1 package network
2
3
4
5
6
7
8
9 import (
10 "context"
11 "encoding/json"
12 "github.com/Azure/go-autorest/autorest"
13 "github.com/Azure/go-autorest/autorest/azure"
14 "github.com/Azure/go-autorest/autorest/date"
15 "github.com/Azure/go-autorest/autorest/to"
16 "github.com/Azure/go-autorest/tracing"
17 "net/http"
18 )
19
20
21 const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-04-01/network"
22
23
24 type AadAuthenticationParameters struct {
25
26 AadTenant *string `json:"aadTenant,omitempty"`
27
28 AadAudience *string `json:"aadAudience,omitempty"`
29
30 AadIssuer *string `json:"aadIssuer,omitempty"`
31 }
32
33
34
35 type AddressSpace struct {
36
37 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"`
38 }
39
40
41 type ApplicationGateway struct {
42 autorest.Response `json:"-"`
43
44 *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"`
45
46 Etag *string `json:"etag,omitempty"`
47
48 Zones *[]string `json:"zones,omitempty"`
49
50 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
51
52 ID *string `json:"id,omitempty"`
53
54 Name *string `json:"name,omitempty"`
55
56 Type *string `json:"type,omitempty"`
57
58 Location *string `json:"location,omitempty"`
59
60 Tags map[string]*string `json:"tags"`
61 }
62
63
64 func (ag ApplicationGateway) MarshalJSON() ([]byte, error) {
65 objectMap := make(map[string]interface{})
66 if ag.ApplicationGatewayPropertiesFormat != nil {
67 objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat
68 }
69 if ag.Zones != nil {
70 objectMap["zones"] = ag.Zones
71 }
72 if ag.Identity != nil {
73 objectMap["identity"] = ag.Identity
74 }
75 if ag.ID != nil {
76 objectMap["id"] = ag.ID
77 }
78 if ag.Location != nil {
79 objectMap["location"] = ag.Location
80 }
81 if ag.Tags != nil {
82 objectMap["tags"] = ag.Tags
83 }
84 return json.Marshal(objectMap)
85 }
86
87
88 func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error {
89 var m map[string]*json.RawMessage
90 err := json.Unmarshal(body, &m)
91 if err != nil {
92 return err
93 }
94 for k, v := range m {
95 switch k {
96 case "properties":
97 if v != nil {
98 var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat
99 err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat)
100 if err != nil {
101 return err
102 }
103 ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat
104 }
105 case "etag":
106 if v != nil {
107 var etag string
108 err = json.Unmarshal(*v, &etag)
109 if err != nil {
110 return err
111 }
112 ag.Etag = &etag
113 }
114 case "zones":
115 if v != nil {
116 var zones []string
117 err = json.Unmarshal(*v, &zones)
118 if err != nil {
119 return err
120 }
121 ag.Zones = &zones
122 }
123 case "identity":
124 if v != nil {
125 var identity ManagedServiceIdentity
126 err = json.Unmarshal(*v, &identity)
127 if err != nil {
128 return err
129 }
130 ag.Identity = &identity
131 }
132 case "id":
133 if v != nil {
134 var ID string
135 err = json.Unmarshal(*v, &ID)
136 if err != nil {
137 return err
138 }
139 ag.ID = &ID
140 }
141 case "name":
142 if v != nil {
143 var name string
144 err = json.Unmarshal(*v, &name)
145 if err != nil {
146 return err
147 }
148 ag.Name = &name
149 }
150 case "type":
151 if v != nil {
152 var typeVar string
153 err = json.Unmarshal(*v, &typeVar)
154 if err != nil {
155 return err
156 }
157 ag.Type = &typeVar
158 }
159 case "location":
160 if v != nil {
161 var location string
162 err = json.Unmarshal(*v, &location)
163 if err != nil {
164 return err
165 }
166 ag.Location = &location
167 }
168 case "tags":
169 if v != nil {
170 var tags map[string]*string
171 err = json.Unmarshal(*v, &tags)
172 if err != nil {
173 return err
174 }
175 ag.Tags = tags
176 }
177 }
178 }
179
180 return nil
181 }
182
183
184 type ApplicationGatewayAuthenticationCertificate struct {
185
186 *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"`
187
188 Name *string `json:"name,omitempty"`
189
190 Etag *string `json:"etag,omitempty"`
191
192 Type *string `json:"type,omitempty"`
193
194 ID *string `json:"id,omitempty"`
195 }
196
197
198 func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) {
199 objectMap := make(map[string]interface{})
200 if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil {
201 objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat
202 }
203 if agac.Name != nil {
204 objectMap["name"] = agac.Name
205 }
206 if agac.ID != nil {
207 objectMap["id"] = agac.ID
208 }
209 return json.Marshal(objectMap)
210 }
211
212
213 func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error {
214 var m map[string]*json.RawMessage
215 err := json.Unmarshal(body, &m)
216 if err != nil {
217 return err
218 }
219 for k, v := range m {
220 switch k {
221 case "properties":
222 if v != nil {
223 var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat
224 err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat)
225 if err != nil {
226 return err
227 }
228 agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat
229 }
230 case "name":
231 if v != nil {
232 var name string
233 err = json.Unmarshal(*v, &name)
234 if err != nil {
235 return err
236 }
237 agac.Name = &name
238 }
239 case "etag":
240 if v != nil {
241 var etag string
242 err = json.Unmarshal(*v, &etag)
243 if err != nil {
244 return err
245 }
246 agac.Etag = &etag
247 }
248 case "type":
249 if v != nil {
250 var typeVar string
251 err = json.Unmarshal(*v, &typeVar)
252 if err != nil {
253 return err
254 }
255 agac.Type = &typeVar
256 }
257 case "id":
258 if v != nil {
259 var ID string
260 err = json.Unmarshal(*v, &ID)
261 if err != nil {
262 return err
263 }
264 agac.ID = &ID
265 }
266 }
267 }
268
269 return nil
270 }
271
272
273
274 type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct {
275
276 Data *string `json:"data,omitempty"`
277
278 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
279 }
280
281
282 func (agacpf ApplicationGatewayAuthenticationCertificatePropertiesFormat) MarshalJSON() ([]byte, error) {
283 objectMap := make(map[string]interface{})
284 if agacpf.Data != nil {
285 objectMap["data"] = agacpf.Data
286 }
287 return json.Marshal(objectMap)
288 }
289
290
291 type ApplicationGatewayAutoscaleConfiguration struct {
292
293 MinCapacity *int32 `json:"minCapacity,omitempty"`
294
295 MaxCapacity *int32 `json:"maxCapacity,omitempty"`
296 }
297
298
299
300 type ApplicationGatewayAvailableSslOptions struct {
301 autorest.Response `json:"-"`
302
303 *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"`
304
305 ID *string `json:"id,omitempty"`
306
307 Name *string `json:"name,omitempty"`
308
309 Type *string `json:"type,omitempty"`
310
311 Location *string `json:"location,omitempty"`
312
313 Tags map[string]*string `json:"tags"`
314 }
315
316
317 func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error) {
318 objectMap := make(map[string]interface{})
319 if agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat != nil {
320 objectMap["properties"] = agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat
321 }
322 if agaso.ID != nil {
323 objectMap["id"] = agaso.ID
324 }
325 if agaso.Location != nil {
326 objectMap["location"] = agaso.Location
327 }
328 if agaso.Tags != nil {
329 objectMap["tags"] = agaso.Tags
330 }
331 return json.Marshal(objectMap)
332 }
333
334
335 func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) error {
336 var m map[string]*json.RawMessage
337 err := json.Unmarshal(body, &m)
338 if err != nil {
339 return err
340 }
341 for k, v := range m {
342 switch k {
343 case "properties":
344 if v != nil {
345 var applicationGatewayAvailableSslOptionsPropertiesFormat ApplicationGatewayAvailableSslOptionsPropertiesFormat
346 err = json.Unmarshal(*v, &applicationGatewayAvailableSslOptionsPropertiesFormat)
347 if err != nil {
348 return err
349 }
350 agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &applicationGatewayAvailableSslOptionsPropertiesFormat
351 }
352 case "id":
353 if v != nil {
354 var ID string
355 err = json.Unmarshal(*v, &ID)
356 if err != nil {
357 return err
358 }
359 agaso.ID = &ID
360 }
361 case "name":
362 if v != nil {
363 var name string
364 err = json.Unmarshal(*v, &name)
365 if err != nil {
366 return err
367 }
368 agaso.Name = &name
369 }
370 case "type":
371 if v != nil {
372 var typeVar string
373 err = json.Unmarshal(*v, &typeVar)
374 if err != nil {
375 return err
376 }
377 agaso.Type = &typeVar
378 }
379 case "location":
380 if v != nil {
381 var location string
382 err = json.Unmarshal(*v, &location)
383 if err != nil {
384 return err
385 }
386 agaso.Location = &location
387 }
388 case "tags":
389 if v != nil {
390 var tags map[string]*string
391 err = json.Unmarshal(*v, &tags)
392 if err != nil {
393 return err
394 }
395 agaso.Tags = tags
396 }
397 }
398 }
399
400 return nil
401 }
402
403
404
405 type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct {
406
407 PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"`
408
409 DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"`
410
411 AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"`
412
413 AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"`
414 }
415
416
417
418 type ApplicationGatewayAvailableSslPredefinedPolicies struct {
419 autorest.Response `json:"-"`
420
421 Value *[]ApplicationGatewaySslPredefinedPolicy `json:"value,omitempty"`
422
423 NextLink *string `json:"nextLink,omitempty"`
424 }
425
426
427
428 type ApplicationGatewayAvailableSslPredefinedPoliciesIterator struct {
429 i int
430 page ApplicationGatewayAvailableSslPredefinedPoliciesPage
431 }
432
433
434
435 func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NextWithContext(ctx context.Context) (err error) {
436 if tracing.IsEnabled() {
437 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesIterator.NextWithContext")
438 defer func() {
439 sc := -1
440 if iter.Response().Response.Response != nil {
441 sc = iter.Response().Response.Response.StatusCode
442 }
443 tracing.EndSpan(ctx, sc, err)
444 }()
445 }
446 iter.i++
447 if iter.i < len(iter.page.Values()) {
448 return nil
449 }
450 err = iter.page.NextWithContext(ctx)
451 if err != nil {
452 iter.i--
453 return err
454 }
455 iter.i = 0
456 return nil
457 }
458
459
460
461
462 func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Next() error {
463 return iter.NextWithContext(context.Background())
464 }
465
466
467 func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NotDone() bool {
468 return iter.page.NotDone() && iter.i < len(iter.page.Values())
469 }
470
471
472 func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Response() ApplicationGatewayAvailableSslPredefinedPolicies {
473 return iter.page.Response()
474 }
475
476
477
478 func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Value() ApplicationGatewaySslPredefinedPolicy {
479 if !iter.page.NotDone() {
480 return ApplicationGatewaySslPredefinedPolicy{}
481 }
482 return iter.page.Values()[iter.i]
483 }
484
485
486 func NewApplicationGatewayAvailableSslPredefinedPoliciesIterator(page ApplicationGatewayAvailableSslPredefinedPoliciesPage) ApplicationGatewayAvailableSslPredefinedPoliciesIterator {
487 return ApplicationGatewayAvailableSslPredefinedPoliciesIterator{page: page}
488 }
489
490
491 func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool {
492 return agaspp.Value == nil || len(*agaspp.Value) == 0
493 }
494
495
496 func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool {
497 return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0
498 }
499
500
501
502 func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) {
503 if !agaspp.hasNextLink() {
504 return nil, nil
505 }
506 return autorest.Prepare((&http.Request{}).WithContext(ctx),
507 autorest.AsJSON(),
508 autorest.AsGet(),
509 autorest.WithBaseURL(to.String(agaspp.NextLink)))
510 }
511
512
513
514 type ApplicationGatewayAvailableSslPredefinedPoliciesPage struct {
515 fn func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)
516 agaspp ApplicationGatewayAvailableSslPredefinedPolicies
517 }
518
519
520
521 func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContext(ctx context.Context) (err error) {
522 if tracing.IsEnabled() {
523 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesPage.NextWithContext")
524 defer func() {
525 sc := -1
526 if page.Response().Response.Response != nil {
527 sc = page.Response().Response.Response.StatusCode
528 }
529 tracing.EndSpan(ctx, sc, err)
530 }()
531 }
532 for {
533 next, err := page.fn(ctx, page.agaspp)
534 if err != nil {
535 return err
536 }
537 page.agaspp = next
538 if !next.hasNextLink() || !next.IsEmpty() {
539 break
540 }
541 }
542 return nil
543 }
544
545
546
547
548 func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) Next() error {
549 return page.NextWithContext(context.Background())
550 }
551
552
553 func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) NotDone() bool {
554 return !page.agaspp.IsEmpty()
555 }
556
557
558 func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Response() ApplicationGatewayAvailableSslPredefinedPolicies {
559 return page.agaspp
560 }
561
562
563 func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []ApplicationGatewaySslPredefinedPolicy {
564 if page.agaspp.IsEmpty() {
565 return nil
566 }
567 return *page.agaspp.Value
568 }
569
570
571 func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(cur ApplicationGatewayAvailableSslPredefinedPolicies, getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage {
572 return ApplicationGatewayAvailableSslPredefinedPoliciesPage{
573 fn: getNextPage,
574 agaspp: cur,
575 }
576 }
577
578
579
580 type ApplicationGatewayAvailableWafRuleSetsResult struct {
581 autorest.Response `json:"-"`
582
583 Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"`
584 }
585
586
587 type ApplicationGatewayBackendAddress struct {
588
589 Fqdn *string `json:"fqdn,omitempty"`
590
591 IPAddress *string `json:"ipAddress,omitempty"`
592 }
593
594
595 type ApplicationGatewayBackendAddressPool struct {
596
597 *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"`
598
599 Name *string `json:"name,omitempty"`
600
601 Etag *string `json:"etag,omitempty"`
602
603 Type *string `json:"type,omitempty"`
604
605 ID *string `json:"id,omitempty"`
606 }
607
608
609 func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) {
610 objectMap := make(map[string]interface{})
611 if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil {
612 objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat
613 }
614 if agbap.Name != nil {
615 objectMap["name"] = agbap.Name
616 }
617 if agbap.ID != nil {
618 objectMap["id"] = agbap.ID
619 }
620 return json.Marshal(objectMap)
621 }
622
623
624 func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error {
625 var m map[string]*json.RawMessage
626 err := json.Unmarshal(body, &m)
627 if err != nil {
628 return err
629 }
630 for k, v := range m {
631 switch k {
632 case "properties":
633 if v != nil {
634 var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat
635 err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat)
636 if err != nil {
637 return err
638 }
639 agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat
640 }
641 case "name":
642 if v != nil {
643 var name string
644 err = json.Unmarshal(*v, &name)
645 if err != nil {
646 return err
647 }
648 agbap.Name = &name
649 }
650 case "etag":
651 if v != nil {
652 var etag string
653 err = json.Unmarshal(*v, &etag)
654 if err != nil {
655 return err
656 }
657 agbap.Etag = &etag
658 }
659 case "type":
660 if v != nil {
661 var typeVar string
662 err = json.Unmarshal(*v, &typeVar)
663 if err != nil {
664 return err
665 }
666 agbap.Type = &typeVar
667 }
668 case "id":
669 if v != nil {
670 var ID string
671 err = json.Unmarshal(*v, &ID)
672 if err != nil {
673 return err
674 }
675 agbap.ID = &ID
676 }
677 }
678 }
679
680 return nil
681 }
682
683
684
685 type ApplicationGatewayBackendAddressPoolPropertiesFormat struct {
686
687 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
688
689 BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"`
690
691 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
692 }
693
694
695 func (agbappf ApplicationGatewayBackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) {
696 objectMap := make(map[string]interface{})
697 if agbappf.BackendAddresses != nil {
698 objectMap["backendAddresses"] = agbappf.BackendAddresses
699 }
700 return json.Marshal(objectMap)
701 }
702
703
704 type ApplicationGatewayBackendHealth struct {
705 autorest.Response `json:"-"`
706
707 BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"`
708 }
709
710
711 type ApplicationGatewayBackendHealthHTTPSettings struct {
712
713 BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"`
714
715 Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"`
716 }
717
718
719 type ApplicationGatewayBackendHealthOnDemand struct {
720 autorest.Response `json:"-"`
721
722 BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"`
723
724 BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"`
725 }
726
727
728 type ApplicationGatewayBackendHealthPool struct {
729
730 BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"`
731
732 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"`
733 }
734
735
736 type ApplicationGatewayBackendHealthServer struct {
737
738 Address *string `json:"address,omitempty"`
739
740 IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"`
741
742 Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"`
743
744 HealthProbeLog *string `json:"healthProbeLog,omitempty"`
745 }
746
747
748 type ApplicationGatewayBackendHTTPSettings struct {
749
750 *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"`
751
752 Name *string `json:"name,omitempty"`
753
754 Etag *string `json:"etag,omitempty"`
755
756 Type *string `json:"type,omitempty"`
757
758 ID *string `json:"id,omitempty"`
759 }
760
761
762 func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) {
763 objectMap := make(map[string]interface{})
764 if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil {
765 objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat
766 }
767 if agbhs.Name != nil {
768 objectMap["name"] = agbhs.Name
769 }
770 if agbhs.ID != nil {
771 objectMap["id"] = agbhs.ID
772 }
773 return json.Marshal(objectMap)
774 }
775
776
777 func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error {
778 var m map[string]*json.RawMessage
779 err := json.Unmarshal(body, &m)
780 if err != nil {
781 return err
782 }
783 for k, v := range m {
784 switch k {
785 case "properties":
786 if v != nil {
787 var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat
788 err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat)
789 if err != nil {
790 return err
791 }
792 agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat
793 }
794 case "name":
795 if v != nil {
796 var name string
797 err = json.Unmarshal(*v, &name)
798 if err != nil {
799 return err
800 }
801 agbhs.Name = &name
802 }
803 case "etag":
804 if v != nil {
805 var etag string
806 err = json.Unmarshal(*v, &etag)
807 if err != nil {
808 return err
809 }
810 agbhs.Etag = &etag
811 }
812 case "type":
813 if v != nil {
814 var typeVar string
815 err = json.Unmarshal(*v, &typeVar)
816 if err != nil {
817 return err
818 }
819 agbhs.Type = &typeVar
820 }
821 case "id":
822 if v != nil {
823 var ID string
824 err = json.Unmarshal(*v, &ID)
825 if err != nil {
826 return err
827 }
828 agbhs.ID = &ID
829 }
830 }
831 }
832
833 return nil
834 }
835
836
837
838 type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct {
839
840 Port *int32 `json:"port,omitempty"`
841
842 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
843
844 CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"`
845
846 RequestTimeout *int32 `json:"requestTimeout,omitempty"`
847
848 Probe *SubResource `json:"probe,omitempty"`
849
850 AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"`
851
852 TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"`
853
854 ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"`
855
856 HostName *string `json:"hostName,omitempty"`
857
858 PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"`
859
860 AffinityCookieName *string `json:"affinityCookieName,omitempty"`
861
862 ProbeEnabled *bool `json:"probeEnabled,omitempty"`
863
864 Path *string `json:"path,omitempty"`
865
866 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
867 }
868
869
870 func (agbhspf ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON() ([]byte, error) {
871 objectMap := make(map[string]interface{})
872 if agbhspf.Port != nil {
873 objectMap["port"] = agbhspf.Port
874 }
875 if agbhspf.Protocol != "" {
876 objectMap["protocol"] = agbhspf.Protocol
877 }
878 if agbhspf.CookieBasedAffinity != "" {
879 objectMap["cookieBasedAffinity"] = agbhspf.CookieBasedAffinity
880 }
881 if agbhspf.RequestTimeout != nil {
882 objectMap["requestTimeout"] = agbhspf.RequestTimeout
883 }
884 if agbhspf.Probe != nil {
885 objectMap["probe"] = agbhspf.Probe
886 }
887 if agbhspf.AuthenticationCertificates != nil {
888 objectMap["authenticationCertificates"] = agbhspf.AuthenticationCertificates
889 }
890 if agbhspf.TrustedRootCertificates != nil {
891 objectMap["trustedRootCertificates"] = agbhspf.TrustedRootCertificates
892 }
893 if agbhspf.ConnectionDraining != nil {
894 objectMap["connectionDraining"] = agbhspf.ConnectionDraining
895 }
896 if agbhspf.HostName != nil {
897 objectMap["hostName"] = agbhspf.HostName
898 }
899 if agbhspf.PickHostNameFromBackendAddress != nil {
900 objectMap["pickHostNameFromBackendAddress"] = agbhspf.PickHostNameFromBackendAddress
901 }
902 if agbhspf.AffinityCookieName != nil {
903 objectMap["affinityCookieName"] = agbhspf.AffinityCookieName
904 }
905 if agbhspf.ProbeEnabled != nil {
906 objectMap["probeEnabled"] = agbhspf.ProbeEnabled
907 }
908 if agbhspf.Path != nil {
909 objectMap["path"] = agbhspf.Path
910 }
911 return json.Marshal(objectMap)
912 }
913
914
915
916 type ApplicationGatewayConnectionDraining struct {
917
918 Enabled *bool `json:"enabled,omitempty"`
919
920 DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"`
921 }
922
923
924 type ApplicationGatewayCustomError struct {
925
926 StatusCode ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"`
927
928 CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"`
929 }
930
931
932
933 type ApplicationGatewayFirewallDisabledRuleGroup struct {
934
935 RuleGroupName *string `json:"ruleGroupName,omitempty"`
936
937 Rules *[]int32 `json:"rules,omitempty"`
938 }
939
940
941
942 type ApplicationGatewayFirewallExclusion struct {
943
944 MatchVariable *string `json:"matchVariable,omitempty"`
945
946 SelectorMatchOperator *string `json:"selectorMatchOperator,omitempty"`
947
948 Selector *string `json:"selector,omitempty"`
949 }
950
951
952 type ApplicationGatewayFirewallRule struct {
953
954 RuleID *int32 `json:"ruleId,omitempty"`
955
956 Description *string `json:"description,omitempty"`
957 }
958
959
960 type ApplicationGatewayFirewallRuleGroup struct {
961
962 RuleGroupName *string `json:"ruleGroupName,omitempty"`
963
964 Description *string `json:"description,omitempty"`
965
966 Rules *[]ApplicationGatewayFirewallRule `json:"rules,omitempty"`
967 }
968
969
970 type ApplicationGatewayFirewallRuleSet struct {
971
972 *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"`
973
974 ID *string `json:"id,omitempty"`
975
976 Name *string `json:"name,omitempty"`
977
978 Type *string `json:"type,omitempty"`
979
980 Location *string `json:"location,omitempty"`
981
982 Tags map[string]*string `json:"tags"`
983 }
984
985
986 func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) {
987 objectMap := make(map[string]interface{})
988 if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil {
989 objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat
990 }
991 if agfrs.ID != nil {
992 objectMap["id"] = agfrs.ID
993 }
994 if agfrs.Location != nil {
995 objectMap["location"] = agfrs.Location
996 }
997 if agfrs.Tags != nil {
998 objectMap["tags"] = agfrs.Tags
999 }
1000 return json.Marshal(objectMap)
1001 }
1002
1003
1004 func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error {
1005 var m map[string]*json.RawMessage
1006 err := json.Unmarshal(body, &m)
1007 if err != nil {
1008 return err
1009 }
1010 for k, v := range m {
1011 switch k {
1012 case "properties":
1013 if v != nil {
1014 var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat
1015 err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat)
1016 if err != nil {
1017 return err
1018 }
1019 agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat
1020 }
1021 case "id":
1022 if v != nil {
1023 var ID string
1024 err = json.Unmarshal(*v, &ID)
1025 if err != nil {
1026 return err
1027 }
1028 agfrs.ID = &ID
1029 }
1030 case "name":
1031 if v != nil {
1032 var name string
1033 err = json.Unmarshal(*v, &name)
1034 if err != nil {
1035 return err
1036 }
1037 agfrs.Name = &name
1038 }
1039 case "type":
1040 if v != nil {
1041 var typeVar string
1042 err = json.Unmarshal(*v, &typeVar)
1043 if err != nil {
1044 return err
1045 }
1046 agfrs.Type = &typeVar
1047 }
1048 case "location":
1049 if v != nil {
1050 var location string
1051 err = json.Unmarshal(*v, &location)
1052 if err != nil {
1053 return err
1054 }
1055 agfrs.Location = &location
1056 }
1057 case "tags":
1058 if v != nil {
1059 var tags map[string]*string
1060 err = json.Unmarshal(*v, &tags)
1061 if err != nil {
1062 return err
1063 }
1064 agfrs.Tags = tags
1065 }
1066 }
1067 }
1068
1069 return nil
1070 }
1071
1072
1073 type ApplicationGatewayFirewallRuleSetPropertiesFormat struct {
1074
1075 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1076
1077 RuleSetType *string `json:"ruleSetType,omitempty"`
1078
1079 RuleSetVersion *string `json:"ruleSetVersion,omitempty"`
1080
1081 RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"`
1082 }
1083
1084
1085 func (agfrspf ApplicationGatewayFirewallRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) {
1086 objectMap := make(map[string]interface{})
1087 if agfrspf.RuleSetType != nil {
1088 objectMap["ruleSetType"] = agfrspf.RuleSetType
1089 }
1090 if agfrspf.RuleSetVersion != nil {
1091 objectMap["ruleSetVersion"] = agfrspf.RuleSetVersion
1092 }
1093 if agfrspf.RuleGroups != nil {
1094 objectMap["ruleGroups"] = agfrspf.RuleGroups
1095 }
1096 return json.Marshal(objectMap)
1097 }
1098
1099
1100 type ApplicationGatewayFrontendIPConfiguration struct {
1101
1102 *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"`
1103
1104 Name *string `json:"name,omitempty"`
1105
1106 Etag *string `json:"etag,omitempty"`
1107
1108 Type *string `json:"type,omitempty"`
1109
1110 ID *string `json:"id,omitempty"`
1111 }
1112
1113
1114 func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) {
1115 objectMap := make(map[string]interface{})
1116 if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil {
1117 objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat
1118 }
1119 if agfic.Name != nil {
1120 objectMap["name"] = agfic.Name
1121 }
1122 if agfic.ID != nil {
1123 objectMap["id"] = agfic.ID
1124 }
1125 return json.Marshal(objectMap)
1126 }
1127
1128
1129 func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error {
1130 var m map[string]*json.RawMessage
1131 err := json.Unmarshal(body, &m)
1132 if err != nil {
1133 return err
1134 }
1135 for k, v := range m {
1136 switch k {
1137 case "properties":
1138 if v != nil {
1139 var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat
1140 err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat)
1141 if err != nil {
1142 return err
1143 }
1144 agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat
1145 }
1146 case "name":
1147 if v != nil {
1148 var name string
1149 err = json.Unmarshal(*v, &name)
1150 if err != nil {
1151 return err
1152 }
1153 agfic.Name = &name
1154 }
1155 case "etag":
1156 if v != nil {
1157 var etag string
1158 err = json.Unmarshal(*v, &etag)
1159 if err != nil {
1160 return err
1161 }
1162 agfic.Etag = &etag
1163 }
1164 case "type":
1165 if v != nil {
1166 var typeVar string
1167 err = json.Unmarshal(*v, &typeVar)
1168 if err != nil {
1169 return err
1170 }
1171 agfic.Type = &typeVar
1172 }
1173 case "id":
1174 if v != nil {
1175 var ID string
1176 err = json.Unmarshal(*v, &ID)
1177 if err != nil {
1178 return err
1179 }
1180 agfic.ID = &ID
1181 }
1182 }
1183 }
1184
1185 return nil
1186 }
1187
1188
1189
1190 type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct {
1191
1192 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
1193
1194 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
1195
1196 Subnet *SubResource `json:"subnet,omitempty"`
1197
1198 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
1199
1200 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1201 }
1202
1203
1204 func (agficpf ApplicationGatewayFrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
1205 objectMap := make(map[string]interface{})
1206 if agficpf.PrivateIPAddress != nil {
1207 objectMap["privateIPAddress"] = agficpf.PrivateIPAddress
1208 }
1209 if agficpf.PrivateIPAllocationMethod != "" {
1210 objectMap["privateIPAllocationMethod"] = agficpf.PrivateIPAllocationMethod
1211 }
1212 if agficpf.Subnet != nil {
1213 objectMap["subnet"] = agficpf.Subnet
1214 }
1215 if agficpf.PublicIPAddress != nil {
1216 objectMap["publicIPAddress"] = agficpf.PublicIPAddress
1217 }
1218 return json.Marshal(objectMap)
1219 }
1220
1221
1222 type ApplicationGatewayFrontendPort struct {
1223
1224 *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"`
1225
1226 Name *string `json:"name,omitempty"`
1227
1228 Etag *string `json:"etag,omitempty"`
1229
1230 Type *string `json:"type,omitempty"`
1231
1232 ID *string `json:"id,omitempty"`
1233 }
1234
1235
1236 func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) {
1237 objectMap := make(map[string]interface{})
1238 if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil {
1239 objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat
1240 }
1241 if agfp.Name != nil {
1242 objectMap["name"] = agfp.Name
1243 }
1244 if agfp.ID != nil {
1245 objectMap["id"] = agfp.ID
1246 }
1247 return json.Marshal(objectMap)
1248 }
1249
1250
1251 func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error {
1252 var m map[string]*json.RawMessage
1253 err := json.Unmarshal(body, &m)
1254 if err != nil {
1255 return err
1256 }
1257 for k, v := range m {
1258 switch k {
1259 case "properties":
1260 if v != nil {
1261 var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat
1262 err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat)
1263 if err != nil {
1264 return err
1265 }
1266 agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat
1267 }
1268 case "name":
1269 if v != nil {
1270 var name string
1271 err = json.Unmarshal(*v, &name)
1272 if err != nil {
1273 return err
1274 }
1275 agfp.Name = &name
1276 }
1277 case "etag":
1278 if v != nil {
1279 var etag string
1280 err = json.Unmarshal(*v, &etag)
1281 if err != nil {
1282 return err
1283 }
1284 agfp.Etag = &etag
1285 }
1286 case "type":
1287 if v != nil {
1288 var typeVar string
1289 err = json.Unmarshal(*v, &typeVar)
1290 if err != nil {
1291 return err
1292 }
1293 agfp.Type = &typeVar
1294 }
1295 case "id":
1296 if v != nil {
1297 var ID string
1298 err = json.Unmarshal(*v, &ID)
1299 if err != nil {
1300 return err
1301 }
1302 agfp.ID = &ID
1303 }
1304 }
1305 }
1306
1307 return nil
1308 }
1309
1310
1311 type ApplicationGatewayFrontendPortPropertiesFormat struct {
1312
1313 Port *int32 `json:"port,omitempty"`
1314
1315 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1316 }
1317
1318
1319 func (agfppf ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]byte, error) {
1320 objectMap := make(map[string]interface{})
1321 if agfppf.Port != nil {
1322 objectMap["port"] = agfppf.Port
1323 }
1324 return json.Marshal(objectMap)
1325 }
1326
1327
1328 type ApplicationGatewayHeaderConfiguration struct {
1329
1330 HeaderName *string `json:"headerName,omitempty"`
1331
1332 HeaderValue *string `json:"headerValue,omitempty"`
1333 }
1334
1335
1336 type ApplicationGatewayHTTPListener struct {
1337
1338 *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"`
1339
1340 Name *string `json:"name,omitempty"`
1341
1342 Etag *string `json:"etag,omitempty"`
1343
1344 Type *string `json:"type,omitempty"`
1345
1346 ID *string `json:"id,omitempty"`
1347 }
1348
1349
1350 func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) {
1351 objectMap := make(map[string]interface{})
1352 if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil {
1353 objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat
1354 }
1355 if aghl.Name != nil {
1356 objectMap["name"] = aghl.Name
1357 }
1358 if aghl.ID != nil {
1359 objectMap["id"] = aghl.ID
1360 }
1361 return json.Marshal(objectMap)
1362 }
1363
1364
1365 func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error {
1366 var m map[string]*json.RawMessage
1367 err := json.Unmarshal(body, &m)
1368 if err != nil {
1369 return err
1370 }
1371 for k, v := range m {
1372 switch k {
1373 case "properties":
1374 if v != nil {
1375 var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat
1376 err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat)
1377 if err != nil {
1378 return err
1379 }
1380 aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat
1381 }
1382 case "name":
1383 if v != nil {
1384 var name string
1385 err = json.Unmarshal(*v, &name)
1386 if err != nil {
1387 return err
1388 }
1389 aghl.Name = &name
1390 }
1391 case "etag":
1392 if v != nil {
1393 var etag string
1394 err = json.Unmarshal(*v, &etag)
1395 if err != nil {
1396 return err
1397 }
1398 aghl.Etag = &etag
1399 }
1400 case "type":
1401 if v != nil {
1402 var typeVar string
1403 err = json.Unmarshal(*v, &typeVar)
1404 if err != nil {
1405 return err
1406 }
1407 aghl.Type = &typeVar
1408 }
1409 case "id":
1410 if v != nil {
1411 var ID string
1412 err = json.Unmarshal(*v, &ID)
1413 if err != nil {
1414 return err
1415 }
1416 aghl.ID = &ID
1417 }
1418 }
1419 }
1420
1421 return nil
1422 }
1423
1424
1425 type ApplicationGatewayHTTPListenerPropertiesFormat struct {
1426
1427 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
1428
1429 FrontendPort *SubResource `json:"frontendPort,omitempty"`
1430
1431 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
1432
1433 HostName *string `json:"hostName,omitempty"`
1434
1435 SslCertificate *SubResource `json:"sslCertificate,omitempty"`
1436
1437 RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"`
1438
1439 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1440
1441 CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"`
1442
1443 FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"`
1444
1445 HostNames *[]string `json:"hostNames,omitempty"`
1446 }
1447
1448
1449 func (aghlpf ApplicationGatewayHTTPListenerPropertiesFormat) MarshalJSON() ([]byte, error) {
1450 objectMap := make(map[string]interface{})
1451 if aghlpf.FrontendIPConfiguration != nil {
1452 objectMap["frontendIPConfiguration"] = aghlpf.FrontendIPConfiguration
1453 }
1454 if aghlpf.FrontendPort != nil {
1455 objectMap["frontendPort"] = aghlpf.FrontendPort
1456 }
1457 if aghlpf.Protocol != "" {
1458 objectMap["protocol"] = aghlpf.Protocol
1459 }
1460 if aghlpf.HostName != nil {
1461 objectMap["hostName"] = aghlpf.HostName
1462 }
1463 if aghlpf.SslCertificate != nil {
1464 objectMap["sslCertificate"] = aghlpf.SslCertificate
1465 }
1466 if aghlpf.RequireServerNameIndication != nil {
1467 objectMap["requireServerNameIndication"] = aghlpf.RequireServerNameIndication
1468 }
1469 if aghlpf.CustomErrorConfigurations != nil {
1470 objectMap["customErrorConfigurations"] = aghlpf.CustomErrorConfigurations
1471 }
1472 if aghlpf.FirewallPolicy != nil {
1473 objectMap["firewallPolicy"] = aghlpf.FirewallPolicy
1474 }
1475 if aghlpf.HostNames != nil {
1476 objectMap["hostNames"] = aghlpf.HostNames
1477 }
1478 return json.Marshal(objectMap)
1479 }
1480
1481
1482
1483 type ApplicationGatewayIPConfiguration struct {
1484
1485 *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"`
1486
1487 Name *string `json:"name,omitempty"`
1488
1489 Etag *string `json:"etag,omitempty"`
1490
1491 Type *string `json:"type,omitempty"`
1492
1493 ID *string `json:"id,omitempty"`
1494 }
1495
1496
1497 func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) {
1498 objectMap := make(map[string]interface{})
1499 if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil {
1500 objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat
1501 }
1502 if agic.Name != nil {
1503 objectMap["name"] = agic.Name
1504 }
1505 if agic.ID != nil {
1506 objectMap["id"] = agic.ID
1507 }
1508 return json.Marshal(objectMap)
1509 }
1510
1511
1512 func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error {
1513 var m map[string]*json.RawMessage
1514 err := json.Unmarshal(body, &m)
1515 if err != nil {
1516 return err
1517 }
1518 for k, v := range m {
1519 switch k {
1520 case "properties":
1521 if v != nil {
1522 var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat
1523 err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat)
1524 if err != nil {
1525 return err
1526 }
1527 agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat
1528 }
1529 case "name":
1530 if v != nil {
1531 var name string
1532 err = json.Unmarshal(*v, &name)
1533 if err != nil {
1534 return err
1535 }
1536 agic.Name = &name
1537 }
1538 case "etag":
1539 if v != nil {
1540 var etag string
1541 err = json.Unmarshal(*v, &etag)
1542 if err != nil {
1543 return err
1544 }
1545 agic.Etag = &etag
1546 }
1547 case "type":
1548 if v != nil {
1549 var typeVar string
1550 err = json.Unmarshal(*v, &typeVar)
1551 if err != nil {
1552 return err
1553 }
1554 agic.Type = &typeVar
1555 }
1556 case "id":
1557 if v != nil {
1558 var ID string
1559 err = json.Unmarshal(*v, &ID)
1560 if err != nil {
1561 return err
1562 }
1563 agic.ID = &ID
1564 }
1565 }
1566 }
1567
1568 return nil
1569 }
1570
1571
1572
1573 type ApplicationGatewayIPConfigurationPropertiesFormat struct {
1574
1575 Subnet *SubResource `json:"subnet,omitempty"`
1576
1577 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1578 }
1579
1580
1581 func (agicpf ApplicationGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
1582 objectMap := make(map[string]interface{})
1583 if agicpf.Subnet != nil {
1584 objectMap["subnet"] = agicpf.Subnet
1585 }
1586 return json.Marshal(objectMap)
1587 }
1588
1589
1590 type ApplicationGatewayListResult struct {
1591 autorest.Response `json:"-"`
1592
1593 Value *[]ApplicationGateway `json:"value,omitempty"`
1594
1595 NextLink *string `json:"nextLink,omitempty"`
1596 }
1597
1598
1599 type ApplicationGatewayListResultIterator struct {
1600 i int
1601 page ApplicationGatewayListResultPage
1602 }
1603
1604
1605
1606 func (iter *ApplicationGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) {
1607 if tracing.IsEnabled() {
1608 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultIterator.NextWithContext")
1609 defer func() {
1610 sc := -1
1611 if iter.Response().Response.Response != nil {
1612 sc = iter.Response().Response.Response.StatusCode
1613 }
1614 tracing.EndSpan(ctx, sc, err)
1615 }()
1616 }
1617 iter.i++
1618 if iter.i < len(iter.page.Values()) {
1619 return nil
1620 }
1621 err = iter.page.NextWithContext(ctx)
1622 if err != nil {
1623 iter.i--
1624 return err
1625 }
1626 iter.i = 0
1627 return nil
1628 }
1629
1630
1631
1632
1633 func (iter *ApplicationGatewayListResultIterator) Next() error {
1634 return iter.NextWithContext(context.Background())
1635 }
1636
1637
1638 func (iter ApplicationGatewayListResultIterator) NotDone() bool {
1639 return iter.page.NotDone() && iter.i < len(iter.page.Values())
1640 }
1641
1642
1643 func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult {
1644 return iter.page.Response()
1645 }
1646
1647
1648
1649 func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway {
1650 if !iter.page.NotDone() {
1651 return ApplicationGateway{}
1652 }
1653 return iter.page.Values()[iter.i]
1654 }
1655
1656
1657 func NewApplicationGatewayListResultIterator(page ApplicationGatewayListResultPage) ApplicationGatewayListResultIterator {
1658 return ApplicationGatewayListResultIterator{page: page}
1659 }
1660
1661
1662 func (aglr ApplicationGatewayListResult) IsEmpty() bool {
1663 return aglr.Value == nil || len(*aglr.Value) == 0
1664 }
1665
1666
1667 func (aglr ApplicationGatewayListResult) hasNextLink() bool {
1668 return aglr.NextLink != nil && len(*aglr.NextLink) != 0
1669 }
1670
1671
1672
1673 func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) {
1674 if !aglr.hasNextLink() {
1675 return nil, nil
1676 }
1677 return autorest.Prepare((&http.Request{}).WithContext(ctx),
1678 autorest.AsJSON(),
1679 autorest.AsGet(),
1680 autorest.WithBaseURL(to.String(aglr.NextLink)))
1681 }
1682
1683
1684 type ApplicationGatewayListResultPage struct {
1685 fn func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)
1686 aglr ApplicationGatewayListResult
1687 }
1688
1689
1690
1691 func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Context) (err error) {
1692 if tracing.IsEnabled() {
1693 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultPage.NextWithContext")
1694 defer func() {
1695 sc := -1
1696 if page.Response().Response.Response != nil {
1697 sc = page.Response().Response.Response.StatusCode
1698 }
1699 tracing.EndSpan(ctx, sc, err)
1700 }()
1701 }
1702 for {
1703 next, err := page.fn(ctx, page.aglr)
1704 if err != nil {
1705 return err
1706 }
1707 page.aglr = next
1708 if !next.hasNextLink() || !next.IsEmpty() {
1709 break
1710 }
1711 }
1712 return nil
1713 }
1714
1715
1716
1717
1718 func (page *ApplicationGatewayListResultPage) Next() error {
1719 return page.NextWithContext(context.Background())
1720 }
1721
1722
1723 func (page ApplicationGatewayListResultPage) NotDone() bool {
1724 return !page.aglr.IsEmpty()
1725 }
1726
1727
1728 func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult {
1729 return page.aglr
1730 }
1731
1732
1733 func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway {
1734 if page.aglr.IsEmpty() {
1735 return nil
1736 }
1737 return *page.aglr.Value
1738 }
1739
1740
1741 func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage {
1742 return ApplicationGatewayListResultPage{
1743 fn: getNextPage,
1744 aglr: cur,
1745 }
1746 }
1747
1748
1749 type ApplicationGatewayOnDemandProbe struct {
1750
1751 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
1752
1753 Host *string `json:"host,omitempty"`
1754
1755 Path *string `json:"path,omitempty"`
1756
1757 Timeout *int32 `json:"timeout,omitempty"`
1758
1759 PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"`
1760
1761 Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"`
1762
1763 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
1764
1765 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"`
1766 }
1767
1768
1769 type ApplicationGatewayPathRule struct {
1770
1771 *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"`
1772
1773 Name *string `json:"name,omitempty"`
1774
1775 Etag *string `json:"etag,omitempty"`
1776
1777 Type *string `json:"type,omitempty"`
1778
1779 ID *string `json:"id,omitempty"`
1780 }
1781
1782
1783 func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) {
1784 objectMap := make(map[string]interface{})
1785 if agpr.ApplicationGatewayPathRulePropertiesFormat != nil {
1786 objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat
1787 }
1788 if agpr.Name != nil {
1789 objectMap["name"] = agpr.Name
1790 }
1791 if agpr.ID != nil {
1792 objectMap["id"] = agpr.ID
1793 }
1794 return json.Marshal(objectMap)
1795 }
1796
1797
1798 func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error {
1799 var m map[string]*json.RawMessage
1800 err := json.Unmarshal(body, &m)
1801 if err != nil {
1802 return err
1803 }
1804 for k, v := range m {
1805 switch k {
1806 case "properties":
1807 if v != nil {
1808 var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat
1809 err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat)
1810 if err != nil {
1811 return err
1812 }
1813 agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat
1814 }
1815 case "name":
1816 if v != nil {
1817 var name string
1818 err = json.Unmarshal(*v, &name)
1819 if err != nil {
1820 return err
1821 }
1822 agpr.Name = &name
1823 }
1824 case "etag":
1825 if v != nil {
1826 var etag string
1827 err = json.Unmarshal(*v, &etag)
1828 if err != nil {
1829 return err
1830 }
1831 agpr.Etag = &etag
1832 }
1833 case "type":
1834 if v != nil {
1835 var typeVar string
1836 err = json.Unmarshal(*v, &typeVar)
1837 if err != nil {
1838 return err
1839 }
1840 agpr.Type = &typeVar
1841 }
1842 case "id":
1843 if v != nil {
1844 var ID string
1845 err = json.Unmarshal(*v, &ID)
1846 if err != nil {
1847 return err
1848 }
1849 agpr.ID = &ID
1850 }
1851 }
1852 }
1853
1854 return nil
1855 }
1856
1857
1858 type ApplicationGatewayPathRulePropertiesFormat struct {
1859
1860 Paths *[]string `json:"paths,omitempty"`
1861
1862 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
1863
1864 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"`
1865
1866 RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"`
1867
1868 RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"`
1869
1870 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1871
1872 FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"`
1873 }
1874
1875
1876 func (agprpf ApplicationGatewayPathRulePropertiesFormat) MarshalJSON() ([]byte, error) {
1877 objectMap := make(map[string]interface{})
1878 if agprpf.Paths != nil {
1879 objectMap["paths"] = agprpf.Paths
1880 }
1881 if agprpf.BackendAddressPool != nil {
1882 objectMap["backendAddressPool"] = agprpf.BackendAddressPool
1883 }
1884 if agprpf.BackendHTTPSettings != nil {
1885 objectMap["backendHttpSettings"] = agprpf.BackendHTTPSettings
1886 }
1887 if agprpf.RedirectConfiguration != nil {
1888 objectMap["redirectConfiguration"] = agprpf.RedirectConfiguration
1889 }
1890 if agprpf.RewriteRuleSet != nil {
1891 objectMap["rewriteRuleSet"] = agprpf.RewriteRuleSet
1892 }
1893 if agprpf.FirewallPolicy != nil {
1894 objectMap["firewallPolicy"] = agprpf.FirewallPolicy
1895 }
1896 return json.Marshal(objectMap)
1897 }
1898
1899
1900 type ApplicationGatewayProbe struct {
1901
1902 *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"`
1903
1904 Name *string `json:"name,omitempty"`
1905
1906 Etag *string `json:"etag,omitempty"`
1907
1908 Type *string `json:"type,omitempty"`
1909
1910 ID *string `json:"id,omitempty"`
1911 }
1912
1913
1914 func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) {
1915 objectMap := make(map[string]interface{})
1916 if agp.ApplicationGatewayProbePropertiesFormat != nil {
1917 objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat
1918 }
1919 if agp.Name != nil {
1920 objectMap["name"] = agp.Name
1921 }
1922 if agp.ID != nil {
1923 objectMap["id"] = agp.ID
1924 }
1925 return json.Marshal(objectMap)
1926 }
1927
1928
1929 func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error {
1930 var m map[string]*json.RawMessage
1931 err := json.Unmarshal(body, &m)
1932 if err != nil {
1933 return err
1934 }
1935 for k, v := range m {
1936 switch k {
1937 case "properties":
1938 if v != nil {
1939 var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat
1940 err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat)
1941 if err != nil {
1942 return err
1943 }
1944 agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat
1945 }
1946 case "name":
1947 if v != nil {
1948 var name string
1949 err = json.Unmarshal(*v, &name)
1950 if err != nil {
1951 return err
1952 }
1953 agp.Name = &name
1954 }
1955 case "etag":
1956 if v != nil {
1957 var etag string
1958 err = json.Unmarshal(*v, &etag)
1959 if err != nil {
1960 return err
1961 }
1962 agp.Etag = &etag
1963 }
1964 case "type":
1965 if v != nil {
1966 var typeVar string
1967 err = json.Unmarshal(*v, &typeVar)
1968 if err != nil {
1969 return err
1970 }
1971 agp.Type = &typeVar
1972 }
1973 case "id":
1974 if v != nil {
1975 var ID string
1976 err = json.Unmarshal(*v, &ID)
1977 if err != nil {
1978 return err
1979 }
1980 agp.ID = &ID
1981 }
1982 }
1983 }
1984
1985 return nil
1986 }
1987
1988
1989 type ApplicationGatewayProbeHealthResponseMatch struct {
1990
1991 Body *string `json:"body,omitempty"`
1992
1993 StatusCodes *[]string `json:"statusCodes,omitempty"`
1994 }
1995
1996
1997 type ApplicationGatewayProbePropertiesFormat struct {
1998
1999 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
2000
2001 Host *string `json:"host,omitempty"`
2002
2003 Path *string `json:"path,omitempty"`
2004
2005 Interval *int32 `json:"interval,omitempty"`
2006
2007 Timeout *int32 `json:"timeout,omitempty"`
2008
2009 UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"`
2010
2011 PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"`
2012
2013 MinServers *int32 `json:"minServers,omitempty"`
2014
2015 Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"`
2016
2017 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2018
2019 Port *int32 `json:"port,omitempty"`
2020 }
2021
2022
2023 func (agppf ApplicationGatewayProbePropertiesFormat) MarshalJSON() ([]byte, error) {
2024 objectMap := make(map[string]interface{})
2025 if agppf.Protocol != "" {
2026 objectMap["protocol"] = agppf.Protocol
2027 }
2028 if agppf.Host != nil {
2029 objectMap["host"] = agppf.Host
2030 }
2031 if agppf.Path != nil {
2032 objectMap["path"] = agppf.Path
2033 }
2034 if agppf.Interval != nil {
2035 objectMap["interval"] = agppf.Interval
2036 }
2037 if agppf.Timeout != nil {
2038 objectMap["timeout"] = agppf.Timeout
2039 }
2040 if agppf.UnhealthyThreshold != nil {
2041 objectMap["unhealthyThreshold"] = agppf.UnhealthyThreshold
2042 }
2043 if agppf.PickHostNameFromBackendHTTPSettings != nil {
2044 objectMap["pickHostNameFromBackendHttpSettings"] = agppf.PickHostNameFromBackendHTTPSettings
2045 }
2046 if agppf.MinServers != nil {
2047 objectMap["minServers"] = agppf.MinServers
2048 }
2049 if agppf.Match != nil {
2050 objectMap["match"] = agppf.Match
2051 }
2052 if agppf.Port != nil {
2053 objectMap["port"] = agppf.Port
2054 }
2055 return json.Marshal(objectMap)
2056 }
2057
2058
2059 type ApplicationGatewayPropertiesFormat struct {
2060
2061 Sku *ApplicationGatewaySku `json:"sku,omitempty"`
2062
2063 SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"`
2064
2065 OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"`
2066
2067 GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"`
2068
2069 AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"`
2070
2071 TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"`
2072
2073 SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"`
2074
2075 FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
2076
2077 FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"`
2078
2079 Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"`
2080
2081 BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"`
2082
2083 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"`
2084
2085 HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"`
2086
2087 URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"`
2088
2089 RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"`
2090
2091 RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"`
2092
2093 RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"`
2094
2095 WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"`
2096
2097 FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"`
2098
2099 EnableHTTP2 *bool `json:"enableHttp2,omitempty"`
2100
2101 EnableFips *bool `json:"enableFips,omitempty"`
2102
2103 AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"`
2104
2105 ResourceGUID *string `json:"resourceGuid,omitempty"`
2106
2107 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2108
2109 CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"`
2110
2111 ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"`
2112 }
2113
2114
2115 func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) {
2116 objectMap := make(map[string]interface{})
2117 if agpf.Sku != nil {
2118 objectMap["sku"] = agpf.Sku
2119 }
2120 if agpf.SslPolicy != nil {
2121 objectMap["sslPolicy"] = agpf.SslPolicy
2122 }
2123 if agpf.GatewayIPConfigurations != nil {
2124 objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations
2125 }
2126 if agpf.AuthenticationCertificates != nil {
2127 objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates
2128 }
2129 if agpf.TrustedRootCertificates != nil {
2130 objectMap["trustedRootCertificates"] = agpf.TrustedRootCertificates
2131 }
2132 if agpf.SslCertificates != nil {
2133 objectMap["sslCertificates"] = agpf.SslCertificates
2134 }
2135 if agpf.FrontendIPConfigurations != nil {
2136 objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations
2137 }
2138 if agpf.FrontendPorts != nil {
2139 objectMap["frontendPorts"] = agpf.FrontendPorts
2140 }
2141 if agpf.Probes != nil {
2142 objectMap["probes"] = agpf.Probes
2143 }
2144 if agpf.BackendAddressPools != nil {
2145 objectMap["backendAddressPools"] = agpf.BackendAddressPools
2146 }
2147 if agpf.BackendHTTPSettingsCollection != nil {
2148 objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection
2149 }
2150 if agpf.HTTPListeners != nil {
2151 objectMap["httpListeners"] = agpf.HTTPListeners
2152 }
2153 if agpf.URLPathMaps != nil {
2154 objectMap["urlPathMaps"] = agpf.URLPathMaps
2155 }
2156 if agpf.RequestRoutingRules != nil {
2157 objectMap["requestRoutingRules"] = agpf.RequestRoutingRules
2158 }
2159 if agpf.RewriteRuleSets != nil {
2160 objectMap["rewriteRuleSets"] = agpf.RewriteRuleSets
2161 }
2162 if agpf.RedirectConfigurations != nil {
2163 objectMap["redirectConfigurations"] = agpf.RedirectConfigurations
2164 }
2165 if agpf.WebApplicationFirewallConfiguration != nil {
2166 objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration
2167 }
2168 if agpf.FirewallPolicy != nil {
2169 objectMap["firewallPolicy"] = agpf.FirewallPolicy
2170 }
2171 if agpf.EnableHTTP2 != nil {
2172 objectMap["enableHttp2"] = agpf.EnableHTTP2
2173 }
2174 if agpf.EnableFips != nil {
2175 objectMap["enableFips"] = agpf.EnableFips
2176 }
2177 if agpf.AutoscaleConfiguration != nil {
2178 objectMap["autoscaleConfiguration"] = agpf.AutoscaleConfiguration
2179 }
2180 if agpf.CustomErrorConfigurations != nil {
2181 objectMap["customErrorConfigurations"] = agpf.CustomErrorConfigurations
2182 }
2183 if agpf.ForceFirewallPolicyAssociation != nil {
2184 objectMap["forceFirewallPolicyAssociation"] = agpf.ForceFirewallPolicyAssociation
2185 }
2186 return json.Marshal(objectMap)
2187 }
2188
2189
2190 type ApplicationGatewayRedirectConfiguration struct {
2191
2192 *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"`
2193
2194 Name *string `json:"name,omitempty"`
2195
2196 Etag *string `json:"etag,omitempty"`
2197
2198 Type *string `json:"type,omitempty"`
2199
2200 ID *string `json:"id,omitempty"`
2201 }
2202
2203
2204 func (agrc ApplicationGatewayRedirectConfiguration) MarshalJSON() ([]byte, error) {
2205 objectMap := make(map[string]interface{})
2206 if agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat != nil {
2207 objectMap["properties"] = agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat
2208 }
2209 if agrc.Name != nil {
2210 objectMap["name"] = agrc.Name
2211 }
2212 if agrc.ID != nil {
2213 objectMap["id"] = agrc.ID
2214 }
2215 return json.Marshal(objectMap)
2216 }
2217
2218
2219 func (agrc *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(body []byte) error {
2220 var m map[string]*json.RawMessage
2221 err := json.Unmarshal(body, &m)
2222 if err != nil {
2223 return err
2224 }
2225 for k, v := range m {
2226 switch k {
2227 case "properties":
2228 if v != nil {
2229 var applicationGatewayRedirectConfigurationPropertiesFormat ApplicationGatewayRedirectConfigurationPropertiesFormat
2230 err = json.Unmarshal(*v, &applicationGatewayRedirectConfigurationPropertiesFormat)
2231 if err != nil {
2232 return err
2233 }
2234 agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat = &applicationGatewayRedirectConfigurationPropertiesFormat
2235 }
2236 case "name":
2237 if v != nil {
2238 var name string
2239 err = json.Unmarshal(*v, &name)
2240 if err != nil {
2241 return err
2242 }
2243 agrc.Name = &name
2244 }
2245 case "etag":
2246 if v != nil {
2247 var etag string
2248 err = json.Unmarshal(*v, &etag)
2249 if err != nil {
2250 return err
2251 }
2252 agrc.Etag = &etag
2253 }
2254 case "type":
2255 if v != nil {
2256 var typeVar string
2257 err = json.Unmarshal(*v, &typeVar)
2258 if err != nil {
2259 return err
2260 }
2261 agrc.Type = &typeVar
2262 }
2263 case "id":
2264 if v != nil {
2265 var ID string
2266 err = json.Unmarshal(*v, &ID)
2267 if err != nil {
2268 return err
2269 }
2270 agrc.ID = &ID
2271 }
2272 }
2273 }
2274
2275 return nil
2276 }
2277
2278
2279
2280 type ApplicationGatewayRedirectConfigurationPropertiesFormat struct {
2281
2282 RedirectType ApplicationGatewayRedirectType `json:"redirectType,omitempty"`
2283
2284 TargetListener *SubResource `json:"targetListener,omitempty"`
2285
2286 TargetURL *string `json:"targetUrl,omitempty"`
2287
2288 IncludePath *bool `json:"includePath,omitempty"`
2289
2290 IncludeQueryString *bool `json:"includeQueryString,omitempty"`
2291
2292 RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"`
2293
2294 URLPathMaps *[]SubResource `json:"urlPathMaps,omitempty"`
2295
2296 PathRules *[]SubResource `json:"pathRules,omitempty"`
2297 }
2298
2299
2300 type ApplicationGatewayRequestRoutingRule struct {
2301
2302 *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"`
2303
2304 Name *string `json:"name,omitempty"`
2305
2306 Etag *string `json:"etag,omitempty"`
2307
2308 Type *string `json:"type,omitempty"`
2309
2310 ID *string `json:"id,omitempty"`
2311 }
2312
2313
2314 func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) {
2315 objectMap := make(map[string]interface{})
2316 if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil {
2317 objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat
2318 }
2319 if agrrr.Name != nil {
2320 objectMap["name"] = agrrr.Name
2321 }
2322 if agrrr.ID != nil {
2323 objectMap["id"] = agrrr.ID
2324 }
2325 return json.Marshal(objectMap)
2326 }
2327
2328
2329 func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error {
2330 var m map[string]*json.RawMessage
2331 err := json.Unmarshal(body, &m)
2332 if err != nil {
2333 return err
2334 }
2335 for k, v := range m {
2336 switch k {
2337 case "properties":
2338 if v != nil {
2339 var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat
2340 err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat)
2341 if err != nil {
2342 return err
2343 }
2344 agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat
2345 }
2346 case "name":
2347 if v != nil {
2348 var name string
2349 err = json.Unmarshal(*v, &name)
2350 if err != nil {
2351 return err
2352 }
2353 agrrr.Name = &name
2354 }
2355 case "etag":
2356 if v != nil {
2357 var etag string
2358 err = json.Unmarshal(*v, &etag)
2359 if err != nil {
2360 return err
2361 }
2362 agrrr.Etag = &etag
2363 }
2364 case "type":
2365 if v != nil {
2366 var typeVar string
2367 err = json.Unmarshal(*v, &typeVar)
2368 if err != nil {
2369 return err
2370 }
2371 agrrr.Type = &typeVar
2372 }
2373 case "id":
2374 if v != nil {
2375 var ID string
2376 err = json.Unmarshal(*v, &ID)
2377 if err != nil {
2378 return err
2379 }
2380 agrrr.ID = &ID
2381 }
2382 }
2383 }
2384
2385 return nil
2386 }
2387
2388
2389
2390 type ApplicationGatewayRequestRoutingRulePropertiesFormat struct {
2391
2392 RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"`
2393
2394 Priority *int32 `json:"priority,omitempty"`
2395
2396 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
2397
2398 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"`
2399
2400 HTTPListener *SubResource `json:"httpListener,omitempty"`
2401
2402 URLPathMap *SubResource `json:"urlPathMap,omitempty"`
2403
2404 RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"`
2405
2406 RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"`
2407
2408 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2409 }
2410
2411
2412 func (agrrrpf ApplicationGatewayRequestRoutingRulePropertiesFormat) MarshalJSON() ([]byte, error) {
2413 objectMap := make(map[string]interface{})
2414 if agrrrpf.RuleType != "" {
2415 objectMap["ruleType"] = agrrrpf.RuleType
2416 }
2417 if agrrrpf.Priority != nil {
2418 objectMap["priority"] = agrrrpf.Priority
2419 }
2420 if agrrrpf.BackendAddressPool != nil {
2421 objectMap["backendAddressPool"] = agrrrpf.BackendAddressPool
2422 }
2423 if agrrrpf.BackendHTTPSettings != nil {
2424 objectMap["backendHttpSettings"] = agrrrpf.BackendHTTPSettings
2425 }
2426 if agrrrpf.HTTPListener != nil {
2427 objectMap["httpListener"] = agrrrpf.HTTPListener
2428 }
2429 if agrrrpf.URLPathMap != nil {
2430 objectMap["urlPathMap"] = agrrrpf.URLPathMap
2431 }
2432 if agrrrpf.RewriteRuleSet != nil {
2433 objectMap["rewriteRuleSet"] = agrrrpf.RewriteRuleSet
2434 }
2435 if agrrrpf.RedirectConfiguration != nil {
2436 objectMap["redirectConfiguration"] = agrrrpf.RedirectConfiguration
2437 }
2438 return json.Marshal(objectMap)
2439 }
2440
2441
2442 type ApplicationGatewayRewriteRule struct {
2443
2444 Name *string `json:"name,omitempty"`
2445
2446 RuleSequence *int32 `json:"ruleSequence,omitempty"`
2447
2448 Conditions *[]ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"`
2449
2450 ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"`
2451 }
2452
2453
2454 type ApplicationGatewayRewriteRuleActionSet struct {
2455
2456 RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"`
2457
2458 ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"`
2459
2460 URLConfiguration *ApplicationGatewayURLConfiguration `json:"urlConfiguration,omitempty"`
2461 }
2462
2463
2464 type ApplicationGatewayRewriteRuleCondition struct {
2465
2466 Variable *string `json:"variable,omitempty"`
2467
2468 Pattern *string `json:"pattern,omitempty"`
2469
2470 IgnoreCase *bool `json:"ignoreCase,omitempty"`
2471
2472 Negate *bool `json:"negate,omitempty"`
2473 }
2474
2475
2476 type ApplicationGatewayRewriteRuleSet struct {
2477
2478 *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"`
2479
2480 Name *string `json:"name,omitempty"`
2481
2482 Etag *string `json:"etag,omitempty"`
2483
2484 ID *string `json:"id,omitempty"`
2485 }
2486
2487
2488 func (agrrs ApplicationGatewayRewriteRuleSet) MarshalJSON() ([]byte, error) {
2489 objectMap := make(map[string]interface{})
2490 if agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat != nil {
2491 objectMap["properties"] = agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat
2492 }
2493 if agrrs.Name != nil {
2494 objectMap["name"] = agrrs.Name
2495 }
2496 if agrrs.ID != nil {
2497 objectMap["id"] = agrrs.ID
2498 }
2499 return json.Marshal(objectMap)
2500 }
2501
2502
2503 func (agrrs *ApplicationGatewayRewriteRuleSet) UnmarshalJSON(body []byte) error {
2504 var m map[string]*json.RawMessage
2505 err := json.Unmarshal(body, &m)
2506 if err != nil {
2507 return err
2508 }
2509 for k, v := range m {
2510 switch k {
2511 case "properties":
2512 if v != nil {
2513 var applicationGatewayRewriteRuleSetPropertiesFormat ApplicationGatewayRewriteRuleSetPropertiesFormat
2514 err = json.Unmarshal(*v, &applicationGatewayRewriteRuleSetPropertiesFormat)
2515 if err != nil {
2516 return err
2517 }
2518 agrrs.ApplicationGatewayRewriteRuleSetPropertiesFormat = &applicationGatewayRewriteRuleSetPropertiesFormat
2519 }
2520 case "name":
2521 if v != nil {
2522 var name string
2523 err = json.Unmarshal(*v, &name)
2524 if err != nil {
2525 return err
2526 }
2527 agrrs.Name = &name
2528 }
2529 case "etag":
2530 if v != nil {
2531 var etag string
2532 err = json.Unmarshal(*v, &etag)
2533 if err != nil {
2534 return err
2535 }
2536 agrrs.Etag = &etag
2537 }
2538 case "id":
2539 if v != nil {
2540 var ID string
2541 err = json.Unmarshal(*v, &ID)
2542 if err != nil {
2543 return err
2544 }
2545 agrrs.ID = &ID
2546 }
2547 }
2548 }
2549
2550 return nil
2551 }
2552
2553
2554
2555 type ApplicationGatewayRewriteRuleSetPropertiesFormat struct {
2556
2557 RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"`
2558
2559 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2560 }
2561
2562
2563 func (agrrspf ApplicationGatewayRewriteRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) {
2564 objectMap := make(map[string]interface{})
2565 if agrrspf.RewriteRules != nil {
2566 objectMap["rewriteRules"] = agrrspf.RewriteRules
2567 }
2568 return json.Marshal(objectMap)
2569 }
2570
2571
2572
2573 type ApplicationGatewaysBackendHealthFuture struct {
2574 azure.FutureAPI
2575
2576
2577 Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealth, error)
2578 }
2579
2580
2581 func (future *ApplicationGatewaysBackendHealthFuture) UnmarshalJSON(body []byte) error {
2582 var azFuture azure.Future
2583 if err := json.Unmarshal(body, &azFuture); err != nil {
2584 return err
2585 }
2586 future.FutureAPI = &azFuture
2587 future.Result = future.result
2588 return nil
2589 }
2590
2591
2592 func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) {
2593 var done bool
2594 done, err = future.DoneWithContext(context.Background(), client)
2595 if err != nil {
2596 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure")
2597 return
2598 }
2599 if !done {
2600 agbh.Response.Response = future.Response()
2601 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture")
2602 return
2603 }
2604 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2605 if agbh.Response.Response, err = future.GetResult(sender); err == nil && agbh.Response.Response.StatusCode != http.StatusNoContent {
2606 agbh, err = client.BackendHealthResponder(agbh.Response.Response)
2607 if err != nil {
2608 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", agbh.Response.Response, "Failure responding to request")
2609 }
2610 }
2611 return
2612 }
2613
2614
2615
2616 type ApplicationGatewaysBackendHealthOnDemandFuture struct {
2617 azure.FutureAPI
2618
2619
2620 Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealthOnDemand, error)
2621 }
2622
2623
2624 func (future *ApplicationGatewaysBackendHealthOnDemandFuture) UnmarshalJSON(body []byte) error {
2625 var azFuture azure.Future
2626 if err := json.Unmarshal(body, &azFuture); err != nil {
2627 return err
2628 }
2629 future.FutureAPI = &azFuture
2630 future.Result = future.result
2631 return nil
2632 }
2633
2634
2635 func (future *ApplicationGatewaysBackendHealthOnDemandFuture) result(client ApplicationGatewaysClient) (agbhod ApplicationGatewayBackendHealthOnDemand, err error) {
2636 var done bool
2637 done, err = future.DoneWithContext(context.Background(), client)
2638 if err != nil {
2639 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthOnDemandFuture", "Result", future.Response(), "Polling failure")
2640 return
2641 }
2642 if !done {
2643 agbhod.Response.Response = future.Response()
2644 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthOnDemandFuture")
2645 return
2646 }
2647 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2648 if agbhod.Response.Response, err = future.GetResult(sender); err == nil && agbhod.Response.Response.StatusCode != http.StatusNoContent {
2649 agbhod, err = client.BackendHealthOnDemandResponder(agbhod.Response.Response)
2650 if err != nil {
2651 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthOnDemandFuture", "Result", agbhod.Response.Response, "Failure responding to request")
2652 }
2653 }
2654 return
2655 }
2656
2657
2658
2659 type ApplicationGatewaysCreateOrUpdateFuture struct {
2660 azure.FutureAPI
2661
2662
2663 Result func(ApplicationGatewaysClient) (ApplicationGateway, error)
2664 }
2665
2666
2667 func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2668 var azFuture azure.Future
2669 if err := json.Unmarshal(body, &azFuture); err != nil {
2670 return err
2671 }
2672 future.FutureAPI = &azFuture
2673 future.Result = future.result
2674 return nil
2675 }
2676
2677
2678 func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) {
2679 var done bool
2680 done, err = future.DoneWithContext(context.Background(), client)
2681 if err != nil {
2682 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2683 return
2684 }
2685 if !done {
2686 ag.Response.Response = future.Response()
2687 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture")
2688 return
2689 }
2690 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2691 if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent {
2692 ag, err = client.CreateOrUpdateResponder(ag.Response.Response)
2693 if err != nil {
2694 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", ag.Response.Response, "Failure responding to request")
2695 }
2696 }
2697 return
2698 }
2699
2700
2701
2702 type ApplicationGatewaysDeleteFuture struct {
2703 azure.FutureAPI
2704
2705
2706 Result func(ApplicationGatewaysClient) (autorest.Response, error)
2707 }
2708
2709
2710 func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
2711 var azFuture azure.Future
2712 if err := json.Unmarshal(body, &azFuture); err != nil {
2713 return err
2714 }
2715 future.FutureAPI = &azFuture
2716 future.Result = future.result
2717 return nil
2718 }
2719
2720
2721 func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
2722 var done bool
2723 done, err = future.DoneWithContext(context.Background(), client)
2724 if err != nil {
2725 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
2726 return
2727 }
2728 if !done {
2729 ar.Response = future.Response()
2730 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture")
2731 return
2732 }
2733 ar.Response = future.Response()
2734 return
2735 }
2736
2737
2738 type ApplicationGatewaySku struct {
2739
2740 Name ApplicationGatewaySkuName `json:"name,omitempty"`
2741
2742 Tier ApplicationGatewayTier `json:"tier,omitempty"`
2743
2744 Capacity *int32 `json:"capacity,omitempty"`
2745 }
2746
2747
2748 type ApplicationGatewaySslCertificate struct {
2749
2750 *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"`
2751
2752 Name *string `json:"name,omitempty"`
2753
2754 Etag *string `json:"etag,omitempty"`
2755
2756 Type *string `json:"type,omitempty"`
2757
2758 ID *string `json:"id,omitempty"`
2759 }
2760
2761
2762 func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) {
2763 objectMap := make(map[string]interface{})
2764 if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil {
2765 objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat
2766 }
2767 if agsc.Name != nil {
2768 objectMap["name"] = agsc.Name
2769 }
2770 if agsc.ID != nil {
2771 objectMap["id"] = agsc.ID
2772 }
2773 return json.Marshal(objectMap)
2774 }
2775
2776
2777 func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error {
2778 var m map[string]*json.RawMessage
2779 err := json.Unmarshal(body, &m)
2780 if err != nil {
2781 return err
2782 }
2783 for k, v := range m {
2784 switch k {
2785 case "properties":
2786 if v != nil {
2787 var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat
2788 err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat)
2789 if err != nil {
2790 return err
2791 }
2792 agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat
2793 }
2794 case "name":
2795 if v != nil {
2796 var name string
2797 err = json.Unmarshal(*v, &name)
2798 if err != nil {
2799 return err
2800 }
2801 agsc.Name = &name
2802 }
2803 case "etag":
2804 if v != nil {
2805 var etag string
2806 err = json.Unmarshal(*v, &etag)
2807 if err != nil {
2808 return err
2809 }
2810 agsc.Etag = &etag
2811 }
2812 case "type":
2813 if v != nil {
2814 var typeVar string
2815 err = json.Unmarshal(*v, &typeVar)
2816 if err != nil {
2817 return err
2818 }
2819 agsc.Type = &typeVar
2820 }
2821 case "id":
2822 if v != nil {
2823 var ID string
2824 err = json.Unmarshal(*v, &ID)
2825 if err != nil {
2826 return err
2827 }
2828 agsc.ID = &ID
2829 }
2830 }
2831 }
2832
2833 return nil
2834 }
2835
2836
2837
2838 type ApplicationGatewaySslCertificatePropertiesFormat struct {
2839
2840 Data *string `json:"data,omitempty"`
2841
2842 Password *string `json:"password,omitempty"`
2843
2844 PublicCertData *string `json:"publicCertData,omitempty"`
2845
2846 KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"`
2847
2848 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2849 }
2850
2851
2852 func (agscpf ApplicationGatewaySslCertificatePropertiesFormat) MarshalJSON() ([]byte, error) {
2853 objectMap := make(map[string]interface{})
2854 if agscpf.Data != nil {
2855 objectMap["data"] = agscpf.Data
2856 }
2857 if agscpf.Password != nil {
2858 objectMap["password"] = agscpf.Password
2859 }
2860 if agscpf.KeyVaultSecretID != nil {
2861 objectMap["keyVaultSecretId"] = agscpf.KeyVaultSecretID
2862 }
2863 return json.Marshal(objectMap)
2864 }
2865
2866
2867 type ApplicationGatewaySslPolicy struct {
2868
2869 DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"`
2870
2871 PolicyType ApplicationGatewaySslPolicyType `json:"policyType,omitempty"`
2872
2873 PolicyName ApplicationGatewaySslPolicyName `json:"policyName,omitempty"`
2874
2875 CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"`
2876
2877 MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"`
2878 }
2879
2880
2881 type ApplicationGatewaySslPredefinedPolicy struct {
2882 autorest.Response `json:"-"`
2883
2884 Name *string `json:"name,omitempty"`
2885
2886 *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"`
2887
2888 ID *string `json:"id,omitempty"`
2889 }
2890
2891
2892 func (agspp ApplicationGatewaySslPredefinedPolicy) MarshalJSON() ([]byte, error) {
2893 objectMap := make(map[string]interface{})
2894 if agspp.Name != nil {
2895 objectMap["name"] = agspp.Name
2896 }
2897 if agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat != nil {
2898 objectMap["properties"] = agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat
2899 }
2900 if agspp.ID != nil {
2901 objectMap["id"] = agspp.ID
2902 }
2903 return json.Marshal(objectMap)
2904 }
2905
2906
2907 func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) error {
2908 var m map[string]*json.RawMessage
2909 err := json.Unmarshal(body, &m)
2910 if err != nil {
2911 return err
2912 }
2913 for k, v := range m {
2914 switch k {
2915 case "name":
2916 if v != nil {
2917 var name string
2918 err = json.Unmarshal(*v, &name)
2919 if err != nil {
2920 return err
2921 }
2922 agspp.Name = &name
2923 }
2924 case "properties":
2925 if v != nil {
2926 var applicationGatewaySslPredefinedPolicyPropertiesFormat ApplicationGatewaySslPredefinedPolicyPropertiesFormat
2927 err = json.Unmarshal(*v, &applicationGatewaySslPredefinedPolicyPropertiesFormat)
2928 if err != nil {
2929 return err
2930 }
2931 agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat = &applicationGatewaySslPredefinedPolicyPropertiesFormat
2932 }
2933 case "id":
2934 if v != nil {
2935 var ID string
2936 err = json.Unmarshal(*v, &ID)
2937 if err != nil {
2938 return err
2939 }
2940 agspp.ID = &ID
2941 }
2942 }
2943 }
2944
2945 return nil
2946 }
2947
2948
2949
2950 type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct {
2951
2952 CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"`
2953
2954 MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"`
2955 }
2956
2957
2958
2959 type ApplicationGatewaysStartFuture struct {
2960 azure.FutureAPI
2961
2962
2963 Result func(ApplicationGatewaysClient) (autorest.Response, error)
2964 }
2965
2966
2967 func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error {
2968 var azFuture azure.Future
2969 if err := json.Unmarshal(body, &azFuture); err != nil {
2970 return err
2971 }
2972 future.FutureAPI = &azFuture
2973 future.Result = future.result
2974 return nil
2975 }
2976
2977
2978 func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
2979 var done bool
2980 done, err = future.DoneWithContext(context.Background(), client)
2981 if err != nil {
2982 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure")
2983 return
2984 }
2985 if !done {
2986 ar.Response = future.Response()
2987 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture")
2988 return
2989 }
2990 ar.Response = future.Response()
2991 return
2992 }
2993
2994
2995
2996 type ApplicationGatewaysStopFuture struct {
2997 azure.FutureAPI
2998
2999
3000 Result func(ApplicationGatewaysClient) (autorest.Response, error)
3001 }
3002
3003
3004 func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error {
3005 var azFuture azure.Future
3006 if err := json.Unmarshal(body, &azFuture); err != nil {
3007 return err
3008 }
3009 future.FutureAPI = &azFuture
3010 future.Result = future.result
3011 return nil
3012 }
3013
3014
3015 func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
3016 var done bool
3017 done, err = future.DoneWithContext(context.Background(), client)
3018 if err != nil {
3019 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure")
3020 return
3021 }
3022 if !done {
3023 ar.Response = future.Response()
3024 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture")
3025 return
3026 }
3027 ar.Response = future.Response()
3028 return
3029 }
3030
3031
3032 type ApplicationGatewayTrustedRootCertificate struct {
3033
3034 *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"`
3035
3036 Name *string `json:"name,omitempty"`
3037
3038 Etag *string `json:"etag,omitempty"`
3039
3040 Type *string `json:"type,omitempty"`
3041
3042 ID *string `json:"id,omitempty"`
3043 }
3044
3045
3046 func (agtrc ApplicationGatewayTrustedRootCertificate) MarshalJSON() ([]byte, error) {
3047 objectMap := make(map[string]interface{})
3048 if agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat != nil {
3049 objectMap["properties"] = agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat
3050 }
3051 if agtrc.Name != nil {
3052 objectMap["name"] = agtrc.Name
3053 }
3054 if agtrc.ID != nil {
3055 objectMap["id"] = agtrc.ID
3056 }
3057 return json.Marshal(objectMap)
3058 }
3059
3060
3061 func (agtrc *ApplicationGatewayTrustedRootCertificate) UnmarshalJSON(body []byte) error {
3062 var m map[string]*json.RawMessage
3063 err := json.Unmarshal(body, &m)
3064 if err != nil {
3065 return err
3066 }
3067 for k, v := range m {
3068 switch k {
3069 case "properties":
3070 if v != nil {
3071 var applicationGatewayTrustedRootCertificatePropertiesFormat ApplicationGatewayTrustedRootCertificatePropertiesFormat
3072 err = json.Unmarshal(*v, &applicationGatewayTrustedRootCertificatePropertiesFormat)
3073 if err != nil {
3074 return err
3075 }
3076 agtrc.ApplicationGatewayTrustedRootCertificatePropertiesFormat = &applicationGatewayTrustedRootCertificatePropertiesFormat
3077 }
3078 case "name":
3079 if v != nil {
3080 var name string
3081 err = json.Unmarshal(*v, &name)
3082 if err != nil {
3083 return err
3084 }
3085 agtrc.Name = &name
3086 }
3087 case "etag":
3088 if v != nil {
3089 var etag string
3090 err = json.Unmarshal(*v, &etag)
3091 if err != nil {
3092 return err
3093 }
3094 agtrc.Etag = &etag
3095 }
3096 case "type":
3097 if v != nil {
3098 var typeVar string
3099 err = json.Unmarshal(*v, &typeVar)
3100 if err != nil {
3101 return err
3102 }
3103 agtrc.Type = &typeVar
3104 }
3105 case "id":
3106 if v != nil {
3107 var ID string
3108 err = json.Unmarshal(*v, &ID)
3109 if err != nil {
3110 return err
3111 }
3112 agtrc.ID = &ID
3113 }
3114 }
3115 }
3116
3117 return nil
3118 }
3119
3120
3121
3122 type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct {
3123
3124 Data *string `json:"data,omitempty"`
3125
3126 KeyVaultSecretID *string `json:"keyVaultSecretId,omitempty"`
3127
3128 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3129 }
3130
3131
3132 func (agtrcpf ApplicationGatewayTrustedRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) {
3133 objectMap := make(map[string]interface{})
3134 if agtrcpf.Data != nil {
3135 objectMap["data"] = agtrcpf.Data
3136 }
3137 if agtrcpf.KeyVaultSecretID != nil {
3138 objectMap["keyVaultSecretId"] = agtrcpf.KeyVaultSecretID
3139 }
3140 return json.Marshal(objectMap)
3141 }
3142
3143
3144 type ApplicationGatewayURLConfiguration struct {
3145
3146 ModifiedPath *string `json:"modifiedPath,omitempty"`
3147
3148 ModifiedQueryString *string `json:"modifiedQueryString,omitempty"`
3149
3150 Reroute *bool `json:"reroute,omitempty"`
3151 }
3152
3153
3154
3155 type ApplicationGatewayURLPathMap struct {
3156
3157 *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"`
3158
3159 Name *string `json:"name,omitempty"`
3160
3161 Etag *string `json:"etag,omitempty"`
3162
3163 Type *string `json:"type,omitempty"`
3164
3165 ID *string `json:"id,omitempty"`
3166 }
3167
3168
3169 func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) {
3170 objectMap := make(map[string]interface{})
3171 if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil {
3172 objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat
3173 }
3174 if agupm.Name != nil {
3175 objectMap["name"] = agupm.Name
3176 }
3177 if agupm.ID != nil {
3178 objectMap["id"] = agupm.ID
3179 }
3180 return json.Marshal(objectMap)
3181 }
3182
3183
3184 func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error {
3185 var m map[string]*json.RawMessage
3186 err := json.Unmarshal(body, &m)
3187 if err != nil {
3188 return err
3189 }
3190 for k, v := range m {
3191 switch k {
3192 case "properties":
3193 if v != nil {
3194 var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat
3195 err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat)
3196 if err != nil {
3197 return err
3198 }
3199 agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat
3200 }
3201 case "name":
3202 if v != nil {
3203 var name string
3204 err = json.Unmarshal(*v, &name)
3205 if err != nil {
3206 return err
3207 }
3208 agupm.Name = &name
3209 }
3210 case "etag":
3211 if v != nil {
3212 var etag string
3213 err = json.Unmarshal(*v, &etag)
3214 if err != nil {
3215 return err
3216 }
3217 agupm.Etag = &etag
3218 }
3219 case "type":
3220 if v != nil {
3221 var typeVar string
3222 err = json.Unmarshal(*v, &typeVar)
3223 if err != nil {
3224 return err
3225 }
3226 agupm.Type = &typeVar
3227 }
3228 case "id":
3229 if v != nil {
3230 var ID string
3231 err = json.Unmarshal(*v, &ID)
3232 if err != nil {
3233 return err
3234 }
3235 agupm.ID = &ID
3236 }
3237 }
3238 }
3239
3240 return nil
3241 }
3242
3243
3244 type ApplicationGatewayURLPathMapPropertiesFormat struct {
3245
3246 DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"`
3247
3248 DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"`
3249
3250 DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"`
3251
3252 DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"`
3253
3254 PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"`
3255
3256 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3257 }
3258
3259
3260 func (agupmpf ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byte, error) {
3261 objectMap := make(map[string]interface{})
3262 if agupmpf.DefaultBackendAddressPool != nil {
3263 objectMap["defaultBackendAddressPool"] = agupmpf.DefaultBackendAddressPool
3264 }
3265 if agupmpf.DefaultBackendHTTPSettings != nil {
3266 objectMap["defaultBackendHttpSettings"] = agupmpf.DefaultBackendHTTPSettings
3267 }
3268 if agupmpf.DefaultRewriteRuleSet != nil {
3269 objectMap["defaultRewriteRuleSet"] = agupmpf.DefaultRewriteRuleSet
3270 }
3271 if agupmpf.DefaultRedirectConfiguration != nil {
3272 objectMap["defaultRedirectConfiguration"] = agupmpf.DefaultRedirectConfiguration
3273 }
3274 if agupmpf.PathRules != nil {
3275 objectMap["pathRules"] = agupmpf.PathRules
3276 }
3277 return json.Marshal(objectMap)
3278 }
3279
3280
3281
3282 type ApplicationGatewayWebApplicationFirewallConfiguration struct {
3283
3284 Enabled *bool `json:"enabled,omitempty"`
3285
3286 FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"`
3287
3288 RuleSetType *string `json:"ruleSetType,omitempty"`
3289
3290 RuleSetVersion *string `json:"ruleSetVersion,omitempty"`
3291
3292 DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"`
3293
3294 RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"`
3295
3296 MaxRequestBodySize *int32 `json:"maxRequestBodySize,omitempty"`
3297
3298 MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"`
3299
3300 FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"`
3301
3302 Exclusions *[]ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"`
3303 }
3304
3305
3306 type ApplicationRuleCondition struct {
3307
3308 SourceAddresses *[]string `json:"sourceAddresses,omitempty"`
3309
3310 DestinationAddresses *[]string `json:"destinationAddresses,omitempty"`
3311
3312 Protocols *[]FirewallPolicyRuleConditionApplicationProtocol `json:"protocols,omitempty"`
3313
3314 TargetFqdns *[]string `json:"targetFqdns,omitempty"`
3315
3316 FqdnTags *[]string `json:"fqdnTags,omitempty"`
3317
3318 SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"`
3319
3320 Name *string `json:"name,omitempty"`
3321
3322 Description *string `json:"description,omitempty"`
3323
3324 RuleConditionType RuleConditionType `json:"ruleConditionType,omitempty"`
3325 }
3326
3327
3328 func (arc ApplicationRuleCondition) MarshalJSON() ([]byte, error) {
3329 arc.RuleConditionType = RuleConditionTypeApplicationRuleCondition
3330 objectMap := make(map[string]interface{})
3331 if arc.SourceAddresses != nil {
3332 objectMap["sourceAddresses"] = arc.SourceAddresses
3333 }
3334 if arc.DestinationAddresses != nil {
3335 objectMap["destinationAddresses"] = arc.DestinationAddresses
3336 }
3337 if arc.Protocols != nil {
3338 objectMap["protocols"] = arc.Protocols
3339 }
3340 if arc.TargetFqdns != nil {
3341 objectMap["targetFqdns"] = arc.TargetFqdns
3342 }
3343 if arc.FqdnTags != nil {
3344 objectMap["fqdnTags"] = arc.FqdnTags
3345 }
3346 if arc.SourceIPGroups != nil {
3347 objectMap["sourceIpGroups"] = arc.SourceIPGroups
3348 }
3349 if arc.Name != nil {
3350 objectMap["name"] = arc.Name
3351 }
3352 if arc.Description != nil {
3353 objectMap["description"] = arc.Description
3354 }
3355 if arc.RuleConditionType != "" {
3356 objectMap["ruleConditionType"] = arc.RuleConditionType
3357 }
3358 return json.Marshal(objectMap)
3359 }
3360
3361
3362 func (arc ApplicationRuleCondition) AsApplicationRuleCondition() (*ApplicationRuleCondition, bool) {
3363 return &arc, true
3364 }
3365
3366
3367 func (arc ApplicationRuleCondition) AsNatRuleCondition() (*NatRuleCondition, bool) {
3368 return nil, false
3369 }
3370
3371
3372 func (arc ApplicationRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
3373 return nil, false
3374 }
3375
3376
3377 func (arc ApplicationRuleCondition) AsFirewallPolicyRuleCondition() (*FirewallPolicyRuleCondition, bool) {
3378 return nil, false
3379 }
3380
3381
3382 func (arc ApplicationRuleCondition) AsBasicFirewallPolicyRuleCondition() (BasicFirewallPolicyRuleCondition, bool) {
3383 return &arc, true
3384 }
3385
3386
3387 type ApplicationSecurityGroup struct {
3388 autorest.Response `json:"-"`
3389
3390 *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"`
3391
3392 Etag *string `json:"etag,omitempty"`
3393
3394 ID *string `json:"id,omitempty"`
3395
3396 Name *string `json:"name,omitempty"`
3397
3398 Type *string `json:"type,omitempty"`
3399
3400 Location *string `json:"location,omitempty"`
3401
3402 Tags map[string]*string `json:"tags"`
3403 }
3404
3405
3406 func (asg ApplicationSecurityGroup) MarshalJSON() ([]byte, error) {
3407 objectMap := make(map[string]interface{})
3408 if asg.ApplicationSecurityGroupPropertiesFormat != nil {
3409 objectMap["properties"] = asg.ApplicationSecurityGroupPropertiesFormat
3410 }
3411 if asg.ID != nil {
3412 objectMap["id"] = asg.ID
3413 }
3414 if asg.Location != nil {
3415 objectMap["location"] = asg.Location
3416 }
3417 if asg.Tags != nil {
3418 objectMap["tags"] = asg.Tags
3419 }
3420 return json.Marshal(objectMap)
3421 }
3422
3423
3424 func (asg *ApplicationSecurityGroup) UnmarshalJSON(body []byte) error {
3425 var m map[string]*json.RawMessage
3426 err := json.Unmarshal(body, &m)
3427 if err != nil {
3428 return err
3429 }
3430 for k, v := range m {
3431 switch k {
3432 case "properties":
3433 if v != nil {
3434 var applicationSecurityGroupPropertiesFormat ApplicationSecurityGroupPropertiesFormat
3435 err = json.Unmarshal(*v, &applicationSecurityGroupPropertiesFormat)
3436 if err != nil {
3437 return err
3438 }
3439 asg.ApplicationSecurityGroupPropertiesFormat = &applicationSecurityGroupPropertiesFormat
3440 }
3441 case "etag":
3442 if v != nil {
3443 var etag string
3444 err = json.Unmarshal(*v, &etag)
3445 if err != nil {
3446 return err
3447 }
3448 asg.Etag = &etag
3449 }
3450 case "id":
3451 if v != nil {
3452 var ID string
3453 err = json.Unmarshal(*v, &ID)
3454 if err != nil {
3455 return err
3456 }
3457 asg.ID = &ID
3458 }
3459 case "name":
3460 if v != nil {
3461 var name string
3462 err = json.Unmarshal(*v, &name)
3463 if err != nil {
3464 return err
3465 }
3466 asg.Name = &name
3467 }
3468 case "type":
3469 if v != nil {
3470 var typeVar string
3471 err = json.Unmarshal(*v, &typeVar)
3472 if err != nil {
3473 return err
3474 }
3475 asg.Type = &typeVar
3476 }
3477 case "location":
3478 if v != nil {
3479 var location string
3480 err = json.Unmarshal(*v, &location)
3481 if err != nil {
3482 return err
3483 }
3484 asg.Location = &location
3485 }
3486 case "tags":
3487 if v != nil {
3488 var tags map[string]*string
3489 err = json.Unmarshal(*v, &tags)
3490 if err != nil {
3491 return err
3492 }
3493 asg.Tags = tags
3494 }
3495 }
3496 }
3497
3498 return nil
3499 }
3500
3501
3502 type ApplicationSecurityGroupListResult struct {
3503 autorest.Response `json:"-"`
3504
3505 Value *[]ApplicationSecurityGroup `json:"value,omitempty"`
3506
3507 NextLink *string `json:"nextLink,omitempty"`
3508 }
3509
3510
3511 func (asglr ApplicationSecurityGroupListResult) MarshalJSON() ([]byte, error) {
3512 objectMap := make(map[string]interface{})
3513 if asglr.Value != nil {
3514 objectMap["value"] = asglr.Value
3515 }
3516 return json.Marshal(objectMap)
3517 }
3518
3519
3520
3521 type ApplicationSecurityGroupListResultIterator struct {
3522 i int
3523 page ApplicationSecurityGroupListResultPage
3524 }
3525
3526
3527
3528 func (iter *ApplicationSecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
3529 if tracing.IsEnabled() {
3530 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultIterator.NextWithContext")
3531 defer func() {
3532 sc := -1
3533 if iter.Response().Response.Response != nil {
3534 sc = iter.Response().Response.Response.StatusCode
3535 }
3536 tracing.EndSpan(ctx, sc, err)
3537 }()
3538 }
3539 iter.i++
3540 if iter.i < len(iter.page.Values()) {
3541 return nil
3542 }
3543 err = iter.page.NextWithContext(ctx)
3544 if err != nil {
3545 iter.i--
3546 return err
3547 }
3548 iter.i = 0
3549 return nil
3550 }
3551
3552
3553
3554
3555 func (iter *ApplicationSecurityGroupListResultIterator) Next() error {
3556 return iter.NextWithContext(context.Background())
3557 }
3558
3559
3560 func (iter ApplicationSecurityGroupListResultIterator) NotDone() bool {
3561 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3562 }
3563
3564
3565 func (iter ApplicationSecurityGroupListResultIterator) Response() ApplicationSecurityGroupListResult {
3566 return iter.page.Response()
3567 }
3568
3569
3570
3571 func (iter ApplicationSecurityGroupListResultIterator) Value() ApplicationSecurityGroup {
3572 if !iter.page.NotDone() {
3573 return ApplicationSecurityGroup{}
3574 }
3575 return iter.page.Values()[iter.i]
3576 }
3577
3578
3579 func NewApplicationSecurityGroupListResultIterator(page ApplicationSecurityGroupListResultPage) ApplicationSecurityGroupListResultIterator {
3580 return ApplicationSecurityGroupListResultIterator{page: page}
3581 }
3582
3583
3584 func (asglr ApplicationSecurityGroupListResult) IsEmpty() bool {
3585 return asglr.Value == nil || len(*asglr.Value) == 0
3586 }
3587
3588
3589 func (asglr ApplicationSecurityGroupListResult) hasNextLink() bool {
3590 return asglr.NextLink != nil && len(*asglr.NextLink) != 0
3591 }
3592
3593
3594
3595 func (asglr ApplicationSecurityGroupListResult) applicationSecurityGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
3596 if !asglr.hasNextLink() {
3597 return nil, nil
3598 }
3599 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3600 autorest.AsJSON(),
3601 autorest.AsGet(),
3602 autorest.WithBaseURL(to.String(asglr.NextLink)))
3603 }
3604
3605
3606 type ApplicationSecurityGroupListResultPage struct {
3607 fn func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error)
3608 asglr ApplicationSecurityGroupListResult
3609 }
3610
3611
3612
3613 func (page *ApplicationSecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
3614 if tracing.IsEnabled() {
3615 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultPage.NextWithContext")
3616 defer func() {
3617 sc := -1
3618 if page.Response().Response.Response != nil {
3619 sc = page.Response().Response.Response.StatusCode
3620 }
3621 tracing.EndSpan(ctx, sc, err)
3622 }()
3623 }
3624 for {
3625 next, err := page.fn(ctx, page.asglr)
3626 if err != nil {
3627 return err
3628 }
3629 page.asglr = next
3630 if !next.hasNextLink() || !next.IsEmpty() {
3631 break
3632 }
3633 }
3634 return nil
3635 }
3636
3637
3638
3639
3640 func (page *ApplicationSecurityGroupListResultPage) Next() error {
3641 return page.NextWithContext(context.Background())
3642 }
3643
3644
3645 func (page ApplicationSecurityGroupListResultPage) NotDone() bool {
3646 return !page.asglr.IsEmpty()
3647 }
3648
3649
3650 func (page ApplicationSecurityGroupListResultPage) Response() ApplicationSecurityGroupListResult {
3651 return page.asglr
3652 }
3653
3654
3655 func (page ApplicationSecurityGroupListResultPage) Values() []ApplicationSecurityGroup {
3656 if page.asglr.IsEmpty() {
3657 return nil
3658 }
3659 return *page.asglr.Value
3660 }
3661
3662
3663 func NewApplicationSecurityGroupListResultPage(cur ApplicationSecurityGroupListResult, getNextPage func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error)) ApplicationSecurityGroupListResultPage {
3664 return ApplicationSecurityGroupListResultPage{
3665 fn: getNextPage,
3666 asglr: cur,
3667 }
3668 }
3669
3670
3671 type ApplicationSecurityGroupPropertiesFormat struct {
3672
3673 ResourceGUID *string `json:"resourceGuid,omitempty"`
3674
3675 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3676 }
3677
3678
3679 func (asgpf ApplicationSecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) {
3680 objectMap := make(map[string]interface{})
3681 return json.Marshal(objectMap)
3682 }
3683
3684
3685
3686 type ApplicationSecurityGroupsCreateOrUpdateFuture struct {
3687 azure.FutureAPI
3688
3689
3690 Result func(ApplicationSecurityGroupsClient) (ApplicationSecurityGroup, error)
3691 }
3692
3693
3694 func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3695 var azFuture azure.Future
3696 if err := json.Unmarshal(body, &azFuture); err != nil {
3697 return err
3698 }
3699 future.FutureAPI = &azFuture
3700 future.Result = future.result
3701 return nil
3702 }
3703
3704
3705 func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) {
3706 var done bool
3707 done, err = future.DoneWithContext(context.Background(), client)
3708 if err != nil {
3709 err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3710 return
3711 }
3712 if !done {
3713 asg.Response.Response = future.Response()
3714 err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsCreateOrUpdateFuture")
3715 return
3716 }
3717 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3718 if asg.Response.Response, err = future.GetResult(sender); err == nil && asg.Response.Response.StatusCode != http.StatusNoContent {
3719 asg, err = client.CreateOrUpdateResponder(asg.Response.Response)
3720 if err != nil {
3721 err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", asg.Response.Response, "Failure responding to request")
3722 }
3723 }
3724 return
3725 }
3726
3727
3728
3729 type ApplicationSecurityGroupsDeleteFuture struct {
3730 azure.FutureAPI
3731
3732
3733 Result func(ApplicationSecurityGroupsClient) (autorest.Response, error)
3734 }
3735
3736
3737 func (future *ApplicationSecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
3738 var azFuture azure.Future
3739 if err := json.Unmarshal(body, &azFuture); err != nil {
3740 return err
3741 }
3742 future.FutureAPI = &azFuture
3743 future.Result = future.result
3744 return nil
3745 }
3746
3747
3748 func (future *ApplicationSecurityGroupsDeleteFuture) result(client ApplicationSecurityGroupsClient) (ar autorest.Response, err error) {
3749 var done bool
3750 done, err = future.DoneWithContext(context.Background(), client)
3751 if err != nil {
3752 err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
3753 return
3754 }
3755 if !done {
3756 ar.Response = future.Response()
3757 err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsDeleteFuture")
3758 return
3759 }
3760 ar.Response = future.Response()
3761 return
3762 }
3763
3764
3765
3766 type AuthorizationListResult struct {
3767 autorest.Response `json:"-"`
3768
3769 Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"`
3770
3771 NextLink *string `json:"nextLink,omitempty"`
3772 }
3773
3774
3775
3776 type AuthorizationListResultIterator struct {
3777 i int
3778 page AuthorizationListResultPage
3779 }
3780
3781
3782
3783 func (iter *AuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) {
3784 if tracing.IsEnabled() {
3785 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultIterator.NextWithContext")
3786 defer func() {
3787 sc := -1
3788 if iter.Response().Response.Response != nil {
3789 sc = iter.Response().Response.Response.StatusCode
3790 }
3791 tracing.EndSpan(ctx, sc, err)
3792 }()
3793 }
3794 iter.i++
3795 if iter.i < len(iter.page.Values()) {
3796 return nil
3797 }
3798 err = iter.page.NextWithContext(ctx)
3799 if err != nil {
3800 iter.i--
3801 return err
3802 }
3803 iter.i = 0
3804 return nil
3805 }
3806
3807
3808
3809
3810 func (iter *AuthorizationListResultIterator) Next() error {
3811 return iter.NextWithContext(context.Background())
3812 }
3813
3814
3815 func (iter AuthorizationListResultIterator) NotDone() bool {
3816 return iter.page.NotDone() && iter.i < len(iter.page.Values())
3817 }
3818
3819
3820 func (iter AuthorizationListResultIterator) Response() AuthorizationListResult {
3821 return iter.page.Response()
3822 }
3823
3824
3825
3826 func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization {
3827 if !iter.page.NotDone() {
3828 return ExpressRouteCircuitAuthorization{}
3829 }
3830 return iter.page.Values()[iter.i]
3831 }
3832
3833
3834 func NewAuthorizationListResultIterator(page AuthorizationListResultPage) AuthorizationListResultIterator {
3835 return AuthorizationListResultIterator{page: page}
3836 }
3837
3838
3839 func (alr AuthorizationListResult) IsEmpty() bool {
3840 return alr.Value == nil || len(*alr.Value) == 0
3841 }
3842
3843
3844 func (alr AuthorizationListResult) hasNextLink() bool {
3845 return alr.NextLink != nil && len(*alr.NextLink) != 0
3846 }
3847
3848
3849
3850 func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) {
3851 if !alr.hasNextLink() {
3852 return nil, nil
3853 }
3854 return autorest.Prepare((&http.Request{}).WithContext(ctx),
3855 autorest.AsJSON(),
3856 autorest.AsGet(),
3857 autorest.WithBaseURL(to.String(alr.NextLink)))
3858 }
3859
3860
3861 type AuthorizationListResultPage struct {
3862 fn func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)
3863 alr AuthorizationListResult
3864 }
3865
3866
3867
3868 func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) {
3869 if tracing.IsEnabled() {
3870 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultPage.NextWithContext")
3871 defer func() {
3872 sc := -1
3873 if page.Response().Response.Response != nil {
3874 sc = page.Response().Response.Response.StatusCode
3875 }
3876 tracing.EndSpan(ctx, sc, err)
3877 }()
3878 }
3879 for {
3880 next, err := page.fn(ctx, page.alr)
3881 if err != nil {
3882 return err
3883 }
3884 page.alr = next
3885 if !next.hasNextLink() || !next.IsEmpty() {
3886 break
3887 }
3888 }
3889 return nil
3890 }
3891
3892
3893
3894
3895 func (page *AuthorizationListResultPage) Next() error {
3896 return page.NextWithContext(context.Background())
3897 }
3898
3899
3900 func (page AuthorizationListResultPage) NotDone() bool {
3901 return !page.alr.IsEmpty()
3902 }
3903
3904
3905 func (page AuthorizationListResultPage) Response() AuthorizationListResult {
3906 return page.alr
3907 }
3908
3909
3910 func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization {
3911 if page.alr.IsEmpty() {
3912 return nil
3913 }
3914 return *page.alr.Value
3915 }
3916
3917
3918 func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage {
3919 return AuthorizationListResultPage{
3920 fn: getNextPage,
3921 alr: cur,
3922 }
3923 }
3924
3925
3926 type AuthorizationPropertiesFormat struct {
3927
3928 AuthorizationKey *string `json:"authorizationKey,omitempty"`
3929
3930 AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"`
3931
3932 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3933 }
3934
3935
3936 func (apf AuthorizationPropertiesFormat) MarshalJSON() ([]byte, error) {
3937 objectMap := make(map[string]interface{})
3938 if apf.AuthorizationKey != nil {
3939 objectMap["authorizationKey"] = apf.AuthorizationKey
3940 }
3941 if apf.AuthorizationUseStatus != "" {
3942 objectMap["authorizationUseStatus"] = apf.AuthorizationUseStatus
3943 }
3944 return json.Marshal(objectMap)
3945 }
3946
3947
3948 type AutoApprovedPrivateLinkService struct {
3949
3950 PrivateLinkService *string `json:"privateLinkService,omitempty"`
3951 }
3952
3953
3954
3955 type AutoApprovedPrivateLinkServicesResult struct {
3956 autorest.Response `json:"-"`
3957
3958 Value *[]AutoApprovedPrivateLinkService `json:"value,omitempty"`
3959
3960 NextLink *string `json:"nextLink,omitempty"`
3961 }
3962
3963
3964 func (aaplsr AutoApprovedPrivateLinkServicesResult) MarshalJSON() ([]byte, error) {
3965 objectMap := make(map[string]interface{})
3966 if aaplsr.Value != nil {
3967 objectMap["value"] = aaplsr.Value
3968 }
3969 return json.Marshal(objectMap)
3970 }
3971
3972
3973
3974 type AutoApprovedPrivateLinkServicesResultIterator struct {
3975 i int
3976 page AutoApprovedPrivateLinkServicesResultPage
3977 }
3978
3979
3980
3981 func (iter *AutoApprovedPrivateLinkServicesResultIterator) NextWithContext(ctx context.Context) (err error) {
3982 if tracing.IsEnabled() {
3983 ctx = tracing.StartSpan(ctx, fqdn+"/AutoApprovedPrivateLinkServicesResultIterator.NextWithContext")
3984 defer func() {
3985 sc := -1
3986 if iter.Response().Response.Response != nil {
3987 sc = iter.Response().Response.Response.StatusCode
3988 }
3989 tracing.EndSpan(ctx, sc, err)
3990 }()
3991 }
3992 iter.i++
3993 if iter.i < len(iter.page.Values()) {
3994 return nil
3995 }
3996 err = iter.page.NextWithContext(ctx)
3997 if err != nil {
3998 iter.i--
3999 return err
4000 }
4001 iter.i = 0
4002 return nil
4003 }
4004
4005
4006
4007
4008 func (iter *AutoApprovedPrivateLinkServicesResultIterator) Next() error {
4009 return iter.NextWithContext(context.Background())
4010 }
4011
4012
4013 func (iter AutoApprovedPrivateLinkServicesResultIterator) NotDone() bool {
4014 return iter.page.NotDone() && iter.i < len(iter.page.Values())
4015 }
4016
4017
4018 func (iter AutoApprovedPrivateLinkServicesResultIterator) Response() AutoApprovedPrivateLinkServicesResult {
4019 return iter.page.Response()
4020 }
4021
4022
4023
4024 func (iter AutoApprovedPrivateLinkServicesResultIterator) Value() AutoApprovedPrivateLinkService {
4025 if !iter.page.NotDone() {
4026 return AutoApprovedPrivateLinkService{}
4027 }
4028 return iter.page.Values()[iter.i]
4029 }
4030
4031
4032 func NewAutoApprovedPrivateLinkServicesResultIterator(page AutoApprovedPrivateLinkServicesResultPage) AutoApprovedPrivateLinkServicesResultIterator {
4033 return AutoApprovedPrivateLinkServicesResultIterator{page: page}
4034 }
4035
4036
4037 func (aaplsr AutoApprovedPrivateLinkServicesResult) IsEmpty() bool {
4038 return aaplsr.Value == nil || len(*aaplsr.Value) == 0
4039 }
4040
4041
4042 func (aaplsr AutoApprovedPrivateLinkServicesResult) hasNextLink() bool {
4043 return aaplsr.NextLink != nil && len(*aaplsr.NextLink) != 0
4044 }
4045
4046
4047
4048 func (aaplsr AutoApprovedPrivateLinkServicesResult) autoApprovedPrivateLinkServicesResultPreparer(ctx context.Context) (*http.Request, error) {
4049 if !aaplsr.hasNextLink() {
4050 return nil, nil
4051 }
4052 return autorest.Prepare((&http.Request{}).WithContext(ctx),
4053 autorest.AsJSON(),
4054 autorest.AsGet(),
4055 autorest.WithBaseURL(to.String(aaplsr.NextLink)))
4056 }
4057
4058
4059 type AutoApprovedPrivateLinkServicesResultPage struct {
4060 fn func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error)
4061 aaplsr AutoApprovedPrivateLinkServicesResult
4062 }
4063
4064
4065
4066 func (page *AutoApprovedPrivateLinkServicesResultPage) NextWithContext(ctx context.Context) (err error) {
4067 if tracing.IsEnabled() {
4068 ctx = tracing.StartSpan(ctx, fqdn+"/AutoApprovedPrivateLinkServicesResultPage.NextWithContext")
4069 defer func() {
4070 sc := -1
4071 if page.Response().Response.Response != nil {
4072 sc = page.Response().Response.Response.StatusCode
4073 }
4074 tracing.EndSpan(ctx, sc, err)
4075 }()
4076 }
4077 for {
4078 next, err := page.fn(ctx, page.aaplsr)
4079 if err != nil {
4080 return err
4081 }
4082 page.aaplsr = next
4083 if !next.hasNextLink() || !next.IsEmpty() {
4084 break
4085 }
4086 }
4087 return nil
4088 }
4089
4090
4091
4092
4093 func (page *AutoApprovedPrivateLinkServicesResultPage) Next() error {
4094 return page.NextWithContext(context.Background())
4095 }
4096
4097
4098 func (page AutoApprovedPrivateLinkServicesResultPage) NotDone() bool {
4099 return !page.aaplsr.IsEmpty()
4100 }
4101
4102
4103 func (page AutoApprovedPrivateLinkServicesResultPage) Response() AutoApprovedPrivateLinkServicesResult {
4104 return page.aaplsr
4105 }
4106
4107
4108 func (page AutoApprovedPrivateLinkServicesResultPage) Values() []AutoApprovedPrivateLinkService {
4109 if page.aaplsr.IsEmpty() {
4110 return nil
4111 }
4112 return *page.aaplsr.Value
4113 }
4114
4115
4116 func NewAutoApprovedPrivateLinkServicesResultPage(cur AutoApprovedPrivateLinkServicesResult, getNextPage func(context.Context, AutoApprovedPrivateLinkServicesResult) (AutoApprovedPrivateLinkServicesResult, error)) AutoApprovedPrivateLinkServicesResultPage {
4117 return AutoApprovedPrivateLinkServicesResultPage{
4118 fn: getNextPage,
4119 aaplsr: cur,
4120 }
4121 }
4122
4123
4124 type Availability struct {
4125
4126 TimeGrain *string `json:"timeGrain,omitempty"`
4127
4128 Retention *string `json:"retention,omitempty"`
4129
4130 BlobDuration *string `json:"blobDuration,omitempty"`
4131 }
4132
4133
4134
4135 type AvailableDelegation struct {
4136
4137 Name *string `json:"name,omitempty"`
4138
4139 ID *string `json:"id,omitempty"`
4140
4141 Type *string `json:"type,omitempty"`
4142
4143 ServiceName *string `json:"serviceName,omitempty"`
4144
4145 Actions *[]string `json:"actions,omitempty"`
4146 }
4147
4148
4149 type AvailableDelegationsResult struct {
4150 autorest.Response `json:"-"`
4151
4152 Value *[]AvailableDelegation `json:"value,omitempty"`
4153
4154 NextLink *string `json:"nextLink,omitempty"`
4155 }
4156
4157
4158 func (adr AvailableDelegationsResult) MarshalJSON() ([]byte, error) {
4159 objectMap := make(map[string]interface{})
4160 if adr.Value != nil {
4161 objectMap["value"] = adr.Value
4162 }
4163 return json.Marshal(objectMap)
4164 }
4165
4166
4167 type AvailableDelegationsResultIterator struct {
4168 i int
4169 page AvailableDelegationsResultPage
4170 }
4171
4172
4173
4174 func (iter *AvailableDelegationsResultIterator) NextWithContext(ctx context.Context) (err error) {
4175 if tracing.IsEnabled() {
4176 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsResultIterator.NextWithContext")
4177 defer func() {
4178 sc := -1
4179 if iter.Response().Response.Response != nil {
4180 sc = iter.Response().Response.Response.StatusCode
4181 }
4182 tracing.EndSpan(ctx, sc, err)
4183 }()
4184 }
4185 iter.i++
4186 if iter.i < len(iter.page.Values()) {
4187 return nil
4188 }
4189 err = iter.page.NextWithContext(ctx)
4190 if err != nil {
4191 iter.i--
4192 return err
4193 }
4194 iter.i = 0
4195 return nil
4196 }
4197
4198
4199
4200
4201 func (iter *AvailableDelegationsResultIterator) Next() error {
4202 return iter.NextWithContext(context.Background())
4203 }
4204
4205
4206 func (iter AvailableDelegationsResultIterator) NotDone() bool {
4207 return iter.page.NotDone() && iter.i < len(iter.page.Values())
4208 }
4209
4210
4211 func (iter AvailableDelegationsResultIterator) Response() AvailableDelegationsResult {
4212 return iter.page.Response()
4213 }
4214
4215
4216
4217 func (iter AvailableDelegationsResultIterator) Value() AvailableDelegation {
4218 if !iter.page.NotDone() {
4219 return AvailableDelegation{}
4220 }
4221 return iter.page.Values()[iter.i]
4222 }
4223
4224
4225 func NewAvailableDelegationsResultIterator(page AvailableDelegationsResultPage) AvailableDelegationsResultIterator {
4226 return AvailableDelegationsResultIterator{page: page}
4227 }
4228
4229
4230 func (adr AvailableDelegationsResult) IsEmpty() bool {
4231 return adr.Value == nil || len(*adr.Value) == 0
4232 }
4233
4234
4235 func (adr AvailableDelegationsResult) hasNextLink() bool {
4236 return adr.NextLink != nil && len(*adr.NextLink) != 0
4237 }
4238
4239
4240
4241 func (adr AvailableDelegationsResult) availableDelegationsResultPreparer(ctx context.Context) (*http.Request, error) {
4242 if !adr.hasNextLink() {
4243 return nil, nil
4244 }
4245 return autorest.Prepare((&http.Request{}).WithContext(ctx),
4246 autorest.AsJSON(),
4247 autorest.AsGet(),
4248 autorest.WithBaseURL(to.String(adr.NextLink)))
4249 }
4250
4251
4252 type AvailableDelegationsResultPage struct {
4253 fn func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error)
4254 adr AvailableDelegationsResult
4255 }
4256
4257
4258
4259 func (page *AvailableDelegationsResultPage) NextWithContext(ctx context.Context) (err error) {
4260 if tracing.IsEnabled() {
4261 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableDelegationsResultPage.NextWithContext")
4262 defer func() {
4263 sc := -1
4264 if page.Response().Response.Response != nil {
4265 sc = page.Response().Response.Response.StatusCode
4266 }
4267 tracing.EndSpan(ctx, sc, err)
4268 }()
4269 }
4270 for {
4271 next, err := page.fn(ctx, page.adr)
4272 if err != nil {
4273 return err
4274 }
4275 page.adr = next
4276 if !next.hasNextLink() || !next.IsEmpty() {
4277 break
4278 }
4279 }
4280 return nil
4281 }
4282
4283
4284
4285
4286 func (page *AvailableDelegationsResultPage) Next() error {
4287 return page.NextWithContext(context.Background())
4288 }
4289
4290
4291 func (page AvailableDelegationsResultPage) NotDone() bool {
4292 return !page.adr.IsEmpty()
4293 }
4294
4295
4296 func (page AvailableDelegationsResultPage) Response() AvailableDelegationsResult {
4297 return page.adr
4298 }
4299
4300
4301 func (page AvailableDelegationsResultPage) Values() []AvailableDelegation {
4302 if page.adr.IsEmpty() {
4303 return nil
4304 }
4305 return *page.adr.Value
4306 }
4307
4308
4309 func NewAvailableDelegationsResultPage(cur AvailableDelegationsResult, getNextPage func(context.Context, AvailableDelegationsResult) (AvailableDelegationsResult, error)) AvailableDelegationsResultPage {
4310 return AvailableDelegationsResultPage{
4311 fn: getNextPage,
4312 adr: cur,
4313 }
4314 }
4315
4316
4317 type AvailablePrivateEndpointType struct {
4318
4319 Name *string `json:"name,omitempty"`
4320
4321 ID *string `json:"id,omitempty"`
4322
4323 Type *string `json:"type,omitempty"`
4324
4325 ResourceName *string `json:"resourceName,omitempty"`
4326 }
4327
4328
4329 type AvailablePrivateEndpointTypesResult struct {
4330 autorest.Response `json:"-"`
4331
4332 Value *[]AvailablePrivateEndpointType `json:"value,omitempty"`
4333
4334 NextLink *string `json:"nextLink,omitempty"`
4335 }
4336
4337
4338 func (apetr AvailablePrivateEndpointTypesResult) MarshalJSON() ([]byte, error) {
4339 objectMap := make(map[string]interface{})
4340 if apetr.Value != nil {
4341 objectMap["value"] = apetr.Value
4342 }
4343 return json.Marshal(objectMap)
4344 }
4345
4346
4347
4348 type AvailablePrivateEndpointTypesResultIterator struct {
4349 i int
4350 page AvailablePrivateEndpointTypesResultPage
4351 }
4352
4353
4354
4355 func (iter *AvailablePrivateEndpointTypesResultIterator) NextWithContext(ctx context.Context) (err error) {
4356 if tracing.IsEnabled() {
4357 ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesResultIterator.NextWithContext")
4358 defer func() {
4359 sc := -1
4360 if iter.Response().Response.Response != nil {
4361 sc = iter.Response().Response.Response.StatusCode
4362 }
4363 tracing.EndSpan(ctx, sc, err)
4364 }()
4365 }
4366 iter.i++
4367 if iter.i < len(iter.page.Values()) {
4368 return nil
4369 }
4370 err = iter.page.NextWithContext(ctx)
4371 if err != nil {
4372 iter.i--
4373 return err
4374 }
4375 iter.i = 0
4376 return nil
4377 }
4378
4379
4380
4381
4382 func (iter *AvailablePrivateEndpointTypesResultIterator) Next() error {
4383 return iter.NextWithContext(context.Background())
4384 }
4385
4386
4387 func (iter AvailablePrivateEndpointTypesResultIterator) NotDone() bool {
4388 return iter.page.NotDone() && iter.i < len(iter.page.Values())
4389 }
4390
4391
4392 func (iter AvailablePrivateEndpointTypesResultIterator) Response() AvailablePrivateEndpointTypesResult {
4393 return iter.page.Response()
4394 }
4395
4396
4397
4398 func (iter AvailablePrivateEndpointTypesResultIterator) Value() AvailablePrivateEndpointType {
4399 if !iter.page.NotDone() {
4400 return AvailablePrivateEndpointType{}
4401 }
4402 return iter.page.Values()[iter.i]
4403 }
4404
4405
4406 func NewAvailablePrivateEndpointTypesResultIterator(page AvailablePrivateEndpointTypesResultPage) AvailablePrivateEndpointTypesResultIterator {
4407 return AvailablePrivateEndpointTypesResultIterator{page: page}
4408 }
4409
4410
4411 func (apetr AvailablePrivateEndpointTypesResult) IsEmpty() bool {
4412 return apetr.Value == nil || len(*apetr.Value) == 0
4413 }
4414
4415
4416 func (apetr AvailablePrivateEndpointTypesResult) hasNextLink() bool {
4417 return apetr.NextLink != nil && len(*apetr.NextLink) != 0
4418 }
4419
4420
4421
4422 func (apetr AvailablePrivateEndpointTypesResult) availablePrivateEndpointTypesResultPreparer(ctx context.Context) (*http.Request, error) {
4423 if !apetr.hasNextLink() {
4424 return nil, nil
4425 }
4426 return autorest.Prepare((&http.Request{}).WithContext(ctx),
4427 autorest.AsJSON(),
4428 autorest.AsGet(),
4429 autorest.WithBaseURL(to.String(apetr.NextLink)))
4430 }
4431
4432
4433 type AvailablePrivateEndpointTypesResultPage struct {
4434 fn func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error)
4435 apetr AvailablePrivateEndpointTypesResult
4436 }
4437
4438
4439
4440 func (page *AvailablePrivateEndpointTypesResultPage) NextWithContext(ctx context.Context) (err error) {
4441 if tracing.IsEnabled() {
4442 ctx = tracing.StartSpan(ctx, fqdn+"/AvailablePrivateEndpointTypesResultPage.NextWithContext")
4443 defer func() {
4444 sc := -1
4445 if page.Response().Response.Response != nil {
4446 sc = page.Response().Response.Response.StatusCode
4447 }
4448 tracing.EndSpan(ctx, sc, err)
4449 }()
4450 }
4451 for {
4452 next, err := page.fn(ctx, page.apetr)
4453 if err != nil {
4454 return err
4455 }
4456 page.apetr = next
4457 if !next.hasNextLink() || !next.IsEmpty() {
4458 break
4459 }
4460 }
4461 return nil
4462 }
4463
4464
4465
4466
4467 func (page *AvailablePrivateEndpointTypesResultPage) Next() error {
4468 return page.NextWithContext(context.Background())
4469 }
4470
4471
4472 func (page AvailablePrivateEndpointTypesResultPage) NotDone() bool {
4473 return !page.apetr.IsEmpty()
4474 }
4475
4476
4477 func (page AvailablePrivateEndpointTypesResultPage) Response() AvailablePrivateEndpointTypesResult {
4478 return page.apetr
4479 }
4480
4481
4482 func (page AvailablePrivateEndpointTypesResultPage) Values() []AvailablePrivateEndpointType {
4483 if page.apetr.IsEmpty() {
4484 return nil
4485 }
4486 return *page.apetr.Value
4487 }
4488
4489
4490 func NewAvailablePrivateEndpointTypesResultPage(cur AvailablePrivateEndpointTypesResult, getNextPage func(context.Context, AvailablePrivateEndpointTypesResult) (AvailablePrivateEndpointTypesResult, error)) AvailablePrivateEndpointTypesResultPage {
4491 return AvailablePrivateEndpointTypesResultPage{
4492 fn: getNextPage,
4493 apetr: cur,
4494 }
4495 }
4496
4497
4498 type AvailableProvidersList struct {
4499 autorest.Response `json:"-"`
4500
4501 Countries *[]AvailableProvidersListCountry `json:"countries,omitempty"`
4502 }
4503
4504
4505 type AvailableProvidersListCity struct {
4506
4507 CityName *string `json:"cityName,omitempty"`
4508
4509 Providers *[]string `json:"providers,omitempty"`
4510 }
4511
4512
4513 type AvailableProvidersListCountry struct {
4514
4515 CountryName *string `json:"countryName,omitempty"`
4516
4517 Providers *[]string `json:"providers,omitempty"`
4518
4519 States *[]AvailableProvidersListState `json:"states,omitempty"`
4520 }
4521
4522
4523
4524 type AvailableProvidersListParameters struct {
4525
4526 AzureLocations *[]string `json:"azureLocations,omitempty"`
4527
4528 Country *string `json:"country,omitempty"`
4529
4530 State *string `json:"state,omitempty"`
4531
4532 City *string `json:"city,omitempty"`
4533 }
4534
4535
4536 type AvailableProvidersListState struct {
4537
4538 StateName *string `json:"stateName,omitempty"`
4539
4540 Providers *[]string `json:"providers,omitempty"`
4541
4542 Cities *[]AvailableProvidersListCity `json:"cities,omitempty"`
4543 }
4544
4545
4546 type AvailableServiceAlias struct {
4547
4548 Name *string `json:"name,omitempty"`
4549
4550 ID *string `json:"id,omitempty"`
4551
4552 Type *string `json:"type,omitempty"`
4553
4554 ResourceName *string `json:"resourceName,omitempty"`
4555 }
4556
4557
4558 type AvailableServiceAliasesResult struct {
4559 autorest.Response `json:"-"`
4560
4561 Value *[]AvailableServiceAlias `json:"value,omitempty"`
4562
4563 NextLink *string `json:"nextLink,omitempty"`
4564 }
4565
4566
4567 func (asar AvailableServiceAliasesResult) MarshalJSON() ([]byte, error) {
4568 objectMap := make(map[string]interface{})
4569 if asar.Value != nil {
4570 objectMap["value"] = asar.Value
4571 }
4572 return json.Marshal(objectMap)
4573 }
4574
4575
4576
4577 type AvailableServiceAliasesResultIterator struct {
4578 i int
4579 page AvailableServiceAliasesResultPage
4580 }
4581
4582
4583
4584 func (iter *AvailableServiceAliasesResultIterator) NextWithContext(ctx context.Context) (err error) {
4585 if tracing.IsEnabled() {
4586 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesResultIterator.NextWithContext")
4587 defer func() {
4588 sc := -1
4589 if iter.Response().Response.Response != nil {
4590 sc = iter.Response().Response.Response.StatusCode
4591 }
4592 tracing.EndSpan(ctx, sc, err)
4593 }()
4594 }
4595 iter.i++
4596 if iter.i < len(iter.page.Values()) {
4597 return nil
4598 }
4599 err = iter.page.NextWithContext(ctx)
4600 if err != nil {
4601 iter.i--
4602 return err
4603 }
4604 iter.i = 0
4605 return nil
4606 }
4607
4608
4609
4610
4611 func (iter *AvailableServiceAliasesResultIterator) Next() error {
4612 return iter.NextWithContext(context.Background())
4613 }
4614
4615
4616 func (iter AvailableServiceAliasesResultIterator) NotDone() bool {
4617 return iter.page.NotDone() && iter.i < len(iter.page.Values())
4618 }
4619
4620
4621 func (iter AvailableServiceAliasesResultIterator) Response() AvailableServiceAliasesResult {
4622 return iter.page.Response()
4623 }
4624
4625
4626
4627 func (iter AvailableServiceAliasesResultIterator) Value() AvailableServiceAlias {
4628 if !iter.page.NotDone() {
4629 return AvailableServiceAlias{}
4630 }
4631 return iter.page.Values()[iter.i]
4632 }
4633
4634
4635 func NewAvailableServiceAliasesResultIterator(page AvailableServiceAliasesResultPage) AvailableServiceAliasesResultIterator {
4636 return AvailableServiceAliasesResultIterator{page: page}
4637 }
4638
4639
4640 func (asar AvailableServiceAliasesResult) IsEmpty() bool {
4641 return asar.Value == nil || len(*asar.Value) == 0
4642 }
4643
4644
4645 func (asar AvailableServiceAliasesResult) hasNextLink() bool {
4646 return asar.NextLink != nil && len(*asar.NextLink) != 0
4647 }
4648
4649
4650
4651 func (asar AvailableServiceAliasesResult) availableServiceAliasesResultPreparer(ctx context.Context) (*http.Request, error) {
4652 if !asar.hasNextLink() {
4653 return nil, nil
4654 }
4655 return autorest.Prepare((&http.Request{}).WithContext(ctx),
4656 autorest.AsJSON(),
4657 autorest.AsGet(),
4658 autorest.WithBaseURL(to.String(asar.NextLink)))
4659 }
4660
4661
4662 type AvailableServiceAliasesResultPage struct {
4663 fn func(context.Context, AvailableServiceAliasesResult) (AvailableServiceAliasesResult, error)
4664 asar AvailableServiceAliasesResult
4665 }
4666
4667
4668
4669 func (page *AvailableServiceAliasesResultPage) NextWithContext(ctx context.Context) (err error) {
4670 if tracing.IsEnabled() {
4671 ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceAliasesResultPage.NextWithContext")
4672 defer func() {
4673 sc := -1
4674 if page.Response().Response.Response != nil {
4675 sc = page.Response().Response.Response.StatusCode
4676 }
4677 tracing.EndSpan(ctx, sc, err)
4678 }()
4679 }
4680 for {
4681 next, err := page.fn(ctx, page.asar)
4682 if err != nil {
4683 return err
4684 }
4685 page.asar = next
4686 if !next.hasNextLink() || !next.IsEmpty() {
4687 break
4688 }
4689 }
4690 return nil
4691 }
4692
4693
4694
4695
4696 func (page *AvailableServiceAliasesResultPage) Next() error {
4697 return page.NextWithContext(context.Background())
4698 }
4699
4700
4701 func (page AvailableServiceAliasesResultPage) NotDone() bool {
4702 return !page.asar.IsEmpty()
4703 }
4704
4705
4706 func (page AvailableServiceAliasesResultPage) Response() AvailableServiceAliasesResult {
4707 return page.asar
4708 }
4709
4710
4711 func (page AvailableServiceAliasesResultPage) Values() []AvailableServiceAlias {
4712 if page.asar.IsEmpty() {
4713 return nil
4714 }
4715 return *page.asar.Value
4716 }
4717
4718
4719 func NewAvailableServiceAliasesResultPage(cur AvailableServiceAliasesResult, getNextPage func(context.Context, AvailableServiceAliasesResult) (AvailableServiceAliasesResult, error)) AvailableServiceAliasesResultPage {
4720 return AvailableServiceAliasesResultPage{
4721 fn: getNextPage,
4722 asar: cur,
4723 }
4724 }
4725
4726
4727
4728
4729
4730
4731
4732 type AzureAsyncOperationResult struct {
4733
4734 Status OperationStatus `json:"status,omitempty"`
4735
4736 Error *Error `json:"error,omitempty"`
4737 }
4738
4739
4740 type AzureFirewall struct {
4741 autorest.Response `json:"-"`
4742
4743 *AzureFirewallPropertiesFormat `json:"properties,omitempty"`
4744
4745 Zones *[]string `json:"zones,omitempty"`
4746
4747 Etag *string `json:"etag,omitempty"`
4748
4749 ID *string `json:"id,omitempty"`
4750
4751 Name *string `json:"name,omitempty"`
4752
4753 Type *string `json:"type,omitempty"`
4754
4755 Location *string `json:"location,omitempty"`
4756
4757 Tags map[string]*string `json:"tags"`
4758 }
4759
4760
4761 func (af AzureFirewall) MarshalJSON() ([]byte, error) {
4762 objectMap := make(map[string]interface{})
4763 if af.AzureFirewallPropertiesFormat != nil {
4764 objectMap["properties"] = af.AzureFirewallPropertiesFormat
4765 }
4766 if af.Zones != nil {
4767 objectMap["zones"] = af.Zones
4768 }
4769 if af.ID != nil {
4770 objectMap["id"] = af.ID
4771 }
4772 if af.Location != nil {
4773 objectMap["location"] = af.Location
4774 }
4775 if af.Tags != nil {
4776 objectMap["tags"] = af.Tags
4777 }
4778 return json.Marshal(objectMap)
4779 }
4780
4781
4782 func (af *AzureFirewall) UnmarshalJSON(body []byte) error {
4783 var m map[string]*json.RawMessage
4784 err := json.Unmarshal(body, &m)
4785 if err != nil {
4786 return err
4787 }
4788 for k, v := range m {
4789 switch k {
4790 case "properties":
4791 if v != nil {
4792 var azureFirewallPropertiesFormat AzureFirewallPropertiesFormat
4793 err = json.Unmarshal(*v, &azureFirewallPropertiesFormat)
4794 if err != nil {
4795 return err
4796 }
4797 af.AzureFirewallPropertiesFormat = &azureFirewallPropertiesFormat
4798 }
4799 case "zones":
4800 if v != nil {
4801 var zones []string
4802 err = json.Unmarshal(*v, &zones)
4803 if err != nil {
4804 return err
4805 }
4806 af.Zones = &zones
4807 }
4808 case "etag":
4809 if v != nil {
4810 var etag string
4811 err = json.Unmarshal(*v, &etag)
4812 if err != nil {
4813 return err
4814 }
4815 af.Etag = &etag
4816 }
4817 case "id":
4818 if v != nil {
4819 var ID string
4820 err = json.Unmarshal(*v, &ID)
4821 if err != nil {
4822 return err
4823 }
4824 af.ID = &ID
4825 }
4826 case "name":
4827 if v != nil {
4828 var name string
4829 err = json.Unmarshal(*v, &name)
4830 if err != nil {
4831 return err
4832 }
4833 af.Name = &name
4834 }
4835 case "type":
4836 if v != nil {
4837 var typeVar string
4838 err = json.Unmarshal(*v, &typeVar)
4839 if err != nil {
4840 return err
4841 }
4842 af.Type = &typeVar
4843 }
4844 case "location":
4845 if v != nil {
4846 var location string
4847 err = json.Unmarshal(*v, &location)
4848 if err != nil {
4849 return err
4850 }
4851 af.Location = &location
4852 }
4853 case "tags":
4854 if v != nil {
4855 var tags map[string]*string
4856 err = json.Unmarshal(*v, &tags)
4857 if err != nil {
4858 return err
4859 }
4860 af.Tags = tags
4861 }
4862 }
4863 }
4864
4865 return nil
4866 }
4867
4868
4869 type AzureFirewallApplicationRule struct {
4870
4871 Name *string `json:"name,omitempty"`
4872
4873 Description *string `json:"description,omitempty"`
4874
4875 SourceAddresses *[]string `json:"sourceAddresses,omitempty"`
4876
4877 Protocols *[]AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"`
4878
4879 TargetFqdns *[]string `json:"targetFqdns,omitempty"`
4880
4881 FqdnTags *[]string `json:"fqdnTags,omitempty"`
4882
4883 SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"`
4884 }
4885
4886
4887 type AzureFirewallApplicationRuleCollection struct {
4888
4889 *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"`
4890
4891 Name *string `json:"name,omitempty"`
4892
4893 Etag *string `json:"etag,omitempty"`
4894
4895 ID *string `json:"id,omitempty"`
4896 }
4897
4898
4899 func (afarc AzureFirewallApplicationRuleCollection) MarshalJSON() ([]byte, error) {
4900 objectMap := make(map[string]interface{})
4901 if afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat != nil {
4902 objectMap["properties"] = afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat
4903 }
4904 if afarc.Name != nil {
4905 objectMap["name"] = afarc.Name
4906 }
4907 if afarc.ID != nil {
4908 objectMap["id"] = afarc.ID
4909 }
4910 return json.Marshal(objectMap)
4911 }
4912
4913
4914 func (afarc *AzureFirewallApplicationRuleCollection) UnmarshalJSON(body []byte) error {
4915 var m map[string]*json.RawMessage
4916 err := json.Unmarshal(body, &m)
4917 if err != nil {
4918 return err
4919 }
4920 for k, v := range m {
4921 switch k {
4922 case "properties":
4923 if v != nil {
4924 var azureFirewallApplicationRuleCollectionPropertiesFormat AzureFirewallApplicationRuleCollectionPropertiesFormat
4925 err = json.Unmarshal(*v, &azureFirewallApplicationRuleCollectionPropertiesFormat)
4926 if err != nil {
4927 return err
4928 }
4929 afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat = &azureFirewallApplicationRuleCollectionPropertiesFormat
4930 }
4931 case "name":
4932 if v != nil {
4933 var name string
4934 err = json.Unmarshal(*v, &name)
4935 if err != nil {
4936 return err
4937 }
4938 afarc.Name = &name
4939 }
4940 case "etag":
4941 if v != nil {
4942 var etag string
4943 err = json.Unmarshal(*v, &etag)
4944 if err != nil {
4945 return err
4946 }
4947 afarc.Etag = &etag
4948 }
4949 case "id":
4950 if v != nil {
4951 var ID string
4952 err = json.Unmarshal(*v, &ID)
4953 if err != nil {
4954 return err
4955 }
4956 afarc.ID = &ID
4957 }
4958 }
4959 }
4960
4961 return nil
4962 }
4963
4964
4965 type AzureFirewallApplicationRuleCollectionPropertiesFormat struct {
4966
4967 Priority *int32 `json:"priority,omitempty"`
4968
4969 Action *AzureFirewallRCAction `json:"action,omitempty"`
4970
4971 Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"`
4972
4973 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
4974 }
4975
4976
4977 func (afarcpf AzureFirewallApplicationRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) {
4978 objectMap := make(map[string]interface{})
4979 if afarcpf.Priority != nil {
4980 objectMap["priority"] = afarcpf.Priority
4981 }
4982 if afarcpf.Action != nil {
4983 objectMap["action"] = afarcpf.Action
4984 }
4985 if afarcpf.Rules != nil {
4986 objectMap["rules"] = afarcpf.Rules
4987 }
4988 return json.Marshal(objectMap)
4989 }
4990
4991
4992 type AzureFirewallApplicationRuleProtocol struct {
4993
4994 ProtocolType AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"`
4995
4996 Port *int32 `json:"port,omitempty"`
4997 }
4998
4999
5000 type AzureFirewallFqdnTag struct {
5001
5002 *AzureFirewallFqdnTagPropertiesFormat `json:"properties,omitempty"`
5003
5004 Etag *string `json:"etag,omitempty"`
5005
5006 ID *string `json:"id,omitempty"`
5007
5008 Name *string `json:"name,omitempty"`
5009
5010 Type *string `json:"type,omitempty"`
5011
5012 Location *string `json:"location,omitempty"`
5013
5014 Tags map[string]*string `json:"tags"`
5015 }
5016
5017
5018 func (afft AzureFirewallFqdnTag) MarshalJSON() ([]byte, error) {
5019 objectMap := make(map[string]interface{})
5020 if afft.AzureFirewallFqdnTagPropertiesFormat != nil {
5021 objectMap["properties"] = afft.AzureFirewallFqdnTagPropertiesFormat
5022 }
5023 if afft.ID != nil {
5024 objectMap["id"] = afft.ID
5025 }
5026 if afft.Location != nil {
5027 objectMap["location"] = afft.Location
5028 }
5029 if afft.Tags != nil {
5030 objectMap["tags"] = afft.Tags
5031 }
5032 return json.Marshal(objectMap)
5033 }
5034
5035
5036 func (afft *AzureFirewallFqdnTag) UnmarshalJSON(body []byte) error {
5037 var m map[string]*json.RawMessage
5038 err := json.Unmarshal(body, &m)
5039 if err != nil {
5040 return err
5041 }
5042 for k, v := range m {
5043 switch k {
5044 case "properties":
5045 if v != nil {
5046 var azureFirewallFqdnTagPropertiesFormat AzureFirewallFqdnTagPropertiesFormat
5047 err = json.Unmarshal(*v, &azureFirewallFqdnTagPropertiesFormat)
5048 if err != nil {
5049 return err
5050 }
5051 afft.AzureFirewallFqdnTagPropertiesFormat = &azureFirewallFqdnTagPropertiesFormat
5052 }
5053 case "etag":
5054 if v != nil {
5055 var etag string
5056 err = json.Unmarshal(*v, &etag)
5057 if err != nil {
5058 return err
5059 }
5060 afft.Etag = &etag
5061 }
5062 case "id":
5063 if v != nil {
5064 var ID string
5065 err = json.Unmarshal(*v, &ID)
5066 if err != nil {
5067 return err
5068 }
5069 afft.ID = &ID
5070 }
5071 case "name":
5072 if v != nil {
5073 var name string
5074 err = json.Unmarshal(*v, &name)
5075 if err != nil {
5076 return err
5077 }
5078 afft.Name = &name
5079 }
5080 case "type":
5081 if v != nil {
5082 var typeVar string
5083 err = json.Unmarshal(*v, &typeVar)
5084 if err != nil {
5085 return err
5086 }
5087 afft.Type = &typeVar
5088 }
5089 case "location":
5090 if v != nil {
5091 var location string
5092 err = json.Unmarshal(*v, &location)
5093 if err != nil {
5094 return err
5095 }
5096 afft.Location = &location
5097 }
5098 case "tags":
5099 if v != nil {
5100 var tags map[string]*string
5101 err = json.Unmarshal(*v, &tags)
5102 if err != nil {
5103 return err
5104 }
5105 afft.Tags = tags
5106 }
5107 }
5108 }
5109
5110 return nil
5111 }
5112
5113
5114 type AzureFirewallFqdnTagListResult struct {
5115 autorest.Response `json:"-"`
5116
5117 Value *[]AzureFirewallFqdnTag `json:"value,omitempty"`
5118
5119 NextLink *string `json:"nextLink,omitempty"`
5120 }
5121
5122
5123
5124 type AzureFirewallFqdnTagListResultIterator struct {
5125 i int
5126 page AzureFirewallFqdnTagListResultPage
5127 }
5128
5129
5130
5131 func (iter *AzureFirewallFqdnTagListResultIterator) NextWithContext(ctx context.Context) (err error) {
5132 if tracing.IsEnabled() {
5133 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagListResultIterator.NextWithContext")
5134 defer func() {
5135 sc := -1
5136 if iter.Response().Response.Response != nil {
5137 sc = iter.Response().Response.Response.StatusCode
5138 }
5139 tracing.EndSpan(ctx, sc, err)
5140 }()
5141 }
5142 iter.i++
5143 if iter.i < len(iter.page.Values()) {
5144 return nil
5145 }
5146 err = iter.page.NextWithContext(ctx)
5147 if err != nil {
5148 iter.i--
5149 return err
5150 }
5151 iter.i = 0
5152 return nil
5153 }
5154
5155
5156
5157
5158 func (iter *AzureFirewallFqdnTagListResultIterator) Next() error {
5159 return iter.NextWithContext(context.Background())
5160 }
5161
5162
5163 func (iter AzureFirewallFqdnTagListResultIterator) NotDone() bool {
5164 return iter.page.NotDone() && iter.i < len(iter.page.Values())
5165 }
5166
5167
5168 func (iter AzureFirewallFqdnTagListResultIterator) Response() AzureFirewallFqdnTagListResult {
5169 return iter.page.Response()
5170 }
5171
5172
5173
5174 func (iter AzureFirewallFqdnTagListResultIterator) Value() AzureFirewallFqdnTag {
5175 if !iter.page.NotDone() {
5176 return AzureFirewallFqdnTag{}
5177 }
5178 return iter.page.Values()[iter.i]
5179 }
5180
5181
5182 func NewAzureFirewallFqdnTagListResultIterator(page AzureFirewallFqdnTagListResultPage) AzureFirewallFqdnTagListResultIterator {
5183 return AzureFirewallFqdnTagListResultIterator{page: page}
5184 }
5185
5186
5187 func (afftlr AzureFirewallFqdnTagListResult) IsEmpty() bool {
5188 return afftlr.Value == nil || len(*afftlr.Value) == 0
5189 }
5190
5191
5192 func (afftlr AzureFirewallFqdnTagListResult) hasNextLink() bool {
5193 return afftlr.NextLink != nil && len(*afftlr.NextLink) != 0
5194 }
5195
5196
5197
5198 func (afftlr AzureFirewallFqdnTagListResult) azureFirewallFqdnTagListResultPreparer(ctx context.Context) (*http.Request, error) {
5199 if !afftlr.hasNextLink() {
5200 return nil, nil
5201 }
5202 return autorest.Prepare((&http.Request{}).WithContext(ctx),
5203 autorest.AsJSON(),
5204 autorest.AsGet(),
5205 autorest.WithBaseURL(to.String(afftlr.NextLink)))
5206 }
5207
5208
5209 type AzureFirewallFqdnTagListResultPage struct {
5210 fn func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error)
5211 afftlr AzureFirewallFqdnTagListResult
5212 }
5213
5214
5215
5216 func (page *AzureFirewallFqdnTagListResultPage) NextWithContext(ctx context.Context) (err error) {
5217 if tracing.IsEnabled() {
5218 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallFqdnTagListResultPage.NextWithContext")
5219 defer func() {
5220 sc := -1
5221 if page.Response().Response.Response != nil {
5222 sc = page.Response().Response.Response.StatusCode
5223 }
5224 tracing.EndSpan(ctx, sc, err)
5225 }()
5226 }
5227 for {
5228 next, err := page.fn(ctx, page.afftlr)
5229 if err != nil {
5230 return err
5231 }
5232 page.afftlr = next
5233 if !next.hasNextLink() || !next.IsEmpty() {
5234 break
5235 }
5236 }
5237 return nil
5238 }
5239
5240
5241
5242
5243 func (page *AzureFirewallFqdnTagListResultPage) Next() error {
5244 return page.NextWithContext(context.Background())
5245 }
5246
5247
5248 func (page AzureFirewallFqdnTagListResultPage) NotDone() bool {
5249 return !page.afftlr.IsEmpty()
5250 }
5251
5252
5253 func (page AzureFirewallFqdnTagListResultPage) Response() AzureFirewallFqdnTagListResult {
5254 return page.afftlr
5255 }
5256
5257
5258 func (page AzureFirewallFqdnTagListResultPage) Values() []AzureFirewallFqdnTag {
5259 if page.afftlr.IsEmpty() {
5260 return nil
5261 }
5262 return *page.afftlr.Value
5263 }
5264
5265
5266 func NewAzureFirewallFqdnTagListResultPage(cur AzureFirewallFqdnTagListResult, getNextPage func(context.Context, AzureFirewallFqdnTagListResult) (AzureFirewallFqdnTagListResult, error)) AzureFirewallFqdnTagListResultPage {
5267 return AzureFirewallFqdnTagListResultPage{
5268 fn: getNextPage,
5269 afftlr: cur,
5270 }
5271 }
5272
5273
5274 type AzureFirewallFqdnTagPropertiesFormat struct {
5275
5276 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
5277
5278 FqdnTagName *string `json:"fqdnTagName,omitempty"`
5279 }
5280
5281
5282 func (afftpf AzureFirewallFqdnTagPropertiesFormat) MarshalJSON() ([]byte, error) {
5283 objectMap := make(map[string]interface{})
5284 return json.Marshal(objectMap)
5285 }
5286
5287
5288 type AzureFirewallIPConfiguration struct {
5289
5290 *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"`
5291
5292 Name *string `json:"name,omitempty"`
5293
5294 Etag *string `json:"etag,omitempty"`
5295
5296 Type *string `json:"type,omitempty"`
5297
5298 ID *string `json:"id,omitempty"`
5299 }
5300
5301
5302 func (afic AzureFirewallIPConfiguration) MarshalJSON() ([]byte, error) {
5303 objectMap := make(map[string]interface{})
5304 if afic.AzureFirewallIPConfigurationPropertiesFormat != nil {
5305 objectMap["properties"] = afic.AzureFirewallIPConfigurationPropertiesFormat
5306 }
5307 if afic.Name != nil {
5308 objectMap["name"] = afic.Name
5309 }
5310 if afic.ID != nil {
5311 objectMap["id"] = afic.ID
5312 }
5313 return json.Marshal(objectMap)
5314 }
5315
5316
5317 func (afic *AzureFirewallIPConfiguration) UnmarshalJSON(body []byte) error {
5318 var m map[string]*json.RawMessage
5319 err := json.Unmarshal(body, &m)
5320 if err != nil {
5321 return err
5322 }
5323 for k, v := range m {
5324 switch k {
5325 case "properties":
5326 if v != nil {
5327 var azureFirewallIPConfigurationPropertiesFormat AzureFirewallIPConfigurationPropertiesFormat
5328 err = json.Unmarshal(*v, &azureFirewallIPConfigurationPropertiesFormat)
5329 if err != nil {
5330 return err
5331 }
5332 afic.AzureFirewallIPConfigurationPropertiesFormat = &azureFirewallIPConfigurationPropertiesFormat
5333 }
5334 case "name":
5335 if v != nil {
5336 var name string
5337 err = json.Unmarshal(*v, &name)
5338 if err != nil {
5339 return err
5340 }
5341 afic.Name = &name
5342 }
5343 case "etag":
5344 if v != nil {
5345 var etag string
5346 err = json.Unmarshal(*v, &etag)
5347 if err != nil {
5348 return err
5349 }
5350 afic.Etag = &etag
5351 }
5352 case "type":
5353 if v != nil {
5354 var typeVar string
5355 err = json.Unmarshal(*v, &typeVar)
5356 if err != nil {
5357 return err
5358 }
5359 afic.Type = &typeVar
5360 }
5361 case "id":
5362 if v != nil {
5363 var ID string
5364 err = json.Unmarshal(*v, &ID)
5365 if err != nil {
5366 return err
5367 }
5368 afic.ID = &ID
5369 }
5370 }
5371 }
5372
5373 return nil
5374 }
5375
5376
5377 type AzureFirewallIPConfigurationPropertiesFormat struct {
5378
5379 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
5380
5381 Subnet *SubResource `json:"subnet,omitempty"`
5382
5383 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
5384
5385 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
5386 }
5387
5388
5389 func (aficpf AzureFirewallIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
5390 objectMap := make(map[string]interface{})
5391 if aficpf.Subnet != nil {
5392 objectMap["subnet"] = aficpf.Subnet
5393 }
5394 if aficpf.PublicIPAddress != nil {
5395 objectMap["publicIPAddress"] = aficpf.PublicIPAddress
5396 }
5397 return json.Marshal(objectMap)
5398 }
5399
5400
5401 type AzureFirewallIPGroups struct {
5402
5403 ID *string `json:"id,omitempty"`
5404
5405 ChangeNumber *string `json:"changeNumber,omitempty"`
5406 }
5407
5408
5409 func (afig AzureFirewallIPGroups) MarshalJSON() ([]byte, error) {
5410 objectMap := make(map[string]interface{})
5411 return json.Marshal(objectMap)
5412 }
5413
5414
5415 type AzureFirewallListResult struct {
5416 autorest.Response `json:"-"`
5417
5418 Value *[]AzureFirewall `json:"value,omitempty"`
5419
5420 NextLink *string `json:"nextLink,omitempty"`
5421 }
5422
5423
5424 type AzureFirewallListResultIterator struct {
5425 i int
5426 page AzureFirewallListResultPage
5427 }
5428
5429
5430
5431 func (iter *AzureFirewallListResultIterator) NextWithContext(ctx context.Context) (err error) {
5432 if tracing.IsEnabled() {
5433 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultIterator.NextWithContext")
5434 defer func() {
5435 sc := -1
5436 if iter.Response().Response.Response != nil {
5437 sc = iter.Response().Response.Response.StatusCode
5438 }
5439 tracing.EndSpan(ctx, sc, err)
5440 }()
5441 }
5442 iter.i++
5443 if iter.i < len(iter.page.Values()) {
5444 return nil
5445 }
5446 err = iter.page.NextWithContext(ctx)
5447 if err != nil {
5448 iter.i--
5449 return err
5450 }
5451 iter.i = 0
5452 return nil
5453 }
5454
5455
5456
5457
5458 func (iter *AzureFirewallListResultIterator) Next() error {
5459 return iter.NextWithContext(context.Background())
5460 }
5461
5462
5463 func (iter AzureFirewallListResultIterator) NotDone() bool {
5464 return iter.page.NotDone() && iter.i < len(iter.page.Values())
5465 }
5466
5467
5468 func (iter AzureFirewallListResultIterator) Response() AzureFirewallListResult {
5469 return iter.page.Response()
5470 }
5471
5472
5473
5474 func (iter AzureFirewallListResultIterator) Value() AzureFirewall {
5475 if !iter.page.NotDone() {
5476 return AzureFirewall{}
5477 }
5478 return iter.page.Values()[iter.i]
5479 }
5480
5481
5482 func NewAzureFirewallListResultIterator(page AzureFirewallListResultPage) AzureFirewallListResultIterator {
5483 return AzureFirewallListResultIterator{page: page}
5484 }
5485
5486
5487 func (aflr AzureFirewallListResult) IsEmpty() bool {
5488 return aflr.Value == nil || len(*aflr.Value) == 0
5489 }
5490
5491
5492 func (aflr AzureFirewallListResult) hasNextLink() bool {
5493 return aflr.NextLink != nil && len(*aflr.NextLink) != 0
5494 }
5495
5496
5497
5498 func (aflr AzureFirewallListResult) azureFirewallListResultPreparer(ctx context.Context) (*http.Request, error) {
5499 if !aflr.hasNextLink() {
5500 return nil, nil
5501 }
5502 return autorest.Prepare((&http.Request{}).WithContext(ctx),
5503 autorest.AsJSON(),
5504 autorest.AsGet(),
5505 autorest.WithBaseURL(to.String(aflr.NextLink)))
5506 }
5507
5508
5509 type AzureFirewallListResultPage struct {
5510 fn func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error)
5511 aflr AzureFirewallListResult
5512 }
5513
5514
5515
5516 func (page *AzureFirewallListResultPage) NextWithContext(ctx context.Context) (err error) {
5517 if tracing.IsEnabled() {
5518 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultPage.NextWithContext")
5519 defer func() {
5520 sc := -1
5521 if page.Response().Response.Response != nil {
5522 sc = page.Response().Response.Response.StatusCode
5523 }
5524 tracing.EndSpan(ctx, sc, err)
5525 }()
5526 }
5527 for {
5528 next, err := page.fn(ctx, page.aflr)
5529 if err != nil {
5530 return err
5531 }
5532 page.aflr = next
5533 if !next.hasNextLink() || !next.IsEmpty() {
5534 break
5535 }
5536 }
5537 return nil
5538 }
5539
5540
5541
5542
5543 func (page *AzureFirewallListResultPage) Next() error {
5544 return page.NextWithContext(context.Background())
5545 }
5546
5547
5548 func (page AzureFirewallListResultPage) NotDone() bool {
5549 return !page.aflr.IsEmpty()
5550 }
5551
5552
5553 func (page AzureFirewallListResultPage) Response() AzureFirewallListResult {
5554 return page.aflr
5555 }
5556
5557
5558 func (page AzureFirewallListResultPage) Values() []AzureFirewall {
5559 if page.aflr.IsEmpty() {
5560 return nil
5561 }
5562 return *page.aflr.Value
5563 }
5564
5565
5566 func NewAzureFirewallListResultPage(cur AzureFirewallListResult, getNextPage func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error)) AzureFirewallListResultPage {
5567 return AzureFirewallListResultPage{
5568 fn: getNextPage,
5569 aflr: cur,
5570 }
5571 }
5572
5573
5574 type AzureFirewallNatRCAction struct {
5575
5576 Type AzureFirewallNatRCActionType `json:"type,omitempty"`
5577 }
5578
5579
5580 type AzureFirewallNatRule struct {
5581
5582 Name *string `json:"name,omitempty"`
5583
5584 Description *string `json:"description,omitempty"`
5585
5586 SourceAddresses *[]string `json:"sourceAddresses,omitempty"`
5587
5588 DestinationAddresses *[]string `json:"destinationAddresses,omitempty"`
5589
5590 DestinationPorts *[]string `json:"destinationPorts,omitempty"`
5591
5592 Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"`
5593
5594 TranslatedAddress *string `json:"translatedAddress,omitempty"`
5595
5596 TranslatedPort *string `json:"translatedPort,omitempty"`
5597
5598 TranslatedFqdn *string `json:"translatedFqdn,omitempty"`
5599
5600 SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"`
5601 }
5602
5603
5604 type AzureFirewallNatRuleCollection struct {
5605
5606 *AzureFirewallNatRuleCollectionProperties `json:"properties,omitempty"`
5607
5608 Name *string `json:"name,omitempty"`
5609
5610 Etag *string `json:"etag,omitempty"`
5611
5612 ID *string `json:"id,omitempty"`
5613 }
5614
5615
5616 func (afnrc AzureFirewallNatRuleCollection) MarshalJSON() ([]byte, error) {
5617 objectMap := make(map[string]interface{})
5618 if afnrc.AzureFirewallNatRuleCollectionProperties != nil {
5619 objectMap["properties"] = afnrc.AzureFirewallNatRuleCollectionProperties
5620 }
5621 if afnrc.Name != nil {
5622 objectMap["name"] = afnrc.Name
5623 }
5624 if afnrc.ID != nil {
5625 objectMap["id"] = afnrc.ID
5626 }
5627 return json.Marshal(objectMap)
5628 }
5629
5630
5631 func (afnrc *AzureFirewallNatRuleCollection) UnmarshalJSON(body []byte) error {
5632 var m map[string]*json.RawMessage
5633 err := json.Unmarshal(body, &m)
5634 if err != nil {
5635 return err
5636 }
5637 for k, v := range m {
5638 switch k {
5639 case "properties":
5640 if v != nil {
5641 var azureFirewallNatRuleCollectionProperties AzureFirewallNatRuleCollectionProperties
5642 err = json.Unmarshal(*v, &azureFirewallNatRuleCollectionProperties)
5643 if err != nil {
5644 return err
5645 }
5646 afnrc.AzureFirewallNatRuleCollectionProperties = &azureFirewallNatRuleCollectionProperties
5647 }
5648 case "name":
5649 if v != nil {
5650 var name string
5651 err = json.Unmarshal(*v, &name)
5652 if err != nil {
5653 return err
5654 }
5655 afnrc.Name = &name
5656 }
5657 case "etag":
5658 if v != nil {
5659 var etag string
5660 err = json.Unmarshal(*v, &etag)
5661 if err != nil {
5662 return err
5663 }
5664 afnrc.Etag = &etag
5665 }
5666 case "id":
5667 if v != nil {
5668 var ID string
5669 err = json.Unmarshal(*v, &ID)
5670 if err != nil {
5671 return err
5672 }
5673 afnrc.ID = &ID
5674 }
5675 }
5676 }
5677
5678 return nil
5679 }
5680
5681
5682 type AzureFirewallNatRuleCollectionProperties struct {
5683
5684 Priority *int32 `json:"priority,omitempty"`
5685
5686 Action *AzureFirewallNatRCAction `json:"action,omitempty"`
5687
5688 Rules *[]AzureFirewallNatRule `json:"rules,omitempty"`
5689
5690 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
5691 }
5692
5693
5694 func (afnrcp AzureFirewallNatRuleCollectionProperties) MarshalJSON() ([]byte, error) {
5695 objectMap := make(map[string]interface{})
5696 if afnrcp.Priority != nil {
5697 objectMap["priority"] = afnrcp.Priority
5698 }
5699 if afnrcp.Action != nil {
5700 objectMap["action"] = afnrcp.Action
5701 }
5702 if afnrcp.Rules != nil {
5703 objectMap["rules"] = afnrcp.Rules
5704 }
5705 return json.Marshal(objectMap)
5706 }
5707
5708
5709 type AzureFirewallNetworkRule struct {
5710
5711 Name *string `json:"name,omitempty"`
5712
5713 Description *string `json:"description,omitempty"`
5714
5715 Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"`
5716
5717 SourceAddresses *[]string `json:"sourceAddresses,omitempty"`
5718
5719 DestinationAddresses *[]string `json:"destinationAddresses,omitempty"`
5720
5721 DestinationPorts *[]string `json:"destinationPorts,omitempty"`
5722
5723 DestinationFqdns *[]string `json:"destinationFqdns,omitempty"`
5724
5725 SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"`
5726
5727 DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"`
5728 }
5729
5730
5731 type AzureFirewallNetworkRuleCollection struct {
5732
5733 *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"`
5734
5735 Name *string `json:"name,omitempty"`
5736
5737 Etag *string `json:"etag,omitempty"`
5738
5739 ID *string `json:"id,omitempty"`
5740 }
5741
5742
5743 func (afnrc AzureFirewallNetworkRuleCollection) MarshalJSON() ([]byte, error) {
5744 objectMap := make(map[string]interface{})
5745 if afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat != nil {
5746 objectMap["properties"] = afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat
5747 }
5748 if afnrc.Name != nil {
5749 objectMap["name"] = afnrc.Name
5750 }
5751 if afnrc.ID != nil {
5752 objectMap["id"] = afnrc.ID
5753 }
5754 return json.Marshal(objectMap)
5755 }
5756
5757
5758 func (afnrc *AzureFirewallNetworkRuleCollection) UnmarshalJSON(body []byte) error {
5759 var m map[string]*json.RawMessage
5760 err := json.Unmarshal(body, &m)
5761 if err != nil {
5762 return err
5763 }
5764 for k, v := range m {
5765 switch k {
5766 case "properties":
5767 if v != nil {
5768 var azureFirewallNetworkRuleCollectionPropertiesFormat AzureFirewallNetworkRuleCollectionPropertiesFormat
5769 err = json.Unmarshal(*v, &azureFirewallNetworkRuleCollectionPropertiesFormat)
5770 if err != nil {
5771 return err
5772 }
5773 afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat = &azureFirewallNetworkRuleCollectionPropertiesFormat
5774 }
5775 case "name":
5776 if v != nil {
5777 var name string
5778 err = json.Unmarshal(*v, &name)
5779 if err != nil {
5780 return err
5781 }
5782 afnrc.Name = &name
5783 }
5784 case "etag":
5785 if v != nil {
5786 var etag string
5787 err = json.Unmarshal(*v, &etag)
5788 if err != nil {
5789 return err
5790 }
5791 afnrc.Etag = &etag
5792 }
5793 case "id":
5794 if v != nil {
5795 var ID string
5796 err = json.Unmarshal(*v, &ID)
5797 if err != nil {
5798 return err
5799 }
5800 afnrc.ID = &ID
5801 }
5802 }
5803 }
5804
5805 return nil
5806 }
5807
5808
5809 type AzureFirewallNetworkRuleCollectionPropertiesFormat struct {
5810
5811 Priority *int32 `json:"priority,omitempty"`
5812
5813 Action *AzureFirewallRCAction `json:"action,omitempty"`
5814
5815 Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"`
5816
5817 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
5818 }
5819
5820
5821 func (afnrcpf AzureFirewallNetworkRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) {
5822 objectMap := make(map[string]interface{})
5823 if afnrcpf.Priority != nil {
5824 objectMap["priority"] = afnrcpf.Priority
5825 }
5826 if afnrcpf.Action != nil {
5827 objectMap["action"] = afnrcpf.Action
5828 }
5829 if afnrcpf.Rules != nil {
5830 objectMap["rules"] = afnrcpf.Rules
5831 }
5832 return json.Marshal(objectMap)
5833 }
5834
5835
5836 type AzureFirewallPropertiesFormat struct {
5837
5838 ApplicationRuleCollections *[]AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"`
5839
5840 NatRuleCollections *[]AzureFirewallNatRuleCollection `json:"natRuleCollections,omitempty"`
5841
5842 NetworkRuleCollections *[]AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"`
5843
5844 IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"`
5845
5846 ManagementIPConfiguration *AzureFirewallIPConfiguration `json:"managementIpConfiguration,omitempty"`
5847
5848 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
5849
5850 ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"`
5851
5852 VirtualHub *SubResource `json:"virtualHub,omitempty"`
5853
5854 FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"`
5855
5856 HubIPAddresses *HubIPAddresses `json:"hubIpAddresses,omitempty"`
5857
5858 IPGroups *[]AzureFirewallIPGroups `json:"ipGroups,omitempty"`
5859
5860 Sku *AzureFirewallSku `json:"sku,omitempty"`
5861
5862 AdditionalProperties map[string]*string `json:"additionalProperties"`
5863 }
5864
5865
5866 func (afpf AzureFirewallPropertiesFormat) MarshalJSON() ([]byte, error) {
5867 objectMap := make(map[string]interface{})
5868 if afpf.ApplicationRuleCollections != nil {
5869 objectMap["applicationRuleCollections"] = afpf.ApplicationRuleCollections
5870 }
5871 if afpf.NatRuleCollections != nil {
5872 objectMap["natRuleCollections"] = afpf.NatRuleCollections
5873 }
5874 if afpf.NetworkRuleCollections != nil {
5875 objectMap["networkRuleCollections"] = afpf.NetworkRuleCollections
5876 }
5877 if afpf.IPConfigurations != nil {
5878 objectMap["ipConfigurations"] = afpf.IPConfigurations
5879 }
5880 if afpf.ManagementIPConfiguration != nil {
5881 objectMap["managementIpConfiguration"] = afpf.ManagementIPConfiguration
5882 }
5883 if afpf.ThreatIntelMode != "" {
5884 objectMap["threatIntelMode"] = afpf.ThreatIntelMode
5885 }
5886 if afpf.VirtualHub != nil {
5887 objectMap["virtualHub"] = afpf.VirtualHub
5888 }
5889 if afpf.FirewallPolicy != nil {
5890 objectMap["firewallPolicy"] = afpf.FirewallPolicy
5891 }
5892 if afpf.Sku != nil {
5893 objectMap["sku"] = afpf.Sku
5894 }
5895 if afpf.AdditionalProperties != nil {
5896 objectMap["additionalProperties"] = afpf.AdditionalProperties
5897 }
5898 return json.Marshal(objectMap)
5899 }
5900
5901
5902 type AzureFirewallPublicIPAddress struct {
5903
5904 Address *string `json:"address,omitempty"`
5905 }
5906
5907
5908 type AzureFirewallRCAction struct {
5909
5910 Type AzureFirewallRCActionType `json:"type,omitempty"`
5911 }
5912
5913
5914
5915 type AzureFirewallsCreateOrUpdateFuture struct {
5916 azure.FutureAPI
5917
5918
5919 Result func(AzureFirewallsClient) (AzureFirewall, error)
5920 }
5921
5922
5923 func (future *AzureFirewallsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5924 var azFuture azure.Future
5925 if err := json.Unmarshal(body, &azFuture); err != nil {
5926 return err
5927 }
5928 future.FutureAPI = &azFuture
5929 future.Result = future.result
5930 return nil
5931 }
5932
5933
5934 func (future *AzureFirewallsCreateOrUpdateFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) {
5935 var done bool
5936 done, err = future.DoneWithContext(context.Background(), client)
5937 if err != nil {
5938 err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5939 return
5940 }
5941 if !done {
5942 af.Response.Response = future.Response()
5943 err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsCreateOrUpdateFuture")
5944 return
5945 }
5946 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5947 if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent {
5948 af, err = client.CreateOrUpdateResponder(af.Response.Response)
5949 if err != nil {
5950 err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", af.Response.Response, "Failure responding to request")
5951 }
5952 }
5953 return
5954 }
5955
5956
5957
5958 type AzureFirewallsDeleteFuture struct {
5959 azure.FutureAPI
5960
5961
5962 Result func(AzureFirewallsClient) (autorest.Response, error)
5963 }
5964
5965
5966 func (future *AzureFirewallsDeleteFuture) UnmarshalJSON(body []byte) error {
5967 var azFuture azure.Future
5968 if err := json.Unmarshal(body, &azFuture); err != nil {
5969 return err
5970 }
5971 future.FutureAPI = &azFuture
5972 future.Result = future.result
5973 return nil
5974 }
5975
5976
5977 func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (ar autorest.Response, err error) {
5978 var done bool
5979 done, err = future.DoneWithContext(context.Background(), client)
5980 if err != nil {
5981 err = autorest.NewErrorWithError(err, "network.AzureFirewallsDeleteFuture", "Result", future.Response(), "Polling failure")
5982 return
5983 }
5984 if !done {
5985 ar.Response = future.Response()
5986 err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsDeleteFuture")
5987 return
5988 }
5989 ar.Response = future.Response()
5990 return
5991 }
5992
5993
5994 type AzureFirewallSku struct {
5995
5996 Name AzureFirewallSkuName `json:"name,omitempty"`
5997
5998 Tier AzureFirewallSkuTier `json:"tier,omitempty"`
5999 }
6000
6001
6002
6003 type AzureFirewallsUpdateTagsFuture struct {
6004 azure.FutureAPI
6005
6006
6007 Result func(AzureFirewallsClient) (AzureFirewall, error)
6008 }
6009
6010
6011 func (future *AzureFirewallsUpdateTagsFuture) UnmarshalJSON(body []byte) error {
6012 var azFuture azure.Future
6013 if err := json.Unmarshal(body, &azFuture); err != nil {
6014 return err
6015 }
6016 future.FutureAPI = &azFuture
6017 future.Result = future.result
6018 return nil
6019 }
6020
6021
6022 func (future *AzureFirewallsUpdateTagsFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) {
6023 var done bool
6024 done, err = future.DoneWithContext(context.Background(), client)
6025 if err != nil {
6026 err = autorest.NewErrorWithError(err, "network.AzureFirewallsUpdateTagsFuture", "Result", future.Response(), "Polling failure")
6027 return
6028 }
6029 if !done {
6030 af.Response.Response = future.Response()
6031 err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsUpdateTagsFuture")
6032 return
6033 }
6034 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6035 if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent {
6036 af, err = client.UpdateTagsResponder(af.Response.Response)
6037 if err != nil {
6038 err = autorest.NewErrorWithError(err, "network.AzureFirewallsUpdateTagsFuture", "Result", af.Response.Response, "Failure responding to request")
6039 }
6040 }
6041 return
6042 }
6043
6044
6045 type AzureReachabilityReport struct {
6046 autorest.Response `json:"-"`
6047
6048 AggregationLevel *string `json:"aggregationLevel,omitempty"`
6049
6050 ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"`
6051
6052 ReachabilityReport *[]AzureReachabilityReportItem `json:"reachabilityReport,omitempty"`
6053 }
6054
6055
6056 type AzureReachabilityReportItem struct {
6057
6058 Provider *string `json:"provider,omitempty"`
6059
6060 AzureLocation *string `json:"azureLocation,omitempty"`
6061
6062 Latencies *[]AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"`
6063 }
6064
6065
6066 type AzureReachabilityReportLatencyInfo struct {
6067
6068 TimeStamp *date.Time `json:"timeStamp,omitempty"`
6069
6070 Score *int32 `json:"score,omitempty"`
6071 }
6072
6073
6074 type AzureReachabilityReportLocation struct {
6075
6076 Country *string `json:"country,omitempty"`
6077
6078 State *string `json:"state,omitempty"`
6079
6080 City *string `json:"city,omitempty"`
6081 }
6082
6083
6084 type AzureReachabilityReportParameters struct {
6085
6086 ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"`
6087
6088 Providers *[]string `json:"providers,omitempty"`
6089
6090 AzureLocations *[]string `json:"azureLocations,omitempty"`
6091
6092 StartTime *date.Time `json:"startTime,omitempty"`
6093
6094 EndTime *date.Time `json:"endTime,omitempty"`
6095 }
6096
6097
6098 type BackendAddressPool struct {
6099 autorest.Response `json:"-"`
6100
6101 *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"`
6102
6103 Name *string `json:"name,omitempty"`
6104
6105 Etag *string `json:"etag,omitempty"`
6106
6107 Type *string `json:"type,omitempty"`
6108
6109 ID *string `json:"id,omitempty"`
6110 }
6111
6112
6113 func (bap BackendAddressPool) MarshalJSON() ([]byte, error) {
6114 objectMap := make(map[string]interface{})
6115 if bap.BackendAddressPoolPropertiesFormat != nil {
6116 objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat
6117 }
6118 if bap.Name != nil {
6119 objectMap["name"] = bap.Name
6120 }
6121 if bap.ID != nil {
6122 objectMap["id"] = bap.ID
6123 }
6124 return json.Marshal(objectMap)
6125 }
6126
6127
6128 func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error {
6129 var m map[string]*json.RawMessage
6130 err := json.Unmarshal(body, &m)
6131 if err != nil {
6132 return err
6133 }
6134 for k, v := range m {
6135 switch k {
6136 case "properties":
6137 if v != nil {
6138 var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat
6139 err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat)
6140 if err != nil {
6141 return err
6142 }
6143 bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat
6144 }
6145 case "name":
6146 if v != nil {
6147 var name string
6148 err = json.Unmarshal(*v, &name)
6149 if err != nil {
6150 return err
6151 }
6152 bap.Name = &name
6153 }
6154 case "etag":
6155 if v != nil {
6156 var etag string
6157 err = json.Unmarshal(*v, &etag)
6158 if err != nil {
6159 return err
6160 }
6161 bap.Etag = &etag
6162 }
6163 case "type":
6164 if v != nil {
6165 var typeVar string
6166 err = json.Unmarshal(*v, &typeVar)
6167 if err != nil {
6168 return err
6169 }
6170 bap.Type = &typeVar
6171 }
6172 case "id":
6173 if v != nil {
6174 var ID string
6175 err = json.Unmarshal(*v, &ID)
6176 if err != nil {
6177 return err
6178 }
6179 bap.ID = &ID
6180 }
6181 }
6182 }
6183
6184 return nil
6185 }
6186
6187
6188 type BackendAddressPoolPropertiesFormat struct {
6189
6190 LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"`
6191
6192 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
6193
6194 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
6195
6196 OutboundRule *SubResource `json:"outboundRule,omitempty"`
6197
6198 OutboundRules *[]SubResource `json:"outboundRules,omitempty"`
6199
6200 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
6201 }
6202
6203
6204 func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) {
6205 objectMap := make(map[string]interface{})
6206 if bappf.LoadBalancerBackendAddresses != nil {
6207 objectMap["loadBalancerBackendAddresses"] = bappf.LoadBalancerBackendAddresses
6208 }
6209 return json.Marshal(objectMap)
6210 }
6211
6212
6213 type BastionActiveSession struct {
6214
6215 SessionID *string `json:"sessionId,omitempty"`
6216
6217 StartTime interface{} `json:"startTime,omitempty"`
6218
6219 TargetSubscriptionID *string `json:"targetSubscriptionId,omitempty"`
6220
6221 ResourceType *string `json:"resourceType,omitempty"`
6222
6223 TargetHostName *string `json:"targetHostName,omitempty"`
6224
6225 TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
6226
6227 UserName *string `json:"userName,omitempty"`
6228
6229 TargetIPAddress *string `json:"targetIpAddress,omitempty"`
6230
6231 Protocol BastionConnectProtocol `json:"protocol,omitempty"`
6232
6233 TargetResourceID *string `json:"targetResourceId,omitempty"`
6234
6235 SessionDurationInMins *float64 `json:"sessionDurationInMins,omitempty"`
6236 }
6237
6238
6239 func (bas BastionActiveSession) MarshalJSON() ([]byte, error) {
6240 objectMap := make(map[string]interface{})
6241 return json.Marshal(objectMap)
6242 }
6243
6244
6245 type BastionActiveSessionListResult struct {
6246 autorest.Response `json:"-"`
6247
6248 Value *[]BastionActiveSession `json:"value,omitempty"`
6249
6250 NextLink *string `json:"nextLink,omitempty"`
6251 }
6252
6253
6254
6255 type BastionActiveSessionListResultIterator struct {
6256 i int
6257 page BastionActiveSessionListResultPage
6258 }
6259
6260
6261
6262 func (iter *BastionActiveSessionListResultIterator) NextWithContext(ctx context.Context) (err error) {
6263 if tracing.IsEnabled() {
6264 ctx = tracing.StartSpan(ctx, fqdn+"/BastionActiveSessionListResultIterator.NextWithContext")
6265 defer func() {
6266 sc := -1
6267 if iter.Response().Response.Response != nil {
6268 sc = iter.Response().Response.Response.StatusCode
6269 }
6270 tracing.EndSpan(ctx, sc, err)
6271 }()
6272 }
6273 iter.i++
6274 if iter.i < len(iter.page.Values()) {
6275 return nil
6276 }
6277 err = iter.page.NextWithContext(ctx)
6278 if err != nil {
6279 iter.i--
6280 return err
6281 }
6282 iter.i = 0
6283 return nil
6284 }
6285
6286
6287
6288
6289 func (iter *BastionActiveSessionListResultIterator) Next() error {
6290 return iter.NextWithContext(context.Background())
6291 }
6292
6293
6294 func (iter BastionActiveSessionListResultIterator) NotDone() bool {
6295 return iter.page.NotDone() && iter.i < len(iter.page.Values())
6296 }
6297
6298
6299 func (iter BastionActiveSessionListResultIterator) Response() BastionActiveSessionListResult {
6300 return iter.page.Response()
6301 }
6302
6303
6304
6305 func (iter BastionActiveSessionListResultIterator) Value() BastionActiveSession {
6306 if !iter.page.NotDone() {
6307 return BastionActiveSession{}
6308 }
6309 return iter.page.Values()[iter.i]
6310 }
6311
6312
6313 func NewBastionActiveSessionListResultIterator(page BastionActiveSessionListResultPage) BastionActiveSessionListResultIterator {
6314 return BastionActiveSessionListResultIterator{page: page}
6315 }
6316
6317
6318 func (baslr BastionActiveSessionListResult) IsEmpty() bool {
6319 return baslr.Value == nil || len(*baslr.Value) == 0
6320 }
6321
6322
6323 func (baslr BastionActiveSessionListResult) hasNextLink() bool {
6324 return baslr.NextLink != nil && len(*baslr.NextLink) != 0
6325 }
6326
6327
6328
6329 func (baslr BastionActiveSessionListResult) bastionActiveSessionListResultPreparer(ctx context.Context) (*http.Request, error) {
6330 if !baslr.hasNextLink() {
6331 return nil, nil
6332 }
6333 return autorest.Prepare((&http.Request{}).WithContext(ctx),
6334 autorest.AsJSON(),
6335 autorest.AsGet(),
6336 autorest.WithBaseURL(to.String(baslr.NextLink)))
6337 }
6338
6339
6340 type BastionActiveSessionListResultPage struct {
6341 fn func(context.Context, BastionActiveSessionListResult) (BastionActiveSessionListResult, error)
6342 baslr BastionActiveSessionListResult
6343 }
6344
6345
6346
6347 func (page *BastionActiveSessionListResultPage) NextWithContext(ctx context.Context) (err error) {
6348 if tracing.IsEnabled() {
6349 ctx = tracing.StartSpan(ctx, fqdn+"/BastionActiveSessionListResultPage.NextWithContext")
6350 defer func() {
6351 sc := -1
6352 if page.Response().Response.Response != nil {
6353 sc = page.Response().Response.Response.StatusCode
6354 }
6355 tracing.EndSpan(ctx, sc, err)
6356 }()
6357 }
6358 for {
6359 next, err := page.fn(ctx, page.baslr)
6360 if err != nil {
6361 return err
6362 }
6363 page.baslr = next
6364 if !next.hasNextLink() || !next.IsEmpty() {
6365 break
6366 }
6367 }
6368 return nil
6369 }
6370
6371
6372
6373
6374 func (page *BastionActiveSessionListResultPage) Next() error {
6375 return page.NextWithContext(context.Background())
6376 }
6377
6378
6379 func (page BastionActiveSessionListResultPage) NotDone() bool {
6380 return !page.baslr.IsEmpty()
6381 }
6382
6383
6384 func (page BastionActiveSessionListResultPage) Response() BastionActiveSessionListResult {
6385 return page.baslr
6386 }
6387
6388
6389 func (page BastionActiveSessionListResultPage) Values() []BastionActiveSession {
6390 if page.baslr.IsEmpty() {
6391 return nil
6392 }
6393 return *page.baslr.Value
6394 }
6395
6396
6397 func NewBastionActiveSessionListResultPage(cur BastionActiveSessionListResult, getNextPage func(context.Context, BastionActiveSessionListResult) (BastionActiveSessionListResult, error)) BastionActiveSessionListResultPage {
6398 return BastionActiveSessionListResultPage{
6399 fn: getNextPage,
6400 baslr: cur,
6401 }
6402 }
6403
6404
6405 type BastionHost struct {
6406 autorest.Response `json:"-"`
6407
6408 *BastionHostPropertiesFormat `json:"properties,omitempty"`
6409
6410 Etag *string `json:"etag,omitempty"`
6411
6412 ID *string `json:"id,omitempty"`
6413
6414 Name *string `json:"name,omitempty"`
6415
6416 Type *string `json:"type,omitempty"`
6417
6418 Location *string `json:"location,omitempty"`
6419
6420 Tags map[string]*string `json:"tags"`
6421 }
6422
6423
6424 func (bh BastionHost) MarshalJSON() ([]byte, error) {
6425 objectMap := make(map[string]interface{})
6426 if bh.BastionHostPropertiesFormat != nil {
6427 objectMap["properties"] = bh.BastionHostPropertiesFormat
6428 }
6429 if bh.ID != nil {
6430 objectMap["id"] = bh.ID
6431 }
6432 if bh.Location != nil {
6433 objectMap["location"] = bh.Location
6434 }
6435 if bh.Tags != nil {
6436 objectMap["tags"] = bh.Tags
6437 }
6438 return json.Marshal(objectMap)
6439 }
6440
6441
6442 func (bh *BastionHost) UnmarshalJSON(body []byte) error {
6443 var m map[string]*json.RawMessage
6444 err := json.Unmarshal(body, &m)
6445 if err != nil {
6446 return err
6447 }
6448 for k, v := range m {
6449 switch k {
6450 case "properties":
6451 if v != nil {
6452 var bastionHostPropertiesFormat BastionHostPropertiesFormat
6453 err = json.Unmarshal(*v, &bastionHostPropertiesFormat)
6454 if err != nil {
6455 return err
6456 }
6457 bh.BastionHostPropertiesFormat = &bastionHostPropertiesFormat
6458 }
6459 case "etag":
6460 if v != nil {
6461 var etag string
6462 err = json.Unmarshal(*v, &etag)
6463 if err != nil {
6464 return err
6465 }
6466 bh.Etag = &etag
6467 }
6468 case "id":
6469 if v != nil {
6470 var ID string
6471 err = json.Unmarshal(*v, &ID)
6472 if err != nil {
6473 return err
6474 }
6475 bh.ID = &ID
6476 }
6477 case "name":
6478 if v != nil {
6479 var name string
6480 err = json.Unmarshal(*v, &name)
6481 if err != nil {
6482 return err
6483 }
6484 bh.Name = &name
6485 }
6486 case "type":
6487 if v != nil {
6488 var typeVar string
6489 err = json.Unmarshal(*v, &typeVar)
6490 if err != nil {
6491 return err
6492 }
6493 bh.Type = &typeVar
6494 }
6495 case "location":
6496 if v != nil {
6497 var location string
6498 err = json.Unmarshal(*v, &location)
6499 if err != nil {
6500 return err
6501 }
6502 bh.Location = &location
6503 }
6504 case "tags":
6505 if v != nil {
6506 var tags map[string]*string
6507 err = json.Unmarshal(*v, &tags)
6508 if err != nil {
6509 return err
6510 }
6511 bh.Tags = tags
6512 }
6513 }
6514 }
6515
6516 return nil
6517 }
6518
6519
6520 type BastionHostIPConfiguration struct {
6521
6522 *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"`
6523
6524 Name *string `json:"name,omitempty"`
6525
6526 Etag *string `json:"etag,omitempty"`
6527
6528 Type *string `json:"type,omitempty"`
6529
6530 ID *string `json:"id,omitempty"`
6531 }
6532
6533
6534 func (bhic BastionHostIPConfiguration) MarshalJSON() ([]byte, error) {
6535 objectMap := make(map[string]interface{})
6536 if bhic.BastionHostIPConfigurationPropertiesFormat != nil {
6537 objectMap["properties"] = bhic.BastionHostIPConfigurationPropertiesFormat
6538 }
6539 if bhic.Name != nil {
6540 objectMap["name"] = bhic.Name
6541 }
6542 if bhic.ID != nil {
6543 objectMap["id"] = bhic.ID
6544 }
6545 return json.Marshal(objectMap)
6546 }
6547
6548
6549 func (bhic *BastionHostIPConfiguration) UnmarshalJSON(body []byte) error {
6550 var m map[string]*json.RawMessage
6551 err := json.Unmarshal(body, &m)
6552 if err != nil {
6553 return err
6554 }
6555 for k, v := range m {
6556 switch k {
6557 case "properties":
6558 if v != nil {
6559 var bastionHostIPConfigurationPropertiesFormat BastionHostIPConfigurationPropertiesFormat
6560 err = json.Unmarshal(*v, &bastionHostIPConfigurationPropertiesFormat)
6561 if err != nil {
6562 return err
6563 }
6564 bhic.BastionHostIPConfigurationPropertiesFormat = &bastionHostIPConfigurationPropertiesFormat
6565 }
6566 case "name":
6567 if v != nil {
6568 var name string
6569 err = json.Unmarshal(*v, &name)
6570 if err != nil {
6571 return err
6572 }
6573 bhic.Name = &name
6574 }
6575 case "etag":
6576 if v != nil {
6577 var etag string
6578 err = json.Unmarshal(*v, &etag)
6579 if err != nil {
6580 return err
6581 }
6582 bhic.Etag = &etag
6583 }
6584 case "type":
6585 if v != nil {
6586 var typeVar string
6587 err = json.Unmarshal(*v, &typeVar)
6588 if err != nil {
6589 return err
6590 }
6591 bhic.Type = &typeVar
6592 }
6593 case "id":
6594 if v != nil {
6595 var ID string
6596 err = json.Unmarshal(*v, &ID)
6597 if err != nil {
6598 return err
6599 }
6600 bhic.ID = &ID
6601 }
6602 }
6603 }
6604
6605 return nil
6606 }
6607
6608
6609 type BastionHostIPConfigurationPropertiesFormat struct {
6610
6611 Subnet *SubResource `json:"subnet,omitempty"`
6612
6613 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
6614
6615 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
6616
6617 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
6618 }
6619
6620
6621 func (bhicpf BastionHostIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
6622 objectMap := make(map[string]interface{})
6623 if bhicpf.Subnet != nil {
6624 objectMap["subnet"] = bhicpf.Subnet
6625 }
6626 if bhicpf.PublicIPAddress != nil {
6627 objectMap["publicIPAddress"] = bhicpf.PublicIPAddress
6628 }
6629 if bhicpf.PrivateIPAllocationMethod != "" {
6630 objectMap["privateIPAllocationMethod"] = bhicpf.PrivateIPAllocationMethod
6631 }
6632 return json.Marshal(objectMap)
6633 }
6634
6635
6636 type BastionHostListResult struct {
6637 autorest.Response `json:"-"`
6638
6639 Value *[]BastionHost `json:"value,omitempty"`
6640
6641 NextLink *string `json:"nextLink,omitempty"`
6642 }
6643
6644
6645 type BastionHostListResultIterator struct {
6646 i int
6647 page BastionHostListResultPage
6648 }
6649
6650
6651
6652 func (iter *BastionHostListResultIterator) NextWithContext(ctx context.Context) (err error) {
6653 if tracing.IsEnabled() {
6654 ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostListResultIterator.NextWithContext")
6655 defer func() {
6656 sc := -1
6657 if iter.Response().Response.Response != nil {
6658 sc = iter.Response().Response.Response.StatusCode
6659 }
6660 tracing.EndSpan(ctx, sc, err)
6661 }()
6662 }
6663 iter.i++
6664 if iter.i < len(iter.page.Values()) {
6665 return nil
6666 }
6667 err = iter.page.NextWithContext(ctx)
6668 if err != nil {
6669 iter.i--
6670 return err
6671 }
6672 iter.i = 0
6673 return nil
6674 }
6675
6676
6677
6678
6679 func (iter *BastionHostListResultIterator) Next() error {
6680 return iter.NextWithContext(context.Background())
6681 }
6682
6683
6684 func (iter BastionHostListResultIterator) NotDone() bool {
6685 return iter.page.NotDone() && iter.i < len(iter.page.Values())
6686 }
6687
6688
6689 func (iter BastionHostListResultIterator) Response() BastionHostListResult {
6690 return iter.page.Response()
6691 }
6692
6693
6694
6695 func (iter BastionHostListResultIterator) Value() BastionHost {
6696 if !iter.page.NotDone() {
6697 return BastionHost{}
6698 }
6699 return iter.page.Values()[iter.i]
6700 }
6701
6702
6703 func NewBastionHostListResultIterator(page BastionHostListResultPage) BastionHostListResultIterator {
6704 return BastionHostListResultIterator{page: page}
6705 }
6706
6707
6708 func (bhlr BastionHostListResult) IsEmpty() bool {
6709 return bhlr.Value == nil || len(*bhlr.Value) == 0
6710 }
6711
6712
6713 func (bhlr BastionHostListResult) hasNextLink() bool {
6714 return bhlr.NextLink != nil && len(*bhlr.NextLink) != 0
6715 }
6716
6717
6718
6719 func (bhlr BastionHostListResult) bastionHostListResultPreparer(ctx context.Context) (*http.Request, error) {
6720 if !bhlr.hasNextLink() {
6721 return nil, nil
6722 }
6723 return autorest.Prepare((&http.Request{}).WithContext(ctx),
6724 autorest.AsJSON(),
6725 autorest.AsGet(),
6726 autorest.WithBaseURL(to.String(bhlr.NextLink)))
6727 }
6728
6729
6730 type BastionHostListResultPage struct {
6731 fn func(context.Context, BastionHostListResult) (BastionHostListResult, error)
6732 bhlr BastionHostListResult
6733 }
6734
6735
6736
6737 func (page *BastionHostListResultPage) NextWithContext(ctx context.Context) (err error) {
6738 if tracing.IsEnabled() {
6739 ctx = tracing.StartSpan(ctx, fqdn+"/BastionHostListResultPage.NextWithContext")
6740 defer func() {
6741 sc := -1
6742 if page.Response().Response.Response != nil {
6743 sc = page.Response().Response.Response.StatusCode
6744 }
6745 tracing.EndSpan(ctx, sc, err)
6746 }()
6747 }
6748 for {
6749 next, err := page.fn(ctx, page.bhlr)
6750 if err != nil {
6751 return err
6752 }
6753 page.bhlr = next
6754 if !next.hasNextLink() || !next.IsEmpty() {
6755 break
6756 }
6757 }
6758 return nil
6759 }
6760
6761
6762
6763
6764 func (page *BastionHostListResultPage) Next() error {
6765 return page.NextWithContext(context.Background())
6766 }
6767
6768
6769 func (page BastionHostListResultPage) NotDone() bool {
6770 return !page.bhlr.IsEmpty()
6771 }
6772
6773
6774 func (page BastionHostListResultPage) Response() BastionHostListResult {
6775 return page.bhlr
6776 }
6777
6778
6779 func (page BastionHostListResultPage) Values() []BastionHost {
6780 if page.bhlr.IsEmpty() {
6781 return nil
6782 }
6783 return *page.bhlr.Value
6784 }
6785
6786
6787 func NewBastionHostListResultPage(cur BastionHostListResult, getNextPage func(context.Context, BastionHostListResult) (BastionHostListResult, error)) BastionHostListResultPage {
6788 return BastionHostListResultPage{
6789 fn: getNextPage,
6790 bhlr: cur,
6791 }
6792 }
6793
6794
6795 type BastionHostPropertiesFormat struct {
6796
6797 IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"`
6798
6799 DNSName *string `json:"dnsName,omitempty"`
6800
6801 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
6802 }
6803
6804
6805 func (bhpf BastionHostPropertiesFormat) MarshalJSON() ([]byte, error) {
6806 objectMap := make(map[string]interface{})
6807 if bhpf.IPConfigurations != nil {
6808 objectMap["ipConfigurations"] = bhpf.IPConfigurations
6809 }
6810 if bhpf.DNSName != nil {
6811 objectMap["dnsName"] = bhpf.DNSName
6812 }
6813 return json.Marshal(objectMap)
6814 }
6815
6816
6817
6818 type BastionHostsCreateOrUpdateFuture struct {
6819 azure.FutureAPI
6820
6821
6822 Result func(BastionHostsClient) (BastionHost, error)
6823 }
6824
6825
6826 func (future *BastionHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6827 var azFuture azure.Future
6828 if err := json.Unmarshal(body, &azFuture); err != nil {
6829 return err
6830 }
6831 future.FutureAPI = &azFuture
6832 future.Result = future.result
6833 return nil
6834 }
6835
6836
6837 func (future *BastionHostsCreateOrUpdateFuture) result(client BastionHostsClient) (bh BastionHost, err error) {
6838 var done bool
6839 done, err = future.DoneWithContext(context.Background(), client)
6840 if err != nil {
6841 err = autorest.NewErrorWithError(err, "network.BastionHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6842 return
6843 }
6844 if !done {
6845 bh.Response.Response = future.Response()
6846 err = azure.NewAsyncOpIncompleteError("network.BastionHostsCreateOrUpdateFuture")
6847 return
6848 }
6849 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6850 if bh.Response.Response, err = future.GetResult(sender); err == nil && bh.Response.Response.StatusCode != http.StatusNoContent {
6851 bh, err = client.CreateOrUpdateResponder(bh.Response.Response)
6852 if err != nil {
6853 err = autorest.NewErrorWithError(err, "network.BastionHostsCreateOrUpdateFuture", "Result", bh.Response.Response, "Failure responding to request")
6854 }
6855 }
6856 return
6857 }
6858
6859
6860
6861 type BastionHostsDeleteFuture struct {
6862 azure.FutureAPI
6863
6864
6865 Result func(BastionHostsClient) (autorest.Response, error)
6866 }
6867
6868
6869 func (future *BastionHostsDeleteFuture) UnmarshalJSON(body []byte) error {
6870 var azFuture azure.Future
6871 if err := json.Unmarshal(body, &azFuture); err != nil {
6872 return err
6873 }
6874 future.FutureAPI = &azFuture
6875 future.Result = future.result
6876 return nil
6877 }
6878
6879
6880 func (future *BastionHostsDeleteFuture) result(client BastionHostsClient) (ar autorest.Response, err error) {
6881 var done bool
6882 done, err = future.DoneWithContext(context.Background(), client)
6883 if err != nil {
6884 err = autorest.NewErrorWithError(err, "network.BastionHostsDeleteFuture", "Result", future.Response(), "Polling failure")
6885 return
6886 }
6887 if !done {
6888 ar.Response = future.Response()
6889 err = azure.NewAsyncOpIncompleteError("network.BastionHostsDeleteFuture")
6890 return
6891 }
6892 ar.Response = future.Response()
6893 return
6894 }
6895
6896
6897 type BastionSessionDeleteResult struct {
6898 autorest.Response `json:"-"`
6899
6900 Value *[]BastionSessionState `json:"value,omitempty"`
6901
6902 NextLink *string `json:"nextLink,omitempty"`
6903 }
6904
6905
6906 type BastionSessionDeleteResultIterator struct {
6907 i int
6908 page BastionSessionDeleteResultPage
6909 }
6910
6911
6912
6913 func (iter *BastionSessionDeleteResultIterator) NextWithContext(ctx context.Context) (err error) {
6914 if tracing.IsEnabled() {
6915 ctx = tracing.StartSpan(ctx, fqdn+"/BastionSessionDeleteResultIterator.NextWithContext")
6916 defer func() {
6917 sc := -1
6918 if iter.Response().Response.Response != nil {
6919 sc = iter.Response().Response.Response.StatusCode
6920 }
6921 tracing.EndSpan(ctx, sc, err)
6922 }()
6923 }
6924 iter.i++
6925 if iter.i < len(iter.page.Values()) {
6926 return nil
6927 }
6928 err = iter.page.NextWithContext(ctx)
6929 if err != nil {
6930 iter.i--
6931 return err
6932 }
6933 iter.i = 0
6934 return nil
6935 }
6936
6937
6938
6939
6940 func (iter *BastionSessionDeleteResultIterator) Next() error {
6941 return iter.NextWithContext(context.Background())
6942 }
6943
6944
6945 func (iter BastionSessionDeleteResultIterator) NotDone() bool {
6946 return iter.page.NotDone() && iter.i < len(iter.page.Values())
6947 }
6948
6949
6950 func (iter BastionSessionDeleteResultIterator) Response() BastionSessionDeleteResult {
6951 return iter.page.Response()
6952 }
6953
6954
6955
6956 func (iter BastionSessionDeleteResultIterator) Value() BastionSessionState {
6957 if !iter.page.NotDone() {
6958 return BastionSessionState{}
6959 }
6960 return iter.page.Values()[iter.i]
6961 }
6962
6963
6964 func NewBastionSessionDeleteResultIterator(page BastionSessionDeleteResultPage) BastionSessionDeleteResultIterator {
6965 return BastionSessionDeleteResultIterator{page: page}
6966 }
6967
6968
6969 func (bsdr BastionSessionDeleteResult) IsEmpty() bool {
6970 return bsdr.Value == nil || len(*bsdr.Value) == 0
6971 }
6972
6973
6974 func (bsdr BastionSessionDeleteResult) hasNextLink() bool {
6975 return bsdr.NextLink != nil && len(*bsdr.NextLink) != 0
6976 }
6977
6978
6979
6980 func (bsdr BastionSessionDeleteResult) bastionSessionDeleteResultPreparer(ctx context.Context) (*http.Request, error) {
6981 if !bsdr.hasNextLink() {
6982 return nil, nil
6983 }
6984 return autorest.Prepare((&http.Request{}).WithContext(ctx),
6985 autorest.AsJSON(),
6986 autorest.AsGet(),
6987 autorest.WithBaseURL(to.String(bsdr.NextLink)))
6988 }
6989
6990
6991 type BastionSessionDeleteResultPage struct {
6992 fn func(context.Context, BastionSessionDeleteResult) (BastionSessionDeleteResult, error)
6993 bsdr BastionSessionDeleteResult
6994 }
6995
6996
6997
6998 func (page *BastionSessionDeleteResultPage) NextWithContext(ctx context.Context) (err error) {
6999 if tracing.IsEnabled() {
7000 ctx = tracing.StartSpan(ctx, fqdn+"/BastionSessionDeleteResultPage.NextWithContext")
7001 defer func() {
7002 sc := -1
7003 if page.Response().Response.Response != nil {
7004 sc = page.Response().Response.Response.StatusCode
7005 }
7006 tracing.EndSpan(ctx, sc, err)
7007 }()
7008 }
7009 for {
7010 next, err := page.fn(ctx, page.bsdr)
7011 if err != nil {
7012 return err
7013 }
7014 page.bsdr = next
7015 if !next.hasNextLink() || !next.IsEmpty() {
7016 break
7017 }
7018 }
7019 return nil
7020 }
7021
7022
7023
7024
7025 func (page *BastionSessionDeleteResultPage) Next() error {
7026 return page.NextWithContext(context.Background())
7027 }
7028
7029
7030 func (page BastionSessionDeleteResultPage) NotDone() bool {
7031 return !page.bsdr.IsEmpty()
7032 }
7033
7034
7035 func (page BastionSessionDeleteResultPage) Response() BastionSessionDeleteResult {
7036 return page.bsdr
7037 }
7038
7039
7040 func (page BastionSessionDeleteResultPage) Values() []BastionSessionState {
7041 if page.bsdr.IsEmpty() {
7042 return nil
7043 }
7044 return *page.bsdr.Value
7045 }
7046
7047
7048 func NewBastionSessionDeleteResultPage(cur BastionSessionDeleteResult, getNextPage func(context.Context, BastionSessionDeleteResult) (BastionSessionDeleteResult, error)) BastionSessionDeleteResultPage {
7049 return BastionSessionDeleteResultPage{
7050 fn: getNextPage,
7051 bsdr: cur,
7052 }
7053 }
7054
7055
7056 type BastionSessionState struct {
7057
7058 SessionID *string `json:"sessionId,omitempty"`
7059
7060 Message *string `json:"message,omitempty"`
7061
7062 State *string `json:"state,omitempty"`
7063 }
7064
7065
7066 func (bss BastionSessionState) MarshalJSON() ([]byte, error) {
7067 objectMap := make(map[string]interface{})
7068 return json.Marshal(objectMap)
7069 }
7070
7071
7072 type BastionShareableLink struct {
7073
7074 VM *VM `json:"vm,omitempty"`
7075
7076 Bsl *string `json:"bsl,omitempty"`
7077
7078 CreatedAt *string `json:"createdAt,omitempty"`
7079
7080 Message *string `json:"message,omitempty"`
7081 }
7082
7083
7084 func (bsl BastionShareableLink) MarshalJSON() ([]byte, error) {
7085 objectMap := make(map[string]interface{})
7086 if bsl.VM != nil {
7087 objectMap["vm"] = bsl.VM
7088 }
7089 return json.Marshal(objectMap)
7090 }
7091
7092
7093 type BastionShareableLinkListRequest struct {
7094
7095 Vms *[]BastionShareableLink `json:"vms,omitempty"`
7096 }
7097
7098
7099 type BastionShareableLinkListResult struct {
7100 autorest.Response `json:"-"`
7101
7102 Value *[]BastionShareableLink `json:"value,omitempty"`
7103
7104 NextLink *string `json:"nextLink,omitempty"`
7105 }
7106
7107
7108
7109 type BastionShareableLinkListResultIterator struct {
7110 i int
7111 page BastionShareableLinkListResultPage
7112 }
7113
7114
7115
7116 func (iter *BastionShareableLinkListResultIterator) NextWithContext(ctx context.Context) (err error) {
7117 if tracing.IsEnabled() {
7118 ctx = tracing.StartSpan(ctx, fqdn+"/BastionShareableLinkListResultIterator.NextWithContext")
7119 defer func() {
7120 sc := -1
7121 if iter.Response().Response.Response != nil {
7122 sc = iter.Response().Response.Response.StatusCode
7123 }
7124 tracing.EndSpan(ctx, sc, err)
7125 }()
7126 }
7127 iter.i++
7128 if iter.i < len(iter.page.Values()) {
7129 return nil
7130 }
7131 err = iter.page.NextWithContext(ctx)
7132 if err != nil {
7133 iter.i--
7134 return err
7135 }
7136 iter.i = 0
7137 return nil
7138 }
7139
7140
7141
7142
7143 func (iter *BastionShareableLinkListResultIterator) Next() error {
7144 return iter.NextWithContext(context.Background())
7145 }
7146
7147
7148 func (iter BastionShareableLinkListResultIterator) NotDone() bool {
7149 return iter.page.NotDone() && iter.i < len(iter.page.Values())
7150 }
7151
7152
7153 func (iter BastionShareableLinkListResultIterator) Response() BastionShareableLinkListResult {
7154 return iter.page.Response()
7155 }
7156
7157
7158
7159 func (iter BastionShareableLinkListResultIterator) Value() BastionShareableLink {
7160 if !iter.page.NotDone() {
7161 return BastionShareableLink{}
7162 }
7163 return iter.page.Values()[iter.i]
7164 }
7165
7166
7167 func NewBastionShareableLinkListResultIterator(page BastionShareableLinkListResultPage) BastionShareableLinkListResultIterator {
7168 return BastionShareableLinkListResultIterator{page: page}
7169 }
7170
7171
7172 func (bsllr BastionShareableLinkListResult) IsEmpty() bool {
7173 return bsllr.Value == nil || len(*bsllr.Value) == 0
7174 }
7175
7176
7177 func (bsllr BastionShareableLinkListResult) hasNextLink() bool {
7178 return bsllr.NextLink != nil && len(*bsllr.NextLink) != 0
7179 }
7180
7181
7182
7183 func (bsllr BastionShareableLinkListResult) bastionShareableLinkListResultPreparer(ctx context.Context) (*http.Request, error) {
7184 if !bsllr.hasNextLink() {
7185 return nil, nil
7186 }
7187 return autorest.Prepare((&http.Request{}).WithContext(ctx),
7188 autorest.AsJSON(),
7189 autorest.AsGet(),
7190 autorest.WithBaseURL(to.String(bsllr.NextLink)))
7191 }
7192
7193
7194 type BastionShareableLinkListResultPage struct {
7195 fn func(context.Context, BastionShareableLinkListResult) (BastionShareableLinkListResult, error)
7196 bsllr BastionShareableLinkListResult
7197 }
7198
7199
7200
7201 func (page *BastionShareableLinkListResultPage) NextWithContext(ctx context.Context) (err error) {
7202 if tracing.IsEnabled() {
7203 ctx = tracing.StartSpan(ctx, fqdn+"/BastionShareableLinkListResultPage.NextWithContext")
7204 defer func() {
7205 sc := -1
7206 if page.Response().Response.Response != nil {
7207 sc = page.Response().Response.Response.StatusCode
7208 }
7209 tracing.EndSpan(ctx, sc, err)
7210 }()
7211 }
7212 for {
7213 next, err := page.fn(ctx, page.bsllr)
7214 if err != nil {
7215 return err
7216 }
7217 page.bsllr = next
7218 if !next.hasNextLink() || !next.IsEmpty() {
7219 break
7220 }
7221 }
7222 return nil
7223 }
7224
7225
7226
7227
7228 func (page *BastionShareableLinkListResultPage) Next() error {
7229 return page.NextWithContext(context.Background())
7230 }
7231
7232
7233 func (page BastionShareableLinkListResultPage) NotDone() bool {
7234 return !page.bsllr.IsEmpty()
7235 }
7236
7237
7238 func (page BastionShareableLinkListResultPage) Response() BastionShareableLinkListResult {
7239 return page.bsllr
7240 }
7241
7242
7243 func (page BastionShareableLinkListResultPage) Values() []BastionShareableLink {
7244 if page.bsllr.IsEmpty() {
7245 return nil
7246 }
7247 return *page.bsllr.Value
7248 }
7249
7250
7251 func NewBastionShareableLinkListResultPage(cur BastionShareableLinkListResult, getNextPage func(context.Context, BastionShareableLinkListResult) (BastionShareableLinkListResult, error)) BastionShareableLinkListResultPage {
7252 return BastionShareableLinkListResultPage{
7253 fn: getNextPage,
7254 bsllr: cur,
7255 }
7256 }
7257
7258
7259 type BGPCommunity struct {
7260
7261 ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"`
7262
7263 CommunityName *string `json:"communityName,omitempty"`
7264
7265 CommunityValue *string `json:"communityValue,omitempty"`
7266
7267 CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"`
7268
7269 IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"`
7270
7271 ServiceGroup *string `json:"serviceGroup,omitempty"`
7272 }
7273
7274
7275 type BgpPeerStatus struct {
7276
7277 LocalAddress *string `json:"localAddress,omitempty"`
7278
7279 Neighbor *string `json:"neighbor,omitempty"`
7280
7281 Asn *int64 `json:"asn,omitempty"`
7282
7283 State BgpPeerState `json:"state,omitempty"`
7284
7285 ConnectedDuration *string `json:"connectedDuration,omitempty"`
7286
7287 RoutesReceived *int64 `json:"routesReceived,omitempty"`
7288
7289 MessagesSent *int64 `json:"messagesSent,omitempty"`
7290
7291 MessagesReceived *int64 `json:"messagesReceived,omitempty"`
7292 }
7293
7294
7295 func (bps BgpPeerStatus) MarshalJSON() ([]byte, error) {
7296 objectMap := make(map[string]interface{})
7297 return json.Marshal(objectMap)
7298 }
7299
7300
7301 type BgpPeerStatusListResult struct {
7302 autorest.Response `json:"-"`
7303
7304 Value *[]BgpPeerStatus `json:"value,omitempty"`
7305 }
7306
7307
7308 type BgpServiceCommunity struct {
7309
7310 *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"`
7311
7312 ID *string `json:"id,omitempty"`
7313
7314 Name *string `json:"name,omitempty"`
7315
7316 Type *string `json:"type,omitempty"`
7317
7318 Location *string `json:"location,omitempty"`
7319
7320 Tags map[string]*string `json:"tags"`
7321 }
7322
7323
7324 func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) {
7325 objectMap := make(map[string]interface{})
7326 if bsc.BgpServiceCommunityPropertiesFormat != nil {
7327 objectMap["properties"] = bsc.BgpServiceCommunityPropertiesFormat
7328 }
7329 if bsc.ID != nil {
7330 objectMap["id"] = bsc.ID
7331 }
7332 if bsc.Location != nil {
7333 objectMap["location"] = bsc.Location
7334 }
7335 if bsc.Tags != nil {
7336 objectMap["tags"] = bsc.Tags
7337 }
7338 return json.Marshal(objectMap)
7339 }
7340
7341
7342 func (bsc *BgpServiceCommunity) UnmarshalJSON(body []byte) error {
7343 var m map[string]*json.RawMessage
7344 err := json.Unmarshal(body, &m)
7345 if err != nil {
7346 return err
7347 }
7348 for k, v := range m {
7349 switch k {
7350 case "properties":
7351 if v != nil {
7352 var bgpServiceCommunityPropertiesFormat BgpServiceCommunityPropertiesFormat
7353 err = json.Unmarshal(*v, &bgpServiceCommunityPropertiesFormat)
7354 if err != nil {
7355 return err
7356 }
7357 bsc.BgpServiceCommunityPropertiesFormat = &bgpServiceCommunityPropertiesFormat
7358 }
7359 case "id":
7360 if v != nil {
7361 var ID string
7362 err = json.Unmarshal(*v, &ID)
7363 if err != nil {
7364 return err
7365 }
7366 bsc.ID = &ID
7367 }
7368 case "name":
7369 if v != nil {
7370 var name string
7371 err = json.Unmarshal(*v, &name)
7372 if err != nil {
7373 return err
7374 }
7375 bsc.Name = &name
7376 }
7377 case "type":
7378 if v != nil {
7379 var typeVar string
7380 err = json.Unmarshal(*v, &typeVar)
7381 if err != nil {
7382 return err
7383 }
7384 bsc.Type = &typeVar
7385 }
7386 case "location":
7387 if v != nil {
7388 var location string
7389 err = json.Unmarshal(*v, &location)
7390 if err != nil {
7391 return err
7392 }
7393 bsc.Location = &location
7394 }
7395 case "tags":
7396 if v != nil {
7397 var tags map[string]*string
7398 err = json.Unmarshal(*v, &tags)
7399 if err != nil {
7400 return err
7401 }
7402 bsc.Tags = tags
7403 }
7404 }
7405 }
7406
7407 return nil
7408 }
7409
7410
7411 type BgpServiceCommunityListResult struct {
7412 autorest.Response `json:"-"`
7413
7414 Value *[]BgpServiceCommunity `json:"value,omitempty"`
7415
7416 NextLink *string `json:"nextLink,omitempty"`
7417 }
7418
7419
7420
7421 type BgpServiceCommunityListResultIterator struct {
7422 i int
7423 page BgpServiceCommunityListResultPage
7424 }
7425
7426
7427
7428 func (iter *BgpServiceCommunityListResultIterator) NextWithContext(ctx context.Context) (err error) {
7429 if tracing.IsEnabled() {
7430 ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultIterator.NextWithContext")
7431 defer func() {
7432 sc := -1
7433 if iter.Response().Response.Response != nil {
7434 sc = iter.Response().Response.Response.StatusCode
7435 }
7436 tracing.EndSpan(ctx, sc, err)
7437 }()
7438 }
7439 iter.i++
7440 if iter.i < len(iter.page.Values()) {
7441 return nil
7442 }
7443 err = iter.page.NextWithContext(ctx)
7444 if err != nil {
7445 iter.i--
7446 return err
7447 }
7448 iter.i = 0
7449 return nil
7450 }
7451
7452
7453
7454
7455 func (iter *BgpServiceCommunityListResultIterator) Next() error {
7456 return iter.NextWithContext(context.Background())
7457 }
7458
7459
7460 func (iter BgpServiceCommunityListResultIterator) NotDone() bool {
7461 return iter.page.NotDone() && iter.i < len(iter.page.Values())
7462 }
7463
7464
7465 func (iter BgpServiceCommunityListResultIterator) Response() BgpServiceCommunityListResult {
7466 return iter.page.Response()
7467 }
7468
7469
7470
7471 func (iter BgpServiceCommunityListResultIterator) Value() BgpServiceCommunity {
7472 if !iter.page.NotDone() {
7473 return BgpServiceCommunity{}
7474 }
7475 return iter.page.Values()[iter.i]
7476 }
7477
7478
7479 func NewBgpServiceCommunityListResultIterator(page BgpServiceCommunityListResultPage) BgpServiceCommunityListResultIterator {
7480 return BgpServiceCommunityListResultIterator{page: page}
7481 }
7482
7483
7484 func (bsclr BgpServiceCommunityListResult) IsEmpty() bool {
7485 return bsclr.Value == nil || len(*bsclr.Value) == 0
7486 }
7487
7488
7489 func (bsclr BgpServiceCommunityListResult) hasNextLink() bool {
7490 return bsclr.NextLink != nil && len(*bsclr.NextLink) != 0
7491 }
7492
7493
7494
7495 func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer(ctx context.Context) (*http.Request, error) {
7496 if !bsclr.hasNextLink() {
7497 return nil, nil
7498 }
7499 return autorest.Prepare((&http.Request{}).WithContext(ctx),
7500 autorest.AsJSON(),
7501 autorest.AsGet(),
7502 autorest.WithBaseURL(to.String(bsclr.NextLink)))
7503 }
7504
7505
7506 type BgpServiceCommunityListResultPage struct {
7507 fn func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)
7508 bsclr BgpServiceCommunityListResult
7509 }
7510
7511
7512
7513 func (page *BgpServiceCommunityListResultPage) NextWithContext(ctx context.Context) (err error) {
7514 if tracing.IsEnabled() {
7515 ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultPage.NextWithContext")
7516 defer func() {
7517 sc := -1
7518 if page.Response().Response.Response != nil {
7519 sc = page.Response().Response.Response.StatusCode
7520 }
7521 tracing.EndSpan(ctx, sc, err)
7522 }()
7523 }
7524 for {
7525 next, err := page.fn(ctx, page.bsclr)
7526 if err != nil {
7527 return err
7528 }
7529 page.bsclr = next
7530 if !next.hasNextLink() || !next.IsEmpty() {
7531 break
7532 }
7533 }
7534 return nil
7535 }
7536
7537
7538
7539
7540 func (page *BgpServiceCommunityListResultPage) Next() error {
7541 return page.NextWithContext(context.Background())
7542 }
7543
7544
7545 func (page BgpServiceCommunityListResultPage) NotDone() bool {
7546 return !page.bsclr.IsEmpty()
7547 }
7548
7549
7550 func (page BgpServiceCommunityListResultPage) Response() BgpServiceCommunityListResult {
7551 return page.bsclr
7552 }
7553
7554
7555 func (page BgpServiceCommunityListResultPage) Values() []BgpServiceCommunity {
7556 if page.bsclr.IsEmpty() {
7557 return nil
7558 }
7559 return *page.bsclr.Value
7560 }
7561
7562
7563 func NewBgpServiceCommunityListResultPage(cur BgpServiceCommunityListResult, getNextPage func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)) BgpServiceCommunityListResultPage {
7564 return BgpServiceCommunityListResultPage{
7565 fn: getNextPage,
7566 bsclr: cur,
7567 }
7568 }
7569
7570
7571 type BgpServiceCommunityPropertiesFormat struct {
7572
7573 ServiceName *string `json:"serviceName,omitempty"`
7574
7575 BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"`
7576 }
7577
7578
7579 type BgpSettings struct {
7580
7581 Asn *int64 `json:"asn,omitempty"`
7582
7583 BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"`
7584
7585 PeerWeight *int32 `json:"peerWeight,omitempty"`
7586
7587 BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"`
7588 }
7589
7590
7591
7592 type CheckPrivateLinkServiceVisibilityRequest struct {
7593
7594 PrivateLinkServiceAlias *string `json:"privateLinkServiceAlias,omitempty"`
7595 }
7596
7597
7598 type CloudError struct {
7599
7600 Error *CloudErrorBody `json:"error,omitempty"`
7601 }
7602
7603
7604 type CloudErrorBody struct {
7605
7606 Code *string `json:"code,omitempty"`
7607
7608 Message *string `json:"message,omitempty"`
7609
7610 Target *string `json:"target,omitempty"`
7611
7612 Details *[]CloudErrorBody `json:"details,omitempty"`
7613 }
7614
7615
7616 type ConfigurationDiagnosticParameters struct {
7617
7618 TargetResourceID *string `json:"targetResourceId,omitempty"`
7619
7620 VerbosityLevel VerbosityLevel `json:"verbosityLevel,omitempty"`
7621
7622 Profiles *[]ConfigurationDiagnosticProfile `json:"profiles,omitempty"`
7623 }
7624
7625
7626 type ConfigurationDiagnosticProfile struct {
7627
7628 Direction Direction `json:"direction,omitempty"`
7629
7630 Protocol *string `json:"protocol,omitempty"`
7631
7632 Source *string `json:"source,omitempty"`
7633
7634 Destination *string `json:"destination,omitempty"`
7635
7636 DestinationPort *string `json:"destinationPort,omitempty"`
7637 }
7638
7639
7640 type ConfigurationDiagnosticResponse struct {
7641 autorest.Response `json:"-"`
7642
7643 Results *[]ConfigurationDiagnosticResult `json:"results,omitempty"`
7644 }
7645
7646
7647 func (cdr ConfigurationDiagnosticResponse) MarshalJSON() ([]byte, error) {
7648 objectMap := make(map[string]interface{})
7649 return json.Marshal(objectMap)
7650 }
7651
7652
7653
7654 type ConfigurationDiagnosticResult struct {
7655
7656 Profile *ConfigurationDiagnosticProfile `json:"profile,omitempty"`
7657
7658 NetworkSecurityGroupResult *SecurityGroupResult `json:"networkSecurityGroupResult,omitempty"`
7659 }
7660
7661
7662 type ConnectionMonitor struct {
7663
7664 Location *string `json:"location,omitempty"`
7665
7666 Tags map[string]*string `json:"tags"`
7667
7668 *ConnectionMonitorParameters `json:"properties,omitempty"`
7669 }
7670
7671
7672 func (cm ConnectionMonitor) MarshalJSON() ([]byte, error) {
7673 objectMap := make(map[string]interface{})
7674 if cm.Location != nil {
7675 objectMap["location"] = cm.Location
7676 }
7677 if cm.Tags != nil {
7678 objectMap["tags"] = cm.Tags
7679 }
7680 if cm.ConnectionMonitorParameters != nil {
7681 objectMap["properties"] = cm.ConnectionMonitorParameters
7682 }
7683 return json.Marshal(objectMap)
7684 }
7685
7686
7687 func (cm *ConnectionMonitor) UnmarshalJSON(body []byte) error {
7688 var m map[string]*json.RawMessage
7689 err := json.Unmarshal(body, &m)
7690 if err != nil {
7691 return err
7692 }
7693 for k, v := range m {
7694 switch k {
7695 case "location":
7696 if v != nil {
7697 var location string
7698 err = json.Unmarshal(*v, &location)
7699 if err != nil {
7700 return err
7701 }
7702 cm.Location = &location
7703 }
7704 case "tags":
7705 if v != nil {
7706 var tags map[string]*string
7707 err = json.Unmarshal(*v, &tags)
7708 if err != nil {
7709 return err
7710 }
7711 cm.Tags = tags
7712 }
7713 case "properties":
7714 if v != nil {
7715 var connectionMonitorParameters ConnectionMonitorParameters
7716 err = json.Unmarshal(*v, &connectionMonitorParameters)
7717 if err != nil {
7718 return err
7719 }
7720 cm.ConnectionMonitorParameters = &connectionMonitorParameters
7721 }
7722 }
7723 }
7724
7725 return nil
7726 }
7727
7728
7729 type ConnectionMonitorDestination struct {
7730
7731 ResourceID *string `json:"resourceId,omitempty"`
7732
7733 Address *string `json:"address,omitempty"`
7734
7735 Port *int32 `json:"port,omitempty"`
7736 }
7737
7738
7739 type ConnectionMonitorEndpoint struct {
7740
7741 Name *string `json:"name,omitempty"`
7742
7743 ResourceID *string `json:"resourceId,omitempty"`
7744
7745 Address *string `json:"address,omitempty"`
7746
7747 Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"`
7748 }
7749
7750
7751 type ConnectionMonitorEndpointFilter struct {
7752
7753 Type ConnectionMonitorEndpointFilterType `json:"type,omitempty"`
7754
7755 Items *[]ConnectionMonitorEndpointFilterItem `json:"items,omitempty"`
7756 }
7757
7758
7759 type ConnectionMonitorEndpointFilterItem struct {
7760
7761 Type ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"`
7762
7763 Address *string `json:"address,omitempty"`
7764 }
7765
7766
7767 type ConnectionMonitorHTTPConfiguration struct {
7768
7769 Port *int32 `json:"port,omitempty"`
7770
7771 Method HTTPConfigurationMethod `json:"method,omitempty"`
7772
7773 Path *string `json:"path,omitempty"`
7774
7775 RequestHeaders *[]HTTPHeader `json:"requestHeaders,omitempty"`
7776
7777 ValidStatusCodeRanges *[]string `json:"validStatusCodeRanges,omitempty"`
7778
7779 PreferHTTPS *bool `json:"preferHTTPS,omitempty"`
7780 }
7781
7782
7783 type ConnectionMonitorIcmpConfiguration struct {
7784
7785 DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"`
7786 }
7787
7788
7789 type ConnectionMonitorListResult struct {
7790 autorest.Response `json:"-"`
7791
7792 Value *[]ConnectionMonitorResult `json:"value,omitempty"`
7793 }
7794
7795
7796 type ConnectionMonitorOutput struct {
7797
7798 Type OutputType `json:"type,omitempty"`
7799
7800 WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"`
7801 }
7802
7803
7804 type ConnectionMonitorParameters struct {
7805
7806 Source *ConnectionMonitorSource `json:"source,omitempty"`
7807
7808 Destination *ConnectionMonitorDestination `json:"destination,omitempty"`
7809
7810 AutoStart *bool `json:"autoStart,omitempty"`
7811
7812 MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"`
7813
7814 Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"`
7815
7816 TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"`
7817
7818 TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"`
7819
7820 Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"`
7821
7822 Notes *string `json:"notes,omitempty"`
7823 }
7824
7825
7826 type ConnectionMonitorQueryResult struct {
7827 autorest.Response `json:"-"`
7828
7829 SourceStatus ConnectionMonitorSourceStatus `json:"sourceStatus,omitempty"`
7830
7831 States *[]ConnectionStateSnapshot `json:"states,omitempty"`
7832 }
7833
7834
7835 type ConnectionMonitorResult struct {
7836 autorest.Response `json:"-"`
7837
7838 Name *string `json:"name,omitempty"`
7839
7840 ID *string `json:"id,omitempty"`
7841
7842 Etag *string `json:"etag,omitempty"`
7843
7844 Type *string `json:"type,omitempty"`
7845
7846 Location *string `json:"location,omitempty"`
7847
7848 Tags map[string]*string `json:"tags"`
7849
7850 *ConnectionMonitorResultProperties `json:"properties,omitempty"`
7851 }
7852
7853
7854 func (cmr ConnectionMonitorResult) MarshalJSON() ([]byte, error) {
7855 objectMap := make(map[string]interface{})
7856 if cmr.Location != nil {
7857 objectMap["location"] = cmr.Location
7858 }
7859 if cmr.Tags != nil {
7860 objectMap["tags"] = cmr.Tags
7861 }
7862 if cmr.ConnectionMonitorResultProperties != nil {
7863 objectMap["properties"] = cmr.ConnectionMonitorResultProperties
7864 }
7865 return json.Marshal(objectMap)
7866 }
7867
7868
7869 func (cmr *ConnectionMonitorResult) UnmarshalJSON(body []byte) error {
7870 var m map[string]*json.RawMessage
7871 err := json.Unmarshal(body, &m)
7872 if err != nil {
7873 return err
7874 }
7875 for k, v := range m {
7876 switch k {
7877 case "name":
7878 if v != nil {
7879 var name string
7880 err = json.Unmarshal(*v, &name)
7881 if err != nil {
7882 return err
7883 }
7884 cmr.Name = &name
7885 }
7886 case "id":
7887 if v != nil {
7888 var ID string
7889 err = json.Unmarshal(*v, &ID)
7890 if err != nil {
7891 return err
7892 }
7893 cmr.ID = &ID
7894 }
7895 case "etag":
7896 if v != nil {
7897 var etag string
7898 err = json.Unmarshal(*v, &etag)
7899 if err != nil {
7900 return err
7901 }
7902 cmr.Etag = &etag
7903 }
7904 case "type":
7905 if v != nil {
7906 var typeVar string
7907 err = json.Unmarshal(*v, &typeVar)
7908 if err != nil {
7909 return err
7910 }
7911 cmr.Type = &typeVar
7912 }
7913 case "location":
7914 if v != nil {
7915 var location string
7916 err = json.Unmarshal(*v, &location)
7917 if err != nil {
7918 return err
7919 }
7920 cmr.Location = &location
7921 }
7922 case "tags":
7923 if v != nil {
7924 var tags map[string]*string
7925 err = json.Unmarshal(*v, &tags)
7926 if err != nil {
7927 return err
7928 }
7929 cmr.Tags = tags
7930 }
7931 case "properties":
7932 if v != nil {
7933 var connectionMonitorResultProperties ConnectionMonitorResultProperties
7934 err = json.Unmarshal(*v, &connectionMonitorResultProperties)
7935 if err != nil {
7936 return err
7937 }
7938 cmr.ConnectionMonitorResultProperties = &connectionMonitorResultProperties
7939 }
7940 }
7941 }
7942
7943 return nil
7944 }
7945
7946
7947 type ConnectionMonitorResultProperties struct {
7948
7949 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
7950
7951 StartTime *date.Time `json:"startTime,omitempty"`
7952
7953 MonitoringStatus *string `json:"monitoringStatus,omitempty"`
7954
7955 ConnectionMonitorType ConnectionMonitorType `json:"connectionMonitorType,omitempty"`
7956
7957 Source *ConnectionMonitorSource `json:"source,omitempty"`
7958
7959 Destination *ConnectionMonitorDestination `json:"destination,omitempty"`
7960
7961 AutoStart *bool `json:"autoStart,omitempty"`
7962
7963 MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"`
7964
7965 Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"`
7966
7967 TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"`
7968
7969 TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"`
7970
7971 Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"`
7972
7973 Notes *string `json:"notes,omitempty"`
7974 }
7975
7976
7977 func (cmrp ConnectionMonitorResultProperties) MarshalJSON() ([]byte, error) {
7978 objectMap := make(map[string]interface{})
7979 if cmrp.Source != nil {
7980 objectMap["source"] = cmrp.Source
7981 }
7982 if cmrp.Destination != nil {
7983 objectMap["destination"] = cmrp.Destination
7984 }
7985 if cmrp.AutoStart != nil {
7986 objectMap["autoStart"] = cmrp.AutoStart
7987 }
7988 if cmrp.MonitoringIntervalInSeconds != nil {
7989 objectMap["monitoringIntervalInSeconds"] = cmrp.MonitoringIntervalInSeconds
7990 }
7991 if cmrp.Endpoints != nil {
7992 objectMap["endpoints"] = cmrp.Endpoints
7993 }
7994 if cmrp.TestConfigurations != nil {
7995 objectMap["testConfigurations"] = cmrp.TestConfigurations
7996 }
7997 if cmrp.TestGroups != nil {
7998 objectMap["testGroups"] = cmrp.TestGroups
7999 }
8000 if cmrp.Outputs != nil {
8001 objectMap["outputs"] = cmrp.Outputs
8002 }
8003 if cmrp.Notes != nil {
8004 objectMap["notes"] = cmrp.Notes
8005 }
8006 return json.Marshal(objectMap)
8007 }
8008
8009
8010
8011 type ConnectionMonitorsCreateOrUpdateFuture struct {
8012 azure.FutureAPI
8013
8014
8015 Result func(ConnectionMonitorsClient) (ConnectionMonitorResult, error)
8016 }
8017
8018
8019 func (future *ConnectionMonitorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8020 var azFuture azure.Future
8021 if err := json.Unmarshal(body, &azFuture); err != nil {
8022 return err
8023 }
8024 future.FutureAPI = &azFuture
8025 future.Result = future.result
8026 return nil
8027 }
8028
8029
8030 func (future *ConnectionMonitorsCreateOrUpdateFuture) result(client ConnectionMonitorsClient) (cmr ConnectionMonitorResult, err error) {
8031 var done bool
8032 done, err = future.DoneWithContext(context.Background(), client)
8033 if err != nil {
8034 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8035 return
8036 }
8037 if !done {
8038 cmr.Response.Response = future.Response()
8039 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsCreateOrUpdateFuture")
8040 return
8041 }
8042 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8043 if cmr.Response.Response, err = future.GetResult(sender); err == nil && cmr.Response.Response.StatusCode != http.StatusNoContent {
8044 cmr, err = client.CreateOrUpdateResponder(cmr.Response.Response)
8045 if err != nil {
8046 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", cmr.Response.Response, "Failure responding to request")
8047 }
8048 }
8049 return
8050 }
8051
8052
8053
8054 type ConnectionMonitorsDeleteFuture struct {
8055 azure.FutureAPI
8056
8057
8058 Result func(ConnectionMonitorsClient) (autorest.Response, error)
8059 }
8060
8061
8062 func (future *ConnectionMonitorsDeleteFuture) UnmarshalJSON(body []byte) error {
8063 var azFuture azure.Future
8064 if err := json.Unmarshal(body, &azFuture); err != nil {
8065 return err
8066 }
8067 future.FutureAPI = &azFuture
8068 future.Result = future.result
8069 return nil
8070 }
8071
8072
8073 func (future *ConnectionMonitorsDeleteFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) {
8074 var done bool
8075 done, err = future.DoneWithContext(context.Background(), client)
8076 if err != nil {
8077 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsDeleteFuture", "Result", future.Response(), "Polling failure")
8078 return
8079 }
8080 if !done {
8081 ar.Response = future.Response()
8082 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsDeleteFuture")
8083 return
8084 }
8085 ar.Response = future.Response()
8086 return
8087 }
8088
8089
8090 type ConnectionMonitorSource struct {
8091
8092 ResourceID *string `json:"resourceId,omitempty"`
8093
8094 Port *int32 `json:"port,omitempty"`
8095 }
8096
8097
8098
8099 type ConnectionMonitorsQueryFuture struct {
8100 azure.FutureAPI
8101
8102
8103 Result func(ConnectionMonitorsClient) (ConnectionMonitorQueryResult, error)
8104 }
8105
8106
8107 func (future *ConnectionMonitorsQueryFuture) UnmarshalJSON(body []byte) error {
8108 var azFuture azure.Future
8109 if err := json.Unmarshal(body, &azFuture); err != nil {
8110 return err
8111 }
8112 future.FutureAPI = &azFuture
8113 future.Result = future.result
8114 return nil
8115 }
8116
8117
8118 func (future *ConnectionMonitorsQueryFuture) result(client ConnectionMonitorsClient) (cmqr ConnectionMonitorQueryResult, err error) {
8119 var done bool
8120 done, err = future.DoneWithContext(context.Background(), client)
8121 if err != nil {
8122 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", future.Response(), "Polling failure")
8123 return
8124 }
8125 if !done {
8126 cmqr.Response.Response = future.Response()
8127 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsQueryFuture")
8128 return
8129 }
8130 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8131 if cmqr.Response.Response, err = future.GetResult(sender); err == nil && cmqr.Response.Response.StatusCode != http.StatusNoContent {
8132 cmqr, err = client.QueryResponder(cmqr.Response.Response)
8133 if err != nil {
8134 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", cmqr.Response.Response, "Failure responding to request")
8135 }
8136 }
8137 return
8138 }
8139
8140
8141
8142 type ConnectionMonitorsStartFuture struct {
8143 azure.FutureAPI
8144
8145
8146 Result func(ConnectionMonitorsClient) (autorest.Response, error)
8147 }
8148
8149
8150 func (future *ConnectionMonitorsStartFuture) UnmarshalJSON(body []byte) error {
8151 var azFuture azure.Future
8152 if err := json.Unmarshal(body, &azFuture); err != nil {
8153 return err
8154 }
8155 future.FutureAPI = &azFuture
8156 future.Result = future.result
8157 return nil
8158 }
8159
8160
8161 func (future *ConnectionMonitorsStartFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) {
8162 var done bool
8163 done, err = future.DoneWithContext(context.Background(), client)
8164 if err != nil {
8165 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStartFuture", "Result", future.Response(), "Polling failure")
8166 return
8167 }
8168 if !done {
8169 ar.Response = future.Response()
8170 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStartFuture")
8171 return
8172 }
8173 ar.Response = future.Response()
8174 return
8175 }
8176
8177
8178
8179 type ConnectionMonitorsStopFuture struct {
8180 azure.FutureAPI
8181
8182
8183 Result func(ConnectionMonitorsClient) (autorest.Response, error)
8184 }
8185
8186
8187 func (future *ConnectionMonitorsStopFuture) UnmarshalJSON(body []byte) error {
8188 var azFuture azure.Future
8189 if err := json.Unmarshal(body, &azFuture); err != nil {
8190 return err
8191 }
8192 future.FutureAPI = &azFuture
8193 future.Result = future.result
8194 return nil
8195 }
8196
8197
8198 func (future *ConnectionMonitorsStopFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) {
8199 var done bool
8200 done, err = future.DoneWithContext(context.Background(), client)
8201 if err != nil {
8202 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStopFuture", "Result", future.Response(), "Polling failure")
8203 return
8204 }
8205 if !done {
8206 ar.Response = future.Response()
8207 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStopFuture")
8208 return
8209 }
8210 ar.Response = future.Response()
8211 return
8212 }
8213
8214
8215 type ConnectionMonitorSuccessThreshold struct {
8216
8217 ChecksFailedPercent *int32 `json:"checksFailedPercent,omitempty"`
8218
8219 RoundTripTimeMs *float64 `json:"roundTripTimeMs,omitempty"`
8220 }
8221
8222
8223 type ConnectionMonitorTCPConfiguration struct {
8224
8225 Port *int32 `json:"port,omitempty"`
8226
8227 DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"`
8228 }
8229
8230
8231 type ConnectionMonitorTestConfiguration struct {
8232
8233 Name *string `json:"name,omitempty"`
8234
8235 TestFrequencySec *int32 `json:"testFrequencySec,omitempty"`
8236
8237 Protocol ConnectionMonitorTestConfigurationProtocol `json:"protocol,omitempty"`
8238
8239 PreferredIPVersion PreferredIPVersion `json:"preferredIPVersion,omitempty"`
8240
8241 HTTPConfiguration *ConnectionMonitorHTTPConfiguration `json:"httpConfiguration,omitempty"`
8242
8243 TCPConfiguration *ConnectionMonitorTCPConfiguration `json:"tcpConfiguration,omitempty"`
8244
8245 IcmpConfiguration *ConnectionMonitorIcmpConfiguration `json:"icmpConfiguration,omitempty"`
8246
8247 SuccessThreshold *ConnectionMonitorSuccessThreshold `json:"successThreshold,omitempty"`
8248 }
8249
8250
8251 type ConnectionMonitorTestGroup struct {
8252
8253 Name *string `json:"name,omitempty"`
8254
8255 Disable *bool `json:"disable,omitempty"`
8256
8257 TestConfigurations *[]string `json:"testConfigurations,omitempty"`
8258
8259 Sources *[]string `json:"sources,omitempty"`
8260
8261 Destinations *[]string `json:"destinations,omitempty"`
8262 }
8263
8264
8265
8266 type ConnectionMonitorWorkspaceSettings struct {
8267
8268 WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"`
8269 }
8270
8271
8272 type ConnectionResetSharedKey struct {
8273 autorest.Response `json:"-"`
8274
8275 KeyLength *int32 `json:"keyLength,omitempty"`
8276 }
8277
8278
8279 type ConnectionSharedKey struct {
8280 autorest.Response `json:"-"`
8281
8282 Value *string `json:"value,omitempty"`
8283
8284 ID *string `json:"id,omitempty"`
8285 }
8286
8287
8288 type ConnectionStateSnapshot struct {
8289
8290 ConnectionState ConnectionState `json:"connectionState,omitempty"`
8291
8292 StartTime *date.Time `json:"startTime,omitempty"`
8293
8294 EndTime *date.Time `json:"endTime,omitempty"`
8295
8296 EvaluationState EvaluationState `json:"evaluationState,omitempty"`
8297
8298 AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"`
8299
8300 MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"`
8301
8302 MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"`
8303
8304 ProbesSent *int32 `json:"probesSent,omitempty"`
8305
8306 ProbesFailed *int32 `json:"probesFailed,omitempty"`
8307
8308 Hops *[]ConnectivityHop `json:"hops,omitempty"`
8309 }
8310
8311
8312 func (CSS ConnectionStateSnapshot) MarshalJSON() ([]byte, error) {
8313 objectMap := make(map[string]interface{})
8314 if CSS.ConnectionState != "" {
8315 objectMap["connectionState"] = CSS.ConnectionState
8316 }
8317 if CSS.StartTime != nil {
8318 objectMap["startTime"] = CSS.StartTime
8319 }
8320 if CSS.EndTime != nil {
8321 objectMap["endTime"] = CSS.EndTime
8322 }
8323 if CSS.EvaluationState != "" {
8324 objectMap["evaluationState"] = CSS.EvaluationState
8325 }
8326 if CSS.AvgLatencyInMs != nil {
8327 objectMap["avgLatencyInMs"] = CSS.AvgLatencyInMs
8328 }
8329 if CSS.MinLatencyInMs != nil {
8330 objectMap["minLatencyInMs"] = CSS.MinLatencyInMs
8331 }
8332 if CSS.MaxLatencyInMs != nil {
8333 objectMap["maxLatencyInMs"] = CSS.MaxLatencyInMs
8334 }
8335 if CSS.ProbesSent != nil {
8336 objectMap["probesSent"] = CSS.ProbesSent
8337 }
8338 if CSS.ProbesFailed != nil {
8339 objectMap["probesFailed"] = CSS.ProbesFailed
8340 }
8341 return json.Marshal(objectMap)
8342 }
8343
8344
8345 type ConnectivityDestination struct {
8346
8347 ResourceID *string `json:"resourceId,omitempty"`
8348
8349 Address *string `json:"address,omitempty"`
8350
8351 Port *int32 `json:"port,omitempty"`
8352 }
8353
8354
8355 type ConnectivityHop struct {
8356
8357 Type *string `json:"type,omitempty"`
8358
8359 ID *string `json:"id,omitempty"`
8360
8361 Address *string `json:"address,omitempty"`
8362
8363 ResourceID *string `json:"resourceId,omitempty"`
8364
8365 NextHopIds *[]string `json:"nextHopIds,omitempty"`
8366
8367 Issues *[]ConnectivityIssue `json:"issues,omitempty"`
8368 }
8369
8370
8371 func (ch ConnectivityHop) MarshalJSON() ([]byte, error) {
8372 objectMap := make(map[string]interface{})
8373 return json.Marshal(objectMap)
8374 }
8375
8376
8377 type ConnectivityInformation struct {
8378 autorest.Response `json:"-"`
8379
8380 Hops *[]ConnectivityHop `json:"hops,omitempty"`
8381
8382 ConnectionStatus ConnectionStatus `json:"connectionStatus,omitempty"`
8383
8384 AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"`
8385
8386 MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"`
8387
8388 MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"`
8389
8390 ProbesSent *int32 `json:"probesSent,omitempty"`
8391
8392 ProbesFailed *int32 `json:"probesFailed,omitempty"`
8393 }
8394
8395
8396 func (ci ConnectivityInformation) MarshalJSON() ([]byte, error) {
8397 objectMap := make(map[string]interface{})
8398 return json.Marshal(objectMap)
8399 }
8400
8401
8402 type ConnectivityIssue struct {
8403
8404 Origin Origin `json:"origin,omitempty"`
8405
8406 Severity Severity `json:"severity,omitempty"`
8407
8408 Type IssueType `json:"type,omitempty"`
8409
8410 Context *[]map[string]*string `json:"context,omitempty"`
8411 }
8412
8413
8414 func (ci ConnectivityIssue) MarshalJSON() ([]byte, error) {
8415 objectMap := make(map[string]interface{})
8416 return json.Marshal(objectMap)
8417 }
8418
8419
8420 type ConnectivityParameters struct {
8421
8422 Source *ConnectivitySource `json:"source,omitempty"`
8423
8424 Destination *ConnectivityDestination `json:"destination,omitempty"`
8425
8426 Protocol Protocol `json:"protocol,omitempty"`
8427
8428 ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"`
8429
8430 PreferredIPVersion IPVersion `json:"preferredIPVersion,omitempty"`
8431 }
8432
8433
8434 type ConnectivitySource struct {
8435
8436 ResourceID *string `json:"resourceId,omitempty"`
8437
8438 Port *int32 `json:"port,omitempty"`
8439 }
8440
8441
8442 type Container struct {
8443
8444 ID *string `json:"id,omitempty"`
8445 }
8446
8447
8448 type ContainerNetworkInterface struct {
8449
8450 *ContainerNetworkInterfacePropertiesFormat `json:"properties,omitempty"`
8451
8452 Name *string `json:"name,omitempty"`
8453
8454 Type *string `json:"type,omitempty"`
8455
8456 Etag *string `json:"etag,omitempty"`
8457
8458 ID *string `json:"id,omitempty"`
8459 }
8460
8461
8462 func (cni ContainerNetworkInterface) MarshalJSON() ([]byte, error) {
8463 objectMap := make(map[string]interface{})
8464 if cni.ContainerNetworkInterfacePropertiesFormat != nil {
8465 objectMap["properties"] = cni.ContainerNetworkInterfacePropertiesFormat
8466 }
8467 if cni.Name != nil {
8468 objectMap["name"] = cni.Name
8469 }
8470 if cni.ID != nil {
8471 objectMap["id"] = cni.ID
8472 }
8473 return json.Marshal(objectMap)
8474 }
8475
8476
8477 func (cni *ContainerNetworkInterface) UnmarshalJSON(body []byte) error {
8478 var m map[string]*json.RawMessage
8479 err := json.Unmarshal(body, &m)
8480 if err != nil {
8481 return err
8482 }
8483 for k, v := range m {
8484 switch k {
8485 case "properties":
8486 if v != nil {
8487 var containerNetworkInterfacePropertiesFormat ContainerNetworkInterfacePropertiesFormat
8488 err = json.Unmarshal(*v, &containerNetworkInterfacePropertiesFormat)
8489 if err != nil {
8490 return err
8491 }
8492 cni.ContainerNetworkInterfacePropertiesFormat = &containerNetworkInterfacePropertiesFormat
8493 }
8494 case "name":
8495 if v != nil {
8496 var name string
8497 err = json.Unmarshal(*v, &name)
8498 if err != nil {
8499 return err
8500 }
8501 cni.Name = &name
8502 }
8503 case "type":
8504 if v != nil {
8505 var typeVar string
8506 err = json.Unmarshal(*v, &typeVar)
8507 if err != nil {
8508 return err
8509 }
8510 cni.Type = &typeVar
8511 }
8512 case "etag":
8513 if v != nil {
8514 var etag string
8515 err = json.Unmarshal(*v, &etag)
8516 if err != nil {
8517 return err
8518 }
8519 cni.Etag = &etag
8520 }
8521 case "id":
8522 if v != nil {
8523 var ID string
8524 err = json.Unmarshal(*v, &ID)
8525 if err != nil {
8526 return err
8527 }
8528 cni.ID = &ID
8529 }
8530 }
8531 }
8532
8533 return nil
8534 }
8535
8536
8537 type ContainerNetworkInterfaceConfiguration struct {
8538
8539 *ContainerNetworkInterfaceConfigurationPropertiesFormat `json:"properties,omitempty"`
8540
8541 Name *string `json:"name,omitempty"`
8542
8543 Type *string `json:"type,omitempty"`
8544
8545 Etag *string `json:"etag,omitempty"`
8546
8547 ID *string `json:"id,omitempty"`
8548 }
8549
8550
8551 func (cnic ContainerNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) {
8552 objectMap := make(map[string]interface{})
8553 if cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat != nil {
8554 objectMap["properties"] = cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat
8555 }
8556 if cnic.Name != nil {
8557 objectMap["name"] = cnic.Name
8558 }
8559 if cnic.ID != nil {
8560 objectMap["id"] = cnic.ID
8561 }
8562 return json.Marshal(objectMap)
8563 }
8564
8565
8566 func (cnic *ContainerNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error {
8567 var m map[string]*json.RawMessage
8568 err := json.Unmarshal(body, &m)
8569 if err != nil {
8570 return err
8571 }
8572 for k, v := range m {
8573 switch k {
8574 case "properties":
8575 if v != nil {
8576 var containerNetworkInterfaceConfigurationPropertiesFormat ContainerNetworkInterfaceConfigurationPropertiesFormat
8577 err = json.Unmarshal(*v, &containerNetworkInterfaceConfigurationPropertiesFormat)
8578 if err != nil {
8579 return err
8580 }
8581 cnic.ContainerNetworkInterfaceConfigurationPropertiesFormat = &containerNetworkInterfaceConfigurationPropertiesFormat
8582 }
8583 case "name":
8584 if v != nil {
8585 var name string
8586 err = json.Unmarshal(*v, &name)
8587 if err != nil {
8588 return err
8589 }
8590 cnic.Name = &name
8591 }
8592 case "type":
8593 if v != nil {
8594 var typeVar string
8595 err = json.Unmarshal(*v, &typeVar)
8596 if err != nil {
8597 return err
8598 }
8599 cnic.Type = &typeVar
8600 }
8601 case "etag":
8602 if v != nil {
8603 var etag string
8604 err = json.Unmarshal(*v, &etag)
8605 if err != nil {
8606 return err
8607 }
8608 cnic.Etag = &etag
8609 }
8610 case "id":
8611 if v != nil {
8612 var ID string
8613 err = json.Unmarshal(*v, &ID)
8614 if err != nil {
8615 return err
8616 }
8617 cnic.ID = &ID
8618 }
8619 }
8620 }
8621
8622 return nil
8623 }
8624
8625
8626
8627 type ContainerNetworkInterfaceConfigurationPropertiesFormat struct {
8628
8629 IPConfigurations *[]IPConfigurationProfile `json:"ipConfigurations,omitempty"`
8630
8631 ContainerNetworkInterfaces *[]SubResource `json:"containerNetworkInterfaces,omitempty"`
8632
8633 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
8634 }
8635
8636
8637 func (cnicpf ContainerNetworkInterfaceConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
8638 objectMap := make(map[string]interface{})
8639 if cnicpf.IPConfigurations != nil {
8640 objectMap["ipConfigurations"] = cnicpf.IPConfigurations
8641 }
8642 if cnicpf.ContainerNetworkInterfaces != nil {
8643 objectMap["containerNetworkInterfaces"] = cnicpf.ContainerNetworkInterfaces
8644 }
8645 return json.Marshal(objectMap)
8646 }
8647
8648
8649 type ContainerNetworkInterfaceIPConfiguration struct {
8650
8651 *ContainerNetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"`
8652
8653 Name *string `json:"name,omitempty"`
8654
8655 Type *string `json:"type,omitempty"`
8656
8657 Etag *string `json:"etag,omitempty"`
8658 }
8659
8660
8661 func (cniic ContainerNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) {
8662 objectMap := make(map[string]interface{})
8663 if cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat != nil {
8664 objectMap["properties"] = cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat
8665 }
8666 if cniic.Name != nil {
8667 objectMap["name"] = cniic.Name
8668 }
8669 return json.Marshal(objectMap)
8670 }
8671
8672
8673 func (cniic *ContainerNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error {
8674 var m map[string]*json.RawMessage
8675 err := json.Unmarshal(body, &m)
8676 if err != nil {
8677 return err
8678 }
8679 for k, v := range m {
8680 switch k {
8681 case "properties":
8682 if v != nil {
8683 var containerNetworkInterfaceIPConfigurationPropertiesFormat ContainerNetworkInterfaceIPConfigurationPropertiesFormat
8684 err = json.Unmarshal(*v, &containerNetworkInterfaceIPConfigurationPropertiesFormat)
8685 if err != nil {
8686 return err
8687 }
8688 cniic.ContainerNetworkInterfaceIPConfigurationPropertiesFormat = &containerNetworkInterfaceIPConfigurationPropertiesFormat
8689 }
8690 case "name":
8691 if v != nil {
8692 var name string
8693 err = json.Unmarshal(*v, &name)
8694 if err != nil {
8695 return err
8696 }
8697 cniic.Name = &name
8698 }
8699 case "type":
8700 if v != nil {
8701 var typeVar string
8702 err = json.Unmarshal(*v, &typeVar)
8703 if err != nil {
8704 return err
8705 }
8706 cniic.Type = &typeVar
8707 }
8708 case "etag":
8709 if v != nil {
8710 var etag string
8711 err = json.Unmarshal(*v, &etag)
8712 if err != nil {
8713 return err
8714 }
8715 cniic.Etag = &etag
8716 }
8717 }
8718 }
8719
8720 return nil
8721 }
8722
8723
8724
8725 type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct {
8726
8727 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
8728 }
8729
8730
8731 func (cniicpf ContainerNetworkInterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
8732 objectMap := make(map[string]interface{})
8733 return json.Marshal(objectMap)
8734 }
8735
8736
8737 type ContainerNetworkInterfacePropertiesFormat struct {
8738
8739 ContainerNetworkInterfaceConfiguration *ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfiguration,omitempty"`
8740
8741 Container *Container `json:"container,omitempty"`
8742
8743 IPConfigurations *[]ContainerNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"`
8744
8745 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
8746 }
8747
8748
8749 func (cnipf ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, error) {
8750 objectMap := make(map[string]interface{})
8751 if cnipf.Container != nil {
8752 objectMap["container"] = cnipf.Container
8753 }
8754 return json.Marshal(objectMap)
8755 }
8756
8757
8758 type CustomDNSConfigPropertiesFormat struct {
8759
8760 Fqdn *string `json:"fqdn,omitempty"`
8761
8762 IPAddresses *[]string `json:"ipAddresses,omitempty"`
8763 }
8764
8765
8766
8767 type DdosCustomPoliciesCreateOrUpdateFuture struct {
8768 azure.FutureAPI
8769
8770
8771 Result func(DdosCustomPoliciesClient) (DdosCustomPolicy, error)
8772 }
8773
8774
8775 func (future *DdosCustomPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8776 var azFuture azure.Future
8777 if err := json.Unmarshal(body, &azFuture); err != nil {
8778 return err
8779 }
8780 future.FutureAPI = &azFuture
8781 future.Result = future.result
8782 return nil
8783 }
8784
8785
8786 func (future *DdosCustomPoliciesCreateOrUpdateFuture) result(client DdosCustomPoliciesClient) (dcp DdosCustomPolicy, err error) {
8787 var done bool
8788 done, err = future.DoneWithContext(context.Background(), client)
8789 if err != nil {
8790 err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8791 return
8792 }
8793 if !done {
8794 dcp.Response.Response = future.Response()
8795 err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesCreateOrUpdateFuture")
8796 return
8797 }
8798 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8799 if dcp.Response.Response, err = future.GetResult(sender); err == nil && dcp.Response.Response.StatusCode != http.StatusNoContent {
8800 dcp, err = client.CreateOrUpdateResponder(dcp.Response.Response)
8801 if err != nil {
8802 err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesCreateOrUpdateFuture", "Result", dcp.Response.Response, "Failure responding to request")
8803 }
8804 }
8805 return
8806 }
8807
8808
8809
8810 type DdosCustomPoliciesDeleteFuture struct {
8811 azure.FutureAPI
8812
8813
8814 Result func(DdosCustomPoliciesClient) (autorest.Response, error)
8815 }
8816
8817
8818 func (future *DdosCustomPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
8819 var azFuture azure.Future
8820 if err := json.Unmarshal(body, &azFuture); err != nil {
8821 return err
8822 }
8823 future.FutureAPI = &azFuture
8824 future.Result = future.result
8825 return nil
8826 }
8827
8828
8829 func (future *DdosCustomPoliciesDeleteFuture) result(client DdosCustomPoliciesClient) (ar autorest.Response, err error) {
8830 var done bool
8831 done, err = future.DoneWithContext(context.Background(), client)
8832 if err != nil {
8833 err = autorest.NewErrorWithError(err, "network.DdosCustomPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
8834 return
8835 }
8836 if !done {
8837 ar.Response = future.Response()
8838 err = azure.NewAsyncOpIncompleteError("network.DdosCustomPoliciesDeleteFuture")
8839 return
8840 }
8841 ar.Response = future.Response()
8842 return
8843 }
8844
8845
8846 type DdosCustomPolicy struct {
8847 autorest.Response `json:"-"`
8848
8849 *DdosCustomPolicyPropertiesFormat `json:"properties,omitempty"`
8850
8851 Etag *string `json:"etag,omitempty"`
8852
8853 ID *string `json:"id,omitempty"`
8854
8855 Name *string `json:"name,omitempty"`
8856
8857 Type *string `json:"type,omitempty"`
8858
8859 Location *string `json:"location,omitempty"`
8860
8861 Tags map[string]*string `json:"tags"`
8862 }
8863
8864
8865 func (dcp DdosCustomPolicy) MarshalJSON() ([]byte, error) {
8866 objectMap := make(map[string]interface{})
8867 if dcp.DdosCustomPolicyPropertiesFormat != nil {
8868 objectMap["properties"] = dcp.DdosCustomPolicyPropertiesFormat
8869 }
8870 if dcp.ID != nil {
8871 objectMap["id"] = dcp.ID
8872 }
8873 if dcp.Location != nil {
8874 objectMap["location"] = dcp.Location
8875 }
8876 if dcp.Tags != nil {
8877 objectMap["tags"] = dcp.Tags
8878 }
8879 return json.Marshal(objectMap)
8880 }
8881
8882
8883 func (dcp *DdosCustomPolicy) UnmarshalJSON(body []byte) error {
8884 var m map[string]*json.RawMessage
8885 err := json.Unmarshal(body, &m)
8886 if err != nil {
8887 return err
8888 }
8889 for k, v := range m {
8890 switch k {
8891 case "properties":
8892 if v != nil {
8893 var ddosCustomPolicyPropertiesFormat DdosCustomPolicyPropertiesFormat
8894 err = json.Unmarshal(*v, &ddosCustomPolicyPropertiesFormat)
8895 if err != nil {
8896 return err
8897 }
8898 dcp.DdosCustomPolicyPropertiesFormat = &ddosCustomPolicyPropertiesFormat
8899 }
8900 case "etag":
8901 if v != nil {
8902 var etag string
8903 err = json.Unmarshal(*v, &etag)
8904 if err != nil {
8905 return err
8906 }
8907 dcp.Etag = &etag
8908 }
8909 case "id":
8910 if v != nil {
8911 var ID string
8912 err = json.Unmarshal(*v, &ID)
8913 if err != nil {
8914 return err
8915 }
8916 dcp.ID = &ID
8917 }
8918 case "name":
8919 if v != nil {
8920 var name string
8921 err = json.Unmarshal(*v, &name)
8922 if err != nil {
8923 return err
8924 }
8925 dcp.Name = &name
8926 }
8927 case "type":
8928 if v != nil {
8929 var typeVar string
8930 err = json.Unmarshal(*v, &typeVar)
8931 if err != nil {
8932 return err
8933 }
8934 dcp.Type = &typeVar
8935 }
8936 case "location":
8937 if v != nil {
8938 var location string
8939 err = json.Unmarshal(*v, &location)
8940 if err != nil {
8941 return err
8942 }
8943 dcp.Location = &location
8944 }
8945 case "tags":
8946 if v != nil {
8947 var tags map[string]*string
8948 err = json.Unmarshal(*v, &tags)
8949 if err != nil {
8950 return err
8951 }
8952 dcp.Tags = tags
8953 }
8954 }
8955 }
8956
8957 return nil
8958 }
8959
8960
8961 type DdosCustomPolicyPropertiesFormat struct {
8962
8963 ResourceGUID *string `json:"resourceGuid,omitempty"`
8964
8965 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
8966
8967 PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"`
8968
8969 ProtocolCustomSettings *[]ProtocolCustomSettingsFormat `json:"protocolCustomSettings,omitempty"`
8970 }
8971
8972
8973 func (dcppf DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) {
8974 objectMap := make(map[string]interface{})
8975 if dcppf.ProtocolCustomSettings != nil {
8976 objectMap["protocolCustomSettings"] = dcppf.ProtocolCustomSettings
8977 }
8978 return json.Marshal(objectMap)
8979 }
8980
8981
8982 type DdosProtectionPlan struct {
8983 autorest.Response `json:"-"`
8984
8985 ID *string `json:"id,omitempty"`
8986
8987 Name *string `json:"name,omitempty"`
8988
8989 Type *string `json:"type,omitempty"`
8990
8991 Location *string `json:"location,omitempty"`
8992
8993 Tags map[string]*string `json:"tags"`
8994
8995 *DdosProtectionPlanPropertiesFormat `json:"properties,omitempty"`
8996
8997 Etag *string `json:"etag,omitempty"`
8998 }
8999
9000
9001 func (dpp DdosProtectionPlan) MarshalJSON() ([]byte, error) {
9002 objectMap := make(map[string]interface{})
9003 if dpp.Location != nil {
9004 objectMap["location"] = dpp.Location
9005 }
9006 if dpp.Tags != nil {
9007 objectMap["tags"] = dpp.Tags
9008 }
9009 if dpp.DdosProtectionPlanPropertiesFormat != nil {
9010 objectMap["properties"] = dpp.DdosProtectionPlanPropertiesFormat
9011 }
9012 return json.Marshal(objectMap)
9013 }
9014
9015
9016 func (dpp *DdosProtectionPlan) UnmarshalJSON(body []byte) error {
9017 var m map[string]*json.RawMessage
9018 err := json.Unmarshal(body, &m)
9019 if err != nil {
9020 return err
9021 }
9022 for k, v := range m {
9023 switch k {
9024 case "id":
9025 if v != nil {
9026 var ID string
9027 err = json.Unmarshal(*v, &ID)
9028 if err != nil {
9029 return err
9030 }
9031 dpp.ID = &ID
9032 }
9033 case "name":
9034 if v != nil {
9035 var name string
9036 err = json.Unmarshal(*v, &name)
9037 if err != nil {
9038 return err
9039 }
9040 dpp.Name = &name
9041 }
9042 case "type":
9043 if v != nil {
9044 var typeVar string
9045 err = json.Unmarshal(*v, &typeVar)
9046 if err != nil {
9047 return err
9048 }
9049 dpp.Type = &typeVar
9050 }
9051 case "location":
9052 if v != nil {
9053 var location string
9054 err = json.Unmarshal(*v, &location)
9055 if err != nil {
9056 return err
9057 }
9058 dpp.Location = &location
9059 }
9060 case "tags":
9061 if v != nil {
9062 var tags map[string]*string
9063 err = json.Unmarshal(*v, &tags)
9064 if err != nil {
9065 return err
9066 }
9067 dpp.Tags = tags
9068 }
9069 case "properties":
9070 if v != nil {
9071 var ddosProtectionPlanPropertiesFormat DdosProtectionPlanPropertiesFormat
9072 err = json.Unmarshal(*v, &ddosProtectionPlanPropertiesFormat)
9073 if err != nil {
9074 return err
9075 }
9076 dpp.DdosProtectionPlanPropertiesFormat = &ddosProtectionPlanPropertiesFormat
9077 }
9078 case "etag":
9079 if v != nil {
9080 var etag string
9081 err = json.Unmarshal(*v, &etag)
9082 if err != nil {
9083 return err
9084 }
9085 dpp.Etag = &etag
9086 }
9087 }
9088 }
9089
9090 return nil
9091 }
9092
9093
9094 type DdosProtectionPlanListResult struct {
9095 autorest.Response `json:"-"`
9096
9097 Value *[]DdosProtectionPlan `json:"value,omitempty"`
9098
9099 NextLink *string `json:"nextLink,omitempty"`
9100 }
9101
9102
9103 func (dpplr DdosProtectionPlanListResult) MarshalJSON() ([]byte, error) {
9104 objectMap := make(map[string]interface{})
9105 if dpplr.Value != nil {
9106 objectMap["value"] = dpplr.Value
9107 }
9108 return json.Marshal(objectMap)
9109 }
9110
9111
9112 type DdosProtectionPlanListResultIterator struct {
9113 i int
9114 page DdosProtectionPlanListResultPage
9115 }
9116
9117
9118
9119 func (iter *DdosProtectionPlanListResultIterator) NextWithContext(ctx context.Context) (err error) {
9120 if tracing.IsEnabled() {
9121 ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultIterator.NextWithContext")
9122 defer func() {
9123 sc := -1
9124 if iter.Response().Response.Response != nil {
9125 sc = iter.Response().Response.Response.StatusCode
9126 }
9127 tracing.EndSpan(ctx, sc, err)
9128 }()
9129 }
9130 iter.i++
9131 if iter.i < len(iter.page.Values()) {
9132 return nil
9133 }
9134 err = iter.page.NextWithContext(ctx)
9135 if err != nil {
9136 iter.i--
9137 return err
9138 }
9139 iter.i = 0
9140 return nil
9141 }
9142
9143
9144
9145
9146 func (iter *DdosProtectionPlanListResultIterator) Next() error {
9147 return iter.NextWithContext(context.Background())
9148 }
9149
9150
9151 func (iter DdosProtectionPlanListResultIterator) NotDone() bool {
9152 return iter.page.NotDone() && iter.i < len(iter.page.Values())
9153 }
9154
9155
9156 func (iter DdosProtectionPlanListResultIterator) Response() DdosProtectionPlanListResult {
9157 return iter.page.Response()
9158 }
9159
9160
9161
9162 func (iter DdosProtectionPlanListResultIterator) Value() DdosProtectionPlan {
9163 if !iter.page.NotDone() {
9164 return DdosProtectionPlan{}
9165 }
9166 return iter.page.Values()[iter.i]
9167 }
9168
9169
9170 func NewDdosProtectionPlanListResultIterator(page DdosProtectionPlanListResultPage) DdosProtectionPlanListResultIterator {
9171 return DdosProtectionPlanListResultIterator{page: page}
9172 }
9173
9174
9175 func (dpplr DdosProtectionPlanListResult) IsEmpty() bool {
9176 return dpplr.Value == nil || len(*dpplr.Value) == 0
9177 }
9178
9179
9180 func (dpplr DdosProtectionPlanListResult) hasNextLink() bool {
9181 return dpplr.NextLink != nil && len(*dpplr.NextLink) != 0
9182 }
9183
9184
9185
9186 func (dpplr DdosProtectionPlanListResult) ddosProtectionPlanListResultPreparer(ctx context.Context) (*http.Request, error) {
9187 if !dpplr.hasNextLink() {
9188 return nil, nil
9189 }
9190 return autorest.Prepare((&http.Request{}).WithContext(ctx),
9191 autorest.AsJSON(),
9192 autorest.AsGet(),
9193 autorest.WithBaseURL(to.String(dpplr.NextLink)))
9194 }
9195
9196
9197 type DdosProtectionPlanListResultPage struct {
9198 fn func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error)
9199 dpplr DdosProtectionPlanListResult
9200 }
9201
9202
9203
9204 func (page *DdosProtectionPlanListResultPage) NextWithContext(ctx context.Context) (err error) {
9205 if tracing.IsEnabled() {
9206 ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultPage.NextWithContext")
9207 defer func() {
9208 sc := -1
9209 if page.Response().Response.Response != nil {
9210 sc = page.Response().Response.Response.StatusCode
9211 }
9212 tracing.EndSpan(ctx, sc, err)
9213 }()
9214 }
9215 for {
9216 next, err := page.fn(ctx, page.dpplr)
9217 if err != nil {
9218 return err
9219 }
9220 page.dpplr = next
9221 if !next.hasNextLink() || !next.IsEmpty() {
9222 break
9223 }
9224 }
9225 return nil
9226 }
9227
9228
9229
9230
9231 func (page *DdosProtectionPlanListResultPage) Next() error {
9232 return page.NextWithContext(context.Background())
9233 }
9234
9235
9236 func (page DdosProtectionPlanListResultPage) NotDone() bool {
9237 return !page.dpplr.IsEmpty()
9238 }
9239
9240
9241 func (page DdosProtectionPlanListResultPage) Response() DdosProtectionPlanListResult {
9242 return page.dpplr
9243 }
9244
9245
9246 func (page DdosProtectionPlanListResultPage) Values() []DdosProtectionPlan {
9247 if page.dpplr.IsEmpty() {
9248 return nil
9249 }
9250 return *page.dpplr.Value
9251 }
9252
9253
9254 func NewDdosProtectionPlanListResultPage(cur DdosProtectionPlanListResult, getNextPage func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error)) DdosProtectionPlanListResultPage {
9255 return DdosProtectionPlanListResultPage{
9256 fn: getNextPage,
9257 dpplr: cur,
9258 }
9259 }
9260
9261
9262 type DdosProtectionPlanPropertiesFormat struct {
9263
9264 ResourceGUID *string `json:"resourceGuid,omitempty"`
9265
9266 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
9267
9268 VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"`
9269 }
9270
9271
9272 func (dpppf DdosProtectionPlanPropertiesFormat) MarshalJSON() ([]byte, error) {
9273 objectMap := make(map[string]interface{})
9274 return json.Marshal(objectMap)
9275 }
9276
9277
9278
9279 type DdosProtectionPlansCreateOrUpdateFuture struct {
9280 azure.FutureAPI
9281
9282
9283 Result func(DdosProtectionPlansClient) (DdosProtectionPlan, error)
9284 }
9285
9286
9287 func (future *DdosProtectionPlansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9288 var azFuture azure.Future
9289 if err := json.Unmarshal(body, &azFuture); err != nil {
9290 return err
9291 }
9292 future.FutureAPI = &azFuture
9293 future.Result = future.result
9294 return nil
9295 }
9296
9297
9298 func (future *DdosProtectionPlansCreateOrUpdateFuture) result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) {
9299 var done bool
9300 done, err = future.DoneWithContext(context.Background(), client)
9301 if err != nil {
9302 err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9303 return
9304 }
9305 if !done {
9306 dpp.Response.Response = future.Response()
9307 err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansCreateOrUpdateFuture")
9308 return
9309 }
9310 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9311 if dpp.Response.Response, err = future.GetResult(sender); err == nil && dpp.Response.Response.StatusCode != http.StatusNoContent {
9312 dpp, err = client.CreateOrUpdateResponder(dpp.Response.Response)
9313 if err != nil {
9314 err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", dpp.Response.Response, "Failure responding to request")
9315 }
9316 }
9317 return
9318 }
9319
9320
9321
9322 type DdosProtectionPlansDeleteFuture struct {
9323 azure.FutureAPI
9324
9325
9326 Result func(DdosProtectionPlansClient) (autorest.Response, error)
9327 }
9328
9329
9330 func (future *DdosProtectionPlansDeleteFuture) UnmarshalJSON(body []byte) error {
9331 var azFuture azure.Future
9332 if err := json.Unmarshal(body, &azFuture); err != nil {
9333 return err
9334 }
9335 future.FutureAPI = &azFuture
9336 future.Result = future.result
9337 return nil
9338 }
9339
9340
9341 func (future *DdosProtectionPlansDeleteFuture) result(client DdosProtectionPlansClient) (ar autorest.Response, err error) {
9342 var done bool
9343 done, err = future.DoneWithContext(context.Background(), client)
9344 if err != nil {
9345 err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansDeleteFuture", "Result", future.Response(), "Polling failure")
9346 return
9347 }
9348 if !done {
9349 ar.Response = future.Response()
9350 err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansDeleteFuture")
9351 return
9352 }
9353 ar.Response = future.Response()
9354 return
9355 }
9356
9357
9358 type DdosSettings struct {
9359
9360 DdosCustomPolicy *SubResource `json:"ddosCustomPolicy,omitempty"`
9361
9362 ProtectionCoverage DdosSettingsProtectionCoverage `json:"protectionCoverage,omitempty"`
9363
9364 ProtectedIP *bool `json:"protectedIP,omitempty"`
9365 }
9366
9367
9368 type Delegation struct {
9369
9370 *ServiceDelegationPropertiesFormat `json:"properties,omitempty"`
9371
9372 Name *string `json:"name,omitempty"`
9373
9374 Etag *string `json:"etag,omitempty"`
9375
9376 ID *string `json:"id,omitempty"`
9377 }
9378
9379
9380 func (d Delegation) MarshalJSON() ([]byte, error) {
9381 objectMap := make(map[string]interface{})
9382 if d.ServiceDelegationPropertiesFormat != nil {
9383 objectMap["properties"] = d.ServiceDelegationPropertiesFormat
9384 }
9385 if d.Name != nil {
9386 objectMap["name"] = d.Name
9387 }
9388 if d.ID != nil {
9389 objectMap["id"] = d.ID
9390 }
9391 return json.Marshal(objectMap)
9392 }
9393
9394
9395 func (d *Delegation) UnmarshalJSON(body []byte) error {
9396 var m map[string]*json.RawMessage
9397 err := json.Unmarshal(body, &m)
9398 if err != nil {
9399 return err
9400 }
9401 for k, v := range m {
9402 switch k {
9403 case "properties":
9404 if v != nil {
9405 var serviceDelegationPropertiesFormat ServiceDelegationPropertiesFormat
9406 err = json.Unmarshal(*v, &serviceDelegationPropertiesFormat)
9407 if err != nil {
9408 return err
9409 }
9410 d.ServiceDelegationPropertiesFormat = &serviceDelegationPropertiesFormat
9411 }
9412 case "name":
9413 if v != nil {
9414 var name string
9415 err = json.Unmarshal(*v, &name)
9416 if err != nil {
9417 return err
9418 }
9419 d.Name = &name
9420 }
9421 case "etag":
9422 if v != nil {
9423 var etag string
9424 err = json.Unmarshal(*v, &etag)
9425 if err != nil {
9426 return err
9427 }
9428 d.Etag = &etag
9429 }
9430 case "id":
9431 if v != nil {
9432 var ID string
9433 err = json.Unmarshal(*v, &ID)
9434 if err != nil {
9435 return err
9436 }
9437 d.ID = &ID
9438 }
9439 }
9440 }
9441
9442 return nil
9443 }
9444
9445
9446
9447 type DeleteBastionShareableLinkFuture struct {
9448 azure.FutureAPI
9449
9450
9451 Result func(BaseClient) (autorest.Response, error)
9452 }
9453
9454
9455 func (future *DeleteBastionShareableLinkFuture) UnmarshalJSON(body []byte) error {
9456 var azFuture azure.Future
9457 if err := json.Unmarshal(body, &azFuture); err != nil {
9458 return err
9459 }
9460 future.FutureAPI = &azFuture
9461 future.Result = future.result
9462 return nil
9463 }
9464
9465
9466 func (future *DeleteBastionShareableLinkFuture) result(client BaseClient) (ar autorest.Response, err error) {
9467 var done bool
9468 done, err = future.DoneWithContext(context.Background(), client)
9469 if err != nil {
9470 err = autorest.NewErrorWithError(err, "network.DeleteBastionShareableLinkFuture", "Result", future.Response(), "Polling failure")
9471 return
9472 }
9473 if !done {
9474 ar.Response = future.Response()
9475 err = azure.NewAsyncOpIncompleteError("network.DeleteBastionShareableLinkFuture")
9476 return
9477 }
9478 ar.Response = future.Response()
9479 return
9480 }
9481
9482
9483 type DeviceProperties struct {
9484
9485 DeviceVendor *string `json:"deviceVendor,omitempty"`
9486
9487 DeviceModel *string `json:"deviceModel,omitempty"`
9488
9489 LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"`
9490 }
9491
9492
9493
9494 type DhcpOptions struct {
9495
9496 DNSServers *[]string `json:"dnsServers,omitempty"`
9497 }
9498
9499
9500 type Dimension struct {
9501
9502 Name *string `json:"name,omitempty"`
9503
9504 DisplayName *string `json:"displayName,omitempty"`
9505
9506 InternalName *string `json:"internalName,omitempty"`
9507 }
9508
9509
9510 type DNSNameAvailabilityResult struct {
9511 autorest.Response `json:"-"`
9512
9513 Available *bool `json:"available,omitempty"`
9514 }
9515
9516
9517 type EffectiveNetworkSecurityGroup struct {
9518
9519 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"`
9520
9521 Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"`
9522
9523 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"`
9524
9525 TagMap map[string][]string `json:"tagMap"`
9526 }
9527
9528
9529 func (ensg EffectiveNetworkSecurityGroup) MarshalJSON() ([]byte, error) {
9530 objectMap := make(map[string]interface{})
9531 if ensg.NetworkSecurityGroup != nil {
9532 objectMap["networkSecurityGroup"] = ensg.NetworkSecurityGroup
9533 }
9534 if ensg.Association != nil {
9535 objectMap["association"] = ensg.Association
9536 }
9537 if ensg.EffectiveSecurityRules != nil {
9538 objectMap["effectiveSecurityRules"] = ensg.EffectiveSecurityRules
9539 }
9540 if ensg.TagMap != nil {
9541 objectMap["tagMap"] = ensg.TagMap
9542 }
9543 return json.Marshal(objectMap)
9544 }
9545
9546
9547 type EffectiveNetworkSecurityGroupAssociation struct {
9548
9549 Subnet *SubResource `json:"subnet,omitempty"`
9550
9551 NetworkInterface *SubResource `json:"networkInterface,omitempty"`
9552 }
9553
9554
9555
9556 type EffectiveNetworkSecurityGroupListResult struct {
9557 autorest.Response `json:"-"`
9558
9559 Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"`
9560
9561 NextLink *string `json:"nextLink,omitempty"`
9562 }
9563
9564
9565 func (ensglr EffectiveNetworkSecurityGroupListResult) MarshalJSON() ([]byte, error) {
9566 objectMap := make(map[string]interface{})
9567 if ensglr.Value != nil {
9568 objectMap["value"] = ensglr.Value
9569 }
9570 return json.Marshal(objectMap)
9571 }
9572
9573
9574 type EffectiveNetworkSecurityRule struct {
9575
9576 Name *string `json:"name,omitempty"`
9577
9578 Protocol EffectiveSecurityRuleProtocol `json:"protocol,omitempty"`
9579
9580 SourcePortRange *string `json:"sourcePortRange,omitempty"`
9581
9582 DestinationPortRange *string `json:"destinationPortRange,omitempty"`
9583
9584 SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"`
9585
9586 DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"`
9587
9588 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
9589
9590 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"`
9591
9592 SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"`
9593
9594 DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"`
9595
9596 ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"`
9597
9598 ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"`
9599
9600 Access SecurityRuleAccess `json:"access,omitempty"`
9601
9602 Priority *int32 `json:"priority,omitempty"`
9603
9604 Direction SecurityRuleDirection `json:"direction,omitempty"`
9605 }
9606
9607
9608 type EffectiveRoute struct {
9609
9610 Name *string `json:"name,omitempty"`
9611
9612 DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"`
9613
9614 Source EffectiveRouteSource `json:"source,omitempty"`
9615
9616 State EffectiveRouteState `json:"state,omitempty"`
9617
9618 AddressPrefix *[]string `json:"addressPrefix,omitempty"`
9619
9620 NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"`
9621
9622 NextHopType RouteNextHopType `json:"nextHopType,omitempty"`
9623 }
9624
9625
9626 type EffectiveRouteListResult struct {
9627 autorest.Response `json:"-"`
9628
9629 Value *[]EffectiveRoute `json:"value,omitempty"`
9630
9631 NextLink *string `json:"nextLink,omitempty"`
9632 }
9633
9634
9635 func (erlr EffectiveRouteListResult) MarshalJSON() ([]byte, error) {
9636 objectMap := make(map[string]interface{})
9637 if erlr.Value != nil {
9638 objectMap["value"] = erlr.Value
9639 }
9640 return json.Marshal(objectMap)
9641 }
9642
9643
9644 type EndpointServiceResult struct {
9645
9646 Name *string `json:"name,omitempty"`
9647
9648 Type *string `json:"type,omitempty"`
9649
9650 ID *string `json:"id,omitempty"`
9651 }
9652
9653
9654 func (esr EndpointServiceResult) MarshalJSON() ([]byte, error) {
9655 objectMap := make(map[string]interface{})
9656 if esr.ID != nil {
9657 objectMap["id"] = esr.ID
9658 }
9659 return json.Marshal(objectMap)
9660 }
9661
9662
9663 type EndpointServicesListResult struct {
9664 autorest.Response `json:"-"`
9665
9666 Value *[]EndpointServiceResult `json:"value,omitempty"`
9667
9668 NextLink *string `json:"nextLink,omitempty"`
9669 }
9670
9671
9672
9673 type EndpointServicesListResultIterator struct {
9674 i int
9675 page EndpointServicesListResultPage
9676 }
9677
9678
9679
9680 func (iter *EndpointServicesListResultIterator) NextWithContext(ctx context.Context) (err error) {
9681 if tracing.IsEnabled() {
9682 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultIterator.NextWithContext")
9683 defer func() {
9684 sc := -1
9685 if iter.Response().Response.Response != nil {
9686 sc = iter.Response().Response.Response.StatusCode
9687 }
9688 tracing.EndSpan(ctx, sc, err)
9689 }()
9690 }
9691 iter.i++
9692 if iter.i < len(iter.page.Values()) {
9693 return nil
9694 }
9695 err = iter.page.NextWithContext(ctx)
9696 if err != nil {
9697 iter.i--
9698 return err
9699 }
9700 iter.i = 0
9701 return nil
9702 }
9703
9704
9705
9706
9707 func (iter *EndpointServicesListResultIterator) Next() error {
9708 return iter.NextWithContext(context.Background())
9709 }
9710
9711
9712 func (iter EndpointServicesListResultIterator) NotDone() bool {
9713 return iter.page.NotDone() && iter.i < len(iter.page.Values())
9714 }
9715
9716
9717 func (iter EndpointServicesListResultIterator) Response() EndpointServicesListResult {
9718 return iter.page.Response()
9719 }
9720
9721
9722
9723 func (iter EndpointServicesListResultIterator) Value() EndpointServiceResult {
9724 if !iter.page.NotDone() {
9725 return EndpointServiceResult{}
9726 }
9727 return iter.page.Values()[iter.i]
9728 }
9729
9730
9731 func NewEndpointServicesListResultIterator(page EndpointServicesListResultPage) EndpointServicesListResultIterator {
9732 return EndpointServicesListResultIterator{page: page}
9733 }
9734
9735
9736 func (eslr EndpointServicesListResult) IsEmpty() bool {
9737 return eslr.Value == nil || len(*eslr.Value) == 0
9738 }
9739
9740
9741 func (eslr EndpointServicesListResult) hasNextLink() bool {
9742 return eslr.NextLink != nil && len(*eslr.NextLink) != 0
9743 }
9744
9745
9746
9747 func (eslr EndpointServicesListResult) endpointServicesListResultPreparer(ctx context.Context) (*http.Request, error) {
9748 if !eslr.hasNextLink() {
9749 return nil, nil
9750 }
9751 return autorest.Prepare((&http.Request{}).WithContext(ctx),
9752 autorest.AsJSON(),
9753 autorest.AsGet(),
9754 autorest.WithBaseURL(to.String(eslr.NextLink)))
9755 }
9756
9757
9758 type EndpointServicesListResultPage struct {
9759 fn func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error)
9760 eslr EndpointServicesListResult
9761 }
9762
9763
9764
9765 func (page *EndpointServicesListResultPage) NextWithContext(ctx context.Context) (err error) {
9766 if tracing.IsEnabled() {
9767 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultPage.NextWithContext")
9768 defer func() {
9769 sc := -1
9770 if page.Response().Response.Response != nil {
9771 sc = page.Response().Response.Response.StatusCode
9772 }
9773 tracing.EndSpan(ctx, sc, err)
9774 }()
9775 }
9776 for {
9777 next, err := page.fn(ctx, page.eslr)
9778 if err != nil {
9779 return err
9780 }
9781 page.eslr = next
9782 if !next.hasNextLink() || !next.IsEmpty() {
9783 break
9784 }
9785 }
9786 return nil
9787 }
9788
9789
9790
9791
9792 func (page *EndpointServicesListResultPage) Next() error {
9793 return page.NextWithContext(context.Background())
9794 }
9795
9796
9797 func (page EndpointServicesListResultPage) NotDone() bool {
9798 return !page.eslr.IsEmpty()
9799 }
9800
9801
9802 func (page EndpointServicesListResultPage) Response() EndpointServicesListResult {
9803 return page.eslr
9804 }
9805
9806
9807 func (page EndpointServicesListResultPage) Values() []EndpointServiceResult {
9808 if page.eslr.IsEmpty() {
9809 return nil
9810 }
9811 return *page.eslr.Value
9812 }
9813
9814
9815 func NewEndpointServicesListResultPage(cur EndpointServicesListResult, getNextPage func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error)) EndpointServicesListResultPage {
9816 return EndpointServicesListResultPage{
9817 fn: getNextPage,
9818 eslr: cur,
9819 }
9820 }
9821
9822
9823 type Error struct {
9824
9825 Code *string `json:"code,omitempty"`
9826
9827 Message *string `json:"message,omitempty"`
9828
9829 Target *string `json:"target,omitempty"`
9830
9831 Details *[]ErrorDetails `json:"details,omitempty"`
9832
9833 InnerError *string `json:"innerError,omitempty"`
9834 }
9835
9836
9837 type ErrorDetails struct {
9838
9839 Code *string `json:"code,omitempty"`
9840
9841 Target *string `json:"target,omitempty"`
9842
9843 Message *string `json:"message,omitempty"`
9844 }
9845
9846
9847 type ErrorResponse struct {
9848
9849 Error *ErrorDetails `json:"error,omitempty"`
9850 }
9851
9852
9853 type EvaluatedNetworkSecurityGroup struct {
9854
9855 NetworkSecurityGroupID *string `json:"networkSecurityGroupId,omitempty"`
9856
9857 AppliedTo *string `json:"appliedTo,omitempty"`
9858
9859 MatchedRule *MatchedRule `json:"matchedRule,omitempty"`
9860
9861 RulesEvaluationResult *[]SecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty"`
9862 }
9863
9864
9865 func (ensg EvaluatedNetworkSecurityGroup) MarshalJSON() ([]byte, error) {
9866 objectMap := make(map[string]interface{})
9867 if ensg.NetworkSecurityGroupID != nil {
9868 objectMap["networkSecurityGroupId"] = ensg.NetworkSecurityGroupID
9869 }
9870 if ensg.AppliedTo != nil {
9871 objectMap["appliedTo"] = ensg.AppliedTo
9872 }
9873 if ensg.MatchedRule != nil {
9874 objectMap["matchedRule"] = ensg.MatchedRule
9875 }
9876 return json.Marshal(objectMap)
9877 }
9878
9879
9880 type ExpressRouteCircuit struct {
9881 autorest.Response `json:"-"`
9882
9883 Sku *ExpressRouteCircuitSku `json:"sku,omitempty"`
9884
9885 *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"`
9886
9887 Etag *string `json:"etag,omitempty"`
9888
9889 ID *string `json:"id,omitempty"`
9890
9891 Name *string `json:"name,omitempty"`
9892
9893 Type *string `json:"type,omitempty"`
9894
9895 Location *string `json:"location,omitempty"`
9896
9897 Tags map[string]*string `json:"tags"`
9898 }
9899
9900
9901 func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) {
9902 objectMap := make(map[string]interface{})
9903 if erc.Sku != nil {
9904 objectMap["sku"] = erc.Sku
9905 }
9906 if erc.ExpressRouteCircuitPropertiesFormat != nil {
9907 objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat
9908 }
9909 if erc.ID != nil {
9910 objectMap["id"] = erc.ID
9911 }
9912 if erc.Location != nil {
9913 objectMap["location"] = erc.Location
9914 }
9915 if erc.Tags != nil {
9916 objectMap["tags"] = erc.Tags
9917 }
9918 return json.Marshal(objectMap)
9919 }
9920
9921
9922 func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error {
9923 var m map[string]*json.RawMessage
9924 err := json.Unmarshal(body, &m)
9925 if err != nil {
9926 return err
9927 }
9928 for k, v := range m {
9929 switch k {
9930 case "sku":
9931 if v != nil {
9932 var sku ExpressRouteCircuitSku
9933 err = json.Unmarshal(*v, &sku)
9934 if err != nil {
9935 return err
9936 }
9937 erc.Sku = &sku
9938 }
9939 case "properties":
9940 if v != nil {
9941 var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat
9942 err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat)
9943 if err != nil {
9944 return err
9945 }
9946 erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat
9947 }
9948 case "etag":
9949 if v != nil {
9950 var etag string
9951 err = json.Unmarshal(*v, &etag)
9952 if err != nil {
9953 return err
9954 }
9955 erc.Etag = &etag
9956 }
9957 case "id":
9958 if v != nil {
9959 var ID string
9960 err = json.Unmarshal(*v, &ID)
9961 if err != nil {
9962 return err
9963 }
9964 erc.ID = &ID
9965 }
9966 case "name":
9967 if v != nil {
9968 var name string
9969 err = json.Unmarshal(*v, &name)
9970 if err != nil {
9971 return err
9972 }
9973 erc.Name = &name
9974 }
9975 case "type":
9976 if v != nil {
9977 var typeVar string
9978 err = json.Unmarshal(*v, &typeVar)
9979 if err != nil {
9980 return err
9981 }
9982 erc.Type = &typeVar
9983 }
9984 case "location":
9985 if v != nil {
9986 var location string
9987 err = json.Unmarshal(*v, &location)
9988 if err != nil {
9989 return err
9990 }
9991 erc.Location = &location
9992 }
9993 case "tags":
9994 if v != nil {
9995 var tags map[string]*string
9996 err = json.Unmarshal(*v, &tags)
9997 if err != nil {
9998 return err
9999 }
10000 erc.Tags = tags
10001 }
10002 }
10003 }
10004
10005 return nil
10006 }
10007
10008
10009 type ExpressRouteCircuitArpTable struct {
10010
10011 Age *int32 `json:"age,omitempty"`
10012
10013 Interface *string `json:"interface,omitempty"`
10014
10015 IPAddress *string `json:"ipAddress,omitempty"`
10016
10017 MacAddress *string `json:"macAddress,omitempty"`
10018 }
10019
10020
10021 type ExpressRouteCircuitAuthorization struct {
10022 autorest.Response `json:"-"`
10023
10024 *AuthorizationPropertiesFormat `json:"properties,omitempty"`
10025
10026 Name *string `json:"name,omitempty"`
10027
10028 Etag *string `json:"etag,omitempty"`
10029
10030 Type *string `json:"type,omitempty"`
10031
10032 ID *string `json:"id,omitempty"`
10033 }
10034
10035
10036 func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) {
10037 objectMap := make(map[string]interface{})
10038 if erca.AuthorizationPropertiesFormat != nil {
10039 objectMap["properties"] = erca.AuthorizationPropertiesFormat
10040 }
10041 if erca.Name != nil {
10042 objectMap["name"] = erca.Name
10043 }
10044 if erca.ID != nil {
10045 objectMap["id"] = erca.ID
10046 }
10047 return json.Marshal(objectMap)
10048 }
10049
10050
10051 func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error {
10052 var m map[string]*json.RawMessage
10053 err := json.Unmarshal(body, &m)
10054 if err != nil {
10055 return err
10056 }
10057 for k, v := range m {
10058 switch k {
10059 case "properties":
10060 if v != nil {
10061 var authorizationPropertiesFormat AuthorizationPropertiesFormat
10062 err = json.Unmarshal(*v, &authorizationPropertiesFormat)
10063 if err != nil {
10064 return err
10065 }
10066 erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat
10067 }
10068 case "name":
10069 if v != nil {
10070 var name string
10071 err = json.Unmarshal(*v, &name)
10072 if err != nil {
10073 return err
10074 }
10075 erca.Name = &name
10076 }
10077 case "etag":
10078 if v != nil {
10079 var etag string
10080 err = json.Unmarshal(*v, &etag)
10081 if err != nil {
10082 return err
10083 }
10084 erca.Etag = &etag
10085 }
10086 case "type":
10087 if v != nil {
10088 var typeVar string
10089 err = json.Unmarshal(*v, &typeVar)
10090 if err != nil {
10091 return err
10092 }
10093 erca.Type = &typeVar
10094 }
10095 case "id":
10096 if v != nil {
10097 var ID string
10098 err = json.Unmarshal(*v, &ID)
10099 if err != nil {
10100 return err
10101 }
10102 erca.ID = &ID
10103 }
10104 }
10105 }
10106
10107 return nil
10108 }
10109
10110
10111
10112 type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct {
10113 azure.FutureAPI
10114
10115
10116 Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error)
10117 }
10118
10119
10120 func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10121 var azFuture azure.Future
10122 if err := json.Unmarshal(body, &azFuture); err != nil {
10123 return err
10124 }
10125 future.FutureAPI = &azFuture
10126 future.Result = future.result
10127 return nil
10128 }
10129
10130
10131 func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) {
10132 var done bool
10133 done, err = future.DoneWithContext(context.Background(), client)
10134 if err != nil {
10135 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10136 return
10137 }
10138 if !done {
10139 erca.Response.Response = future.Response()
10140 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture")
10141 return
10142 }
10143 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10144 if erca.Response.Response, err = future.GetResult(sender); err == nil && erca.Response.Response.StatusCode != http.StatusNoContent {
10145 erca, err = client.CreateOrUpdateResponder(erca.Response.Response)
10146 if err != nil {
10147 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", erca.Response.Response, "Failure responding to request")
10148 }
10149 }
10150 return
10151 }
10152
10153
10154
10155 type ExpressRouteCircuitAuthorizationsDeleteFuture struct {
10156 azure.FutureAPI
10157
10158
10159 Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error)
10160 }
10161
10162
10163 func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error {
10164 var azFuture azure.Future
10165 if err := json.Unmarshal(body, &azFuture); err != nil {
10166 return err
10167 }
10168 future.FutureAPI = &azFuture
10169 future.Result = future.result
10170 return nil
10171 }
10172
10173
10174 func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) {
10175 var done bool
10176 done, err = future.DoneWithContext(context.Background(), client)
10177 if err != nil {
10178 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure")
10179 return
10180 }
10181 if !done {
10182 ar.Response = future.Response()
10183 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture")
10184 return
10185 }
10186 ar.Response = future.Response()
10187 return
10188 }
10189
10190
10191
10192 type ExpressRouteCircuitConnection struct {
10193 autorest.Response `json:"-"`
10194
10195 *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"`
10196
10197 Name *string `json:"name,omitempty"`
10198
10199 Etag *string `json:"etag,omitempty"`
10200
10201 Type *string `json:"type,omitempty"`
10202
10203 ID *string `json:"id,omitempty"`
10204 }
10205
10206
10207 func (ercc ExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) {
10208 objectMap := make(map[string]interface{})
10209 if ercc.ExpressRouteCircuitConnectionPropertiesFormat != nil {
10210 objectMap["properties"] = ercc.ExpressRouteCircuitConnectionPropertiesFormat
10211 }
10212 if ercc.Name != nil {
10213 objectMap["name"] = ercc.Name
10214 }
10215 if ercc.ID != nil {
10216 objectMap["id"] = ercc.ID
10217 }
10218 return json.Marshal(objectMap)
10219 }
10220
10221
10222 func (ercc *ExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error {
10223 var m map[string]*json.RawMessage
10224 err := json.Unmarshal(body, &m)
10225 if err != nil {
10226 return err
10227 }
10228 for k, v := range m {
10229 switch k {
10230 case "properties":
10231 if v != nil {
10232 var expressRouteCircuitConnectionPropertiesFormat ExpressRouteCircuitConnectionPropertiesFormat
10233 err = json.Unmarshal(*v, &expressRouteCircuitConnectionPropertiesFormat)
10234 if err != nil {
10235 return err
10236 }
10237 ercc.ExpressRouteCircuitConnectionPropertiesFormat = &expressRouteCircuitConnectionPropertiesFormat
10238 }
10239 case "name":
10240 if v != nil {
10241 var name string
10242 err = json.Unmarshal(*v, &name)
10243 if err != nil {
10244 return err
10245 }
10246 ercc.Name = &name
10247 }
10248 case "etag":
10249 if v != nil {
10250 var etag string
10251 err = json.Unmarshal(*v, &etag)
10252 if err != nil {
10253 return err
10254 }
10255 ercc.Etag = &etag
10256 }
10257 case "type":
10258 if v != nil {
10259 var typeVar string
10260 err = json.Unmarshal(*v, &typeVar)
10261 if err != nil {
10262 return err
10263 }
10264 ercc.Type = &typeVar
10265 }
10266 case "id":
10267 if v != nil {
10268 var ID string
10269 err = json.Unmarshal(*v, &ID)
10270 if err != nil {
10271 return err
10272 }
10273 ercc.ID = &ID
10274 }
10275 }
10276 }
10277
10278 return nil
10279 }
10280
10281
10282
10283 type ExpressRouteCircuitConnectionListResult struct {
10284 autorest.Response `json:"-"`
10285
10286 Value *[]ExpressRouteCircuitConnection `json:"value,omitempty"`
10287
10288 NextLink *string `json:"nextLink,omitempty"`
10289 }
10290
10291
10292
10293 type ExpressRouteCircuitConnectionListResultIterator struct {
10294 i int
10295 page ExpressRouteCircuitConnectionListResultPage
10296 }
10297
10298
10299
10300 func (iter *ExpressRouteCircuitConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
10301 if tracing.IsEnabled() {
10302 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionListResultIterator.NextWithContext")
10303 defer func() {
10304 sc := -1
10305 if iter.Response().Response.Response != nil {
10306 sc = iter.Response().Response.Response.StatusCode
10307 }
10308 tracing.EndSpan(ctx, sc, err)
10309 }()
10310 }
10311 iter.i++
10312 if iter.i < len(iter.page.Values()) {
10313 return nil
10314 }
10315 err = iter.page.NextWithContext(ctx)
10316 if err != nil {
10317 iter.i--
10318 return err
10319 }
10320 iter.i = 0
10321 return nil
10322 }
10323
10324
10325
10326
10327 func (iter *ExpressRouteCircuitConnectionListResultIterator) Next() error {
10328 return iter.NextWithContext(context.Background())
10329 }
10330
10331
10332 func (iter ExpressRouteCircuitConnectionListResultIterator) NotDone() bool {
10333 return iter.page.NotDone() && iter.i < len(iter.page.Values())
10334 }
10335
10336
10337 func (iter ExpressRouteCircuitConnectionListResultIterator) Response() ExpressRouteCircuitConnectionListResult {
10338 return iter.page.Response()
10339 }
10340
10341
10342
10343 func (iter ExpressRouteCircuitConnectionListResultIterator) Value() ExpressRouteCircuitConnection {
10344 if !iter.page.NotDone() {
10345 return ExpressRouteCircuitConnection{}
10346 }
10347 return iter.page.Values()[iter.i]
10348 }
10349
10350
10351 func NewExpressRouteCircuitConnectionListResultIterator(page ExpressRouteCircuitConnectionListResultPage) ExpressRouteCircuitConnectionListResultIterator {
10352 return ExpressRouteCircuitConnectionListResultIterator{page: page}
10353 }
10354
10355
10356 func (ercclr ExpressRouteCircuitConnectionListResult) IsEmpty() bool {
10357 return ercclr.Value == nil || len(*ercclr.Value) == 0
10358 }
10359
10360
10361 func (ercclr ExpressRouteCircuitConnectionListResult) hasNextLink() bool {
10362 return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0
10363 }
10364
10365
10366
10367 func (ercclr ExpressRouteCircuitConnectionListResult) expressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
10368 if !ercclr.hasNextLink() {
10369 return nil, nil
10370 }
10371 return autorest.Prepare((&http.Request{}).WithContext(ctx),
10372 autorest.AsJSON(),
10373 autorest.AsGet(),
10374 autorest.WithBaseURL(to.String(ercclr.NextLink)))
10375 }
10376
10377
10378 type ExpressRouteCircuitConnectionListResultPage struct {
10379 fn func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error)
10380 ercclr ExpressRouteCircuitConnectionListResult
10381 }
10382
10383
10384
10385 func (page *ExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
10386 if tracing.IsEnabled() {
10387 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitConnectionListResultPage.NextWithContext")
10388 defer func() {
10389 sc := -1
10390 if page.Response().Response.Response != nil {
10391 sc = page.Response().Response.Response.StatusCode
10392 }
10393 tracing.EndSpan(ctx, sc, err)
10394 }()
10395 }
10396 for {
10397 next, err := page.fn(ctx, page.ercclr)
10398 if err != nil {
10399 return err
10400 }
10401 page.ercclr = next
10402 if !next.hasNextLink() || !next.IsEmpty() {
10403 break
10404 }
10405 }
10406 return nil
10407 }
10408
10409
10410
10411
10412 func (page *ExpressRouteCircuitConnectionListResultPage) Next() error {
10413 return page.NextWithContext(context.Background())
10414 }
10415
10416
10417 func (page ExpressRouteCircuitConnectionListResultPage) NotDone() bool {
10418 return !page.ercclr.IsEmpty()
10419 }
10420
10421
10422 func (page ExpressRouteCircuitConnectionListResultPage) Response() ExpressRouteCircuitConnectionListResult {
10423 return page.ercclr
10424 }
10425
10426
10427 func (page ExpressRouteCircuitConnectionListResultPage) Values() []ExpressRouteCircuitConnection {
10428 if page.ercclr.IsEmpty() {
10429 return nil
10430 }
10431 return *page.ercclr.Value
10432 }
10433
10434
10435 func NewExpressRouteCircuitConnectionListResultPage(cur ExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, ExpressRouteCircuitConnectionListResult) (ExpressRouteCircuitConnectionListResult, error)) ExpressRouteCircuitConnectionListResultPage {
10436 return ExpressRouteCircuitConnectionListResultPage{
10437 fn: getNextPage,
10438 ercclr: cur,
10439 }
10440 }
10441
10442
10443 type ExpressRouteCircuitConnectionPropertiesFormat struct {
10444
10445 ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"`
10446
10447 PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"`
10448
10449 AddressPrefix *string `json:"addressPrefix,omitempty"`
10450
10451 AuthorizationKey *string `json:"authorizationKey,omitempty"`
10452
10453 Ipv6CircuitConnectionConfig *Ipv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"`
10454
10455 CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"`
10456
10457 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
10458 }
10459
10460
10461 func (erccpf ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) {
10462 objectMap := make(map[string]interface{})
10463 if erccpf.ExpressRouteCircuitPeering != nil {
10464 objectMap["expressRouteCircuitPeering"] = erccpf.ExpressRouteCircuitPeering
10465 }
10466 if erccpf.PeerExpressRouteCircuitPeering != nil {
10467 objectMap["peerExpressRouteCircuitPeering"] = erccpf.PeerExpressRouteCircuitPeering
10468 }
10469 if erccpf.AddressPrefix != nil {
10470 objectMap["addressPrefix"] = erccpf.AddressPrefix
10471 }
10472 if erccpf.AuthorizationKey != nil {
10473 objectMap["authorizationKey"] = erccpf.AuthorizationKey
10474 }
10475 if erccpf.Ipv6CircuitConnectionConfig != nil {
10476 objectMap["ipv6CircuitConnectionConfig"] = erccpf.Ipv6CircuitConnectionConfig
10477 }
10478 if erccpf.CircuitConnectionStatus != "" {
10479 objectMap["circuitConnectionStatus"] = erccpf.CircuitConnectionStatus
10480 }
10481 return json.Marshal(objectMap)
10482 }
10483
10484
10485
10486 type ExpressRouteCircuitConnectionsCreateOrUpdateFuture struct {
10487 azure.FutureAPI
10488
10489
10490 Result func(ExpressRouteCircuitConnectionsClient) (ExpressRouteCircuitConnection, error)
10491 }
10492
10493
10494 func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10495 var azFuture azure.Future
10496 if err := json.Unmarshal(body, &azFuture); err != nil {
10497 return err
10498 }
10499 future.FutureAPI = &azFuture
10500 future.Result = future.result
10501 return nil
10502 }
10503
10504
10505 func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) result(client ExpressRouteCircuitConnectionsClient) (ercc ExpressRouteCircuitConnection, err error) {
10506 var done bool
10507 done, err = future.DoneWithContext(context.Background(), client)
10508 if err != nil {
10509 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10510 return
10511 }
10512 if !done {
10513 ercc.Response.Response = future.Response()
10514 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture")
10515 return
10516 }
10517 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10518 if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent {
10519 ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response)
10520 if err != nil {
10521 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request")
10522 }
10523 }
10524 return
10525 }
10526
10527
10528
10529 type ExpressRouteCircuitConnectionsDeleteFuture struct {
10530 azure.FutureAPI
10531
10532
10533 Result func(ExpressRouteCircuitConnectionsClient) (autorest.Response, error)
10534 }
10535
10536
10537 func (future *ExpressRouteCircuitConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
10538 var azFuture azure.Future
10539 if err := json.Unmarshal(body, &azFuture); err != nil {
10540 return err
10541 }
10542 future.FutureAPI = &azFuture
10543 future.Result = future.result
10544 return nil
10545 }
10546
10547
10548 func (future *ExpressRouteCircuitConnectionsDeleteFuture) result(client ExpressRouteCircuitConnectionsClient) (ar autorest.Response, err error) {
10549 var done bool
10550 done, err = future.DoneWithContext(context.Background(), client)
10551 if err != nil {
10552 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
10553 return
10554 }
10555 if !done {
10556 ar.Response = future.Response()
10557 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsDeleteFuture")
10558 return
10559 }
10560 ar.Response = future.Response()
10561 return
10562 }
10563
10564
10565 type ExpressRouteCircuitListResult struct {
10566 autorest.Response `json:"-"`
10567
10568 Value *[]ExpressRouteCircuit `json:"value,omitempty"`
10569
10570 NextLink *string `json:"nextLink,omitempty"`
10571 }
10572
10573
10574
10575 type ExpressRouteCircuitListResultIterator struct {
10576 i int
10577 page ExpressRouteCircuitListResultPage
10578 }
10579
10580
10581
10582 func (iter *ExpressRouteCircuitListResultIterator) NextWithContext(ctx context.Context) (err error) {
10583 if tracing.IsEnabled() {
10584 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultIterator.NextWithContext")
10585 defer func() {
10586 sc := -1
10587 if iter.Response().Response.Response != nil {
10588 sc = iter.Response().Response.Response.StatusCode
10589 }
10590 tracing.EndSpan(ctx, sc, err)
10591 }()
10592 }
10593 iter.i++
10594 if iter.i < len(iter.page.Values()) {
10595 return nil
10596 }
10597 err = iter.page.NextWithContext(ctx)
10598 if err != nil {
10599 iter.i--
10600 return err
10601 }
10602 iter.i = 0
10603 return nil
10604 }
10605
10606
10607
10608
10609 func (iter *ExpressRouteCircuitListResultIterator) Next() error {
10610 return iter.NextWithContext(context.Background())
10611 }
10612
10613
10614 func (iter ExpressRouteCircuitListResultIterator) NotDone() bool {
10615 return iter.page.NotDone() && iter.i < len(iter.page.Values())
10616 }
10617
10618
10619 func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult {
10620 return iter.page.Response()
10621 }
10622
10623
10624
10625 func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit {
10626 if !iter.page.NotDone() {
10627 return ExpressRouteCircuit{}
10628 }
10629 return iter.page.Values()[iter.i]
10630 }
10631
10632
10633 func NewExpressRouteCircuitListResultIterator(page ExpressRouteCircuitListResultPage) ExpressRouteCircuitListResultIterator {
10634 return ExpressRouteCircuitListResultIterator{page: page}
10635 }
10636
10637
10638 func (erclr ExpressRouteCircuitListResult) IsEmpty() bool {
10639 return erclr.Value == nil || len(*erclr.Value) == 0
10640 }
10641
10642
10643 func (erclr ExpressRouteCircuitListResult) hasNextLink() bool {
10644 return erclr.NextLink != nil && len(*erclr.NextLink) != 0
10645 }
10646
10647
10648
10649 func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) {
10650 if !erclr.hasNextLink() {
10651 return nil, nil
10652 }
10653 return autorest.Prepare((&http.Request{}).WithContext(ctx),
10654 autorest.AsJSON(),
10655 autorest.AsGet(),
10656 autorest.WithBaseURL(to.String(erclr.NextLink)))
10657 }
10658
10659
10660 type ExpressRouteCircuitListResultPage struct {
10661 fn func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)
10662 erclr ExpressRouteCircuitListResult
10663 }
10664
10665
10666
10667 func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Context) (err error) {
10668 if tracing.IsEnabled() {
10669 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultPage.NextWithContext")
10670 defer func() {
10671 sc := -1
10672 if page.Response().Response.Response != nil {
10673 sc = page.Response().Response.Response.StatusCode
10674 }
10675 tracing.EndSpan(ctx, sc, err)
10676 }()
10677 }
10678 for {
10679 next, err := page.fn(ctx, page.erclr)
10680 if err != nil {
10681 return err
10682 }
10683 page.erclr = next
10684 if !next.hasNextLink() || !next.IsEmpty() {
10685 break
10686 }
10687 }
10688 return nil
10689 }
10690
10691
10692
10693
10694 func (page *ExpressRouteCircuitListResultPage) Next() error {
10695 return page.NextWithContext(context.Background())
10696 }
10697
10698
10699 func (page ExpressRouteCircuitListResultPage) NotDone() bool {
10700 return !page.erclr.IsEmpty()
10701 }
10702
10703
10704 func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult {
10705 return page.erclr
10706 }
10707
10708
10709 func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit {
10710 if page.erclr.IsEmpty() {
10711 return nil
10712 }
10713 return *page.erclr.Value
10714 }
10715
10716
10717 func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage {
10718 return ExpressRouteCircuitListResultPage{
10719 fn: getNextPage,
10720 erclr: cur,
10721 }
10722 }
10723
10724
10725 type ExpressRouteCircuitPeering struct {
10726 autorest.Response `json:"-"`
10727
10728 *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"`
10729
10730 Name *string `json:"name,omitempty"`
10731
10732 Etag *string `json:"etag,omitempty"`
10733
10734 Type *string `json:"type,omitempty"`
10735
10736 ID *string `json:"id,omitempty"`
10737 }
10738
10739
10740 func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) {
10741 objectMap := make(map[string]interface{})
10742 if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil {
10743 objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat
10744 }
10745 if ercp.Name != nil {
10746 objectMap["name"] = ercp.Name
10747 }
10748 if ercp.ID != nil {
10749 objectMap["id"] = ercp.ID
10750 }
10751 return json.Marshal(objectMap)
10752 }
10753
10754
10755 func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error {
10756 var m map[string]*json.RawMessage
10757 err := json.Unmarshal(body, &m)
10758 if err != nil {
10759 return err
10760 }
10761 for k, v := range m {
10762 switch k {
10763 case "properties":
10764 if v != nil {
10765 var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat
10766 err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat)
10767 if err != nil {
10768 return err
10769 }
10770 ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat
10771 }
10772 case "name":
10773 if v != nil {
10774 var name string
10775 err = json.Unmarshal(*v, &name)
10776 if err != nil {
10777 return err
10778 }
10779 ercp.Name = &name
10780 }
10781 case "etag":
10782 if v != nil {
10783 var etag string
10784 err = json.Unmarshal(*v, &etag)
10785 if err != nil {
10786 return err
10787 }
10788 ercp.Etag = &etag
10789 }
10790 case "type":
10791 if v != nil {
10792 var typeVar string
10793 err = json.Unmarshal(*v, &typeVar)
10794 if err != nil {
10795 return err
10796 }
10797 ercp.Type = &typeVar
10798 }
10799 case "id":
10800 if v != nil {
10801 var ID string
10802 err = json.Unmarshal(*v, &ID)
10803 if err != nil {
10804 return err
10805 }
10806 ercp.ID = &ID
10807 }
10808 }
10809 }
10810
10811 return nil
10812 }
10813
10814
10815 type ExpressRouteCircuitPeeringConfig struct {
10816
10817 AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"`
10818
10819 AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"`
10820
10821 AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"`
10822
10823 LegacyMode *int32 `json:"legacyMode,omitempty"`
10824
10825 CustomerASN *int32 `json:"customerASN,omitempty"`
10826
10827 RoutingRegistryName *string `json:"routingRegistryName,omitempty"`
10828 }
10829
10830
10831 func (ercpc ExpressRouteCircuitPeeringConfig) MarshalJSON() ([]byte, error) {
10832 objectMap := make(map[string]interface{})
10833 if ercpc.AdvertisedPublicPrefixes != nil {
10834 objectMap["advertisedPublicPrefixes"] = ercpc.AdvertisedPublicPrefixes
10835 }
10836 if ercpc.AdvertisedCommunities != nil {
10837 objectMap["advertisedCommunities"] = ercpc.AdvertisedCommunities
10838 }
10839 if ercpc.LegacyMode != nil {
10840 objectMap["legacyMode"] = ercpc.LegacyMode
10841 }
10842 if ercpc.CustomerASN != nil {
10843 objectMap["customerASN"] = ercpc.CustomerASN
10844 }
10845 if ercpc.RoutingRegistryName != nil {
10846 objectMap["routingRegistryName"] = ercpc.RoutingRegistryName
10847 }
10848 return json.Marshal(objectMap)
10849 }
10850
10851
10852 type ExpressRouteCircuitPeeringID struct {
10853
10854 ID *string `json:"id,omitempty"`
10855 }
10856
10857
10858
10859 type ExpressRouteCircuitPeeringListResult struct {
10860 autorest.Response `json:"-"`
10861
10862 Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"`
10863
10864 NextLink *string `json:"nextLink,omitempty"`
10865 }
10866
10867
10868
10869 type ExpressRouteCircuitPeeringListResultIterator struct {
10870 i int
10871 page ExpressRouteCircuitPeeringListResultPage
10872 }
10873
10874
10875
10876 func (iter *ExpressRouteCircuitPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) {
10877 if tracing.IsEnabled() {
10878 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultIterator.NextWithContext")
10879 defer func() {
10880 sc := -1
10881 if iter.Response().Response.Response != nil {
10882 sc = iter.Response().Response.Response.StatusCode
10883 }
10884 tracing.EndSpan(ctx, sc, err)
10885 }()
10886 }
10887 iter.i++
10888 if iter.i < len(iter.page.Values()) {
10889 return nil
10890 }
10891 err = iter.page.NextWithContext(ctx)
10892 if err != nil {
10893 iter.i--
10894 return err
10895 }
10896 iter.i = 0
10897 return nil
10898 }
10899
10900
10901
10902
10903 func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error {
10904 return iter.NextWithContext(context.Background())
10905 }
10906
10907
10908 func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool {
10909 return iter.page.NotDone() && iter.i < len(iter.page.Values())
10910 }
10911
10912
10913 func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult {
10914 return iter.page.Response()
10915 }
10916
10917
10918
10919 func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering {
10920 if !iter.page.NotDone() {
10921 return ExpressRouteCircuitPeering{}
10922 }
10923 return iter.page.Values()[iter.i]
10924 }
10925
10926
10927 func NewExpressRouteCircuitPeeringListResultIterator(page ExpressRouteCircuitPeeringListResultPage) ExpressRouteCircuitPeeringListResultIterator {
10928 return ExpressRouteCircuitPeeringListResultIterator{page: page}
10929 }
10930
10931
10932 func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool {
10933 return ercplr.Value == nil || len(*ercplr.Value) == 0
10934 }
10935
10936
10937 func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool {
10938 return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0
10939 }
10940
10941
10942
10943 func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) {
10944 if !ercplr.hasNextLink() {
10945 return nil, nil
10946 }
10947 return autorest.Prepare((&http.Request{}).WithContext(ctx),
10948 autorest.AsJSON(),
10949 autorest.AsGet(),
10950 autorest.WithBaseURL(to.String(ercplr.NextLink)))
10951 }
10952
10953
10954 type ExpressRouteCircuitPeeringListResultPage struct {
10955 fn func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)
10956 ercplr ExpressRouteCircuitPeeringListResult
10957 }
10958
10959
10960
10961 func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx context.Context) (err error) {
10962 if tracing.IsEnabled() {
10963 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultPage.NextWithContext")
10964 defer func() {
10965 sc := -1
10966 if page.Response().Response.Response != nil {
10967 sc = page.Response().Response.Response.StatusCode
10968 }
10969 tracing.EndSpan(ctx, sc, err)
10970 }()
10971 }
10972 for {
10973 next, err := page.fn(ctx, page.ercplr)
10974 if err != nil {
10975 return err
10976 }
10977 page.ercplr = next
10978 if !next.hasNextLink() || !next.IsEmpty() {
10979 break
10980 }
10981 }
10982 return nil
10983 }
10984
10985
10986
10987
10988 func (page *ExpressRouteCircuitPeeringListResultPage) Next() error {
10989 return page.NextWithContext(context.Background())
10990 }
10991
10992
10993 func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool {
10994 return !page.ercplr.IsEmpty()
10995 }
10996
10997
10998 func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult {
10999 return page.ercplr
11000 }
11001
11002
11003 func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering {
11004 if page.ercplr.IsEmpty() {
11005 return nil
11006 }
11007 return *page.ercplr.Value
11008 }
11009
11010
11011 func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage {
11012 return ExpressRouteCircuitPeeringListResultPage{
11013 fn: getNextPage,
11014 ercplr: cur,
11015 }
11016 }
11017
11018
11019 type ExpressRouteCircuitPeeringPropertiesFormat struct {
11020
11021 PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"`
11022
11023 State ExpressRoutePeeringState `json:"state,omitempty"`
11024
11025 AzureASN *int32 `json:"azureASN,omitempty"`
11026
11027 PeerASN *int64 `json:"peerASN,omitempty"`
11028
11029 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"`
11030
11031 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"`
11032
11033 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"`
11034
11035 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"`
11036
11037 SharedKey *string `json:"sharedKey,omitempty"`
11038
11039 VlanID *int32 `json:"vlanId,omitempty"`
11040
11041 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"`
11042
11043 Stats *ExpressRouteCircuitStats `json:"stats,omitempty"`
11044
11045 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
11046
11047 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"`
11048
11049 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
11050
11051 RouteFilter *SubResource `json:"routeFilter,omitempty"`
11052
11053 Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"`
11054
11055 ExpressRouteConnection *ExpressRouteConnectionID `json:"expressRouteConnection,omitempty"`
11056
11057 Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"`
11058
11059 PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"`
11060 }
11061
11062
11063 func (ercppf ExpressRouteCircuitPeeringPropertiesFormat) MarshalJSON() ([]byte, error) {
11064 objectMap := make(map[string]interface{})
11065 if ercppf.PeeringType != "" {
11066 objectMap["peeringType"] = ercppf.PeeringType
11067 }
11068 if ercppf.State != "" {
11069 objectMap["state"] = ercppf.State
11070 }
11071 if ercppf.AzureASN != nil {
11072 objectMap["azureASN"] = ercppf.AzureASN
11073 }
11074 if ercppf.PeerASN != nil {
11075 objectMap["peerASN"] = ercppf.PeerASN
11076 }
11077 if ercppf.PrimaryPeerAddressPrefix != nil {
11078 objectMap["primaryPeerAddressPrefix"] = ercppf.PrimaryPeerAddressPrefix
11079 }
11080 if ercppf.SecondaryPeerAddressPrefix != nil {
11081 objectMap["secondaryPeerAddressPrefix"] = ercppf.SecondaryPeerAddressPrefix
11082 }
11083 if ercppf.PrimaryAzurePort != nil {
11084 objectMap["primaryAzurePort"] = ercppf.PrimaryAzurePort
11085 }
11086 if ercppf.SecondaryAzurePort != nil {
11087 objectMap["secondaryAzurePort"] = ercppf.SecondaryAzurePort
11088 }
11089 if ercppf.SharedKey != nil {
11090 objectMap["sharedKey"] = ercppf.SharedKey
11091 }
11092 if ercppf.VlanID != nil {
11093 objectMap["vlanId"] = ercppf.VlanID
11094 }
11095 if ercppf.MicrosoftPeeringConfig != nil {
11096 objectMap["microsoftPeeringConfig"] = ercppf.MicrosoftPeeringConfig
11097 }
11098 if ercppf.Stats != nil {
11099 objectMap["stats"] = ercppf.Stats
11100 }
11101 if ercppf.GatewayManagerEtag != nil {
11102 objectMap["gatewayManagerEtag"] = ercppf.GatewayManagerEtag
11103 }
11104 if ercppf.RouteFilter != nil {
11105 objectMap["routeFilter"] = ercppf.RouteFilter
11106 }
11107 if ercppf.Ipv6PeeringConfig != nil {
11108 objectMap["ipv6PeeringConfig"] = ercppf.Ipv6PeeringConfig
11109 }
11110 if ercppf.ExpressRouteConnection != nil {
11111 objectMap["expressRouteConnection"] = ercppf.ExpressRouteConnection
11112 }
11113 if ercppf.Connections != nil {
11114 objectMap["connections"] = ercppf.Connections
11115 }
11116 return json.Marshal(objectMap)
11117 }
11118
11119
11120
11121 type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct {
11122 azure.FutureAPI
11123
11124
11125 Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error)
11126 }
11127
11128
11129 func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
11130 var azFuture azure.Future
11131 if err := json.Unmarshal(body, &azFuture); err != nil {
11132 return err
11133 }
11134 future.FutureAPI = &azFuture
11135 future.Result = future.result
11136 return nil
11137 }
11138
11139
11140 func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) {
11141 var done bool
11142 done, err = future.DoneWithContext(context.Background(), client)
11143 if err != nil {
11144 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11145 return
11146 }
11147 if !done {
11148 ercp.Response.Response = future.Response()
11149 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture")
11150 return
11151 }
11152 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11153 if ercp.Response.Response, err = future.GetResult(sender); err == nil && ercp.Response.Response.StatusCode != http.StatusNoContent {
11154 ercp, err = client.CreateOrUpdateResponder(ercp.Response.Response)
11155 if err != nil {
11156 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", ercp.Response.Response, "Failure responding to request")
11157 }
11158 }
11159 return
11160 }
11161
11162
11163
11164 type ExpressRouteCircuitPeeringsDeleteFuture struct {
11165 azure.FutureAPI
11166
11167
11168 Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error)
11169 }
11170
11171
11172 func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error {
11173 var azFuture azure.Future
11174 if err := json.Unmarshal(body, &azFuture); err != nil {
11175 return err
11176 }
11177 future.FutureAPI = &azFuture
11178 future.Result = future.result
11179 return nil
11180 }
11181
11182
11183 func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) {
11184 var done bool
11185 done, err = future.DoneWithContext(context.Background(), client)
11186 if err != nil {
11187 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
11188 return
11189 }
11190 if !done {
11191 ar.Response = future.Response()
11192 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture")
11193 return
11194 }
11195 ar.Response = future.Response()
11196 return
11197 }
11198
11199
11200 type ExpressRouteCircuitPropertiesFormat struct {
11201
11202 AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"`
11203
11204 CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"`
11205
11206 ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"`
11207
11208 Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"`
11209
11210 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"`
11211
11212 ServiceKey *string `json:"serviceKey,omitempty"`
11213
11214 ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"`
11215
11216 ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"`
11217
11218 ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"`
11219
11220 BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"`
11221
11222 Stag *int32 `json:"stag,omitempty"`
11223
11224 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
11225
11226 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"`
11227
11228 GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"`
11229 }
11230
11231
11232 func (ercpf ExpressRouteCircuitPropertiesFormat) MarshalJSON() ([]byte, error) {
11233 objectMap := make(map[string]interface{})
11234 if ercpf.AllowClassicOperations != nil {
11235 objectMap["allowClassicOperations"] = ercpf.AllowClassicOperations
11236 }
11237 if ercpf.CircuitProvisioningState != nil {
11238 objectMap["circuitProvisioningState"] = ercpf.CircuitProvisioningState
11239 }
11240 if ercpf.ServiceProviderProvisioningState != "" {
11241 objectMap["serviceProviderProvisioningState"] = ercpf.ServiceProviderProvisioningState
11242 }
11243 if ercpf.Authorizations != nil {
11244 objectMap["authorizations"] = ercpf.Authorizations
11245 }
11246 if ercpf.Peerings != nil {
11247 objectMap["peerings"] = ercpf.Peerings
11248 }
11249 if ercpf.ServiceKey != nil {
11250 objectMap["serviceKey"] = ercpf.ServiceKey
11251 }
11252 if ercpf.ServiceProviderNotes != nil {
11253 objectMap["serviceProviderNotes"] = ercpf.ServiceProviderNotes
11254 }
11255 if ercpf.ServiceProviderProperties != nil {
11256 objectMap["serviceProviderProperties"] = ercpf.ServiceProviderProperties
11257 }
11258 if ercpf.ExpressRoutePort != nil {
11259 objectMap["expressRoutePort"] = ercpf.ExpressRoutePort
11260 }
11261 if ercpf.BandwidthInGbps != nil {
11262 objectMap["bandwidthInGbps"] = ercpf.BandwidthInGbps
11263 }
11264 if ercpf.GatewayManagerEtag != nil {
11265 objectMap["gatewayManagerEtag"] = ercpf.GatewayManagerEtag
11266 }
11267 if ercpf.GlobalReachEnabled != nil {
11268 objectMap["globalReachEnabled"] = ercpf.GlobalReachEnabled
11269 }
11270 return json.Marshal(objectMap)
11271 }
11272
11273
11274 type ExpressRouteCircuitReference struct {
11275
11276 ID *string `json:"id,omitempty"`
11277 }
11278
11279
11280 type ExpressRouteCircuitRoutesTable struct {
11281
11282 NetworkProperty *string `json:"network,omitempty"`
11283
11284 NextHop *string `json:"nextHop,omitempty"`
11285
11286 LocPrf *string `json:"locPrf,omitempty"`
11287
11288 Weight *int32 `json:"weight,omitempty"`
11289
11290 Path *string `json:"path,omitempty"`
11291 }
11292
11293
11294 type ExpressRouteCircuitRoutesTableSummary struct {
11295
11296 Neighbor *string `json:"neighbor,omitempty"`
11297
11298 V *int32 `json:"v,omitempty"`
11299
11300 As *int32 `json:"as,omitempty"`
11301
11302 UpDown *string `json:"upDown,omitempty"`
11303
11304 StatePfxRcd *string `json:"statePfxRcd,omitempty"`
11305 }
11306
11307
11308
11309 type ExpressRouteCircuitsArpTableListResult struct {
11310 autorest.Response `json:"-"`
11311
11312 Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"`
11313
11314 NextLink *string `json:"nextLink,omitempty"`
11315 }
11316
11317
11318
11319 type ExpressRouteCircuitsCreateOrUpdateFuture struct {
11320 azure.FutureAPI
11321
11322
11323 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error)
11324 }
11325
11326
11327 func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
11328 var azFuture azure.Future
11329 if err := json.Unmarshal(body, &azFuture); err != nil {
11330 return err
11331 }
11332 future.FutureAPI = &azFuture
11333 future.Result = future.result
11334 return nil
11335 }
11336
11337
11338 func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) {
11339 var done bool
11340 done, err = future.DoneWithContext(context.Background(), client)
11341 if err != nil {
11342 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11343 return
11344 }
11345 if !done {
11346 erc.Response.Response = future.Response()
11347 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture")
11348 return
11349 }
11350 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11351 if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent {
11352 erc, err = client.CreateOrUpdateResponder(erc.Response.Response)
11353 if err != nil {
11354 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request")
11355 }
11356 }
11357 return
11358 }
11359
11360
11361
11362 type ExpressRouteCircuitsDeleteFuture struct {
11363 azure.FutureAPI
11364
11365
11366 Result func(ExpressRouteCircuitsClient) (autorest.Response, error)
11367 }
11368
11369
11370 func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error {
11371 var azFuture azure.Future
11372 if err := json.Unmarshal(body, &azFuture); err != nil {
11373 return err
11374 }
11375 future.FutureAPI = &azFuture
11376 future.Result = future.result
11377 return nil
11378 }
11379
11380
11381 func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) {
11382 var done bool
11383 done, err = future.DoneWithContext(context.Background(), client)
11384 if err != nil {
11385 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure")
11386 return
11387 }
11388 if !done {
11389 ar.Response = future.Response()
11390 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture")
11391 return
11392 }
11393 ar.Response = future.Response()
11394 return
11395 }
11396
11397
11398
11399 type ExpressRouteCircuitServiceProviderProperties struct {
11400
11401 ServiceProviderName *string `json:"serviceProviderName,omitempty"`
11402
11403 PeeringLocation *string `json:"peeringLocation,omitempty"`
11404
11405 BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
11406 }
11407
11408
11409 type ExpressRouteCircuitSku struct {
11410
11411 Name *string `json:"name,omitempty"`
11412
11413 Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"`
11414
11415 Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"`
11416 }
11417
11418
11419
11420 type ExpressRouteCircuitsListArpTableFuture struct {
11421 azure.FutureAPI
11422
11423
11424 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error)
11425 }
11426
11427
11428 func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error {
11429 var azFuture azure.Future
11430 if err := json.Unmarshal(body, &azFuture); err != nil {
11431 return err
11432 }
11433 future.FutureAPI = &azFuture
11434 future.Result = future.result
11435 return nil
11436 }
11437
11438
11439 func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) {
11440 var done bool
11441 done, err = future.DoneWithContext(context.Background(), client)
11442 if err != nil {
11443 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure")
11444 return
11445 }
11446 if !done {
11447 ercatlr.Response.Response = future.Response()
11448 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture")
11449 return
11450 }
11451 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11452 if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent {
11453 ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response)
11454 if err != nil {
11455 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request")
11456 }
11457 }
11458 return
11459 }
11460
11461
11462
11463 type ExpressRouteCircuitsListRoutesTableFuture struct {
11464 azure.FutureAPI
11465
11466
11467 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error)
11468 }
11469
11470
11471 func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error {
11472 var azFuture azure.Future
11473 if err := json.Unmarshal(body, &azFuture); err != nil {
11474 return err
11475 }
11476 future.FutureAPI = &azFuture
11477 future.Result = future.result
11478 return nil
11479 }
11480
11481
11482 func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) {
11483 var done bool
11484 done, err = future.DoneWithContext(context.Background(), client)
11485 if err != nil {
11486 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure")
11487 return
11488 }
11489 if !done {
11490 ercrtlr.Response.Response = future.Response()
11491 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture")
11492 return
11493 }
11494 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11495 if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent {
11496 ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response)
11497 if err != nil {
11498 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request")
11499 }
11500 }
11501 return
11502 }
11503
11504
11505
11506 type ExpressRouteCircuitsListRoutesTableSummaryFuture struct {
11507 azure.FutureAPI
11508
11509
11510 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error)
11511 }
11512
11513
11514 func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error {
11515 var azFuture azure.Future
11516 if err := json.Unmarshal(body, &azFuture); err != nil {
11517 return err
11518 }
11519 future.FutureAPI = &azFuture
11520 future.Result = future.result
11521 return nil
11522 }
11523
11524
11525 func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) {
11526 var done bool
11527 done, err = future.DoneWithContext(context.Background(), client)
11528 if err != nil {
11529 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure")
11530 return
11531 }
11532 if !done {
11533 ercrtslr.Response.Response = future.Response()
11534 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture")
11535 return
11536 }
11537 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11538 if ercrtslr.Response.Response, err = future.GetResult(sender); err == nil && ercrtslr.Response.Response.StatusCode != http.StatusNoContent {
11539 ercrtslr, err = client.ListRoutesTableSummaryResponder(ercrtslr.Response.Response)
11540 if err != nil {
11541 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", ercrtslr.Response.Response, "Failure responding to request")
11542 }
11543 }
11544 return
11545 }
11546
11547
11548
11549 type ExpressRouteCircuitsRoutesTableListResult struct {
11550 autorest.Response `json:"-"`
11551
11552 Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"`
11553
11554 NextLink *string `json:"nextLink,omitempty"`
11555 }
11556
11557
11558
11559 type ExpressRouteCircuitsRoutesTableSummaryListResult struct {
11560 autorest.Response `json:"-"`
11561
11562 Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"`
11563
11564 NextLink *string `json:"nextLink,omitempty"`
11565 }
11566
11567
11568 type ExpressRouteCircuitStats struct {
11569 autorest.Response `json:"-"`
11570
11571 PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"`
11572
11573 PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"`
11574
11575 SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"`
11576
11577 SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"`
11578 }
11579
11580
11581 type ExpressRouteConnection struct {
11582 autorest.Response `json:"-"`
11583
11584 *ExpressRouteConnectionProperties `json:"properties,omitempty"`
11585
11586 Name *string `json:"name,omitempty"`
11587
11588 ID *string `json:"id,omitempty"`
11589 }
11590
11591
11592 func (erc ExpressRouteConnection) MarshalJSON() ([]byte, error) {
11593 objectMap := make(map[string]interface{})
11594 if erc.ExpressRouteConnectionProperties != nil {
11595 objectMap["properties"] = erc.ExpressRouteConnectionProperties
11596 }
11597 if erc.Name != nil {
11598 objectMap["name"] = erc.Name
11599 }
11600 if erc.ID != nil {
11601 objectMap["id"] = erc.ID
11602 }
11603 return json.Marshal(objectMap)
11604 }
11605
11606
11607 func (erc *ExpressRouteConnection) UnmarshalJSON(body []byte) error {
11608 var m map[string]*json.RawMessage
11609 err := json.Unmarshal(body, &m)
11610 if err != nil {
11611 return err
11612 }
11613 for k, v := range m {
11614 switch k {
11615 case "properties":
11616 if v != nil {
11617 var expressRouteConnectionProperties ExpressRouteConnectionProperties
11618 err = json.Unmarshal(*v, &expressRouteConnectionProperties)
11619 if err != nil {
11620 return err
11621 }
11622 erc.ExpressRouteConnectionProperties = &expressRouteConnectionProperties
11623 }
11624 case "name":
11625 if v != nil {
11626 var name string
11627 err = json.Unmarshal(*v, &name)
11628 if err != nil {
11629 return err
11630 }
11631 erc.Name = &name
11632 }
11633 case "id":
11634 if v != nil {
11635 var ID string
11636 err = json.Unmarshal(*v, &ID)
11637 if err != nil {
11638 return err
11639 }
11640 erc.ID = &ID
11641 }
11642 }
11643 }
11644
11645 return nil
11646 }
11647
11648
11649 type ExpressRouteConnectionID struct {
11650
11651 ID *string `json:"id,omitempty"`
11652 }
11653
11654
11655 func (erci ExpressRouteConnectionID) MarshalJSON() ([]byte, error) {
11656 objectMap := make(map[string]interface{})
11657 return json.Marshal(objectMap)
11658 }
11659
11660
11661 type ExpressRouteConnectionList struct {
11662 autorest.Response `json:"-"`
11663
11664 Value *[]ExpressRouteConnection `json:"value,omitempty"`
11665 }
11666
11667
11668 type ExpressRouteConnectionProperties struct {
11669
11670 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
11671
11672 ExpressRouteCircuitPeering *ExpressRouteCircuitPeeringID `json:"expressRouteCircuitPeering,omitempty"`
11673
11674 AuthorizationKey *string `json:"authorizationKey,omitempty"`
11675
11676 RoutingWeight *int32 `json:"routingWeight,omitempty"`
11677
11678 EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"`
11679
11680 RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"`
11681 }
11682
11683
11684 func (ercp ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) {
11685 objectMap := make(map[string]interface{})
11686 if ercp.ExpressRouteCircuitPeering != nil {
11687 objectMap["expressRouteCircuitPeering"] = ercp.ExpressRouteCircuitPeering
11688 }
11689 if ercp.AuthorizationKey != nil {
11690 objectMap["authorizationKey"] = ercp.AuthorizationKey
11691 }
11692 if ercp.RoutingWeight != nil {
11693 objectMap["routingWeight"] = ercp.RoutingWeight
11694 }
11695 if ercp.EnableInternetSecurity != nil {
11696 objectMap["enableInternetSecurity"] = ercp.EnableInternetSecurity
11697 }
11698 if ercp.RoutingConfiguration != nil {
11699 objectMap["routingConfiguration"] = ercp.RoutingConfiguration
11700 }
11701 return json.Marshal(objectMap)
11702 }
11703
11704
11705
11706 type ExpressRouteConnectionsCreateOrUpdateFuture struct {
11707 azure.FutureAPI
11708
11709
11710 Result func(ExpressRouteConnectionsClient) (ExpressRouteConnection, error)
11711 }
11712
11713
11714 func (future *ExpressRouteConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
11715 var azFuture azure.Future
11716 if err := json.Unmarshal(body, &azFuture); err != nil {
11717 return err
11718 }
11719 future.FutureAPI = &azFuture
11720 future.Result = future.result
11721 return nil
11722 }
11723
11724
11725 func (future *ExpressRouteConnectionsCreateOrUpdateFuture) result(client ExpressRouteConnectionsClient) (erc ExpressRouteConnection, err error) {
11726 var done bool
11727 done, err = future.DoneWithContext(context.Background(), client)
11728 if err != nil {
11729 err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11730 return
11731 }
11732 if !done {
11733 erc.Response.Response = future.Response()
11734 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsCreateOrUpdateFuture")
11735 return
11736 }
11737 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11738 if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent {
11739 erc, err = client.CreateOrUpdateResponder(erc.Response.Response)
11740 if err != nil {
11741 err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request")
11742 }
11743 }
11744 return
11745 }
11746
11747
11748
11749 type ExpressRouteConnectionsDeleteFuture struct {
11750 azure.FutureAPI
11751
11752
11753 Result func(ExpressRouteConnectionsClient) (autorest.Response, error)
11754 }
11755
11756
11757 func (future *ExpressRouteConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
11758 var azFuture azure.Future
11759 if err := json.Unmarshal(body, &azFuture); err != nil {
11760 return err
11761 }
11762 future.FutureAPI = &azFuture
11763 future.Result = future.result
11764 return nil
11765 }
11766
11767
11768 func (future *ExpressRouteConnectionsDeleteFuture) result(client ExpressRouteConnectionsClient) (ar autorest.Response, err error) {
11769 var done bool
11770 done, err = future.DoneWithContext(context.Background(), client)
11771 if err != nil {
11772 err = autorest.NewErrorWithError(err, "network.ExpressRouteConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
11773 return
11774 }
11775 if !done {
11776 ar.Response = future.Response()
11777 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteConnectionsDeleteFuture")
11778 return
11779 }
11780 ar.Response = future.Response()
11781 return
11782 }
11783
11784
11785 type ExpressRouteCrossConnection struct {
11786 autorest.Response `json:"-"`
11787
11788 *ExpressRouteCrossConnectionProperties `json:"properties,omitempty"`
11789
11790 Etag *string `json:"etag,omitempty"`
11791
11792 ID *string `json:"id,omitempty"`
11793
11794 Name *string `json:"name,omitempty"`
11795
11796 Type *string `json:"type,omitempty"`
11797
11798 Location *string `json:"location,omitempty"`
11799
11800 Tags map[string]*string `json:"tags"`
11801 }
11802
11803
11804 func (ercc ExpressRouteCrossConnection) MarshalJSON() ([]byte, error) {
11805 objectMap := make(map[string]interface{})
11806 if ercc.ExpressRouteCrossConnectionProperties != nil {
11807 objectMap["properties"] = ercc.ExpressRouteCrossConnectionProperties
11808 }
11809 if ercc.ID != nil {
11810 objectMap["id"] = ercc.ID
11811 }
11812 if ercc.Location != nil {
11813 objectMap["location"] = ercc.Location
11814 }
11815 if ercc.Tags != nil {
11816 objectMap["tags"] = ercc.Tags
11817 }
11818 return json.Marshal(objectMap)
11819 }
11820
11821
11822 func (ercc *ExpressRouteCrossConnection) UnmarshalJSON(body []byte) error {
11823 var m map[string]*json.RawMessage
11824 err := json.Unmarshal(body, &m)
11825 if err != nil {
11826 return err
11827 }
11828 for k, v := range m {
11829 switch k {
11830 case "properties":
11831 if v != nil {
11832 var expressRouteCrossConnectionProperties ExpressRouteCrossConnectionProperties
11833 err = json.Unmarshal(*v, &expressRouteCrossConnectionProperties)
11834 if err != nil {
11835 return err
11836 }
11837 ercc.ExpressRouteCrossConnectionProperties = &expressRouteCrossConnectionProperties
11838 }
11839 case "etag":
11840 if v != nil {
11841 var etag string
11842 err = json.Unmarshal(*v, &etag)
11843 if err != nil {
11844 return err
11845 }
11846 ercc.Etag = &etag
11847 }
11848 case "id":
11849 if v != nil {
11850 var ID string
11851 err = json.Unmarshal(*v, &ID)
11852 if err != nil {
11853 return err
11854 }
11855 ercc.ID = &ID
11856 }
11857 case "name":
11858 if v != nil {
11859 var name string
11860 err = json.Unmarshal(*v, &name)
11861 if err != nil {
11862 return err
11863 }
11864 ercc.Name = &name
11865 }
11866 case "type":
11867 if v != nil {
11868 var typeVar string
11869 err = json.Unmarshal(*v, &typeVar)
11870 if err != nil {
11871 return err
11872 }
11873 ercc.Type = &typeVar
11874 }
11875 case "location":
11876 if v != nil {
11877 var location string
11878 err = json.Unmarshal(*v, &location)
11879 if err != nil {
11880 return err
11881 }
11882 ercc.Location = &location
11883 }
11884 case "tags":
11885 if v != nil {
11886 var tags map[string]*string
11887 err = json.Unmarshal(*v, &tags)
11888 if err != nil {
11889 return err
11890 }
11891 ercc.Tags = tags
11892 }
11893 }
11894 }
11895
11896 return nil
11897 }
11898
11899
11900 type ExpressRouteCrossConnectionListResult struct {
11901 autorest.Response `json:"-"`
11902
11903 Value *[]ExpressRouteCrossConnection `json:"value,omitempty"`
11904
11905 NextLink *string `json:"nextLink,omitempty"`
11906 }
11907
11908
11909 func (ercclr ExpressRouteCrossConnectionListResult) MarshalJSON() ([]byte, error) {
11910 objectMap := make(map[string]interface{})
11911 if ercclr.Value != nil {
11912 objectMap["value"] = ercclr.Value
11913 }
11914 return json.Marshal(objectMap)
11915 }
11916
11917
11918
11919 type ExpressRouteCrossConnectionListResultIterator struct {
11920 i int
11921 page ExpressRouteCrossConnectionListResultPage
11922 }
11923
11924
11925
11926 func (iter *ExpressRouteCrossConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
11927 if tracing.IsEnabled() {
11928 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultIterator.NextWithContext")
11929 defer func() {
11930 sc := -1
11931 if iter.Response().Response.Response != nil {
11932 sc = iter.Response().Response.Response.StatusCode
11933 }
11934 tracing.EndSpan(ctx, sc, err)
11935 }()
11936 }
11937 iter.i++
11938 if iter.i < len(iter.page.Values()) {
11939 return nil
11940 }
11941 err = iter.page.NextWithContext(ctx)
11942 if err != nil {
11943 iter.i--
11944 return err
11945 }
11946 iter.i = 0
11947 return nil
11948 }
11949
11950
11951
11952
11953 func (iter *ExpressRouteCrossConnectionListResultIterator) Next() error {
11954 return iter.NextWithContext(context.Background())
11955 }
11956
11957
11958 func (iter ExpressRouteCrossConnectionListResultIterator) NotDone() bool {
11959 return iter.page.NotDone() && iter.i < len(iter.page.Values())
11960 }
11961
11962
11963 func (iter ExpressRouteCrossConnectionListResultIterator) Response() ExpressRouteCrossConnectionListResult {
11964 return iter.page.Response()
11965 }
11966
11967
11968
11969 func (iter ExpressRouteCrossConnectionListResultIterator) Value() ExpressRouteCrossConnection {
11970 if !iter.page.NotDone() {
11971 return ExpressRouteCrossConnection{}
11972 }
11973 return iter.page.Values()[iter.i]
11974 }
11975
11976
11977 func NewExpressRouteCrossConnectionListResultIterator(page ExpressRouteCrossConnectionListResultPage) ExpressRouteCrossConnectionListResultIterator {
11978 return ExpressRouteCrossConnectionListResultIterator{page: page}
11979 }
11980
11981
11982 func (ercclr ExpressRouteCrossConnectionListResult) IsEmpty() bool {
11983 return ercclr.Value == nil || len(*ercclr.Value) == 0
11984 }
11985
11986
11987 func (ercclr ExpressRouteCrossConnectionListResult) hasNextLink() bool {
11988 return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0
11989 }
11990
11991
11992
11993 func (ercclr ExpressRouteCrossConnectionListResult) expressRouteCrossConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
11994 if !ercclr.hasNextLink() {
11995 return nil, nil
11996 }
11997 return autorest.Prepare((&http.Request{}).WithContext(ctx),
11998 autorest.AsJSON(),
11999 autorest.AsGet(),
12000 autorest.WithBaseURL(to.String(ercclr.NextLink)))
12001 }
12002
12003
12004 type ExpressRouteCrossConnectionListResultPage struct {
12005 fn func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error)
12006 ercclr ExpressRouteCrossConnectionListResult
12007 }
12008
12009
12010
12011 func (page *ExpressRouteCrossConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
12012 if tracing.IsEnabled() {
12013 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultPage.NextWithContext")
12014 defer func() {
12015 sc := -1
12016 if page.Response().Response.Response != nil {
12017 sc = page.Response().Response.Response.StatusCode
12018 }
12019 tracing.EndSpan(ctx, sc, err)
12020 }()
12021 }
12022 for {
12023 next, err := page.fn(ctx, page.ercclr)
12024 if err != nil {
12025 return err
12026 }
12027 page.ercclr = next
12028 if !next.hasNextLink() || !next.IsEmpty() {
12029 break
12030 }
12031 }
12032 return nil
12033 }
12034
12035
12036
12037
12038 func (page *ExpressRouteCrossConnectionListResultPage) Next() error {
12039 return page.NextWithContext(context.Background())
12040 }
12041
12042
12043 func (page ExpressRouteCrossConnectionListResultPage) NotDone() bool {
12044 return !page.ercclr.IsEmpty()
12045 }
12046
12047
12048 func (page ExpressRouteCrossConnectionListResultPage) Response() ExpressRouteCrossConnectionListResult {
12049 return page.ercclr
12050 }
12051
12052
12053 func (page ExpressRouteCrossConnectionListResultPage) Values() []ExpressRouteCrossConnection {
12054 if page.ercclr.IsEmpty() {
12055 return nil
12056 }
12057 return *page.ercclr.Value
12058 }
12059
12060
12061 func NewExpressRouteCrossConnectionListResultPage(cur ExpressRouteCrossConnectionListResult, getNextPage func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error)) ExpressRouteCrossConnectionListResultPage {
12062 return ExpressRouteCrossConnectionListResultPage{
12063 fn: getNextPage,
12064 ercclr: cur,
12065 }
12066 }
12067
12068
12069 type ExpressRouteCrossConnectionPeering struct {
12070 autorest.Response `json:"-"`
12071
12072 *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"`
12073
12074 Name *string `json:"name,omitempty"`
12075
12076 Etag *string `json:"etag,omitempty"`
12077
12078 ID *string `json:"id,omitempty"`
12079 }
12080
12081
12082 func (erccp ExpressRouteCrossConnectionPeering) MarshalJSON() ([]byte, error) {
12083 objectMap := make(map[string]interface{})
12084 if erccp.ExpressRouteCrossConnectionPeeringProperties != nil {
12085 objectMap["properties"] = erccp.ExpressRouteCrossConnectionPeeringProperties
12086 }
12087 if erccp.Name != nil {
12088 objectMap["name"] = erccp.Name
12089 }
12090 if erccp.ID != nil {
12091 objectMap["id"] = erccp.ID
12092 }
12093 return json.Marshal(objectMap)
12094 }
12095
12096
12097 func (erccp *ExpressRouteCrossConnectionPeering) UnmarshalJSON(body []byte) error {
12098 var m map[string]*json.RawMessage
12099 err := json.Unmarshal(body, &m)
12100 if err != nil {
12101 return err
12102 }
12103 for k, v := range m {
12104 switch k {
12105 case "properties":
12106 if v != nil {
12107 var expressRouteCrossConnectionPeeringProperties ExpressRouteCrossConnectionPeeringProperties
12108 err = json.Unmarshal(*v, &expressRouteCrossConnectionPeeringProperties)
12109 if err != nil {
12110 return err
12111 }
12112 erccp.ExpressRouteCrossConnectionPeeringProperties = &expressRouteCrossConnectionPeeringProperties
12113 }
12114 case "name":
12115 if v != nil {
12116 var name string
12117 err = json.Unmarshal(*v, &name)
12118 if err != nil {
12119 return err
12120 }
12121 erccp.Name = &name
12122 }
12123 case "etag":
12124 if v != nil {
12125 var etag string
12126 err = json.Unmarshal(*v, &etag)
12127 if err != nil {
12128 return err
12129 }
12130 erccp.Etag = &etag
12131 }
12132 case "id":
12133 if v != nil {
12134 var ID string
12135 err = json.Unmarshal(*v, &ID)
12136 if err != nil {
12137 return err
12138 }
12139 erccp.ID = &ID
12140 }
12141 }
12142 }
12143
12144 return nil
12145 }
12146
12147
12148
12149 type ExpressRouteCrossConnectionPeeringList struct {
12150 autorest.Response `json:"-"`
12151
12152 Value *[]ExpressRouteCrossConnectionPeering `json:"value,omitempty"`
12153
12154 NextLink *string `json:"nextLink,omitempty"`
12155 }
12156
12157
12158 func (erccpl ExpressRouteCrossConnectionPeeringList) MarshalJSON() ([]byte, error) {
12159 objectMap := make(map[string]interface{})
12160 if erccpl.Value != nil {
12161 objectMap["value"] = erccpl.Value
12162 }
12163 return json.Marshal(objectMap)
12164 }
12165
12166
12167
12168 type ExpressRouteCrossConnectionPeeringListIterator struct {
12169 i int
12170 page ExpressRouteCrossConnectionPeeringListPage
12171 }
12172
12173
12174
12175 func (iter *ExpressRouteCrossConnectionPeeringListIterator) NextWithContext(ctx context.Context) (err error) {
12176 if tracing.IsEnabled() {
12177 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListIterator.NextWithContext")
12178 defer func() {
12179 sc := -1
12180 if iter.Response().Response.Response != nil {
12181 sc = iter.Response().Response.Response.StatusCode
12182 }
12183 tracing.EndSpan(ctx, sc, err)
12184 }()
12185 }
12186 iter.i++
12187 if iter.i < len(iter.page.Values()) {
12188 return nil
12189 }
12190 err = iter.page.NextWithContext(ctx)
12191 if err != nil {
12192 iter.i--
12193 return err
12194 }
12195 iter.i = 0
12196 return nil
12197 }
12198
12199
12200
12201
12202 func (iter *ExpressRouteCrossConnectionPeeringListIterator) Next() error {
12203 return iter.NextWithContext(context.Background())
12204 }
12205
12206
12207 func (iter ExpressRouteCrossConnectionPeeringListIterator) NotDone() bool {
12208 return iter.page.NotDone() && iter.i < len(iter.page.Values())
12209 }
12210
12211
12212 func (iter ExpressRouteCrossConnectionPeeringListIterator) Response() ExpressRouteCrossConnectionPeeringList {
12213 return iter.page.Response()
12214 }
12215
12216
12217
12218 func (iter ExpressRouteCrossConnectionPeeringListIterator) Value() ExpressRouteCrossConnectionPeering {
12219 if !iter.page.NotDone() {
12220 return ExpressRouteCrossConnectionPeering{}
12221 }
12222 return iter.page.Values()[iter.i]
12223 }
12224
12225
12226 func NewExpressRouteCrossConnectionPeeringListIterator(page ExpressRouteCrossConnectionPeeringListPage) ExpressRouteCrossConnectionPeeringListIterator {
12227 return ExpressRouteCrossConnectionPeeringListIterator{page: page}
12228 }
12229
12230
12231 func (erccpl ExpressRouteCrossConnectionPeeringList) IsEmpty() bool {
12232 return erccpl.Value == nil || len(*erccpl.Value) == 0
12233 }
12234
12235
12236 func (erccpl ExpressRouteCrossConnectionPeeringList) hasNextLink() bool {
12237 return erccpl.NextLink != nil && len(*erccpl.NextLink) != 0
12238 }
12239
12240
12241
12242 func (erccpl ExpressRouteCrossConnectionPeeringList) expressRouteCrossConnectionPeeringListPreparer(ctx context.Context) (*http.Request, error) {
12243 if !erccpl.hasNextLink() {
12244 return nil, nil
12245 }
12246 return autorest.Prepare((&http.Request{}).WithContext(ctx),
12247 autorest.AsJSON(),
12248 autorest.AsGet(),
12249 autorest.WithBaseURL(to.String(erccpl.NextLink)))
12250 }
12251
12252
12253 type ExpressRouteCrossConnectionPeeringListPage struct {
12254 fn func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error)
12255 erccpl ExpressRouteCrossConnectionPeeringList
12256 }
12257
12258
12259
12260 func (page *ExpressRouteCrossConnectionPeeringListPage) NextWithContext(ctx context.Context) (err error) {
12261 if tracing.IsEnabled() {
12262 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListPage.NextWithContext")
12263 defer func() {
12264 sc := -1
12265 if page.Response().Response.Response != nil {
12266 sc = page.Response().Response.Response.StatusCode
12267 }
12268 tracing.EndSpan(ctx, sc, err)
12269 }()
12270 }
12271 for {
12272 next, err := page.fn(ctx, page.erccpl)
12273 if err != nil {
12274 return err
12275 }
12276 page.erccpl = next
12277 if !next.hasNextLink() || !next.IsEmpty() {
12278 break
12279 }
12280 }
12281 return nil
12282 }
12283
12284
12285
12286
12287 func (page *ExpressRouteCrossConnectionPeeringListPage) Next() error {
12288 return page.NextWithContext(context.Background())
12289 }
12290
12291
12292 func (page ExpressRouteCrossConnectionPeeringListPage) NotDone() bool {
12293 return !page.erccpl.IsEmpty()
12294 }
12295
12296
12297 func (page ExpressRouteCrossConnectionPeeringListPage) Response() ExpressRouteCrossConnectionPeeringList {
12298 return page.erccpl
12299 }
12300
12301
12302 func (page ExpressRouteCrossConnectionPeeringListPage) Values() []ExpressRouteCrossConnectionPeering {
12303 if page.erccpl.IsEmpty() {
12304 return nil
12305 }
12306 return *page.erccpl.Value
12307 }
12308
12309
12310 func NewExpressRouteCrossConnectionPeeringListPage(cur ExpressRouteCrossConnectionPeeringList, getNextPage func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error)) ExpressRouteCrossConnectionPeeringListPage {
12311 return ExpressRouteCrossConnectionPeeringListPage{
12312 fn: getNextPage,
12313 erccpl: cur,
12314 }
12315 }
12316
12317
12318 type ExpressRouteCrossConnectionPeeringProperties struct {
12319
12320 PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"`
12321
12322 State ExpressRoutePeeringState `json:"state,omitempty"`
12323
12324 AzureASN *int32 `json:"azureASN,omitempty"`
12325
12326 PeerASN *int64 `json:"peerASN,omitempty"`
12327
12328 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"`
12329
12330 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"`
12331
12332 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"`
12333
12334 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"`
12335
12336 SharedKey *string `json:"sharedKey,omitempty"`
12337
12338 VlanID *int32 `json:"vlanId,omitempty"`
12339
12340 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"`
12341
12342 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
12343
12344 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"`
12345
12346 LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
12347
12348 Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"`
12349 }
12350
12351
12352 func (erccpp ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) {
12353 objectMap := make(map[string]interface{})
12354 if erccpp.PeeringType != "" {
12355 objectMap["peeringType"] = erccpp.PeeringType
12356 }
12357 if erccpp.State != "" {
12358 objectMap["state"] = erccpp.State
12359 }
12360 if erccpp.PeerASN != nil {
12361 objectMap["peerASN"] = erccpp.PeerASN
12362 }
12363 if erccpp.PrimaryPeerAddressPrefix != nil {
12364 objectMap["primaryPeerAddressPrefix"] = erccpp.PrimaryPeerAddressPrefix
12365 }
12366 if erccpp.SecondaryPeerAddressPrefix != nil {
12367 objectMap["secondaryPeerAddressPrefix"] = erccpp.SecondaryPeerAddressPrefix
12368 }
12369 if erccpp.SharedKey != nil {
12370 objectMap["sharedKey"] = erccpp.SharedKey
12371 }
12372 if erccpp.VlanID != nil {
12373 objectMap["vlanId"] = erccpp.VlanID
12374 }
12375 if erccpp.MicrosoftPeeringConfig != nil {
12376 objectMap["microsoftPeeringConfig"] = erccpp.MicrosoftPeeringConfig
12377 }
12378 if erccpp.GatewayManagerEtag != nil {
12379 objectMap["gatewayManagerEtag"] = erccpp.GatewayManagerEtag
12380 }
12381 if erccpp.Ipv6PeeringConfig != nil {
12382 objectMap["ipv6PeeringConfig"] = erccpp.Ipv6PeeringConfig
12383 }
12384 return json.Marshal(objectMap)
12385 }
12386
12387
12388
12389 type ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture struct {
12390 azure.FutureAPI
12391
12392
12393 Result func(ExpressRouteCrossConnectionPeeringsClient) (ExpressRouteCrossConnectionPeering, error)
12394 }
12395
12396
12397 func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12398 var azFuture azure.Future
12399 if err := json.Unmarshal(body, &azFuture); err != nil {
12400 return err
12401 }
12402 future.FutureAPI = &azFuture
12403 future.Result = future.result
12404 return nil
12405 }
12406
12407
12408 func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (erccp ExpressRouteCrossConnectionPeering, err error) {
12409 var done bool
12410 done, err = future.DoneWithContext(context.Background(), client)
12411 if err != nil {
12412 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12413 return
12414 }
12415 if !done {
12416 erccp.Response.Response = future.Response()
12417 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture")
12418 return
12419 }
12420 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12421 if erccp.Response.Response, err = future.GetResult(sender); err == nil && erccp.Response.Response.StatusCode != http.StatusNoContent {
12422 erccp, err = client.CreateOrUpdateResponder(erccp.Response.Response)
12423 if err != nil {
12424 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", erccp.Response.Response, "Failure responding to request")
12425 }
12426 }
12427 return
12428 }
12429
12430
12431
12432 type ExpressRouteCrossConnectionPeeringsDeleteFuture struct {
12433 azure.FutureAPI
12434
12435
12436 Result func(ExpressRouteCrossConnectionPeeringsClient) (autorest.Response, error)
12437 }
12438
12439
12440 func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) UnmarshalJSON(body []byte) error {
12441 var azFuture azure.Future
12442 if err := json.Unmarshal(body, &azFuture); err != nil {
12443 return err
12444 }
12445 future.FutureAPI = &azFuture
12446 future.Result = future.result
12447 return nil
12448 }
12449
12450
12451 func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (ar autorest.Response, err error) {
12452 var done bool
12453 done, err = future.DoneWithContext(context.Background(), client)
12454 if err != nil {
12455 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
12456 return
12457 }
12458 if !done {
12459 ar.Response = future.Response()
12460 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsDeleteFuture")
12461 return
12462 }
12463 ar.Response = future.Response()
12464 return
12465 }
12466
12467
12468 type ExpressRouteCrossConnectionProperties struct {
12469
12470 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"`
12471
12472 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"`
12473
12474 STag *int32 `json:"sTag,omitempty"`
12475
12476 PeeringLocation *string `json:"peeringLocation,omitempty"`
12477
12478 BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
12479
12480 ExpressRouteCircuit *ExpressRouteCircuitReference `json:"expressRouteCircuit,omitempty"`
12481
12482 ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"`
12483
12484 ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"`
12485
12486 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
12487
12488 Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"`
12489 }
12490
12491
12492 func (erccp ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) {
12493 objectMap := make(map[string]interface{})
12494 if erccp.PeeringLocation != nil {
12495 objectMap["peeringLocation"] = erccp.PeeringLocation
12496 }
12497 if erccp.BandwidthInMbps != nil {
12498 objectMap["bandwidthInMbps"] = erccp.BandwidthInMbps
12499 }
12500 if erccp.ExpressRouteCircuit != nil {
12501 objectMap["expressRouteCircuit"] = erccp.ExpressRouteCircuit
12502 }
12503 if erccp.ServiceProviderProvisioningState != "" {
12504 objectMap["serviceProviderProvisioningState"] = erccp.ServiceProviderProvisioningState
12505 }
12506 if erccp.ServiceProviderNotes != nil {
12507 objectMap["serviceProviderNotes"] = erccp.ServiceProviderNotes
12508 }
12509 if erccp.Peerings != nil {
12510 objectMap["peerings"] = erccp.Peerings
12511 }
12512 return json.Marshal(objectMap)
12513 }
12514
12515
12516 type ExpressRouteCrossConnectionRoutesTableSummary struct {
12517
12518 Neighbor *string `json:"neighbor,omitempty"`
12519
12520 Asn *int32 `json:"asn,omitempty"`
12521
12522 UpDown *string `json:"upDown,omitempty"`
12523
12524 StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"`
12525 }
12526
12527
12528
12529 type ExpressRouteCrossConnectionsCreateOrUpdateFuture struct {
12530 azure.FutureAPI
12531
12532
12533 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnection, error)
12534 }
12535
12536
12537 func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12538 var azFuture azure.Future
12539 if err := json.Unmarshal(body, &azFuture); err != nil {
12540 return err
12541 }
12542 future.FutureAPI = &azFuture
12543 future.Result = future.result
12544 return nil
12545 }
12546
12547
12548 func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) {
12549 var done bool
12550 done, err = future.DoneWithContext(context.Background(), client)
12551 if err != nil {
12552 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12553 return
12554 }
12555 if !done {
12556 ercc.Response.Response = future.Response()
12557 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsCreateOrUpdateFuture")
12558 return
12559 }
12560 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12561 if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent {
12562 ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response)
12563 if err != nil {
12564 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request")
12565 }
12566 }
12567 return
12568 }
12569
12570
12571
12572 type ExpressRouteCrossConnectionsListArpTableFuture struct {
12573 azure.FutureAPI
12574
12575
12576 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsArpTableListResult, error)
12577 }
12578
12579
12580 func (future *ExpressRouteCrossConnectionsListArpTableFuture) UnmarshalJSON(body []byte) error {
12581 var azFuture azure.Future
12582 if err := json.Unmarshal(body, &azFuture); err != nil {
12583 return err
12584 }
12585 future.FutureAPI = &azFuture
12586 future.Result = future.result
12587 return nil
12588 }
12589
12590
12591 func (future *ExpressRouteCrossConnectionsListArpTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) {
12592 var done bool
12593 done, err = future.DoneWithContext(context.Background(), client)
12594 if err != nil {
12595 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", future.Response(), "Polling failure")
12596 return
12597 }
12598 if !done {
12599 ercatlr.Response.Response = future.Response()
12600 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListArpTableFuture")
12601 return
12602 }
12603 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12604 if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent {
12605 ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response)
12606 if err != nil {
12607 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request")
12608 }
12609 }
12610 return
12611 }
12612
12613
12614
12615 type ExpressRouteCrossConnectionsListRoutesTableFuture struct {
12616 azure.FutureAPI
12617
12618
12619 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsRoutesTableListResult, error)
12620 }
12621
12622
12623 func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) UnmarshalJSON(body []byte) error {
12624 var azFuture azure.Future
12625 if err := json.Unmarshal(body, &azFuture); err != nil {
12626 return err
12627 }
12628 future.FutureAPI = &azFuture
12629 future.Result = future.result
12630 return nil
12631 }
12632
12633
12634 func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) {
12635 var done bool
12636 done, err = future.DoneWithContext(context.Background(), client)
12637 if err != nil {
12638 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", future.Response(), "Polling failure")
12639 return
12640 }
12641 if !done {
12642 ercrtlr.Response.Response = future.Response()
12643 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableFuture")
12644 return
12645 }
12646 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12647 if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent {
12648 ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response)
12649 if err != nil {
12650 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request")
12651 }
12652 }
12653 return
12654 }
12655
12656
12657
12658 type ExpressRouteCrossConnectionsListRoutesTableSummaryFuture struct {
12659 azure.FutureAPI
12660
12661
12662 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnectionsRoutesTableSummaryListResult, error)
12663 }
12664
12665
12666 func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error {
12667 var azFuture azure.Future
12668 if err := json.Unmarshal(body, &azFuture); err != nil {
12669 return err
12670 }
12671 future.FutureAPI = &azFuture
12672 future.Result = future.result
12673 return nil
12674 }
12675
12676
12677 func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) result(client ExpressRouteCrossConnectionsClient) (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) {
12678 var done bool
12679 done, err = future.DoneWithContext(context.Background(), client)
12680 if err != nil {
12681 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure")
12682 return
12683 }
12684 if !done {
12685 erccrtslr.Response.Response = future.Response()
12686 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture")
12687 return
12688 }
12689 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12690 if erccrtslr.Response.Response, err = future.GetResult(sender); err == nil && erccrtslr.Response.Response.StatusCode != http.StatusNoContent {
12691 erccrtslr, err = client.ListRoutesTableSummaryResponder(erccrtslr.Response.Response)
12692 if err != nil {
12693 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", erccrtslr.Response.Response, "Failure responding to request")
12694 }
12695 }
12696 return
12697 }
12698
12699
12700
12701 type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct {
12702 autorest.Response `json:"-"`
12703
12704 Value *[]ExpressRouteCrossConnectionRoutesTableSummary `json:"value,omitempty"`
12705
12706 NextLink *string `json:"nextLink,omitempty"`
12707 }
12708
12709
12710 func (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) {
12711 objectMap := make(map[string]interface{})
12712 if erccrtslr.Value != nil {
12713 objectMap["value"] = erccrtslr.Value
12714 }
12715 return json.Marshal(objectMap)
12716 }
12717
12718
12719 type ExpressRouteGateway struct {
12720 autorest.Response `json:"-"`
12721
12722 *ExpressRouteGatewayProperties `json:"properties,omitempty"`
12723
12724 Etag *string `json:"etag,omitempty"`
12725
12726 ID *string `json:"id,omitempty"`
12727
12728 Name *string `json:"name,omitempty"`
12729
12730 Type *string `json:"type,omitempty"`
12731
12732 Location *string `json:"location,omitempty"`
12733
12734 Tags map[string]*string `json:"tags"`
12735 }
12736
12737
12738 func (erg ExpressRouteGateway) MarshalJSON() ([]byte, error) {
12739 objectMap := make(map[string]interface{})
12740 if erg.ExpressRouteGatewayProperties != nil {
12741 objectMap["properties"] = erg.ExpressRouteGatewayProperties
12742 }
12743 if erg.ID != nil {
12744 objectMap["id"] = erg.ID
12745 }
12746 if erg.Location != nil {
12747 objectMap["location"] = erg.Location
12748 }
12749 if erg.Tags != nil {
12750 objectMap["tags"] = erg.Tags
12751 }
12752 return json.Marshal(objectMap)
12753 }
12754
12755
12756 func (erg *ExpressRouteGateway) UnmarshalJSON(body []byte) error {
12757 var m map[string]*json.RawMessage
12758 err := json.Unmarshal(body, &m)
12759 if err != nil {
12760 return err
12761 }
12762 for k, v := range m {
12763 switch k {
12764 case "properties":
12765 if v != nil {
12766 var expressRouteGatewayProperties ExpressRouteGatewayProperties
12767 err = json.Unmarshal(*v, &expressRouteGatewayProperties)
12768 if err != nil {
12769 return err
12770 }
12771 erg.ExpressRouteGatewayProperties = &expressRouteGatewayProperties
12772 }
12773 case "etag":
12774 if v != nil {
12775 var etag string
12776 err = json.Unmarshal(*v, &etag)
12777 if err != nil {
12778 return err
12779 }
12780 erg.Etag = &etag
12781 }
12782 case "id":
12783 if v != nil {
12784 var ID string
12785 err = json.Unmarshal(*v, &ID)
12786 if err != nil {
12787 return err
12788 }
12789 erg.ID = &ID
12790 }
12791 case "name":
12792 if v != nil {
12793 var name string
12794 err = json.Unmarshal(*v, &name)
12795 if err != nil {
12796 return err
12797 }
12798 erg.Name = &name
12799 }
12800 case "type":
12801 if v != nil {
12802 var typeVar string
12803 err = json.Unmarshal(*v, &typeVar)
12804 if err != nil {
12805 return err
12806 }
12807 erg.Type = &typeVar
12808 }
12809 case "location":
12810 if v != nil {
12811 var location string
12812 err = json.Unmarshal(*v, &location)
12813 if err != nil {
12814 return err
12815 }
12816 erg.Location = &location
12817 }
12818 case "tags":
12819 if v != nil {
12820 var tags map[string]*string
12821 err = json.Unmarshal(*v, &tags)
12822 if err != nil {
12823 return err
12824 }
12825 erg.Tags = tags
12826 }
12827 }
12828 }
12829
12830 return nil
12831 }
12832
12833
12834 type ExpressRouteGatewayList struct {
12835 autorest.Response `json:"-"`
12836
12837 Value *[]ExpressRouteGateway `json:"value,omitempty"`
12838 }
12839
12840
12841 type ExpressRouteGatewayProperties struct {
12842
12843 AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"`
12844
12845 ExpressRouteConnections *[]ExpressRouteConnection `json:"expressRouteConnections,omitempty"`
12846
12847 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
12848
12849 VirtualHub *VirtualHubID `json:"virtualHub,omitempty"`
12850 }
12851
12852
12853 func (ergp ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) {
12854 objectMap := make(map[string]interface{})
12855 if ergp.AutoScaleConfiguration != nil {
12856 objectMap["autoScaleConfiguration"] = ergp.AutoScaleConfiguration
12857 }
12858 if ergp.VirtualHub != nil {
12859 objectMap["virtualHub"] = ergp.VirtualHub
12860 }
12861 return json.Marshal(objectMap)
12862 }
12863
12864
12865 type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct {
12866
12867 Bounds *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds `json:"bounds,omitempty"`
12868 }
12869
12870
12871
12872 type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct {
12873
12874 Min *int32 `json:"min,omitempty"`
12875
12876 Max *int32 `json:"max,omitempty"`
12877 }
12878
12879
12880
12881 type ExpressRouteGatewaysCreateOrUpdateFuture struct {
12882 azure.FutureAPI
12883
12884
12885 Result func(ExpressRouteGatewaysClient) (ExpressRouteGateway, error)
12886 }
12887
12888
12889 func (future *ExpressRouteGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12890 var azFuture azure.Future
12891 if err := json.Unmarshal(body, &azFuture); err != nil {
12892 return err
12893 }
12894 future.FutureAPI = &azFuture
12895 future.Result = future.result
12896 return nil
12897 }
12898
12899
12900 func (future *ExpressRouteGatewaysCreateOrUpdateFuture) result(client ExpressRouteGatewaysClient) (erg ExpressRouteGateway, err error) {
12901 var done bool
12902 done, err = future.DoneWithContext(context.Background(), client)
12903 if err != nil {
12904 err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12905 return
12906 }
12907 if !done {
12908 erg.Response.Response = future.Response()
12909 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysCreateOrUpdateFuture")
12910 return
12911 }
12912 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12913 if erg.Response.Response, err = future.GetResult(sender); err == nil && erg.Response.Response.StatusCode != http.StatusNoContent {
12914 erg, err = client.CreateOrUpdateResponder(erg.Response.Response)
12915 if err != nil {
12916 err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysCreateOrUpdateFuture", "Result", erg.Response.Response, "Failure responding to request")
12917 }
12918 }
12919 return
12920 }
12921
12922
12923
12924 type ExpressRouteGatewaysDeleteFuture struct {
12925 azure.FutureAPI
12926
12927
12928 Result func(ExpressRouteGatewaysClient) (autorest.Response, error)
12929 }
12930
12931
12932 func (future *ExpressRouteGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
12933 var azFuture azure.Future
12934 if err := json.Unmarshal(body, &azFuture); err != nil {
12935 return err
12936 }
12937 future.FutureAPI = &azFuture
12938 future.Result = future.result
12939 return nil
12940 }
12941
12942
12943 func (future *ExpressRouteGatewaysDeleteFuture) result(client ExpressRouteGatewaysClient) (ar autorest.Response, err error) {
12944 var done bool
12945 done, err = future.DoneWithContext(context.Background(), client)
12946 if err != nil {
12947 err = autorest.NewErrorWithError(err, "network.ExpressRouteGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
12948 return
12949 }
12950 if !done {
12951 ar.Response = future.Response()
12952 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteGatewaysDeleteFuture")
12953 return
12954 }
12955 ar.Response = future.Response()
12956 return
12957 }
12958
12959
12960 type ExpressRouteLink struct {
12961 autorest.Response `json:"-"`
12962
12963 *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"`
12964
12965 Name *string `json:"name,omitempty"`
12966
12967 Etag *string `json:"etag,omitempty"`
12968
12969 ID *string `json:"id,omitempty"`
12970 }
12971
12972
12973 func (erl ExpressRouteLink) MarshalJSON() ([]byte, error) {
12974 objectMap := make(map[string]interface{})
12975 if erl.ExpressRouteLinkPropertiesFormat != nil {
12976 objectMap["properties"] = erl.ExpressRouteLinkPropertiesFormat
12977 }
12978 if erl.Name != nil {
12979 objectMap["name"] = erl.Name
12980 }
12981 if erl.ID != nil {
12982 objectMap["id"] = erl.ID
12983 }
12984 return json.Marshal(objectMap)
12985 }
12986
12987
12988 func (erl *ExpressRouteLink) UnmarshalJSON(body []byte) error {
12989 var m map[string]*json.RawMessage
12990 err := json.Unmarshal(body, &m)
12991 if err != nil {
12992 return err
12993 }
12994 for k, v := range m {
12995 switch k {
12996 case "properties":
12997 if v != nil {
12998 var expressRouteLinkPropertiesFormat ExpressRouteLinkPropertiesFormat
12999 err = json.Unmarshal(*v, &expressRouteLinkPropertiesFormat)
13000 if err != nil {
13001 return err
13002 }
13003 erl.ExpressRouteLinkPropertiesFormat = &expressRouteLinkPropertiesFormat
13004 }
13005 case "name":
13006 if v != nil {
13007 var name string
13008 err = json.Unmarshal(*v, &name)
13009 if err != nil {
13010 return err
13011 }
13012 erl.Name = &name
13013 }
13014 case "etag":
13015 if v != nil {
13016 var etag string
13017 err = json.Unmarshal(*v, &etag)
13018 if err != nil {
13019 return err
13020 }
13021 erl.Etag = &etag
13022 }
13023 case "id":
13024 if v != nil {
13025 var ID string
13026 err = json.Unmarshal(*v, &ID)
13027 if err != nil {
13028 return err
13029 }
13030 erl.ID = &ID
13031 }
13032 }
13033 }
13034
13035 return nil
13036 }
13037
13038
13039 type ExpressRouteLinkListResult struct {
13040 autorest.Response `json:"-"`
13041
13042 Value *[]ExpressRouteLink `json:"value,omitempty"`
13043
13044 NextLink *string `json:"nextLink,omitempty"`
13045 }
13046
13047
13048 type ExpressRouteLinkListResultIterator struct {
13049 i int
13050 page ExpressRouteLinkListResultPage
13051 }
13052
13053
13054
13055 func (iter *ExpressRouteLinkListResultIterator) NextWithContext(ctx context.Context) (err error) {
13056 if tracing.IsEnabled() {
13057 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinkListResultIterator.NextWithContext")
13058 defer func() {
13059 sc := -1
13060 if iter.Response().Response.Response != nil {
13061 sc = iter.Response().Response.Response.StatusCode
13062 }
13063 tracing.EndSpan(ctx, sc, err)
13064 }()
13065 }
13066 iter.i++
13067 if iter.i < len(iter.page.Values()) {
13068 return nil
13069 }
13070 err = iter.page.NextWithContext(ctx)
13071 if err != nil {
13072 iter.i--
13073 return err
13074 }
13075 iter.i = 0
13076 return nil
13077 }
13078
13079
13080
13081
13082 func (iter *ExpressRouteLinkListResultIterator) Next() error {
13083 return iter.NextWithContext(context.Background())
13084 }
13085
13086
13087 func (iter ExpressRouteLinkListResultIterator) NotDone() bool {
13088 return iter.page.NotDone() && iter.i < len(iter.page.Values())
13089 }
13090
13091
13092 func (iter ExpressRouteLinkListResultIterator) Response() ExpressRouteLinkListResult {
13093 return iter.page.Response()
13094 }
13095
13096
13097
13098 func (iter ExpressRouteLinkListResultIterator) Value() ExpressRouteLink {
13099 if !iter.page.NotDone() {
13100 return ExpressRouteLink{}
13101 }
13102 return iter.page.Values()[iter.i]
13103 }
13104
13105
13106 func NewExpressRouteLinkListResultIterator(page ExpressRouteLinkListResultPage) ExpressRouteLinkListResultIterator {
13107 return ExpressRouteLinkListResultIterator{page: page}
13108 }
13109
13110
13111 func (erllr ExpressRouteLinkListResult) IsEmpty() bool {
13112 return erllr.Value == nil || len(*erllr.Value) == 0
13113 }
13114
13115
13116 func (erllr ExpressRouteLinkListResult) hasNextLink() bool {
13117 return erllr.NextLink != nil && len(*erllr.NextLink) != 0
13118 }
13119
13120
13121
13122 func (erllr ExpressRouteLinkListResult) expressRouteLinkListResultPreparer(ctx context.Context) (*http.Request, error) {
13123 if !erllr.hasNextLink() {
13124 return nil, nil
13125 }
13126 return autorest.Prepare((&http.Request{}).WithContext(ctx),
13127 autorest.AsJSON(),
13128 autorest.AsGet(),
13129 autorest.WithBaseURL(to.String(erllr.NextLink)))
13130 }
13131
13132
13133 type ExpressRouteLinkListResultPage struct {
13134 fn func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error)
13135 erllr ExpressRouteLinkListResult
13136 }
13137
13138
13139
13140 func (page *ExpressRouteLinkListResultPage) NextWithContext(ctx context.Context) (err error) {
13141 if tracing.IsEnabled() {
13142 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteLinkListResultPage.NextWithContext")
13143 defer func() {
13144 sc := -1
13145 if page.Response().Response.Response != nil {
13146 sc = page.Response().Response.Response.StatusCode
13147 }
13148 tracing.EndSpan(ctx, sc, err)
13149 }()
13150 }
13151 for {
13152 next, err := page.fn(ctx, page.erllr)
13153 if err != nil {
13154 return err
13155 }
13156 page.erllr = next
13157 if !next.hasNextLink() || !next.IsEmpty() {
13158 break
13159 }
13160 }
13161 return nil
13162 }
13163
13164
13165
13166
13167 func (page *ExpressRouteLinkListResultPage) Next() error {
13168 return page.NextWithContext(context.Background())
13169 }
13170
13171
13172 func (page ExpressRouteLinkListResultPage) NotDone() bool {
13173 return !page.erllr.IsEmpty()
13174 }
13175
13176
13177 func (page ExpressRouteLinkListResultPage) Response() ExpressRouteLinkListResult {
13178 return page.erllr
13179 }
13180
13181
13182 func (page ExpressRouteLinkListResultPage) Values() []ExpressRouteLink {
13183 if page.erllr.IsEmpty() {
13184 return nil
13185 }
13186 return *page.erllr.Value
13187 }
13188
13189
13190 func NewExpressRouteLinkListResultPage(cur ExpressRouteLinkListResult, getNextPage func(context.Context, ExpressRouteLinkListResult) (ExpressRouteLinkListResult, error)) ExpressRouteLinkListResultPage {
13191 return ExpressRouteLinkListResultPage{
13192 fn: getNextPage,
13193 erllr: cur,
13194 }
13195 }
13196
13197
13198 type ExpressRouteLinkMacSecConfig struct {
13199
13200 CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"`
13201
13202 CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"`
13203
13204 Cipher ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"`
13205 }
13206
13207
13208 type ExpressRouteLinkPropertiesFormat struct {
13209
13210 RouterName *string `json:"routerName,omitempty"`
13211
13212 InterfaceName *string `json:"interfaceName,omitempty"`
13213
13214 PatchPanelID *string `json:"patchPanelId,omitempty"`
13215
13216 RackID *string `json:"rackId,omitempty"`
13217
13218 ConnectorType ExpressRouteLinkConnectorType `json:"connectorType,omitempty"`
13219
13220 AdminState ExpressRouteLinkAdminState `json:"adminState,omitempty"`
13221
13222 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
13223
13224 MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"`
13225 }
13226
13227
13228 func (erlpf ExpressRouteLinkPropertiesFormat) MarshalJSON() ([]byte, error) {
13229 objectMap := make(map[string]interface{})
13230 if erlpf.AdminState != "" {
13231 objectMap["adminState"] = erlpf.AdminState
13232 }
13233 if erlpf.MacSecConfig != nil {
13234 objectMap["macSecConfig"] = erlpf.MacSecConfig
13235 }
13236 return json.Marshal(objectMap)
13237 }
13238
13239
13240 type ExpressRoutePort struct {
13241 autorest.Response `json:"-"`
13242
13243 *ExpressRoutePortPropertiesFormat `json:"properties,omitempty"`
13244
13245 Etag *string `json:"etag,omitempty"`
13246
13247 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
13248
13249 ID *string `json:"id,omitempty"`
13250
13251 Name *string `json:"name,omitempty"`
13252
13253 Type *string `json:"type,omitempty"`
13254
13255 Location *string `json:"location,omitempty"`
13256
13257 Tags map[string]*string `json:"tags"`
13258 }
13259
13260
13261 func (erp ExpressRoutePort) MarshalJSON() ([]byte, error) {
13262 objectMap := make(map[string]interface{})
13263 if erp.ExpressRoutePortPropertiesFormat != nil {
13264 objectMap["properties"] = erp.ExpressRoutePortPropertiesFormat
13265 }
13266 if erp.Identity != nil {
13267 objectMap["identity"] = erp.Identity
13268 }
13269 if erp.ID != nil {
13270 objectMap["id"] = erp.ID
13271 }
13272 if erp.Location != nil {
13273 objectMap["location"] = erp.Location
13274 }
13275 if erp.Tags != nil {
13276 objectMap["tags"] = erp.Tags
13277 }
13278 return json.Marshal(objectMap)
13279 }
13280
13281
13282 func (erp *ExpressRoutePort) UnmarshalJSON(body []byte) error {
13283 var m map[string]*json.RawMessage
13284 err := json.Unmarshal(body, &m)
13285 if err != nil {
13286 return err
13287 }
13288 for k, v := range m {
13289 switch k {
13290 case "properties":
13291 if v != nil {
13292 var expressRoutePortPropertiesFormat ExpressRoutePortPropertiesFormat
13293 err = json.Unmarshal(*v, &expressRoutePortPropertiesFormat)
13294 if err != nil {
13295 return err
13296 }
13297 erp.ExpressRoutePortPropertiesFormat = &expressRoutePortPropertiesFormat
13298 }
13299 case "etag":
13300 if v != nil {
13301 var etag string
13302 err = json.Unmarshal(*v, &etag)
13303 if err != nil {
13304 return err
13305 }
13306 erp.Etag = &etag
13307 }
13308 case "identity":
13309 if v != nil {
13310 var identity ManagedServiceIdentity
13311 err = json.Unmarshal(*v, &identity)
13312 if err != nil {
13313 return err
13314 }
13315 erp.Identity = &identity
13316 }
13317 case "id":
13318 if v != nil {
13319 var ID string
13320 err = json.Unmarshal(*v, &ID)
13321 if err != nil {
13322 return err
13323 }
13324 erp.ID = &ID
13325 }
13326 case "name":
13327 if v != nil {
13328 var name string
13329 err = json.Unmarshal(*v, &name)
13330 if err != nil {
13331 return err
13332 }
13333 erp.Name = &name
13334 }
13335 case "type":
13336 if v != nil {
13337 var typeVar string
13338 err = json.Unmarshal(*v, &typeVar)
13339 if err != nil {
13340 return err
13341 }
13342 erp.Type = &typeVar
13343 }
13344 case "location":
13345 if v != nil {
13346 var location string
13347 err = json.Unmarshal(*v, &location)
13348 if err != nil {
13349 return err
13350 }
13351 erp.Location = &location
13352 }
13353 case "tags":
13354 if v != nil {
13355 var tags map[string]*string
13356 err = json.Unmarshal(*v, &tags)
13357 if err != nil {
13358 return err
13359 }
13360 erp.Tags = tags
13361 }
13362 }
13363 }
13364
13365 return nil
13366 }
13367
13368
13369 type ExpressRoutePortListResult struct {
13370 autorest.Response `json:"-"`
13371
13372 Value *[]ExpressRoutePort `json:"value,omitempty"`
13373
13374 NextLink *string `json:"nextLink,omitempty"`
13375 }
13376
13377
13378 type ExpressRoutePortListResultIterator struct {
13379 i int
13380 page ExpressRoutePortListResultPage
13381 }
13382
13383
13384
13385 func (iter *ExpressRoutePortListResultIterator) NextWithContext(ctx context.Context) (err error) {
13386 if tracing.IsEnabled() {
13387 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortListResultIterator.NextWithContext")
13388 defer func() {
13389 sc := -1
13390 if iter.Response().Response.Response != nil {
13391 sc = iter.Response().Response.Response.StatusCode
13392 }
13393 tracing.EndSpan(ctx, sc, err)
13394 }()
13395 }
13396 iter.i++
13397 if iter.i < len(iter.page.Values()) {
13398 return nil
13399 }
13400 err = iter.page.NextWithContext(ctx)
13401 if err != nil {
13402 iter.i--
13403 return err
13404 }
13405 iter.i = 0
13406 return nil
13407 }
13408
13409
13410
13411
13412 func (iter *ExpressRoutePortListResultIterator) Next() error {
13413 return iter.NextWithContext(context.Background())
13414 }
13415
13416
13417 func (iter ExpressRoutePortListResultIterator) NotDone() bool {
13418 return iter.page.NotDone() && iter.i < len(iter.page.Values())
13419 }
13420
13421
13422 func (iter ExpressRoutePortListResultIterator) Response() ExpressRoutePortListResult {
13423 return iter.page.Response()
13424 }
13425
13426
13427
13428 func (iter ExpressRoutePortListResultIterator) Value() ExpressRoutePort {
13429 if !iter.page.NotDone() {
13430 return ExpressRoutePort{}
13431 }
13432 return iter.page.Values()[iter.i]
13433 }
13434
13435
13436 func NewExpressRoutePortListResultIterator(page ExpressRoutePortListResultPage) ExpressRoutePortListResultIterator {
13437 return ExpressRoutePortListResultIterator{page: page}
13438 }
13439
13440
13441 func (erplr ExpressRoutePortListResult) IsEmpty() bool {
13442 return erplr.Value == nil || len(*erplr.Value) == 0
13443 }
13444
13445
13446 func (erplr ExpressRoutePortListResult) hasNextLink() bool {
13447 return erplr.NextLink != nil && len(*erplr.NextLink) != 0
13448 }
13449
13450
13451
13452 func (erplr ExpressRoutePortListResult) expressRoutePortListResultPreparer(ctx context.Context) (*http.Request, error) {
13453 if !erplr.hasNextLink() {
13454 return nil, nil
13455 }
13456 return autorest.Prepare((&http.Request{}).WithContext(ctx),
13457 autorest.AsJSON(),
13458 autorest.AsGet(),
13459 autorest.WithBaseURL(to.String(erplr.NextLink)))
13460 }
13461
13462
13463 type ExpressRoutePortListResultPage struct {
13464 fn func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error)
13465 erplr ExpressRoutePortListResult
13466 }
13467
13468
13469
13470 func (page *ExpressRoutePortListResultPage) NextWithContext(ctx context.Context) (err error) {
13471 if tracing.IsEnabled() {
13472 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortListResultPage.NextWithContext")
13473 defer func() {
13474 sc := -1
13475 if page.Response().Response.Response != nil {
13476 sc = page.Response().Response.Response.StatusCode
13477 }
13478 tracing.EndSpan(ctx, sc, err)
13479 }()
13480 }
13481 for {
13482 next, err := page.fn(ctx, page.erplr)
13483 if err != nil {
13484 return err
13485 }
13486 page.erplr = next
13487 if !next.hasNextLink() || !next.IsEmpty() {
13488 break
13489 }
13490 }
13491 return nil
13492 }
13493
13494
13495
13496
13497 func (page *ExpressRoutePortListResultPage) Next() error {
13498 return page.NextWithContext(context.Background())
13499 }
13500
13501
13502 func (page ExpressRoutePortListResultPage) NotDone() bool {
13503 return !page.erplr.IsEmpty()
13504 }
13505
13506
13507 func (page ExpressRoutePortListResultPage) Response() ExpressRoutePortListResult {
13508 return page.erplr
13509 }
13510
13511
13512 func (page ExpressRoutePortListResultPage) Values() []ExpressRoutePort {
13513 if page.erplr.IsEmpty() {
13514 return nil
13515 }
13516 return *page.erplr.Value
13517 }
13518
13519
13520 func NewExpressRoutePortListResultPage(cur ExpressRoutePortListResult, getNextPage func(context.Context, ExpressRoutePortListResult) (ExpressRoutePortListResult, error)) ExpressRoutePortListResultPage {
13521 return ExpressRoutePortListResultPage{
13522 fn: getNextPage,
13523 erplr: cur,
13524 }
13525 }
13526
13527
13528 type ExpressRoutePortPropertiesFormat struct {
13529
13530 PeeringLocation *string `json:"peeringLocation,omitempty"`
13531
13532 BandwidthInGbps *int32 `json:"bandwidthInGbps,omitempty"`
13533
13534 ProvisionedBandwidthInGbps *float64 `json:"provisionedBandwidthInGbps,omitempty"`
13535
13536 Mtu *string `json:"mtu,omitempty"`
13537
13538 Encapsulation ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"`
13539
13540 EtherType *string `json:"etherType,omitempty"`
13541
13542 AllocationDate *string `json:"allocationDate,omitempty"`
13543
13544 Links *[]ExpressRouteLink `json:"links,omitempty"`
13545
13546 Circuits *[]SubResource `json:"circuits,omitempty"`
13547
13548 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
13549
13550 ResourceGUID *string `json:"resourceGuid,omitempty"`
13551 }
13552
13553
13554 func (erppf ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) {
13555 objectMap := make(map[string]interface{})
13556 if erppf.PeeringLocation != nil {
13557 objectMap["peeringLocation"] = erppf.PeeringLocation
13558 }
13559 if erppf.BandwidthInGbps != nil {
13560 objectMap["bandwidthInGbps"] = erppf.BandwidthInGbps
13561 }
13562 if erppf.Encapsulation != "" {
13563 objectMap["encapsulation"] = erppf.Encapsulation
13564 }
13565 if erppf.Links != nil {
13566 objectMap["links"] = erppf.Links
13567 }
13568 return json.Marshal(objectMap)
13569 }
13570
13571
13572
13573 type ExpressRoutePortsCreateOrUpdateFuture struct {
13574 azure.FutureAPI
13575
13576
13577 Result func(ExpressRoutePortsClient) (ExpressRoutePort, error)
13578 }
13579
13580
13581 func (future *ExpressRoutePortsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
13582 var azFuture azure.Future
13583 if err := json.Unmarshal(body, &azFuture); err != nil {
13584 return err
13585 }
13586 future.FutureAPI = &azFuture
13587 future.Result = future.result
13588 return nil
13589 }
13590
13591
13592 func (future *ExpressRoutePortsCreateOrUpdateFuture) result(client ExpressRoutePortsClient) (erp ExpressRoutePort, err error) {
13593 var done bool
13594 done, err = future.DoneWithContext(context.Background(), client)
13595 if err != nil {
13596 err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
13597 return
13598 }
13599 if !done {
13600 erp.Response.Response = future.Response()
13601 err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsCreateOrUpdateFuture")
13602 return
13603 }
13604 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13605 if erp.Response.Response, err = future.GetResult(sender); err == nil && erp.Response.Response.StatusCode != http.StatusNoContent {
13606 erp, err = client.CreateOrUpdateResponder(erp.Response.Response)
13607 if err != nil {
13608 err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsCreateOrUpdateFuture", "Result", erp.Response.Response, "Failure responding to request")
13609 }
13610 }
13611 return
13612 }
13613
13614
13615
13616 type ExpressRoutePortsDeleteFuture struct {
13617 azure.FutureAPI
13618
13619
13620 Result func(ExpressRoutePortsClient) (autorest.Response, error)
13621 }
13622
13623
13624 func (future *ExpressRoutePortsDeleteFuture) UnmarshalJSON(body []byte) error {
13625 var azFuture azure.Future
13626 if err := json.Unmarshal(body, &azFuture); err != nil {
13627 return err
13628 }
13629 future.FutureAPI = &azFuture
13630 future.Result = future.result
13631 return nil
13632 }
13633
13634
13635 func (future *ExpressRoutePortsDeleteFuture) result(client ExpressRoutePortsClient) (ar autorest.Response, err error) {
13636 var done bool
13637 done, err = future.DoneWithContext(context.Background(), client)
13638 if err != nil {
13639 err = autorest.NewErrorWithError(err, "network.ExpressRoutePortsDeleteFuture", "Result", future.Response(), "Polling failure")
13640 return
13641 }
13642 if !done {
13643 ar.Response = future.Response()
13644 err = azure.NewAsyncOpIncompleteError("network.ExpressRoutePortsDeleteFuture")
13645 return
13646 }
13647 ar.Response = future.Response()
13648 return
13649 }
13650
13651
13652 type ExpressRoutePortsLocation struct {
13653 autorest.Response `json:"-"`
13654
13655 *ExpressRoutePortsLocationPropertiesFormat `json:"properties,omitempty"`
13656
13657 ID *string `json:"id,omitempty"`
13658
13659 Name *string `json:"name,omitempty"`
13660
13661 Type *string `json:"type,omitempty"`
13662
13663 Location *string `json:"location,omitempty"`
13664
13665 Tags map[string]*string `json:"tags"`
13666 }
13667
13668
13669 func (erpl ExpressRoutePortsLocation) MarshalJSON() ([]byte, error) {
13670 objectMap := make(map[string]interface{})
13671 if erpl.ExpressRoutePortsLocationPropertiesFormat != nil {
13672 objectMap["properties"] = erpl.ExpressRoutePortsLocationPropertiesFormat
13673 }
13674 if erpl.ID != nil {
13675 objectMap["id"] = erpl.ID
13676 }
13677 if erpl.Location != nil {
13678 objectMap["location"] = erpl.Location
13679 }
13680 if erpl.Tags != nil {
13681 objectMap["tags"] = erpl.Tags
13682 }
13683 return json.Marshal(objectMap)
13684 }
13685
13686
13687 func (erpl *ExpressRoutePortsLocation) UnmarshalJSON(body []byte) error {
13688 var m map[string]*json.RawMessage
13689 err := json.Unmarshal(body, &m)
13690 if err != nil {
13691 return err
13692 }
13693 for k, v := range m {
13694 switch k {
13695 case "properties":
13696 if v != nil {
13697 var expressRoutePortsLocationPropertiesFormat ExpressRoutePortsLocationPropertiesFormat
13698 err = json.Unmarshal(*v, &expressRoutePortsLocationPropertiesFormat)
13699 if err != nil {
13700 return err
13701 }
13702 erpl.ExpressRoutePortsLocationPropertiesFormat = &expressRoutePortsLocationPropertiesFormat
13703 }
13704 case "id":
13705 if v != nil {
13706 var ID string
13707 err = json.Unmarshal(*v, &ID)
13708 if err != nil {
13709 return err
13710 }
13711 erpl.ID = &ID
13712 }
13713 case "name":
13714 if v != nil {
13715 var name string
13716 err = json.Unmarshal(*v, &name)
13717 if err != nil {
13718 return err
13719 }
13720 erpl.Name = &name
13721 }
13722 case "type":
13723 if v != nil {
13724 var typeVar string
13725 err = json.Unmarshal(*v, &typeVar)
13726 if err != nil {
13727 return err
13728 }
13729 erpl.Type = &typeVar
13730 }
13731 case "location":
13732 if v != nil {
13733 var location string
13734 err = json.Unmarshal(*v, &location)
13735 if err != nil {
13736 return err
13737 }
13738 erpl.Location = &location
13739 }
13740 case "tags":
13741 if v != nil {
13742 var tags map[string]*string
13743 err = json.Unmarshal(*v, &tags)
13744 if err != nil {
13745 return err
13746 }
13747 erpl.Tags = tags
13748 }
13749 }
13750 }
13751
13752 return nil
13753 }
13754
13755
13756 type ExpressRoutePortsLocationBandwidths struct {
13757
13758 OfferName *string `json:"offerName,omitempty"`
13759
13760 ValueInGbps *int32 `json:"valueInGbps,omitempty"`
13761 }
13762
13763
13764 func (erplb ExpressRoutePortsLocationBandwidths) MarshalJSON() ([]byte, error) {
13765 objectMap := make(map[string]interface{})
13766 return json.Marshal(objectMap)
13767 }
13768
13769
13770 type ExpressRoutePortsLocationListResult struct {
13771 autorest.Response `json:"-"`
13772
13773 Value *[]ExpressRoutePortsLocation `json:"value,omitempty"`
13774
13775 NextLink *string `json:"nextLink,omitempty"`
13776 }
13777
13778
13779
13780 type ExpressRoutePortsLocationListResultIterator struct {
13781 i int
13782 page ExpressRoutePortsLocationListResultPage
13783 }
13784
13785
13786
13787 func (iter *ExpressRoutePortsLocationListResultIterator) NextWithContext(ctx context.Context) (err error) {
13788 if tracing.IsEnabled() {
13789 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationListResultIterator.NextWithContext")
13790 defer func() {
13791 sc := -1
13792 if iter.Response().Response.Response != nil {
13793 sc = iter.Response().Response.Response.StatusCode
13794 }
13795 tracing.EndSpan(ctx, sc, err)
13796 }()
13797 }
13798 iter.i++
13799 if iter.i < len(iter.page.Values()) {
13800 return nil
13801 }
13802 err = iter.page.NextWithContext(ctx)
13803 if err != nil {
13804 iter.i--
13805 return err
13806 }
13807 iter.i = 0
13808 return nil
13809 }
13810
13811
13812
13813
13814 func (iter *ExpressRoutePortsLocationListResultIterator) Next() error {
13815 return iter.NextWithContext(context.Background())
13816 }
13817
13818
13819 func (iter ExpressRoutePortsLocationListResultIterator) NotDone() bool {
13820 return iter.page.NotDone() && iter.i < len(iter.page.Values())
13821 }
13822
13823
13824 func (iter ExpressRoutePortsLocationListResultIterator) Response() ExpressRoutePortsLocationListResult {
13825 return iter.page.Response()
13826 }
13827
13828
13829
13830 func (iter ExpressRoutePortsLocationListResultIterator) Value() ExpressRoutePortsLocation {
13831 if !iter.page.NotDone() {
13832 return ExpressRoutePortsLocation{}
13833 }
13834 return iter.page.Values()[iter.i]
13835 }
13836
13837
13838 func NewExpressRoutePortsLocationListResultIterator(page ExpressRoutePortsLocationListResultPage) ExpressRoutePortsLocationListResultIterator {
13839 return ExpressRoutePortsLocationListResultIterator{page: page}
13840 }
13841
13842
13843 func (erpllr ExpressRoutePortsLocationListResult) IsEmpty() bool {
13844 return erpllr.Value == nil || len(*erpllr.Value) == 0
13845 }
13846
13847
13848 func (erpllr ExpressRoutePortsLocationListResult) hasNextLink() bool {
13849 return erpllr.NextLink != nil && len(*erpllr.NextLink) != 0
13850 }
13851
13852
13853
13854 func (erpllr ExpressRoutePortsLocationListResult) expressRoutePortsLocationListResultPreparer(ctx context.Context) (*http.Request, error) {
13855 if !erpllr.hasNextLink() {
13856 return nil, nil
13857 }
13858 return autorest.Prepare((&http.Request{}).WithContext(ctx),
13859 autorest.AsJSON(),
13860 autorest.AsGet(),
13861 autorest.WithBaseURL(to.String(erpllr.NextLink)))
13862 }
13863
13864
13865 type ExpressRoutePortsLocationListResultPage struct {
13866 fn func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error)
13867 erpllr ExpressRoutePortsLocationListResult
13868 }
13869
13870
13871
13872 func (page *ExpressRoutePortsLocationListResultPage) NextWithContext(ctx context.Context) (err error) {
13873 if tracing.IsEnabled() {
13874 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRoutePortsLocationListResultPage.NextWithContext")
13875 defer func() {
13876 sc := -1
13877 if page.Response().Response.Response != nil {
13878 sc = page.Response().Response.Response.StatusCode
13879 }
13880 tracing.EndSpan(ctx, sc, err)
13881 }()
13882 }
13883 for {
13884 next, err := page.fn(ctx, page.erpllr)
13885 if err != nil {
13886 return err
13887 }
13888 page.erpllr = next
13889 if !next.hasNextLink() || !next.IsEmpty() {
13890 break
13891 }
13892 }
13893 return nil
13894 }
13895
13896
13897
13898
13899 func (page *ExpressRoutePortsLocationListResultPage) Next() error {
13900 return page.NextWithContext(context.Background())
13901 }
13902
13903
13904 func (page ExpressRoutePortsLocationListResultPage) NotDone() bool {
13905 return !page.erpllr.IsEmpty()
13906 }
13907
13908
13909 func (page ExpressRoutePortsLocationListResultPage) Response() ExpressRoutePortsLocationListResult {
13910 return page.erpllr
13911 }
13912
13913
13914 func (page ExpressRoutePortsLocationListResultPage) Values() []ExpressRoutePortsLocation {
13915 if page.erpllr.IsEmpty() {
13916 return nil
13917 }
13918 return *page.erpllr.Value
13919 }
13920
13921
13922 func NewExpressRoutePortsLocationListResultPage(cur ExpressRoutePortsLocationListResult, getNextPage func(context.Context, ExpressRoutePortsLocationListResult) (ExpressRoutePortsLocationListResult, error)) ExpressRoutePortsLocationListResultPage {
13923 return ExpressRoutePortsLocationListResultPage{
13924 fn: getNextPage,
13925 erpllr: cur,
13926 }
13927 }
13928
13929
13930
13931 type ExpressRoutePortsLocationPropertiesFormat struct {
13932
13933 Address *string `json:"address,omitempty"`
13934
13935 Contact *string `json:"contact,omitempty"`
13936
13937 AvailableBandwidths *[]ExpressRoutePortsLocationBandwidths `json:"availableBandwidths,omitempty"`
13938
13939 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
13940 }
13941
13942
13943 func (erplpf ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, error) {
13944 objectMap := make(map[string]interface{})
13945 if erplpf.AvailableBandwidths != nil {
13946 objectMap["availableBandwidths"] = erplpf.AvailableBandwidths
13947 }
13948 return json.Marshal(objectMap)
13949 }
13950
13951
13952 type ExpressRouteServiceProvider struct {
13953
13954 *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"`
13955
13956 ID *string `json:"id,omitempty"`
13957
13958 Name *string `json:"name,omitempty"`
13959
13960 Type *string `json:"type,omitempty"`
13961
13962 Location *string `json:"location,omitempty"`
13963
13964 Tags map[string]*string `json:"tags"`
13965 }
13966
13967
13968 func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) {
13969 objectMap := make(map[string]interface{})
13970 if ersp.ExpressRouteServiceProviderPropertiesFormat != nil {
13971 objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat
13972 }
13973 if ersp.ID != nil {
13974 objectMap["id"] = ersp.ID
13975 }
13976 if ersp.Location != nil {
13977 objectMap["location"] = ersp.Location
13978 }
13979 if ersp.Tags != nil {
13980 objectMap["tags"] = ersp.Tags
13981 }
13982 return json.Marshal(objectMap)
13983 }
13984
13985
13986 func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error {
13987 var m map[string]*json.RawMessage
13988 err := json.Unmarshal(body, &m)
13989 if err != nil {
13990 return err
13991 }
13992 for k, v := range m {
13993 switch k {
13994 case "properties":
13995 if v != nil {
13996 var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat
13997 err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat)
13998 if err != nil {
13999 return err
14000 }
14001 ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat
14002 }
14003 case "id":
14004 if v != nil {
14005 var ID string
14006 err = json.Unmarshal(*v, &ID)
14007 if err != nil {
14008 return err
14009 }
14010 ersp.ID = &ID
14011 }
14012 case "name":
14013 if v != nil {
14014 var name string
14015 err = json.Unmarshal(*v, &name)
14016 if err != nil {
14017 return err
14018 }
14019 ersp.Name = &name
14020 }
14021 case "type":
14022 if v != nil {
14023 var typeVar string
14024 err = json.Unmarshal(*v, &typeVar)
14025 if err != nil {
14026 return err
14027 }
14028 ersp.Type = &typeVar
14029 }
14030 case "location":
14031 if v != nil {
14032 var location string
14033 err = json.Unmarshal(*v, &location)
14034 if err != nil {
14035 return err
14036 }
14037 ersp.Location = &location
14038 }
14039 case "tags":
14040 if v != nil {
14041 var tags map[string]*string
14042 err = json.Unmarshal(*v, &tags)
14043 if err != nil {
14044 return err
14045 }
14046 ersp.Tags = tags
14047 }
14048 }
14049 }
14050
14051 return nil
14052 }
14053
14054
14055
14056 type ExpressRouteServiceProviderBandwidthsOffered struct {
14057
14058 OfferName *string `json:"offerName,omitempty"`
14059
14060 ValueInMbps *int32 `json:"valueInMbps,omitempty"`
14061 }
14062
14063
14064 type ExpressRouteServiceProviderListResult struct {
14065 autorest.Response `json:"-"`
14066
14067 Value *[]ExpressRouteServiceProvider `json:"value,omitempty"`
14068
14069 NextLink *string `json:"nextLink,omitempty"`
14070 }
14071
14072
14073
14074 type ExpressRouteServiceProviderListResultIterator struct {
14075 i int
14076 page ExpressRouteServiceProviderListResultPage
14077 }
14078
14079
14080
14081 func (iter *ExpressRouteServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) {
14082 if tracing.IsEnabled() {
14083 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultIterator.NextWithContext")
14084 defer func() {
14085 sc := -1
14086 if iter.Response().Response.Response != nil {
14087 sc = iter.Response().Response.Response.StatusCode
14088 }
14089 tracing.EndSpan(ctx, sc, err)
14090 }()
14091 }
14092 iter.i++
14093 if iter.i < len(iter.page.Values()) {
14094 return nil
14095 }
14096 err = iter.page.NextWithContext(ctx)
14097 if err != nil {
14098 iter.i--
14099 return err
14100 }
14101 iter.i = 0
14102 return nil
14103 }
14104
14105
14106
14107
14108 func (iter *ExpressRouteServiceProviderListResultIterator) Next() error {
14109 return iter.NextWithContext(context.Background())
14110 }
14111
14112
14113 func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool {
14114 return iter.page.NotDone() && iter.i < len(iter.page.Values())
14115 }
14116
14117
14118 func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult {
14119 return iter.page.Response()
14120 }
14121
14122
14123
14124 func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider {
14125 if !iter.page.NotDone() {
14126 return ExpressRouteServiceProvider{}
14127 }
14128 return iter.page.Values()[iter.i]
14129 }
14130
14131
14132 func NewExpressRouteServiceProviderListResultIterator(page ExpressRouteServiceProviderListResultPage) ExpressRouteServiceProviderListResultIterator {
14133 return ExpressRouteServiceProviderListResultIterator{page: page}
14134 }
14135
14136
14137 func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool {
14138 return ersplr.Value == nil || len(*ersplr.Value) == 0
14139 }
14140
14141
14142 func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool {
14143 return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0
14144 }
14145
14146
14147
14148 func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) {
14149 if !ersplr.hasNextLink() {
14150 return nil, nil
14151 }
14152 return autorest.Prepare((&http.Request{}).WithContext(ctx),
14153 autorest.AsJSON(),
14154 autorest.AsGet(),
14155 autorest.WithBaseURL(to.String(ersplr.NextLink)))
14156 }
14157
14158
14159 type ExpressRouteServiceProviderListResultPage struct {
14160 fn func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)
14161 ersplr ExpressRouteServiceProviderListResult
14162 }
14163
14164
14165
14166 func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) {
14167 if tracing.IsEnabled() {
14168 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultPage.NextWithContext")
14169 defer func() {
14170 sc := -1
14171 if page.Response().Response.Response != nil {
14172 sc = page.Response().Response.Response.StatusCode
14173 }
14174 tracing.EndSpan(ctx, sc, err)
14175 }()
14176 }
14177 for {
14178 next, err := page.fn(ctx, page.ersplr)
14179 if err != nil {
14180 return err
14181 }
14182 page.ersplr = next
14183 if !next.hasNextLink() || !next.IsEmpty() {
14184 break
14185 }
14186 }
14187 return nil
14188 }
14189
14190
14191
14192
14193 func (page *ExpressRouteServiceProviderListResultPage) Next() error {
14194 return page.NextWithContext(context.Background())
14195 }
14196
14197
14198 func (page ExpressRouteServiceProviderListResultPage) NotDone() bool {
14199 return !page.ersplr.IsEmpty()
14200 }
14201
14202
14203 func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult {
14204 return page.ersplr
14205 }
14206
14207
14208 func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider {
14209 if page.ersplr.IsEmpty() {
14210 return nil
14211 }
14212 return *page.ersplr.Value
14213 }
14214
14215
14216 func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage {
14217 return ExpressRouteServiceProviderListResultPage{
14218 fn: getNextPage,
14219 ersplr: cur,
14220 }
14221 }
14222
14223
14224 type ExpressRouteServiceProviderPropertiesFormat struct {
14225
14226 PeeringLocations *[]string `json:"peeringLocations,omitempty"`
14227
14228 BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"`
14229
14230 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
14231 }
14232
14233
14234 func (ersppf ExpressRouteServiceProviderPropertiesFormat) MarshalJSON() ([]byte, error) {
14235 objectMap := make(map[string]interface{})
14236 if ersppf.PeeringLocations != nil {
14237 objectMap["peeringLocations"] = ersppf.PeeringLocations
14238 }
14239 if ersppf.BandwidthsOffered != nil {
14240 objectMap["bandwidthsOffered"] = ersppf.BandwidthsOffered
14241 }
14242 return json.Marshal(objectMap)
14243 }
14244
14245
14246
14247 type FirewallPoliciesCreateOrUpdateFuture struct {
14248 azure.FutureAPI
14249
14250
14251 Result func(FirewallPoliciesClient) (FirewallPolicy, error)
14252 }
14253
14254
14255 func (future *FirewallPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
14256 var azFuture azure.Future
14257 if err := json.Unmarshal(body, &azFuture); err != nil {
14258 return err
14259 }
14260 future.FutureAPI = &azFuture
14261 future.Result = future.result
14262 return nil
14263 }
14264
14265
14266 func (future *FirewallPoliciesCreateOrUpdateFuture) result(client FirewallPoliciesClient) (fp FirewallPolicy, err error) {
14267 var done bool
14268 done, err = future.DoneWithContext(context.Background(), client)
14269 if err != nil {
14270 err = autorest.NewErrorWithError(err, "network.FirewallPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
14271 return
14272 }
14273 if !done {
14274 fp.Response.Response = future.Response()
14275 err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesCreateOrUpdateFuture")
14276 return
14277 }
14278 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
14279 if fp.Response.Response, err = future.GetResult(sender); err == nil && fp.Response.Response.StatusCode != http.StatusNoContent {
14280 fp, err = client.CreateOrUpdateResponder(fp.Response.Response)
14281 if err != nil {
14282 err = autorest.NewErrorWithError(err, "network.FirewallPoliciesCreateOrUpdateFuture", "Result", fp.Response.Response, "Failure responding to request")
14283 }
14284 }
14285 return
14286 }
14287
14288
14289
14290 type FirewallPoliciesDeleteFuture struct {
14291 azure.FutureAPI
14292
14293
14294 Result func(FirewallPoliciesClient) (autorest.Response, error)
14295 }
14296
14297
14298 func (future *FirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
14299 var azFuture azure.Future
14300 if err := json.Unmarshal(body, &azFuture); err != nil {
14301 return err
14302 }
14303 future.FutureAPI = &azFuture
14304 future.Result = future.result
14305 return nil
14306 }
14307
14308
14309 func (future *FirewallPoliciesDeleteFuture) result(client FirewallPoliciesClient) (ar autorest.Response, err error) {
14310 var done bool
14311 done, err = future.DoneWithContext(context.Background(), client)
14312 if err != nil {
14313 err = autorest.NewErrorWithError(err, "network.FirewallPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
14314 return
14315 }
14316 if !done {
14317 ar.Response = future.Response()
14318 err = azure.NewAsyncOpIncompleteError("network.FirewallPoliciesDeleteFuture")
14319 return
14320 }
14321 ar.Response = future.Response()
14322 return
14323 }
14324
14325
14326 type FirewallPolicy struct {
14327 autorest.Response `json:"-"`
14328
14329 *FirewallPolicyPropertiesFormat `json:"properties,omitempty"`
14330
14331 Etag *string `json:"etag,omitempty"`
14332
14333 ID *string `json:"id,omitempty"`
14334
14335 Name *string `json:"name,omitempty"`
14336
14337 Type *string `json:"type,omitempty"`
14338
14339 Location *string `json:"location,omitempty"`
14340
14341 Tags map[string]*string `json:"tags"`
14342 }
14343
14344
14345 func (fp FirewallPolicy) MarshalJSON() ([]byte, error) {
14346 objectMap := make(map[string]interface{})
14347 if fp.FirewallPolicyPropertiesFormat != nil {
14348 objectMap["properties"] = fp.FirewallPolicyPropertiesFormat
14349 }
14350 if fp.ID != nil {
14351 objectMap["id"] = fp.ID
14352 }
14353 if fp.Location != nil {
14354 objectMap["location"] = fp.Location
14355 }
14356 if fp.Tags != nil {
14357 objectMap["tags"] = fp.Tags
14358 }
14359 return json.Marshal(objectMap)
14360 }
14361
14362
14363 func (fp *FirewallPolicy) UnmarshalJSON(body []byte) error {
14364 var m map[string]*json.RawMessage
14365 err := json.Unmarshal(body, &m)
14366 if err != nil {
14367 return err
14368 }
14369 for k, v := range m {
14370 switch k {
14371 case "properties":
14372 if v != nil {
14373 var firewallPolicyPropertiesFormat FirewallPolicyPropertiesFormat
14374 err = json.Unmarshal(*v, &firewallPolicyPropertiesFormat)
14375 if err != nil {
14376 return err
14377 }
14378 fp.FirewallPolicyPropertiesFormat = &firewallPolicyPropertiesFormat
14379 }
14380 case "etag":
14381 if v != nil {
14382 var etag string
14383 err = json.Unmarshal(*v, &etag)
14384 if err != nil {
14385 return err
14386 }
14387 fp.Etag = &etag
14388 }
14389 case "id":
14390 if v != nil {
14391 var ID string
14392 err = json.Unmarshal(*v, &ID)
14393 if err != nil {
14394 return err
14395 }
14396 fp.ID = &ID
14397 }
14398 case "name":
14399 if v != nil {
14400 var name string
14401 err = json.Unmarshal(*v, &name)
14402 if err != nil {
14403 return err
14404 }
14405 fp.Name = &name
14406 }
14407 case "type":
14408 if v != nil {
14409 var typeVar string
14410 err = json.Unmarshal(*v, &typeVar)
14411 if err != nil {
14412 return err
14413 }
14414 fp.Type = &typeVar
14415 }
14416 case "location":
14417 if v != nil {
14418 var location string
14419 err = json.Unmarshal(*v, &location)
14420 if err != nil {
14421 return err
14422 }
14423 fp.Location = &location
14424 }
14425 case "tags":
14426 if v != nil {
14427 var tags map[string]*string
14428 err = json.Unmarshal(*v, &tags)
14429 if err != nil {
14430 return err
14431 }
14432 fp.Tags = tags
14433 }
14434 }
14435 }
14436
14437 return nil
14438 }
14439
14440
14441 type FirewallPolicyFilterRule struct {
14442
14443 Action *FirewallPolicyFilterRuleAction `json:"action,omitempty"`
14444
14445 RuleConditions *[]BasicFirewallPolicyRuleCondition `json:"ruleConditions,omitempty"`
14446
14447 Name *string `json:"name,omitempty"`
14448
14449 Priority *int32 `json:"priority,omitempty"`
14450
14451 RuleType RuleType `json:"ruleType,omitempty"`
14452 }
14453
14454
14455 func (fpfr FirewallPolicyFilterRule) MarshalJSON() ([]byte, error) {
14456 fpfr.RuleType = RuleTypeFirewallPolicyFilterRule
14457 objectMap := make(map[string]interface{})
14458 if fpfr.Action != nil {
14459 objectMap["action"] = fpfr.Action
14460 }
14461 if fpfr.RuleConditions != nil {
14462 objectMap["ruleConditions"] = fpfr.RuleConditions
14463 }
14464 if fpfr.Name != nil {
14465 objectMap["name"] = fpfr.Name
14466 }
14467 if fpfr.Priority != nil {
14468 objectMap["priority"] = fpfr.Priority
14469 }
14470 if fpfr.RuleType != "" {
14471 objectMap["ruleType"] = fpfr.RuleType
14472 }
14473 return json.Marshal(objectMap)
14474 }
14475
14476
14477 func (fpfr FirewallPolicyFilterRule) AsFirewallPolicyNatRule() (*FirewallPolicyNatRule, bool) {
14478 return nil, false
14479 }
14480
14481
14482 func (fpfr FirewallPolicyFilterRule) AsFirewallPolicyFilterRule() (*FirewallPolicyFilterRule, bool) {
14483 return &fpfr, true
14484 }
14485
14486
14487 func (fpfr FirewallPolicyFilterRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) {
14488 return nil, false
14489 }
14490
14491
14492 func (fpfr FirewallPolicyFilterRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) {
14493 return &fpfr, true
14494 }
14495
14496
14497 func (fpfr *FirewallPolicyFilterRule) UnmarshalJSON(body []byte) error {
14498 var m map[string]*json.RawMessage
14499 err := json.Unmarshal(body, &m)
14500 if err != nil {
14501 return err
14502 }
14503 for k, v := range m {
14504 switch k {
14505 case "action":
14506 if v != nil {
14507 var action FirewallPolicyFilterRuleAction
14508 err = json.Unmarshal(*v, &action)
14509 if err != nil {
14510 return err
14511 }
14512 fpfr.Action = &action
14513 }
14514 case "ruleConditions":
14515 if v != nil {
14516 ruleConditions, err := unmarshalBasicFirewallPolicyRuleConditionArray(*v)
14517 if err != nil {
14518 return err
14519 }
14520 fpfr.RuleConditions = &ruleConditions
14521 }
14522 case "name":
14523 if v != nil {
14524 var name string
14525 err = json.Unmarshal(*v, &name)
14526 if err != nil {
14527 return err
14528 }
14529 fpfr.Name = &name
14530 }
14531 case "priority":
14532 if v != nil {
14533 var priority int32
14534 err = json.Unmarshal(*v, &priority)
14535 if err != nil {
14536 return err
14537 }
14538 fpfr.Priority = &priority
14539 }
14540 case "ruleType":
14541 if v != nil {
14542 var ruleType RuleType
14543 err = json.Unmarshal(*v, &ruleType)
14544 if err != nil {
14545 return err
14546 }
14547 fpfr.RuleType = ruleType
14548 }
14549 }
14550 }
14551
14552 return nil
14553 }
14554
14555
14556 type FirewallPolicyFilterRuleAction struct {
14557
14558 Type FirewallPolicyFilterRuleActionType `json:"type,omitempty"`
14559 }
14560
14561
14562 type FirewallPolicyListResult struct {
14563 autorest.Response `json:"-"`
14564
14565 Value *[]FirewallPolicy `json:"value,omitempty"`
14566
14567 NextLink *string `json:"nextLink,omitempty"`
14568 }
14569
14570
14571 type FirewallPolicyListResultIterator struct {
14572 i int
14573 page FirewallPolicyListResultPage
14574 }
14575
14576
14577
14578 func (iter *FirewallPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
14579 if tracing.IsEnabled() {
14580 ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyListResultIterator.NextWithContext")
14581 defer func() {
14582 sc := -1
14583 if iter.Response().Response.Response != nil {
14584 sc = iter.Response().Response.Response.StatusCode
14585 }
14586 tracing.EndSpan(ctx, sc, err)
14587 }()
14588 }
14589 iter.i++
14590 if iter.i < len(iter.page.Values()) {
14591 return nil
14592 }
14593 err = iter.page.NextWithContext(ctx)
14594 if err != nil {
14595 iter.i--
14596 return err
14597 }
14598 iter.i = 0
14599 return nil
14600 }
14601
14602
14603
14604
14605 func (iter *FirewallPolicyListResultIterator) Next() error {
14606 return iter.NextWithContext(context.Background())
14607 }
14608
14609
14610 func (iter FirewallPolicyListResultIterator) NotDone() bool {
14611 return iter.page.NotDone() && iter.i < len(iter.page.Values())
14612 }
14613
14614
14615 func (iter FirewallPolicyListResultIterator) Response() FirewallPolicyListResult {
14616 return iter.page.Response()
14617 }
14618
14619
14620
14621 func (iter FirewallPolicyListResultIterator) Value() FirewallPolicy {
14622 if !iter.page.NotDone() {
14623 return FirewallPolicy{}
14624 }
14625 return iter.page.Values()[iter.i]
14626 }
14627
14628
14629 func NewFirewallPolicyListResultIterator(page FirewallPolicyListResultPage) FirewallPolicyListResultIterator {
14630 return FirewallPolicyListResultIterator{page: page}
14631 }
14632
14633
14634 func (fplr FirewallPolicyListResult) IsEmpty() bool {
14635 return fplr.Value == nil || len(*fplr.Value) == 0
14636 }
14637
14638
14639 func (fplr FirewallPolicyListResult) hasNextLink() bool {
14640 return fplr.NextLink != nil && len(*fplr.NextLink) != 0
14641 }
14642
14643
14644
14645 func (fplr FirewallPolicyListResult) firewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
14646 if !fplr.hasNextLink() {
14647 return nil, nil
14648 }
14649 return autorest.Prepare((&http.Request{}).WithContext(ctx),
14650 autorest.AsJSON(),
14651 autorest.AsGet(),
14652 autorest.WithBaseURL(to.String(fplr.NextLink)))
14653 }
14654
14655
14656 type FirewallPolicyListResultPage struct {
14657 fn func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error)
14658 fplr FirewallPolicyListResult
14659 }
14660
14661
14662
14663 func (page *FirewallPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
14664 if tracing.IsEnabled() {
14665 ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyListResultPage.NextWithContext")
14666 defer func() {
14667 sc := -1
14668 if page.Response().Response.Response != nil {
14669 sc = page.Response().Response.Response.StatusCode
14670 }
14671 tracing.EndSpan(ctx, sc, err)
14672 }()
14673 }
14674 for {
14675 next, err := page.fn(ctx, page.fplr)
14676 if err != nil {
14677 return err
14678 }
14679 page.fplr = next
14680 if !next.hasNextLink() || !next.IsEmpty() {
14681 break
14682 }
14683 }
14684 return nil
14685 }
14686
14687
14688
14689
14690 func (page *FirewallPolicyListResultPage) Next() error {
14691 return page.NextWithContext(context.Background())
14692 }
14693
14694
14695 func (page FirewallPolicyListResultPage) NotDone() bool {
14696 return !page.fplr.IsEmpty()
14697 }
14698
14699
14700 func (page FirewallPolicyListResultPage) Response() FirewallPolicyListResult {
14701 return page.fplr
14702 }
14703
14704
14705 func (page FirewallPolicyListResultPage) Values() []FirewallPolicy {
14706 if page.fplr.IsEmpty() {
14707 return nil
14708 }
14709 return *page.fplr.Value
14710 }
14711
14712
14713 func NewFirewallPolicyListResultPage(cur FirewallPolicyListResult, getNextPage func(context.Context, FirewallPolicyListResult) (FirewallPolicyListResult, error)) FirewallPolicyListResultPage {
14714 return FirewallPolicyListResultPage{
14715 fn: getNextPage,
14716 fplr: cur,
14717 }
14718 }
14719
14720
14721 type FirewallPolicyNatRule struct {
14722
14723 Action *FirewallPolicyNatRuleAction `json:"action,omitempty"`
14724
14725 TranslatedAddress *string `json:"translatedAddress,omitempty"`
14726
14727 TranslatedPort *string `json:"translatedPort,omitempty"`
14728
14729 RuleCondition BasicFirewallPolicyRuleCondition `json:"ruleCondition,omitempty"`
14730
14731 Name *string `json:"name,omitempty"`
14732
14733 Priority *int32 `json:"priority,omitempty"`
14734
14735 RuleType RuleType `json:"ruleType,omitempty"`
14736 }
14737
14738
14739 func (fpnr FirewallPolicyNatRule) MarshalJSON() ([]byte, error) {
14740 fpnr.RuleType = RuleTypeFirewallPolicyNatRule
14741 objectMap := make(map[string]interface{})
14742 if fpnr.Action != nil {
14743 objectMap["action"] = fpnr.Action
14744 }
14745 if fpnr.TranslatedAddress != nil {
14746 objectMap["translatedAddress"] = fpnr.TranslatedAddress
14747 }
14748 if fpnr.TranslatedPort != nil {
14749 objectMap["translatedPort"] = fpnr.TranslatedPort
14750 }
14751 objectMap["ruleCondition"] = fpnr.RuleCondition
14752 if fpnr.Name != nil {
14753 objectMap["name"] = fpnr.Name
14754 }
14755 if fpnr.Priority != nil {
14756 objectMap["priority"] = fpnr.Priority
14757 }
14758 if fpnr.RuleType != "" {
14759 objectMap["ruleType"] = fpnr.RuleType
14760 }
14761 return json.Marshal(objectMap)
14762 }
14763
14764
14765 func (fpnr FirewallPolicyNatRule) AsFirewallPolicyNatRule() (*FirewallPolicyNatRule, bool) {
14766 return &fpnr, true
14767 }
14768
14769
14770 func (fpnr FirewallPolicyNatRule) AsFirewallPolicyFilterRule() (*FirewallPolicyFilterRule, bool) {
14771 return nil, false
14772 }
14773
14774
14775 func (fpnr FirewallPolicyNatRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) {
14776 return nil, false
14777 }
14778
14779
14780 func (fpnr FirewallPolicyNatRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) {
14781 return &fpnr, true
14782 }
14783
14784
14785 func (fpnr *FirewallPolicyNatRule) UnmarshalJSON(body []byte) error {
14786 var m map[string]*json.RawMessage
14787 err := json.Unmarshal(body, &m)
14788 if err != nil {
14789 return err
14790 }
14791 for k, v := range m {
14792 switch k {
14793 case "action":
14794 if v != nil {
14795 var action FirewallPolicyNatRuleAction
14796 err = json.Unmarshal(*v, &action)
14797 if err != nil {
14798 return err
14799 }
14800 fpnr.Action = &action
14801 }
14802 case "translatedAddress":
14803 if v != nil {
14804 var translatedAddress string
14805 err = json.Unmarshal(*v, &translatedAddress)
14806 if err != nil {
14807 return err
14808 }
14809 fpnr.TranslatedAddress = &translatedAddress
14810 }
14811 case "translatedPort":
14812 if v != nil {
14813 var translatedPort string
14814 err = json.Unmarshal(*v, &translatedPort)
14815 if err != nil {
14816 return err
14817 }
14818 fpnr.TranslatedPort = &translatedPort
14819 }
14820 case "ruleCondition":
14821 if v != nil {
14822 ruleCondition, err := unmarshalBasicFirewallPolicyRuleCondition(*v)
14823 if err != nil {
14824 return err
14825 }
14826 fpnr.RuleCondition = ruleCondition
14827 }
14828 case "name":
14829 if v != nil {
14830 var name string
14831 err = json.Unmarshal(*v, &name)
14832 if err != nil {
14833 return err
14834 }
14835 fpnr.Name = &name
14836 }
14837 case "priority":
14838 if v != nil {
14839 var priority int32
14840 err = json.Unmarshal(*v, &priority)
14841 if err != nil {
14842 return err
14843 }
14844 fpnr.Priority = &priority
14845 }
14846 case "ruleType":
14847 if v != nil {
14848 var ruleType RuleType
14849 err = json.Unmarshal(*v, &ruleType)
14850 if err != nil {
14851 return err
14852 }
14853 fpnr.RuleType = ruleType
14854 }
14855 }
14856 }
14857
14858 return nil
14859 }
14860
14861
14862 type FirewallPolicyNatRuleAction struct {
14863
14864 Type FirewallPolicyNatRuleActionType `json:"type,omitempty"`
14865 }
14866
14867
14868 type FirewallPolicyPropertiesFormat struct {
14869
14870 RuleGroups *[]SubResource `json:"ruleGroups,omitempty"`
14871
14872 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
14873
14874 BasePolicy *SubResource `json:"basePolicy,omitempty"`
14875
14876 Firewalls *[]SubResource `json:"firewalls,omitempty"`
14877
14878 ChildPolicies *[]SubResource `json:"childPolicies,omitempty"`
14879
14880 ThreatIntelMode AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"`
14881
14882 ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist `json:"threatIntelWhitelist,omitempty"`
14883 }
14884
14885
14886 func (fppf FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) {
14887 objectMap := make(map[string]interface{})
14888 if fppf.BasePolicy != nil {
14889 objectMap["basePolicy"] = fppf.BasePolicy
14890 }
14891 if fppf.ThreatIntelMode != "" {
14892 objectMap["threatIntelMode"] = fppf.ThreatIntelMode
14893 }
14894 if fppf.ThreatIntelWhitelist != nil {
14895 objectMap["threatIntelWhitelist"] = fppf.ThreatIntelWhitelist
14896 }
14897 return json.Marshal(objectMap)
14898 }
14899
14900
14901 type BasicFirewallPolicyRule interface {
14902 AsFirewallPolicyNatRule() (*FirewallPolicyNatRule, bool)
14903 AsFirewallPolicyFilterRule() (*FirewallPolicyFilterRule, bool)
14904 AsFirewallPolicyRule() (*FirewallPolicyRule, bool)
14905 }
14906
14907
14908 type FirewallPolicyRule struct {
14909
14910 Name *string `json:"name,omitempty"`
14911
14912 Priority *int32 `json:"priority,omitempty"`
14913
14914 RuleType RuleType `json:"ruleType,omitempty"`
14915 }
14916
14917 func unmarshalBasicFirewallPolicyRule(body []byte) (BasicFirewallPolicyRule, error) {
14918 var m map[string]interface{}
14919 err := json.Unmarshal(body, &m)
14920 if err != nil {
14921 return nil, err
14922 }
14923
14924 switch m["ruleType"] {
14925 case string(RuleTypeFirewallPolicyNatRule):
14926 var fpnr FirewallPolicyNatRule
14927 err := json.Unmarshal(body, &fpnr)
14928 return fpnr, err
14929 case string(RuleTypeFirewallPolicyFilterRule):
14930 var fpfr FirewallPolicyFilterRule
14931 err := json.Unmarshal(body, &fpfr)
14932 return fpfr, err
14933 default:
14934 var fpr FirewallPolicyRule
14935 err := json.Unmarshal(body, &fpr)
14936 return fpr, err
14937 }
14938 }
14939 func unmarshalBasicFirewallPolicyRuleArray(body []byte) ([]BasicFirewallPolicyRule, error) {
14940 var rawMessages []*json.RawMessage
14941 err := json.Unmarshal(body, &rawMessages)
14942 if err != nil {
14943 return nil, err
14944 }
14945
14946 fprArray := make([]BasicFirewallPolicyRule, len(rawMessages))
14947
14948 for index, rawMessage := range rawMessages {
14949 fpr, err := unmarshalBasicFirewallPolicyRule(*rawMessage)
14950 if err != nil {
14951 return nil, err
14952 }
14953 fprArray[index] = fpr
14954 }
14955 return fprArray, nil
14956 }
14957
14958
14959 func (fpr FirewallPolicyRule) MarshalJSON() ([]byte, error) {
14960 fpr.RuleType = RuleTypeFirewallPolicyRule
14961 objectMap := make(map[string]interface{})
14962 if fpr.Name != nil {
14963 objectMap["name"] = fpr.Name
14964 }
14965 if fpr.Priority != nil {
14966 objectMap["priority"] = fpr.Priority
14967 }
14968 if fpr.RuleType != "" {
14969 objectMap["ruleType"] = fpr.RuleType
14970 }
14971 return json.Marshal(objectMap)
14972 }
14973
14974
14975 func (fpr FirewallPolicyRule) AsFirewallPolicyNatRule() (*FirewallPolicyNatRule, bool) {
14976 return nil, false
14977 }
14978
14979
14980 func (fpr FirewallPolicyRule) AsFirewallPolicyFilterRule() (*FirewallPolicyFilterRule, bool) {
14981 return nil, false
14982 }
14983
14984
14985 func (fpr FirewallPolicyRule) AsFirewallPolicyRule() (*FirewallPolicyRule, bool) {
14986 return &fpr, true
14987 }
14988
14989
14990 func (fpr FirewallPolicyRule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) {
14991 return &fpr, true
14992 }
14993
14994
14995 type BasicFirewallPolicyRuleCondition interface {
14996 AsApplicationRuleCondition() (*ApplicationRuleCondition, bool)
14997 AsNatRuleCondition() (*NatRuleCondition, bool)
14998 AsRuleCondition() (*RuleCondition, bool)
14999 AsFirewallPolicyRuleCondition() (*FirewallPolicyRuleCondition, bool)
15000 }
15001
15002
15003 type FirewallPolicyRuleCondition struct {
15004
15005 Name *string `json:"name,omitempty"`
15006
15007 Description *string `json:"description,omitempty"`
15008
15009 RuleConditionType RuleConditionType `json:"ruleConditionType,omitempty"`
15010 }
15011
15012 func unmarshalBasicFirewallPolicyRuleCondition(body []byte) (BasicFirewallPolicyRuleCondition, error) {
15013 var m map[string]interface{}
15014 err := json.Unmarshal(body, &m)
15015 if err != nil {
15016 return nil, err
15017 }
15018
15019 switch m["ruleConditionType"] {
15020 case string(RuleConditionTypeApplicationRuleCondition):
15021 var arc ApplicationRuleCondition
15022 err := json.Unmarshal(body, &arc)
15023 return arc, err
15024 case string(RuleConditionTypeNatRuleCondition):
15025 var nrc NatRuleCondition
15026 err := json.Unmarshal(body, &nrc)
15027 return nrc, err
15028 case string(RuleConditionTypeNetworkRuleCondition):
15029 var rc RuleCondition
15030 err := json.Unmarshal(body, &rc)
15031 return rc, err
15032 default:
15033 var fprc FirewallPolicyRuleCondition
15034 err := json.Unmarshal(body, &fprc)
15035 return fprc, err
15036 }
15037 }
15038 func unmarshalBasicFirewallPolicyRuleConditionArray(body []byte) ([]BasicFirewallPolicyRuleCondition, error) {
15039 var rawMessages []*json.RawMessage
15040 err := json.Unmarshal(body, &rawMessages)
15041 if err != nil {
15042 return nil, err
15043 }
15044
15045 fprcArray := make([]BasicFirewallPolicyRuleCondition, len(rawMessages))
15046
15047 for index, rawMessage := range rawMessages {
15048 fprc, err := unmarshalBasicFirewallPolicyRuleCondition(*rawMessage)
15049 if err != nil {
15050 return nil, err
15051 }
15052 fprcArray[index] = fprc
15053 }
15054 return fprcArray, nil
15055 }
15056
15057
15058 func (fprc FirewallPolicyRuleCondition) MarshalJSON() ([]byte, error) {
15059 fprc.RuleConditionType = RuleConditionTypeFirewallPolicyRuleCondition
15060 objectMap := make(map[string]interface{})
15061 if fprc.Name != nil {
15062 objectMap["name"] = fprc.Name
15063 }
15064 if fprc.Description != nil {
15065 objectMap["description"] = fprc.Description
15066 }
15067 if fprc.RuleConditionType != "" {
15068 objectMap["ruleConditionType"] = fprc.RuleConditionType
15069 }
15070 return json.Marshal(objectMap)
15071 }
15072
15073
15074 func (fprc FirewallPolicyRuleCondition) AsApplicationRuleCondition() (*ApplicationRuleCondition, bool) {
15075 return nil, false
15076 }
15077
15078
15079 func (fprc FirewallPolicyRuleCondition) AsNatRuleCondition() (*NatRuleCondition, bool) {
15080 return nil, false
15081 }
15082
15083
15084 func (fprc FirewallPolicyRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
15085 return nil, false
15086 }
15087
15088
15089 func (fprc FirewallPolicyRuleCondition) AsFirewallPolicyRuleCondition() (*FirewallPolicyRuleCondition, bool) {
15090 return &fprc, true
15091 }
15092
15093
15094 func (fprc FirewallPolicyRuleCondition) AsBasicFirewallPolicyRuleCondition() (BasicFirewallPolicyRuleCondition, bool) {
15095 return &fprc, true
15096 }
15097
15098
15099 type FirewallPolicyRuleConditionApplicationProtocol struct {
15100
15101 ProtocolType FirewallPolicyRuleConditionApplicationProtocolType `json:"protocolType,omitempty"`
15102
15103 Port *int32 `json:"port,omitempty"`
15104 }
15105
15106
15107 type FirewallPolicyRuleGroup struct {
15108 autorest.Response `json:"-"`
15109
15110 *FirewallPolicyRuleGroupProperties `json:"properties,omitempty"`
15111
15112 Name *string `json:"name,omitempty"`
15113
15114 Etag *string `json:"etag,omitempty"`
15115
15116 Type *string `json:"type,omitempty"`
15117
15118 ID *string `json:"id,omitempty"`
15119 }
15120
15121
15122 func (fprg FirewallPolicyRuleGroup) MarshalJSON() ([]byte, error) {
15123 objectMap := make(map[string]interface{})
15124 if fprg.FirewallPolicyRuleGroupProperties != nil {
15125 objectMap["properties"] = fprg.FirewallPolicyRuleGroupProperties
15126 }
15127 if fprg.Name != nil {
15128 objectMap["name"] = fprg.Name
15129 }
15130 if fprg.ID != nil {
15131 objectMap["id"] = fprg.ID
15132 }
15133 return json.Marshal(objectMap)
15134 }
15135
15136
15137 func (fprg *FirewallPolicyRuleGroup) UnmarshalJSON(body []byte) error {
15138 var m map[string]*json.RawMessage
15139 err := json.Unmarshal(body, &m)
15140 if err != nil {
15141 return err
15142 }
15143 for k, v := range m {
15144 switch k {
15145 case "properties":
15146 if v != nil {
15147 var firewallPolicyRuleGroupProperties FirewallPolicyRuleGroupProperties
15148 err = json.Unmarshal(*v, &firewallPolicyRuleGroupProperties)
15149 if err != nil {
15150 return err
15151 }
15152 fprg.FirewallPolicyRuleGroupProperties = &firewallPolicyRuleGroupProperties
15153 }
15154 case "name":
15155 if v != nil {
15156 var name string
15157 err = json.Unmarshal(*v, &name)
15158 if err != nil {
15159 return err
15160 }
15161 fprg.Name = &name
15162 }
15163 case "etag":
15164 if v != nil {
15165 var etag string
15166 err = json.Unmarshal(*v, &etag)
15167 if err != nil {
15168 return err
15169 }
15170 fprg.Etag = &etag
15171 }
15172 case "type":
15173 if v != nil {
15174 var typeVar string
15175 err = json.Unmarshal(*v, &typeVar)
15176 if err != nil {
15177 return err
15178 }
15179 fprg.Type = &typeVar
15180 }
15181 case "id":
15182 if v != nil {
15183 var ID string
15184 err = json.Unmarshal(*v, &ID)
15185 if err != nil {
15186 return err
15187 }
15188 fprg.ID = &ID
15189 }
15190 }
15191 }
15192
15193 return nil
15194 }
15195
15196
15197 type FirewallPolicyRuleGroupListResult struct {
15198 autorest.Response `json:"-"`
15199
15200 Value *[]FirewallPolicyRuleGroup `json:"value,omitempty"`
15201
15202 NextLink *string `json:"nextLink,omitempty"`
15203 }
15204
15205
15206
15207 type FirewallPolicyRuleGroupListResultIterator struct {
15208 i int
15209 page FirewallPolicyRuleGroupListResultPage
15210 }
15211
15212
15213
15214 func (iter *FirewallPolicyRuleGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
15215 if tracing.IsEnabled() {
15216 ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupListResultIterator.NextWithContext")
15217 defer func() {
15218 sc := -1
15219 if iter.Response().Response.Response != nil {
15220 sc = iter.Response().Response.Response.StatusCode
15221 }
15222 tracing.EndSpan(ctx, sc, err)
15223 }()
15224 }
15225 iter.i++
15226 if iter.i < len(iter.page.Values()) {
15227 return nil
15228 }
15229 err = iter.page.NextWithContext(ctx)
15230 if err != nil {
15231 iter.i--
15232 return err
15233 }
15234 iter.i = 0
15235 return nil
15236 }
15237
15238
15239
15240
15241 func (iter *FirewallPolicyRuleGroupListResultIterator) Next() error {
15242 return iter.NextWithContext(context.Background())
15243 }
15244
15245
15246 func (iter FirewallPolicyRuleGroupListResultIterator) NotDone() bool {
15247 return iter.page.NotDone() && iter.i < len(iter.page.Values())
15248 }
15249
15250
15251 func (iter FirewallPolicyRuleGroupListResultIterator) Response() FirewallPolicyRuleGroupListResult {
15252 return iter.page.Response()
15253 }
15254
15255
15256
15257 func (iter FirewallPolicyRuleGroupListResultIterator) Value() FirewallPolicyRuleGroup {
15258 if !iter.page.NotDone() {
15259 return FirewallPolicyRuleGroup{}
15260 }
15261 return iter.page.Values()[iter.i]
15262 }
15263
15264
15265 func NewFirewallPolicyRuleGroupListResultIterator(page FirewallPolicyRuleGroupListResultPage) FirewallPolicyRuleGroupListResultIterator {
15266 return FirewallPolicyRuleGroupListResultIterator{page: page}
15267 }
15268
15269
15270 func (fprglr FirewallPolicyRuleGroupListResult) IsEmpty() bool {
15271 return fprglr.Value == nil || len(*fprglr.Value) == 0
15272 }
15273
15274
15275 func (fprglr FirewallPolicyRuleGroupListResult) hasNextLink() bool {
15276 return fprglr.NextLink != nil && len(*fprglr.NextLink) != 0
15277 }
15278
15279
15280
15281 func (fprglr FirewallPolicyRuleGroupListResult) firewallPolicyRuleGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
15282 if !fprglr.hasNextLink() {
15283 return nil, nil
15284 }
15285 return autorest.Prepare((&http.Request{}).WithContext(ctx),
15286 autorest.AsJSON(),
15287 autorest.AsGet(),
15288 autorest.WithBaseURL(to.String(fprglr.NextLink)))
15289 }
15290
15291
15292 type FirewallPolicyRuleGroupListResultPage struct {
15293 fn func(context.Context, FirewallPolicyRuleGroupListResult) (FirewallPolicyRuleGroupListResult, error)
15294 fprglr FirewallPolicyRuleGroupListResult
15295 }
15296
15297
15298
15299 func (page *FirewallPolicyRuleGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
15300 if tracing.IsEnabled() {
15301 ctx = tracing.StartSpan(ctx, fqdn+"/FirewallPolicyRuleGroupListResultPage.NextWithContext")
15302 defer func() {
15303 sc := -1
15304 if page.Response().Response.Response != nil {
15305 sc = page.Response().Response.Response.StatusCode
15306 }
15307 tracing.EndSpan(ctx, sc, err)
15308 }()
15309 }
15310 for {
15311 next, err := page.fn(ctx, page.fprglr)
15312 if err != nil {
15313 return err
15314 }
15315 page.fprglr = next
15316 if !next.hasNextLink() || !next.IsEmpty() {
15317 break
15318 }
15319 }
15320 return nil
15321 }
15322
15323
15324
15325
15326 func (page *FirewallPolicyRuleGroupListResultPage) Next() error {
15327 return page.NextWithContext(context.Background())
15328 }
15329
15330
15331 func (page FirewallPolicyRuleGroupListResultPage) NotDone() bool {
15332 return !page.fprglr.IsEmpty()
15333 }
15334
15335
15336 func (page FirewallPolicyRuleGroupListResultPage) Response() FirewallPolicyRuleGroupListResult {
15337 return page.fprglr
15338 }
15339
15340
15341 func (page FirewallPolicyRuleGroupListResultPage) Values() []FirewallPolicyRuleGroup {
15342 if page.fprglr.IsEmpty() {
15343 return nil
15344 }
15345 return *page.fprglr.Value
15346 }
15347
15348
15349 func NewFirewallPolicyRuleGroupListResultPage(cur FirewallPolicyRuleGroupListResult, getNextPage func(context.Context, FirewallPolicyRuleGroupListResult) (FirewallPolicyRuleGroupListResult, error)) FirewallPolicyRuleGroupListResultPage {
15350 return FirewallPolicyRuleGroupListResultPage{
15351 fn: getNextPage,
15352 fprglr: cur,
15353 }
15354 }
15355
15356
15357 type FirewallPolicyRuleGroupProperties struct {
15358
15359 Priority *int32 `json:"priority,omitempty"`
15360
15361 Rules *[]BasicFirewallPolicyRule `json:"rules,omitempty"`
15362
15363 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
15364 }
15365
15366
15367 func (fprgp FirewallPolicyRuleGroupProperties) MarshalJSON() ([]byte, error) {
15368 objectMap := make(map[string]interface{})
15369 if fprgp.Priority != nil {
15370 objectMap["priority"] = fprgp.Priority
15371 }
15372 if fprgp.Rules != nil {
15373 objectMap["rules"] = fprgp.Rules
15374 }
15375 return json.Marshal(objectMap)
15376 }
15377
15378
15379 func (fprgp *FirewallPolicyRuleGroupProperties) UnmarshalJSON(body []byte) error {
15380 var m map[string]*json.RawMessage
15381 err := json.Unmarshal(body, &m)
15382 if err != nil {
15383 return err
15384 }
15385 for k, v := range m {
15386 switch k {
15387 case "priority":
15388 if v != nil {
15389 var priority int32
15390 err = json.Unmarshal(*v, &priority)
15391 if err != nil {
15392 return err
15393 }
15394 fprgp.Priority = &priority
15395 }
15396 case "rules":
15397 if v != nil {
15398 rules, err := unmarshalBasicFirewallPolicyRuleArray(*v)
15399 if err != nil {
15400 return err
15401 }
15402 fprgp.Rules = &rules
15403 }
15404 case "provisioningState":
15405 if v != nil {
15406 var provisioningState ProvisioningState
15407 err = json.Unmarshal(*v, &provisioningState)
15408 if err != nil {
15409 return err
15410 }
15411 fprgp.ProvisioningState = provisioningState
15412 }
15413 }
15414 }
15415
15416 return nil
15417 }
15418
15419
15420
15421 type FirewallPolicyRuleGroupsCreateOrUpdateFuture struct {
15422 azure.FutureAPI
15423
15424
15425 Result func(FirewallPolicyRuleGroupsClient) (FirewallPolicyRuleGroup, error)
15426 }
15427
15428
15429 func (future *FirewallPolicyRuleGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15430 var azFuture azure.Future
15431 if err := json.Unmarshal(body, &azFuture); err != nil {
15432 return err
15433 }
15434 future.FutureAPI = &azFuture
15435 future.Result = future.result
15436 return nil
15437 }
15438
15439
15440 func (future *FirewallPolicyRuleGroupsCreateOrUpdateFuture) result(client FirewallPolicyRuleGroupsClient) (fprg FirewallPolicyRuleGroup, err error) {
15441 var done bool
15442 done, err = future.DoneWithContext(context.Background(), client)
15443 if err != nil {
15444 err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15445 return
15446 }
15447 if !done {
15448 fprg.Response.Response = future.Response()
15449 err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleGroupsCreateOrUpdateFuture")
15450 return
15451 }
15452 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15453 if fprg.Response.Response, err = future.GetResult(sender); err == nil && fprg.Response.Response.StatusCode != http.StatusNoContent {
15454 fprg, err = client.CreateOrUpdateResponder(fprg.Response.Response)
15455 if err != nil {
15456 err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsCreateOrUpdateFuture", "Result", fprg.Response.Response, "Failure responding to request")
15457 }
15458 }
15459 return
15460 }
15461
15462
15463
15464 type FirewallPolicyRuleGroupsDeleteFuture struct {
15465 azure.FutureAPI
15466
15467
15468 Result func(FirewallPolicyRuleGroupsClient) (autorest.Response, error)
15469 }
15470
15471
15472 func (future *FirewallPolicyRuleGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
15473 var azFuture azure.Future
15474 if err := json.Unmarshal(body, &azFuture); err != nil {
15475 return err
15476 }
15477 future.FutureAPI = &azFuture
15478 future.Result = future.result
15479 return nil
15480 }
15481
15482
15483 func (future *FirewallPolicyRuleGroupsDeleteFuture) result(client FirewallPolicyRuleGroupsClient) (ar autorest.Response, err error) {
15484 var done bool
15485 done, err = future.DoneWithContext(context.Background(), client)
15486 if err != nil {
15487 err = autorest.NewErrorWithError(err, "network.FirewallPolicyRuleGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
15488 return
15489 }
15490 if !done {
15491 ar.Response = future.Response()
15492 err = azure.NewAsyncOpIncompleteError("network.FirewallPolicyRuleGroupsDeleteFuture")
15493 return
15494 }
15495 ar.Response = future.Response()
15496 return
15497 }
15498
15499
15500 type FirewallPolicyThreatIntelWhitelist struct {
15501
15502 IPAddresses *[]string `json:"ipAddresses,omitempty"`
15503
15504 Fqdns *[]string `json:"fqdns,omitempty"`
15505 }
15506
15507
15508 type FlowLog struct {
15509 autorest.Response `json:"-"`
15510
15511 *FlowLogPropertiesFormat `json:"properties,omitempty"`
15512
15513 Etag *string `json:"etag,omitempty"`
15514
15515 ID *string `json:"id,omitempty"`
15516
15517 Name *string `json:"name,omitempty"`
15518
15519 Type *string `json:"type,omitempty"`
15520
15521 Location *string `json:"location,omitempty"`
15522
15523 Tags map[string]*string `json:"tags"`
15524 }
15525
15526
15527 func (fl FlowLog) MarshalJSON() ([]byte, error) {
15528 objectMap := make(map[string]interface{})
15529 if fl.FlowLogPropertiesFormat != nil {
15530 objectMap["properties"] = fl.FlowLogPropertiesFormat
15531 }
15532 if fl.ID != nil {
15533 objectMap["id"] = fl.ID
15534 }
15535 if fl.Location != nil {
15536 objectMap["location"] = fl.Location
15537 }
15538 if fl.Tags != nil {
15539 objectMap["tags"] = fl.Tags
15540 }
15541 return json.Marshal(objectMap)
15542 }
15543
15544
15545 func (fl *FlowLog) UnmarshalJSON(body []byte) error {
15546 var m map[string]*json.RawMessage
15547 err := json.Unmarshal(body, &m)
15548 if err != nil {
15549 return err
15550 }
15551 for k, v := range m {
15552 switch k {
15553 case "properties":
15554 if v != nil {
15555 var flowLogPropertiesFormat FlowLogPropertiesFormat
15556 err = json.Unmarshal(*v, &flowLogPropertiesFormat)
15557 if err != nil {
15558 return err
15559 }
15560 fl.FlowLogPropertiesFormat = &flowLogPropertiesFormat
15561 }
15562 case "etag":
15563 if v != nil {
15564 var etag string
15565 err = json.Unmarshal(*v, &etag)
15566 if err != nil {
15567 return err
15568 }
15569 fl.Etag = &etag
15570 }
15571 case "id":
15572 if v != nil {
15573 var ID string
15574 err = json.Unmarshal(*v, &ID)
15575 if err != nil {
15576 return err
15577 }
15578 fl.ID = &ID
15579 }
15580 case "name":
15581 if v != nil {
15582 var name string
15583 err = json.Unmarshal(*v, &name)
15584 if err != nil {
15585 return err
15586 }
15587 fl.Name = &name
15588 }
15589 case "type":
15590 if v != nil {
15591 var typeVar string
15592 err = json.Unmarshal(*v, &typeVar)
15593 if err != nil {
15594 return err
15595 }
15596 fl.Type = &typeVar
15597 }
15598 case "location":
15599 if v != nil {
15600 var location string
15601 err = json.Unmarshal(*v, &location)
15602 if err != nil {
15603 return err
15604 }
15605 fl.Location = &location
15606 }
15607 case "tags":
15608 if v != nil {
15609 var tags map[string]*string
15610 err = json.Unmarshal(*v, &tags)
15611 if err != nil {
15612 return err
15613 }
15614 fl.Tags = tags
15615 }
15616 }
15617 }
15618
15619 return nil
15620 }
15621
15622
15623 type FlowLogFormatParameters struct {
15624
15625 Type FlowLogFormatType `json:"type,omitempty"`
15626
15627 Version *int32 `json:"version,omitempty"`
15628 }
15629
15630
15631 type FlowLogInformation struct {
15632 autorest.Response `json:"-"`
15633
15634 TargetResourceID *string `json:"targetResourceId,omitempty"`
15635
15636 *FlowLogProperties `json:"properties,omitempty"`
15637
15638 FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"`
15639 }
15640
15641
15642 func (fli FlowLogInformation) MarshalJSON() ([]byte, error) {
15643 objectMap := make(map[string]interface{})
15644 if fli.TargetResourceID != nil {
15645 objectMap["targetResourceId"] = fli.TargetResourceID
15646 }
15647 if fli.FlowLogProperties != nil {
15648 objectMap["properties"] = fli.FlowLogProperties
15649 }
15650 if fli.FlowAnalyticsConfiguration != nil {
15651 objectMap["flowAnalyticsConfiguration"] = fli.FlowAnalyticsConfiguration
15652 }
15653 return json.Marshal(objectMap)
15654 }
15655
15656
15657 func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error {
15658 var m map[string]*json.RawMessage
15659 err := json.Unmarshal(body, &m)
15660 if err != nil {
15661 return err
15662 }
15663 for k, v := range m {
15664 switch k {
15665 case "targetResourceId":
15666 if v != nil {
15667 var targetResourceID string
15668 err = json.Unmarshal(*v, &targetResourceID)
15669 if err != nil {
15670 return err
15671 }
15672 fli.TargetResourceID = &targetResourceID
15673 }
15674 case "properties":
15675 if v != nil {
15676 var flowLogProperties FlowLogProperties
15677 err = json.Unmarshal(*v, &flowLogProperties)
15678 if err != nil {
15679 return err
15680 }
15681 fli.FlowLogProperties = &flowLogProperties
15682 }
15683 case "flowAnalyticsConfiguration":
15684 if v != nil {
15685 var flowAnalyticsConfiguration TrafficAnalyticsProperties
15686 err = json.Unmarshal(*v, &flowAnalyticsConfiguration)
15687 if err != nil {
15688 return err
15689 }
15690 fli.FlowAnalyticsConfiguration = &flowAnalyticsConfiguration
15691 }
15692 }
15693 }
15694
15695 return nil
15696 }
15697
15698
15699 type FlowLogListResult struct {
15700 autorest.Response `json:"-"`
15701
15702 Value *[]FlowLog `json:"value,omitempty"`
15703
15704 NextLink *string `json:"nextLink,omitempty"`
15705 }
15706
15707
15708 func (fllr FlowLogListResult) MarshalJSON() ([]byte, error) {
15709 objectMap := make(map[string]interface{})
15710 if fllr.Value != nil {
15711 objectMap["value"] = fllr.Value
15712 }
15713 return json.Marshal(objectMap)
15714 }
15715
15716
15717 type FlowLogListResultIterator struct {
15718 i int
15719 page FlowLogListResultPage
15720 }
15721
15722
15723
15724 func (iter *FlowLogListResultIterator) NextWithContext(ctx context.Context) (err error) {
15725 if tracing.IsEnabled() {
15726 ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogListResultIterator.NextWithContext")
15727 defer func() {
15728 sc := -1
15729 if iter.Response().Response.Response != nil {
15730 sc = iter.Response().Response.Response.StatusCode
15731 }
15732 tracing.EndSpan(ctx, sc, err)
15733 }()
15734 }
15735 iter.i++
15736 if iter.i < len(iter.page.Values()) {
15737 return nil
15738 }
15739 err = iter.page.NextWithContext(ctx)
15740 if err != nil {
15741 iter.i--
15742 return err
15743 }
15744 iter.i = 0
15745 return nil
15746 }
15747
15748
15749
15750
15751 func (iter *FlowLogListResultIterator) Next() error {
15752 return iter.NextWithContext(context.Background())
15753 }
15754
15755
15756 func (iter FlowLogListResultIterator) NotDone() bool {
15757 return iter.page.NotDone() && iter.i < len(iter.page.Values())
15758 }
15759
15760
15761 func (iter FlowLogListResultIterator) Response() FlowLogListResult {
15762 return iter.page.Response()
15763 }
15764
15765
15766
15767 func (iter FlowLogListResultIterator) Value() FlowLog {
15768 if !iter.page.NotDone() {
15769 return FlowLog{}
15770 }
15771 return iter.page.Values()[iter.i]
15772 }
15773
15774
15775 func NewFlowLogListResultIterator(page FlowLogListResultPage) FlowLogListResultIterator {
15776 return FlowLogListResultIterator{page: page}
15777 }
15778
15779
15780 func (fllr FlowLogListResult) IsEmpty() bool {
15781 return fllr.Value == nil || len(*fllr.Value) == 0
15782 }
15783
15784
15785 func (fllr FlowLogListResult) hasNextLink() bool {
15786 return fllr.NextLink != nil && len(*fllr.NextLink) != 0
15787 }
15788
15789
15790
15791 func (fllr FlowLogListResult) flowLogListResultPreparer(ctx context.Context) (*http.Request, error) {
15792 if !fllr.hasNextLink() {
15793 return nil, nil
15794 }
15795 return autorest.Prepare((&http.Request{}).WithContext(ctx),
15796 autorest.AsJSON(),
15797 autorest.AsGet(),
15798 autorest.WithBaseURL(to.String(fllr.NextLink)))
15799 }
15800
15801
15802 type FlowLogListResultPage struct {
15803 fn func(context.Context, FlowLogListResult) (FlowLogListResult, error)
15804 fllr FlowLogListResult
15805 }
15806
15807
15808
15809 func (page *FlowLogListResultPage) NextWithContext(ctx context.Context) (err error) {
15810 if tracing.IsEnabled() {
15811 ctx = tracing.StartSpan(ctx, fqdn+"/FlowLogListResultPage.NextWithContext")
15812 defer func() {
15813 sc := -1
15814 if page.Response().Response.Response != nil {
15815 sc = page.Response().Response.Response.StatusCode
15816 }
15817 tracing.EndSpan(ctx, sc, err)
15818 }()
15819 }
15820 for {
15821 next, err := page.fn(ctx, page.fllr)
15822 if err != nil {
15823 return err
15824 }
15825 page.fllr = next
15826 if !next.hasNextLink() || !next.IsEmpty() {
15827 break
15828 }
15829 }
15830 return nil
15831 }
15832
15833
15834
15835
15836 func (page *FlowLogListResultPage) Next() error {
15837 return page.NextWithContext(context.Background())
15838 }
15839
15840
15841 func (page FlowLogListResultPage) NotDone() bool {
15842 return !page.fllr.IsEmpty()
15843 }
15844
15845
15846 func (page FlowLogListResultPage) Response() FlowLogListResult {
15847 return page.fllr
15848 }
15849
15850
15851 func (page FlowLogListResultPage) Values() []FlowLog {
15852 if page.fllr.IsEmpty() {
15853 return nil
15854 }
15855 return *page.fllr.Value
15856 }
15857
15858
15859 func NewFlowLogListResultPage(cur FlowLogListResult, getNextPage func(context.Context, FlowLogListResult) (FlowLogListResult, error)) FlowLogListResultPage {
15860 return FlowLogListResultPage{
15861 fn: getNextPage,
15862 fllr: cur,
15863 }
15864 }
15865
15866
15867 type FlowLogProperties struct {
15868
15869 StorageID *string `json:"storageId,omitempty"`
15870
15871 Enabled *bool `json:"enabled,omitempty"`
15872
15873 RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"`
15874
15875 Format *FlowLogFormatParameters `json:"format,omitempty"`
15876 }
15877
15878
15879 type FlowLogPropertiesFormat struct {
15880
15881 TargetResourceID *string `json:"targetResourceId,omitempty"`
15882
15883 TargetResourceGUID *string `json:"targetResourceGuid,omitempty"`
15884
15885 StorageID *string `json:"storageId,omitempty"`
15886
15887 Enabled *bool `json:"enabled,omitempty"`
15888
15889 RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"`
15890
15891 Format *FlowLogFormatParameters `json:"format,omitempty"`
15892
15893 FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"`
15894
15895 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
15896 }
15897
15898
15899 func (flpf FlowLogPropertiesFormat) MarshalJSON() ([]byte, error) {
15900 objectMap := make(map[string]interface{})
15901 if flpf.TargetResourceID != nil {
15902 objectMap["targetResourceId"] = flpf.TargetResourceID
15903 }
15904 if flpf.StorageID != nil {
15905 objectMap["storageId"] = flpf.StorageID
15906 }
15907 if flpf.Enabled != nil {
15908 objectMap["enabled"] = flpf.Enabled
15909 }
15910 if flpf.RetentionPolicy != nil {
15911 objectMap["retentionPolicy"] = flpf.RetentionPolicy
15912 }
15913 if flpf.Format != nil {
15914 objectMap["format"] = flpf.Format
15915 }
15916 if flpf.FlowAnalyticsConfiguration != nil {
15917 objectMap["flowAnalyticsConfiguration"] = flpf.FlowAnalyticsConfiguration
15918 }
15919 return json.Marshal(objectMap)
15920 }
15921
15922
15923
15924 type FlowLogsCreateOrUpdateFuture struct {
15925 azure.FutureAPI
15926
15927
15928 Result func(FlowLogsClient) (FlowLog, error)
15929 }
15930
15931
15932 func (future *FlowLogsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
15933 var azFuture azure.Future
15934 if err := json.Unmarshal(body, &azFuture); err != nil {
15935 return err
15936 }
15937 future.FutureAPI = &azFuture
15938 future.Result = future.result
15939 return nil
15940 }
15941
15942
15943 func (future *FlowLogsCreateOrUpdateFuture) result(client FlowLogsClient) (fl FlowLog, err error) {
15944 var done bool
15945 done, err = future.DoneWithContext(context.Background(), client)
15946 if err != nil {
15947 err = autorest.NewErrorWithError(err, "network.FlowLogsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
15948 return
15949 }
15950 if !done {
15951 fl.Response.Response = future.Response()
15952 err = azure.NewAsyncOpIncompleteError("network.FlowLogsCreateOrUpdateFuture")
15953 return
15954 }
15955 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15956 if fl.Response.Response, err = future.GetResult(sender); err == nil && fl.Response.Response.StatusCode != http.StatusNoContent {
15957 fl, err = client.CreateOrUpdateResponder(fl.Response.Response)
15958 if err != nil {
15959 err = autorest.NewErrorWithError(err, "network.FlowLogsCreateOrUpdateFuture", "Result", fl.Response.Response, "Failure responding to request")
15960 }
15961 }
15962 return
15963 }
15964
15965
15966
15967 type FlowLogsDeleteFuture struct {
15968 azure.FutureAPI
15969
15970
15971 Result func(FlowLogsClient) (autorest.Response, error)
15972 }
15973
15974
15975 func (future *FlowLogsDeleteFuture) UnmarshalJSON(body []byte) error {
15976 var azFuture azure.Future
15977 if err := json.Unmarshal(body, &azFuture); err != nil {
15978 return err
15979 }
15980 future.FutureAPI = &azFuture
15981 future.Result = future.result
15982 return nil
15983 }
15984
15985
15986 func (future *FlowLogsDeleteFuture) result(client FlowLogsClient) (ar autorest.Response, err error) {
15987 var done bool
15988 done, err = future.DoneWithContext(context.Background(), client)
15989 if err != nil {
15990 err = autorest.NewErrorWithError(err, "network.FlowLogsDeleteFuture", "Result", future.Response(), "Polling failure")
15991 return
15992 }
15993 if !done {
15994 ar.Response = future.Response()
15995 err = azure.NewAsyncOpIncompleteError("network.FlowLogsDeleteFuture")
15996 return
15997 }
15998 ar.Response = future.Response()
15999 return
16000 }
16001
16002
16003
16004 type FlowLogStatusParameters struct {
16005
16006 TargetResourceID *string `json:"targetResourceId,omitempty"`
16007 }
16008
16009
16010 type FrontendIPConfiguration struct {
16011 autorest.Response `json:"-"`
16012
16013 *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"`
16014
16015 Name *string `json:"name,omitempty"`
16016
16017 Etag *string `json:"etag,omitempty"`
16018
16019 Type *string `json:"type,omitempty"`
16020
16021 Zones *[]string `json:"zones,omitempty"`
16022
16023 ID *string `json:"id,omitempty"`
16024 }
16025
16026
16027 func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) {
16028 objectMap := make(map[string]interface{})
16029 if fic.FrontendIPConfigurationPropertiesFormat != nil {
16030 objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat
16031 }
16032 if fic.Name != nil {
16033 objectMap["name"] = fic.Name
16034 }
16035 if fic.Zones != nil {
16036 objectMap["zones"] = fic.Zones
16037 }
16038 if fic.ID != nil {
16039 objectMap["id"] = fic.ID
16040 }
16041 return json.Marshal(objectMap)
16042 }
16043
16044
16045 func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error {
16046 var m map[string]*json.RawMessage
16047 err := json.Unmarshal(body, &m)
16048 if err != nil {
16049 return err
16050 }
16051 for k, v := range m {
16052 switch k {
16053 case "properties":
16054 if v != nil {
16055 var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat
16056 err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat)
16057 if err != nil {
16058 return err
16059 }
16060 fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat
16061 }
16062 case "name":
16063 if v != nil {
16064 var name string
16065 err = json.Unmarshal(*v, &name)
16066 if err != nil {
16067 return err
16068 }
16069 fic.Name = &name
16070 }
16071 case "etag":
16072 if v != nil {
16073 var etag string
16074 err = json.Unmarshal(*v, &etag)
16075 if err != nil {
16076 return err
16077 }
16078 fic.Etag = &etag
16079 }
16080 case "type":
16081 if v != nil {
16082 var typeVar string
16083 err = json.Unmarshal(*v, &typeVar)
16084 if err != nil {
16085 return err
16086 }
16087 fic.Type = &typeVar
16088 }
16089 case "zones":
16090 if v != nil {
16091 var zones []string
16092 err = json.Unmarshal(*v, &zones)
16093 if err != nil {
16094 return err
16095 }
16096 fic.Zones = &zones
16097 }
16098 case "id":
16099 if v != nil {
16100 var ID string
16101 err = json.Unmarshal(*v, &ID)
16102 if err != nil {
16103 return err
16104 }
16105 fic.ID = &ID
16106 }
16107 }
16108 }
16109
16110 return nil
16111 }
16112
16113
16114 type FrontendIPConfigurationPropertiesFormat struct {
16115
16116 InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"`
16117
16118 InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"`
16119
16120 OutboundRules *[]SubResource `json:"outboundRules,omitempty"`
16121
16122 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
16123
16124 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
16125
16126 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
16127
16128 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
16129
16130 Subnet *Subnet `json:"subnet,omitempty"`
16131
16132 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
16133
16134 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"`
16135
16136 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
16137 }
16138
16139
16140 func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
16141 objectMap := make(map[string]interface{})
16142 if ficpf.PrivateIPAddress != nil {
16143 objectMap["privateIPAddress"] = ficpf.PrivateIPAddress
16144 }
16145 if ficpf.PrivateIPAllocationMethod != "" {
16146 objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod
16147 }
16148 if ficpf.PrivateIPAddressVersion != "" {
16149 objectMap["privateIPAddressVersion"] = ficpf.PrivateIPAddressVersion
16150 }
16151 if ficpf.Subnet != nil {
16152 objectMap["subnet"] = ficpf.Subnet
16153 }
16154 if ficpf.PublicIPAddress != nil {
16155 objectMap["publicIPAddress"] = ficpf.PublicIPAddress
16156 }
16157 if ficpf.PublicIPPrefix != nil {
16158 objectMap["publicIPPrefix"] = ficpf.PublicIPPrefix
16159 }
16160 return json.Marshal(objectMap)
16161 }
16162
16163
16164 type GatewayRoute struct {
16165
16166 LocalAddress *string `json:"localAddress,omitempty"`
16167
16168 NetworkProperty *string `json:"network,omitempty"`
16169
16170 NextHop *string `json:"nextHop,omitempty"`
16171
16172 SourcePeer *string `json:"sourcePeer,omitempty"`
16173
16174 Origin *string `json:"origin,omitempty"`
16175
16176 AsPath *string `json:"asPath,omitempty"`
16177
16178 Weight *int32 `json:"weight,omitempty"`
16179 }
16180
16181
16182 func (gr GatewayRoute) MarshalJSON() ([]byte, error) {
16183 objectMap := make(map[string]interface{})
16184 return json.Marshal(objectMap)
16185 }
16186
16187
16188 type GatewayRouteListResult struct {
16189 autorest.Response `json:"-"`
16190
16191 Value *[]GatewayRoute `json:"value,omitempty"`
16192 }
16193
16194
16195
16196 type GeneratevirtualwanvpnserverconfigurationvpnprofileFuture struct {
16197 azure.FutureAPI
16198
16199
16200 Result func(BaseClient) (VpnProfileResponse, error)
16201 }
16202
16203
16204 func (future *GeneratevirtualwanvpnserverconfigurationvpnprofileFuture) UnmarshalJSON(body []byte) error {
16205 var azFuture azure.Future
16206 if err := json.Unmarshal(body, &azFuture); err != nil {
16207 return err
16208 }
16209 future.FutureAPI = &azFuture
16210 future.Result = future.result
16211 return nil
16212 }
16213
16214
16215 func (future *GeneratevirtualwanvpnserverconfigurationvpnprofileFuture) result(client BaseClient) (vpr VpnProfileResponse, err error) {
16216 var done bool
16217 done, err = future.DoneWithContext(context.Background(), client)
16218 if err != nil {
16219 err = autorest.NewErrorWithError(err, "network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture", "Result", future.Response(), "Polling failure")
16220 return
16221 }
16222 if !done {
16223 vpr.Response.Response = future.Response()
16224 err = azure.NewAsyncOpIncompleteError("network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture")
16225 return
16226 }
16227 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16228 if vpr.Response.Response, err = future.GetResult(sender); err == nil && vpr.Response.Response.StatusCode != http.StatusNoContent {
16229 vpr, err = client.GeneratevirtualwanvpnserverconfigurationvpnprofileResponder(vpr.Response.Response)
16230 if err != nil {
16231 err = autorest.NewErrorWithError(err, "network.GeneratevirtualwanvpnserverconfigurationvpnprofileFuture", "Result", vpr.Response.Response, "Failure responding to request")
16232 }
16233 }
16234 return
16235 }
16236
16237
16238
16239 type GetActiveSessionsAllFuture struct {
16240 azure.FutureAPI
16241
16242
16243 Result func(BaseClient) (BastionActiveSessionListResultPage, error)
16244 }
16245
16246
16247 func (future *GetActiveSessionsAllFuture) UnmarshalJSON(body []byte) error {
16248 var azFuture azure.Future
16249 if err := json.Unmarshal(body, &azFuture); err != nil {
16250 return err
16251 }
16252 future.FutureAPI = &azFuture
16253 future.Result = future.result
16254 return nil
16255 }
16256
16257
16258 func (future *GetActiveSessionsAllFuture) result(client BaseClient) (baslrp BastionActiveSessionListResultPage, err error) {
16259 var done bool
16260 done, err = future.DoneWithContext(context.Background(), client)
16261 if err != nil {
16262 err = autorest.NewErrorWithError(err, "network.GetActiveSessionsAllFuture", "Result", future.Response(), "Polling failure")
16263 return
16264 }
16265 if !done {
16266 baslrp.baslr.Response.Response = future.Response()
16267 err = azure.NewAsyncOpIncompleteError("network.GetActiveSessionsAllFuture")
16268 return
16269 }
16270 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16271 if baslrp.baslr.Response.Response, err = future.GetResult(sender); err == nil && baslrp.baslr.Response.Response.StatusCode != http.StatusNoContent {
16272 baslrp, err = client.GetActiveSessionsResponder(baslrp.baslr.Response.Response)
16273 if err != nil {
16274 err = autorest.NewErrorWithError(err, "network.GetActiveSessionsAllFuture", "Result", baslrp.baslr.Response.Response, "Failure responding to request")
16275 }
16276 }
16277 return
16278 }
16279
16280
16281
16282 type GetActiveSessionsFuture struct {
16283 azure.FutureAPI
16284
16285
16286 Result func(BaseClient) (BastionActiveSessionListResultPage, error)
16287 }
16288
16289
16290 func (future *GetActiveSessionsFuture) UnmarshalJSON(body []byte) error {
16291 var azFuture azure.Future
16292 if err := json.Unmarshal(body, &azFuture); err != nil {
16293 return err
16294 }
16295 future.FutureAPI = &azFuture
16296 future.Result = future.result
16297 return nil
16298 }
16299
16300
16301 func (future *GetActiveSessionsFuture) result(client BaseClient) (baslrp BastionActiveSessionListResultPage, err error) {
16302 var done bool
16303 done, err = future.DoneWithContext(context.Background(), client)
16304 if err != nil {
16305 err = autorest.NewErrorWithError(err, "network.GetActiveSessionsFuture", "Result", future.Response(), "Polling failure")
16306 return
16307 }
16308 if !done {
16309 baslrp.baslr.Response.Response = future.Response()
16310 err = azure.NewAsyncOpIncompleteError("network.GetActiveSessionsFuture")
16311 return
16312 }
16313 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16314 if baslrp.baslr.Response.Response, err = future.GetResult(sender); err == nil && baslrp.baslr.Response.Response.StatusCode != http.StatusNoContent {
16315 baslrp, err = client.GetActiveSessionsResponder(baslrp.baslr.Response.Response)
16316 if err != nil {
16317 err = autorest.NewErrorWithError(err, "network.GetActiveSessionsFuture", "Result", baslrp.baslr.Response.Response, "Failure responding to request")
16318 }
16319 }
16320 return
16321 }
16322
16323
16324 type GetVpnSitesConfigurationRequest struct {
16325
16326 VpnSites *[]string `json:"vpnSites,omitempty"`
16327
16328 OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"`
16329 }
16330
16331
16332 type HTTPConfiguration struct {
16333
16334 Method HTTPMethod `json:"method,omitempty"`
16335
16336 Headers *[]HTTPHeader `json:"headers,omitempty"`
16337
16338 ValidStatusCodes *[]int32 `json:"validStatusCodes,omitempty"`
16339 }
16340
16341
16342 type HTTPHeader struct {
16343
16344 Name *string `json:"name,omitempty"`
16345
16346 Value *string `json:"value,omitempty"`
16347 }
16348
16349
16350 type HubIPAddresses struct {
16351
16352 PublicIPAddresses *[]AzureFirewallPublicIPAddress `json:"publicIPAddresses,omitempty"`
16353
16354 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
16355 }
16356
16357
16358 type HubRoute struct {
16359
16360 Name *string `json:"name,omitempty"`
16361
16362 DestinationType *string `json:"destinationType,omitempty"`
16363
16364 Destinations *[]string `json:"destinations,omitempty"`
16365
16366 NextHopType *string `json:"nextHopType,omitempty"`
16367
16368 NextHop *string `json:"nextHop,omitempty"`
16369 }
16370
16371
16372 type HubRouteTable struct {
16373 autorest.Response `json:"-"`
16374
16375 *HubRouteTableProperties `json:"properties,omitempty"`
16376
16377 Name *string `json:"name,omitempty"`
16378
16379 Etag *string `json:"etag,omitempty"`
16380
16381 Type *string `json:"type,omitempty"`
16382
16383 ID *string `json:"id,omitempty"`
16384 }
16385
16386
16387 func (hrt HubRouteTable) MarshalJSON() ([]byte, error) {
16388 objectMap := make(map[string]interface{})
16389 if hrt.HubRouteTableProperties != nil {
16390 objectMap["properties"] = hrt.HubRouteTableProperties
16391 }
16392 if hrt.Name != nil {
16393 objectMap["name"] = hrt.Name
16394 }
16395 if hrt.ID != nil {
16396 objectMap["id"] = hrt.ID
16397 }
16398 return json.Marshal(objectMap)
16399 }
16400
16401
16402 func (hrt *HubRouteTable) UnmarshalJSON(body []byte) error {
16403 var m map[string]*json.RawMessage
16404 err := json.Unmarshal(body, &m)
16405 if err != nil {
16406 return err
16407 }
16408 for k, v := range m {
16409 switch k {
16410 case "properties":
16411 if v != nil {
16412 var hubRouteTableProperties HubRouteTableProperties
16413 err = json.Unmarshal(*v, &hubRouteTableProperties)
16414 if err != nil {
16415 return err
16416 }
16417 hrt.HubRouteTableProperties = &hubRouteTableProperties
16418 }
16419 case "name":
16420 if v != nil {
16421 var name string
16422 err = json.Unmarshal(*v, &name)
16423 if err != nil {
16424 return err
16425 }
16426 hrt.Name = &name
16427 }
16428 case "etag":
16429 if v != nil {
16430 var etag string
16431 err = json.Unmarshal(*v, &etag)
16432 if err != nil {
16433 return err
16434 }
16435 hrt.Etag = &etag
16436 }
16437 case "type":
16438 if v != nil {
16439 var typeVar string
16440 err = json.Unmarshal(*v, &typeVar)
16441 if err != nil {
16442 return err
16443 }
16444 hrt.Type = &typeVar
16445 }
16446 case "id":
16447 if v != nil {
16448 var ID string
16449 err = json.Unmarshal(*v, &ID)
16450 if err != nil {
16451 return err
16452 }
16453 hrt.ID = &ID
16454 }
16455 }
16456 }
16457
16458 return nil
16459 }
16460
16461
16462 type HubRouteTableProperties struct {
16463
16464 Routes *[]HubRoute `json:"routes,omitempty"`
16465
16466 Labels *[]string `json:"labels,omitempty"`
16467
16468 AssociatedConnections *[]string `json:"associatedConnections,omitempty"`
16469
16470 PropagatingConnections *[]string `json:"propagatingConnections,omitempty"`
16471
16472 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
16473 }
16474
16475
16476 func (hrtp HubRouteTableProperties) MarshalJSON() ([]byte, error) {
16477 objectMap := make(map[string]interface{})
16478 if hrtp.Routes != nil {
16479 objectMap["routes"] = hrtp.Routes
16480 }
16481 if hrtp.Labels != nil {
16482 objectMap["labels"] = hrtp.Labels
16483 }
16484 return json.Marshal(objectMap)
16485 }
16486
16487
16488
16489 type HubRouteTablesCreateOrUpdateFuture struct {
16490 azure.FutureAPI
16491
16492
16493 Result func(HubRouteTablesClient) (HubRouteTable, error)
16494 }
16495
16496
16497 func (future *HubRouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
16498 var azFuture azure.Future
16499 if err := json.Unmarshal(body, &azFuture); err != nil {
16500 return err
16501 }
16502 future.FutureAPI = &azFuture
16503 future.Result = future.result
16504 return nil
16505 }
16506
16507
16508 func (future *HubRouteTablesCreateOrUpdateFuture) result(client HubRouteTablesClient) (hrt HubRouteTable, err error) {
16509 var done bool
16510 done, err = future.DoneWithContext(context.Background(), client)
16511 if err != nil {
16512 err = autorest.NewErrorWithError(err, "network.HubRouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
16513 return
16514 }
16515 if !done {
16516 hrt.Response.Response = future.Response()
16517 err = azure.NewAsyncOpIncompleteError("network.HubRouteTablesCreateOrUpdateFuture")
16518 return
16519 }
16520 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
16521 if hrt.Response.Response, err = future.GetResult(sender); err == nil && hrt.Response.Response.StatusCode != http.StatusNoContent {
16522 hrt, err = client.CreateOrUpdateResponder(hrt.Response.Response)
16523 if err != nil {
16524 err = autorest.NewErrorWithError(err, "network.HubRouteTablesCreateOrUpdateFuture", "Result", hrt.Response.Response, "Failure responding to request")
16525 }
16526 }
16527 return
16528 }
16529
16530
16531
16532 type HubRouteTablesDeleteFuture struct {
16533 azure.FutureAPI
16534
16535
16536 Result func(HubRouteTablesClient) (autorest.Response, error)
16537 }
16538
16539
16540 func (future *HubRouteTablesDeleteFuture) UnmarshalJSON(body []byte) error {
16541 var azFuture azure.Future
16542 if err := json.Unmarshal(body, &azFuture); err != nil {
16543 return err
16544 }
16545 future.FutureAPI = &azFuture
16546 future.Result = future.result
16547 return nil
16548 }
16549
16550
16551 func (future *HubRouteTablesDeleteFuture) result(client HubRouteTablesClient) (ar autorest.Response, err error) {
16552 var done bool
16553 done, err = future.DoneWithContext(context.Background(), client)
16554 if err != nil {
16555 err = autorest.NewErrorWithError(err, "network.HubRouteTablesDeleteFuture", "Result", future.Response(), "Polling failure")
16556 return
16557 }
16558 if !done {
16559 ar.Response = future.Response()
16560 err = azure.NewAsyncOpIncompleteError("network.HubRouteTablesDeleteFuture")
16561 return
16562 }
16563 ar.Response = future.Response()
16564 return
16565 }
16566
16567
16568 type HubVirtualNetworkConnection struct {
16569 autorest.Response `json:"-"`
16570
16571 *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"`
16572
16573 Name *string `json:"name,omitempty"`
16574
16575 Etag *string `json:"etag,omitempty"`
16576
16577 ID *string `json:"id,omitempty"`
16578 }
16579
16580
16581 func (hvnc HubVirtualNetworkConnection) MarshalJSON() ([]byte, error) {
16582 objectMap := make(map[string]interface{})
16583 if hvnc.HubVirtualNetworkConnectionProperties != nil {
16584 objectMap["properties"] = hvnc.HubVirtualNetworkConnectionProperties
16585 }
16586 if hvnc.Name != nil {
16587 objectMap["name"] = hvnc.Name
16588 }
16589 if hvnc.ID != nil {
16590 objectMap["id"] = hvnc.ID
16591 }
16592 return json.Marshal(objectMap)
16593 }
16594
16595
16596 func (hvnc *HubVirtualNetworkConnection) UnmarshalJSON(body []byte) error {
16597 var m map[string]*json.RawMessage
16598 err := json.Unmarshal(body, &m)
16599 if err != nil {
16600 return err
16601 }
16602 for k, v := range m {
16603 switch k {
16604 case "properties":
16605 if v != nil {
16606 var hubVirtualNetworkConnectionProperties HubVirtualNetworkConnectionProperties
16607 err = json.Unmarshal(*v, &hubVirtualNetworkConnectionProperties)
16608 if err != nil {
16609 return err
16610 }
16611 hvnc.HubVirtualNetworkConnectionProperties = &hubVirtualNetworkConnectionProperties
16612 }
16613 case "name":
16614 if v != nil {
16615 var name string
16616 err = json.Unmarshal(*v, &name)
16617 if err != nil {
16618 return err
16619 }
16620 hvnc.Name = &name
16621 }
16622 case "etag":
16623 if v != nil {
16624 var etag string
16625 err = json.Unmarshal(*v, &etag)
16626 if err != nil {
16627 return err
16628 }
16629 hvnc.Etag = &etag
16630 }
16631 case "id":
16632 if v != nil {
16633 var ID string
16634 err = json.Unmarshal(*v, &ID)
16635 if err != nil {
16636 return err
16637 }
16638 hvnc.ID = &ID
16639 }
16640 }
16641 }
16642
16643 return nil
16644 }
16645
16646
16647 type HubVirtualNetworkConnectionProperties struct {
16648
16649 RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"`
16650
16651 AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"`
16652
16653 AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"`
16654
16655 EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"`
16656
16657 RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"`
16658
16659 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
16660 }
16661
16662
16663 func (hvncp HubVirtualNetworkConnectionProperties) MarshalJSON() ([]byte, error) {
16664 objectMap := make(map[string]interface{})
16665 if hvncp.RemoteVirtualNetwork != nil {
16666 objectMap["remoteVirtualNetwork"] = hvncp.RemoteVirtualNetwork
16667 }
16668 if hvncp.AllowHubToRemoteVnetTransit != nil {
16669 objectMap["allowHubToRemoteVnetTransit"] = hvncp.AllowHubToRemoteVnetTransit
16670 }
16671 if hvncp.AllowRemoteVnetToUseHubVnetGateways != nil {
16672 objectMap["allowRemoteVnetToUseHubVnetGateways"] = hvncp.AllowRemoteVnetToUseHubVnetGateways
16673 }
16674 if hvncp.EnableInternetSecurity != nil {
16675 objectMap["enableInternetSecurity"] = hvncp.EnableInternetSecurity
16676 }
16677 if hvncp.RoutingConfiguration != nil {
16678 objectMap["routingConfiguration"] = hvncp.RoutingConfiguration
16679 }
16680 return json.Marshal(objectMap)
16681 }
16682
16683
16684 type InboundNatPool struct {
16685
16686 *InboundNatPoolPropertiesFormat `json:"properties,omitempty"`
16687
16688 Name *string `json:"name,omitempty"`
16689
16690 Etag *string `json:"etag,omitempty"`
16691
16692 Type *string `json:"type,omitempty"`
16693
16694 ID *string `json:"id,omitempty"`
16695 }
16696
16697
16698 func (inp InboundNatPool) MarshalJSON() ([]byte, error) {
16699 objectMap := make(map[string]interface{})
16700 if inp.InboundNatPoolPropertiesFormat != nil {
16701 objectMap["properties"] = inp.InboundNatPoolPropertiesFormat
16702 }
16703 if inp.Name != nil {
16704 objectMap["name"] = inp.Name
16705 }
16706 if inp.ID != nil {
16707 objectMap["id"] = inp.ID
16708 }
16709 return json.Marshal(objectMap)
16710 }
16711
16712
16713 func (inp *InboundNatPool) UnmarshalJSON(body []byte) error {
16714 var m map[string]*json.RawMessage
16715 err := json.Unmarshal(body, &m)
16716 if err != nil {
16717 return err
16718 }
16719 for k, v := range m {
16720 switch k {
16721 case "properties":
16722 if v != nil {
16723 var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat
16724 err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat)
16725 if err != nil {
16726 return err
16727 }
16728 inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat
16729 }
16730 case "name":
16731 if v != nil {
16732 var name string
16733 err = json.Unmarshal(*v, &name)
16734 if err != nil {
16735 return err
16736 }
16737 inp.Name = &name
16738 }
16739 case "etag":
16740 if v != nil {
16741 var etag string
16742 err = json.Unmarshal(*v, &etag)
16743 if err != nil {
16744 return err
16745 }
16746 inp.Etag = &etag
16747 }
16748 case "type":
16749 if v != nil {
16750 var typeVar string
16751 err = json.Unmarshal(*v, &typeVar)
16752 if err != nil {
16753 return err
16754 }
16755 inp.Type = &typeVar
16756 }
16757 case "id":
16758 if v != nil {
16759 var ID string
16760 err = json.Unmarshal(*v, &ID)
16761 if err != nil {
16762 return err
16763 }
16764 inp.ID = &ID
16765 }
16766 }
16767 }
16768
16769 return nil
16770 }
16771
16772
16773 type InboundNatPoolPropertiesFormat struct {
16774
16775 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
16776
16777 Protocol TransportProtocol `json:"protocol,omitempty"`
16778
16779 FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"`
16780
16781 FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"`
16782
16783 BackendPort *int32 `json:"backendPort,omitempty"`
16784
16785 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
16786
16787 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
16788
16789 EnableTCPReset *bool `json:"enableTcpReset,omitempty"`
16790
16791 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
16792 }
16793
16794
16795 func (inppf InboundNatPoolPropertiesFormat) MarshalJSON() ([]byte, error) {
16796 objectMap := make(map[string]interface{})
16797 if inppf.FrontendIPConfiguration != nil {
16798 objectMap["frontendIPConfiguration"] = inppf.FrontendIPConfiguration
16799 }
16800 if inppf.Protocol != "" {
16801 objectMap["protocol"] = inppf.Protocol
16802 }
16803 if inppf.FrontendPortRangeStart != nil {
16804 objectMap["frontendPortRangeStart"] = inppf.FrontendPortRangeStart
16805 }
16806 if inppf.FrontendPortRangeEnd != nil {
16807 objectMap["frontendPortRangeEnd"] = inppf.FrontendPortRangeEnd
16808 }
16809 if inppf.BackendPort != nil {
16810 objectMap["backendPort"] = inppf.BackendPort
16811 }
16812 if inppf.IdleTimeoutInMinutes != nil {
16813 objectMap["idleTimeoutInMinutes"] = inppf.IdleTimeoutInMinutes
16814 }
16815 if inppf.EnableFloatingIP != nil {
16816 objectMap["enableFloatingIP"] = inppf.EnableFloatingIP
16817 }
16818 if inppf.EnableTCPReset != nil {
16819 objectMap["enableTcpReset"] = inppf.EnableTCPReset
16820 }
16821 return json.Marshal(objectMap)
16822 }
16823
16824
16825 type InboundNatRule struct {
16826 autorest.Response `json:"-"`
16827
16828 *InboundNatRulePropertiesFormat `json:"properties,omitempty"`
16829
16830 Name *string `json:"name,omitempty"`
16831
16832 Etag *string `json:"etag,omitempty"`
16833
16834 Type *string `json:"type,omitempty"`
16835
16836 ID *string `json:"id,omitempty"`
16837 }
16838
16839
16840 func (inr InboundNatRule) MarshalJSON() ([]byte, error) {
16841 objectMap := make(map[string]interface{})
16842 if inr.InboundNatRulePropertiesFormat != nil {
16843 objectMap["properties"] = inr.InboundNatRulePropertiesFormat
16844 }
16845 if inr.Name != nil {
16846 objectMap["name"] = inr.Name
16847 }
16848 if inr.ID != nil {
16849 objectMap["id"] = inr.ID
16850 }
16851 return json.Marshal(objectMap)
16852 }
16853
16854
16855 func (inr *InboundNatRule) UnmarshalJSON(body []byte) error {
16856 var m map[string]*json.RawMessage
16857 err := json.Unmarshal(body, &m)
16858 if err != nil {
16859 return err
16860 }
16861 for k, v := range m {
16862 switch k {
16863 case "properties":
16864 if v != nil {
16865 var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat
16866 err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat)
16867 if err != nil {
16868 return err
16869 }
16870 inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat
16871 }
16872 case "name":
16873 if v != nil {
16874 var name string
16875 err = json.Unmarshal(*v, &name)
16876 if err != nil {
16877 return err
16878 }
16879 inr.Name = &name
16880 }
16881 case "etag":
16882 if v != nil {
16883 var etag string
16884 err = json.Unmarshal(*v, &etag)
16885 if err != nil {
16886 return err
16887 }
16888 inr.Etag = &etag
16889 }
16890 case "type":
16891 if v != nil {
16892 var typeVar string
16893 err = json.Unmarshal(*v, &typeVar)
16894 if err != nil {
16895 return err
16896 }
16897 inr.Type = &typeVar
16898 }
16899 case "id":
16900 if v != nil {
16901 var ID string
16902 err = json.Unmarshal(*v, &ID)
16903 if err != nil {
16904 return err
16905 }
16906 inr.ID = &ID
16907 }
16908 }
16909 }
16910
16911 return nil
16912 }
16913
16914
16915 type InboundNatRuleListResult struct {
16916 autorest.Response `json:"-"`
16917
16918 Value *[]InboundNatRule `json:"value,omitempty"`
16919
16920 NextLink *string `json:"nextLink,omitempty"`
16921 }
16922
16923
16924 func (inrlr InboundNatRuleListResult) MarshalJSON() ([]byte, error) {
16925 objectMap := make(map[string]interface{})
16926 if inrlr.Value != nil {
16927 objectMap["value"] = inrlr.Value
16928 }
16929 return json.Marshal(objectMap)
16930 }
16931
16932
16933 type InboundNatRuleListResultIterator struct {
16934 i int
16935 page InboundNatRuleListResultPage
16936 }
16937
16938
16939
16940 func (iter *InboundNatRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
16941 if tracing.IsEnabled() {
16942 ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultIterator.NextWithContext")
16943 defer func() {
16944 sc := -1
16945 if iter.Response().Response.Response != nil {
16946 sc = iter.Response().Response.Response.StatusCode
16947 }
16948 tracing.EndSpan(ctx, sc, err)
16949 }()
16950 }
16951 iter.i++
16952 if iter.i < len(iter.page.Values()) {
16953 return nil
16954 }
16955 err = iter.page.NextWithContext(ctx)
16956 if err != nil {
16957 iter.i--
16958 return err
16959 }
16960 iter.i = 0
16961 return nil
16962 }
16963
16964
16965
16966
16967 func (iter *InboundNatRuleListResultIterator) Next() error {
16968 return iter.NextWithContext(context.Background())
16969 }
16970
16971
16972 func (iter InboundNatRuleListResultIterator) NotDone() bool {
16973 return iter.page.NotDone() && iter.i < len(iter.page.Values())
16974 }
16975
16976
16977 func (iter InboundNatRuleListResultIterator) Response() InboundNatRuleListResult {
16978 return iter.page.Response()
16979 }
16980
16981
16982
16983 func (iter InboundNatRuleListResultIterator) Value() InboundNatRule {
16984 if !iter.page.NotDone() {
16985 return InboundNatRule{}
16986 }
16987 return iter.page.Values()[iter.i]
16988 }
16989
16990
16991 func NewInboundNatRuleListResultIterator(page InboundNatRuleListResultPage) InboundNatRuleListResultIterator {
16992 return InboundNatRuleListResultIterator{page: page}
16993 }
16994
16995
16996 func (inrlr InboundNatRuleListResult) IsEmpty() bool {
16997 return inrlr.Value == nil || len(*inrlr.Value) == 0
16998 }
16999
17000
17001 func (inrlr InboundNatRuleListResult) hasNextLink() bool {
17002 return inrlr.NextLink != nil && len(*inrlr.NextLink) != 0
17003 }
17004
17005
17006
17007 func (inrlr InboundNatRuleListResult) inboundNatRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
17008 if !inrlr.hasNextLink() {
17009 return nil, nil
17010 }
17011 return autorest.Prepare((&http.Request{}).WithContext(ctx),
17012 autorest.AsJSON(),
17013 autorest.AsGet(),
17014 autorest.WithBaseURL(to.String(inrlr.NextLink)))
17015 }
17016
17017
17018 type InboundNatRuleListResultPage struct {
17019 fn func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error)
17020 inrlr InboundNatRuleListResult
17021 }
17022
17023
17024
17025 func (page *InboundNatRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
17026 if tracing.IsEnabled() {
17027 ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultPage.NextWithContext")
17028 defer func() {
17029 sc := -1
17030 if page.Response().Response.Response != nil {
17031 sc = page.Response().Response.Response.StatusCode
17032 }
17033 tracing.EndSpan(ctx, sc, err)
17034 }()
17035 }
17036 for {
17037 next, err := page.fn(ctx, page.inrlr)
17038 if err != nil {
17039 return err
17040 }
17041 page.inrlr = next
17042 if !next.hasNextLink() || !next.IsEmpty() {
17043 break
17044 }
17045 }
17046 return nil
17047 }
17048
17049
17050
17051
17052 func (page *InboundNatRuleListResultPage) Next() error {
17053 return page.NextWithContext(context.Background())
17054 }
17055
17056
17057 func (page InboundNatRuleListResultPage) NotDone() bool {
17058 return !page.inrlr.IsEmpty()
17059 }
17060
17061
17062 func (page InboundNatRuleListResultPage) Response() InboundNatRuleListResult {
17063 return page.inrlr
17064 }
17065
17066
17067 func (page InboundNatRuleListResultPage) Values() []InboundNatRule {
17068 if page.inrlr.IsEmpty() {
17069 return nil
17070 }
17071 return *page.inrlr.Value
17072 }
17073
17074
17075 func NewInboundNatRuleListResultPage(cur InboundNatRuleListResult, getNextPage func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error)) InboundNatRuleListResultPage {
17076 return InboundNatRuleListResultPage{
17077 fn: getNextPage,
17078 inrlr: cur,
17079 }
17080 }
17081
17082
17083 type InboundNatRulePropertiesFormat struct {
17084
17085 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
17086
17087 BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"`
17088
17089 Protocol TransportProtocol `json:"protocol,omitempty"`
17090
17091 FrontendPort *int32 `json:"frontendPort,omitempty"`
17092
17093 BackendPort *int32 `json:"backendPort,omitempty"`
17094
17095 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
17096
17097 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
17098
17099 EnableTCPReset *bool `json:"enableTcpReset,omitempty"`
17100
17101 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
17102 }
17103
17104
17105 func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) {
17106 objectMap := make(map[string]interface{})
17107 if inrpf.FrontendIPConfiguration != nil {
17108 objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration
17109 }
17110 if inrpf.Protocol != "" {
17111 objectMap["protocol"] = inrpf.Protocol
17112 }
17113 if inrpf.FrontendPort != nil {
17114 objectMap["frontendPort"] = inrpf.FrontendPort
17115 }
17116 if inrpf.BackendPort != nil {
17117 objectMap["backendPort"] = inrpf.BackendPort
17118 }
17119 if inrpf.IdleTimeoutInMinutes != nil {
17120 objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes
17121 }
17122 if inrpf.EnableFloatingIP != nil {
17123 objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP
17124 }
17125 if inrpf.EnableTCPReset != nil {
17126 objectMap["enableTcpReset"] = inrpf.EnableTCPReset
17127 }
17128 return json.Marshal(objectMap)
17129 }
17130
17131
17132
17133 type InboundNatRulesCreateOrUpdateFuture struct {
17134 azure.FutureAPI
17135
17136
17137 Result func(InboundNatRulesClient) (InboundNatRule, error)
17138 }
17139
17140
17141 func (future *InboundNatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
17142 var azFuture azure.Future
17143 if err := json.Unmarshal(body, &azFuture); err != nil {
17144 return err
17145 }
17146 future.FutureAPI = &azFuture
17147 future.Result = future.result
17148 return nil
17149 }
17150
17151
17152 func (future *InboundNatRulesCreateOrUpdateFuture) result(client InboundNatRulesClient) (inr InboundNatRule, err error) {
17153 var done bool
17154 done, err = future.DoneWithContext(context.Background(), client)
17155 if err != nil {
17156 err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
17157 return
17158 }
17159 if !done {
17160 inr.Response.Response = future.Response()
17161 err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesCreateOrUpdateFuture")
17162 return
17163 }
17164 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
17165 if inr.Response.Response, err = future.GetResult(sender); err == nil && inr.Response.Response.StatusCode != http.StatusNoContent {
17166 inr, err = client.CreateOrUpdateResponder(inr.Response.Response)
17167 if err != nil {
17168 err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", inr.Response.Response, "Failure responding to request")
17169 }
17170 }
17171 return
17172 }
17173
17174
17175
17176 type InboundNatRulesDeleteFuture struct {
17177 azure.FutureAPI
17178
17179
17180 Result func(InboundNatRulesClient) (autorest.Response, error)
17181 }
17182
17183
17184 func (future *InboundNatRulesDeleteFuture) UnmarshalJSON(body []byte) error {
17185 var azFuture azure.Future
17186 if err := json.Unmarshal(body, &azFuture); err != nil {
17187 return err
17188 }
17189 future.FutureAPI = &azFuture
17190 future.Result = future.result
17191 return nil
17192 }
17193
17194
17195 func (future *InboundNatRulesDeleteFuture) result(client InboundNatRulesClient) (ar autorest.Response, err error) {
17196 var done bool
17197 done, err = future.DoneWithContext(context.Background(), client)
17198 if err != nil {
17199 err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", future.Response(), "Polling failure")
17200 return
17201 }
17202 if !done {
17203 ar.Response = future.Response()
17204 err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesDeleteFuture")
17205 return
17206 }
17207 ar.Response = future.Response()
17208 return
17209 }
17210
17211
17212 type IntentPolicy struct {
17213
17214 Etag *string `json:"etag,omitempty"`
17215
17216 ID *string `json:"id,omitempty"`
17217
17218 Name *string `json:"name,omitempty"`
17219
17220 Type *string `json:"type,omitempty"`
17221
17222 Location *string `json:"location,omitempty"`
17223
17224 Tags map[string]*string `json:"tags"`
17225 }
17226
17227
17228 func (IP IntentPolicy) MarshalJSON() ([]byte, error) {
17229 objectMap := make(map[string]interface{})
17230 if IP.ID != nil {
17231 objectMap["id"] = IP.ID
17232 }
17233 if IP.Location != nil {
17234 objectMap["location"] = IP.Location
17235 }
17236 if IP.Tags != nil {
17237 objectMap["tags"] = IP.Tags
17238 }
17239 return json.Marshal(objectMap)
17240 }
17241
17242
17243 type IntentPolicyConfiguration struct {
17244
17245 NetworkIntentPolicyName *string `json:"networkIntentPolicyName,omitempty"`
17246
17247 SourceNetworkIntentPolicy *IntentPolicy `json:"sourceNetworkIntentPolicy,omitempty"`
17248 }
17249
17250
17251 type Interface struct {
17252 autorest.Response `json:"-"`
17253
17254 *InterfacePropertiesFormat `json:"properties,omitempty"`
17255
17256 Etag *string `json:"etag,omitempty"`
17257
17258 ID *string `json:"id,omitempty"`
17259
17260 Name *string `json:"name,omitempty"`
17261
17262 Type *string `json:"type,omitempty"`
17263
17264 Location *string `json:"location,omitempty"`
17265
17266 Tags map[string]*string `json:"tags"`
17267 }
17268
17269
17270 func (i Interface) MarshalJSON() ([]byte, error) {
17271 objectMap := make(map[string]interface{})
17272 if i.InterfacePropertiesFormat != nil {
17273 objectMap["properties"] = i.InterfacePropertiesFormat
17274 }
17275 if i.ID != nil {
17276 objectMap["id"] = i.ID
17277 }
17278 if i.Location != nil {
17279 objectMap["location"] = i.Location
17280 }
17281 if i.Tags != nil {
17282 objectMap["tags"] = i.Tags
17283 }
17284 return json.Marshal(objectMap)
17285 }
17286
17287
17288 func (i *Interface) UnmarshalJSON(body []byte) error {
17289 var m map[string]*json.RawMessage
17290 err := json.Unmarshal(body, &m)
17291 if err != nil {
17292 return err
17293 }
17294 for k, v := range m {
17295 switch k {
17296 case "properties":
17297 if v != nil {
17298 var interfacePropertiesFormat InterfacePropertiesFormat
17299 err = json.Unmarshal(*v, &interfacePropertiesFormat)
17300 if err != nil {
17301 return err
17302 }
17303 i.InterfacePropertiesFormat = &interfacePropertiesFormat
17304 }
17305 case "etag":
17306 if v != nil {
17307 var etag string
17308 err = json.Unmarshal(*v, &etag)
17309 if err != nil {
17310 return err
17311 }
17312 i.Etag = &etag
17313 }
17314 case "id":
17315 if v != nil {
17316 var ID string
17317 err = json.Unmarshal(*v, &ID)
17318 if err != nil {
17319 return err
17320 }
17321 i.ID = &ID
17322 }
17323 case "name":
17324 if v != nil {
17325 var name string
17326 err = json.Unmarshal(*v, &name)
17327 if err != nil {
17328 return err
17329 }
17330 i.Name = &name
17331 }
17332 case "type":
17333 if v != nil {
17334 var typeVar string
17335 err = json.Unmarshal(*v, &typeVar)
17336 if err != nil {
17337 return err
17338 }
17339 i.Type = &typeVar
17340 }
17341 case "location":
17342 if v != nil {
17343 var location string
17344 err = json.Unmarshal(*v, &location)
17345 if err != nil {
17346 return err
17347 }
17348 i.Location = &location
17349 }
17350 case "tags":
17351 if v != nil {
17352 var tags map[string]*string
17353 err = json.Unmarshal(*v, &tags)
17354 if err != nil {
17355 return err
17356 }
17357 i.Tags = tags
17358 }
17359 }
17360 }
17361
17362 return nil
17363 }
17364
17365
17366 type InterfaceAssociation struct {
17367
17368 ID *string `json:"id,omitempty"`
17369
17370 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
17371 }
17372
17373
17374 func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) {
17375 objectMap := make(map[string]interface{})
17376 if ia.SecurityRules != nil {
17377 objectMap["securityRules"] = ia.SecurityRules
17378 }
17379 return json.Marshal(objectMap)
17380 }
17381
17382
17383 type InterfaceDNSSettings struct {
17384
17385 DNSServers *[]string `json:"dnsServers,omitempty"`
17386
17387 AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"`
17388
17389 InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"`
17390
17391 InternalFqdn *string `json:"internalFqdn,omitempty"`
17392
17393 InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"`
17394 }
17395
17396
17397 func (ids InterfaceDNSSettings) MarshalJSON() ([]byte, error) {
17398 objectMap := make(map[string]interface{})
17399 if ids.DNSServers != nil {
17400 objectMap["dnsServers"] = ids.DNSServers
17401 }
17402 if ids.InternalDNSNameLabel != nil {
17403 objectMap["internalDnsNameLabel"] = ids.InternalDNSNameLabel
17404 }
17405 return json.Marshal(objectMap)
17406 }
17407
17408
17409 type InterfaceIPConfiguration struct {
17410 autorest.Response `json:"-"`
17411
17412 *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"`
17413
17414 Name *string `json:"name,omitempty"`
17415
17416 Etag *string `json:"etag,omitempty"`
17417
17418 ID *string `json:"id,omitempty"`
17419 }
17420
17421
17422 func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) {
17423 objectMap := make(map[string]interface{})
17424 if iic.InterfaceIPConfigurationPropertiesFormat != nil {
17425 objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat
17426 }
17427 if iic.Name != nil {
17428 objectMap["name"] = iic.Name
17429 }
17430 if iic.ID != nil {
17431 objectMap["id"] = iic.ID
17432 }
17433 return json.Marshal(objectMap)
17434 }
17435
17436
17437 func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error {
17438 var m map[string]*json.RawMessage
17439 err := json.Unmarshal(body, &m)
17440 if err != nil {
17441 return err
17442 }
17443 for k, v := range m {
17444 switch k {
17445 case "properties":
17446 if v != nil {
17447 var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat
17448 err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat)
17449 if err != nil {
17450 return err
17451 }
17452 iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat
17453 }
17454 case "name":
17455 if v != nil {
17456 var name string
17457 err = json.Unmarshal(*v, &name)
17458 if err != nil {
17459 return err
17460 }
17461 iic.Name = &name
17462 }
17463 case "etag":
17464 if v != nil {
17465 var etag string
17466 err = json.Unmarshal(*v, &etag)
17467 if err != nil {
17468 return err
17469 }
17470 iic.Etag = &etag
17471 }
17472 case "id":
17473 if v != nil {
17474 var ID string
17475 err = json.Unmarshal(*v, &ID)
17476 if err != nil {
17477 return err
17478 }
17479 iic.ID = &ID
17480 }
17481 }
17482 }
17483
17484 return nil
17485 }
17486
17487
17488 type InterfaceIPConfigurationListResult struct {
17489 autorest.Response `json:"-"`
17490
17491 Value *[]InterfaceIPConfiguration `json:"value,omitempty"`
17492
17493 NextLink *string `json:"nextLink,omitempty"`
17494 }
17495
17496
17497 func (iiclr InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) {
17498 objectMap := make(map[string]interface{})
17499 if iiclr.Value != nil {
17500 objectMap["value"] = iiclr.Value
17501 }
17502 return json.Marshal(objectMap)
17503 }
17504
17505
17506
17507 type InterfaceIPConfigurationListResultIterator struct {
17508 i int
17509 page InterfaceIPConfigurationListResultPage
17510 }
17511
17512
17513
17514 func (iter *InterfaceIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) {
17515 if tracing.IsEnabled() {
17516 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultIterator.NextWithContext")
17517 defer func() {
17518 sc := -1
17519 if iter.Response().Response.Response != nil {
17520 sc = iter.Response().Response.Response.StatusCode
17521 }
17522 tracing.EndSpan(ctx, sc, err)
17523 }()
17524 }
17525 iter.i++
17526 if iter.i < len(iter.page.Values()) {
17527 return nil
17528 }
17529 err = iter.page.NextWithContext(ctx)
17530 if err != nil {
17531 iter.i--
17532 return err
17533 }
17534 iter.i = 0
17535 return nil
17536 }
17537
17538
17539
17540
17541 func (iter *InterfaceIPConfigurationListResultIterator) Next() error {
17542 return iter.NextWithContext(context.Background())
17543 }
17544
17545
17546 func (iter InterfaceIPConfigurationListResultIterator) NotDone() bool {
17547 return iter.page.NotDone() && iter.i < len(iter.page.Values())
17548 }
17549
17550
17551 func (iter InterfaceIPConfigurationListResultIterator) Response() InterfaceIPConfigurationListResult {
17552 return iter.page.Response()
17553 }
17554
17555
17556
17557 func (iter InterfaceIPConfigurationListResultIterator) Value() InterfaceIPConfiguration {
17558 if !iter.page.NotDone() {
17559 return InterfaceIPConfiguration{}
17560 }
17561 return iter.page.Values()[iter.i]
17562 }
17563
17564
17565 func NewInterfaceIPConfigurationListResultIterator(page InterfaceIPConfigurationListResultPage) InterfaceIPConfigurationListResultIterator {
17566 return InterfaceIPConfigurationListResultIterator{page: page}
17567 }
17568
17569
17570 func (iiclr InterfaceIPConfigurationListResult) IsEmpty() bool {
17571 return iiclr.Value == nil || len(*iiclr.Value) == 0
17572 }
17573
17574
17575 func (iiclr InterfaceIPConfigurationListResult) hasNextLink() bool {
17576 return iiclr.NextLink != nil && len(*iiclr.NextLink) != 0
17577 }
17578
17579
17580
17581 func (iiclr InterfaceIPConfigurationListResult) interfaceIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) {
17582 if !iiclr.hasNextLink() {
17583 return nil, nil
17584 }
17585 return autorest.Prepare((&http.Request{}).WithContext(ctx),
17586 autorest.AsJSON(),
17587 autorest.AsGet(),
17588 autorest.WithBaseURL(to.String(iiclr.NextLink)))
17589 }
17590
17591
17592 type InterfaceIPConfigurationListResultPage struct {
17593 fn func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error)
17594 iiclr InterfaceIPConfigurationListResult
17595 }
17596
17597
17598
17599 func (page *InterfaceIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) {
17600 if tracing.IsEnabled() {
17601 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultPage.NextWithContext")
17602 defer func() {
17603 sc := -1
17604 if page.Response().Response.Response != nil {
17605 sc = page.Response().Response.Response.StatusCode
17606 }
17607 tracing.EndSpan(ctx, sc, err)
17608 }()
17609 }
17610 for {
17611 next, err := page.fn(ctx, page.iiclr)
17612 if err != nil {
17613 return err
17614 }
17615 page.iiclr = next
17616 if !next.hasNextLink() || !next.IsEmpty() {
17617 break
17618 }
17619 }
17620 return nil
17621 }
17622
17623
17624
17625
17626 func (page *InterfaceIPConfigurationListResultPage) Next() error {
17627 return page.NextWithContext(context.Background())
17628 }
17629
17630
17631 func (page InterfaceIPConfigurationListResultPage) NotDone() bool {
17632 return !page.iiclr.IsEmpty()
17633 }
17634
17635
17636 func (page InterfaceIPConfigurationListResultPage) Response() InterfaceIPConfigurationListResult {
17637 return page.iiclr
17638 }
17639
17640
17641 func (page InterfaceIPConfigurationListResultPage) Values() []InterfaceIPConfiguration {
17642 if page.iiclr.IsEmpty() {
17643 return nil
17644 }
17645 return *page.iiclr.Value
17646 }
17647
17648
17649 func NewInterfaceIPConfigurationListResultPage(cur InterfaceIPConfigurationListResult, getNextPage func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error)) InterfaceIPConfigurationListResultPage {
17650 return InterfaceIPConfigurationListResultPage{
17651 fn: getNextPage,
17652 iiclr: cur,
17653 }
17654 }
17655
17656
17657
17658 type InterfaceIPConfigurationPrivateLinkConnectionProperties struct {
17659
17660 GroupID *string `json:"groupId,omitempty"`
17661
17662 RequiredMemberName *string `json:"requiredMemberName,omitempty"`
17663
17664 Fqdns *[]string `json:"fqdns,omitempty"`
17665 }
17666
17667
17668 func (iicplcp InterfaceIPConfigurationPrivateLinkConnectionProperties) MarshalJSON() ([]byte, error) {
17669 objectMap := make(map[string]interface{})
17670 return json.Marshal(objectMap)
17671 }
17672
17673
17674 type InterfaceIPConfigurationPropertiesFormat struct {
17675
17676 VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"`
17677
17678 ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"`
17679
17680 LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"`
17681
17682 LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"`
17683
17684 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
17685
17686 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
17687
17688 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
17689
17690 Subnet *Subnet `json:"subnet,omitempty"`
17691
17692 Primary *bool `json:"primary,omitempty"`
17693
17694 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
17695
17696 ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"`
17697
17698 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
17699
17700 PrivateLinkConnectionProperties *InterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"`
17701 }
17702
17703
17704 func (iicpf InterfaceIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
17705 objectMap := make(map[string]interface{})
17706 if iicpf.VirtualNetworkTaps != nil {
17707 objectMap["virtualNetworkTaps"] = iicpf.VirtualNetworkTaps
17708 }
17709 if iicpf.ApplicationGatewayBackendAddressPools != nil {
17710 objectMap["applicationGatewayBackendAddressPools"] = iicpf.ApplicationGatewayBackendAddressPools
17711 }
17712 if iicpf.LoadBalancerBackendAddressPools != nil {
17713 objectMap["loadBalancerBackendAddressPools"] = iicpf.LoadBalancerBackendAddressPools
17714 }
17715 if iicpf.LoadBalancerInboundNatRules != nil {
17716 objectMap["loadBalancerInboundNatRules"] = iicpf.LoadBalancerInboundNatRules
17717 }
17718 if iicpf.PrivateIPAddress != nil {
17719 objectMap["privateIPAddress"] = iicpf.PrivateIPAddress
17720 }
17721 if iicpf.PrivateIPAllocationMethod != "" {
17722 objectMap["privateIPAllocationMethod"] = iicpf.PrivateIPAllocationMethod
17723 }
17724 if iicpf.PrivateIPAddressVersion != "" {
17725 objectMap["privateIPAddressVersion"] = iicpf.PrivateIPAddressVersion
17726 }
17727 if iicpf.Subnet != nil {
17728 objectMap["subnet"] = iicpf.Subnet
17729 }
17730 if iicpf.Primary != nil {
17731 objectMap["primary"] = iicpf.Primary
17732 }
17733 if iicpf.PublicIPAddress != nil {
17734 objectMap["publicIPAddress"] = iicpf.PublicIPAddress
17735 }
17736 if iicpf.ApplicationSecurityGroups != nil {
17737 objectMap["applicationSecurityGroups"] = iicpf.ApplicationSecurityGroups
17738 }
17739 return json.Marshal(objectMap)
17740 }
17741
17742
17743 type InterfaceListResult struct {
17744 autorest.Response `json:"-"`
17745
17746 Value *[]Interface `json:"value,omitempty"`
17747
17748 NextLink *string `json:"nextLink,omitempty"`
17749 }
17750
17751
17752 func (ilr InterfaceListResult) MarshalJSON() ([]byte, error) {
17753 objectMap := make(map[string]interface{})
17754 if ilr.Value != nil {
17755 objectMap["value"] = ilr.Value
17756 }
17757 return json.Marshal(objectMap)
17758 }
17759
17760
17761 type InterfaceListResultIterator struct {
17762 i int
17763 page InterfaceListResultPage
17764 }
17765
17766
17767
17768 func (iter *InterfaceListResultIterator) NextWithContext(ctx context.Context) (err error) {
17769 if tracing.IsEnabled() {
17770 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultIterator.NextWithContext")
17771 defer func() {
17772 sc := -1
17773 if iter.Response().Response.Response != nil {
17774 sc = iter.Response().Response.Response.StatusCode
17775 }
17776 tracing.EndSpan(ctx, sc, err)
17777 }()
17778 }
17779 iter.i++
17780 if iter.i < len(iter.page.Values()) {
17781 return nil
17782 }
17783 err = iter.page.NextWithContext(ctx)
17784 if err != nil {
17785 iter.i--
17786 return err
17787 }
17788 iter.i = 0
17789 return nil
17790 }
17791
17792
17793
17794
17795 func (iter *InterfaceListResultIterator) Next() error {
17796 return iter.NextWithContext(context.Background())
17797 }
17798
17799
17800 func (iter InterfaceListResultIterator) NotDone() bool {
17801 return iter.page.NotDone() && iter.i < len(iter.page.Values())
17802 }
17803
17804
17805 func (iter InterfaceListResultIterator) Response() InterfaceListResult {
17806 return iter.page.Response()
17807 }
17808
17809
17810
17811 func (iter InterfaceListResultIterator) Value() Interface {
17812 if !iter.page.NotDone() {
17813 return Interface{}
17814 }
17815 return iter.page.Values()[iter.i]
17816 }
17817
17818
17819 func NewInterfaceListResultIterator(page InterfaceListResultPage) InterfaceListResultIterator {
17820 return InterfaceListResultIterator{page: page}
17821 }
17822
17823
17824 func (ilr InterfaceListResult) IsEmpty() bool {
17825 return ilr.Value == nil || len(*ilr.Value) == 0
17826 }
17827
17828
17829 func (ilr InterfaceListResult) hasNextLink() bool {
17830 return ilr.NextLink != nil && len(*ilr.NextLink) != 0
17831 }
17832
17833
17834
17835 func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) {
17836 if !ilr.hasNextLink() {
17837 return nil, nil
17838 }
17839 return autorest.Prepare((&http.Request{}).WithContext(ctx),
17840 autorest.AsJSON(),
17841 autorest.AsGet(),
17842 autorest.WithBaseURL(to.String(ilr.NextLink)))
17843 }
17844
17845
17846 type InterfaceListResultPage struct {
17847 fn func(context.Context, InterfaceListResult) (InterfaceListResult, error)
17848 ilr InterfaceListResult
17849 }
17850
17851
17852
17853 func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err error) {
17854 if tracing.IsEnabled() {
17855 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultPage.NextWithContext")
17856 defer func() {
17857 sc := -1
17858 if page.Response().Response.Response != nil {
17859 sc = page.Response().Response.Response.StatusCode
17860 }
17861 tracing.EndSpan(ctx, sc, err)
17862 }()
17863 }
17864 for {
17865 next, err := page.fn(ctx, page.ilr)
17866 if err != nil {
17867 return err
17868 }
17869 page.ilr = next
17870 if !next.hasNextLink() || !next.IsEmpty() {
17871 break
17872 }
17873 }
17874 return nil
17875 }
17876
17877
17878
17879
17880 func (page *InterfaceListResultPage) Next() error {
17881 return page.NextWithContext(context.Background())
17882 }
17883
17884
17885 func (page InterfaceListResultPage) NotDone() bool {
17886 return !page.ilr.IsEmpty()
17887 }
17888
17889
17890 func (page InterfaceListResultPage) Response() InterfaceListResult {
17891 return page.ilr
17892 }
17893
17894
17895 func (page InterfaceListResultPage) Values() []Interface {
17896 if page.ilr.IsEmpty() {
17897 return nil
17898 }
17899 return *page.ilr.Value
17900 }
17901
17902
17903 func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage {
17904 return InterfaceListResultPage{
17905 fn: getNextPage,
17906 ilr: cur,
17907 }
17908 }
17909
17910
17911 type InterfaceLoadBalancerListResult struct {
17912 autorest.Response `json:"-"`
17913
17914 Value *[]LoadBalancer `json:"value,omitempty"`
17915
17916 NextLink *string `json:"nextLink,omitempty"`
17917 }
17918
17919
17920 func (ilblr InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) {
17921 objectMap := make(map[string]interface{})
17922 if ilblr.Value != nil {
17923 objectMap["value"] = ilblr.Value
17924 }
17925 return json.Marshal(objectMap)
17926 }
17927
17928
17929 type InterfaceLoadBalancerListResultIterator struct {
17930 i int
17931 page InterfaceLoadBalancerListResultPage
17932 }
17933
17934
17935
17936 func (iter *InterfaceLoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) {
17937 if tracing.IsEnabled() {
17938 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultIterator.NextWithContext")
17939 defer func() {
17940 sc := -1
17941 if iter.Response().Response.Response != nil {
17942 sc = iter.Response().Response.Response.StatusCode
17943 }
17944 tracing.EndSpan(ctx, sc, err)
17945 }()
17946 }
17947 iter.i++
17948 if iter.i < len(iter.page.Values()) {
17949 return nil
17950 }
17951 err = iter.page.NextWithContext(ctx)
17952 if err != nil {
17953 iter.i--
17954 return err
17955 }
17956 iter.i = 0
17957 return nil
17958 }
17959
17960
17961
17962
17963 func (iter *InterfaceLoadBalancerListResultIterator) Next() error {
17964 return iter.NextWithContext(context.Background())
17965 }
17966
17967
17968 func (iter InterfaceLoadBalancerListResultIterator) NotDone() bool {
17969 return iter.page.NotDone() && iter.i < len(iter.page.Values())
17970 }
17971
17972
17973 func (iter InterfaceLoadBalancerListResultIterator) Response() InterfaceLoadBalancerListResult {
17974 return iter.page.Response()
17975 }
17976
17977
17978
17979 func (iter InterfaceLoadBalancerListResultIterator) Value() LoadBalancer {
17980 if !iter.page.NotDone() {
17981 return LoadBalancer{}
17982 }
17983 return iter.page.Values()[iter.i]
17984 }
17985
17986
17987 func NewInterfaceLoadBalancerListResultIterator(page InterfaceLoadBalancerListResultPage) InterfaceLoadBalancerListResultIterator {
17988 return InterfaceLoadBalancerListResultIterator{page: page}
17989 }
17990
17991
17992 func (ilblr InterfaceLoadBalancerListResult) IsEmpty() bool {
17993 return ilblr.Value == nil || len(*ilblr.Value) == 0
17994 }
17995
17996
17997 func (ilblr InterfaceLoadBalancerListResult) hasNextLink() bool {
17998 return ilblr.NextLink != nil && len(*ilblr.NextLink) != 0
17999 }
18000
18001
18002
18003 func (ilblr InterfaceLoadBalancerListResult) interfaceLoadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) {
18004 if !ilblr.hasNextLink() {
18005 return nil, nil
18006 }
18007 return autorest.Prepare((&http.Request{}).WithContext(ctx),
18008 autorest.AsJSON(),
18009 autorest.AsGet(),
18010 autorest.WithBaseURL(to.String(ilblr.NextLink)))
18011 }
18012
18013
18014 type InterfaceLoadBalancerListResultPage struct {
18015 fn func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error)
18016 ilblr InterfaceLoadBalancerListResult
18017 }
18018
18019
18020
18021 func (page *InterfaceLoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) {
18022 if tracing.IsEnabled() {
18023 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultPage.NextWithContext")
18024 defer func() {
18025 sc := -1
18026 if page.Response().Response.Response != nil {
18027 sc = page.Response().Response.Response.StatusCode
18028 }
18029 tracing.EndSpan(ctx, sc, err)
18030 }()
18031 }
18032 for {
18033 next, err := page.fn(ctx, page.ilblr)
18034 if err != nil {
18035 return err
18036 }
18037 page.ilblr = next
18038 if !next.hasNextLink() || !next.IsEmpty() {
18039 break
18040 }
18041 }
18042 return nil
18043 }
18044
18045
18046
18047
18048 func (page *InterfaceLoadBalancerListResultPage) Next() error {
18049 return page.NextWithContext(context.Background())
18050 }
18051
18052
18053 func (page InterfaceLoadBalancerListResultPage) NotDone() bool {
18054 return !page.ilblr.IsEmpty()
18055 }
18056
18057
18058 func (page InterfaceLoadBalancerListResultPage) Response() InterfaceLoadBalancerListResult {
18059 return page.ilblr
18060 }
18061
18062
18063 func (page InterfaceLoadBalancerListResultPage) Values() []LoadBalancer {
18064 if page.ilblr.IsEmpty() {
18065 return nil
18066 }
18067 return *page.ilblr.Value
18068 }
18069
18070
18071 func NewInterfaceLoadBalancerListResultPage(cur InterfaceLoadBalancerListResult, getNextPage func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error)) InterfaceLoadBalancerListResultPage {
18072 return InterfaceLoadBalancerListResultPage{
18073 fn: getNextPage,
18074 ilblr: cur,
18075 }
18076 }
18077
18078
18079 type InterfacePropertiesFormat struct {
18080
18081 VirtualMachine *SubResource `json:"virtualMachine,omitempty"`
18082
18083 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
18084
18085 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
18086
18087 IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"`
18088
18089 TapConfigurations *[]InterfaceTapConfiguration `json:"tapConfigurations,omitempty"`
18090
18091 DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"`
18092
18093 MacAddress *string `json:"macAddress,omitempty"`
18094
18095 Primary *bool `json:"primary,omitempty"`
18096
18097 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"`
18098
18099 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"`
18100
18101 HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"`
18102
18103 ResourceGUID *string `json:"resourceGuid,omitempty"`
18104
18105 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
18106 }
18107
18108
18109 func (ipf InterfacePropertiesFormat) MarshalJSON() ([]byte, error) {
18110 objectMap := make(map[string]interface{})
18111 if ipf.NetworkSecurityGroup != nil {
18112 objectMap["networkSecurityGroup"] = ipf.NetworkSecurityGroup
18113 }
18114 if ipf.IPConfigurations != nil {
18115 objectMap["ipConfigurations"] = ipf.IPConfigurations
18116 }
18117 if ipf.DNSSettings != nil {
18118 objectMap["dnsSettings"] = ipf.DNSSettings
18119 }
18120 if ipf.EnableAcceleratedNetworking != nil {
18121 objectMap["enableAcceleratedNetworking"] = ipf.EnableAcceleratedNetworking
18122 }
18123 if ipf.EnableIPForwarding != nil {
18124 objectMap["enableIPForwarding"] = ipf.EnableIPForwarding
18125 }
18126 return json.Marshal(objectMap)
18127 }
18128
18129
18130
18131 type InterfacesCreateOrUpdateFuture struct {
18132 azure.FutureAPI
18133
18134
18135 Result func(InterfacesClient) (Interface, error)
18136 }
18137
18138
18139 func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18140 var azFuture azure.Future
18141 if err := json.Unmarshal(body, &azFuture); err != nil {
18142 return err
18143 }
18144 future.FutureAPI = &azFuture
18145 future.Result = future.result
18146 return nil
18147 }
18148
18149
18150 func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) {
18151 var done bool
18152 done, err = future.DoneWithContext(context.Background(), client)
18153 if err != nil {
18154 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18155 return
18156 }
18157 if !done {
18158 i.Response.Response = future.Response()
18159 err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture")
18160 return
18161 }
18162 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18163 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
18164 i, err = client.CreateOrUpdateResponder(i.Response.Response)
18165 if err != nil {
18166 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
18167 }
18168 }
18169 return
18170 }
18171
18172
18173
18174 type InterfacesDeleteFuture struct {
18175 azure.FutureAPI
18176
18177
18178 Result func(InterfacesClient) (autorest.Response, error)
18179 }
18180
18181
18182 func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error {
18183 var azFuture azure.Future
18184 if err := json.Unmarshal(body, &azFuture); err != nil {
18185 return err
18186 }
18187 future.FutureAPI = &azFuture
18188 future.Result = future.result
18189 return nil
18190 }
18191
18192
18193 func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) {
18194 var done bool
18195 done, err = future.DoneWithContext(context.Background(), client)
18196 if err != nil {
18197 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure")
18198 return
18199 }
18200 if !done {
18201 ar.Response = future.Response()
18202 err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture")
18203 return
18204 }
18205 ar.Response = future.Response()
18206 return
18207 }
18208
18209
18210
18211 type InterfacesGetEffectiveRouteTableFuture struct {
18212 azure.FutureAPI
18213
18214
18215 Result func(InterfacesClient) (EffectiveRouteListResult, error)
18216 }
18217
18218
18219 func (future *InterfacesGetEffectiveRouteTableFuture) UnmarshalJSON(body []byte) error {
18220 var azFuture azure.Future
18221 if err := json.Unmarshal(body, &azFuture); err != nil {
18222 return err
18223 }
18224 future.FutureAPI = &azFuture
18225 future.Result = future.result
18226 return nil
18227 }
18228
18229
18230 func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) {
18231 var done bool
18232 done, err = future.DoneWithContext(context.Background(), client)
18233 if err != nil {
18234 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure")
18235 return
18236 }
18237 if !done {
18238 erlr.Response.Response = future.Response()
18239 err = azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture")
18240 return
18241 }
18242 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18243 if erlr.Response.Response, err = future.GetResult(sender); err == nil && erlr.Response.Response.StatusCode != http.StatusNoContent {
18244 erlr, err = client.GetEffectiveRouteTableResponder(erlr.Response.Response)
18245 if err != nil {
18246 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", erlr.Response.Response, "Failure responding to request")
18247 }
18248 }
18249 return
18250 }
18251
18252
18253
18254 type InterfacesListEffectiveNetworkSecurityGroupsFuture struct {
18255 azure.FutureAPI
18256
18257
18258 Result func(InterfacesClient) (EffectiveNetworkSecurityGroupListResult, error)
18259 }
18260
18261
18262 func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) UnmarshalJSON(body []byte) error {
18263 var azFuture azure.Future
18264 if err := json.Unmarshal(body, &azFuture); err != nil {
18265 return err
18266 }
18267 future.FutureAPI = &azFuture
18268 future.Result = future.result
18269 return nil
18270 }
18271
18272
18273 func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) {
18274 var done bool
18275 done, err = future.DoneWithContext(context.Background(), client)
18276 if err != nil {
18277 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure")
18278 return
18279 }
18280 if !done {
18281 ensglr.Response.Response = future.Response()
18282 err = azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture")
18283 return
18284 }
18285 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18286 if ensglr.Response.Response, err = future.GetResult(sender); err == nil && ensglr.Response.Response.StatusCode != http.StatusNoContent {
18287 ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(ensglr.Response.Response)
18288 if err != nil {
18289 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", ensglr.Response.Response, "Failure responding to request")
18290 }
18291 }
18292 return
18293 }
18294
18295
18296 type InterfaceTapConfiguration struct {
18297 autorest.Response `json:"-"`
18298
18299 *InterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"`
18300
18301 Name *string `json:"name,omitempty"`
18302
18303 Etag *string `json:"etag,omitempty"`
18304
18305 Type *string `json:"type,omitempty"`
18306
18307 ID *string `json:"id,omitempty"`
18308 }
18309
18310
18311 func (itc InterfaceTapConfiguration) MarshalJSON() ([]byte, error) {
18312 objectMap := make(map[string]interface{})
18313 if itc.InterfaceTapConfigurationPropertiesFormat != nil {
18314 objectMap["properties"] = itc.InterfaceTapConfigurationPropertiesFormat
18315 }
18316 if itc.Name != nil {
18317 objectMap["name"] = itc.Name
18318 }
18319 if itc.ID != nil {
18320 objectMap["id"] = itc.ID
18321 }
18322 return json.Marshal(objectMap)
18323 }
18324
18325
18326 func (itc *InterfaceTapConfiguration) UnmarshalJSON(body []byte) error {
18327 var m map[string]*json.RawMessage
18328 err := json.Unmarshal(body, &m)
18329 if err != nil {
18330 return err
18331 }
18332 for k, v := range m {
18333 switch k {
18334 case "properties":
18335 if v != nil {
18336 var interfaceTapConfigurationPropertiesFormat InterfaceTapConfigurationPropertiesFormat
18337 err = json.Unmarshal(*v, &interfaceTapConfigurationPropertiesFormat)
18338 if err != nil {
18339 return err
18340 }
18341 itc.InterfaceTapConfigurationPropertiesFormat = &interfaceTapConfigurationPropertiesFormat
18342 }
18343 case "name":
18344 if v != nil {
18345 var name string
18346 err = json.Unmarshal(*v, &name)
18347 if err != nil {
18348 return err
18349 }
18350 itc.Name = &name
18351 }
18352 case "etag":
18353 if v != nil {
18354 var etag string
18355 err = json.Unmarshal(*v, &etag)
18356 if err != nil {
18357 return err
18358 }
18359 itc.Etag = &etag
18360 }
18361 case "type":
18362 if v != nil {
18363 var typeVar string
18364 err = json.Unmarshal(*v, &typeVar)
18365 if err != nil {
18366 return err
18367 }
18368 itc.Type = &typeVar
18369 }
18370 case "id":
18371 if v != nil {
18372 var ID string
18373 err = json.Unmarshal(*v, &ID)
18374 if err != nil {
18375 return err
18376 }
18377 itc.ID = &ID
18378 }
18379 }
18380 }
18381
18382 return nil
18383 }
18384
18385
18386 type InterfaceTapConfigurationListResult struct {
18387 autorest.Response `json:"-"`
18388
18389 Value *[]InterfaceTapConfiguration `json:"value,omitempty"`
18390
18391 NextLink *string `json:"nextLink,omitempty"`
18392 }
18393
18394
18395 func (itclr InterfaceTapConfigurationListResult) MarshalJSON() ([]byte, error) {
18396 objectMap := make(map[string]interface{})
18397 if itclr.Value != nil {
18398 objectMap["value"] = itclr.Value
18399 }
18400 return json.Marshal(objectMap)
18401 }
18402
18403
18404
18405 type InterfaceTapConfigurationListResultIterator struct {
18406 i int
18407 page InterfaceTapConfigurationListResultPage
18408 }
18409
18410
18411
18412 func (iter *InterfaceTapConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) {
18413 if tracing.IsEnabled() {
18414 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationListResultIterator.NextWithContext")
18415 defer func() {
18416 sc := -1
18417 if iter.Response().Response.Response != nil {
18418 sc = iter.Response().Response.Response.StatusCode
18419 }
18420 tracing.EndSpan(ctx, sc, err)
18421 }()
18422 }
18423 iter.i++
18424 if iter.i < len(iter.page.Values()) {
18425 return nil
18426 }
18427 err = iter.page.NextWithContext(ctx)
18428 if err != nil {
18429 iter.i--
18430 return err
18431 }
18432 iter.i = 0
18433 return nil
18434 }
18435
18436
18437
18438
18439 func (iter *InterfaceTapConfigurationListResultIterator) Next() error {
18440 return iter.NextWithContext(context.Background())
18441 }
18442
18443
18444 func (iter InterfaceTapConfigurationListResultIterator) NotDone() bool {
18445 return iter.page.NotDone() && iter.i < len(iter.page.Values())
18446 }
18447
18448
18449 func (iter InterfaceTapConfigurationListResultIterator) Response() InterfaceTapConfigurationListResult {
18450 return iter.page.Response()
18451 }
18452
18453
18454
18455 func (iter InterfaceTapConfigurationListResultIterator) Value() InterfaceTapConfiguration {
18456 if !iter.page.NotDone() {
18457 return InterfaceTapConfiguration{}
18458 }
18459 return iter.page.Values()[iter.i]
18460 }
18461
18462
18463 func NewInterfaceTapConfigurationListResultIterator(page InterfaceTapConfigurationListResultPage) InterfaceTapConfigurationListResultIterator {
18464 return InterfaceTapConfigurationListResultIterator{page: page}
18465 }
18466
18467
18468 func (itclr InterfaceTapConfigurationListResult) IsEmpty() bool {
18469 return itclr.Value == nil || len(*itclr.Value) == 0
18470 }
18471
18472
18473 func (itclr InterfaceTapConfigurationListResult) hasNextLink() bool {
18474 return itclr.NextLink != nil && len(*itclr.NextLink) != 0
18475 }
18476
18477
18478
18479 func (itclr InterfaceTapConfigurationListResult) interfaceTapConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) {
18480 if !itclr.hasNextLink() {
18481 return nil, nil
18482 }
18483 return autorest.Prepare((&http.Request{}).WithContext(ctx),
18484 autorest.AsJSON(),
18485 autorest.AsGet(),
18486 autorest.WithBaseURL(to.String(itclr.NextLink)))
18487 }
18488
18489
18490 type InterfaceTapConfigurationListResultPage struct {
18491 fn func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error)
18492 itclr InterfaceTapConfigurationListResult
18493 }
18494
18495
18496
18497 func (page *InterfaceTapConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) {
18498 if tracing.IsEnabled() {
18499 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceTapConfigurationListResultPage.NextWithContext")
18500 defer func() {
18501 sc := -1
18502 if page.Response().Response.Response != nil {
18503 sc = page.Response().Response.Response.StatusCode
18504 }
18505 tracing.EndSpan(ctx, sc, err)
18506 }()
18507 }
18508 for {
18509 next, err := page.fn(ctx, page.itclr)
18510 if err != nil {
18511 return err
18512 }
18513 page.itclr = next
18514 if !next.hasNextLink() || !next.IsEmpty() {
18515 break
18516 }
18517 }
18518 return nil
18519 }
18520
18521
18522
18523
18524 func (page *InterfaceTapConfigurationListResultPage) Next() error {
18525 return page.NextWithContext(context.Background())
18526 }
18527
18528
18529 func (page InterfaceTapConfigurationListResultPage) NotDone() bool {
18530 return !page.itclr.IsEmpty()
18531 }
18532
18533
18534 func (page InterfaceTapConfigurationListResultPage) Response() InterfaceTapConfigurationListResult {
18535 return page.itclr
18536 }
18537
18538
18539 func (page InterfaceTapConfigurationListResultPage) Values() []InterfaceTapConfiguration {
18540 if page.itclr.IsEmpty() {
18541 return nil
18542 }
18543 return *page.itclr.Value
18544 }
18545
18546
18547 func NewInterfaceTapConfigurationListResultPage(cur InterfaceTapConfigurationListResult, getNextPage func(context.Context, InterfaceTapConfigurationListResult) (InterfaceTapConfigurationListResult, error)) InterfaceTapConfigurationListResultPage {
18548 return InterfaceTapConfigurationListResultPage{
18549 fn: getNextPage,
18550 itclr: cur,
18551 }
18552 }
18553
18554
18555 type InterfaceTapConfigurationPropertiesFormat struct {
18556
18557 VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"`
18558
18559 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
18560 }
18561
18562
18563 func (itcpf InterfaceTapConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
18564 objectMap := make(map[string]interface{})
18565 if itcpf.VirtualNetworkTap != nil {
18566 objectMap["virtualNetworkTap"] = itcpf.VirtualNetworkTap
18567 }
18568 return json.Marshal(objectMap)
18569 }
18570
18571
18572
18573 type InterfaceTapConfigurationsCreateOrUpdateFuture struct {
18574 azure.FutureAPI
18575
18576
18577 Result func(InterfaceTapConfigurationsClient) (InterfaceTapConfiguration, error)
18578 }
18579
18580
18581 func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18582 var azFuture azure.Future
18583 if err := json.Unmarshal(body, &azFuture); err != nil {
18584 return err
18585 }
18586 future.FutureAPI = &azFuture
18587 future.Result = future.result
18588 return nil
18589 }
18590
18591
18592 func (future *InterfaceTapConfigurationsCreateOrUpdateFuture) result(client InterfaceTapConfigurationsClient) (itc InterfaceTapConfiguration, err error) {
18593 var done bool
18594 done, err = future.DoneWithContext(context.Background(), client)
18595 if err != nil {
18596 err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
18597 return
18598 }
18599 if !done {
18600 itc.Response.Response = future.Response()
18601 err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsCreateOrUpdateFuture")
18602 return
18603 }
18604 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
18605 if itc.Response.Response, err = future.GetResult(sender); err == nil && itc.Response.Response.StatusCode != http.StatusNoContent {
18606 itc, err = client.CreateOrUpdateResponder(itc.Response.Response)
18607 if err != nil {
18608 err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsCreateOrUpdateFuture", "Result", itc.Response.Response, "Failure responding to request")
18609 }
18610 }
18611 return
18612 }
18613
18614
18615
18616 type InterfaceTapConfigurationsDeleteFuture struct {
18617 azure.FutureAPI
18618
18619
18620 Result func(InterfaceTapConfigurationsClient) (autorest.Response, error)
18621 }
18622
18623
18624 func (future *InterfaceTapConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error {
18625 var azFuture azure.Future
18626 if err := json.Unmarshal(body, &azFuture); err != nil {
18627 return err
18628 }
18629 future.FutureAPI = &azFuture
18630 future.Result = future.result
18631 return nil
18632 }
18633
18634
18635 func (future *InterfaceTapConfigurationsDeleteFuture) result(client InterfaceTapConfigurationsClient) (ar autorest.Response, err error) {
18636 var done bool
18637 done, err = future.DoneWithContext(context.Background(), client)
18638 if err != nil {
18639 err = autorest.NewErrorWithError(err, "network.InterfaceTapConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure")
18640 return
18641 }
18642 if !done {
18643 ar.Response = future.Response()
18644 err = azure.NewAsyncOpIncompleteError("network.InterfaceTapConfigurationsDeleteFuture")
18645 return
18646 }
18647 ar.Response = future.Response()
18648 return
18649 }
18650
18651
18652 type IPAddressAvailabilityResult struct {
18653 autorest.Response `json:"-"`
18654
18655 Available *bool `json:"available,omitempty"`
18656
18657 AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"`
18658 }
18659
18660
18661 type IPAllocation struct {
18662 autorest.Response `json:"-"`
18663
18664 *IPAllocationPropertiesFormat `json:"properties,omitempty"`
18665
18666 Etag *string `json:"etag,omitempty"`
18667
18668 ID *string `json:"id,omitempty"`
18669
18670 Name *string `json:"name,omitempty"`
18671
18672 Type *string `json:"type,omitempty"`
18673
18674 Location *string `json:"location,omitempty"`
18675
18676 Tags map[string]*string `json:"tags"`
18677 }
18678
18679
18680 func (ia IPAllocation) MarshalJSON() ([]byte, error) {
18681 objectMap := make(map[string]interface{})
18682 if ia.IPAllocationPropertiesFormat != nil {
18683 objectMap["properties"] = ia.IPAllocationPropertiesFormat
18684 }
18685 if ia.ID != nil {
18686 objectMap["id"] = ia.ID
18687 }
18688 if ia.Location != nil {
18689 objectMap["location"] = ia.Location
18690 }
18691 if ia.Tags != nil {
18692 objectMap["tags"] = ia.Tags
18693 }
18694 return json.Marshal(objectMap)
18695 }
18696
18697
18698 func (ia *IPAllocation) UnmarshalJSON(body []byte) error {
18699 var m map[string]*json.RawMessage
18700 err := json.Unmarshal(body, &m)
18701 if err != nil {
18702 return err
18703 }
18704 for k, v := range m {
18705 switch k {
18706 case "properties":
18707 if v != nil {
18708 var IPAllocationPropertiesFormat IPAllocationPropertiesFormat
18709 err = json.Unmarshal(*v, &IPAllocationPropertiesFormat)
18710 if err != nil {
18711 return err
18712 }
18713 ia.IPAllocationPropertiesFormat = &IPAllocationPropertiesFormat
18714 }
18715 case "etag":
18716 if v != nil {
18717 var etag string
18718 err = json.Unmarshal(*v, &etag)
18719 if err != nil {
18720 return err
18721 }
18722 ia.Etag = &etag
18723 }
18724 case "id":
18725 if v != nil {
18726 var ID string
18727 err = json.Unmarshal(*v, &ID)
18728 if err != nil {
18729 return err
18730 }
18731 ia.ID = &ID
18732 }
18733 case "name":
18734 if v != nil {
18735 var name string
18736 err = json.Unmarshal(*v, &name)
18737 if err != nil {
18738 return err
18739 }
18740 ia.Name = &name
18741 }
18742 case "type":
18743 if v != nil {
18744 var typeVar string
18745 err = json.Unmarshal(*v, &typeVar)
18746 if err != nil {
18747 return err
18748 }
18749 ia.Type = &typeVar
18750 }
18751 case "location":
18752 if v != nil {
18753 var location string
18754 err = json.Unmarshal(*v, &location)
18755 if err != nil {
18756 return err
18757 }
18758 ia.Location = &location
18759 }
18760 case "tags":
18761 if v != nil {
18762 var tags map[string]*string
18763 err = json.Unmarshal(*v, &tags)
18764 if err != nil {
18765 return err
18766 }
18767 ia.Tags = tags
18768 }
18769 }
18770 }
18771
18772 return nil
18773 }
18774
18775
18776 type IPAllocationListResult struct {
18777 autorest.Response `json:"-"`
18778
18779 Value *[]IPAllocation `json:"value,omitempty"`
18780
18781 NextLink *string `json:"nextLink,omitempty"`
18782 }
18783
18784
18785 type IPAllocationListResultIterator struct {
18786 i int
18787 page IPAllocationListResultPage
18788 }
18789
18790
18791
18792 func (iter *IPAllocationListResultIterator) NextWithContext(ctx context.Context) (err error) {
18793 if tracing.IsEnabled() {
18794 ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationListResultIterator.NextWithContext")
18795 defer func() {
18796 sc := -1
18797 if iter.Response().Response.Response != nil {
18798 sc = iter.Response().Response.Response.StatusCode
18799 }
18800 tracing.EndSpan(ctx, sc, err)
18801 }()
18802 }
18803 iter.i++
18804 if iter.i < len(iter.page.Values()) {
18805 return nil
18806 }
18807 err = iter.page.NextWithContext(ctx)
18808 if err != nil {
18809 iter.i--
18810 return err
18811 }
18812 iter.i = 0
18813 return nil
18814 }
18815
18816
18817
18818
18819 func (iter *IPAllocationListResultIterator) Next() error {
18820 return iter.NextWithContext(context.Background())
18821 }
18822
18823
18824 func (iter IPAllocationListResultIterator) NotDone() bool {
18825 return iter.page.NotDone() && iter.i < len(iter.page.Values())
18826 }
18827
18828
18829 func (iter IPAllocationListResultIterator) Response() IPAllocationListResult {
18830 return iter.page.Response()
18831 }
18832
18833
18834
18835 func (iter IPAllocationListResultIterator) Value() IPAllocation {
18836 if !iter.page.NotDone() {
18837 return IPAllocation{}
18838 }
18839 return iter.page.Values()[iter.i]
18840 }
18841
18842
18843 func NewIPAllocationListResultIterator(page IPAllocationListResultPage) IPAllocationListResultIterator {
18844 return IPAllocationListResultIterator{page: page}
18845 }
18846
18847
18848 func (ialr IPAllocationListResult) IsEmpty() bool {
18849 return ialr.Value == nil || len(*ialr.Value) == 0
18850 }
18851
18852
18853 func (ialr IPAllocationListResult) hasNextLink() bool {
18854 return ialr.NextLink != nil && len(*ialr.NextLink) != 0
18855 }
18856
18857
18858
18859 func (ialr IPAllocationListResult) iPAllocationListResultPreparer(ctx context.Context) (*http.Request, error) {
18860 if !ialr.hasNextLink() {
18861 return nil, nil
18862 }
18863 return autorest.Prepare((&http.Request{}).WithContext(ctx),
18864 autorest.AsJSON(),
18865 autorest.AsGet(),
18866 autorest.WithBaseURL(to.String(ialr.NextLink)))
18867 }
18868
18869
18870 type IPAllocationListResultPage struct {
18871 fn func(context.Context, IPAllocationListResult) (IPAllocationListResult, error)
18872 ialr IPAllocationListResult
18873 }
18874
18875
18876
18877 func (page *IPAllocationListResultPage) NextWithContext(ctx context.Context) (err error) {
18878 if tracing.IsEnabled() {
18879 ctx = tracing.StartSpan(ctx, fqdn+"/IPAllocationListResultPage.NextWithContext")
18880 defer func() {
18881 sc := -1
18882 if page.Response().Response.Response != nil {
18883 sc = page.Response().Response.Response.StatusCode
18884 }
18885 tracing.EndSpan(ctx, sc, err)
18886 }()
18887 }
18888 for {
18889 next, err := page.fn(ctx, page.ialr)
18890 if err != nil {
18891 return err
18892 }
18893 page.ialr = next
18894 if !next.hasNextLink() || !next.IsEmpty() {
18895 break
18896 }
18897 }
18898 return nil
18899 }
18900
18901
18902
18903
18904 func (page *IPAllocationListResultPage) Next() error {
18905 return page.NextWithContext(context.Background())
18906 }
18907
18908
18909 func (page IPAllocationListResultPage) NotDone() bool {
18910 return !page.ialr.IsEmpty()
18911 }
18912
18913
18914 func (page IPAllocationListResultPage) Response() IPAllocationListResult {
18915 return page.ialr
18916 }
18917
18918
18919 func (page IPAllocationListResultPage) Values() []IPAllocation {
18920 if page.ialr.IsEmpty() {
18921 return nil
18922 }
18923 return *page.ialr.Value
18924 }
18925
18926
18927 func NewIPAllocationListResultPage(cur IPAllocationListResult, getNextPage func(context.Context, IPAllocationListResult) (IPAllocationListResult, error)) IPAllocationListResultPage {
18928 return IPAllocationListResultPage{
18929 fn: getNextPage,
18930 ialr: cur,
18931 }
18932 }
18933
18934
18935 type IPAllocationPropertiesFormat struct {
18936
18937 Subnet *SubResource `json:"subnet,omitempty"`
18938
18939 VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"`
18940
18941 Type IPAllocationType `json:"type,omitempty"`
18942
18943 Prefix *string `json:"prefix,omitempty"`
18944
18945 PrefixLength *int32 `json:"prefixLength,omitempty"`
18946
18947 PrefixType IPVersion `json:"prefixType,omitempty"`
18948
18949 IpamAllocationID *string `json:"ipamAllocationId,omitempty"`
18950
18951 AllocationTags map[string]*string `json:"allocationTags"`
18952 }
18953
18954
18955 func (iapf IPAllocationPropertiesFormat) MarshalJSON() ([]byte, error) {
18956 objectMap := make(map[string]interface{})
18957 if iapf.Type != "" {
18958 objectMap["type"] = iapf.Type
18959 }
18960 if iapf.Prefix != nil {
18961 objectMap["prefix"] = iapf.Prefix
18962 }
18963 if iapf.PrefixLength != nil {
18964 objectMap["prefixLength"] = iapf.PrefixLength
18965 }
18966 if iapf.PrefixType != "" {
18967 objectMap["prefixType"] = iapf.PrefixType
18968 }
18969 if iapf.IpamAllocationID != nil {
18970 objectMap["ipamAllocationId"] = iapf.IpamAllocationID
18971 }
18972 if iapf.AllocationTags != nil {
18973 objectMap["allocationTags"] = iapf.AllocationTags
18974 }
18975 return json.Marshal(objectMap)
18976 }
18977
18978
18979
18980 type IPAllocationsCreateOrUpdateFuture struct {
18981 azure.FutureAPI
18982
18983
18984 Result func(IPAllocationsClient) (IPAllocation, error)
18985 }
18986
18987
18988 func (future *IPAllocationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
18989 var azFuture azure.Future
18990 if err := json.Unmarshal(body, &azFuture); err != nil {
18991 return err
18992 }
18993 future.FutureAPI = &azFuture
18994 future.Result = future.result
18995 return nil
18996 }
18997
18998
18999 func (future *IPAllocationsCreateOrUpdateFuture) result(client IPAllocationsClient) (ia IPAllocation, err error) {
19000 var done bool
19001 done, err = future.DoneWithContext(context.Background(), client)
19002 if err != nil {
19003 err = autorest.NewErrorWithError(err, "network.IPAllocationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19004 return
19005 }
19006 if !done {
19007 ia.Response.Response = future.Response()
19008 err = azure.NewAsyncOpIncompleteError("network.IPAllocationsCreateOrUpdateFuture")
19009 return
19010 }
19011 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19012 if ia.Response.Response, err = future.GetResult(sender); err == nil && ia.Response.Response.StatusCode != http.StatusNoContent {
19013 ia, err = client.CreateOrUpdateResponder(ia.Response.Response)
19014 if err != nil {
19015 err = autorest.NewErrorWithError(err, "network.IPAllocationsCreateOrUpdateFuture", "Result", ia.Response.Response, "Failure responding to request")
19016 }
19017 }
19018 return
19019 }
19020
19021
19022
19023 type IPAllocationsDeleteFuture struct {
19024 azure.FutureAPI
19025
19026
19027 Result func(IPAllocationsClient) (autorest.Response, error)
19028 }
19029
19030
19031 func (future *IPAllocationsDeleteFuture) UnmarshalJSON(body []byte) error {
19032 var azFuture azure.Future
19033 if err := json.Unmarshal(body, &azFuture); err != nil {
19034 return err
19035 }
19036 future.FutureAPI = &azFuture
19037 future.Result = future.result
19038 return nil
19039 }
19040
19041
19042 func (future *IPAllocationsDeleteFuture) result(client IPAllocationsClient) (ar autorest.Response, err error) {
19043 var done bool
19044 done, err = future.DoneWithContext(context.Background(), client)
19045 if err != nil {
19046 err = autorest.NewErrorWithError(err, "network.IPAllocationsDeleteFuture", "Result", future.Response(), "Polling failure")
19047 return
19048 }
19049 if !done {
19050 ar.Response = future.Response()
19051 err = azure.NewAsyncOpIncompleteError("network.IPAllocationsDeleteFuture")
19052 return
19053 }
19054 ar.Response = future.Response()
19055 return
19056 }
19057
19058
19059 type IPConfiguration struct {
19060
19061 *IPConfigurationPropertiesFormat `json:"properties,omitempty"`
19062
19063 Name *string `json:"name,omitempty"`
19064
19065 Etag *string `json:"etag,omitempty"`
19066
19067 ID *string `json:"id,omitempty"`
19068 }
19069
19070
19071 func (ic IPConfiguration) MarshalJSON() ([]byte, error) {
19072 objectMap := make(map[string]interface{})
19073 if ic.IPConfigurationPropertiesFormat != nil {
19074 objectMap["properties"] = ic.IPConfigurationPropertiesFormat
19075 }
19076 if ic.Name != nil {
19077 objectMap["name"] = ic.Name
19078 }
19079 if ic.ID != nil {
19080 objectMap["id"] = ic.ID
19081 }
19082 return json.Marshal(objectMap)
19083 }
19084
19085
19086 func (ic *IPConfiguration) UnmarshalJSON(body []byte) error {
19087 var m map[string]*json.RawMessage
19088 err := json.Unmarshal(body, &m)
19089 if err != nil {
19090 return err
19091 }
19092 for k, v := range m {
19093 switch k {
19094 case "properties":
19095 if v != nil {
19096 var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat
19097 err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat)
19098 if err != nil {
19099 return err
19100 }
19101 ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat
19102 }
19103 case "name":
19104 if v != nil {
19105 var name string
19106 err = json.Unmarshal(*v, &name)
19107 if err != nil {
19108 return err
19109 }
19110 ic.Name = &name
19111 }
19112 case "etag":
19113 if v != nil {
19114 var etag string
19115 err = json.Unmarshal(*v, &etag)
19116 if err != nil {
19117 return err
19118 }
19119 ic.Etag = &etag
19120 }
19121 case "id":
19122 if v != nil {
19123 var ID string
19124 err = json.Unmarshal(*v, &ID)
19125 if err != nil {
19126 return err
19127 }
19128 ic.ID = &ID
19129 }
19130 }
19131 }
19132
19133 return nil
19134 }
19135
19136
19137 type IPConfigurationBgpPeeringAddress struct {
19138
19139 IpconfigurationID *string `json:"ipconfigurationId,omitempty"`
19140
19141 DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"`
19142
19143 CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"`
19144
19145 TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"`
19146 }
19147
19148
19149 func (icbpa IPConfigurationBgpPeeringAddress) MarshalJSON() ([]byte, error) {
19150 objectMap := make(map[string]interface{})
19151 if icbpa.IpconfigurationID != nil {
19152 objectMap["ipconfigurationId"] = icbpa.IpconfigurationID
19153 }
19154 if icbpa.CustomBgpIPAddresses != nil {
19155 objectMap["customBgpIpAddresses"] = icbpa.CustomBgpIPAddresses
19156 }
19157 return json.Marshal(objectMap)
19158 }
19159
19160
19161 type IPConfigurationProfile struct {
19162
19163 *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"`
19164
19165 Name *string `json:"name,omitempty"`
19166
19167 Type *string `json:"type,omitempty"`
19168
19169 Etag *string `json:"etag,omitempty"`
19170
19171 ID *string `json:"id,omitempty"`
19172 }
19173
19174
19175 func (icp IPConfigurationProfile) MarshalJSON() ([]byte, error) {
19176 objectMap := make(map[string]interface{})
19177 if icp.IPConfigurationProfilePropertiesFormat != nil {
19178 objectMap["properties"] = icp.IPConfigurationProfilePropertiesFormat
19179 }
19180 if icp.Name != nil {
19181 objectMap["name"] = icp.Name
19182 }
19183 if icp.ID != nil {
19184 objectMap["id"] = icp.ID
19185 }
19186 return json.Marshal(objectMap)
19187 }
19188
19189
19190 func (icp *IPConfigurationProfile) UnmarshalJSON(body []byte) error {
19191 var m map[string]*json.RawMessage
19192 err := json.Unmarshal(body, &m)
19193 if err != nil {
19194 return err
19195 }
19196 for k, v := range m {
19197 switch k {
19198 case "properties":
19199 if v != nil {
19200 var IPConfigurationProfilePropertiesFormat IPConfigurationProfilePropertiesFormat
19201 err = json.Unmarshal(*v, &IPConfigurationProfilePropertiesFormat)
19202 if err != nil {
19203 return err
19204 }
19205 icp.IPConfigurationProfilePropertiesFormat = &IPConfigurationProfilePropertiesFormat
19206 }
19207 case "name":
19208 if v != nil {
19209 var name string
19210 err = json.Unmarshal(*v, &name)
19211 if err != nil {
19212 return err
19213 }
19214 icp.Name = &name
19215 }
19216 case "type":
19217 if v != nil {
19218 var typeVar string
19219 err = json.Unmarshal(*v, &typeVar)
19220 if err != nil {
19221 return err
19222 }
19223 icp.Type = &typeVar
19224 }
19225 case "etag":
19226 if v != nil {
19227 var etag string
19228 err = json.Unmarshal(*v, &etag)
19229 if err != nil {
19230 return err
19231 }
19232 icp.Etag = &etag
19233 }
19234 case "id":
19235 if v != nil {
19236 var ID string
19237 err = json.Unmarshal(*v, &ID)
19238 if err != nil {
19239 return err
19240 }
19241 icp.ID = &ID
19242 }
19243 }
19244 }
19245
19246 return nil
19247 }
19248
19249
19250 type IPConfigurationProfilePropertiesFormat struct {
19251
19252 Subnet *Subnet `json:"subnet,omitempty"`
19253
19254 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
19255 }
19256
19257
19258 func (icppf IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error) {
19259 objectMap := make(map[string]interface{})
19260 if icppf.Subnet != nil {
19261 objectMap["subnet"] = icppf.Subnet
19262 }
19263 return json.Marshal(objectMap)
19264 }
19265
19266
19267 type IPConfigurationPropertiesFormat struct {
19268
19269 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
19270
19271 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
19272
19273 Subnet *Subnet `json:"subnet,omitempty"`
19274
19275 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
19276
19277 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
19278 }
19279
19280
19281 func (icpf IPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
19282 objectMap := make(map[string]interface{})
19283 if icpf.PrivateIPAddress != nil {
19284 objectMap["privateIPAddress"] = icpf.PrivateIPAddress
19285 }
19286 if icpf.PrivateIPAllocationMethod != "" {
19287 objectMap["privateIPAllocationMethod"] = icpf.PrivateIPAllocationMethod
19288 }
19289 if icpf.Subnet != nil {
19290 objectMap["subnet"] = icpf.Subnet
19291 }
19292 if icpf.PublicIPAddress != nil {
19293 objectMap["publicIPAddress"] = icpf.PublicIPAddress
19294 }
19295 return json.Marshal(objectMap)
19296 }
19297
19298
19299 type IPGroup struct {
19300 autorest.Response `json:"-"`
19301
19302 *IPGroupPropertiesFormat `json:"properties,omitempty"`
19303
19304 Etag *string `json:"etag,omitempty"`
19305
19306 ID *string `json:"id,omitempty"`
19307
19308 Name *string `json:"name,omitempty"`
19309
19310 Type *string `json:"type,omitempty"`
19311
19312 Location *string `json:"location,omitempty"`
19313
19314 Tags map[string]*string `json:"tags"`
19315 }
19316
19317
19318 func (ig IPGroup) MarshalJSON() ([]byte, error) {
19319 objectMap := make(map[string]interface{})
19320 if ig.IPGroupPropertiesFormat != nil {
19321 objectMap["properties"] = ig.IPGroupPropertiesFormat
19322 }
19323 if ig.ID != nil {
19324 objectMap["id"] = ig.ID
19325 }
19326 if ig.Location != nil {
19327 objectMap["location"] = ig.Location
19328 }
19329 if ig.Tags != nil {
19330 objectMap["tags"] = ig.Tags
19331 }
19332 return json.Marshal(objectMap)
19333 }
19334
19335
19336 func (ig *IPGroup) UnmarshalJSON(body []byte) error {
19337 var m map[string]*json.RawMessage
19338 err := json.Unmarshal(body, &m)
19339 if err != nil {
19340 return err
19341 }
19342 for k, v := range m {
19343 switch k {
19344 case "properties":
19345 if v != nil {
19346 var IPGroupPropertiesFormat IPGroupPropertiesFormat
19347 err = json.Unmarshal(*v, &IPGroupPropertiesFormat)
19348 if err != nil {
19349 return err
19350 }
19351 ig.IPGroupPropertiesFormat = &IPGroupPropertiesFormat
19352 }
19353 case "etag":
19354 if v != nil {
19355 var etag string
19356 err = json.Unmarshal(*v, &etag)
19357 if err != nil {
19358 return err
19359 }
19360 ig.Etag = &etag
19361 }
19362 case "id":
19363 if v != nil {
19364 var ID string
19365 err = json.Unmarshal(*v, &ID)
19366 if err != nil {
19367 return err
19368 }
19369 ig.ID = &ID
19370 }
19371 case "name":
19372 if v != nil {
19373 var name string
19374 err = json.Unmarshal(*v, &name)
19375 if err != nil {
19376 return err
19377 }
19378 ig.Name = &name
19379 }
19380 case "type":
19381 if v != nil {
19382 var typeVar string
19383 err = json.Unmarshal(*v, &typeVar)
19384 if err != nil {
19385 return err
19386 }
19387 ig.Type = &typeVar
19388 }
19389 case "location":
19390 if v != nil {
19391 var location string
19392 err = json.Unmarshal(*v, &location)
19393 if err != nil {
19394 return err
19395 }
19396 ig.Location = &location
19397 }
19398 case "tags":
19399 if v != nil {
19400 var tags map[string]*string
19401 err = json.Unmarshal(*v, &tags)
19402 if err != nil {
19403 return err
19404 }
19405 ig.Tags = tags
19406 }
19407 }
19408 }
19409
19410 return nil
19411 }
19412
19413
19414 type IPGroupListResult struct {
19415 autorest.Response `json:"-"`
19416
19417 Value *[]IPGroup `json:"value,omitempty"`
19418
19419 NextLink *string `json:"nextLink,omitempty"`
19420 }
19421
19422
19423 type IPGroupListResultIterator struct {
19424 i int
19425 page IPGroupListResultPage
19426 }
19427
19428
19429
19430 func (iter *IPGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
19431 if tracing.IsEnabled() {
19432 ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupListResultIterator.NextWithContext")
19433 defer func() {
19434 sc := -1
19435 if iter.Response().Response.Response != nil {
19436 sc = iter.Response().Response.Response.StatusCode
19437 }
19438 tracing.EndSpan(ctx, sc, err)
19439 }()
19440 }
19441 iter.i++
19442 if iter.i < len(iter.page.Values()) {
19443 return nil
19444 }
19445 err = iter.page.NextWithContext(ctx)
19446 if err != nil {
19447 iter.i--
19448 return err
19449 }
19450 iter.i = 0
19451 return nil
19452 }
19453
19454
19455
19456
19457 func (iter *IPGroupListResultIterator) Next() error {
19458 return iter.NextWithContext(context.Background())
19459 }
19460
19461
19462 func (iter IPGroupListResultIterator) NotDone() bool {
19463 return iter.page.NotDone() && iter.i < len(iter.page.Values())
19464 }
19465
19466
19467 func (iter IPGroupListResultIterator) Response() IPGroupListResult {
19468 return iter.page.Response()
19469 }
19470
19471
19472
19473 func (iter IPGroupListResultIterator) Value() IPGroup {
19474 if !iter.page.NotDone() {
19475 return IPGroup{}
19476 }
19477 return iter.page.Values()[iter.i]
19478 }
19479
19480
19481 func NewIPGroupListResultIterator(page IPGroupListResultPage) IPGroupListResultIterator {
19482 return IPGroupListResultIterator{page: page}
19483 }
19484
19485
19486 func (iglr IPGroupListResult) IsEmpty() bool {
19487 return iglr.Value == nil || len(*iglr.Value) == 0
19488 }
19489
19490
19491 func (iglr IPGroupListResult) hasNextLink() bool {
19492 return iglr.NextLink != nil && len(*iglr.NextLink) != 0
19493 }
19494
19495
19496
19497 func (iglr IPGroupListResult) iPGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
19498 if !iglr.hasNextLink() {
19499 return nil, nil
19500 }
19501 return autorest.Prepare((&http.Request{}).WithContext(ctx),
19502 autorest.AsJSON(),
19503 autorest.AsGet(),
19504 autorest.WithBaseURL(to.String(iglr.NextLink)))
19505 }
19506
19507
19508 type IPGroupListResultPage struct {
19509 fn func(context.Context, IPGroupListResult) (IPGroupListResult, error)
19510 iglr IPGroupListResult
19511 }
19512
19513
19514
19515 func (page *IPGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
19516 if tracing.IsEnabled() {
19517 ctx = tracing.StartSpan(ctx, fqdn+"/IPGroupListResultPage.NextWithContext")
19518 defer func() {
19519 sc := -1
19520 if page.Response().Response.Response != nil {
19521 sc = page.Response().Response.Response.StatusCode
19522 }
19523 tracing.EndSpan(ctx, sc, err)
19524 }()
19525 }
19526 for {
19527 next, err := page.fn(ctx, page.iglr)
19528 if err != nil {
19529 return err
19530 }
19531 page.iglr = next
19532 if !next.hasNextLink() || !next.IsEmpty() {
19533 break
19534 }
19535 }
19536 return nil
19537 }
19538
19539
19540
19541
19542 func (page *IPGroupListResultPage) Next() error {
19543 return page.NextWithContext(context.Background())
19544 }
19545
19546
19547 func (page IPGroupListResultPage) NotDone() bool {
19548 return !page.iglr.IsEmpty()
19549 }
19550
19551
19552 func (page IPGroupListResultPage) Response() IPGroupListResult {
19553 return page.iglr
19554 }
19555
19556
19557 func (page IPGroupListResultPage) Values() []IPGroup {
19558 if page.iglr.IsEmpty() {
19559 return nil
19560 }
19561 return *page.iglr.Value
19562 }
19563
19564
19565 func NewIPGroupListResultPage(cur IPGroupListResult, getNextPage func(context.Context, IPGroupListResult) (IPGroupListResult, error)) IPGroupListResultPage {
19566 return IPGroupListResultPage{
19567 fn: getNextPage,
19568 iglr: cur,
19569 }
19570 }
19571
19572
19573 type IPGroupPropertiesFormat struct {
19574
19575 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
19576
19577 IPAddresses *[]string `json:"ipAddresses,omitempty"`
19578
19579 Firewalls *[]SubResource `json:"firewalls,omitempty"`
19580 }
19581
19582
19583 func (igpf IPGroupPropertiesFormat) MarshalJSON() ([]byte, error) {
19584 objectMap := make(map[string]interface{})
19585 if igpf.IPAddresses != nil {
19586 objectMap["ipAddresses"] = igpf.IPAddresses
19587 }
19588 return json.Marshal(objectMap)
19589 }
19590
19591
19592
19593 type IPGroupsCreateOrUpdateFuture struct {
19594 azure.FutureAPI
19595
19596
19597 Result func(IPGroupsClient) (IPGroup, error)
19598 }
19599
19600
19601 func (future *IPGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
19602 var azFuture azure.Future
19603 if err := json.Unmarshal(body, &azFuture); err != nil {
19604 return err
19605 }
19606 future.FutureAPI = &azFuture
19607 future.Result = future.result
19608 return nil
19609 }
19610
19611
19612 func (future *IPGroupsCreateOrUpdateFuture) result(client IPGroupsClient) (ig IPGroup, err error) {
19613 var done bool
19614 done, err = future.DoneWithContext(context.Background(), client)
19615 if err != nil {
19616 err = autorest.NewErrorWithError(err, "network.IPGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
19617 return
19618 }
19619 if !done {
19620 ig.Response.Response = future.Response()
19621 err = azure.NewAsyncOpIncompleteError("network.IPGroupsCreateOrUpdateFuture")
19622 return
19623 }
19624 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
19625 if ig.Response.Response, err = future.GetResult(sender); err == nil && ig.Response.Response.StatusCode != http.StatusNoContent {
19626 ig, err = client.CreateOrUpdateResponder(ig.Response.Response)
19627 if err != nil {
19628 err = autorest.NewErrorWithError(err, "network.IPGroupsCreateOrUpdateFuture", "Result", ig.Response.Response, "Failure responding to request")
19629 }
19630 }
19631 return
19632 }
19633
19634
19635
19636 type IPGroupsDeleteFuture struct {
19637 azure.FutureAPI
19638
19639
19640 Result func(IPGroupsClient) (autorest.Response, error)
19641 }
19642
19643
19644 func (future *IPGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
19645 var azFuture azure.Future
19646 if err := json.Unmarshal(body, &azFuture); err != nil {
19647 return err
19648 }
19649 future.FutureAPI = &azFuture
19650 future.Result = future.result
19651 return nil
19652 }
19653
19654
19655 func (future *IPGroupsDeleteFuture) result(client IPGroupsClient) (ar autorest.Response, err error) {
19656 var done bool
19657 done, err = future.DoneWithContext(context.Background(), client)
19658 if err != nil {
19659 err = autorest.NewErrorWithError(err, "network.IPGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
19660 return
19661 }
19662 if !done {
19663 ar.Response = future.Response()
19664 err = azure.NewAsyncOpIncompleteError("network.IPGroupsDeleteFuture")
19665 return
19666 }
19667 ar.Response = future.Response()
19668 return
19669 }
19670
19671
19672 type IpsecPolicy struct {
19673
19674 SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"`
19675
19676 SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"`
19677
19678 IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"`
19679
19680 IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"`
19681
19682 IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"`
19683
19684 IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"`
19685
19686 DhGroup DhGroup `json:"dhGroup,omitempty"`
19687
19688 PfsGroup PfsGroup `json:"pfsGroup,omitempty"`
19689 }
19690
19691
19692 type IPTag struct {
19693
19694 IPTagType *string `json:"ipTagType,omitempty"`
19695
19696 Tag *string `json:"tag,omitempty"`
19697 }
19698
19699
19700 type Ipv6CircuitConnectionConfig struct {
19701
19702 AddressPrefix *string `json:"addressPrefix,omitempty"`
19703
19704 CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"`
19705 }
19706
19707
19708 func (i6ccc Ipv6CircuitConnectionConfig) MarshalJSON() ([]byte, error) {
19709 objectMap := make(map[string]interface{})
19710 if i6ccc.AddressPrefix != nil {
19711 objectMap["addressPrefix"] = i6ccc.AddressPrefix
19712 }
19713 return json.Marshal(objectMap)
19714 }
19715
19716
19717 type Ipv6ExpressRouteCircuitPeeringConfig struct {
19718
19719 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"`
19720
19721 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"`
19722
19723 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"`
19724
19725 RouteFilter *SubResource `json:"routeFilter,omitempty"`
19726
19727 State ExpressRouteCircuitPeeringState `json:"state,omitempty"`
19728 }
19729
19730
19731 type ListHubRouteTablesResult struct {
19732 autorest.Response `json:"-"`
19733
19734 Value *[]HubRouteTable `json:"value,omitempty"`
19735
19736 NextLink *string `json:"nextLink,omitempty"`
19737 }
19738
19739
19740 type ListHubRouteTablesResultIterator struct {
19741 i int
19742 page ListHubRouteTablesResultPage
19743 }
19744
19745
19746
19747 func (iter *ListHubRouteTablesResultIterator) NextWithContext(ctx context.Context) (err error) {
19748 if tracing.IsEnabled() {
19749 ctx = tracing.StartSpan(ctx, fqdn+"/ListHubRouteTablesResultIterator.NextWithContext")
19750 defer func() {
19751 sc := -1
19752 if iter.Response().Response.Response != nil {
19753 sc = iter.Response().Response.Response.StatusCode
19754 }
19755 tracing.EndSpan(ctx, sc, err)
19756 }()
19757 }
19758 iter.i++
19759 if iter.i < len(iter.page.Values()) {
19760 return nil
19761 }
19762 err = iter.page.NextWithContext(ctx)
19763 if err != nil {
19764 iter.i--
19765 return err
19766 }
19767 iter.i = 0
19768 return nil
19769 }
19770
19771
19772
19773
19774 func (iter *ListHubRouteTablesResultIterator) Next() error {
19775 return iter.NextWithContext(context.Background())
19776 }
19777
19778
19779 func (iter ListHubRouteTablesResultIterator) NotDone() bool {
19780 return iter.page.NotDone() && iter.i < len(iter.page.Values())
19781 }
19782
19783
19784 func (iter ListHubRouteTablesResultIterator) Response() ListHubRouteTablesResult {
19785 return iter.page.Response()
19786 }
19787
19788
19789
19790 func (iter ListHubRouteTablesResultIterator) Value() HubRouteTable {
19791 if !iter.page.NotDone() {
19792 return HubRouteTable{}
19793 }
19794 return iter.page.Values()[iter.i]
19795 }
19796
19797
19798 func NewListHubRouteTablesResultIterator(page ListHubRouteTablesResultPage) ListHubRouteTablesResultIterator {
19799 return ListHubRouteTablesResultIterator{page: page}
19800 }
19801
19802
19803 func (lhrtr ListHubRouteTablesResult) IsEmpty() bool {
19804 return lhrtr.Value == nil || len(*lhrtr.Value) == 0
19805 }
19806
19807
19808 func (lhrtr ListHubRouteTablesResult) hasNextLink() bool {
19809 return lhrtr.NextLink != nil && len(*lhrtr.NextLink) != 0
19810 }
19811
19812
19813
19814 func (lhrtr ListHubRouteTablesResult) listHubRouteTablesResultPreparer(ctx context.Context) (*http.Request, error) {
19815 if !lhrtr.hasNextLink() {
19816 return nil, nil
19817 }
19818 return autorest.Prepare((&http.Request{}).WithContext(ctx),
19819 autorest.AsJSON(),
19820 autorest.AsGet(),
19821 autorest.WithBaseURL(to.String(lhrtr.NextLink)))
19822 }
19823
19824
19825 type ListHubRouteTablesResultPage struct {
19826 fn func(context.Context, ListHubRouteTablesResult) (ListHubRouteTablesResult, error)
19827 lhrtr ListHubRouteTablesResult
19828 }
19829
19830
19831
19832 func (page *ListHubRouteTablesResultPage) NextWithContext(ctx context.Context) (err error) {
19833 if tracing.IsEnabled() {
19834 ctx = tracing.StartSpan(ctx, fqdn+"/ListHubRouteTablesResultPage.NextWithContext")
19835 defer func() {
19836 sc := -1
19837 if page.Response().Response.Response != nil {
19838 sc = page.Response().Response.Response.StatusCode
19839 }
19840 tracing.EndSpan(ctx, sc, err)
19841 }()
19842 }
19843 for {
19844 next, err := page.fn(ctx, page.lhrtr)
19845 if err != nil {
19846 return err
19847 }
19848 page.lhrtr = next
19849 if !next.hasNextLink() || !next.IsEmpty() {
19850 break
19851 }
19852 }
19853 return nil
19854 }
19855
19856
19857
19858
19859 func (page *ListHubRouteTablesResultPage) Next() error {
19860 return page.NextWithContext(context.Background())
19861 }
19862
19863
19864 func (page ListHubRouteTablesResultPage) NotDone() bool {
19865 return !page.lhrtr.IsEmpty()
19866 }
19867
19868
19869 func (page ListHubRouteTablesResultPage) Response() ListHubRouteTablesResult {
19870 return page.lhrtr
19871 }
19872
19873
19874 func (page ListHubRouteTablesResultPage) Values() []HubRouteTable {
19875 if page.lhrtr.IsEmpty() {
19876 return nil
19877 }
19878 return *page.lhrtr.Value
19879 }
19880
19881
19882 func NewListHubRouteTablesResultPage(cur ListHubRouteTablesResult, getNextPage func(context.Context, ListHubRouteTablesResult) (ListHubRouteTablesResult, error)) ListHubRouteTablesResultPage {
19883 return ListHubRouteTablesResultPage{
19884 fn: getNextPage,
19885 lhrtr: cur,
19886 }
19887 }
19888
19889
19890
19891 type ListHubVirtualNetworkConnectionsResult struct {
19892 autorest.Response `json:"-"`
19893
19894 Value *[]HubVirtualNetworkConnection `json:"value,omitempty"`
19895
19896 NextLink *string `json:"nextLink,omitempty"`
19897 }
19898
19899
19900
19901 type ListHubVirtualNetworkConnectionsResultIterator struct {
19902 i int
19903 page ListHubVirtualNetworkConnectionsResultPage
19904 }
19905
19906
19907
19908 func (iter *ListHubVirtualNetworkConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) {
19909 if tracing.IsEnabled() {
19910 ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultIterator.NextWithContext")
19911 defer func() {
19912 sc := -1
19913 if iter.Response().Response.Response != nil {
19914 sc = iter.Response().Response.Response.StatusCode
19915 }
19916 tracing.EndSpan(ctx, sc, err)
19917 }()
19918 }
19919 iter.i++
19920 if iter.i < len(iter.page.Values()) {
19921 return nil
19922 }
19923 err = iter.page.NextWithContext(ctx)
19924 if err != nil {
19925 iter.i--
19926 return err
19927 }
19928 iter.i = 0
19929 return nil
19930 }
19931
19932
19933
19934
19935 func (iter *ListHubVirtualNetworkConnectionsResultIterator) Next() error {
19936 return iter.NextWithContext(context.Background())
19937 }
19938
19939
19940 func (iter ListHubVirtualNetworkConnectionsResultIterator) NotDone() bool {
19941 return iter.page.NotDone() && iter.i < len(iter.page.Values())
19942 }
19943
19944
19945 func (iter ListHubVirtualNetworkConnectionsResultIterator) Response() ListHubVirtualNetworkConnectionsResult {
19946 return iter.page.Response()
19947 }
19948
19949
19950
19951 func (iter ListHubVirtualNetworkConnectionsResultIterator) Value() HubVirtualNetworkConnection {
19952 if !iter.page.NotDone() {
19953 return HubVirtualNetworkConnection{}
19954 }
19955 return iter.page.Values()[iter.i]
19956 }
19957
19958
19959 func NewListHubVirtualNetworkConnectionsResultIterator(page ListHubVirtualNetworkConnectionsResultPage) ListHubVirtualNetworkConnectionsResultIterator {
19960 return ListHubVirtualNetworkConnectionsResultIterator{page: page}
19961 }
19962
19963
19964 func (lhvncr ListHubVirtualNetworkConnectionsResult) IsEmpty() bool {
19965 return lhvncr.Value == nil || len(*lhvncr.Value) == 0
19966 }
19967
19968
19969 func (lhvncr ListHubVirtualNetworkConnectionsResult) hasNextLink() bool {
19970 return lhvncr.NextLink != nil && len(*lhvncr.NextLink) != 0
19971 }
19972
19973
19974
19975 func (lhvncr ListHubVirtualNetworkConnectionsResult) listHubVirtualNetworkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) {
19976 if !lhvncr.hasNextLink() {
19977 return nil, nil
19978 }
19979 return autorest.Prepare((&http.Request{}).WithContext(ctx),
19980 autorest.AsJSON(),
19981 autorest.AsGet(),
19982 autorest.WithBaseURL(to.String(lhvncr.NextLink)))
19983 }
19984
19985
19986 type ListHubVirtualNetworkConnectionsResultPage struct {
19987 fn func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error)
19988 lhvncr ListHubVirtualNetworkConnectionsResult
19989 }
19990
19991
19992
19993 func (page *ListHubVirtualNetworkConnectionsResultPage) NextWithContext(ctx context.Context) (err error) {
19994 if tracing.IsEnabled() {
19995 ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultPage.NextWithContext")
19996 defer func() {
19997 sc := -1
19998 if page.Response().Response.Response != nil {
19999 sc = page.Response().Response.Response.StatusCode
20000 }
20001 tracing.EndSpan(ctx, sc, err)
20002 }()
20003 }
20004 for {
20005 next, err := page.fn(ctx, page.lhvncr)
20006 if err != nil {
20007 return err
20008 }
20009 page.lhvncr = next
20010 if !next.hasNextLink() || !next.IsEmpty() {
20011 break
20012 }
20013 }
20014 return nil
20015 }
20016
20017
20018
20019
20020 func (page *ListHubVirtualNetworkConnectionsResultPage) Next() error {
20021 return page.NextWithContext(context.Background())
20022 }
20023
20024
20025 func (page ListHubVirtualNetworkConnectionsResultPage) NotDone() bool {
20026 return !page.lhvncr.IsEmpty()
20027 }
20028
20029
20030 func (page ListHubVirtualNetworkConnectionsResultPage) Response() ListHubVirtualNetworkConnectionsResult {
20031 return page.lhvncr
20032 }
20033
20034
20035 func (page ListHubVirtualNetworkConnectionsResultPage) Values() []HubVirtualNetworkConnection {
20036 if page.lhvncr.IsEmpty() {
20037 return nil
20038 }
20039 return *page.lhvncr.Value
20040 }
20041
20042
20043 func NewListHubVirtualNetworkConnectionsResultPage(cur ListHubVirtualNetworkConnectionsResult, getNextPage func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error)) ListHubVirtualNetworkConnectionsResultPage {
20044 return ListHubVirtualNetworkConnectionsResultPage{
20045 fn: getNextPage,
20046 lhvncr: cur,
20047 }
20048 }
20049
20050
20051
20052 type ListP2SVpnGatewaysResult struct {
20053 autorest.Response `json:"-"`
20054
20055 Value *[]P2SVpnGateway `json:"value,omitempty"`
20056
20057 NextLink *string `json:"nextLink,omitempty"`
20058 }
20059
20060
20061 type ListP2SVpnGatewaysResultIterator struct {
20062 i int
20063 page ListP2SVpnGatewaysResultPage
20064 }
20065
20066
20067
20068 func (iter *ListP2SVpnGatewaysResultIterator) NextWithContext(ctx context.Context) (err error) {
20069 if tracing.IsEnabled() {
20070 ctx = tracing.StartSpan(ctx, fqdn+"/ListP2SVpnGatewaysResultIterator.NextWithContext")
20071 defer func() {
20072 sc := -1
20073 if iter.Response().Response.Response != nil {
20074 sc = iter.Response().Response.Response.StatusCode
20075 }
20076 tracing.EndSpan(ctx, sc, err)
20077 }()
20078 }
20079 iter.i++
20080 if iter.i < len(iter.page.Values()) {
20081 return nil
20082 }
20083 err = iter.page.NextWithContext(ctx)
20084 if err != nil {
20085 iter.i--
20086 return err
20087 }
20088 iter.i = 0
20089 return nil
20090 }
20091
20092
20093
20094
20095 func (iter *ListP2SVpnGatewaysResultIterator) Next() error {
20096 return iter.NextWithContext(context.Background())
20097 }
20098
20099
20100 func (iter ListP2SVpnGatewaysResultIterator) NotDone() bool {
20101 return iter.page.NotDone() && iter.i < len(iter.page.Values())
20102 }
20103
20104
20105 func (iter ListP2SVpnGatewaysResultIterator) Response() ListP2SVpnGatewaysResult {
20106 return iter.page.Response()
20107 }
20108
20109
20110
20111 func (iter ListP2SVpnGatewaysResultIterator) Value() P2SVpnGateway {
20112 if !iter.page.NotDone() {
20113 return P2SVpnGateway{}
20114 }
20115 return iter.page.Values()[iter.i]
20116 }
20117
20118
20119 func NewListP2SVpnGatewaysResultIterator(page ListP2SVpnGatewaysResultPage) ListP2SVpnGatewaysResultIterator {
20120 return ListP2SVpnGatewaysResultIterator{page: page}
20121 }
20122
20123
20124 func (lpvgr ListP2SVpnGatewaysResult) IsEmpty() bool {
20125 return lpvgr.Value == nil || len(*lpvgr.Value) == 0
20126 }
20127
20128
20129 func (lpvgr ListP2SVpnGatewaysResult) hasNextLink() bool {
20130 return lpvgr.NextLink != nil && len(*lpvgr.NextLink) != 0
20131 }
20132
20133
20134
20135 func (lpvgr ListP2SVpnGatewaysResult) listP2SVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) {
20136 if !lpvgr.hasNextLink() {
20137 return nil, nil
20138 }
20139 return autorest.Prepare((&http.Request{}).WithContext(ctx),
20140 autorest.AsJSON(),
20141 autorest.AsGet(),
20142 autorest.WithBaseURL(to.String(lpvgr.NextLink)))
20143 }
20144
20145
20146 type ListP2SVpnGatewaysResultPage struct {
20147 fn func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error)
20148 lpvgr ListP2SVpnGatewaysResult
20149 }
20150
20151
20152
20153 func (page *ListP2SVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err error) {
20154 if tracing.IsEnabled() {
20155 ctx = tracing.StartSpan(ctx, fqdn+"/ListP2SVpnGatewaysResultPage.NextWithContext")
20156 defer func() {
20157 sc := -1
20158 if page.Response().Response.Response != nil {
20159 sc = page.Response().Response.Response.StatusCode
20160 }
20161 tracing.EndSpan(ctx, sc, err)
20162 }()
20163 }
20164 for {
20165 next, err := page.fn(ctx, page.lpvgr)
20166 if err != nil {
20167 return err
20168 }
20169 page.lpvgr = next
20170 if !next.hasNextLink() || !next.IsEmpty() {
20171 break
20172 }
20173 }
20174 return nil
20175 }
20176
20177
20178
20179
20180 func (page *ListP2SVpnGatewaysResultPage) Next() error {
20181 return page.NextWithContext(context.Background())
20182 }
20183
20184
20185 func (page ListP2SVpnGatewaysResultPage) NotDone() bool {
20186 return !page.lpvgr.IsEmpty()
20187 }
20188
20189
20190 func (page ListP2SVpnGatewaysResultPage) Response() ListP2SVpnGatewaysResult {
20191 return page.lpvgr
20192 }
20193
20194
20195 func (page ListP2SVpnGatewaysResultPage) Values() []P2SVpnGateway {
20196 if page.lpvgr.IsEmpty() {
20197 return nil
20198 }
20199 return *page.lpvgr.Value
20200 }
20201
20202
20203 func NewListP2SVpnGatewaysResultPage(cur ListP2SVpnGatewaysResult, getNextPage func(context.Context, ListP2SVpnGatewaysResult) (ListP2SVpnGatewaysResult, error)) ListP2SVpnGatewaysResultPage {
20204 return ListP2SVpnGatewaysResultPage{
20205 fn: getNextPage,
20206 lpvgr: cur,
20207 }
20208 }
20209
20210
20211 type ListString struct {
20212 autorest.Response `json:"-"`
20213 Value *[]string `json:"value,omitempty"`
20214 }
20215
20216
20217
20218 type ListVirtualHubRouteTableV2sResult struct {
20219 autorest.Response `json:"-"`
20220
20221 Value *[]VirtualHubRouteTableV2 `json:"value,omitempty"`
20222
20223 NextLink *string `json:"nextLink,omitempty"`
20224 }
20225
20226
20227
20228 type ListVirtualHubRouteTableV2sResultIterator struct {
20229 i int
20230 page ListVirtualHubRouteTableV2sResultPage
20231 }
20232
20233
20234
20235 func (iter *ListVirtualHubRouteTableV2sResultIterator) NextWithContext(ctx context.Context) (err error) {
20236 if tracing.IsEnabled() {
20237 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultIterator.NextWithContext")
20238 defer func() {
20239 sc := -1
20240 if iter.Response().Response.Response != nil {
20241 sc = iter.Response().Response.Response.StatusCode
20242 }
20243 tracing.EndSpan(ctx, sc, err)
20244 }()
20245 }
20246 iter.i++
20247 if iter.i < len(iter.page.Values()) {
20248 return nil
20249 }
20250 err = iter.page.NextWithContext(ctx)
20251 if err != nil {
20252 iter.i--
20253 return err
20254 }
20255 iter.i = 0
20256 return nil
20257 }
20258
20259
20260
20261
20262 func (iter *ListVirtualHubRouteTableV2sResultIterator) Next() error {
20263 return iter.NextWithContext(context.Background())
20264 }
20265
20266
20267 func (iter ListVirtualHubRouteTableV2sResultIterator) NotDone() bool {
20268 return iter.page.NotDone() && iter.i < len(iter.page.Values())
20269 }
20270
20271
20272 func (iter ListVirtualHubRouteTableV2sResultIterator) Response() ListVirtualHubRouteTableV2sResult {
20273 return iter.page.Response()
20274 }
20275
20276
20277
20278 func (iter ListVirtualHubRouteTableV2sResultIterator) Value() VirtualHubRouteTableV2 {
20279 if !iter.page.NotDone() {
20280 return VirtualHubRouteTableV2{}
20281 }
20282 return iter.page.Values()[iter.i]
20283 }
20284
20285
20286 func NewListVirtualHubRouteTableV2sResultIterator(page ListVirtualHubRouteTableV2sResultPage) ListVirtualHubRouteTableV2sResultIterator {
20287 return ListVirtualHubRouteTableV2sResultIterator{page: page}
20288 }
20289
20290
20291 func (lvhrtvr ListVirtualHubRouteTableV2sResult) IsEmpty() bool {
20292 return lvhrtvr.Value == nil || len(*lvhrtvr.Value) == 0
20293 }
20294
20295
20296 func (lvhrtvr ListVirtualHubRouteTableV2sResult) hasNextLink() bool {
20297 return lvhrtvr.NextLink != nil && len(*lvhrtvr.NextLink) != 0
20298 }
20299
20300
20301
20302 func (lvhrtvr ListVirtualHubRouteTableV2sResult) listVirtualHubRouteTableV2sResultPreparer(ctx context.Context) (*http.Request, error) {
20303 if !lvhrtvr.hasNextLink() {
20304 return nil, nil
20305 }
20306 return autorest.Prepare((&http.Request{}).WithContext(ctx),
20307 autorest.AsJSON(),
20308 autorest.AsGet(),
20309 autorest.WithBaseURL(to.String(lvhrtvr.NextLink)))
20310 }
20311
20312
20313 type ListVirtualHubRouteTableV2sResultPage struct {
20314 fn func(context.Context, ListVirtualHubRouteTableV2sResult) (ListVirtualHubRouteTableV2sResult, error)
20315 lvhrtvr ListVirtualHubRouteTableV2sResult
20316 }
20317
20318
20319
20320 func (page *ListVirtualHubRouteTableV2sResultPage) NextWithContext(ctx context.Context) (err error) {
20321 if tracing.IsEnabled() {
20322 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultPage.NextWithContext")
20323 defer func() {
20324 sc := -1
20325 if page.Response().Response.Response != nil {
20326 sc = page.Response().Response.Response.StatusCode
20327 }
20328 tracing.EndSpan(ctx, sc, err)
20329 }()
20330 }
20331 for {
20332 next, err := page.fn(ctx, page.lvhrtvr)
20333 if err != nil {
20334 return err
20335 }
20336 page.lvhrtvr = next
20337 if !next.hasNextLink() || !next.IsEmpty() {
20338 break
20339 }
20340 }
20341 return nil
20342 }
20343
20344
20345
20346
20347 func (page *ListVirtualHubRouteTableV2sResultPage) Next() error {
20348 return page.NextWithContext(context.Background())
20349 }
20350
20351
20352 func (page ListVirtualHubRouteTableV2sResultPage) NotDone() bool {
20353 return !page.lvhrtvr.IsEmpty()
20354 }
20355
20356
20357 func (page ListVirtualHubRouteTableV2sResultPage) Response() ListVirtualHubRouteTableV2sResult {
20358 return page.lvhrtvr
20359 }
20360
20361
20362 func (page ListVirtualHubRouteTableV2sResultPage) Values() []VirtualHubRouteTableV2 {
20363 if page.lvhrtvr.IsEmpty() {
20364 return nil
20365 }
20366 return *page.lvhrtvr.Value
20367 }
20368
20369
20370 func NewListVirtualHubRouteTableV2sResultPage(cur ListVirtualHubRouteTableV2sResult, getNextPage func(context.Context, ListVirtualHubRouteTableV2sResult) (ListVirtualHubRouteTableV2sResult, error)) ListVirtualHubRouteTableV2sResultPage {
20371 return ListVirtualHubRouteTableV2sResultPage{
20372 fn: getNextPage,
20373 lvhrtvr: cur,
20374 }
20375 }
20376
20377
20378
20379 type ListVirtualHubsResult struct {
20380 autorest.Response `json:"-"`
20381
20382 Value *[]VirtualHub `json:"value,omitempty"`
20383
20384 NextLink *string `json:"nextLink,omitempty"`
20385 }
20386
20387
20388 type ListVirtualHubsResultIterator struct {
20389 i int
20390 page ListVirtualHubsResultPage
20391 }
20392
20393
20394
20395 func (iter *ListVirtualHubsResultIterator) NextWithContext(ctx context.Context) (err error) {
20396 if tracing.IsEnabled() {
20397 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultIterator.NextWithContext")
20398 defer func() {
20399 sc := -1
20400 if iter.Response().Response.Response != nil {
20401 sc = iter.Response().Response.Response.StatusCode
20402 }
20403 tracing.EndSpan(ctx, sc, err)
20404 }()
20405 }
20406 iter.i++
20407 if iter.i < len(iter.page.Values()) {
20408 return nil
20409 }
20410 err = iter.page.NextWithContext(ctx)
20411 if err != nil {
20412 iter.i--
20413 return err
20414 }
20415 iter.i = 0
20416 return nil
20417 }
20418
20419
20420
20421
20422 func (iter *ListVirtualHubsResultIterator) Next() error {
20423 return iter.NextWithContext(context.Background())
20424 }
20425
20426
20427 func (iter ListVirtualHubsResultIterator) NotDone() bool {
20428 return iter.page.NotDone() && iter.i < len(iter.page.Values())
20429 }
20430
20431
20432 func (iter ListVirtualHubsResultIterator) Response() ListVirtualHubsResult {
20433 return iter.page.Response()
20434 }
20435
20436
20437
20438 func (iter ListVirtualHubsResultIterator) Value() VirtualHub {
20439 if !iter.page.NotDone() {
20440 return VirtualHub{}
20441 }
20442 return iter.page.Values()[iter.i]
20443 }
20444
20445
20446 func NewListVirtualHubsResultIterator(page ListVirtualHubsResultPage) ListVirtualHubsResultIterator {
20447 return ListVirtualHubsResultIterator{page: page}
20448 }
20449
20450
20451 func (lvhr ListVirtualHubsResult) IsEmpty() bool {
20452 return lvhr.Value == nil || len(*lvhr.Value) == 0
20453 }
20454
20455
20456 func (lvhr ListVirtualHubsResult) hasNextLink() bool {
20457 return lvhr.NextLink != nil && len(*lvhr.NextLink) != 0
20458 }
20459
20460
20461
20462 func (lvhr ListVirtualHubsResult) listVirtualHubsResultPreparer(ctx context.Context) (*http.Request, error) {
20463 if !lvhr.hasNextLink() {
20464 return nil, nil
20465 }
20466 return autorest.Prepare((&http.Request{}).WithContext(ctx),
20467 autorest.AsJSON(),
20468 autorest.AsGet(),
20469 autorest.WithBaseURL(to.String(lvhr.NextLink)))
20470 }
20471
20472
20473 type ListVirtualHubsResultPage struct {
20474 fn func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error)
20475 lvhr ListVirtualHubsResult
20476 }
20477
20478
20479
20480 func (page *ListVirtualHubsResultPage) NextWithContext(ctx context.Context) (err error) {
20481 if tracing.IsEnabled() {
20482 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultPage.NextWithContext")
20483 defer func() {
20484 sc := -1
20485 if page.Response().Response.Response != nil {
20486 sc = page.Response().Response.Response.StatusCode
20487 }
20488 tracing.EndSpan(ctx, sc, err)
20489 }()
20490 }
20491 for {
20492 next, err := page.fn(ctx, page.lvhr)
20493 if err != nil {
20494 return err
20495 }
20496 page.lvhr = next
20497 if !next.hasNextLink() || !next.IsEmpty() {
20498 break
20499 }
20500 }
20501 return nil
20502 }
20503
20504
20505
20506
20507 func (page *ListVirtualHubsResultPage) Next() error {
20508 return page.NextWithContext(context.Background())
20509 }
20510
20511
20512 func (page ListVirtualHubsResultPage) NotDone() bool {
20513 return !page.lvhr.IsEmpty()
20514 }
20515
20516
20517 func (page ListVirtualHubsResultPage) Response() ListVirtualHubsResult {
20518 return page.lvhr
20519 }
20520
20521
20522 func (page ListVirtualHubsResultPage) Values() []VirtualHub {
20523 if page.lvhr.IsEmpty() {
20524 return nil
20525 }
20526 return *page.lvhr.Value
20527 }
20528
20529
20530 func NewListVirtualHubsResultPage(cur ListVirtualHubsResult, getNextPage func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error)) ListVirtualHubsResultPage {
20531 return ListVirtualHubsResultPage{
20532 fn: getNextPage,
20533 lvhr: cur,
20534 }
20535 }
20536
20537
20538
20539 type ListVirtualWANsResult struct {
20540 autorest.Response `json:"-"`
20541
20542 Value *[]VirtualWAN `json:"value,omitempty"`
20543
20544 NextLink *string `json:"nextLink,omitempty"`
20545 }
20546
20547
20548 type ListVirtualWANsResultIterator struct {
20549 i int
20550 page ListVirtualWANsResultPage
20551 }
20552
20553
20554
20555 func (iter *ListVirtualWANsResultIterator) NextWithContext(ctx context.Context) (err error) {
20556 if tracing.IsEnabled() {
20557 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultIterator.NextWithContext")
20558 defer func() {
20559 sc := -1
20560 if iter.Response().Response.Response != nil {
20561 sc = iter.Response().Response.Response.StatusCode
20562 }
20563 tracing.EndSpan(ctx, sc, err)
20564 }()
20565 }
20566 iter.i++
20567 if iter.i < len(iter.page.Values()) {
20568 return nil
20569 }
20570 err = iter.page.NextWithContext(ctx)
20571 if err != nil {
20572 iter.i--
20573 return err
20574 }
20575 iter.i = 0
20576 return nil
20577 }
20578
20579
20580
20581
20582 func (iter *ListVirtualWANsResultIterator) Next() error {
20583 return iter.NextWithContext(context.Background())
20584 }
20585
20586
20587 func (iter ListVirtualWANsResultIterator) NotDone() bool {
20588 return iter.page.NotDone() && iter.i < len(iter.page.Values())
20589 }
20590
20591
20592 func (iter ListVirtualWANsResultIterator) Response() ListVirtualWANsResult {
20593 return iter.page.Response()
20594 }
20595
20596
20597
20598 func (iter ListVirtualWANsResultIterator) Value() VirtualWAN {
20599 if !iter.page.NotDone() {
20600 return VirtualWAN{}
20601 }
20602 return iter.page.Values()[iter.i]
20603 }
20604
20605
20606 func NewListVirtualWANsResultIterator(page ListVirtualWANsResultPage) ListVirtualWANsResultIterator {
20607 return ListVirtualWANsResultIterator{page: page}
20608 }
20609
20610
20611 func (lvwnr ListVirtualWANsResult) IsEmpty() bool {
20612 return lvwnr.Value == nil || len(*lvwnr.Value) == 0
20613 }
20614
20615
20616 func (lvwnr ListVirtualWANsResult) hasNextLink() bool {
20617 return lvwnr.NextLink != nil && len(*lvwnr.NextLink) != 0
20618 }
20619
20620
20621
20622 func (lvwnr ListVirtualWANsResult) listVirtualWANsResultPreparer(ctx context.Context) (*http.Request, error) {
20623 if !lvwnr.hasNextLink() {
20624 return nil, nil
20625 }
20626 return autorest.Prepare((&http.Request{}).WithContext(ctx),
20627 autorest.AsJSON(),
20628 autorest.AsGet(),
20629 autorest.WithBaseURL(to.String(lvwnr.NextLink)))
20630 }
20631
20632
20633 type ListVirtualWANsResultPage struct {
20634 fn func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error)
20635 lvwnr ListVirtualWANsResult
20636 }
20637
20638
20639
20640 func (page *ListVirtualWANsResultPage) NextWithContext(ctx context.Context) (err error) {
20641 if tracing.IsEnabled() {
20642 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultPage.NextWithContext")
20643 defer func() {
20644 sc := -1
20645 if page.Response().Response.Response != nil {
20646 sc = page.Response().Response.Response.StatusCode
20647 }
20648 tracing.EndSpan(ctx, sc, err)
20649 }()
20650 }
20651 for {
20652 next, err := page.fn(ctx, page.lvwnr)
20653 if err != nil {
20654 return err
20655 }
20656 page.lvwnr = next
20657 if !next.hasNextLink() || !next.IsEmpty() {
20658 break
20659 }
20660 }
20661 return nil
20662 }
20663
20664
20665
20666
20667 func (page *ListVirtualWANsResultPage) Next() error {
20668 return page.NextWithContext(context.Background())
20669 }
20670
20671
20672 func (page ListVirtualWANsResultPage) NotDone() bool {
20673 return !page.lvwnr.IsEmpty()
20674 }
20675
20676
20677 func (page ListVirtualWANsResultPage) Response() ListVirtualWANsResult {
20678 return page.lvwnr
20679 }
20680
20681
20682 func (page ListVirtualWANsResultPage) Values() []VirtualWAN {
20683 if page.lvwnr.IsEmpty() {
20684 return nil
20685 }
20686 return *page.lvwnr.Value
20687 }
20688
20689
20690 func NewListVirtualWANsResultPage(cur ListVirtualWANsResult, getNextPage func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error)) ListVirtualWANsResultPage {
20691 return ListVirtualWANsResultPage{
20692 fn: getNextPage,
20693 lvwnr: cur,
20694 }
20695 }
20696
20697
20698
20699 type ListVpnConnectionsResult struct {
20700 autorest.Response `json:"-"`
20701
20702 Value *[]VpnConnection `json:"value,omitempty"`
20703
20704 NextLink *string `json:"nextLink,omitempty"`
20705 }
20706
20707
20708 type ListVpnConnectionsResultIterator struct {
20709 i int
20710 page ListVpnConnectionsResultPage
20711 }
20712
20713
20714
20715 func (iter *ListVpnConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) {
20716 if tracing.IsEnabled() {
20717 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultIterator.NextWithContext")
20718 defer func() {
20719 sc := -1
20720 if iter.Response().Response.Response != nil {
20721 sc = iter.Response().Response.Response.StatusCode
20722 }
20723 tracing.EndSpan(ctx, sc, err)
20724 }()
20725 }
20726 iter.i++
20727 if iter.i < len(iter.page.Values()) {
20728 return nil
20729 }
20730 err = iter.page.NextWithContext(ctx)
20731 if err != nil {
20732 iter.i--
20733 return err
20734 }
20735 iter.i = 0
20736 return nil
20737 }
20738
20739
20740
20741
20742 func (iter *ListVpnConnectionsResultIterator) Next() error {
20743 return iter.NextWithContext(context.Background())
20744 }
20745
20746
20747 func (iter ListVpnConnectionsResultIterator) NotDone() bool {
20748 return iter.page.NotDone() && iter.i < len(iter.page.Values())
20749 }
20750
20751
20752 func (iter ListVpnConnectionsResultIterator) Response() ListVpnConnectionsResult {
20753 return iter.page.Response()
20754 }
20755
20756
20757
20758 func (iter ListVpnConnectionsResultIterator) Value() VpnConnection {
20759 if !iter.page.NotDone() {
20760 return VpnConnection{}
20761 }
20762 return iter.page.Values()[iter.i]
20763 }
20764
20765
20766 func NewListVpnConnectionsResultIterator(page ListVpnConnectionsResultPage) ListVpnConnectionsResultIterator {
20767 return ListVpnConnectionsResultIterator{page: page}
20768 }
20769
20770
20771 func (lvcr ListVpnConnectionsResult) IsEmpty() bool {
20772 return lvcr.Value == nil || len(*lvcr.Value) == 0
20773 }
20774
20775
20776 func (lvcr ListVpnConnectionsResult) hasNextLink() bool {
20777 return lvcr.NextLink != nil && len(*lvcr.NextLink) != 0
20778 }
20779
20780
20781
20782 func (lvcr ListVpnConnectionsResult) listVpnConnectionsResultPreparer(ctx context.Context) (*http.Request, error) {
20783 if !lvcr.hasNextLink() {
20784 return nil, nil
20785 }
20786 return autorest.Prepare((&http.Request{}).WithContext(ctx),
20787 autorest.AsJSON(),
20788 autorest.AsGet(),
20789 autorest.WithBaseURL(to.String(lvcr.NextLink)))
20790 }
20791
20792
20793 type ListVpnConnectionsResultPage struct {
20794 fn func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error)
20795 lvcr ListVpnConnectionsResult
20796 }
20797
20798
20799
20800 func (page *ListVpnConnectionsResultPage) NextWithContext(ctx context.Context) (err error) {
20801 if tracing.IsEnabled() {
20802 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultPage.NextWithContext")
20803 defer func() {
20804 sc := -1
20805 if page.Response().Response.Response != nil {
20806 sc = page.Response().Response.Response.StatusCode
20807 }
20808 tracing.EndSpan(ctx, sc, err)
20809 }()
20810 }
20811 for {
20812 next, err := page.fn(ctx, page.lvcr)
20813 if err != nil {
20814 return err
20815 }
20816 page.lvcr = next
20817 if !next.hasNextLink() || !next.IsEmpty() {
20818 break
20819 }
20820 }
20821 return nil
20822 }
20823
20824
20825
20826
20827 func (page *ListVpnConnectionsResultPage) Next() error {
20828 return page.NextWithContext(context.Background())
20829 }
20830
20831
20832 func (page ListVpnConnectionsResultPage) NotDone() bool {
20833 return !page.lvcr.IsEmpty()
20834 }
20835
20836
20837 func (page ListVpnConnectionsResultPage) Response() ListVpnConnectionsResult {
20838 return page.lvcr
20839 }
20840
20841
20842 func (page ListVpnConnectionsResultPage) Values() []VpnConnection {
20843 if page.lvcr.IsEmpty() {
20844 return nil
20845 }
20846 return *page.lvcr.Value
20847 }
20848
20849
20850 func NewListVpnConnectionsResultPage(cur ListVpnConnectionsResult, getNextPage func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error)) ListVpnConnectionsResultPage {
20851 return ListVpnConnectionsResultPage{
20852 fn: getNextPage,
20853 lvcr: cur,
20854 }
20855 }
20856
20857
20858
20859 type ListVpnGatewaysResult struct {
20860 autorest.Response `json:"-"`
20861
20862 Value *[]VpnGateway `json:"value,omitempty"`
20863
20864 NextLink *string `json:"nextLink,omitempty"`
20865 }
20866
20867
20868 type ListVpnGatewaysResultIterator struct {
20869 i int
20870 page ListVpnGatewaysResultPage
20871 }
20872
20873
20874
20875 func (iter *ListVpnGatewaysResultIterator) NextWithContext(ctx context.Context) (err error) {
20876 if tracing.IsEnabled() {
20877 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultIterator.NextWithContext")
20878 defer func() {
20879 sc := -1
20880 if iter.Response().Response.Response != nil {
20881 sc = iter.Response().Response.Response.StatusCode
20882 }
20883 tracing.EndSpan(ctx, sc, err)
20884 }()
20885 }
20886 iter.i++
20887 if iter.i < len(iter.page.Values()) {
20888 return nil
20889 }
20890 err = iter.page.NextWithContext(ctx)
20891 if err != nil {
20892 iter.i--
20893 return err
20894 }
20895 iter.i = 0
20896 return nil
20897 }
20898
20899
20900
20901
20902 func (iter *ListVpnGatewaysResultIterator) Next() error {
20903 return iter.NextWithContext(context.Background())
20904 }
20905
20906
20907 func (iter ListVpnGatewaysResultIterator) NotDone() bool {
20908 return iter.page.NotDone() && iter.i < len(iter.page.Values())
20909 }
20910
20911
20912 func (iter ListVpnGatewaysResultIterator) Response() ListVpnGatewaysResult {
20913 return iter.page.Response()
20914 }
20915
20916
20917
20918 func (iter ListVpnGatewaysResultIterator) Value() VpnGateway {
20919 if !iter.page.NotDone() {
20920 return VpnGateway{}
20921 }
20922 return iter.page.Values()[iter.i]
20923 }
20924
20925
20926 func NewListVpnGatewaysResultIterator(page ListVpnGatewaysResultPage) ListVpnGatewaysResultIterator {
20927 return ListVpnGatewaysResultIterator{page: page}
20928 }
20929
20930
20931 func (lvgr ListVpnGatewaysResult) IsEmpty() bool {
20932 return lvgr.Value == nil || len(*lvgr.Value) == 0
20933 }
20934
20935
20936 func (lvgr ListVpnGatewaysResult) hasNextLink() bool {
20937 return lvgr.NextLink != nil && len(*lvgr.NextLink) != 0
20938 }
20939
20940
20941
20942 func (lvgr ListVpnGatewaysResult) listVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) {
20943 if !lvgr.hasNextLink() {
20944 return nil, nil
20945 }
20946 return autorest.Prepare((&http.Request{}).WithContext(ctx),
20947 autorest.AsJSON(),
20948 autorest.AsGet(),
20949 autorest.WithBaseURL(to.String(lvgr.NextLink)))
20950 }
20951
20952
20953 type ListVpnGatewaysResultPage struct {
20954 fn func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error)
20955 lvgr ListVpnGatewaysResult
20956 }
20957
20958
20959
20960 func (page *ListVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err error) {
20961 if tracing.IsEnabled() {
20962 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultPage.NextWithContext")
20963 defer func() {
20964 sc := -1
20965 if page.Response().Response.Response != nil {
20966 sc = page.Response().Response.Response.StatusCode
20967 }
20968 tracing.EndSpan(ctx, sc, err)
20969 }()
20970 }
20971 for {
20972 next, err := page.fn(ctx, page.lvgr)
20973 if err != nil {
20974 return err
20975 }
20976 page.lvgr = next
20977 if !next.hasNextLink() || !next.IsEmpty() {
20978 break
20979 }
20980 }
20981 return nil
20982 }
20983
20984
20985
20986
20987 func (page *ListVpnGatewaysResultPage) Next() error {
20988 return page.NextWithContext(context.Background())
20989 }
20990
20991
20992 func (page ListVpnGatewaysResultPage) NotDone() bool {
20993 return !page.lvgr.IsEmpty()
20994 }
20995
20996
20997 func (page ListVpnGatewaysResultPage) Response() ListVpnGatewaysResult {
20998 return page.lvgr
20999 }
21000
21001
21002 func (page ListVpnGatewaysResultPage) Values() []VpnGateway {
21003 if page.lvgr.IsEmpty() {
21004 return nil
21005 }
21006 return *page.lvgr.Value
21007 }
21008
21009
21010 func NewListVpnGatewaysResultPage(cur ListVpnGatewaysResult, getNextPage func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error)) ListVpnGatewaysResultPage {
21011 return ListVpnGatewaysResultPage{
21012 fn: getNextPage,
21013 lvgr: cur,
21014 }
21015 }
21016
21017
21018
21019 type ListVpnServerConfigurationsResult struct {
21020 autorest.Response `json:"-"`
21021
21022 Value *[]VpnServerConfiguration `json:"value,omitempty"`
21023
21024 NextLink *string `json:"nextLink,omitempty"`
21025 }
21026
21027
21028
21029 type ListVpnServerConfigurationsResultIterator struct {
21030 i int
21031 page ListVpnServerConfigurationsResultPage
21032 }
21033
21034
21035
21036 func (iter *ListVpnServerConfigurationsResultIterator) NextWithContext(ctx context.Context) (err error) {
21037 if tracing.IsEnabled() {
21038 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationsResultIterator.NextWithContext")
21039 defer func() {
21040 sc := -1
21041 if iter.Response().Response.Response != nil {
21042 sc = iter.Response().Response.Response.StatusCode
21043 }
21044 tracing.EndSpan(ctx, sc, err)
21045 }()
21046 }
21047 iter.i++
21048 if iter.i < len(iter.page.Values()) {
21049 return nil
21050 }
21051 err = iter.page.NextWithContext(ctx)
21052 if err != nil {
21053 iter.i--
21054 return err
21055 }
21056 iter.i = 0
21057 return nil
21058 }
21059
21060
21061
21062
21063 func (iter *ListVpnServerConfigurationsResultIterator) Next() error {
21064 return iter.NextWithContext(context.Background())
21065 }
21066
21067
21068 func (iter ListVpnServerConfigurationsResultIterator) NotDone() bool {
21069 return iter.page.NotDone() && iter.i < len(iter.page.Values())
21070 }
21071
21072
21073 func (iter ListVpnServerConfigurationsResultIterator) Response() ListVpnServerConfigurationsResult {
21074 return iter.page.Response()
21075 }
21076
21077
21078
21079 func (iter ListVpnServerConfigurationsResultIterator) Value() VpnServerConfiguration {
21080 if !iter.page.NotDone() {
21081 return VpnServerConfiguration{}
21082 }
21083 return iter.page.Values()[iter.i]
21084 }
21085
21086
21087 func NewListVpnServerConfigurationsResultIterator(page ListVpnServerConfigurationsResultPage) ListVpnServerConfigurationsResultIterator {
21088 return ListVpnServerConfigurationsResultIterator{page: page}
21089 }
21090
21091
21092 func (lvscr ListVpnServerConfigurationsResult) IsEmpty() bool {
21093 return lvscr.Value == nil || len(*lvscr.Value) == 0
21094 }
21095
21096
21097 func (lvscr ListVpnServerConfigurationsResult) hasNextLink() bool {
21098 return lvscr.NextLink != nil && len(*lvscr.NextLink) != 0
21099 }
21100
21101
21102
21103 func (lvscr ListVpnServerConfigurationsResult) listVpnServerConfigurationsResultPreparer(ctx context.Context) (*http.Request, error) {
21104 if !lvscr.hasNextLink() {
21105 return nil, nil
21106 }
21107 return autorest.Prepare((&http.Request{}).WithContext(ctx),
21108 autorest.AsJSON(),
21109 autorest.AsGet(),
21110 autorest.WithBaseURL(to.String(lvscr.NextLink)))
21111 }
21112
21113
21114 type ListVpnServerConfigurationsResultPage struct {
21115 fn func(context.Context, ListVpnServerConfigurationsResult) (ListVpnServerConfigurationsResult, error)
21116 lvscr ListVpnServerConfigurationsResult
21117 }
21118
21119
21120
21121 func (page *ListVpnServerConfigurationsResultPage) NextWithContext(ctx context.Context) (err error) {
21122 if tracing.IsEnabled() {
21123 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnServerConfigurationsResultPage.NextWithContext")
21124 defer func() {
21125 sc := -1
21126 if page.Response().Response.Response != nil {
21127 sc = page.Response().Response.Response.StatusCode
21128 }
21129 tracing.EndSpan(ctx, sc, err)
21130 }()
21131 }
21132 for {
21133 next, err := page.fn(ctx, page.lvscr)
21134 if err != nil {
21135 return err
21136 }
21137 page.lvscr = next
21138 if !next.hasNextLink() || !next.IsEmpty() {
21139 break
21140 }
21141 }
21142 return nil
21143 }
21144
21145
21146
21147
21148 func (page *ListVpnServerConfigurationsResultPage) Next() error {
21149 return page.NextWithContext(context.Background())
21150 }
21151
21152
21153 func (page ListVpnServerConfigurationsResultPage) NotDone() bool {
21154 return !page.lvscr.IsEmpty()
21155 }
21156
21157
21158 func (page ListVpnServerConfigurationsResultPage) Response() ListVpnServerConfigurationsResult {
21159 return page.lvscr
21160 }
21161
21162
21163 func (page ListVpnServerConfigurationsResultPage) Values() []VpnServerConfiguration {
21164 if page.lvscr.IsEmpty() {
21165 return nil
21166 }
21167 return *page.lvscr.Value
21168 }
21169
21170
21171 func NewListVpnServerConfigurationsResultPage(cur ListVpnServerConfigurationsResult, getNextPage func(context.Context, ListVpnServerConfigurationsResult) (ListVpnServerConfigurationsResult, error)) ListVpnServerConfigurationsResultPage {
21172 return ListVpnServerConfigurationsResultPage{
21173 fn: getNextPage,
21174 lvscr: cur,
21175 }
21176 }
21177
21178
21179
21180 type ListVpnSiteLinkConnectionsResult struct {
21181 autorest.Response `json:"-"`
21182
21183 Value *[]VpnSiteLinkConnection `json:"value,omitempty"`
21184
21185 NextLink *string `json:"nextLink,omitempty"`
21186 }
21187
21188
21189
21190 type ListVpnSiteLinkConnectionsResultIterator struct {
21191 i int
21192 page ListVpnSiteLinkConnectionsResultPage
21193 }
21194
21195
21196
21197 func (iter *ListVpnSiteLinkConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) {
21198 if tracing.IsEnabled() {
21199 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinkConnectionsResultIterator.NextWithContext")
21200 defer func() {
21201 sc := -1
21202 if iter.Response().Response.Response != nil {
21203 sc = iter.Response().Response.Response.StatusCode
21204 }
21205 tracing.EndSpan(ctx, sc, err)
21206 }()
21207 }
21208 iter.i++
21209 if iter.i < len(iter.page.Values()) {
21210 return nil
21211 }
21212 err = iter.page.NextWithContext(ctx)
21213 if err != nil {
21214 iter.i--
21215 return err
21216 }
21217 iter.i = 0
21218 return nil
21219 }
21220
21221
21222
21223
21224 func (iter *ListVpnSiteLinkConnectionsResultIterator) Next() error {
21225 return iter.NextWithContext(context.Background())
21226 }
21227
21228
21229 func (iter ListVpnSiteLinkConnectionsResultIterator) NotDone() bool {
21230 return iter.page.NotDone() && iter.i < len(iter.page.Values())
21231 }
21232
21233
21234 func (iter ListVpnSiteLinkConnectionsResultIterator) Response() ListVpnSiteLinkConnectionsResult {
21235 return iter.page.Response()
21236 }
21237
21238
21239
21240 func (iter ListVpnSiteLinkConnectionsResultIterator) Value() VpnSiteLinkConnection {
21241 if !iter.page.NotDone() {
21242 return VpnSiteLinkConnection{}
21243 }
21244 return iter.page.Values()[iter.i]
21245 }
21246
21247
21248 func NewListVpnSiteLinkConnectionsResultIterator(page ListVpnSiteLinkConnectionsResultPage) ListVpnSiteLinkConnectionsResultIterator {
21249 return ListVpnSiteLinkConnectionsResultIterator{page: page}
21250 }
21251
21252
21253 func (lvslcr ListVpnSiteLinkConnectionsResult) IsEmpty() bool {
21254 return lvslcr.Value == nil || len(*lvslcr.Value) == 0
21255 }
21256
21257
21258 func (lvslcr ListVpnSiteLinkConnectionsResult) hasNextLink() bool {
21259 return lvslcr.NextLink != nil && len(*lvslcr.NextLink) != 0
21260 }
21261
21262
21263
21264 func (lvslcr ListVpnSiteLinkConnectionsResult) listVpnSiteLinkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) {
21265 if !lvslcr.hasNextLink() {
21266 return nil, nil
21267 }
21268 return autorest.Prepare((&http.Request{}).WithContext(ctx),
21269 autorest.AsJSON(),
21270 autorest.AsGet(),
21271 autorest.WithBaseURL(to.String(lvslcr.NextLink)))
21272 }
21273
21274
21275 type ListVpnSiteLinkConnectionsResultPage struct {
21276 fn func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error)
21277 lvslcr ListVpnSiteLinkConnectionsResult
21278 }
21279
21280
21281
21282 func (page *ListVpnSiteLinkConnectionsResultPage) NextWithContext(ctx context.Context) (err error) {
21283 if tracing.IsEnabled() {
21284 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinkConnectionsResultPage.NextWithContext")
21285 defer func() {
21286 sc := -1
21287 if page.Response().Response.Response != nil {
21288 sc = page.Response().Response.Response.StatusCode
21289 }
21290 tracing.EndSpan(ctx, sc, err)
21291 }()
21292 }
21293 for {
21294 next, err := page.fn(ctx, page.lvslcr)
21295 if err != nil {
21296 return err
21297 }
21298 page.lvslcr = next
21299 if !next.hasNextLink() || !next.IsEmpty() {
21300 break
21301 }
21302 }
21303 return nil
21304 }
21305
21306
21307
21308
21309 func (page *ListVpnSiteLinkConnectionsResultPage) Next() error {
21310 return page.NextWithContext(context.Background())
21311 }
21312
21313
21314 func (page ListVpnSiteLinkConnectionsResultPage) NotDone() bool {
21315 return !page.lvslcr.IsEmpty()
21316 }
21317
21318
21319 func (page ListVpnSiteLinkConnectionsResultPage) Response() ListVpnSiteLinkConnectionsResult {
21320 return page.lvslcr
21321 }
21322
21323
21324 func (page ListVpnSiteLinkConnectionsResultPage) Values() []VpnSiteLinkConnection {
21325 if page.lvslcr.IsEmpty() {
21326 return nil
21327 }
21328 return *page.lvslcr.Value
21329 }
21330
21331
21332 func NewListVpnSiteLinkConnectionsResultPage(cur ListVpnSiteLinkConnectionsResult, getNextPage func(context.Context, ListVpnSiteLinkConnectionsResult) (ListVpnSiteLinkConnectionsResult, error)) ListVpnSiteLinkConnectionsResultPage {
21333 return ListVpnSiteLinkConnectionsResultPage{
21334 fn: getNextPage,
21335 lvslcr: cur,
21336 }
21337 }
21338
21339
21340
21341 type ListVpnSiteLinksResult struct {
21342 autorest.Response `json:"-"`
21343
21344 Value *[]VpnSiteLink `json:"value,omitempty"`
21345
21346 NextLink *string `json:"nextLink,omitempty"`
21347 }
21348
21349
21350 type ListVpnSiteLinksResultIterator struct {
21351 i int
21352 page ListVpnSiteLinksResultPage
21353 }
21354
21355
21356
21357 func (iter *ListVpnSiteLinksResultIterator) NextWithContext(ctx context.Context) (err error) {
21358 if tracing.IsEnabled() {
21359 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinksResultIterator.NextWithContext")
21360 defer func() {
21361 sc := -1
21362 if iter.Response().Response.Response != nil {
21363 sc = iter.Response().Response.Response.StatusCode
21364 }
21365 tracing.EndSpan(ctx, sc, err)
21366 }()
21367 }
21368 iter.i++
21369 if iter.i < len(iter.page.Values()) {
21370 return nil
21371 }
21372 err = iter.page.NextWithContext(ctx)
21373 if err != nil {
21374 iter.i--
21375 return err
21376 }
21377 iter.i = 0
21378 return nil
21379 }
21380
21381
21382
21383
21384 func (iter *ListVpnSiteLinksResultIterator) Next() error {
21385 return iter.NextWithContext(context.Background())
21386 }
21387
21388
21389 func (iter ListVpnSiteLinksResultIterator) NotDone() bool {
21390 return iter.page.NotDone() && iter.i < len(iter.page.Values())
21391 }
21392
21393
21394 func (iter ListVpnSiteLinksResultIterator) Response() ListVpnSiteLinksResult {
21395 return iter.page.Response()
21396 }
21397
21398
21399
21400 func (iter ListVpnSiteLinksResultIterator) Value() VpnSiteLink {
21401 if !iter.page.NotDone() {
21402 return VpnSiteLink{}
21403 }
21404 return iter.page.Values()[iter.i]
21405 }
21406
21407
21408 func NewListVpnSiteLinksResultIterator(page ListVpnSiteLinksResultPage) ListVpnSiteLinksResultIterator {
21409 return ListVpnSiteLinksResultIterator{page: page}
21410 }
21411
21412
21413 func (lvslr ListVpnSiteLinksResult) IsEmpty() bool {
21414 return lvslr.Value == nil || len(*lvslr.Value) == 0
21415 }
21416
21417
21418 func (lvslr ListVpnSiteLinksResult) hasNextLink() bool {
21419 return lvslr.NextLink != nil && len(*lvslr.NextLink) != 0
21420 }
21421
21422
21423
21424 func (lvslr ListVpnSiteLinksResult) listVpnSiteLinksResultPreparer(ctx context.Context) (*http.Request, error) {
21425 if !lvslr.hasNextLink() {
21426 return nil, nil
21427 }
21428 return autorest.Prepare((&http.Request{}).WithContext(ctx),
21429 autorest.AsJSON(),
21430 autorest.AsGet(),
21431 autorest.WithBaseURL(to.String(lvslr.NextLink)))
21432 }
21433
21434
21435 type ListVpnSiteLinksResultPage struct {
21436 fn func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error)
21437 lvslr ListVpnSiteLinksResult
21438 }
21439
21440
21441
21442 func (page *ListVpnSiteLinksResultPage) NextWithContext(ctx context.Context) (err error) {
21443 if tracing.IsEnabled() {
21444 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSiteLinksResultPage.NextWithContext")
21445 defer func() {
21446 sc := -1
21447 if page.Response().Response.Response != nil {
21448 sc = page.Response().Response.Response.StatusCode
21449 }
21450 tracing.EndSpan(ctx, sc, err)
21451 }()
21452 }
21453 for {
21454 next, err := page.fn(ctx, page.lvslr)
21455 if err != nil {
21456 return err
21457 }
21458 page.lvslr = next
21459 if !next.hasNextLink() || !next.IsEmpty() {
21460 break
21461 }
21462 }
21463 return nil
21464 }
21465
21466
21467
21468
21469 func (page *ListVpnSiteLinksResultPage) Next() error {
21470 return page.NextWithContext(context.Background())
21471 }
21472
21473
21474 func (page ListVpnSiteLinksResultPage) NotDone() bool {
21475 return !page.lvslr.IsEmpty()
21476 }
21477
21478
21479 func (page ListVpnSiteLinksResultPage) Response() ListVpnSiteLinksResult {
21480 return page.lvslr
21481 }
21482
21483
21484 func (page ListVpnSiteLinksResultPage) Values() []VpnSiteLink {
21485 if page.lvslr.IsEmpty() {
21486 return nil
21487 }
21488 return *page.lvslr.Value
21489 }
21490
21491
21492 func NewListVpnSiteLinksResultPage(cur ListVpnSiteLinksResult, getNextPage func(context.Context, ListVpnSiteLinksResult) (ListVpnSiteLinksResult, error)) ListVpnSiteLinksResultPage {
21493 return ListVpnSiteLinksResultPage{
21494 fn: getNextPage,
21495 lvslr: cur,
21496 }
21497 }
21498
21499
21500
21501 type ListVpnSitesResult struct {
21502 autorest.Response `json:"-"`
21503
21504 Value *[]VpnSite `json:"value,omitempty"`
21505
21506 NextLink *string `json:"nextLink,omitempty"`
21507 }
21508
21509
21510 type ListVpnSitesResultIterator struct {
21511 i int
21512 page ListVpnSitesResultPage
21513 }
21514
21515
21516
21517 func (iter *ListVpnSitesResultIterator) NextWithContext(ctx context.Context) (err error) {
21518 if tracing.IsEnabled() {
21519 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultIterator.NextWithContext")
21520 defer func() {
21521 sc := -1
21522 if iter.Response().Response.Response != nil {
21523 sc = iter.Response().Response.Response.StatusCode
21524 }
21525 tracing.EndSpan(ctx, sc, err)
21526 }()
21527 }
21528 iter.i++
21529 if iter.i < len(iter.page.Values()) {
21530 return nil
21531 }
21532 err = iter.page.NextWithContext(ctx)
21533 if err != nil {
21534 iter.i--
21535 return err
21536 }
21537 iter.i = 0
21538 return nil
21539 }
21540
21541
21542
21543
21544 func (iter *ListVpnSitesResultIterator) Next() error {
21545 return iter.NextWithContext(context.Background())
21546 }
21547
21548
21549 func (iter ListVpnSitesResultIterator) NotDone() bool {
21550 return iter.page.NotDone() && iter.i < len(iter.page.Values())
21551 }
21552
21553
21554 func (iter ListVpnSitesResultIterator) Response() ListVpnSitesResult {
21555 return iter.page.Response()
21556 }
21557
21558
21559
21560 func (iter ListVpnSitesResultIterator) Value() VpnSite {
21561 if !iter.page.NotDone() {
21562 return VpnSite{}
21563 }
21564 return iter.page.Values()[iter.i]
21565 }
21566
21567
21568 func NewListVpnSitesResultIterator(page ListVpnSitesResultPage) ListVpnSitesResultIterator {
21569 return ListVpnSitesResultIterator{page: page}
21570 }
21571
21572
21573 func (lvsr ListVpnSitesResult) IsEmpty() bool {
21574 return lvsr.Value == nil || len(*lvsr.Value) == 0
21575 }
21576
21577
21578 func (lvsr ListVpnSitesResult) hasNextLink() bool {
21579 return lvsr.NextLink != nil && len(*lvsr.NextLink) != 0
21580 }
21581
21582
21583
21584 func (lvsr ListVpnSitesResult) listVpnSitesResultPreparer(ctx context.Context) (*http.Request, error) {
21585 if !lvsr.hasNextLink() {
21586 return nil, nil
21587 }
21588 return autorest.Prepare((&http.Request{}).WithContext(ctx),
21589 autorest.AsJSON(),
21590 autorest.AsGet(),
21591 autorest.WithBaseURL(to.String(lvsr.NextLink)))
21592 }
21593
21594
21595 type ListVpnSitesResultPage struct {
21596 fn func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error)
21597 lvsr ListVpnSitesResult
21598 }
21599
21600
21601
21602 func (page *ListVpnSitesResultPage) NextWithContext(ctx context.Context) (err error) {
21603 if tracing.IsEnabled() {
21604 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultPage.NextWithContext")
21605 defer func() {
21606 sc := -1
21607 if page.Response().Response.Response != nil {
21608 sc = page.Response().Response.Response.StatusCode
21609 }
21610 tracing.EndSpan(ctx, sc, err)
21611 }()
21612 }
21613 for {
21614 next, err := page.fn(ctx, page.lvsr)
21615 if err != nil {
21616 return err
21617 }
21618 page.lvsr = next
21619 if !next.hasNextLink() || !next.IsEmpty() {
21620 break
21621 }
21622 }
21623 return nil
21624 }
21625
21626
21627
21628
21629 func (page *ListVpnSitesResultPage) Next() error {
21630 return page.NextWithContext(context.Background())
21631 }
21632
21633
21634 func (page ListVpnSitesResultPage) NotDone() bool {
21635 return !page.lvsr.IsEmpty()
21636 }
21637
21638
21639 func (page ListVpnSitesResultPage) Response() ListVpnSitesResult {
21640 return page.lvsr
21641 }
21642
21643
21644 func (page ListVpnSitesResultPage) Values() []VpnSite {
21645 if page.lvsr.IsEmpty() {
21646 return nil
21647 }
21648 return *page.lvsr.Value
21649 }
21650
21651
21652 func NewListVpnSitesResultPage(cur ListVpnSitesResult, getNextPage func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error)) ListVpnSitesResultPage {
21653 return ListVpnSitesResultPage{
21654 fn: getNextPage,
21655 lvsr: cur,
21656 }
21657 }
21658
21659
21660 type LoadBalancer struct {
21661 autorest.Response `json:"-"`
21662
21663 Sku *LoadBalancerSku `json:"sku,omitempty"`
21664
21665 *LoadBalancerPropertiesFormat `json:"properties,omitempty"`
21666
21667 Etag *string `json:"etag,omitempty"`
21668
21669 ID *string `json:"id,omitempty"`
21670
21671 Name *string `json:"name,omitempty"`
21672
21673 Type *string `json:"type,omitempty"`
21674
21675 Location *string `json:"location,omitempty"`
21676
21677 Tags map[string]*string `json:"tags"`
21678 }
21679
21680
21681 func (lb LoadBalancer) MarshalJSON() ([]byte, error) {
21682 objectMap := make(map[string]interface{})
21683 if lb.Sku != nil {
21684 objectMap["sku"] = lb.Sku
21685 }
21686 if lb.LoadBalancerPropertiesFormat != nil {
21687 objectMap["properties"] = lb.LoadBalancerPropertiesFormat
21688 }
21689 if lb.ID != nil {
21690 objectMap["id"] = lb.ID
21691 }
21692 if lb.Location != nil {
21693 objectMap["location"] = lb.Location
21694 }
21695 if lb.Tags != nil {
21696 objectMap["tags"] = lb.Tags
21697 }
21698 return json.Marshal(objectMap)
21699 }
21700
21701
21702 func (lb *LoadBalancer) UnmarshalJSON(body []byte) error {
21703 var m map[string]*json.RawMessage
21704 err := json.Unmarshal(body, &m)
21705 if err != nil {
21706 return err
21707 }
21708 for k, v := range m {
21709 switch k {
21710 case "sku":
21711 if v != nil {
21712 var sku LoadBalancerSku
21713 err = json.Unmarshal(*v, &sku)
21714 if err != nil {
21715 return err
21716 }
21717 lb.Sku = &sku
21718 }
21719 case "properties":
21720 if v != nil {
21721 var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat
21722 err = json.Unmarshal(*v, &loadBalancerPropertiesFormat)
21723 if err != nil {
21724 return err
21725 }
21726 lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat
21727 }
21728 case "etag":
21729 if v != nil {
21730 var etag string
21731 err = json.Unmarshal(*v, &etag)
21732 if err != nil {
21733 return err
21734 }
21735 lb.Etag = &etag
21736 }
21737 case "id":
21738 if v != nil {
21739 var ID string
21740 err = json.Unmarshal(*v, &ID)
21741 if err != nil {
21742 return err
21743 }
21744 lb.ID = &ID
21745 }
21746 case "name":
21747 if v != nil {
21748 var name string
21749 err = json.Unmarshal(*v, &name)
21750 if err != nil {
21751 return err
21752 }
21753 lb.Name = &name
21754 }
21755 case "type":
21756 if v != nil {
21757 var typeVar string
21758 err = json.Unmarshal(*v, &typeVar)
21759 if err != nil {
21760 return err
21761 }
21762 lb.Type = &typeVar
21763 }
21764 case "location":
21765 if v != nil {
21766 var location string
21767 err = json.Unmarshal(*v, &location)
21768 if err != nil {
21769 return err
21770 }
21771 lb.Location = &location
21772 }
21773 case "tags":
21774 if v != nil {
21775 var tags map[string]*string
21776 err = json.Unmarshal(*v, &tags)
21777 if err != nil {
21778 return err
21779 }
21780 lb.Tags = tags
21781 }
21782 }
21783 }
21784
21785 return nil
21786 }
21787
21788
21789 type LoadBalancerBackendAddress struct {
21790
21791 *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"`
21792
21793 Name *string `json:"name,omitempty"`
21794 }
21795
21796
21797 func (lbba LoadBalancerBackendAddress) MarshalJSON() ([]byte, error) {
21798 objectMap := make(map[string]interface{})
21799 if lbba.LoadBalancerBackendAddressPropertiesFormat != nil {
21800 objectMap["properties"] = lbba.LoadBalancerBackendAddressPropertiesFormat
21801 }
21802 if lbba.Name != nil {
21803 objectMap["name"] = lbba.Name
21804 }
21805 return json.Marshal(objectMap)
21806 }
21807
21808
21809 func (lbba *LoadBalancerBackendAddress) UnmarshalJSON(body []byte) error {
21810 var m map[string]*json.RawMessage
21811 err := json.Unmarshal(body, &m)
21812 if err != nil {
21813 return err
21814 }
21815 for k, v := range m {
21816 switch k {
21817 case "properties":
21818 if v != nil {
21819 var loadBalancerBackendAddressPropertiesFormat LoadBalancerBackendAddressPropertiesFormat
21820 err = json.Unmarshal(*v, &loadBalancerBackendAddressPropertiesFormat)
21821 if err != nil {
21822 return err
21823 }
21824 lbba.LoadBalancerBackendAddressPropertiesFormat = &loadBalancerBackendAddressPropertiesFormat
21825 }
21826 case "name":
21827 if v != nil {
21828 var name string
21829 err = json.Unmarshal(*v, &name)
21830 if err != nil {
21831 return err
21832 }
21833 lbba.Name = &name
21834 }
21835 }
21836 }
21837
21838 return nil
21839 }
21840
21841
21842 type LoadBalancerBackendAddressPoolListResult struct {
21843 autorest.Response `json:"-"`
21844
21845 Value *[]BackendAddressPool `json:"value,omitempty"`
21846
21847 NextLink *string `json:"nextLink,omitempty"`
21848 }
21849
21850
21851 func (lbbaplr LoadBalancerBackendAddressPoolListResult) MarshalJSON() ([]byte, error) {
21852 objectMap := make(map[string]interface{})
21853 if lbbaplr.Value != nil {
21854 objectMap["value"] = lbbaplr.Value
21855 }
21856 return json.Marshal(objectMap)
21857 }
21858
21859
21860
21861 type LoadBalancerBackendAddressPoolListResultIterator struct {
21862 i int
21863 page LoadBalancerBackendAddressPoolListResultPage
21864 }
21865
21866
21867
21868 func (iter *LoadBalancerBackendAddressPoolListResultIterator) NextWithContext(ctx context.Context) (err error) {
21869 if tracing.IsEnabled() {
21870 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultIterator.NextWithContext")
21871 defer func() {
21872 sc := -1
21873 if iter.Response().Response.Response != nil {
21874 sc = iter.Response().Response.Response.StatusCode
21875 }
21876 tracing.EndSpan(ctx, sc, err)
21877 }()
21878 }
21879 iter.i++
21880 if iter.i < len(iter.page.Values()) {
21881 return nil
21882 }
21883 err = iter.page.NextWithContext(ctx)
21884 if err != nil {
21885 iter.i--
21886 return err
21887 }
21888 iter.i = 0
21889 return nil
21890 }
21891
21892
21893
21894
21895 func (iter *LoadBalancerBackendAddressPoolListResultIterator) Next() error {
21896 return iter.NextWithContext(context.Background())
21897 }
21898
21899
21900 func (iter LoadBalancerBackendAddressPoolListResultIterator) NotDone() bool {
21901 return iter.page.NotDone() && iter.i < len(iter.page.Values())
21902 }
21903
21904
21905 func (iter LoadBalancerBackendAddressPoolListResultIterator) Response() LoadBalancerBackendAddressPoolListResult {
21906 return iter.page.Response()
21907 }
21908
21909
21910
21911 func (iter LoadBalancerBackendAddressPoolListResultIterator) Value() BackendAddressPool {
21912 if !iter.page.NotDone() {
21913 return BackendAddressPool{}
21914 }
21915 return iter.page.Values()[iter.i]
21916 }
21917
21918
21919 func NewLoadBalancerBackendAddressPoolListResultIterator(page LoadBalancerBackendAddressPoolListResultPage) LoadBalancerBackendAddressPoolListResultIterator {
21920 return LoadBalancerBackendAddressPoolListResultIterator{page: page}
21921 }
21922
21923
21924 func (lbbaplr LoadBalancerBackendAddressPoolListResult) IsEmpty() bool {
21925 return lbbaplr.Value == nil || len(*lbbaplr.Value) == 0
21926 }
21927
21928
21929 func (lbbaplr LoadBalancerBackendAddressPoolListResult) hasNextLink() bool {
21930 return lbbaplr.NextLink != nil && len(*lbbaplr.NextLink) != 0
21931 }
21932
21933
21934
21935 func (lbbaplr LoadBalancerBackendAddressPoolListResult) loadBalancerBackendAddressPoolListResultPreparer(ctx context.Context) (*http.Request, error) {
21936 if !lbbaplr.hasNextLink() {
21937 return nil, nil
21938 }
21939 return autorest.Prepare((&http.Request{}).WithContext(ctx),
21940 autorest.AsJSON(),
21941 autorest.AsGet(),
21942 autorest.WithBaseURL(to.String(lbbaplr.NextLink)))
21943 }
21944
21945
21946 type LoadBalancerBackendAddressPoolListResultPage struct {
21947 fn func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error)
21948 lbbaplr LoadBalancerBackendAddressPoolListResult
21949 }
21950
21951
21952
21953 func (page *LoadBalancerBackendAddressPoolListResultPage) NextWithContext(ctx context.Context) (err error) {
21954 if tracing.IsEnabled() {
21955 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultPage.NextWithContext")
21956 defer func() {
21957 sc := -1
21958 if page.Response().Response.Response != nil {
21959 sc = page.Response().Response.Response.StatusCode
21960 }
21961 tracing.EndSpan(ctx, sc, err)
21962 }()
21963 }
21964 for {
21965 next, err := page.fn(ctx, page.lbbaplr)
21966 if err != nil {
21967 return err
21968 }
21969 page.lbbaplr = next
21970 if !next.hasNextLink() || !next.IsEmpty() {
21971 break
21972 }
21973 }
21974 return nil
21975 }
21976
21977
21978
21979
21980 func (page *LoadBalancerBackendAddressPoolListResultPage) Next() error {
21981 return page.NextWithContext(context.Background())
21982 }
21983
21984
21985 func (page LoadBalancerBackendAddressPoolListResultPage) NotDone() bool {
21986 return !page.lbbaplr.IsEmpty()
21987 }
21988
21989
21990 func (page LoadBalancerBackendAddressPoolListResultPage) Response() LoadBalancerBackendAddressPoolListResult {
21991 return page.lbbaplr
21992 }
21993
21994
21995 func (page LoadBalancerBackendAddressPoolListResultPage) Values() []BackendAddressPool {
21996 if page.lbbaplr.IsEmpty() {
21997 return nil
21998 }
21999 return *page.lbbaplr.Value
22000 }
22001
22002
22003 func NewLoadBalancerBackendAddressPoolListResultPage(cur LoadBalancerBackendAddressPoolListResult, getNextPage func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error)) LoadBalancerBackendAddressPoolListResultPage {
22004 return LoadBalancerBackendAddressPoolListResultPage{
22005 fn: getNextPage,
22006 lbbaplr: cur,
22007 }
22008 }
22009
22010
22011
22012 type LoadBalancerBackendAddressPoolsCreateOrUpdateFuture struct {
22013 azure.FutureAPI
22014
22015
22016 Result func(LoadBalancerBackendAddressPoolsClient) (BackendAddressPool, error)
22017 }
22018
22019
22020 func (future *LoadBalancerBackendAddressPoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
22021 var azFuture azure.Future
22022 if err := json.Unmarshal(body, &azFuture); err != nil {
22023 return err
22024 }
22025 future.FutureAPI = &azFuture
22026 future.Result = future.result
22027 return nil
22028 }
22029
22030
22031 func (future *LoadBalancerBackendAddressPoolsCreateOrUpdateFuture) result(client LoadBalancerBackendAddressPoolsClient) (bap BackendAddressPool, err error) {
22032 var done bool
22033 done, err = future.DoneWithContext(context.Background(), client)
22034 if err != nil {
22035 err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
22036 return
22037 }
22038 if !done {
22039 bap.Response.Response = future.Response()
22040 err = azure.NewAsyncOpIncompleteError("network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture")
22041 return
22042 }
22043 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
22044 if bap.Response.Response, err = future.GetResult(sender); err == nil && bap.Response.Response.StatusCode != http.StatusNoContent {
22045 bap, err = client.CreateOrUpdateResponder(bap.Response.Response)
22046 if err != nil {
22047 err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsCreateOrUpdateFuture", "Result", bap.Response.Response, "Failure responding to request")
22048 }
22049 }
22050 return
22051 }
22052
22053
22054
22055 type LoadBalancerBackendAddressPoolsDeleteFuture struct {
22056 azure.FutureAPI
22057
22058
22059 Result func(LoadBalancerBackendAddressPoolsClient) (autorest.Response, error)
22060 }
22061
22062
22063 func (future *LoadBalancerBackendAddressPoolsDeleteFuture) UnmarshalJSON(body []byte) error {
22064 var azFuture azure.Future
22065 if err := json.Unmarshal(body, &azFuture); err != nil {
22066 return err
22067 }
22068 future.FutureAPI = &azFuture
22069 future.Result = future.result
22070 return nil
22071 }
22072
22073
22074 func (future *LoadBalancerBackendAddressPoolsDeleteFuture) result(client LoadBalancerBackendAddressPoolsClient) (ar autorest.Response, err error) {
22075 var done bool
22076 done, err = future.DoneWithContext(context.Background(), client)
22077 if err != nil {
22078 err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsDeleteFuture", "Result", future.Response(), "Polling failure")
22079 return
22080 }
22081 if !done {
22082 ar.Response = future.Response()
22083 err = azure.NewAsyncOpIncompleteError("network.LoadBalancerBackendAddressPoolsDeleteFuture")
22084 return
22085 }
22086 ar.Response = future.Response()
22087 return
22088 }
22089
22090
22091 type LoadBalancerBackendAddressPropertiesFormat struct {
22092
22093 VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"`
22094
22095 IPAddress *string `json:"ipAddress,omitempty"`
22096
22097 NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"`
22098 }
22099
22100
22101 func (lbbapf LoadBalancerBackendAddressPropertiesFormat) MarshalJSON() ([]byte, error) {
22102 objectMap := make(map[string]interface{})
22103 if lbbapf.VirtualNetwork != nil {
22104 objectMap["virtualNetwork"] = lbbapf.VirtualNetwork
22105 }
22106 if lbbapf.IPAddress != nil {
22107 objectMap["ipAddress"] = lbbapf.IPAddress
22108 }
22109 return json.Marshal(objectMap)
22110 }
22111
22112
22113 type LoadBalancerFrontendIPConfigurationListResult struct {
22114 autorest.Response `json:"-"`
22115
22116 Value *[]FrontendIPConfiguration `json:"value,omitempty"`
22117
22118 NextLink *string `json:"nextLink,omitempty"`
22119 }
22120
22121
22122 func (lbficlr LoadBalancerFrontendIPConfigurationListResult) MarshalJSON() ([]byte, error) {
22123 objectMap := make(map[string]interface{})
22124 if lbficlr.Value != nil {
22125 objectMap["value"] = lbficlr.Value
22126 }
22127 return json.Marshal(objectMap)
22128 }
22129
22130
22131
22132 type LoadBalancerFrontendIPConfigurationListResultIterator struct {
22133 i int
22134 page LoadBalancerFrontendIPConfigurationListResultPage
22135 }
22136
22137
22138
22139 func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) {
22140 if tracing.IsEnabled() {
22141 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultIterator.NextWithContext")
22142 defer func() {
22143 sc := -1
22144 if iter.Response().Response.Response != nil {
22145 sc = iter.Response().Response.Response.StatusCode
22146 }
22147 tracing.EndSpan(ctx, sc, err)
22148 }()
22149 }
22150 iter.i++
22151 if iter.i < len(iter.page.Values()) {
22152 return nil
22153 }
22154 err = iter.page.NextWithContext(ctx)
22155 if err != nil {
22156 iter.i--
22157 return err
22158 }
22159 iter.i = 0
22160 return nil
22161 }
22162
22163
22164
22165
22166 func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) Next() error {
22167 return iter.NextWithContext(context.Background())
22168 }
22169
22170
22171 func (iter LoadBalancerFrontendIPConfigurationListResultIterator) NotDone() bool {
22172 return iter.page.NotDone() && iter.i < len(iter.page.Values())
22173 }
22174
22175
22176 func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Response() LoadBalancerFrontendIPConfigurationListResult {
22177 return iter.page.Response()
22178 }
22179
22180
22181
22182 func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Value() FrontendIPConfiguration {
22183 if !iter.page.NotDone() {
22184 return FrontendIPConfiguration{}
22185 }
22186 return iter.page.Values()[iter.i]
22187 }
22188
22189
22190 func NewLoadBalancerFrontendIPConfigurationListResultIterator(page LoadBalancerFrontendIPConfigurationListResultPage) LoadBalancerFrontendIPConfigurationListResultIterator {
22191 return LoadBalancerFrontendIPConfigurationListResultIterator{page: page}
22192 }
22193
22194
22195 func (lbficlr LoadBalancerFrontendIPConfigurationListResult) IsEmpty() bool {
22196 return lbficlr.Value == nil || len(*lbficlr.Value) == 0
22197 }
22198
22199
22200 func (lbficlr LoadBalancerFrontendIPConfigurationListResult) hasNextLink() bool {
22201 return lbficlr.NextLink != nil && len(*lbficlr.NextLink) != 0
22202 }
22203
22204
22205
22206 func (lbficlr LoadBalancerFrontendIPConfigurationListResult) loadBalancerFrontendIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) {
22207 if !lbficlr.hasNextLink() {
22208 return nil, nil
22209 }
22210 return autorest.Prepare((&http.Request{}).WithContext(ctx),
22211 autorest.AsJSON(),
22212 autorest.AsGet(),
22213 autorest.WithBaseURL(to.String(lbficlr.NextLink)))
22214 }
22215
22216
22217 type LoadBalancerFrontendIPConfigurationListResultPage struct {
22218 fn func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error)
22219 lbficlr LoadBalancerFrontendIPConfigurationListResult
22220 }
22221
22222
22223
22224 func (page *LoadBalancerFrontendIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) {
22225 if tracing.IsEnabled() {
22226 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultPage.NextWithContext")
22227 defer func() {
22228 sc := -1
22229 if page.Response().Response.Response != nil {
22230 sc = page.Response().Response.Response.StatusCode
22231 }
22232 tracing.EndSpan(ctx, sc, err)
22233 }()
22234 }
22235 for {
22236 next, err := page.fn(ctx, page.lbficlr)
22237 if err != nil {
22238 return err
22239 }
22240 page.lbficlr = next
22241 if !next.hasNextLink() || !next.IsEmpty() {
22242 break
22243 }
22244 }
22245 return nil
22246 }
22247
22248
22249
22250
22251 func (page *LoadBalancerFrontendIPConfigurationListResultPage) Next() error {
22252 return page.NextWithContext(context.Background())
22253 }
22254
22255
22256 func (page LoadBalancerFrontendIPConfigurationListResultPage) NotDone() bool {
22257 return !page.lbficlr.IsEmpty()
22258 }
22259
22260
22261 func (page LoadBalancerFrontendIPConfigurationListResultPage) Response() LoadBalancerFrontendIPConfigurationListResult {
22262 return page.lbficlr
22263 }
22264
22265
22266 func (page LoadBalancerFrontendIPConfigurationListResultPage) Values() []FrontendIPConfiguration {
22267 if page.lbficlr.IsEmpty() {
22268 return nil
22269 }
22270 return *page.lbficlr.Value
22271 }
22272
22273
22274 func NewLoadBalancerFrontendIPConfigurationListResultPage(cur LoadBalancerFrontendIPConfigurationListResult, getNextPage func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error)) LoadBalancerFrontendIPConfigurationListResultPage {
22275 return LoadBalancerFrontendIPConfigurationListResultPage{
22276 fn: getNextPage,
22277 lbficlr: cur,
22278 }
22279 }
22280
22281
22282 type LoadBalancerListResult struct {
22283 autorest.Response `json:"-"`
22284
22285 Value *[]LoadBalancer `json:"value,omitempty"`
22286
22287 NextLink *string `json:"nextLink,omitempty"`
22288 }
22289
22290
22291 func (lblr LoadBalancerListResult) MarshalJSON() ([]byte, error) {
22292 objectMap := make(map[string]interface{})
22293 if lblr.Value != nil {
22294 objectMap["value"] = lblr.Value
22295 }
22296 return json.Marshal(objectMap)
22297 }
22298
22299
22300 type LoadBalancerListResultIterator struct {
22301 i int
22302 page LoadBalancerListResultPage
22303 }
22304
22305
22306
22307 func (iter *LoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) {
22308 if tracing.IsEnabled() {
22309 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultIterator.NextWithContext")
22310 defer func() {
22311 sc := -1
22312 if iter.Response().Response.Response != nil {
22313 sc = iter.Response().Response.Response.StatusCode
22314 }
22315 tracing.EndSpan(ctx, sc, err)
22316 }()
22317 }
22318 iter.i++
22319 if iter.i < len(iter.page.Values()) {
22320 return nil
22321 }
22322 err = iter.page.NextWithContext(ctx)
22323 if err != nil {
22324 iter.i--
22325 return err
22326 }
22327 iter.i = 0
22328 return nil
22329 }
22330
22331
22332
22333
22334 func (iter *LoadBalancerListResultIterator) Next() error {
22335 return iter.NextWithContext(context.Background())
22336 }
22337
22338
22339 func (iter LoadBalancerListResultIterator) NotDone() bool {
22340 return iter.page.NotDone() && iter.i < len(iter.page.Values())
22341 }
22342
22343
22344 func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult {
22345 return iter.page.Response()
22346 }
22347
22348
22349
22350 func (iter LoadBalancerListResultIterator) Value() LoadBalancer {
22351 if !iter.page.NotDone() {
22352 return LoadBalancer{}
22353 }
22354 return iter.page.Values()[iter.i]
22355 }
22356
22357
22358 func NewLoadBalancerListResultIterator(page LoadBalancerListResultPage) LoadBalancerListResultIterator {
22359 return LoadBalancerListResultIterator{page: page}
22360 }
22361
22362
22363 func (lblr LoadBalancerListResult) IsEmpty() bool {
22364 return lblr.Value == nil || len(*lblr.Value) == 0
22365 }
22366
22367
22368 func (lblr LoadBalancerListResult) hasNextLink() bool {
22369 return lblr.NextLink != nil && len(*lblr.NextLink) != 0
22370 }
22371
22372
22373
22374 func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) {
22375 if !lblr.hasNextLink() {
22376 return nil, nil
22377 }
22378 return autorest.Prepare((&http.Request{}).WithContext(ctx),
22379 autorest.AsJSON(),
22380 autorest.AsGet(),
22381 autorest.WithBaseURL(to.String(lblr.NextLink)))
22382 }
22383
22384
22385 type LoadBalancerListResultPage struct {
22386 fn func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)
22387 lblr LoadBalancerListResult
22388 }
22389
22390
22391
22392 func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) {
22393 if tracing.IsEnabled() {
22394 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultPage.NextWithContext")
22395 defer func() {
22396 sc := -1
22397 if page.Response().Response.Response != nil {
22398 sc = page.Response().Response.Response.StatusCode
22399 }
22400 tracing.EndSpan(ctx, sc, err)
22401 }()
22402 }
22403 for {
22404 next, err := page.fn(ctx, page.lblr)
22405 if err != nil {
22406 return err
22407 }
22408 page.lblr = next
22409 if !next.hasNextLink() || !next.IsEmpty() {
22410 break
22411 }
22412 }
22413 return nil
22414 }
22415
22416
22417
22418
22419 func (page *LoadBalancerListResultPage) Next() error {
22420 return page.NextWithContext(context.Background())
22421 }
22422
22423
22424 func (page LoadBalancerListResultPage) NotDone() bool {
22425 return !page.lblr.IsEmpty()
22426 }
22427
22428
22429 func (page LoadBalancerListResultPage) Response() LoadBalancerListResult {
22430 return page.lblr
22431 }
22432
22433
22434 func (page LoadBalancerListResultPage) Values() []LoadBalancer {
22435 if page.lblr.IsEmpty() {
22436 return nil
22437 }
22438 return *page.lblr.Value
22439 }
22440
22441
22442 func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage {
22443 return LoadBalancerListResultPage{
22444 fn: getNextPage,
22445 lblr: cur,
22446 }
22447 }
22448
22449
22450 type LoadBalancerLoadBalancingRuleListResult struct {
22451 autorest.Response `json:"-"`
22452
22453 Value *[]LoadBalancingRule `json:"value,omitempty"`
22454
22455 NextLink *string `json:"nextLink,omitempty"`
22456 }
22457
22458
22459 func (lblbrlr LoadBalancerLoadBalancingRuleListResult) MarshalJSON() ([]byte, error) {
22460 objectMap := make(map[string]interface{})
22461 if lblbrlr.Value != nil {
22462 objectMap["value"] = lblbrlr.Value
22463 }
22464 return json.Marshal(objectMap)
22465 }
22466
22467
22468
22469 type LoadBalancerLoadBalancingRuleListResultIterator struct {
22470 i int
22471 page LoadBalancerLoadBalancingRuleListResultPage
22472 }
22473
22474
22475
22476 func (iter *LoadBalancerLoadBalancingRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
22477 if tracing.IsEnabled() {
22478 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultIterator.NextWithContext")
22479 defer func() {
22480 sc := -1
22481 if iter.Response().Response.Response != nil {
22482 sc = iter.Response().Response.Response.StatusCode
22483 }
22484 tracing.EndSpan(ctx, sc, err)
22485 }()
22486 }
22487 iter.i++
22488 if iter.i < len(iter.page.Values()) {
22489 return nil
22490 }
22491 err = iter.page.NextWithContext(ctx)
22492 if err != nil {
22493 iter.i--
22494 return err
22495 }
22496 iter.i = 0
22497 return nil
22498 }
22499
22500
22501
22502
22503 func (iter *LoadBalancerLoadBalancingRuleListResultIterator) Next() error {
22504 return iter.NextWithContext(context.Background())
22505 }
22506
22507
22508 func (iter LoadBalancerLoadBalancingRuleListResultIterator) NotDone() bool {
22509 return iter.page.NotDone() && iter.i < len(iter.page.Values())
22510 }
22511
22512
22513 func (iter LoadBalancerLoadBalancingRuleListResultIterator) Response() LoadBalancerLoadBalancingRuleListResult {
22514 return iter.page.Response()
22515 }
22516
22517
22518
22519 func (iter LoadBalancerLoadBalancingRuleListResultIterator) Value() LoadBalancingRule {
22520 if !iter.page.NotDone() {
22521 return LoadBalancingRule{}
22522 }
22523 return iter.page.Values()[iter.i]
22524 }
22525
22526
22527 func NewLoadBalancerLoadBalancingRuleListResultIterator(page LoadBalancerLoadBalancingRuleListResultPage) LoadBalancerLoadBalancingRuleListResultIterator {
22528 return LoadBalancerLoadBalancingRuleListResultIterator{page: page}
22529 }
22530
22531
22532 func (lblbrlr LoadBalancerLoadBalancingRuleListResult) IsEmpty() bool {
22533 return lblbrlr.Value == nil || len(*lblbrlr.Value) == 0
22534 }
22535
22536
22537 func (lblbrlr LoadBalancerLoadBalancingRuleListResult) hasNextLink() bool {
22538 return lblbrlr.NextLink != nil && len(*lblbrlr.NextLink) != 0
22539 }
22540
22541
22542
22543 func (lblbrlr LoadBalancerLoadBalancingRuleListResult) loadBalancerLoadBalancingRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
22544 if !lblbrlr.hasNextLink() {
22545 return nil, nil
22546 }
22547 return autorest.Prepare((&http.Request{}).WithContext(ctx),
22548 autorest.AsJSON(),
22549 autorest.AsGet(),
22550 autorest.WithBaseURL(to.String(lblbrlr.NextLink)))
22551 }
22552
22553
22554 type LoadBalancerLoadBalancingRuleListResultPage struct {
22555 fn func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error)
22556 lblbrlr LoadBalancerLoadBalancingRuleListResult
22557 }
22558
22559
22560
22561 func (page *LoadBalancerLoadBalancingRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
22562 if tracing.IsEnabled() {
22563 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultPage.NextWithContext")
22564 defer func() {
22565 sc := -1
22566 if page.Response().Response.Response != nil {
22567 sc = page.Response().Response.Response.StatusCode
22568 }
22569 tracing.EndSpan(ctx, sc, err)
22570 }()
22571 }
22572 for {
22573 next, err := page.fn(ctx, page.lblbrlr)
22574 if err != nil {
22575 return err
22576 }
22577 page.lblbrlr = next
22578 if !next.hasNextLink() || !next.IsEmpty() {
22579 break
22580 }
22581 }
22582 return nil
22583 }
22584
22585
22586
22587
22588 func (page *LoadBalancerLoadBalancingRuleListResultPage) Next() error {
22589 return page.NextWithContext(context.Background())
22590 }
22591
22592
22593 func (page LoadBalancerLoadBalancingRuleListResultPage) NotDone() bool {
22594 return !page.lblbrlr.IsEmpty()
22595 }
22596
22597
22598 func (page LoadBalancerLoadBalancingRuleListResultPage) Response() LoadBalancerLoadBalancingRuleListResult {
22599 return page.lblbrlr
22600 }
22601
22602
22603 func (page LoadBalancerLoadBalancingRuleListResultPage) Values() []LoadBalancingRule {
22604 if page.lblbrlr.IsEmpty() {
22605 return nil
22606 }
22607 return *page.lblbrlr.Value
22608 }
22609
22610
22611 func NewLoadBalancerLoadBalancingRuleListResultPage(cur LoadBalancerLoadBalancingRuleListResult, getNextPage func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error)) LoadBalancerLoadBalancingRuleListResultPage {
22612 return LoadBalancerLoadBalancingRuleListResultPage{
22613 fn: getNextPage,
22614 lblbrlr: cur,
22615 }
22616 }
22617
22618
22619 type LoadBalancerOutboundRuleListResult struct {
22620 autorest.Response `json:"-"`
22621
22622 Value *[]OutboundRule `json:"value,omitempty"`
22623
22624 NextLink *string `json:"nextLink,omitempty"`
22625 }
22626
22627
22628 func (lborlr LoadBalancerOutboundRuleListResult) MarshalJSON() ([]byte, error) {
22629 objectMap := make(map[string]interface{})
22630 if lborlr.Value != nil {
22631 objectMap["value"] = lborlr.Value
22632 }
22633 return json.Marshal(objectMap)
22634 }
22635
22636
22637 type LoadBalancerOutboundRuleListResultIterator struct {
22638 i int
22639 page LoadBalancerOutboundRuleListResultPage
22640 }
22641
22642
22643
22644 func (iter *LoadBalancerOutboundRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
22645 if tracing.IsEnabled() {
22646 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultIterator.NextWithContext")
22647 defer func() {
22648 sc := -1
22649 if iter.Response().Response.Response != nil {
22650 sc = iter.Response().Response.Response.StatusCode
22651 }
22652 tracing.EndSpan(ctx, sc, err)
22653 }()
22654 }
22655 iter.i++
22656 if iter.i < len(iter.page.Values()) {
22657 return nil
22658 }
22659 err = iter.page.NextWithContext(ctx)
22660 if err != nil {
22661 iter.i--
22662 return err
22663 }
22664 iter.i = 0
22665 return nil
22666 }
22667
22668
22669
22670
22671 func (iter *LoadBalancerOutboundRuleListResultIterator) Next() error {
22672 return iter.NextWithContext(context.Background())
22673 }
22674
22675
22676 func (iter LoadBalancerOutboundRuleListResultIterator) NotDone() bool {
22677 return iter.page.NotDone() && iter.i < len(iter.page.Values())
22678 }
22679
22680
22681 func (iter LoadBalancerOutboundRuleListResultIterator) Response() LoadBalancerOutboundRuleListResult {
22682 return iter.page.Response()
22683 }
22684
22685
22686
22687 func (iter LoadBalancerOutboundRuleListResultIterator) Value() OutboundRule {
22688 if !iter.page.NotDone() {
22689 return OutboundRule{}
22690 }
22691 return iter.page.Values()[iter.i]
22692 }
22693
22694
22695 func NewLoadBalancerOutboundRuleListResultIterator(page LoadBalancerOutboundRuleListResultPage) LoadBalancerOutboundRuleListResultIterator {
22696 return LoadBalancerOutboundRuleListResultIterator{page: page}
22697 }
22698
22699
22700 func (lborlr LoadBalancerOutboundRuleListResult) IsEmpty() bool {
22701 return lborlr.Value == nil || len(*lborlr.Value) == 0
22702 }
22703
22704
22705 func (lborlr LoadBalancerOutboundRuleListResult) hasNextLink() bool {
22706 return lborlr.NextLink != nil && len(*lborlr.NextLink) != 0
22707 }
22708
22709
22710
22711 func (lborlr LoadBalancerOutboundRuleListResult) loadBalancerOutboundRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
22712 if !lborlr.hasNextLink() {
22713 return nil, nil
22714 }
22715 return autorest.Prepare((&http.Request{}).WithContext(ctx),
22716 autorest.AsJSON(),
22717 autorest.AsGet(),
22718 autorest.WithBaseURL(to.String(lborlr.NextLink)))
22719 }
22720
22721
22722 type LoadBalancerOutboundRuleListResultPage struct {
22723 fn func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)
22724 lborlr LoadBalancerOutboundRuleListResult
22725 }
22726
22727
22728
22729 func (page *LoadBalancerOutboundRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
22730 if tracing.IsEnabled() {
22731 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultPage.NextWithContext")
22732 defer func() {
22733 sc := -1
22734 if page.Response().Response.Response != nil {
22735 sc = page.Response().Response.Response.StatusCode
22736 }
22737 tracing.EndSpan(ctx, sc, err)
22738 }()
22739 }
22740 for {
22741 next, err := page.fn(ctx, page.lborlr)
22742 if err != nil {
22743 return err
22744 }
22745 page.lborlr = next
22746 if !next.hasNextLink() || !next.IsEmpty() {
22747 break
22748 }
22749 }
22750 return nil
22751 }
22752
22753
22754
22755
22756 func (page *LoadBalancerOutboundRuleListResultPage) Next() error {
22757 return page.NextWithContext(context.Background())
22758 }
22759
22760
22761 func (page LoadBalancerOutboundRuleListResultPage) NotDone() bool {
22762 return !page.lborlr.IsEmpty()
22763 }
22764
22765
22766 func (page LoadBalancerOutboundRuleListResultPage) Response() LoadBalancerOutboundRuleListResult {
22767 return page.lborlr
22768 }
22769
22770
22771 func (page LoadBalancerOutboundRuleListResultPage) Values() []OutboundRule {
22772 if page.lborlr.IsEmpty() {
22773 return nil
22774 }
22775 return *page.lborlr.Value
22776 }
22777
22778
22779 func NewLoadBalancerOutboundRuleListResultPage(cur LoadBalancerOutboundRuleListResult, getNextPage func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)) LoadBalancerOutboundRuleListResultPage {
22780 return LoadBalancerOutboundRuleListResultPage{
22781 fn: getNextPage,
22782 lborlr: cur,
22783 }
22784 }
22785
22786
22787 type LoadBalancerProbeListResult struct {
22788 autorest.Response `json:"-"`
22789
22790 Value *[]Probe `json:"value,omitempty"`
22791
22792 NextLink *string `json:"nextLink,omitempty"`
22793 }
22794
22795
22796 func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) {
22797 objectMap := make(map[string]interface{})
22798 if lbplr.Value != nil {
22799 objectMap["value"] = lbplr.Value
22800 }
22801 return json.Marshal(objectMap)
22802 }
22803
22804
22805 type LoadBalancerProbeListResultIterator struct {
22806 i int
22807 page LoadBalancerProbeListResultPage
22808 }
22809
22810
22811
22812 func (iter *LoadBalancerProbeListResultIterator) NextWithContext(ctx context.Context) (err error) {
22813 if tracing.IsEnabled() {
22814 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultIterator.NextWithContext")
22815 defer func() {
22816 sc := -1
22817 if iter.Response().Response.Response != nil {
22818 sc = iter.Response().Response.Response.StatusCode
22819 }
22820 tracing.EndSpan(ctx, sc, err)
22821 }()
22822 }
22823 iter.i++
22824 if iter.i < len(iter.page.Values()) {
22825 return nil
22826 }
22827 err = iter.page.NextWithContext(ctx)
22828 if err != nil {
22829 iter.i--
22830 return err
22831 }
22832 iter.i = 0
22833 return nil
22834 }
22835
22836
22837
22838
22839 func (iter *LoadBalancerProbeListResultIterator) Next() error {
22840 return iter.NextWithContext(context.Background())
22841 }
22842
22843
22844 func (iter LoadBalancerProbeListResultIterator) NotDone() bool {
22845 return iter.page.NotDone() && iter.i < len(iter.page.Values())
22846 }
22847
22848
22849 func (iter LoadBalancerProbeListResultIterator) Response() LoadBalancerProbeListResult {
22850 return iter.page.Response()
22851 }
22852
22853
22854
22855 func (iter LoadBalancerProbeListResultIterator) Value() Probe {
22856 if !iter.page.NotDone() {
22857 return Probe{}
22858 }
22859 return iter.page.Values()[iter.i]
22860 }
22861
22862
22863 func NewLoadBalancerProbeListResultIterator(page LoadBalancerProbeListResultPage) LoadBalancerProbeListResultIterator {
22864 return LoadBalancerProbeListResultIterator{page: page}
22865 }
22866
22867
22868 func (lbplr LoadBalancerProbeListResult) IsEmpty() bool {
22869 return lbplr.Value == nil || len(*lbplr.Value) == 0
22870 }
22871
22872
22873 func (lbplr LoadBalancerProbeListResult) hasNextLink() bool {
22874 return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0
22875 }
22876
22877
22878
22879 func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) {
22880 if !lbplr.hasNextLink() {
22881 return nil, nil
22882 }
22883 return autorest.Prepare((&http.Request{}).WithContext(ctx),
22884 autorest.AsJSON(),
22885 autorest.AsGet(),
22886 autorest.WithBaseURL(to.String(lbplr.NextLink)))
22887 }
22888
22889
22890 type LoadBalancerProbeListResultPage struct {
22891 fn func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)
22892 lbplr LoadBalancerProbeListResult
22893 }
22894
22895
22896
22897 func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context) (err error) {
22898 if tracing.IsEnabled() {
22899 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultPage.NextWithContext")
22900 defer func() {
22901 sc := -1
22902 if page.Response().Response.Response != nil {
22903 sc = page.Response().Response.Response.StatusCode
22904 }
22905 tracing.EndSpan(ctx, sc, err)
22906 }()
22907 }
22908 for {
22909 next, err := page.fn(ctx, page.lbplr)
22910 if err != nil {
22911 return err
22912 }
22913 page.lbplr = next
22914 if !next.hasNextLink() || !next.IsEmpty() {
22915 break
22916 }
22917 }
22918 return nil
22919 }
22920
22921
22922
22923
22924 func (page *LoadBalancerProbeListResultPage) Next() error {
22925 return page.NextWithContext(context.Background())
22926 }
22927
22928
22929 func (page LoadBalancerProbeListResultPage) NotDone() bool {
22930 return !page.lbplr.IsEmpty()
22931 }
22932
22933
22934 func (page LoadBalancerProbeListResultPage) Response() LoadBalancerProbeListResult {
22935 return page.lbplr
22936 }
22937
22938
22939 func (page LoadBalancerProbeListResultPage) Values() []Probe {
22940 if page.lbplr.IsEmpty() {
22941 return nil
22942 }
22943 return *page.lbplr.Value
22944 }
22945
22946
22947 func NewLoadBalancerProbeListResultPage(cur LoadBalancerProbeListResult, getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage {
22948 return LoadBalancerProbeListResultPage{
22949 fn: getNextPage,
22950 lbplr: cur,
22951 }
22952 }
22953
22954
22955 type LoadBalancerPropertiesFormat struct {
22956
22957 FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
22958
22959 BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"`
22960
22961 LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"`
22962
22963 Probes *[]Probe `json:"probes,omitempty"`
22964
22965 InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"`
22966
22967 InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"`
22968
22969 OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"`
22970
22971 ResourceGUID *string `json:"resourceGuid,omitempty"`
22972
22973 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
22974 }
22975
22976
22977 func (lbpf LoadBalancerPropertiesFormat) MarshalJSON() ([]byte, error) {
22978 objectMap := make(map[string]interface{})
22979 if lbpf.FrontendIPConfigurations != nil {
22980 objectMap["frontendIPConfigurations"] = lbpf.FrontendIPConfigurations
22981 }
22982 if lbpf.BackendAddressPools != nil {
22983 objectMap["backendAddressPools"] = lbpf.BackendAddressPools
22984 }
22985 if lbpf.LoadBalancingRules != nil {
22986 objectMap["loadBalancingRules"] = lbpf.LoadBalancingRules
22987 }
22988 if lbpf.Probes != nil {
22989 objectMap["probes"] = lbpf.Probes
22990 }
22991 if lbpf.InboundNatRules != nil {
22992 objectMap["inboundNatRules"] = lbpf.InboundNatRules
22993 }
22994 if lbpf.InboundNatPools != nil {
22995 objectMap["inboundNatPools"] = lbpf.InboundNatPools
22996 }
22997 if lbpf.OutboundRules != nil {
22998 objectMap["outboundRules"] = lbpf.OutboundRules
22999 }
23000 return json.Marshal(objectMap)
23001 }
23002
23003
23004
23005 type LoadBalancersCreateOrUpdateFuture struct {
23006 azure.FutureAPI
23007
23008
23009 Result func(LoadBalancersClient) (LoadBalancer, error)
23010 }
23011
23012
23013 func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
23014 var azFuture azure.Future
23015 if err := json.Unmarshal(body, &azFuture); err != nil {
23016 return err
23017 }
23018 future.FutureAPI = &azFuture
23019 future.Result = future.result
23020 return nil
23021 }
23022
23023
23024 func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) {
23025 var done bool
23026 done, err = future.DoneWithContext(context.Background(), client)
23027 if err != nil {
23028 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
23029 return
23030 }
23031 if !done {
23032 lb.Response.Response = future.Response()
23033 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture")
23034 return
23035 }
23036 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
23037 if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent {
23038 lb, err = client.CreateOrUpdateResponder(lb.Response.Response)
23039 if err != nil {
23040 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request")
23041 }
23042 }
23043 return
23044 }
23045
23046
23047
23048 type LoadBalancersDeleteFuture struct {
23049 azure.FutureAPI
23050
23051
23052 Result func(LoadBalancersClient) (autorest.Response, error)
23053 }
23054
23055
23056 func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error {
23057 var azFuture azure.Future
23058 if err := json.Unmarshal(body, &azFuture); err != nil {
23059 return err
23060 }
23061 future.FutureAPI = &azFuture
23062 future.Result = future.result
23063 return nil
23064 }
23065
23066
23067 func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) {
23068 var done bool
23069 done, err = future.DoneWithContext(context.Background(), client)
23070 if err != nil {
23071 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure")
23072 return
23073 }
23074 if !done {
23075 ar.Response = future.Response()
23076 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture")
23077 return
23078 }
23079 ar.Response = future.Response()
23080 return
23081 }
23082
23083
23084 type LoadBalancerSku struct {
23085
23086 Name LoadBalancerSkuName `json:"name,omitempty"`
23087 }
23088
23089
23090 type LoadBalancingRule struct {
23091 autorest.Response `json:"-"`
23092
23093 *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"`
23094
23095 Name *string `json:"name,omitempty"`
23096
23097 Etag *string `json:"etag,omitempty"`
23098
23099 Type *string `json:"type,omitempty"`
23100
23101 ID *string `json:"id,omitempty"`
23102 }
23103
23104
23105 func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) {
23106 objectMap := make(map[string]interface{})
23107 if lbr.LoadBalancingRulePropertiesFormat != nil {
23108 objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat
23109 }
23110 if lbr.Name != nil {
23111 objectMap["name"] = lbr.Name
23112 }
23113 if lbr.ID != nil {
23114 objectMap["id"] = lbr.ID
23115 }
23116 return json.Marshal(objectMap)
23117 }
23118
23119
23120 func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error {
23121 var m map[string]*json.RawMessage
23122 err := json.Unmarshal(body, &m)
23123 if err != nil {
23124 return err
23125 }
23126 for k, v := range m {
23127 switch k {
23128 case "properties":
23129 if v != nil {
23130 var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat
23131 err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat)
23132 if err != nil {
23133 return err
23134 }
23135 lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat
23136 }
23137 case "name":
23138 if v != nil {
23139 var name string
23140 err = json.Unmarshal(*v, &name)
23141 if err != nil {
23142 return err
23143 }
23144 lbr.Name = &name
23145 }
23146 case "etag":
23147 if v != nil {
23148 var etag string
23149 err = json.Unmarshal(*v, &etag)
23150 if err != nil {
23151 return err
23152 }
23153 lbr.Etag = &etag
23154 }
23155 case "type":
23156 if v != nil {
23157 var typeVar string
23158 err = json.Unmarshal(*v, &typeVar)
23159 if err != nil {
23160 return err
23161 }
23162 lbr.Type = &typeVar
23163 }
23164 case "id":
23165 if v != nil {
23166 var ID string
23167 err = json.Unmarshal(*v, &ID)
23168 if err != nil {
23169 return err
23170 }
23171 lbr.ID = &ID
23172 }
23173 }
23174 }
23175
23176 return nil
23177 }
23178
23179
23180 type LoadBalancingRulePropertiesFormat struct {
23181
23182 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
23183
23184 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
23185
23186 Probe *SubResource `json:"probe,omitempty"`
23187
23188 Protocol TransportProtocol `json:"protocol,omitempty"`
23189
23190 LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"`
23191
23192 FrontendPort *int32 `json:"frontendPort,omitempty"`
23193
23194 BackendPort *int32 `json:"backendPort,omitempty"`
23195
23196 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
23197
23198 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
23199
23200 EnableTCPReset *bool `json:"enableTcpReset,omitempty"`
23201
23202 DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"`
23203
23204 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
23205 }
23206
23207
23208 func (lbrpf LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) {
23209 objectMap := make(map[string]interface{})
23210 if lbrpf.FrontendIPConfiguration != nil {
23211 objectMap["frontendIPConfiguration"] = lbrpf.FrontendIPConfiguration
23212 }
23213 if lbrpf.BackendAddressPool != nil {
23214 objectMap["backendAddressPool"] = lbrpf.BackendAddressPool
23215 }
23216 if lbrpf.Probe != nil {
23217 objectMap["probe"] = lbrpf.Probe
23218 }
23219 if lbrpf.Protocol != "" {
23220 objectMap["protocol"] = lbrpf.Protocol
23221 }
23222 if lbrpf.LoadDistribution != "" {
23223 objectMap["loadDistribution"] = lbrpf.LoadDistribution
23224 }
23225 if lbrpf.FrontendPort != nil {
23226 objectMap["frontendPort"] = lbrpf.FrontendPort
23227 }
23228 if lbrpf.BackendPort != nil {
23229 objectMap["backendPort"] = lbrpf.BackendPort
23230 }
23231 if lbrpf.IdleTimeoutInMinutes != nil {
23232 objectMap["idleTimeoutInMinutes"] = lbrpf.IdleTimeoutInMinutes
23233 }
23234 if lbrpf.EnableFloatingIP != nil {
23235 objectMap["enableFloatingIP"] = lbrpf.EnableFloatingIP
23236 }
23237 if lbrpf.EnableTCPReset != nil {
23238 objectMap["enableTcpReset"] = lbrpf.EnableTCPReset
23239 }
23240 if lbrpf.DisableOutboundSnat != nil {
23241 objectMap["disableOutboundSnat"] = lbrpf.DisableOutboundSnat
23242 }
23243 return json.Marshal(objectMap)
23244 }
23245
23246
23247 type LocalNetworkGateway struct {
23248 autorest.Response `json:"-"`
23249
23250 *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"`
23251
23252 Etag *string `json:"etag,omitempty"`
23253
23254 ID *string `json:"id,omitempty"`
23255
23256 Name *string `json:"name,omitempty"`
23257
23258 Type *string `json:"type,omitempty"`
23259
23260 Location *string `json:"location,omitempty"`
23261
23262 Tags map[string]*string `json:"tags"`
23263 }
23264
23265
23266 func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) {
23267 objectMap := make(map[string]interface{})
23268 if lng.LocalNetworkGatewayPropertiesFormat != nil {
23269 objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat
23270 }
23271 if lng.ID != nil {
23272 objectMap["id"] = lng.ID
23273 }
23274 if lng.Location != nil {
23275 objectMap["location"] = lng.Location
23276 }
23277 if lng.Tags != nil {
23278 objectMap["tags"] = lng.Tags
23279 }
23280 return json.Marshal(objectMap)
23281 }
23282
23283
23284 func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error {
23285 var m map[string]*json.RawMessage
23286 err := json.Unmarshal(body, &m)
23287 if err != nil {
23288 return err
23289 }
23290 for k, v := range m {
23291 switch k {
23292 case "properties":
23293 if v != nil {
23294 var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat
23295 err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat)
23296 if err != nil {
23297 return err
23298 }
23299 lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat
23300 }
23301 case "etag":
23302 if v != nil {
23303 var etag string
23304 err = json.Unmarshal(*v, &etag)
23305 if err != nil {
23306 return err
23307 }
23308 lng.Etag = &etag
23309 }
23310 case "id":
23311 if v != nil {
23312 var ID string
23313 err = json.Unmarshal(*v, &ID)
23314 if err != nil {
23315 return err
23316 }
23317 lng.ID = &ID
23318 }
23319 case "name":
23320 if v != nil {
23321 var name string
23322 err = json.Unmarshal(*v, &name)
23323 if err != nil {
23324 return err
23325 }
23326 lng.Name = &name
23327 }
23328 case "type":
23329 if v != nil {
23330 var typeVar string
23331 err = json.Unmarshal(*v, &typeVar)
23332 if err != nil {
23333 return err
23334 }
23335 lng.Type = &typeVar
23336 }
23337 case "location":
23338 if v != nil {
23339 var location string
23340 err = json.Unmarshal(*v, &location)
23341 if err != nil {
23342 return err
23343 }
23344 lng.Location = &location
23345 }
23346 case "tags":
23347 if v != nil {
23348 var tags map[string]*string
23349 err = json.Unmarshal(*v, &tags)
23350 if err != nil {
23351 return err
23352 }
23353 lng.Tags = tags
23354 }
23355 }
23356 }
23357
23358 return nil
23359 }
23360
23361
23362 type LocalNetworkGatewayListResult struct {
23363 autorest.Response `json:"-"`
23364
23365 Value *[]LocalNetworkGateway `json:"value,omitempty"`
23366
23367 NextLink *string `json:"nextLink,omitempty"`
23368 }
23369
23370
23371 func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) {
23372 objectMap := make(map[string]interface{})
23373 if lnglr.Value != nil {
23374 objectMap["value"] = lnglr.Value
23375 }
23376 return json.Marshal(objectMap)
23377 }
23378
23379
23380
23381 type LocalNetworkGatewayListResultIterator struct {
23382 i int
23383 page LocalNetworkGatewayListResultPage
23384 }
23385
23386
23387
23388 func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) {
23389 if tracing.IsEnabled() {
23390 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext")
23391 defer func() {
23392 sc := -1
23393 if iter.Response().Response.Response != nil {
23394 sc = iter.Response().Response.Response.StatusCode
23395 }
23396 tracing.EndSpan(ctx, sc, err)
23397 }()
23398 }
23399 iter.i++
23400 if iter.i < len(iter.page.Values()) {
23401 return nil
23402 }
23403 err = iter.page.NextWithContext(ctx)
23404 if err != nil {
23405 iter.i--
23406 return err
23407 }
23408 iter.i = 0
23409 return nil
23410 }
23411
23412
23413
23414
23415 func (iter *LocalNetworkGatewayListResultIterator) Next() error {
23416 return iter.NextWithContext(context.Background())
23417 }
23418
23419
23420 func (iter LocalNetworkGatewayListResultIterator) NotDone() bool {
23421 return iter.page.NotDone() && iter.i < len(iter.page.Values())
23422 }
23423
23424
23425 func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult {
23426 return iter.page.Response()
23427 }
23428
23429
23430
23431 func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway {
23432 if !iter.page.NotDone() {
23433 return LocalNetworkGateway{}
23434 }
23435 return iter.page.Values()[iter.i]
23436 }
23437
23438
23439 func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator {
23440 return LocalNetworkGatewayListResultIterator{page: page}
23441 }
23442
23443
23444 func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool {
23445 return lnglr.Value == nil || len(*lnglr.Value) == 0
23446 }
23447
23448
23449 func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool {
23450 return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0
23451 }
23452
23453
23454
23455 func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) {
23456 if !lnglr.hasNextLink() {
23457 return nil, nil
23458 }
23459 return autorest.Prepare((&http.Request{}).WithContext(ctx),
23460 autorest.AsJSON(),
23461 autorest.AsGet(),
23462 autorest.WithBaseURL(to.String(lnglr.NextLink)))
23463 }
23464
23465
23466 type LocalNetworkGatewayListResultPage struct {
23467 fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)
23468 lnglr LocalNetworkGatewayListResult
23469 }
23470
23471
23472
23473 func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) {
23474 if tracing.IsEnabled() {
23475 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext")
23476 defer func() {
23477 sc := -1
23478 if page.Response().Response.Response != nil {
23479 sc = page.Response().Response.Response.StatusCode
23480 }
23481 tracing.EndSpan(ctx, sc, err)
23482 }()
23483 }
23484 for {
23485 next, err := page.fn(ctx, page.lnglr)
23486 if err != nil {
23487 return err
23488 }
23489 page.lnglr = next
23490 if !next.hasNextLink() || !next.IsEmpty() {
23491 break
23492 }
23493 }
23494 return nil
23495 }
23496
23497
23498
23499
23500 func (page *LocalNetworkGatewayListResultPage) Next() error {
23501 return page.NextWithContext(context.Background())
23502 }
23503
23504
23505 func (page LocalNetworkGatewayListResultPage) NotDone() bool {
23506 return !page.lnglr.IsEmpty()
23507 }
23508
23509
23510 func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult {
23511 return page.lnglr
23512 }
23513
23514
23515 func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway {
23516 if page.lnglr.IsEmpty() {
23517 return nil
23518 }
23519 return *page.lnglr.Value
23520 }
23521
23522
23523 func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage {
23524 return LocalNetworkGatewayListResultPage{
23525 fn: getNextPage,
23526 lnglr: cur,
23527 }
23528 }
23529
23530
23531 type LocalNetworkGatewayPropertiesFormat struct {
23532
23533 LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"`
23534
23535 GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"`
23536
23537 Fqdn *string `json:"fqdn,omitempty"`
23538
23539 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
23540
23541 ResourceGUID *string `json:"resourceGuid,omitempty"`
23542
23543 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
23544 }
23545
23546
23547 func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) {
23548 objectMap := make(map[string]interface{})
23549 if lngpf.LocalNetworkAddressSpace != nil {
23550 objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace
23551 }
23552 if lngpf.GatewayIPAddress != nil {
23553 objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress
23554 }
23555 if lngpf.Fqdn != nil {
23556 objectMap["fqdn"] = lngpf.Fqdn
23557 }
23558 if lngpf.BgpSettings != nil {
23559 objectMap["bgpSettings"] = lngpf.BgpSettings
23560 }
23561 return json.Marshal(objectMap)
23562 }
23563
23564
23565
23566 type LocalNetworkGatewaysCreateOrUpdateFuture struct {
23567 azure.FutureAPI
23568
23569
23570 Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error)
23571 }
23572
23573
23574 func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
23575 var azFuture azure.Future
23576 if err := json.Unmarshal(body, &azFuture); err != nil {
23577 return err
23578 }
23579 future.FutureAPI = &azFuture
23580 future.Result = future.result
23581 return nil
23582 }
23583
23584
23585 func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) {
23586 var done bool
23587 done, err = future.DoneWithContext(context.Background(), client)
23588 if err != nil {
23589 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
23590 return
23591 }
23592 if !done {
23593 lng.Response.Response = future.Response()
23594 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture")
23595 return
23596 }
23597 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
23598 if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent {
23599 lng, err = client.CreateOrUpdateResponder(lng.Response.Response)
23600 if err != nil {
23601 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request")
23602 }
23603 }
23604 return
23605 }
23606
23607
23608
23609 type LocalNetworkGatewaysDeleteFuture struct {
23610 azure.FutureAPI
23611
23612
23613 Result func(LocalNetworkGatewaysClient) (autorest.Response, error)
23614 }
23615
23616
23617 func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
23618 var azFuture azure.Future
23619 if err := json.Unmarshal(body, &azFuture); err != nil {
23620 return err
23621 }
23622 future.FutureAPI = &azFuture
23623 future.Result = future.result
23624 return nil
23625 }
23626
23627
23628 func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) {
23629 var done bool
23630 done, err = future.DoneWithContext(context.Background(), client)
23631 if err != nil {
23632 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
23633 return
23634 }
23635 if !done {
23636 ar.Response = future.Response()
23637 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture")
23638 return
23639 }
23640 ar.Response = future.Response()
23641 return
23642 }
23643
23644
23645 type LogSpecification struct {
23646
23647 Name *string `json:"name,omitempty"`
23648
23649 DisplayName *string `json:"displayName,omitempty"`
23650
23651 BlobDuration *string `json:"blobDuration,omitempty"`
23652 }
23653
23654
23655 type ManagedRuleGroupOverride struct {
23656
23657 RuleGroupName *string `json:"ruleGroupName,omitempty"`
23658
23659 Rules *[]ManagedRuleOverride `json:"rules,omitempty"`
23660 }
23661
23662
23663 type ManagedRuleOverride struct {
23664
23665 RuleID *string `json:"ruleId,omitempty"`
23666
23667 State ManagedRuleEnabledState `json:"state,omitempty"`
23668 }
23669
23670
23671 type ManagedRulesDefinition struct {
23672
23673 Exclusions *[]OwaspCrsExclusionEntry `json:"exclusions,omitempty"`
23674
23675 ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"`
23676 }
23677
23678
23679 type ManagedRuleSet struct {
23680
23681 RuleSetType *string `json:"ruleSetType,omitempty"`
23682
23683 RuleSetVersion *string `json:"ruleSetVersion,omitempty"`
23684
23685 RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"`
23686 }
23687
23688
23689 type ManagedServiceIdentity struct {
23690
23691 PrincipalID *string `json:"principalId,omitempty"`
23692
23693 TenantID *string `json:"tenantId,omitempty"`
23694
23695 Type ResourceIdentityType `json:"type,omitempty"`
23696
23697 UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
23698 }
23699
23700
23701 func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) {
23702 objectMap := make(map[string]interface{})
23703 if msi.Type != "" {
23704 objectMap["type"] = msi.Type
23705 }
23706 if msi.UserAssignedIdentities != nil {
23707 objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities
23708 }
23709 return json.Marshal(objectMap)
23710 }
23711
23712
23713 type ManagedServiceIdentityUserAssignedIdentitiesValue struct {
23714
23715 PrincipalID *string `json:"principalId,omitempty"`
23716
23717 ClientID *string `json:"clientId,omitempty"`
23718 }
23719
23720
23721 func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
23722 objectMap := make(map[string]interface{})
23723 return json.Marshal(objectMap)
23724 }
23725
23726
23727 type MatchCondition struct {
23728
23729 MatchVariables *[]MatchVariable `json:"matchVariables,omitempty"`
23730
23731 Operator WebApplicationFirewallOperator `json:"operator,omitempty"`
23732
23733 NegationConditon *bool `json:"negationConditon,omitempty"`
23734
23735 MatchValues *[]string `json:"matchValues,omitempty"`
23736
23737 Transforms *[]WebApplicationFirewallTransform `json:"transforms,omitempty"`
23738 }
23739
23740
23741 type MatchedRule struct {
23742
23743 RuleName *string `json:"ruleName,omitempty"`
23744
23745 Action *string `json:"action,omitempty"`
23746 }
23747
23748
23749 type MatchVariable struct {
23750
23751 VariableName WebApplicationFirewallMatchVariable `json:"variableName,omitempty"`
23752
23753 Selector *string `json:"selector,omitempty"`
23754 }
23755
23756
23757 type MetricSpecification struct {
23758
23759 Name *string `json:"name,omitempty"`
23760
23761 DisplayName *string `json:"displayName,omitempty"`
23762
23763 DisplayDescription *string `json:"displayDescription,omitempty"`
23764
23765 Unit *string `json:"unit,omitempty"`
23766
23767 AggregationType *string `json:"aggregationType,omitempty"`
23768
23769 Availabilities *[]Availability `json:"availabilities,omitempty"`
23770
23771 EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"`
23772
23773 FillGapWithZero *bool `json:"fillGapWithZero,omitempty"`
23774
23775 MetricFilterPattern *string `json:"metricFilterPattern,omitempty"`
23776
23777 Dimensions *[]Dimension `json:"dimensions,omitempty"`
23778
23779 IsInternal *bool `json:"isInternal,omitempty"`
23780
23781 SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"`
23782
23783 SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"`
23784
23785 ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"`
23786 }
23787
23788
23789 type NatGateway struct {
23790 autorest.Response `json:"-"`
23791
23792 Sku *NatGatewaySku `json:"sku,omitempty"`
23793
23794 *NatGatewayPropertiesFormat `json:"properties,omitempty"`
23795
23796 Zones *[]string `json:"zones,omitempty"`
23797
23798 Etag *string `json:"etag,omitempty"`
23799
23800 ID *string `json:"id,omitempty"`
23801
23802 Name *string `json:"name,omitempty"`
23803
23804 Type *string `json:"type,omitempty"`
23805
23806 Location *string `json:"location,omitempty"`
23807
23808 Tags map[string]*string `json:"tags"`
23809 }
23810
23811
23812 func (ng NatGateway) MarshalJSON() ([]byte, error) {
23813 objectMap := make(map[string]interface{})
23814 if ng.Sku != nil {
23815 objectMap["sku"] = ng.Sku
23816 }
23817 if ng.NatGatewayPropertiesFormat != nil {
23818 objectMap["properties"] = ng.NatGatewayPropertiesFormat
23819 }
23820 if ng.Zones != nil {
23821 objectMap["zones"] = ng.Zones
23822 }
23823 if ng.ID != nil {
23824 objectMap["id"] = ng.ID
23825 }
23826 if ng.Location != nil {
23827 objectMap["location"] = ng.Location
23828 }
23829 if ng.Tags != nil {
23830 objectMap["tags"] = ng.Tags
23831 }
23832 return json.Marshal(objectMap)
23833 }
23834
23835
23836 func (ng *NatGateway) UnmarshalJSON(body []byte) error {
23837 var m map[string]*json.RawMessage
23838 err := json.Unmarshal(body, &m)
23839 if err != nil {
23840 return err
23841 }
23842 for k, v := range m {
23843 switch k {
23844 case "sku":
23845 if v != nil {
23846 var sku NatGatewaySku
23847 err = json.Unmarshal(*v, &sku)
23848 if err != nil {
23849 return err
23850 }
23851 ng.Sku = &sku
23852 }
23853 case "properties":
23854 if v != nil {
23855 var natGatewayPropertiesFormat NatGatewayPropertiesFormat
23856 err = json.Unmarshal(*v, &natGatewayPropertiesFormat)
23857 if err != nil {
23858 return err
23859 }
23860 ng.NatGatewayPropertiesFormat = &natGatewayPropertiesFormat
23861 }
23862 case "zones":
23863 if v != nil {
23864 var zones []string
23865 err = json.Unmarshal(*v, &zones)
23866 if err != nil {
23867 return err
23868 }
23869 ng.Zones = &zones
23870 }
23871 case "etag":
23872 if v != nil {
23873 var etag string
23874 err = json.Unmarshal(*v, &etag)
23875 if err != nil {
23876 return err
23877 }
23878 ng.Etag = &etag
23879 }
23880 case "id":
23881 if v != nil {
23882 var ID string
23883 err = json.Unmarshal(*v, &ID)
23884 if err != nil {
23885 return err
23886 }
23887 ng.ID = &ID
23888 }
23889 case "name":
23890 if v != nil {
23891 var name string
23892 err = json.Unmarshal(*v, &name)
23893 if err != nil {
23894 return err
23895 }
23896 ng.Name = &name
23897 }
23898 case "type":
23899 if v != nil {
23900 var typeVar string
23901 err = json.Unmarshal(*v, &typeVar)
23902 if err != nil {
23903 return err
23904 }
23905 ng.Type = &typeVar
23906 }
23907 case "location":
23908 if v != nil {
23909 var location string
23910 err = json.Unmarshal(*v, &location)
23911 if err != nil {
23912 return err
23913 }
23914 ng.Location = &location
23915 }
23916 case "tags":
23917 if v != nil {
23918 var tags map[string]*string
23919 err = json.Unmarshal(*v, &tags)
23920 if err != nil {
23921 return err
23922 }
23923 ng.Tags = tags
23924 }
23925 }
23926 }
23927
23928 return nil
23929 }
23930
23931
23932 type NatGatewayListResult struct {
23933 autorest.Response `json:"-"`
23934
23935 Value *[]NatGateway `json:"value,omitempty"`
23936
23937 NextLink *string `json:"nextLink,omitempty"`
23938 }
23939
23940
23941 type NatGatewayListResultIterator struct {
23942 i int
23943 page NatGatewayListResultPage
23944 }
23945
23946
23947
23948 func (iter *NatGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) {
23949 if tracing.IsEnabled() {
23950 ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewayListResultIterator.NextWithContext")
23951 defer func() {
23952 sc := -1
23953 if iter.Response().Response.Response != nil {
23954 sc = iter.Response().Response.Response.StatusCode
23955 }
23956 tracing.EndSpan(ctx, sc, err)
23957 }()
23958 }
23959 iter.i++
23960 if iter.i < len(iter.page.Values()) {
23961 return nil
23962 }
23963 err = iter.page.NextWithContext(ctx)
23964 if err != nil {
23965 iter.i--
23966 return err
23967 }
23968 iter.i = 0
23969 return nil
23970 }
23971
23972
23973
23974
23975 func (iter *NatGatewayListResultIterator) Next() error {
23976 return iter.NextWithContext(context.Background())
23977 }
23978
23979
23980 func (iter NatGatewayListResultIterator) NotDone() bool {
23981 return iter.page.NotDone() && iter.i < len(iter.page.Values())
23982 }
23983
23984
23985 func (iter NatGatewayListResultIterator) Response() NatGatewayListResult {
23986 return iter.page.Response()
23987 }
23988
23989
23990
23991 func (iter NatGatewayListResultIterator) Value() NatGateway {
23992 if !iter.page.NotDone() {
23993 return NatGateway{}
23994 }
23995 return iter.page.Values()[iter.i]
23996 }
23997
23998
23999 func NewNatGatewayListResultIterator(page NatGatewayListResultPage) NatGatewayListResultIterator {
24000 return NatGatewayListResultIterator{page: page}
24001 }
24002
24003
24004 func (nglr NatGatewayListResult) IsEmpty() bool {
24005 return nglr.Value == nil || len(*nglr.Value) == 0
24006 }
24007
24008
24009 func (nglr NatGatewayListResult) hasNextLink() bool {
24010 return nglr.NextLink != nil && len(*nglr.NextLink) != 0
24011 }
24012
24013
24014
24015 func (nglr NatGatewayListResult) natGatewayListResultPreparer(ctx context.Context) (*http.Request, error) {
24016 if !nglr.hasNextLink() {
24017 return nil, nil
24018 }
24019 return autorest.Prepare((&http.Request{}).WithContext(ctx),
24020 autorest.AsJSON(),
24021 autorest.AsGet(),
24022 autorest.WithBaseURL(to.String(nglr.NextLink)))
24023 }
24024
24025
24026 type NatGatewayListResultPage struct {
24027 fn func(context.Context, NatGatewayListResult) (NatGatewayListResult, error)
24028 nglr NatGatewayListResult
24029 }
24030
24031
24032
24033 func (page *NatGatewayListResultPage) NextWithContext(ctx context.Context) (err error) {
24034 if tracing.IsEnabled() {
24035 ctx = tracing.StartSpan(ctx, fqdn+"/NatGatewayListResultPage.NextWithContext")
24036 defer func() {
24037 sc := -1
24038 if page.Response().Response.Response != nil {
24039 sc = page.Response().Response.Response.StatusCode
24040 }
24041 tracing.EndSpan(ctx, sc, err)
24042 }()
24043 }
24044 for {
24045 next, err := page.fn(ctx, page.nglr)
24046 if err != nil {
24047 return err
24048 }
24049 page.nglr = next
24050 if !next.hasNextLink() || !next.IsEmpty() {
24051 break
24052 }
24053 }
24054 return nil
24055 }
24056
24057
24058
24059
24060 func (page *NatGatewayListResultPage) Next() error {
24061 return page.NextWithContext(context.Background())
24062 }
24063
24064
24065 func (page NatGatewayListResultPage) NotDone() bool {
24066 return !page.nglr.IsEmpty()
24067 }
24068
24069
24070 func (page NatGatewayListResultPage) Response() NatGatewayListResult {
24071 return page.nglr
24072 }
24073
24074
24075 func (page NatGatewayListResultPage) Values() []NatGateway {
24076 if page.nglr.IsEmpty() {
24077 return nil
24078 }
24079 return *page.nglr.Value
24080 }
24081
24082
24083 func NewNatGatewayListResultPage(cur NatGatewayListResult, getNextPage func(context.Context, NatGatewayListResult) (NatGatewayListResult, error)) NatGatewayListResultPage {
24084 return NatGatewayListResultPage{
24085 fn: getNextPage,
24086 nglr: cur,
24087 }
24088 }
24089
24090
24091 type NatGatewayPropertiesFormat struct {
24092
24093 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
24094
24095 PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"`
24096
24097 PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"`
24098
24099 Subnets *[]SubResource `json:"subnets,omitempty"`
24100
24101 ResourceGUID *string `json:"resourceGuid,omitempty"`
24102
24103 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
24104 }
24105
24106
24107 func (ngpf NatGatewayPropertiesFormat) MarshalJSON() ([]byte, error) {
24108 objectMap := make(map[string]interface{})
24109 if ngpf.IdleTimeoutInMinutes != nil {
24110 objectMap["idleTimeoutInMinutes"] = ngpf.IdleTimeoutInMinutes
24111 }
24112 if ngpf.PublicIPAddresses != nil {
24113 objectMap["publicIpAddresses"] = ngpf.PublicIPAddresses
24114 }
24115 if ngpf.PublicIPPrefixes != nil {
24116 objectMap["publicIpPrefixes"] = ngpf.PublicIPPrefixes
24117 }
24118 return json.Marshal(objectMap)
24119 }
24120
24121
24122
24123 type NatGatewaysCreateOrUpdateFuture struct {
24124 azure.FutureAPI
24125
24126
24127 Result func(NatGatewaysClient) (NatGateway, error)
24128 }
24129
24130
24131 func (future *NatGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
24132 var azFuture azure.Future
24133 if err := json.Unmarshal(body, &azFuture); err != nil {
24134 return err
24135 }
24136 future.FutureAPI = &azFuture
24137 future.Result = future.result
24138 return nil
24139 }
24140
24141
24142 func (future *NatGatewaysCreateOrUpdateFuture) result(client NatGatewaysClient) (ng NatGateway, err error) {
24143 var done bool
24144 done, err = future.DoneWithContext(context.Background(), client)
24145 if err != nil {
24146 err = autorest.NewErrorWithError(err, "network.NatGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
24147 return
24148 }
24149 if !done {
24150 ng.Response.Response = future.Response()
24151 err = azure.NewAsyncOpIncompleteError("network.NatGatewaysCreateOrUpdateFuture")
24152 return
24153 }
24154 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
24155 if ng.Response.Response, err = future.GetResult(sender); err == nil && ng.Response.Response.StatusCode != http.StatusNoContent {
24156 ng, err = client.CreateOrUpdateResponder(ng.Response.Response)
24157 if err != nil {
24158 err = autorest.NewErrorWithError(err, "network.NatGatewaysCreateOrUpdateFuture", "Result", ng.Response.Response, "Failure responding to request")
24159 }
24160 }
24161 return
24162 }
24163
24164
24165
24166 type NatGatewaysDeleteFuture struct {
24167 azure.FutureAPI
24168
24169
24170 Result func(NatGatewaysClient) (autorest.Response, error)
24171 }
24172
24173
24174 func (future *NatGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
24175 var azFuture azure.Future
24176 if err := json.Unmarshal(body, &azFuture); err != nil {
24177 return err
24178 }
24179 future.FutureAPI = &azFuture
24180 future.Result = future.result
24181 return nil
24182 }
24183
24184
24185 func (future *NatGatewaysDeleteFuture) result(client NatGatewaysClient) (ar autorest.Response, err error) {
24186 var done bool
24187 done, err = future.DoneWithContext(context.Background(), client)
24188 if err != nil {
24189 err = autorest.NewErrorWithError(err, "network.NatGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
24190 return
24191 }
24192 if !done {
24193 ar.Response = future.Response()
24194 err = azure.NewAsyncOpIncompleteError("network.NatGatewaysDeleteFuture")
24195 return
24196 }
24197 ar.Response = future.Response()
24198 return
24199 }
24200
24201
24202 type NatGatewaySku struct {
24203
24204 Name NatGatewaySkuName `json:"name,omitempty"`
24205 }
24206
24207
24208 type NatRuleCondition struct {
24209
24210 IPProtocols *[]FirewallPolicyRuleConditionNetworkProtocol `json:"ipProtocols,omitempty"`
24211
24212 SourceAddresses *[]string `json:"sourceAddresses,omitempty"`
24213
24214 DestinationAddresses *[]string `json:"destinationAddresses,omitempty"`
24215
24216 DestinationPorts *[]string `json:"destinationPorts,omitempty"`
24217
24218 SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"`
24219
24220 Name *string `json:"name,omitempty"`
24221
24222 Description *string `json:"description,omitempty"`
24223
24224 RuleConditionType RuleConditionType `json:"ruleConditionType,omitempty"`
24225 }
24226
24227
24228 func (nrc NatRuleCondition) MarshalJSON() ([]byte, error) {
24229 nrc.RuleConditionType = RuleConditionTypeNatRuleCondition
24230 objectMap := make(map[string]interface{})
24231 if nrc.IPProtocols != nil {
24232 objectMap["ipProtocols"] = nrc.IPProtocols
24233 }
24234 if nrc.SourceAddresses != nil {
24235 objectMap["sourceAddresses"] = nrc.SourceAddresses
24236 }
24237 if nrc.DestinationAddresses != nil {
24238 objectMap["destinationAddresses"] = nrc.DestinationAddresses
24239 }
24240 if nrc.DestinationPorts != nil {
24241 objectMap["destinationPorts"] = nrc.DestinationPorts
24242 }
24243 if nrc.SourceIPGroups != nil {
24244 objectMap["sourceIpGroups"] = nrc.SourceIPGroups
24245 }
24246 if nrc.Name != nil {
24247 objectMap["name"] = nrc.Name
24248 }
24249 if nrc.Description != nil {
24250 objectMap["description"] = nrc.Description
24251 }
24252 if nrc.RuleConditionType != "" {
24253 objectMap["ruleConditionType"] = nrc.RuleConditionType
24254 }
24255 return json.Marshal(objectMap)
24256 }
24257
24258
24259 func (nrc NatRuleCondition) AsApplicationRuleCondition() (*ApplicationRuleCondition, bool) {
24260 return nil, false
24261 }
24262
24263
24264 func (nrc NatRuleCondition) AsNatRuleCondition() (*NatRuleCondition, bool) {
24265 return &nrc, true
24266 }
24267
24268
24269 func (nrc NatRuleCondition) AsRuleCondition() (*RuleCondition, bool) {
24270 return nil, false
24271 }
24272
24273
24274 func (nrc NatRuleCondition) AsFirewallPolicyRuleCondition() (*FirewallPolicyRuleCondition, bool) {
24275 return nil, false
24276 }
24277
24278
24279 func (nrc NatRuleCondition) AsBasicFirewallPolicyRuleCondition() (BasicFirewallPolicyRuleCondition, bool) {
24280 return &nrc, true
24281 }
24282
24283
24284 type NextHopParameters struct {
24285
24286 TargetResourceID *string `json:"targetResourceId,omitempty"`
24287
24288 SourceIPAddress *string `json:"sourceIPAddress,omitempty"`
24289
24290 DestinationIPAddress *string `json:"destinationIPAddress,omitempty"`
24291
24292 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"`
24293 }
24294
24295
24296 type NextHopResult struct {
24297 autorest.Response `json:"-"`
24298
24299 NextHopType NextHopType `json:"nextHopType,omitempty"`
24300
24301 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"`
24302
24303 RouteTableID *string `json:"routeTableId,omitempty"`
24304 }
24305
24306
24307 type Operation struct {
24308
24309 Name *string `json:"name,omitempty"`
24310
24311 Display *OperationDisplay `json:"display,omitempty"`
24312
24313 Origin *string `json:"origin,omitempty"`
24314
24315 *OperationPropertiesFormat `json:"properties,omitempty"`
24316 }
24317
24318
24319 func (o Operation) MarshalJSON() ([]byte, error) {
24320 objectMap := make(map[string]interface{})
24321 if o.Name != nil {
24322 objectMap["name"] = o.Name
24323 }
24324 if o.Display != nil {
24325 objectMap["display"] = o.Display
24326 }
24327 if o.Origin != nil {
24328 objectMap["origin"] = o.Origin
24329 }
24330 if o.OperationPropertiesFormat != nil {
24331 objectMap["properties"] = o.OperationPropertiesFormat
24332 }
24333 return json.Marshal(objectMap)
24334 }
24335
24336
24337 func (o *Operation) UnmarshalJSON(body []byte) error {
24338 var m map[string]*json.RawMessage
24339 err := json.Unmarshal(body, &m)
24340 if err != nil {
24341 return err
24342 }
24343 for k, v := range m {
24344 switch k {
24345 case "name":
24346 if v != nil {
24347 var name string
24348 err = json.Unmarshal(*v, &name)
24349 if err != nil {
24350 return err
24351 }
24352 o.Name = &name
24353 }
24354 case "display":
24355 if v != nil {
24356 var display OperationDisplay
24357 err = json.Unmarshal(*v, &display)
24358 if err != nil {
24359 return err
24360 }
24361 o.Display = &display
24362 }
24363 case "origin":
24364 if v != nil {
24365 var origin string
24366 err = json.Unmarshal(*v, &origin)
24367 if err != nil {
24368 return err
24369 }
24370 o.Origin = &origin
24371 }
24372 case "properties":
24373 if v != nil {
24374 var operationPropertiesFormat OperationPropertiesFormat
24375 err = json.Unmarshal(*v, &operationPropertiesFormat)
24376 if err != nil {
24377 return err
24378 }
24379 o.OperationPropertiesFormat = &operationPropertiesFormat
24380 }
24381 }
24382 }
24383
24384 return nil
24385 }
24386
24387
24388 type OperationDisplay struct {
24389
24390 Provider *string `json:"provider,omitempty"`
24391
24392 Resource *string `json:"resource,omitempty"`
24393
24394 Operation *string `json:"operation,omitempty"`
24395
24396 Description *string `json:"description,omitempty"`
24397 }
24398
24399
24400
24401 type OperationListResult struct {
24402 autorest.Response `json:"-"`
24403
24404 Value *[]Operation `json:"value,omitempty"`
24405
24406 NextLink *string `json:"nextLink,omitempty"`
24407 }
24408
24409
24410 type OperationListResultIterator struct {
24411 i int
24412 page OperationListResultPage
24413 }
24414
24415
24416
24417 func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
24418 if tracing.IsEnabled() {
24419 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
24420 defer func() {
24421 sc := -1
24422 if iter.Response().Response.Response != nil {
24423 sc = iter.Response().Response.Response.StatusCode
24424 }
24425 tracing.EndSpan(ctx, sc, err)
24426 }()
24427 }
24428 iter.i++
24429 if iter.i < len(iter.page.Values()) {
24430 return nil
24431 }
24432 err = iter.page.NextWithContext(ctx)
24433 if err != nil {
24434 iter.i--
24435 return err
24436 }
24437 iter.i = 0
24438 return nil
24439 }
24440
24441
24442
24443
24444 func (iter *OperationListResultIterator) Next() error {
24445 return iter.NextWithContext(context.Background())
24446 }
24447
24448
24449 func (iter OperationListResultIterator) NotDone() bool {
24450 return iter.page.NotDone() && iter.i < len(iter.page.Values())
24451 }
24452
24453
24454 func (iter OperationListResultIterator) Response() OperationListResult {
24455 return iter.page.Response()
24456 }
24457
24458
24459
24460 func (iter OperationListResultIterator) Value() Operation {
24461 if !iter.page.NotDone() {
24462 return Operation{}
24463 }
24464 return iter.page.Values()[iter.i]
24465 }
24466
24467
24468 func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
24469 return OperationListResultIterator{page: page}
24470 }
24471
24472
24473 func (olr OperationListResult) IsEmpty() bool {
24474 return olr.Value == nil || len(*olr.Value) == 0
24475 }
24476
24477
24478 func (olr OperationListResult) hasNextLink() bool {
24479 return olr.NextLink != nil && len(*olr.NextLink) != 0
24480 }
24481
24482
24483
24484 func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
24485 if !olr.hasNextLink() {
24486 return nil, nil
24487 }
24488 return autorest.Prepare((&http.Request{}).WithContext(ctx),
24489 autorest.AsJSON(),
24490 autorest.AsGet(),
24491 autorest.WithBaseURL(to.String(olr.NextLink)))
24492 }
24493
24494
24495 type OperationListResultPage struct {
24496 fn func(context.Context, OperationListResult) (OperationListResult, error)
24497 olr OperationListResult
24498 }
24499
24500
24501
24502 func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
24503 if tracing.IsEnabled() {
24504 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
24505 defer func() {
24506 sc := -1
24507 if page.Response().Response.Response != nil {
24508 sc = page.Response().Response.Response.StatusCode
24509 }
24510 tracing.EndSpan(ctx, sc, err)
24511 }()
24512 }
24513 for {
24514 next, err := page.fn(ctx, page.olr)
24515 if err != nil {
24516 return err
24517 }
24518 page.olr = next
24519 if !next.hasNextLink() || !next.IsEmpty() {
24520 break
24521 }
24522 }
24523 return nil
24524 }
24525
24526
24527
24528
24529 func (page *OperationListResultPage) Next() error {
24530 return page.NextWithContext(context.Background())
24531 }
24532
24533
24534 func (page OperationListResultPage) NotDone() bool {
24535 return !page.olr.IsEmpty()
24536 }
24537
24538
24539 func (page OperationListResultPage) Response() OperationListResult {
24540 return page.olr
24541 }
24542
24543
24544 func (page OperationListResultPage) Values() []Operation {
24545 if page.olr.IsEmpty() {
24546 return nil
24547 }
24548 return *page.olr.Value
24549 }
24550
24551
24552 func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
24553 return OperationListResultPage{
24554 fn: getNextPage,
24555 olr: cur,
24556 }
24557 }
24558
24559
24560 type OperationPropertiesFormat struct {
24561
24562 ServiceSpecification *OperationPropertiesFormatServiceSpecification `json:"serviceSpecification,omitempty"`
24563 }
24564
24565
24566 type OperationPropertiesFormatServiceSpecification struct {
24567
24568 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
24569
24570 LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
24571 }
24572
24573
24574 type OutboundRule struct {
24575 autorest.Response `json:"-"`
24576
24577 *OutboundRulePropertiesFormat `json:"properties,omitempty"`
24578
24579 Name *string `json:"name,omitempty"`
24580
24581 Etag *string `json:"etag,omitempty"`
24582
24583 Type *string `json:"type,omitempty"`
24584
24585 ID *string `json:"id,omitempty"`
24586 }
24587
24588
24589 func (or OutboundRule) MarshalJSON() ([]byte, error) {
24590 objectMap := make(map[string]interface{})
24591 if or.OutboundRulePropertiesFormat != nil {
24592 objectMap["properties"] = or.OutboundRulePropertiesFormat
24593 }
24594 if or.Name != nil {
24595 objectMap["name"] = or.Name
24596 }
24597 if or.ID != nil {
24598 objectMap["id"] = or.ID
24599 }
24600 return json.Marshal(objectMap)
24601 }
24602
24603
24604 func (or *OutboundRule) UnmarshalJSON(body []byte) error {
24605 var m map[string]*json.RawMessage
24606 err := json.Unmarshal(body, &m)
24607 if err != nil {
24608 return err
24609 }
24610 for k, v := range m {
24611 switch k {
24612 case "properties":
24613 if v != nil {
24614 var outboundRulePropertiesFormat OutboundRulePropertiesFormat
24615 err = json.Unmarshal(*v, &outboundRulePropertiesFormat)
24616 if err != nil {
24617 return err
24618 }
24619 or.OutboundRulePropertiesFormat = &outboundRulePropertiesFormat
24620 }
24621 case "name":
24622 if v != nil {
24623 var name string
24624 err = json.Unmarshal(*v, &name)
24625 if err != nil {
24626 return err
24627 }
24628 or.Name = &name
24629 }
24630 case "etag":
24631 if v != nil {
24632 var etag string
24633 err = json.Unmarshal(*v, &etag)
24634 if err != nil {
24635 return err
24636 }
24637 or.Etag = &etag
24638 }
24639 case "type":
24640 if v != nil {
24641 var typeVar string
24642 err = json.Unmarshal(*v, &typeVar)
24643 if err != nil {
24644 return err
24645 }
24646 or.Type = &typeVar
24647 }
24648 case "id":
24649 if v != nil {
24650 var ID string
24651 err = json.Unmarshal(*v, &ID)
24652 if err != nil {
24653 return err
24654 }
24655 or.ID = &ID
24656 }
24657 }
24658 }
24659
24660 return nil
24661 }
24662
24663
24664 type OutboundRulePropertiesFormat struct {
24665
24666 AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"`
24667
24668 FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"`
24669
24670 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
24671
24672 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
24673
24674 Protocol LoadBalancerOutboundRuleProtocol `json:"protocol,omitempty"`
24675
24676 EnableTCPReset *bool `json:"enableTcpReset,omitempty"`
24677
24678 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
24679 }
24680
24681
24682 func (orpf OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) {
24683 objectMap := make(map[string]interface{})
24684 if orpf.AllocatedOutboundPorts != nil {
24685 objectMap["allocatedOutboundPorts"] = orpf.AllocatedOutboundPorts
24686 }
24687 if orpf.FrontendIPConfigurations != nil {
24688 objectMap["frontendIPConfigurations"] = orpf.FrontendIPConfigurations
24689 }
24690 if orpf.BackendAddressPool != nil {
24691 objectMap["backendAddressPool"] = orpf.BackendAddressPool
24692 }
24693 if orpf.Protocol != "" {
24694 objectMap["protocol"] = orpf.Protocol
24695 }
24696 if orpf.EnableTCPReset != nil {
24697 objectMap["enableTcpReset"] = orpf.EnableTCPReset
24698 }
24699 if orpf.IdleTimeoutInMinutes != nil {
24700 objectMap["idleTimeoutInMinutes"] = orpf.IdleTimeoutInMinutes
24701 }
24702 return json.Marshal(objectMap)
24703 }
24704
24705
24706 type OwaspCrsExclusionEntry struct {
24707
24708 MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable,omitempty"`
24709
24710 SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator,omitempty"`
24711
24712 Selector *string `json:"selector,omitempty"`
24713 }
24714
24715
24716 type P2SConnectionConfiguration struct {
24717
24718 *P2SConnectionConfigurationProperties `json:"properties,omitempty"`
24719
24720 Name *string `json:"name,omitempty"`
24721
24722 Etag *string `json:"etag,omitempty"`
24723
24724 ID *string `json:"id,omitempty"`
24725 }
24726
24727
24728 func (pcc P2SConnectionConfiguration) MarshalJSON() ([]byte, error) {
24729 objectMap := make(map[string]interface{})
24730 if pcc.P2SConnectionConfigurationProperties != nil {
24731 objectMap["properties"] = pcc.P2SConnectionConfigurationProperties
24732 }
24733 if pcc.Name != nil {
24734 objectMap["name"] = pcc.Name
24735 }
24736 if pcc.ID != nil {
24737 objectMap["id"] = pcc.ID
24738 }
24739 return json.Marshal(objectMap)
24740 }
24741
24742
24743 func (pcc *P2SConnectionConfiguration) UnmarshalJSON(body []byte) error {
24744 var m map[string]*json.RawMessage
24745 err := json.Unmarshal(body, &m)
24746 if err != nil {
24747 return err
24748 }
24749 for k, v := range m {
24750 switch k {
24751 case "properties":
24752 if v != nil {
24753 var p2SConnectionConfigurationProperties P2SConnectionConfigurationProperties
24754 err = json.Unmarshal(*v, &p2SConnectionConfigurationProperties)
24755 if err != nil {
24756 return err
24757 }
24758 pcc.P2SConnectionConfigurationProperties = &p2SConnectionConfigurationProperties
24759 }
24760 case "name":
24761 if v != nil {
24762 var name string
24763 err = json.Unmarshal(*v, &name)
24764 if err != nil {
24765 return err
24766 }
24767 pcc.Name = &name
24768 }
24769 case "etag":
24770 if v != nil {
24771 var etag string
24772 err = json.Unmarshal(*v, &etag)
24773 if err != nil {
24774 return err
24775 }
24776 pcc.Etag = &etag
24777 }
24778 case "id":
24779 if v != nil {
24780 var ID string
24781 err = json.Unmarshal(*v, &ID)
24782 if err != nil {
24783 return err
24784 }
24785 pcc.ID = &ID
24786 }
24787 }
24788 }
24789
24790 return nil
24791 }
24792
24793
24794 type P2SConnectionConfigurationProperties struct {
24795
24796 VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"`
24797
24798 RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"`
24799
24800 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
24801 }
24802
24803
24804 func (pccp P2SConnectionConfigurationProperties) MarshalJSON() ([]byte, error) {
24805 objectMap := make(map[string]interface{})
24806 if pccp.VpnClientAddressPool != nil {
24807 objectMap["vpnClientAddressPool"] = pccp.VpnClientAddressPool
24808 }
24809 if pccp.RoutingConfiguration != nil {
24810 objectMap["routingConfiguration"] = pccp.RoutingConfiguration
24811 }
24812 return json.Marshal(objectMap)
24813 }
24814
24815
24816 type P2SVpnConnectionHealth struct {
24817 autorest.Response `json:"-"`
24818
24819 SasURL *string `json:"sasUrl,omitempty"`
24820 }
24821
24822
24823 type P2SVpnConnectionHealthRequest struct {
24824
24825 VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"`
24826
24827 OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"`
24828 }
24829
24830
24831 type P2SVpnConnectionRequest struct {
24832
24833 VpnConnectionIds *[]string `json:"vpnConnectionIds,omitempty"`
24834 }
24835
24836
24837 type P2SVpnGateway struct {
24838 autorest.Response `json:"-"`
24839
24840 *P2SVpnGatewayProperties `json:"properties,omitempty"`
24841
24842 Etag *string `json:"etag,omitempty"`
24843
24844 ID *string `json:"id,omitempty"`
24845
24846 Name *string `json:"name,omitempty"`
24847
24848 Type *string `json:"type,omitempty"`
24849
24850 Location *string `json:"location,omitempty"`
24851
24852 Tags map[string]*string `json:"tags"`
24853 }
24854
24855
24856 func (pvg P2SVpnGateway) MarshalJSON() ([]byte, error) {
24857 objectMap := make(map[string]interface{})
24858 if pvg.P2SVpnGatewayProperties != nil {
24859 objectMap["properties"] = pvg.P2SVpnGatewayProperties
24860 }
24861 if pvg.ID != nil {
24862 objectMap["id"] = pvg.ID
24863 }
24864 if pvg.Location != nil {
24865 objectMap["location"] = pvg.Location
24866 }
24867 if pvg.Tags != nil {
24868 objectMap["tags"] = pvg.Tags
24869 }
24870 return json.Marshal(objectMap)
24871 }
24872
24873
24874 func (pvg *P2SVpnGateway) UnmarshalJSON(body []byte) error {
24875 var m map[string]*json.RawMessage
24876 err := json.Unmarshal(body, &m)
24877 if err != nil {
24878 return err
24879 }
24880 for k, v := range m {
24881 switch k {
24882 case "properties":
24883 if v != nil {
24884 var p2SVpnGatewayProperties P2SVpnGatewayProperties
24885 err = json.Unmarshal(*v, &p2SVpnGatewayProperties)
24886 if err != nil {
24887 return err
24888 }
24889 pvg.P2SVpnGatewayProperties = &p2SVpnGatewayProperties
24890 }
24891 case "etag":
24892 if v != nil {
24893 var etag string
24894 err = json.Unmarshal(*v, &etag)
24895 if err != nil {
24896 return err
24897 }
24898 pvg.Etag = &etag
24899 }
24900 case "id":
24901 if v != nil {
24902 var ID string
24903 err = json.Unmarshal(*v, &ID)
24904 if err != nil {
24905 return err
24906 }
24907 pvg.ID = &ID
24908 }
24909 case "name":
24910 if v != nil {
24911 var name string
24912 err = json.Unmarshal(*v, &name)
24913 if err != nil {
24914 return err
24915 }
24916 pvg.Name = &name
24917 }
24918 case "type":
24919 if v != nil {
24920 var typeVar string
24921 err = json.Unmarshal(*v, &typeVar)
24922 if err != nil {
24923 return err
24924 }
24925 pvg.Type = &typeVar
24926 }
24927 case "location":
24928 if v != nil {
24929 var location string
24930 err = json.Unmarshal(*v, &location)
24931 if err != nil {
24932 return err
24933 }
24934 pvg.Location = &location
24935 }
24936 case "tags":
24937 if v != nil {
24938 var tags map[string]*string
24939 err = json.Unmarshal(*v, &tags)
24940 if err != nil {
24941 return err
24942 }
24943 pvg.Tags = tags
24944 }
24945 }
24946 }
24947
24948 return nil
24949 }
24950
24951
24952 type P2SVpnGatewayProperties struct {
24953
24954 VirtualHub *SubResource `json:"virtualHub,omitempty"`
24955
24956 P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"`
24957
24958 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
24959
24960 VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"`
24961
24962 VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"`
24963
24964 VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"`
24965 }
24966
24967
24968 func (pvgp P2SVpnGatewayProperties) MarshalJSON() ([]byte, error) {
24969 objectMap := make(map[string]interface{})
24970 if pvgp.VirtualHub != nil {
24971 objectMap["virtualHub"] = pvgp.VirtualHub
24972 }
24973 if pvgp.P2SConnectionConfigurations != nil {
24974 objectMap["p2SConnectionConfigurations"] = pvgp.P2SConnectionConfigurations
24975 }
24976 if pvgp.VpnGatewayScaleUnit != nil {
24977 objectMap["vpnGatewayScaleUnit"] = pvgp.VpnGatewayScaleUnit
24978 }
24979 if pvgp.VpnServerConfiguration != nil {
24980 objectMap["vpnServerConfiguration"] = pvgp.VpnServerConfiguration
24981 }
24982 return json.Marshal(objectMap)
24983 }
24984
24985
24986
24987 type P2sVpnGatewaysCreateOrUpdateFuture struct {
24988 azure.FutureAPI
24989
24990
24991 Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error)
24992 }
24993
24994
24995 func (future *P2sVpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
24996 var azFuture azure.Future
24997 if err := json.Unmarshal(body, &azFuture); err != nil {
24998 return err
24999 }
25000 future.FutureAPI = &azFuture
25001 future.Result = future.result
25002 return nil
25003 }
25004
25005
25006 func (future *P2sVpnGatewaysCreateOrUpdateFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) {
25007 var done bool
25008 done, err = future.DoneWithContext(context.Background(), client)
25009 if err != nil {
25010 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
25011 return
25012 }
25013 if !done {
25014 pvg.Response.Response = future.Response()
25015 err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysCreateOrUpdateFuture")
25016 return
25017 }
25018 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25019 if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent {
25020 pvg, err = client.CreateOrUpdateResponder(pvg.Response.Response)
25021 if err != nil {
25022 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysCreateOrUpdateFuture", "Result", pvg.Response.Response, "Failure responding to request")
25023 }
25024 }
25025 return
25026 }
25027
25028
25029
25030 type P2sVpnGatewaysDeleteFuture struct {
25031 azure.FutureAPI
25032
25033
25034 Result func(P2sVpnGatewaysClient) (autorest.Response, error)
25035 }
25036
25037
25038 func (future *P2sVpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
25039 var azFuture azure.Future
25040 if err := json.Unmarshal(body, &azFuture); err != nil {
25041 return err
25042 }
25043 future.FutureAPI = &azFuture
25044 future.Result = future.result
25045 return nil
25046 }
25047
25048
25049 func (future *P2sVpnGatewaysDeleteFuture) result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) {
25050 var done bool
25051 done, err = future.DoneWithContext(context.Background(), client)
25052 if err != nil {
25053 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
25054 return
25055 }
25056 if !done {
25057 ar.Response = future.Response()
25058 err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysDeleteFuture")
25059 return
25060 }
25061 ar.Response = future.Response()
25062 return
25063 }
25064
25065
25066
25067 type P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture struct {
25068 azure.FutureAPI
25069
25070
25071 Result func(P2sVpnGatewaysClient) (autorest.Response, error)
25072 }
25073
25074
25075 func (future *P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture) UnmarshalJSON(body []byte) error {
25076 var azFuture azure.Future
25077 if err := json.Unmarshal(body, &azFuture); err != nil {
25078 return err
25079 }
25080 future.FutureAPI = &azFuture
25081 future.Result = future.result
25082 return nil
25083 }
25084
25085
25086 func (future *P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture) result(client P2sVpnGatewaysClient) (ar autorest.Response, err error) {
25087 var done bool
25088 done, err = future.DoneWithContext(context.Background(), client)
25089 if err != nil {
25090 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture", "Result", future.Response(), "Polling failure")
25091 return
25092 }
25093 if !done {
25094 ar.Response = future.Response()
25095 err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysDisconnectP2sVpnConnectionsFuture")
25096 return
25097 }
25098 ar.Response = future.Response()
25099 return
25100 }
25101
25102
25103
25104 type P2sVpnGatewaysGenerateVpnProfileFuture struct {
25105 azure.FutureAPI
25106
25107
25108 Result func(P2sVpnGatewaysClient) (VpnProfileResponse, error)
25109 }
25110
25111
25112 func (future *P2sVpnGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error {
25113 var azFuture azure.Future
25114 if err := json.Unmarshal(body, &azFuture); err != nil {
25115 return err
25116 }
25117 future.FutureAPI = &azFuture
25118 future.Result = future.result
25119 return nil
25120 }
25121
25122
25123 func (future *P2sVpnGatewaysGenerateVpnProfileFuture) result(client P2sVpnGatewaysClient) (vpr VpnProfileResponse, err error) {
25124 var done bool
25125 done, err = future.DoneWithContext(context.Background(), client)
25126 if err != nil {
25127 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure")
25128 return
25129 }
25130 if !done {
25131 vpr.Response.Response = future.Response()
25132 err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGenerateVpnProfileFuture")
25133 return
25134 }
25135 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25136 if vpr.Response.Response, err = future.GetResult(sender); err == nil && vpr.Response.Response.StatusCode != http.StatusNoContent {
25137 vpr, err = client.GenerateVpnProfileResponder(vpr.Response.Response)
25138 if err != nil {
25139 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGenerateVpnProfileFuture", "Result", vpr.Response.Response, "Failure responding to request")
25140 }
25141 }
25142 return
25143 }
25144
25145
25146
25147 type P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture struct {
25148 azure.FutureAPI
25149
25150
25151 Result func(P2sVpnGatewaysClient) (P2SVpnConnectionHealth, error)
25152 }
25153
25154
25155 func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture) UnmarshalJSON(body []byte) error {
25156 var azFuture azure.Future
25157 if err := json.Unmarshal(body, &azFuture); err != nil {
25158 return err
25159 }
25160 future.FutureAPI = &azFuture
25161 future.Result = future.result
25162 return nil
25163 }
25164
25165
25166 func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture) result(client P2sVpnGatewaysClient) (pvch P2SVpnConnectionHealth, err error) {
25167 var done bool
25168 done, err = future.DoneWithContext(context.Background(), client)
25169 if err != nil {
25170 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture", "Result", future.Response(), "Polling failure")
25171 return
25172 }
25173 if !done {
25174 pvch.Response.Response = future.Response()
25175 err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture")
25176 return
25177 }
25178 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25179 if pvch.Response.Response, err = future.GetResult(sender); err == nil && pvch.Response.Response.StatusCode != http.StatusNoContent {
25180 pvch, err = client.GetP2sVpnConnectionHealthDetailedResponder(pvch.Response.Response)
25181 if err != nil {
25182 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthDetailedFuture", "Result", pvch.Response.Response, "Failure responding to request")
25183 }
25184 }
25185 return
25186 }
25187
25188
25189
25190 type P2sVpnGatewaysGetP2sVpnConnectionHealthFuture struct {
25191 azure.FutureAPI
25192
25193
25194 Result func(P2sVpnGatewaysClient) (P2SVpnGateway, error)
25195 }
25196
25197
25198 func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) UnmarshalJSON(body []byte) error {
25199 var azFuture azure.Future
25200 if err := json.Unmarshal(body, &azFuture); err != nil {
25201 return err
25202 }
25203 future.FutureAPI = &azFuture
25204 future.Result = future.result
25205 return nil
25206 }
25207
25208
25209 func (future *P2sVpnGatewaysGetP2sVpnConnectionHealthFuture) result(client P2sVpnGatewaysClient) (pvg P2SVpnGateway, err error) {
25210 var done bool
25211 done, err = future.DoneWithContext(context.Background(), client)
25212 if err != nil {
25213 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture", "Result", future.Response(), "Polling failure")
25214 return
25215 }
25216 if !done {
25217 pvg.Response.Response = future.Response()
25218 err = azure.NewAsyncOpIncompleteError("network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture")
25219 return
25220 }
25221 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25222 if pvg.Response.Response, err = future.GetResult(sender); err == nil && pvg.Response.Response.StatusCode != http.StatusNoContent {
25223 pvg, err = client.GetP2sVpnConnectionHealthResponder(pvg.Response.Response)
25224 if err != nil {
25225 err = autorest.NewErrorWithError(err, "network.P2sVpnGatewaysGetP2sVpnConnectionHealthFuture", "Result", pvg.Response.Response, "Failure responding to request")
25226 }
25227 }
25228 return
25229 }
25230
25231
25232 type P2SVpnProfileParameters struct {
25233
25234 AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"`
25235 }
25236
25237
25238 type PacketCapture struct {
25239
25240 *PacketCaptureParameters `json:"properties,omitempty"`
25241 }
25242
25243
25244 func (pc PacketCapture) MarshalJSON() ([]byte, error) {
25245 objectMap := make(map[string]interface{})
25246 if pc.PacketCaptureParameters != nil {
25247 objectMap["properties"] = pc.PacketCaptureParameters
25248 }
25249 return json.Marshal(objectMap)
25250 }
25251
25252
25253 func (pc *PacketCapture) UnmarshalJSON(body []byte) error {
25254 var m map[string]*json.RawMessage
25255 err := json.Unmarshal(body, &m)
25256 if err != nil {
25257 return err
25258 }
25259 for k, v := range m {
25260 switch k {
25261 case "properties":
25262 if v != nil {
25263 var packetCaptureParameters PacketCaptureParameters
25264 err = json.Unmarshal(*v, &packetCaptureParameters)
25265 if err != nil {
25266 return err
25267 }
25268 pc.PacketCaptureParameters = &packetCaptureParameters
25269 }
25270 }
25271 }
25272
25273 return nil
25274 }
25275
25276
25277 type PacketCaptureFilter struct {
25278
25279 Protocol PcProtocol `json:"protocol,omitempty"`
25280
25281 LocalIPAddress *string `json:"localIPAddress,omitempty"`
25282
25283 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"`
25284
25285 LocalPort *string `json:"localPort,omitempty"`
25286
25287 RemotePort *string `json:"remotePort,omitempty"`
25288 }
25289
25290
25291 type PacketCaptureListResult struct {
25292 autorest.Response `json:"-"`
25293
25294 Value *[]PacketCaptureResult `json:"value,omitempty"`
25295 }
25296
25297
25298 type PacketCaptureParameters struct {
25299
25300 Target *string `json:"target,omitempty"`
25301
25302 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"`
25303
25304 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"`
25305
25306 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"`
25307
25308 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"`
25309
25310 Filters *[]PacketCaptureFilter `json:"filters,omitempty"`
25311 }
25312
25313
25314 type PacketCaptureQueryStatusResult struct {
25315 autorest.Response `json:"-"`
25316
25317 Name *string `json:"name,omitempty"`
25318
25319 ID *string `json:"id,omitempty"`
25320
25321 CaptureStartTime *date.Time `json:"captureStartTime,omitempty"`
25322
25323 PacketCaptureStatus PcStatus `json:"packetCaptureStatus,omitempty"`
25324
25325 StopReason *string `json:"stopReason,omitempty"`
25326
25327 PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"`
25328 }
25329
25330
25331 type PacketCaptureResult struct {
25332 autorest.Response `json:"-"`
25333
25334 Name *string `json:"name,omitempty"`
25335
25336 ID *string `json:"id,omitempty"`
25337
25338 Etag *string `json:"etag,omitempty"`
25339
25340 *PacketCaptureResultProperties `json:"properties,omitempty"`
25341 }
25342
25343
25344 func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) {
25345 objectMap := make(map[string]interface{})
25346 if pcr.PacketCaptureResultProperties != nil {
25347 objectMap["properties"] = pcr.PacketCaptureResultProperties
25348 }
25349 return json.Marshal(objectMap)
25350 }
25351
25352
25353 func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error {
25354 var m map[string]*json.RawMessage
25355 err := json.Unmarshal(body, &m)
25356 if err != nil {
25357 return err
25358 }
25359 for k, v := range m {
25360 switch k {
25361 case "name":
25362 if v != nil {
25363 var name string
25364 err = json.Unmarshal(*v, &name)
25365 if err != nil {
25366 return err
25367 }
25368 pcr.Name = &name
25369 }
25370 case "id":
25371 if v != nil {
25372 var ID string
25373 err = json.Unmarshal(*v, &ID)
25374 if err != nil {
25375 return err
25376 }
25377 pcr.ID = &ID
25378 }
25379 case "etag":
25380 if v != nil {
25381 var etag string
25382 err = json.Unmarshal(*v, &etag)
25383 if err != nil {
25384 return err
25385 }
25386 pcr.Etag = &etag
25387 }
25388 case "properties":
25389 if v != nil {
25390 var packetCaptureResultProperties PacketCaptureResultProperties
25391 err = json.Unmarshal(*v, &packetCaptureResultProperties)
25392 if err != nil {
25393 return err
25394 }
25395 pcr.PacketCaptureResultProperties = &packetCaptureResultProperties
25396 }
25397 }
25398 }
25399
25400 return nil
25401 }
25402
25403
25404 type PacketCaptureResultProperties struct {
25405
25406 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
25407
25408 Target *string `json:"target,omitempty"`
25409
25410 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"`
25411
25412 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"`
25413
25414 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"`
25415
25416 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"`
25417
25418 Filters *[]PacketCaptureFilter `json:"filters,omitempty"`
25419 }
25420
25421
25422 func (pcrp PacketCaptureResultProperties) MarshalJSON() ([]byte, error) {
25423 objectMap := make(map[string]interface{})
25424 if pcrp.Target != nil {
25425 objectMap["target"] = pcrp.Target
25426 }
25427 if pcrp.BytesToCapturePerPacket != nil {
25428 objectMap["bytesToCapturePerPacket"] = pcrp.BytesToCapturePerPacket
25429 }
25430 if pcrp.TotalBytesPerSession != nil {
25431 objectMap["totalBytesPerSession"] = pcrp.TotalBytesPerSession
25432 }
25433 if pcrp.TimeLimitInSeconds != nil {
25434 objectMap["timeLimitInSeconds"] = pcrp.TimeLimitInSeconds
25435 }
25436 if pcrp.StorageLocation != nil {
25437 objectMap["storageLocation"] = pcrp.StorageLocation
25438 }
25439 if pcrp.Filters != nil {
25440 objectMap["filters"] = pcrp.Filters
25441 }
25442 return json.Marshal(objectMap)
25443 }
25444
25445
25446
25447 type PacketCapturesCreateFuture struct {
25448 azure.FutureAPI
25449
25450
25451 Result func(PacketCapturesClient) (PacketCaptureResult, error)
25452 }
25453
25454
25455 func (future *PacketCapturesCreateFuture) UnmarshalJSON(body []byte) error {
25456 var azFuture azure.Future
25457 if err := json.Unmarshal(body, &azFuture); err != nil {
25458 return err
25459 }
25460 future.FutureAPI = &azFuture
25461 future.Result = future.result
25462 return nil
25463 }
25464
25465
25466 func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) {
25467 var done bool
25468 done, err = future.DoneWithContext(context.Background(), client)
25469 if err != nil {
25470 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure")
25471 return
25472 }
25473 if !done {
25474 pcr.Response.Response = future.Response()
25475 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture")
25476 return
25477 }
25478 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25479 if pcr.Response.Response, err = future.GetResult(sender); err == nil && pcr.Response.Response.StatusCode != http.StatusNoContent {
25480 pcr, err = client.CreateResponder(pcr.Response.Response)
25481 if err != nil {
25482 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", pcr.Response.Response, "Failure responding to request")
25483 }
25484 }
25485 return
25486 }
25487
25488
25489
25490 type PacketCapturesDeleteFuture struct {
25491 azure.FutureAPI
25492
25493
25494 Result func(PacketCapturesClient) (autorest.Response, error)
25495 }
25496
25497
25498 func (future *PacketCapturesDeleteFuture) UnmarshalJSON(body []byte) error {
25499 var azFuture azure.Future
25500 if err := json.Unmarshal(body, &azFuture); err != nil {
25501 return err
25502 }
25503 future.FutureAPI = &azFuture
25504 future.Result = future.result
25505 return nil
25506 }
25507
25508
25509 func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) {
25510 var done bool
25511 done, err = future.DoneWithContext(context.Background(), client)
25512 if err != nil {
25513 err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure")
25514 return
25515 }
25516 if !done {
25517 ar.Response = future.Response()
25518 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture")
25519 return
25520 }
25521 ar.Response = future.Response()
25522 return
25523 }
25524
25525
25526
25527 type PacketCapturesGetStatusFuture struct {
25528 azure.FutureAPI
25529
25530
25531 Result func(PacketCapturesClient) (PacketCaptureQueryStatusResult, error)
25532 }
25533
25534
25535 func (future *PacketCapturesGetStatusFuture) UnmarshalJSON(body []byte) error {
25536 var azFuture azure.Future
25537 if err := json.Unmarshal(body, &azFuture); err != nil {
25538 return err
25539 }
25540 future.FutureAPI = &azFuture
25541 future.Result = future.result
25542 return nil
25543 }
25544
25545
25546 func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) {
25547 var done bool
25548 done, err = future.DoneWithContext(context.Background(), client)
25549 if err != nil {
25550 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure")
25551 return
25552 }
25553 if !done {
25554 pcqsr.Response.Response = future.Response()
25555 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture")
25556 return
25557 }
25558 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
25559 if pcqsr.Response.Response, err = future.GetResult(sender); err == nil && pcqsr.Response.Response.StatusCode != http.StatusNoContent {
25560 pcqsr, err = client.GetStatusResponder(pcqsr.Response.Response)
25561 if err != nil {
25562 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", pcqsr.Response.Response, "Failure responding to request")
25563 }
25564 }
25565 return
25566 }
25567
25568
25569
25570 type PacketCapturesStopFuture struct {
25571 azure.FutureAPI
25572
25573
25574 Result func(PacketCapturesClient) (autorest.Response, error)
25575 }
25576
25577
25578 func (future *PacketCapturesStopFuture) UnmarshalJSON(body []byte) error {
25579 var azFuture azure.Future
25580 if err := json.Unmarshal(body, &azFuture); err != nil {
25581 return err
25582 }
25583 future.FutureAPI = &azFuture
25584 future.Result = future.result
25585 return nil
25586 }
25587
25588
25589 func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) {
25590 var done bool
25591 done, err = future.DoneWithContext(context.Background(), client)
25592 if err != nil {
25593 err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure")
25594 return
25595 }
25596 if !done {
25597 ar.Response = future.Response()
25598 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture")
25599 return
25600 }
25601 ar.Response = future.Response()
25602 return
25603 }
25604
25605
25606 type PacketCaptureStorageLocation struct {
25607
25608 StorageID *string `json:"storageId,omitempty"`
25609
25610 StoragePath *string `json:"storagePath,omitempty"`
25611
25612 FilePath *string `json:"filePath,omitempty"`
25613 }
25614
25615
25616 type PatchRouteFilter struct {
25617
25618 *RouteFilterPropertiesFormat `json:"properties,omitempty"`
25619
25620 Name *string `json:"name,omitempty"`
25621
25622 Etag *string `json:"etag,omitempty"`
25623
25624 Type *string `json:"type,omitempty"`
25625
25626 Tags map[string]*string `json:"tags"`
25627
25628 ID *string `json:"id,omitempty"`
25629 }
25630
25631
25632 func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) {
25633 objectMap := make(map[string]interface{})
25634 if prf.RouteFilterPropertiesFormat != nil {
25635 objectMap["properties"] = prf.RouteFilterPropertiesFormat
25636 }
25637 if prf.Tags != nil {
25638 objectMap["tags"] = prf.Tags
25639 }
25640 if prf.ID != nil {
25641 objectMap["id"] = prf.ID
25642 }
25643 return json.Marshal(objectMap)
25644 }
25645
25646
25647 func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error {
25648 var m map[string]*json.RawMessage
25649 err := json.Unmarshal(body, &m)
25650 if err != nil {
25651 return err
25652 }
25653 for k, v := range m {
25654 switch k {
25655 case "properties":
25656 if v != nil {
25657 var routeFilterPropertiesFormat RouteFilterPropertiesFormat
25658 err = json.Unmarshal(*v, &routeFilterPropertiesFormat)
25659 if err != nil {
25660 return err
25661 }
25662 prf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat
25663 }
25664 case "name":
25665 if v != nil {
25666 var name string
25667 err = json.Unmarshal(*v, &name)
25668 if err != nil {
25669 return err
25670 }
25671 prf.Name = &name
25672 }
25673 case "etag":
25674 if v != nil {
25675 var etag string
25676 err = json.Unmarshal(*v, &etag)
25677 if err != nil {
25678 return err
25679 }
25680 prf.Etag = &etag
25681 }
25682 case "type":
25683 if v != nil {
25684 var typeVar string
25685 err = json.Unmarshal(*v, &typeVar)
25686 if err != nil {
25687 return err
25688 }
25689 prf.Type = &typeVar
25690 }
25691 case "tags":
25692 if v != nil {
25693 var tags map[string]*string
25694 err = json.Unmarshal(*v, &tags)
25695 if err != nil {
25696 return err
25697 }
25698 prf.Tags = tags
25699 }
25700 case "id":
25701 if v != nil {
25702 var ID string
25703 err = json.Unmarshal(*v, &ID)
25704 if err != nil {
25705 return err
25706 }
25707 prf.ID = &ID
25708 }
25709 }
25710 }
25711
25712 return nil
25713 }
25714
25715
25716 type PatchRouteFilterRule struct {
25717
25718 *RouteFilterRulePropertiesFormat `json:"properties,omitempty"`
25719
25720 Name *string `json:"name,omitempty"`
25721
25722 Etag *string `json:"etag,omitempty"`
25723
25724 ID *string `json:"id,omitempty"`
25725 }
25726
25727
25728 func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) {
25729 objectMap := make(map[string]interface{})
25730 if prfr.RouteFilterRulePropertiesFormat != nil {
25731 objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat
25732 }
25733 if prfr.ID != nil {
25734 objectMap["id"] = prfr.ID
25735 }
25736 return json.Marshal(objectMap)
25737 }
25738
25739
25740 func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error {
25741 var m map[string]*json.RawMessage
25742 err := json.Unmarshal(body, &m)
25743 if err != nil {
25744 return err
25745 }
25746 for k, v := range m {
25747 switch k {
25748 case "properties":
25749 if v != nil {
25750 var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat
25751 err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat)
25752 if err != nil {
25753 return err
25754 }
25755 prfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat
25756 }
25757 case "name":
25758 if v != nil {
25759 var name string
25760 err = json.Unmarshal(*v, &name)
25761 if err != nil {
25762 return err
25763 }
25764 prfr.Name = &name
25765 }
25766 case "etag":
25767 if v != nil {
25768 var etag string
25769 err = json.Unmarshal(*v, &etag)
25770 if err != nil {
25771 return err
25772 }
25773 prfr.Etag = &etag
25774 }
25775 case "id":
25776 if v != nil {
25777 var ID string
25778 err = json.Unmarshal(*v, &ID)
25779 if err != nil {
25780 return err
25781 }
25782 prfr.ID = &ID
25783 }
25784 }
25785 }
25786
25787 return nil
25788 }
25789
25790
25791
25792 type PeerExpressRouteCircuitConnection struct {
25793 autorest.Response `json:"-"`
25794
25795 *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"`
25796
25797 Name *string `json:"name,omitempty"`
25798
25799 Etag *string `json:"etag,omitempty"`
25800
25801 Type *string `json:"type,omitempty"`
25802
25803 ID *string `json:"id,omitempty"`
25804 }
25805
25806
25807 func (percc PeerExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) {
25808 objectMap := make(map[string]interface{})
25809 if percc.PeerExpressRouteCircuitConnectionPropertiesFormat != nil {
25810 objectMap["properties"] = percc.PeerExpressRouteCircuitConnectionPropertiesFormat
25811 }
25812 if percc.Name != nil {
25813 objectMap["name"] = percc.Name
25814 }
25815 if percc.ID != nil {
25816 objectMap["id"] = percc.ID
25817 }
25818 return json.Marshal(objectMap)
25819 }
25820
25821
25822 func (percc *PeerExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error {
25823 var m map[string]*json.RawMessage
25824 err := json.Unmarshal(body, &m)
25825 if err != nil {
25826 return err
25827 }
25828 for k, v := range m {
25829 switch k {
25830 case "properties":
25831 if v != nil {
25832 var peerExpressRouteCircuitConnectionPropertiesFormat PeerExpressRouteCircuitConnectionPropertiesFormat
25833 err = json.Unmarshal(*v, &peerExpressRouteCircuitConnectionPropertiesFormat)
25834 if err != nil {
25835 return err
25836 }
25837 percc.PeerExpressRouteCircuitConnectionPropertiesFormat = &peerExpressRouteCircuitConnectionPropertiesFormat
25838 }
25839 case "name":
25840 if v != nil {
25841 var name string
25842 err = json.Unmarshal(*v, &name)
25843 if err != nil {
25844 return err
25845 }
25846 percc.Name = &name
25847 }
25848 case "etag":
25849 if v != nil {
25850 var etag string
25851 err = json.Unmarshal(*v, &etag)
25852 if err != nil {
25853 return err
25854 }
25855 percc.Etag = &etag
25856 }
25857 case "type":
25858 if v != nil {
25859 var typeVar string
25860 err = json.Unmarshal(*v, &typeVar)
25861 if err != nil {
25862 return err
25863 }
25864 percc.Type = &typeVar
25865 }
25866 case "id":
25867 if v != nil {
25868 var ID string
25869 err = json.Unmarshal(*v, &ID)
25870 if err != nil {
25871 return err
25872 }
25873 percc.ID = &ID
25874 }
25875 }
25876 }
25877
25878 return nil
25879 }
25880
25881
25882
25883
25884 type PeerExpressRouteCircuitConnectionListResult struct {
25885 autorest.Response `json:"-"`
25886
25887 Value *[]PeerExpressRouteCircuitConnection `json:"value,omitempty"`
25888
25889 NextLink *string `json:"nextLink,omitempty"`
25890 }
25891
25892
25893
25894 type PeerExpressRouteCircuitConnectionListResultIterator struct {
25895 i int
25896 page PeerExpressRouteCircuitConnectionListResultPage
25897 }
25898
25899
25900
25901 func (iter *PeerExpressRouteCircuitConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
25902 if tracing.IsEnabled() {
25903 ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionListResultIterator.NextWithContext")
25904 defer func() {
25905 sc := -1
25906 if iter.Response().Response.Response != nil {
25907 sc = iter.Response().Response.Response.StatusCode
25908 }
25909 tracing.EndSpan(ctx, sc, err)
25910 }()
25911 }
25912 iter.i++
25913 if iter.i < len(iter.page.Values()) {
25914 return nil
25915 }
25916 err = iter.page.NextWithContext(ctx)
25917 if err != nil {
25918 iter.i--
25919 return err
25920 }
25921 iter.i = 0
25922 return nil
25923 }
25924
25925
25926
25927
25928 func (iter *PeerExpressRouteCircuitConnectionListResultIterator) Next() error {
25929 return iter.NextWithContext(context.Background())
25930 }
25931
25932
25933 func (iter PeerExpressRouteCircuitConnectionListResultIterator) NotDone() bool {
25934 return iter.page.NotDone() && iter.i < len(iter.page.Values())
25935 }
25936
25937
25938 func (iter PeerExpressRouteCircuitConnectionListResultIterator) Response() PeerExpressRouteCircuitConnectionListResult {
25939 return iter.page.Response()
25940 }
25941
25942
25943
25944 func (iter PeerExpressRouteCircuitConnectionListResultIterator) Value() PeerExpressRouteCircuitConnection {
25945 if !iter.page.NotDone() {
25946 return PeerExpressRouteCircuitConnection{}
25947 }
25948 return iter.page.Values()[iter.i]
25949 }
25950
25951
25952 func NewPeerExpressRouteCircuitConnectionListResultIterator(page PeerExpressRouteCircuitConnectionListResultPage) PeerExpressRouteCircuitConnectionListResultIterator {
25953 return PeerExpressRouteCircuitConnectionListResultIterator{page: page}
25954 }
25955
25956
25957 func (percclr PeerExpressRouteCircuitConnectionListResult) IsEmpty() bool {
25958 return percclr.Value == nil || len(*percclr.Value) == 0
25959 }
25960
25961
25962 func (percclr PeerExpressRouteCircuitConnectionListResult) hasNextLink() bool {
25963 return percclr.NextLink != nil && len(*percclr.NextLink) != 0
25964 }
25965
25966
25967
25968 func (percclr PeerExpressRouteCircuitConnectionListResult) peerExpressRouteCircuitConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
25969 if !percclr.hasNextLink() {
25970 return nil, nil
25971 }
25972 return autorest.Prepare((&http.Request{}).WithContext(ctx),
25973 autorest.AsJSON(),
25974 autorest.AsGet(),
25975 autorest.WithBaseURL(to.String(percclr.NextLink)))
25976 }
25977
25978
25979
25980 type PeerExpressRouteCircuitConnectionListResultPage struct {
25981 fn func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error)
25982 percclr PeerExpressRouteCircuitConnectionListResult
25983 }
25984
25985
25986
25987 func (page *PeerExpressRouteCircuitConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
25988 if tracing.IsEnabled() {
25989 ctx = tracing.StartSpan(ctx, fqdn+"/PeerExpressRouteCircuitConnectionListResultPage.NextWithContext")
25990 defer func() {
25991 sc := -1
25992 if page.Response().Response.Response != nil {
25993 sc = page.Response().Response.Response.StatusCode
25994 }
25995 tracing.EndSpan(ctx, sc, err)
25996 }()
25997 }
25998 for {
25999 next, err := page.fn(ctx, page.percclr)
26000 if err != nil {
26001 return err
26002 }
26003 page.percclr = next
26004 if !next.hasNextLink() || !next.IsEmpty() {
26005 break
26006 }
26007 }
26008 return nil
26009 }
26010
26011
26012
26013
26014 func (page *PeerExpressRouteCircuitConnectionListResultPage) Next() error {
26015 return page.NextWithContext(context.Background())
26016 }
26017
26018
26019 func (page PeerExpressRouteCircuitConnectionListResultPage) NotDone() bool {
26020 return !page.percclr.IsEmpty()
26021 }
26022
26023
26024 func (page PeerExpressRouteCircuitConnectionListResultPage) Response() PeerExpressRouteCircuitConnectionListResult {
26025 return page.percclr
26026 }
26027
26028
26029 func (page PeerExpressRouteCircuitConnectionListResultPage) Values() []PeerExpressRouteCircuitConnection {
26030 if page.percclr.IsEmpty() {
26031 return nil
26032 }
26033 return *page.percclr.Value
26034 }
26035
26036
26037 func NewPeerExpressRouteCircuitConnectionListResultPage(cur PeerExpressRouteCircuitConnectionListResult, getNextPage func(context.Context, PeerExpressRouteCircuitConnectionListResult) (PeerExpressRouteCircuitConnectionListResult, error)) PeerExpressRouteCircuitConnectionListResultPage {
26038 return PeerExpressRouteCircuitConnectionListResultPage{
26039 fn: getNextPage,
26040 percclr: cur,
26041 }
26042 }
26043
26044
26045
26046 type PeerExpressRouteCircuitConnectionPropertiesFormat struct {
26047
26048 ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"`
26049
26050 PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"`
26051
26052 AddressPrefix *string `json:"addressPrefix,omitempty"`
26053
26054 CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"`
26055
26056 ConnectionName *string `json:"connectionName,omitempty"`
26057
26058 AuthResourceGUID *string `json:"authResourceGuid,omitempty"`
26059
26060 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
26061 }
26062
26063
26064 func (perccpf PeerExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) {
26065 objectMap := make(map[string]interface{})
26066 if perccpf.ExpressRouteCircuitPeering != nil {
26067 objectMap["expressRouteCircuitPeering"] = perccpf.ExpressRouteCircuitPeering
26068 }
26069 if perccpf.PeerExpressRouteCircuitPeering != nil {
26070 objectMap["peerExpressRouteCircuitPeering"] = perccpf.PeerExpressRouteCircuitPeering
26071 }
26072 if perccpf.AddressPrefix != nil {
26073 objectMap["addressPrefix"] = perccpf.AddressPrefix
26074 }
26075 if perccpf.CircuitConnectionStatus != "" {
26076 objectMap["circuitConnectionStatus"] = perccpf.CircuitConnectionStatus
26077 }
26078 if perccpf.ConnectionName != nil {
26079 objectMap["connectionName"] = perccpf.ConnectionName
26080 }
26081 if perccpf.AuthResourceGUID != nil {
26082 objectMap["authResourceGuid"] = perccpf.AuthResourceGUID
26083 }
26084 return json.Marshal(objectMap)
26085 }
26086
26087
26088 type PolicySettings struct {
26089
26090 State WebApplicationFirewallEnabledState `json:"state,omitempty"`
26091
26092 Mode WebApplicationFirewallMode `json:"mode,omitempty"`
26093
26094 RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"`
26095
26096 MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"`
26097
26098 FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"`
26099 }
26100
26101
26102 type PrepareNetworkPoliciesRequest struct {
26103
26104 ServiceName *string `json:"serviceName,omitempty"`
26105
26106 NetworkIntentPolicyConfigurations *[]IntentPolicyConfiguration `json:"networkIntentPolicyConfigurations,omitempty"`
26107 }
26108
26109
26110 type PrivateDNSZoneConfig struct {
26111
26112 Name *string `json:"name,omitempty"`
26113
26114 *PrivateDNSZonePropertiesFormat `json:"properties,omitempty"`
26115 }
26116
26117
26118 func (pdzc PrivateDNSZoneConfig) MarshalJSON() ([]byte, error) {
26119 objectMap := make(map[string]interface{})
26120 if pdzc.Name != nil {
26121 objectMap["name"] = pdzc.Name
26122 }
26123 if pdzc.PrivateDNSZonePropertiesFormat != nil {
26124 objectMap["properties"] = pdzc.PrivateDNSZonePropertiesFormat
26125 }
26126 return json.Marshal(objectMap)
26127 }
26128
26129
26130 func (pdzc *PrivateDNSZoneConfig) UnmarshalJSON(body []byte) error {
26131 var m map[string]*json.RawMessage
26132 err := json.Unmarshal(body, &m)
26133 if err != nil {
26134 return err
26135 }
26136 for k, v := range m {
26137 switch k {
26138 case "name":
26139 if v != nil {
26140 var name string
26141 err = json.Unmarshal(*v, &name)
26142 if err != nil {
26143 return err
26144 }
26145 pdzc.Name = &name
26146 }
26147 case "properties":
26148 if v != nil {
26149 var privateDNSZonePropertiesFormat PrivateDNSZonePropertiesFormat
26150 err = json.Unmarshal(*v, &privateDNSZonePropertiesFormat)
26151 if err != nil {
26152 return err
26153 }
26154 pdzc.PrivateDNSZonePropertiesFormat = &privateDNSZonePropertiesFormat
26155 }
26156 }
26157 }
26158
26159 return nil
26160 }
26161
26162
26163 type PrivateDNSZoneGroup struct {
26164 autorest.Response `json:"-"`
26165
26166 Name *string `json:"name,omitempty"`
26167
26168 Etag *string `json:"etag,omitempty"`
26169
26170 *PrivateDNSZoneGroupPropertiesFormat `json:"properties,omitempty"`
26171
26172 ID *string `json:"id,omitempty"`
26173 }
26174
26175
26176 func (pdzg PrivateDNSZoneGroup) MarshalJSON() ([]byte, error) {
26177 objectMap := make(map[string]interface{})
26178 if pdzg.Name != nil {
26179 objectMap["name"] = pdzg.Name
26180 }
26181 if pdzg.PrivateDNSZoneGroupPropertiesFormat != nil {
26182 objectMap["properties"] = pdzg.PrivateDNSZoneGroupPropertiesFormat
26183 }
26184 if pdzg.ID != nil {
26185 objectMap["id"] = pdzg.ID
26186 }
26187 return json.Marshal(objectMap)
26188 }
26189
26190
26191 func (pdzg *PrivateDNSZoneGroup) UnmarshalJSON(body []byte) error {
26192 var m map[string]*json.RawMessage
26193 err := json.Unmarshal(body, &m)
26194 if err != nil {
26195 return err
26196 }
26197 for k, v := range m {
26198 switch k {
26199 case "name":
26200 if v != nil {
26201 var name string
26202 err = json.Unmarshal(*v, &name)
26203 if err != nil {
26204 return err
26205 }
26206 pdzg.Name = &name
26207 }
26208 case "etag":
26209 if v != nil {
26210 var etag string
26211 err = json.Unmarshal(*v, &etag)
26212 if err != nil {
26213 return err
26214 }
26215 pdzg.Etag = &etag
26216 }
26217 case "properties":
26218 if v != nil {
26219 var privateDNSZoneGroupPropertiesFormat PrivateDNSZoneGroupPropertiesFormat
26220 err = json.Unmarshal(*v, &privateDNSZoneGroupPropertiesFormat)
26221 if err != nil {
26222 return err
26223 }
26224 pdzg.PrivateDNSZoneGroupPropertiesFormat = &privateDNSZoneGroupPropertiesFormat
26225 }
26226 case "id":
26227 if v != nil {
26228 var ID string
26229 err = json.Unmarshal(*v, &ID)
26230 if err != nil {
26231 return err
26232 }
26233 pdzg.ID = &ID
26234 }
26235 }
26236 }
26237
26238 return nil
26239 }
26240
26241
26242 type PrivateDNSZoneGroupListResult struct {
26243 autorest.Response `json:"-"`
26244
26245 Value *[]PrivateDNSZoneGroup `json:"value,omitempty"`
26246
26247 NextLink *string `json:"nextLink,omitempty"`
26248 }
26249
26250
26251 func (pdzglr PrivateDNSZoneGroupListResult) MarshalJSON() ([]byte, error) {
26252 objectMap := make(map[string]interface{})
26253 if pdzglr.Value != nil {
26254 objectMap["value"] = pdzglr.Value
26255 }
26256 return json.Marshal(objectMap)
26257 }
26258
26259
26260
26261 type PrivateDNSZoneGroupListResultIterator struct {
26262 i int
26263 page PrivateDNSZoneGroupListResultPage
26264 }
26265
26266
26267
26268 func (iter *PrivateDNSZoneGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
26269 if tracing.IsEnabled() {
26270 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupListResultIterator.NextWithContext")
26271 defer func() {
26272 sc := -1
26273 if iter.Response().Response.Response != nil {
26274 sc = iter.Response().Response.Response.StatusCode
26275 }
26276 tracing.EndSpan(ctx, sc, err)
26277 }()
26278 }
26279 iter.i++
26280 if iter.i < len(iter.page.Values()) {
26281 return nil
26282 }
26283 err = iter.page.NextWithContext(ctx)
26284 if err != nil {
26285 iter.i--
26286 return err
26287 }
26288 iter.i = 0
26289 return nil
26290 }
26291
26292
26293
26294
26295 func (iter *PrivateDNSZoneGroupListResultIterator) Next() error {
26296 return iter.NextWithContext(context.Background())
26297 }
26298
26299
26300 func (iter PrivateDNSZoneGroupListResultIterator) NotDone() bool {
26301 return iter.page.NotDone() && iter.i < len(iter.page.Values())
26302 }
26303
26304
26305 func (iter PrivateDNSZoneGroupListResultIterator) Response() PrivateDNSZoneGroupListResult {
26306 return iter.page.Response()
26307 }
26308
26309
26310
26311 func (iter PrivateDNSZoneGroupListResultIterator) Value() PrivateDNSZoneGroup {
26312 if !iter.page.NotDone() {
26313 return PrivateDNSZoneGroup{}
26314 }
26315 return iter.page.Values()[iter.i]
26316 }
26317
26318
26319 func NewPrivateDNSZoneGroupListResultIterator(page PrivateDNSZoneGroupListResultPage) PrivateDNSZoneGroupListResultIterator {
26320 return PrivateDNSZoneGroupListResultIterator{page: page}
26321 }
26322
26323
26324 func (pdzglr PrivateDNSZoneGroupListResult) IsEmpty() bool {
26325 return pdzglr.Value == nil || len(*pdzglr.Value) == 0
26326 }
26327
26328
26329 func (pdzglr PrivateDNSZoneGroupListResult) hasNextLink() bool {
26330 return pdzglr.NextLink != nil && len(*pdzglr.NextLink) != 0
26331 }
26332
26333
26334
26335 func (pdzglr PrivateDNSZoneGroupListResult) privateDNSZoneGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
26336 if !pdzglr.hasNextLink() {
26337 return nil, nil
26338 }
26339 return autorest.Prepare((&http.Request{}).WithContext(ctx),
26340 autorest.AsJSON(),
26341 autorest.AsGet(),
26342 autorest.WithBaseURL(to.String(pdzglr.NextLink)))
26343 }
26344
26345
26346 type PrivateDNSZoneGroupListResultPage struct {
26347 fn func(context.Context, PrivateDNSZoneGroupListResult) (PrivateDNSZoneGroupListResult, error)
26348 pdzglr PrivateDNSZoneGroupListResult
26349 }
26350
26351
26352
26353 func (page *PrivateDNSZoneGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
26354 if tracing.IsEnabled() {
26355 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateDNSZoneGroupListResultPage.NextWithContext")
26356 defer func() {
26357 sc := -1
26358 if page.Response().Response.Response != nil {
26359 sc = page.Response().Response.Response.StatusCode
26360 }
26361 tracing.EndSpan(ctx, sc, err)
26362 }()
26363 }
26364 for {
26365 next, err := page.fn(ctx, page.pdzglr)
26366 if err != nil {
26367 return err
26368 }
26369 page.pdzglr = next
26370 if !next.hasNextLink() || !next.IsEmpty() {
26371 break
26372 }
26373 }
26374 return nil
26375 }
26376
26377
26378
26379
26380 func (page *PrivateDNSZoneGroupListResultPage) Next() error {
26381 return page.NextWithContext(context.Background())
26382 }
26383
26384
26385 func (page PrivateDNSZoneGroupListResultPage) NotDone() bool {
26386 return !page.pdzglr.IsEmpty()
26387 }
26388
26389
26390 func (page PrivateDNSZoneGroupListResultPage) Response() PrivateDNSZoneGroupListResult {
26391 return page.pdzglr
26392 }
26393
26394
26395 func (page PrivateDNSZoneGroupListResultPage) Values() []PrivateDNSZoneGroup {
26396 if page.pdzglr.IsEmpty() {
26397 return nil
26398 }
26399 return *page.pdzglr.Value
26400 }
26401
26402
26403 func NewPrivateDNSZoneGroupListResultPage(cur PrivateDNSZoneGroupListResult, getNextPage func(context.Context, PrivateDNSZoneGroupListResult) (PrivateDNSZoneGroupListResult, error)) PrivateDNSZoneGroupListResultPage {
26404 return PrivateDNSZoneGroupListResultPage{
26405 fn: getNextPage,
26406 pdzglr: cur,
26407 }
26408 }
26409
26410
26411 type PrivateDNSZoneGroupPropertiesFormat struct {
26412
26413 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
26414
26415 PrivateDNSZoneConfigs *[]PrivateDNSZoneConfig `json:"privateDnsZoneConfigs,omitempty"`
26416 }
26417
26418
26419 func (pdzgpf PrivateDNSZoneGroupPropertiesFormat) MarshalJSON() ([]byte, error) {
26420 objectMap := make(map[string]interface{})
26421 if pdzgpf.PrivateDNSZoneConfigs != nil {
26422 objectMap["privateDnsZoneConfigs"] = pdzgpf.PrivateDNSZoneConfigs
26423 }
26424 return json.Marshal(objectMap)
26425 }
26426
26427
26428
26429 type PrivateDNSZoneGroupsCreateOrUpdateFuture struct {
26430 azure.FutureAPI
26431
26432
26433 Result func(PrivateDNSZoneGroupsClient) (PrivateDNSZoneGroup, error)
26434 }
26435
26436
26437 func (future *PrivateDNSZoneGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
26438 var azFuture azure.Future
26439 if err := json.Unmarshal(body, &azFuture); err != nil {
26440 return err
26441 }
26442 future.FutureAPI = &azFuture
26443 future.Result = future.result
26444 return nil
26445 }
26446
26447
26448 func (future *PrivateDNSZoneGroupsCreateOrUpdateFuture) result(client PrivateDNSZoneGroupsClient) (pdzg PrivateDNSZoneGroup, err error) {
26449 var done bool
26450 done, err = future.DoneWithContext(context.Background(), client)
26451 if err != nil {
26452 err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
26453 return
26454 }
26455 if !done {
26456 pdzg.Response.Response = future.Response()
26457 err = azure.NewAsyncOpIncompleteError("network.PrivateDNSZoneGroupsCreateOrUpdateFuture")
26458 return
26459 }
26460 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
26461 if pdzg.Response.Response, err = future.GetResult(sender); err == nil && pdzg.Response.Response.StatusCode != http.StatusNoContent {
26462 pdzg, err = client.CreateOrUpdateResponder(pdzg.Response.Response)
26463 if err != nil {
26464 err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsCreateOrUpdateFuture", "Result", pdzg.Response.Response, "Failure responding to request")
26465 }
26466 }
26467 return
26468 }
26469
26470
26471
26472 type PrivateDNSZoneGroupsDeleteFuture struct {
26473 azure.FutureAPI
26474
26475
26476 Result func(PrivateDNSZoneGroupsClient) (autorest.Response, error)
26477 }
26478
26479
26480 func (future *PrivateDNSZoneGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
26481 var azFuture azure.Future
26482 if err := json.Unmarshal(body, &azFuture); err != nil {
26483 return err
26484 }
26485 future.FutureAPI = &azFuture
26486 future.Result = future.result
26487 return nil
26488 }
26489
26490
26491 func (future *PrivateDNSZoneGroupsDeleteFuture) result(client PrivateDNSZoneGroupsClient) (ar autorest.Response, err error) {
26492 var done bool
26493 done, err = future.DoneWithContext(context.Background(), client)
26494 if err != nil {
26495 err = autorest.NewErrorWithError(err, "network.PrivateDNSZoneGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
26496 return
26497 }
26498 if !done {
26499 ar.Response = future.Response()
26500 err = azure.NewAsyncOpIncompleteError("network.PrivateDNSZoneGroupsDeleteFuture")
26501 return
26502 }
26503 ar.Response = future.Response()
26504 return
26505 }
26506
26507
26508 type PrivateDNSZonePropertiesFormat struct {
26509
26510 PrivateDNSZoneID *string `json:"privateDnsZoneId,omitempty"`
26511
26512 RecordSets *[]RecordSet `json:"recordSets,omitempty"`
26513 }
26514
26515
26516 func (pdzpf PrivateDNSZonePropertiesFormat) MarshalJSON() ([]byte, error) {
26517 objectMap := make(map[string]interface{})
26518 if pdzpf.PrivateDNSZoneID != nil {
26519 objectMap["privateDnsZoneId"] = pdzpf.PrivateDNSZoneID
26520 }
26521 return json.Marshal(objectMap)
26522 }
26523
26524
26525 type PrivateEndpoint struct {
26526 autorest.Response `json:"-"`
26527
26528 *PrivateEndpointProperties `json:"properties,omitempty"`
26529
26530 Etag *string `json:"etag,omitempty"`
26531
26532 ID *string `json:"id,omitempty"`
26533
26534 Name *string `json:"name,omitempty"`
26535
26536 Type *string `json:"type,omitempty"`
26537
26538 Location *string `json:"location,omitempty"`
26539
26540 Tags map[string]*string `json:"tags"`
26541 }
26542
26543
26544 func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
26545 objectMap := make(map[string]interface{})
26546 if peVar.PrivateEndpointProperties != nil {
26547 objectMap["properties"] = peVar.PrivateEndpointProperties
26548 }
26549 if peVar.ID != nil {
26550 objectMap["id"] = peVar.ID
26551 }
26552 if peVar.Location != nil {
26553 objectMap["location"] = peVar.Location
26554 }
26555 if peVar.Tags != nil {
26556 objectMap["tags"] = peVar.Tags
26557 }
26558 return json.Marshal(objectMap)
26559 }
26560
26561
26562 func (peVar *PrivateEndpoint) UnmarshalJSON(body []byte) error {
26563 var m map[string]*json.RawMessage
26564 err := json.Unmarshal(body, &m)
26565 if err != nil {
26566 return err
26567 }
26568 for k, v := range m {
26569 switch k {
26570 case "properties":
26571 if v != nil {
26572 var privateEndpointProperties PrivateEndpointProperties
26573 err = json.Unmarshal(*v, &privateEndpointProperties)
26574 if err != nil {
26575 return err
26576 }
26577 peVar.PrivateEndpointProperties = &privateEndpointProperties
26578 }
26579 case "etag":
26580 if v != nil {
26581 var etag string
26582 err = json.Unmarshal(*v, &etag)
26583 if err != nil {
26584 return err
26585 }
26586 peVar.Etag = &etag
26587 }
26588 case "id":
26589 if v != nil {
26590 var ID string
26591 err = json.Unmarshal(*v, &ID)
26592 if err != nil {
26593 return err
26594 }
26595 peVar.ID = &ID
26596 }
26597 case "name":
26598 if v != nil {
26599 var name string
26600 err = json.Unmarshal(*v, &name)
26601 if err != nil {
26602 return err
26603 }
26604 peVar.Name = &name
26605 }
26606 case "type":
26607 if v != nil {
26608 var typeVar string
26609 err = json.Unmarshal(*v, &typeVar)
26610 if err != nil {
26611 return err
26612 }
26613 peVar.Type = &typeVar
26614 }
26615 case "location":
26616 if v != nil {
26617 var location string
26618 err = json.Unmarshal(*v, &location)
26619 if err != nil {
26620 return err
26621 }
26622 peVar.Location = &location
26623 }
26624 case "tags":
26625 if v != nil {
26626 var tags map[string]*string
26627 err = json.Unmarshal(*v, &tags)
26628 if err != nil {
26629 return err
26630 }
26631 peVar.Tags = tags
26632 }
26633 }
26634 }
26635
26636 return nil
26637 }
26638
26639
26640 type PrivateEndpointConnection struct {
26641 autorest.Response `json:"-"`
26642
26643 *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
26644
26645 Name *string `json:"name,omitempty"`
26646
26647 Type *string `json:"type,omitempty"`
26648
26649 Etag *string `json:"etag,omitempty"`
26650
26651 ID *string `json:"id,omitempty"`
26652 }
26653
26654
26655 func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
26656 objectMap := make(map[string]interface{})
26657 if pec.PrivateEndpointConnectionProperties != nil {
26658 objectMap["properties"] = pec.PrivateEndpointConnectionProperties
26659 }
26660 if pec.Name != nil {
26661 objectMap["name"] = pec.Name
26662 }
26663 if pec.ID != nil {
26664 objectMap["id"] = pec.ID
26665 }
26666 return json.Marshal(objectMap)
26667 }
26668
26669
26670 func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
26671 var m map[string]*json.RawMessage
26672 err := json.Unmarshal(body, &m)
26673 if err != nil {
26674 return err
26675 }
26676 for k, v := range m {
26677 switch k {
26678 case "properties":
26679 if v != nil {
26680 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
26681 err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
26682 if err != nil {
26683 return err
26684 }
26685 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
26686 }
26687 case "name":
26688 if v != nil {
26689 var name string
26690 err = json.Unmarshal(*v, &name)
26691 if err != nil {
26692 return err
26693 }
26694 pec.Name = &name
26695 }
26696 case "type":
26697 if v != nil {
26698 var typeVar string
26699 err = json.Unmarshal(*v, &typeVar)
26700 if err != nil {
26701 return err
26702 }
26703 pec.Type = &typeVar
26704 }
26705 case "etag":
26706 if v != nil {
26707 var etag string
26708 err = json.Unmarshal(*v, &etag)
26709 if err != nil {
26710 return err
26711 }
26712 pec.Etag = &etag
26713 }
26714 case "id":
26715 if v != nil {
26716 var ID string
26717 err = json.Unmarshal(*v, &ID)
26718 if err != nil {
26719 return err
26720 }
26721 pec.ID = &ID
26722 }
26723 }
26724 }
26725
26726 return nil
26727 }
26728
26729
26730 type PrivateEndpointConnectionListResult struct {
26731 autorest.Response `json:"-"`
26732
26733 Value *[]PrivateEndpointConnection `json:"value,omitempty"`
26734
26735 NextLink *string `json:"nextLink,omitempty"`
26736 }
26737
26738
26739 func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) {
26740 objectMap := make(map[string]interface{})
26741 if peclr.Value != nil {
26742 objectMap["value"] = peclr.Value
26743 }
26744 return json.Marshal(objectMap)
26745 }
26746
26747
26748
26749 type PrivateEndpointConnectionListResultIterator struct {
26750 i int
26751 page PrivateEndpointConnectionListResultPage
26752 }
26753
26754
26755
26756 func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
26757 if tracing.IsEnabled() {
26758 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
26759 defer func() {
26760 sc := -1
26761 if iter.Response().Response.Response != nil {
26762 sc = iter.Response().Response.Response.StatusCode
26763 }
26764 tracing.EndSpan(ctx, sc, err)
26765 }()
26766 }
26767 iter.i++
26768 if iter.i < len(iter.page.Values()) {
26769 return nil
26770 }
26771 err = iter.page.NextWithContext(ctx)
26772 if err != nil {
26773 iter.i--
26774 return err
26775 }
26776 iter.i = 0
26777 return nil
26778 }
26779
26780
26781
26782
26783 func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
26784 return iter.NextWithContext(context.Background())
26785 }
26786
26787
26788 func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
26789 return iter.page.NotDone() && iter.i < len(iter.page.Values())
26790 }
26791
26792
26793 func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
26794 return iter.page.Response()
26795 }
26796
26797
26798
26799 func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
26800 if !iter.page.NotDone() {
26801 return PrivateEndpointConnection{}
26802 }
26803 return iter.page.Values()[iter.i]
26804 }
26805
26806
26807 func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
26808 return PrivateEndpointConnectionListResultIterator{page: page}
26809 }
26810
26811
26812 func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
26813 return peclr.Value == nil || len(*peclr.Value) == 0
26814 }
26815
26816
26817 func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
26818 return peclr.NextLink != nil && len(*peclr.NextLink) != 0
26819 }
26820
26821
26822
26823 func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
26824 if !peclr.hasNextLink() {
26825 return nil, nil
26826 }
26827 return autorest.Prepare((&http.Request{}).WithContext(ctx),
26828 autorest.AsJSON(),
26829 autorest.AsGet(),
26830 autorest.WithBaseURL(to.String(peclr.NextLink)))
26831 }
26832
26833
26834 type PrivateEndpointConnectionListResultPage struct {
26835 fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
26836 peclr PrivateEndpointConnectionListResult
26837 }
26838
26839
26840
26841 func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
26842 if tracing.IsEnabled() {
26843 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
26844 defer func() {
26845 sc := -1
26846 if page.Response().Response.Response != nil {
26847 sc = page.Response().Response.Response.StatusCode
26848 }
26849 tracing.EndSpan(ctx, sc, err)
26850 }()
26851 }
26852 for {
26853 next, err := page.fn(ctx, page.peclr)
26854 if err != nil {
26855 return err
26856 }
26857 page.peclr = next
26858 if !next.hasNextLink() || !next.IsEmpty() {
26859 break
26860 }
26861 }
26862 return nil
26863 }
26864
26865
26866
26867
26868 func (page *PrivateEndpointConnectionListResultPage) Next() error {
26869 return page.NextWithContext(context.Background())
26870 }
26871
26872
26873 func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
26874 return !page.peclr.IsEmpty()
26875 }
26876
26877
26878 func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
26879 return page.peclr
26880 }
26881
26882
26883 func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
26884 if page.peclr.IsEmpty() {
26885 return nil
26886 }
26887 return *page.peclr.Value
26888 }
26889
26890
26891 func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
26892 return PrivateEndpointConnectionListResultPage{
26893 fn: getNextPage,
26894 peclr: cur,
26895 }
26896 }
26897
26898
26899 type PrivateEndpointConnectionProperties struct {
26900
26901 PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
26902
26903 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
26904
26905 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
26906
26907 LinkIdentifier *string `json:"linkIdentifier,omitempty"`
26908 }
26909
26910
26911 func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
26912 objectMap := make(map[string]interface{})
26913 if pecp.PrivateLinkServiceConnectionState != nil {
26914 objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
26915 }
26916 return json.Marshal(objectMap)
26917 }
26918
26919
26920 type PrivateEndpointListResult struct {
26921 autorest.Response `json:"-"`
26922
26923 Value *[]PrivateEndpoint `json:"value,omitempty"`
26924
26925 NextLink *string `json:"nextLink,omitempty"`
26926 }
26927
26928
26929 func (pelr PrivateEndpointListResult) MarshalJSON() ([]byte, error) {
26930 objectMap := make(map[string]interface{})
26931 if pelr.Value != nil {
26932 objectMap["value"] = pelr.Value
26933 }
26934 return json.Marshal(objectMap)
26935 }
26936
26937
26938 type PrivateEndpointListResultIterator struct {
26939 i int
26940 page PrivateEndpointListResultPage
26941 }
26942
26943
26944
26945 func (iter *PrivateEndpointListResultIterator) NextWithContext(ctx context.Context) (err error) {
26946 if tracing.IsEnabled() {
26947 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointListResultIterator.NextWithContext")
26948 defer func() {
26949 sc := -1
26950 if iter.Response().Response.Response != nil {
26951 sc = iter.Response().Response.Response.StatusCode
26952 }
26953 tracing.EndSpan(ctx, sc, err)
26954 }()
26955 }
26956 iter.i++
26957 if iter.i < len(iter.page.Values()) {
26958 return nil
26959 }
26960 err = iter.page.NextWithContext(ctx)
26961 if err != nil {
26962 iter.i--
26963 return err
26964 }
26965 iter.i = 0
26966 return nil
26967 }
26968
26969
26970
26971
26972 func (iter *PrivateEndpointListResultIterator) Next() error {
26973 return iter.NextWithContext(context.Background())
26974 }
26975
26976
26977 func (iter PrivateEndpointListResultIterator) NotDone() bool {
26978 return iter.page.NotDone() && iter.i < len(iter.page.Values())
26979 }
26980
26981
26982 func (iter PrivateEndpointListResultIterator) Response() PrivateEndpointListResult {
26983 return iter.page.Response()
26984 }
26985
26986
26987
26988 func (iter PrivateEndpointListResultIterator) Value() PrivateEndpoint {
26989 if !iter.page.NotDone() {
26990 return PrivateEndpoint{}
26991 }
26992 return iter.page.Values()[iter.i]
26993 }
26994
26995
26996 func NewPrivateEndpointListResultIterator(page PrivateEndpointListResultPage) PrivateEndpointListResultIterator {
26997 return PrivateEndpointListResultIterator{page: page}
26998 }
26999
27000
27001 func (pelr PrivateEndpointListResult) IsEmpty() bool {
27002 return pelr.Value == nil || len(*pelr.Value) == 0
27003 }
27004
27005
27006 func (pelr PrivateEndpointListResult) hasNextLink() bool {
27007 return pelr.NextLink != nil && len(*pelr.NextLink) != 0
27008 }
27009
27010
27011
27012 func (pelr PrivateEndpointListResult) privateEndpointListResultPreparer(ctx context.Context) (*http.Request, error) {
27013 if !pelr.hasNextLink() {
27014 return nil, nil
27015 }
27016 return autorest.Prepare((&http.Request{}).WithContext(ctx),
27017 autorest.AsJSON(),
27018 autorest.AsGet(),
27019 autorest.WithBaseURL(to.String(pelr.NextLink)))
27020 }
27021
27022
27023 type PrivateEndpointListResultPage struct {
27024 fn func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error)
27025 pelr PrivateEndpointListResult
27026 }
27027
27028
27029
27030 func (page *PrivateEndpointListResultPage) NextWithContext(ctx context.Context) (err error) {
27031 if tracing.IsEnabled() {
27032 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointListResultPage.NextWithContext")
27033 defer func() {
27034 sc := -1
27035 if page.Response().Response.Response != nil {
27036 sc = page.Response().Response.Response.StatusCode
27037 }
27038 tracing.EndSpan(ctx, sc, err)
27039 }()
27040 }
27041 for {
27042 next, err := page.fn(ctx, page.pelr)
27043 if err != nil {
27044 return err
27045 }
27046 page.pelr = next
27047 if !next.hasNextLink() || !next.IsEmpty() {
27048 break
27049 }
27050 }
27051 return nil
27052 }
27053
27054
27055
27056
27057 func (page *PrivateEndpointListResultPage) Next() error {
27058 return page.NextWithContext(context.Background())
27059 }
27060
27061
27062 func (page PrivateEndpointListResultPage) NotDone() bool {
27063 return !page.pelr.IsEmpty()
27064 }
27065
27066
27067 func (page PrivateEndpointListResultPage) Response() PrivateEndpointListResult {
27068 return page.pelr
27069 }
27070
27071
27072 func (page PrivateEndpointListResultPage) Values() []PrivateEndpoint {
27073 if page.pelr.IsEmpty() {
27074 return nil
27075 }
27076 return *page.pelr.Value
27077 }
27078
27079
27080 func NewPrivateEndpointListResultPage(cur PrivateEndpointListResult, getNextPage func(context.Context, PrivateEndpointListResult) (PrivateEndpointListResult, error)) PrivateEndpointListResultPage {
27081 return PrivateEndpointListResultPage{
27082 fn: getNextPage,
27083 pelr: cur,
27084 }
27085 }
27086
27087
27088 type PrivateEndpointProperties struct {
27089
27090 Subnet *Subnet `json:"subnet,omitempty"`
27091
27092 NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"`
27093
27094 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
27095
27096 PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"`
27097
27098 ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"`
27099
27100 CustomDNSConfigs *[]CustomDNSConfigPropertiesFormat `json:"customDnsConfigs,omitempty"`
27101 }
27102
27103
27104 func (pep PrivateEndpointProperties) MarshalJSON() ([]byte, error) {
27105 objectMap := make(map[string]interface{})
27106 if pep.Subnet != nil {
27107 objectMap["subnet"] = pep.Subnet
27108 }
27109 if pep.PrivateLinkServiceConnections != nil {
27110 objectMap["privateLinkServiceConnections"] = pep.PrivateLinkServiceConnections
27111 }
27112 if pep.ManualPrivateLinkServiceConnections != nil {
27113 objectMap["manualPrivateLinkServiceConnections"] = pep.ManualPrivateLinkServiceConnections
27114 }
27115 if pep.CustomDNSConfigs != nil {
27116 objectMap["customDnsConfigs"] = pep.CustomDNSConfigs
27117 }
27118 return json.Marshal(objectMap)
27119 }
27120
27121
27122
27123 type PrivateEndpointsCreateOrUpdateFuture struct {
27124 azure.FutureAPI
27125
27126
27127 Result func(PrivateEndpointsClient) (PrivateEndpoint, error)
27128 }
27129
27130
27131 func (future *PrivateEndpointsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
27132 var azFuture azure.Future
27133 if err := json.Unmarshal(body, &azFuture); err != nil {
27134 return err
27135 }
27136 future.FutureAPI = &azFuture
27137 future.Result = future.result
27138 return nil
27139 }
27140
27141
27142 func (future *PrivateEndpointsCreateOrUpdateFuture) result(client PrivateEndpointsClient) (peVar PrivateEndpoint, err error) {
27143 var done bool
27144 done, err = future.DoneWithContext(context.Background(), client)
27145 if err != nil {
27146 err = autorest.NewErrorWithError(err, "network.PrivateEndpointsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
27147 return
27148 }
27149 if !done {
27150 peVar.Response.Response = future.Response()
27151 err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsCreateOrUpdateFuture")
27152 return
27153 }
27154 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27155 if peVar.Response.Response, err = future.GetResult(sender); err == nil && peVar.Response.Response.StatusCode != http.StatusNoContent {
27156 peVar, err = client.CreateOrUpdateResponder(peVar.Response.Response)
27157 if err != nil {
27158 err = autorest.NewErrorWithError(err, "network.PrivateEndpointsCreateOrUpdateFuture", "Result", peVar.Response.Response, "Failure responding to request")
27159 }
27160 }
27161 return
27162 }
27163
27164
27165
27166 type PrivateEndpointsDeleteFuture struct {
27167 azure.FutureAPI
27168
27169
27170 Result func(PrivateEndpointsClient) (autorest.Response, error)
27171 }
27172
27173
27174 func (future *PrivateEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
27175 var azFuture azure.Future
27176 if err := json.Unmarshal(body, &azFuture); err != nil {
27177 return err
27178 }
27179 future.FutureAPI = &azFuture
27180 future.Result = future.result
27181 return nil
27182 }
27183
27184
27185 func (future *PrivateEndpointsDeleteFuture) result(client PrivateEndpointsClient) (ar autorest.Response, err error) {
27186 var done bool
27187 done, err = future.DoneWithContext(context.Background(), client)
27188 if err != nil {
27189 err = autorest.NewErrorWithError(err, "network.PrivateEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
27190 return
27191 }
27192 if !done {
27193 ar.Response = future.Response()
27194 err = azure.NewAsyncOpIncompleteError("network.PrivateEndpointsDeleteFuture")
27195 return
27196 }
27197 ar.Response = future.Response()
27198 return
27199 }
27200
27201
27202 type PrivateLinkService struct {
27203 autorest.Response `json:"-"`
27204
27205 *PrivateLinkServiceProperties `json:"properties,omitempty"`
27206
27207 Etag *string `json:"etag,omitempty"`
27208
27209 ID *string `json:"id,omitempty"`
27210
27211 Name *string `json:"name,omitempty"`
27212
27213 Type *string `json:"type,omitempty"`
27214
27215 Location *string `json:"location,omitempty"`
27216
27217 Tags map[string]*string `json:"tags"`
27218 }
27219
27220
27221 func (pls PrivateLinkService) MarshalJSON() ([]byte, error) {
27222 objectMap := make(map[string]interface{})
27223 if pls.PrivateLinkServiceProperties != nil {
27224 objectMap["properties"] = pls.PrivateLinkServiceProperties
27225 }
27226 if pls.ID != nil {
27227 objectMap["id"] = pls.ID
27228 }
27229 if pls.Location != nil {
27230 objectMap["location"] = pls.Location
27231 }
27232 if pls.Tags != nil {
27233 objectMap["tags"] = pls.Tags
27234 }
27235 return json.Marshal(objectMap)
27236 }
27237
27238
27239 func (pls *PrivateLinkService) UnmarshalJSON(body []byte) error {
27240 var m map[string]*json.RawMessage
27241 err := json.Unmarshal(body, &m)
27242 if err != nil {
27243 return err
27244 }
27245 for k, v := range m {
27246 switch k {
27247 case "properties":
27248 if v != nil {
27249 var privateLinkServiceProperties PrivateLinkServiceProperties
27250 err = json.Unmarshal(*v, &privateLinkServiceProperties)
27251 if err != nil {
27252 return err
27253 }
27254 pls.PrivateLinkServiceProperties = &privateLinkServiceProperties
27255 }
27256 case "etag":
27257 if v != nil {
27258 var etag string
27259 err = json.Unmarshal(*v, &etag)
27260 if err != nil {
27261 return err
27262 }
27263 pls.Etag = &etag
27264 }
27265 case "id":
27266 if v != nil {
27267 var ID string
27268 err = json.Unmarshal(*v, &ID)
27269 if err != nil {
27270 return err
27271 }
27272 pls.ID = &ID
27273 }
27274 case "name":
27275 if v != nil {
27276 var name string
27277 err = json.Unmarshal(*v, &name)
27278 if err != nil {
27279 return err
27280 }
27281 pls.Name = &name
27282 }
27283 case "type":
27284 if v != nil {
27285 var typeVar string
27286 err = json.Unmarshal(*v, &typeVar)
27287 if err != nil {
27288 return err
27289 }
27290 pls.Type = &typeVar
27291 }
27292 case "location":
27293 if v != nil {
27294 var location string
27295 err = json.Unmarshal(*v, &location)
27296 if err != nil {
27297 return err
27298 }
27299 pls.Location = &location
27300 }
27301 case "tags":
27302 if v != nil {
27303 var tags map[string]*string
27304 err = json.Unmarshal(*v, &tags)
27305 if err != nil {
27306 return err
27307 }
27308 pls.Tags = tags
27309 }
27310 }
27311 }
27312
27313 return nil
27314 }
27315
27316
27317 type PrivateLinkServiceConnection struct {
27318
27319 *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"`
27320
27321 Name *string `json:"name,omitempty"`
27322
27323 Type *string `json:"type,omitempty"`
27324
27325 Etag *string `json:"etag,omitempty"`
27326
27327 ID *string `json:"id,omitempty"`
27328 }
27329
27330
27331 func (plsc PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) {
27332 objectMap := make(map[string]interface{})
27333 if plsc.PrivateLinkServiceConnectionProperties != nil {
27334 objectMap["properties"] = plsc.PrivateLinkServiceConnectionProperties
27335 }
27336 if plsc.Name != nil {
27337 objectMap["name"] = plsc.Name
27338 }
27339 if plsc.ID != nil {
27340 objectMap["id"] = plsc.ID
27341 }
27342 return json.Marshal(objectMap)
27343 }
27344
27345
27346 func (plsc *PrivateLinkServiceConnection) UnmarshalJSON(body []byte) error {
27347 var m map[string]*json.RawMessage
27348 err := json.Unmarshal(body, &m)
27349 if err != nil {
27350 return err
27351 }
27352 for k, v := range m {
27353 switch k {
27354 case "properties":
27355 if v != nil {
27356 var privateLinkServiceConnectionProperties PrivateLinkServiceConnectionProperties
27357 err = json.Unmarshal(*v, &privateLinkServiceConnectionProperties)
27358 if err != nil {
27359 return err
27360 }
27361 plsc.PrivateLinkServiceConnectionProperties = &privateLinkServiceConnectionProperties
27362 }
27363 case "name":
27364 if v != nil {
27365 var name string
27366 err = json.Unmarshal(*v, &name)
27367 if err != nil {
27368 return err
27369 }
27370 plsc.Name = &name
27371 }
27372 case "type":
27373 if v != nil {
27374 var typeVar string
27375 err = json.Unmarshal(*v, &typeVar)
27376 if err != nil {
27377 return err
27378 }
27379 plsc.Type = &typeVar
27380 }
27381 case "etag":
27382 if v != nil {
27383 var etag string
27384 err = json.Unmarshal(*v, &etag)
27385 if err != nil {
27386 return err
27387 }
27388 plsc.Etag = &etag
27389 }
27390 case "id":
27391 if v != nil {
27392 var ID string
27393 err = json.Unmarshal(*v, &ID)
27394 if err != nil {
27395 return err
27396 }
27397 plsc.ID = &ID
27398 }
27399 }
27400 }
27401
27402 return nil
27403 }
27404
27405
27406 type PrivateLinkServiceConnectionProperties struct {
27407
27408 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
27409
27410 PrivateLinkServiceID *string `json:"privateLinkServiceId,omitempty"`
27411
27412 GroupIds *[]string `json:"groupIds,omitempty"`
27413
27414 RequestMessage *string `json:"requestMessage,omitempty"`
27415
27416 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
27417 }
27418
27419
27420 func (plscp PrivateLinkServiceConnectionProperties) MarshalJSON() ([]byte, error) {
27421 objectMap := make(map[string]interface{})
27422 if plscp.PrivateLinkServiceID != nil {
27423 objectMap["privateLinkServiceId"] = plscp.PrivateLinkServiceID
27424 }
27425 if plscp.GroupIds != nil {
27426 objectMap["groupIds"] = plscp.GroupIds
27427 }
27428 if plscp.RequestMessage != nil {
27429 objectMap["requestMessage"] = plscp.RequestMessage
27430 }
27431 if plscp.PrivateLinkServiceConnectionState != nil {
27432 objectMap["privateLinkServiceConnectionState"] = plscp.PrivateLinkServiceConnectionState
27433 }
27434 return json.Marshal(objectMap)
27435 }
27436
27437
27438
27439 type PrivateLinkServiceConnectionState struct {
27440
27441 Status *string `json:"status,omitempty"`
27442
27443 Description *string `json:"description,omitempty"`
27444
27445 ActionsRequired *string `json:"actionsRequired,omitempty"`
27446 }
27447
27448
27449 type PrivateLinkServiceIPConfiguration struct {
27450
27451 *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"`
27452
27453 Name *string `json:"name,omitempty"`
27454
27455 Etag *string `json:"etag,omitempty"`
27456
27457 Type *string `json:"type,omitempty"`
27458
27459 ID *string `json:"id,omitempty"`
27460 }
27461
27462
27463 func (plsic PrivateLinkServiceIPConfiguration) MarshalJSON() ([]byte, error) {
27464 objectMap := make(map[string]interface{})
27465 if plsic.PrivateLinkServiceIPConfigurationProperties != nil {
27466 objectMap["properties"] = plsic.PrivateLinkServiceIPConfigurationProperties
27467 }
27468 if plsic.Name != nil {
27469 objectMap["name"] = plsic.Name
27470 }
27471 if plsic.ID != nil {
27472 objectMap["id"] = plsic.ID
27473 }
27474 return json.Marshal(objectMap)
27475 }
27476
27477
27478 func (plsic *PrivateLinkServiceIPConfiguration) UnmarshalJSON(body []byte) error {
27479 var m map[string]*json.RawMessage
27480 err := json.Unmarshal(body, &m)
27481 if err != nil {
27482 return err
27483 }
27484 for k, v := range m {
27485 switch k {
27486 case "properties":
27487 if v != nil {
27488 var privateLinkServiceIPConfigurationProperties PrivateLinkServiceIPConfigurationProperties
27489 err = json.Unmarshal(*v, &privateLinkServiceIPConfigurationProperties)
27490 if err != nil {
27491 return err
27492 }
27493 plsic.PrivateLinkServiceIPConfigurationProperties = &privateLinkServiceIPConfigurationProperties
27494 }
27495 case "name":
27496 if v != nil {
27497 var name string
27498 err = json.Unmarshal(*v, &name)
27499 if err != nil {
27500 return err
27501 }
27502 plsic.Name = &name
27503 }
27504 case "etag":
27505 if v != nil {
27506 var etag string
27507 err = json.Unmarshal(*v, &etag)
27508 if err != nil {
27509 return err
27510 }
27511 plsic.Etag = &etag
27512 }
27513 case "type":
27514 if v != nil {
27515 var typeVar string
27516 err = json.Unmarshal(*v, &typeVar)
27517 if err != nil {
27518 return err
27519 }
27520 plsic.Type = &typeVar
27521 }
27522 case "id":
27523 if v != nil {
27524 var ID string
27525 err = json.Unmarshal(*v, &ID)
27526 if err != nil {
27527 return err
27528 }
27529 plsic.ID = &ID
27530 }
27531 }
27532 }
27533
27534 return nil
27535 }
27536
27537
27538 type PrivateLinkServiceIPConfigurationProperties struct {
27539
27540 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
27541
27542 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
27543
27544 Subnet *Subnet `json:"subnet,omitempty"`
27545
27546 Primary *bool `json:"primary,omitempty"`
27547
27548 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
27549
27550 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
27551 }
27552
27553
27554 func (plsicp PrivateLinkServiceIPConfigurationProperties) MarshalJSON() ([]byte, error) {
27555 objectMap := make(map[string]interface{})
27556 if plsicp.PrivateIPAddress != nil {
27557 objectMap["privateIPAddress"] = plsicp.PrivateIPAddress
27558 }
27559 if plsicp.PrivateIPAllocationMethod != "" {
27560 objectMap["privateIPAllocationMethod"] = plsicp.PrivateIPAllocationMethod
27561 }
27562 if plsicp.Subnet != nil {
27563 objectMap["subnet"] = plsicp.Subnet
27564 }
27565 if plsicp.Primary != nil {
27566 objectMap["primary"] = plsicp.Primary
27567 }
27568 if plsicp.PrivateIPAddressVersion != "" {
27569 objectMap["privateIPAddressVersion"] = plsicp.PrivateIPAddressVersion
27570 }
27571 return json.Marshal(objectMap)
27572 }
27573
27574
27575 type PrivateLinkServiceListResult struct {
27576 autorest.Response `json:"-"`
27577
27578 Value *[]PrivateLinkService `json:"value,omitempty"`
27579
27580 NextLink *string `json:"nextLink,omitempty"`
27581 }
27582
27583
27584 func (plslr PrivateLinkServiceListResult) MarshalJSON() ([]byte, error) {
27585 objectMap := make(map[string]interface{})
27586 if plslr.Value != nil {
27587 objectMap["value"] = plslr.Value
27588 }
27589 return json.Marshal(objectMap)
27590 }
27591
27592
27593 type PrivateLinkServiceListResultIterator struct {
27594 i int
27595 page PrivateLinkServiceListResultPage
27596 }
27597
27598
27599
27600 func (iter *PrivateLinkServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
27601 if tracing.IsEnabled() {
27602 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServiceListResultIterator.NextWithContext")
27603 defer func() {
27604 sc := -1
27605 if iter.Response().Response.Response != nil {
27606 sc = iter.Response().Response.Response.StatusCode
27607 }
27608 tracing.EndSpan(ctx, sc, err)
27609 }()
27610 }
27611 iter.i++
27612 if iter.i < len(iter.page.Values()) {
27613 return nil
27614 }
27615 err = iter.page.NextWithContext(ctx)
27616 if err != nil {
27617 iter.i--
27618 return err
27619 }
27620 iter.i = 0
27621 return nil
27622 }
27623
27624
27625
27626
27627 func (iter *PrivateLinkServiceListResultIterator) Next() error {
27628 return iter.NextWithContext(context.Background())
27629 }
27630
27631
27632 func (iter PrivateLinkServiceListResultIterator) NotDone() bool {
27633 return iter.page.NotDone() && iter.i < len(iter.page.Values())
27634 }
27635
27636
27637 func (iter PrivateLinkServiceListResultIterator) Response() PrivateLinkServiceListResult {
27638 return iter.page.Response()
27639 }
27640
27641
27642
27643 func (iter PrivateLinkServiceListResultIterator) Value() PrivateLinkService {
27644 if !iter.page.NotDone() {
27645 return PrivateLinkService{}
27646 }
27647 return iter.page.Values()[iter.i]
27648 }
27649
27650
27651 func NewPrivateLinkServiceListResultIterator(page PrivateLinkServiceListResultPage) PrivateLinkServiceListResultIterator {
27652 return PrivateLinkServiceListResultIterator{page: page}
27653 }
27654
27655
27656 func (plslr PrivateLinkServiceListResult) IsEmpty() bool {
27657 return plslr.Value == nil || len(*plslr.Value) == 0
27658 }
27659
27660
27661 func (plslr PrivateLinkServiceListResult) hasNextLink() bool {
27662 return plslr.NextLink != nil && len(*plslr.NextLink) != 0
27663 }
27664
27665
27666
27667 func (plslr PrivateLinkServiceListResult) privateLinkServiceListResultPreparer(ctx context.Context) (*http.Request, error) {
27668 if !plslr.hasNextLink() {
27669 return nil, nil
27670 }
27671 return autorest.Prepare((&http.Request{}).WithContext(ctx),
27672 autorest.AsJSON(),
27673 autorest.AsGet(),
27674 autorest.WithBaseURL(to.String(plslr.NextLink)))
27675 }
27676
27677
27678 type PrivateLinkServiceListResultPage struct {
27679 fn func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error)
27680 plslr PrivateLinkServiceListResult
27681 }
27682
27683
27684
27685 func (page *PrivateLinkServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
27686 if tracing.IsEnabled() {
27687 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkServiceListResultPage.NextWithContext")
27688 defer func() {
27689 sc := -1
27690 if page.Response().Response.Response != nil {
27691 sc = page.Response().Response.Response.StatusCode
27692 }
27693 tracing.EndSpan(ctx, sc, err)
27694 }()
27695 }
27696 for {
27697 next, err := page.fn(ctx, page.plslr)
27698 if err != nil {
27699 return err
27700 }
27701 page.plslr = next
27702 if !next.hasNextLink() || !next.IsEmpty() {
27703 break
27704 }
27705 }
27706 return nil
27707 }
27708
27709
27710
27711
27712 func (page *PrivateLinkServiceListResultPage) Next() error {
27713 return page.NextWithContext(context.Background())
27714 }
27715
27716
27717 func (page PrivateLinkServiceListResultPage) NotDone() bool {
27718 return !page.plslr.IsEmpty()
27719 }
27720
27721
27722 func (page PrivateLinkServiceListResultPage) Response() PrivateLinkServiceListResult {
27723 return page.plslr
27724 }
27725
27726
27727 func (page PrivateLinkServiceListResultPage) Values() []PrivateLinkService {
27728 if page.plslr.IsEmpty() {
27729 return nil
27730 }
27731 return *page.plslr.Value
27732 }
27733
27734
27735 func NewPrivateLinkServiceListResultPage(cur PrivateLinkServiceListResult, getNextPage func(context.Context, PrivateLinkServiceListResult) (PrivateLinkServiceListResult, error)) PrivateLinkServiceListResultPage {
27736 return PrivateLinkServiceListResultPage{
27737 fn: getNextPage,
27738 plslr: cur,
27739 }
27740 }
27741
27742
27743 type PrivateLinkServiceProperties struct {
27744
27745 LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"`
27746
27747 IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"`
27748
27749 NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"`
27750
27751 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
27752
27753 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
27754
27755 Visibility *PrivateLinkServicePropertiesVisibility `json:"visibility,omitempty"`
27756
27757 AutoApproval *PrivateLinkServicePropertiesAutoApproval `json:"autoApproval,omitempty"`
27758
27759 Fqdns *[]string `json:"fqdns,omitempty"`
27760
27761 Alias *string `json:"alias,omitempty"`
27762
27763 EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"`
27764 }
27765
27766
27767 func (plsp PrivateLinkServiceProperties) MarshalJSON() ([]byte, error) {
27768 objectMap := make(map[string]interface{})
27769 if plsp.LoadBalancerFrontendIPConfigurations != nil {
27770 objectMap["loadBalancerFrontendIpConfigurations"] = plsp.LoadBalancerFrontendIPConfigurations
27771 }
27772 if plsp.IPConfigurations != nil {
27773 objectMap["ipConfigurations"] = plsp.IPConfigurations
27774 }
27775 if plsp.Visibility != nil {
27776 objectMap["visibility"] = plsp.Visibility
27777 }
27778 if plsp.AutoApproval != nil {
27779 objectMap["autoApproval"] = plsp.AutoApproval
27780 }
27781 if plsp.Fqdns != nil {
27782 objectMap["fqdns"] = plsp.Fqdns
27783 }
27784 if plsp.EnableProxyProtocol != nil {
27785 objectMap["enableProxyProtocol"] = plsp.EnableProxyProtocol
27786 }
27787 return json.Marshal(objectMap)
27788 }
27789
27790
27791 type PrivateLinkServicePropertiesAutoApproval struct {
27792
27793 Subscriptions *[]string `json:"subscriptions,omitempty"`
27794 }
27795
27796
27797 type PrivateLinkServicePropertiesVisibility struct {
27798
27799 Subscriptions *[]string `json:"subscriptions,omitempty"`
27800 }
27801
27802
27803
27804 type PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture struct {
27805 azure.FutureAPI
27806
27807
27808 Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error)
27809 }
27810
27811
27812 func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) UnmarshalJSON(body []byte) error {
27813 var azFuture azure.Future
27814 if err := json.Unmarshal(body, &azFuture); err != nil {
27815 return err
27816 }
27817 future.FutureAPI = &azFuture
27818 future.Result = future.result
27819 return nil
27820 }
27821
27822
27823 func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) {
27824 var done bool
27825 done, err = future.DoneWithContext(context.Background(), client)
27826 if err != nil {
27827 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", future.Response(), "Polling failure")
27828 return
27829 }
27830 if !done {
27831 plsv.Response.Response = future.Response()
27832 err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture")
27833 return
27834 }
27835 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27836 if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent {
27837 plsv, err = client.CheckPrivateLinkServiceVisibilityByResourceGroupResponder(plsv.Response.Response)
27838 if err != nil {
27839 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityByResourceGroupFuture", "Result", plsv.Response.Response, "Failure responding to request")
27840 }
27841 }
27842 return
27843 }
27844
27845
27846
27847 type PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture struct {
27848 azure.FutureAPI
27849
27850
27851 Result func(PrivateLinkServicesClient) (PrivateLinkServiceVisibility, error)
27852 }
27853
27854
27855 func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) UnmarshalJSON(body []byte) error {
27856 var azFuture azure.Future
27857 if err := json.Unmarshal(body, &azFuture); err != nil {
27858 return err
27859 }
27860 future.FutureAPI = &azFuture
27861 future.Result = future.result
27862 return nil
27863 }
27864
27865
27866 func (future *PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture) result(client PrivateLinkServicesClient) (plsv PrivateLinkServiceVisibility, err error) {
27867 var done bool
27868 done, err = future.DoneWithContext(context.Background(), client)
27869 if err != nil {
27870 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", future.Response(), "Polling failure")
27871 return
27872 }
27873 if !done {
27874 plsv.Response.Response = future.Response()
27875 err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture")
27876 return
27877 }
27878 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27879 if plsv.Response.Response, err = future.GetResult(sender); err == nil && plsv.Response.Response.StatusCode != http.StatusNoContent {
27880 plsv, err = client.CheckPrivateLinkServiceVisibilityResponder(plsv.Response.Response)
27881 if err != nil {
27882 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCheckPrivateLinkServiceVisibilityFuture", "Result", plsv.Response.Response, "Failure responding to request")
27883 }
27884 }
27885 return
27886 }
27887
27888
27889
27890 type PrivateLinkServicesCreateOrUpdateFuture struct {
27891 azure.FutureAPI
27892
27893
27894 Result func(PrivateLinkServicesClient) (PrivateLinkService, error)
27895 }
27896
27897
27898 func (future *PrivateLinkServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
27899 var azFuture azure.Future
27900 if err := json.Unmarshal(body, &azFuture); err != nil {
27901 return err
27902 }
27903 future.FutureAPI = &azFuture
27904 future.Result = future.result
27905 return nil
27906 }
27907
27908
27909 func (future *PrivateLinkServicesCreateOrUpdateFuture) result(client PrivateLinkServicesClient) (pls PrivateLinkService, err error) {
27910 var done bool
27911 done, err = future.DoneWithContext(context.Background(), client)
27912 if err != nil {
27913 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
27914 return
27915 }
27916 if !done {
27917 pls.Response.Response = future.Response()
27918 err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesCreateOrUpdateFuture")
27919 return
27920 }
27921 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
27922 if pls.Response.Response, err = future.GetResult(sender); err == nil && pls.Response.Response.StatusCode != http.StatusNoContent {
27923 pls, err = client.CreateOrUpdateResponder(pls.Response.Response)
27924 if err != nil {
27925 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesCreateOrUpdateFuture", "Result", pls.Response.Response, "Failure responding to request")
27926 }
27927 }
27928 return
27929 }
27930
27931
27932
27933 type PrivateLinkServicesDeleteFuture struct {
27934 azure.FutureAPI
27935
27936
27937 Result func(PrivateLinkServicesClient) (autorest.Response, error)
27938 }
27939
27940
27941 func (future *PrivateLinkServicesDeleteFuture) UnmarshalJSON(body []byte) error {
27942 var azFuture azure.Future
27943 if err := json.Unmarshal(body, &azFuture); err != nil {
27944 return err
27945 }
27946 future.FutureAPI = &azFuture
27947 future.Result = future.result
27948 return nil
27949 }
27950
27951
27952 func (future *PrivateLinkServicesDeleteFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) {
27953 var done bool
27954 done, err = future.DoneWithContext(context.Background(), client)
27955 if err != nil {
27956 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesDeleteFuture", "Result", future.Response(), "Polling failure")
27957 return
27958 }
27959 if !done {
27960 ar.Response = future.Response()
27961 err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeleteFuture")
27962 return
27963 }
27964 ar.Response = future.Response()
27965 return
27966 }
27967
27968
27969
27970 type PrivateLinkServicesDeletePrivateEndpointConnectionFuture struct {
27971 azure.FutureAPI
27972
27973
27974 Result func(PrivateLinkServicesClient) (autorest.Response, error)
27975 }
27976
27977
27978 func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error {
27979 var azFuture azure.Future
27980 if err := json.Unmarshal(body, &azFuture); err != nil {
27981 return err
27982 }
27983 future.FutureAPI = &azFuture
27984 future.Result = future.result
27985 return nil
27986 }
27987
27988
27989 func (future *PrivateLinkServicesDeletePrivateEndpointConnectionFuture) result(client PrivateLinkServicesClient) (ar autorest.Response, err error) {
27990 var done bool
27991 done, err = future.DoneWithContext(context.Background(), client)
27992 if err != nil {
27993 err = autorest.NewErrorWithError(err, "network.PrivateLinkServicesDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure")
27994 return
27995 }
27996 if !done {
27997 ar.Response = future.Response()
27998 err = azure.NewAsyncOpIncompleteError("network.PrivateLinkServicesDeletePrivateEndpointConnectionFuture")
27999 return
28000 }
28001 ar.Response = future.Response()
28002 return
28003 }
28004
28005
28006 type PrivateLinkServiceVisibility struct {
28007 autorest.Response `json:"-"`
28008
28009 Visible *bool `json:"visible,omitempty"`
28010 }
28011
28012
28013 type Probe struct {
28014 autorest.Response `json:"-"`
28015
28016 *ProbePropertiesFormat `json:"properties,omitempty"`
28017
28018 Name *string `json:"name,omitempty"`
28019
28020 Etag *string `json:"etag,omitempty"`
28021
28022 Type *string `json:"type,omitempty"`
28023
28024 ID *string `json:"id,omitempty"`
28025 }
28026
28027
28028 func (p Probe) MarshalJSON() ([]byte, error) {
28029 objectMap := make(map[string]interface{})
28030 if p.ProbePropertiesFormat != nil {
28031 objectMap["properties"] = p.ProbePropertiesFormat
28032 }
28033 if p.Name != nil {
28034 objectMap["name"] = p.Name
28035 }
28036 if p.ID != nil {
28037 objectMap["id"] = p.ID
28038 }
28039 return json.Marshal(objectMap)
28040 }
28041
28042
28043 func (p *Probe) UnmarshalJSON(body []byte) error {
28044 var m map[string]*json.RawMessage
28045 err := json.Unmarshal(body, &m)
28046 if err != nil {
28047 return err
28048 }
28049 for k, v := range m {
28050 switch k {
28051 case "properties":
28052 if v != nil {
28053 var probePropertiesFormat ProbePropertiesFormat
28054 err = json.Unmarshal(*v, &probePropertiesFormat)
28055 if err != nil {
28056 return err
28057 }
28058 p.ProbePropertiesFormat = &probePropertiesFormat
28059 }
28060 case "name":
28061 if v != nil {
28062 var name string
28063 err = json.Unmarshal(*v, &name)
28064 if err != nil {
28065 return err
28066 }
28067 p.Name = &name
28068 }
28069 case "etag":
28070 if v != nil {
28071 var etag string
28072 err = json.Unmarshal(*v, &etag)
28073 if err != nil {
28074 return err
28075 }
28076 p.Etag = &etag
28077 }
28078 case "type":
28079 if v != nil {
28080 var typeVar string
28081 err = json.Unmarshal(*v, &typeVar)
28082 if err != nil {
28083 return err
28084 }
28085 p.Type = &typeVar
28086 }
28087 case "id":
28088 if v != nil {
28089 var ID string
28090 err = json.Unmarshal(*v, &ID)
28091 if err != nil {
28092 return err
28093 }
28094 p.ID = &ID
28095 }
28096 }
28097 }
28098
28099 return nil
28100 }
28101
28102
28103 type ProbePropertiesFormat struct {
28104
28105 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
28106
28107 Protocol ProbeProtocol `json:"protocol,omitempty"`
28108
28109 Port *int32 `json:"port,omitempty"`
28110
28111 IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"`
28112
28113 NumberOfProbes *int32 `json:"numberOfProbes,omitempty"`
28114
28115 RequestPath *string `json:"requestPath,omitempty"`
28116
28117 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
28118 }
28119
28120
28121 func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) {
28122 objectMap := make(map[string]interface{})
28123 if ppf.Protocol != "" {
28124 objectMap["protocol"] = ppf.Protocol
28125 }
28126 if ppf.Port != nil {
28127 objectMap["port"] = ppf.Port
28128 }
28129 if ppf.IntervalInSeconds != nil {
28130 objectMap["intervalInSeconds"] = ppf.IntervalInSeconds
28131 }
28132 if ppf.NumberOfProbes != nil {
28133 objectMap["numberOfProbes"] = ppf.NumberOfProbes
28134 }
28135 if ppf.RequestPath != nil {
28136 objectMap["requestPath"] = ppf.RequestPath
28137 }
28138 return json.Marshal(objectMap)
28139 }
28140
28141
28142 type Profile struct {
28143 autorest.Response `json:"-"`
28144
28145 *ProfilePropertiesFormat `json:"properties,omitempty"`
28146
28147 Etag *string `json:"etag,omitempty"`
28148
28149 ID *string `json:"id,omitempty"`
28150
28151 Name *string `json:"name,omitempty"`
28152
28153 Type *string `json:"type,omitempty"`
28154
28155 Location *string `json:"location,omitempty"`
28156
28157 Tags map[string]*string `json:"tags"`
28158 }
28159
28160
28161 func (p Profile) MarshalJSON() ([]byte, error) {
28162 objectMap := make(map[string]interface{})
28163 if p.ProfilePropertiesFormat != nil {
28164 objectMap["properties"] = p.ProfilePropertiesFormat
28165 }
28166 if p.ID != nil {
28167 objectMap["id"] = p.ID
28168 }
28169 if p.Location != nil {
28170 objectMap["location"] = p.Location
28171 }
28172 if p.Tags != nil {
28173 objectMap["tags"] = p.Tags
28174 }
28175 return json.Marshal(objectMap)
28176 }
28177
28178
28179 func (p *Profile) UnmarshalJSON(body []byte) error {
28180 var m map[string]*json.RawMessage
28181 err := json.Unmarshal(body, &m)
28182 if err != nil {
28183 return err
28184 }
28185 for k, v := range m {
28186 switch k {
28187 case "properties":
28188 if v != nil {
28189 var profilePropertiesFormat ProfilePropertiesFormat
28190 err = json.Unmarshal(*v, &profilePropertiesFormat)
28191 if err != nil {
28192 return err
28193 }
28194 p.ProfilePropertiesFormat = &profilePropertiesFormat
28195 }
28196 case "etag":
28197 if v != nil {
28198 var etag string
28199 err = json.Unmarshal(*v, &etag)
28200 if err != nil {
28201 return err
28202 }
28203 p.Etag = &etag
28204 }
28205 case "id":
28206 if v != nil {
28207 var ID string
28208 err = json.Unmarshal(*v, &ID)
28209 if err != nil {
28210 return err
28211 }
28212 p.ID = &ID
28213 }
28214 case "name":
28215 if v != nil {
28216 var name string
28217 err = json.Unmarshal(*v, &name)
28218 if err != nil {
28219 return err
28220 }
28221 p.Name = &name
28222 }
28223 case "type":
28224 if v != nil {
28225 var typeVar string
28226 err = json.Unmarshal(*v, &typeVar)
28227 if err != nil {
28228 return err
28229 }
28230 p.Type = &typeVar
28231 }
28232 case "location":
28233 if v != nil {
28234 var location string
28235 err = json.Unmarshal(*v, &location)
28236 if err != nil {
28237 return err
28238 }
28239 p.Location = &location
28240 }
28241 case "tags":
28242 if v != nil {
28243 var tags map[string]*string
28244 err = json.Unmarshal(*v, &tags)
28245 if err != nil {
28246 return err
28247 }
28248 p.Tags = tags
28249 }
28250 }
28251 }
28252
28253 return nil
28254 }
28255
28256
28257 type ProfileListResult struct {
28258 autorest.Response `json:"-"`
28259
28260 Value *[]Profile `json:"value,omitempty"`
28261
28262 NextLink *string `json:"nextLink,omitempty"`
28263 }
28264
28265
28266 type ProfileListResultIterator struct {
28267 i int
28268 page ProfileListResultPage
28269 }
28270
28271
28272
28273 func (iter *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) {
28274 if tracing.IsEnabled() {
28275 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.NextWithContext")
28276 defer func() {
28277 sc := -1
28278 if iter.Response().Response.Response != nil {
28279 sc = iter.Response().Response.Response.StatusCode
28280 }
28281 tracing.EndSpan(ctx, sc, err)
28282 }()
28283 }
28284 iter.i++
28285 if iter.i < len(iter.page.Values()) {
28286 return nil
28287 }
28288 err = iter.page.NextWithContext(ctx)
28289 if err != nil {
28290 iter.i--
28291 return err
28292 }
28293 iter.i = 0
28294 return nil
28295 }
28296
28297
28298
28299
28300 func (iter *ProfileListResultIterator) Next() error {
28301 return iter.NextWithContext(context.Background())
28302 }
28303
28304
28305 func (iter ProfileListResultIterator) NotDone() bool {
28306 return iter.page.NotDone() && iter.i < len(iter.page.Values())
28307 }
28308
28309
28310 func (iter ProfileListResultIterator) Response() ProfileListResult {
28311 return iter.page.Response()
28312 }
28313
28314
28315
28316 func (iter ProfileListResultIterator) Value() Profile {
28317 if !iter.page.NotDone() {
28318 return Profile{}
28319 }
28320 return iter.page.Values()[iter.i]
28321 }
28322
28323
28324 func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator {
28325 return ProfileListResultIterator{page: page}
28326 }
28327
28328
28329 func (plr ProfileListResult) IsEmpty() bool {
28330 return plr.Value == nil || len(*plr.Value) == 0
28331 }
28332
28333
28334 func (plr ProfileListResult) hasNextLink() bool {
28335 return plr.NextLink != nil && len(*plr.NextLink) != 0
28336 }
28337
28338
28339
28340 func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) {
28341 if !plr.hasNextLink() {
28342 return nil, nil
28343 }
28344 return autorest.Prepare((&http.Request{}).WithContext(ctx),
28345 autorest.AsJSON(),
28346 autorest.AsGet(),
28347 autorest.WithBaseURL(to.String(plr.NextLink)))
28348 }
28349
28350
28351 type ProfileListResultPage struct {
28352 fn func(context.Context, ProfileListResult) (ProfileListResult, error)
28353 plr ProfileListResult
28354 }
28355
28356
28357
28358 func (page *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) {
28359 if tracing.IsEnabled() {
28360 ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext")
28361 defer func() {
28362 sc := -1
28363 if page.Response().Response.Response != nil {
28364 sc = page.Response().Response.Response.StatusCode
28365 }
28366 tracing.EndSpan(ctx, sc, err)
28367 }()
28368 }
28369 for {
28370 next, err := page.fn(ctx, page.plr)
28371 if err != nil {
28372 return err
28373 }
28374 page.plr = next
28375 if !next.hasNextLink() || !next.IsEmpty() {
28376 break
28377 }
28378 }
28379 return nil
28380 }
28381
28382
28383
28384
28385 func (page *ProfileListResultPage) Next() error {
28386 return page.NextWithContext(context.Background())
28387 }
28388
28389
28390 func (page ProfileListResultPage) NotDone() bool {
28391 return !page.plr.IsEmpty()
28392 }
28393
28394
28395 func (page ProfileListResultPage) Response() ProfileListResult {
28396 return page.plr
28397 }
28398
28399
28400 func (page ProfileListResultPage) Values() []Profile {
28401 if page.plr.IsEmpty() {
28402 return nil
28403 }
28404 return *page.plr.Value
28405 }
28406
28407
28408 func NewProfileListResultPage(cur ProfileListResult, getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage {
28409 return ProfileListResultPage{
28410 fn: getNextPage,
28411 plr: cur,
28412 }
28413 }
28414
28415
28416 type ProfilePropertiesFormat struct {
28417
28418 ContainerNetworkInterfaces *[]ContainerNetworkInterface `json:"containerNetworkInterfaces,omitempty"`
28419
28420 ContainerNetworkInterfaceConfigurations *[]ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfigurations,omitempty"`
28421
28422 ResourceGUID *string `json:"resourceGuid,omitempty"`
28423
28424 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
28425 }
28426
28427
28428 func (ppf ProfilePropertiesFormat) MarshalJSON() ([]byte, error) {
28429 objectMap := make(map[string]interface{})
28430 if ppf.ContainerNetworkInterfaceConfigurations != nil {
28431 objectMap["containerNetworkInterfaceConfigurations"] = ppf.ContainerNetworkInterfaceConfigurations
28432 }
28433 return json.Marshal(objectMap)
28434 }
28435
28436
28437
28438 type ProfilesDeleteFuture struct {
28439 azure.FutureAPI
28440
28441
28442 Result func(ProfilesClient) (autorest.Response, error)
28443 }
28444
28445
28446 func (future *ProfilesDeleteFuture) UnmarshalJSON(body []byte) error {
28447 var azFuture azure.Future
28448 if err := json.Unmarshal(body, &azFuture); err != nil {
28449 return err
28450 }
28451 future.FutureAPI = &azFuture
28452 future.Result = future.result
28453 return nil
28454 }
28455
28456
28457 func (future *ProfilesDeleteFuture) result(client ProfilesClient) (ar autorest.Response, err error) {
28458 var done bool
28459 done, err = future.DoneWithContext(context.Background(), client)
28460 if err != nil {
28461 err = autorest.NewErrorWithError(err, "network.ProfilesDeleteFuture", "Result", future.Response(), "Polling failure")
28462 return
28463 }
28464 if !done {
28465 ar.Response = future.Response()
28466 err = azure.NewAsyncOpIncompleteError("network.ProfilesDeleteFuture")
28467 return
28468 }
28469 ar.Response = future.Response()
28470 return
28471 }
28472
28473
28474 type PropagatedRouteTable struct {
28475
28476 Labels *[]string `json:"labels,omitempty"`
28477
28478 Ids *[]SubResource `json:"ids,omitempty"`
28479 }
28480
28481
28482 type ProtocolConfiguration struct {
28483
28484 HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"`
28485 }
28486
28487
28488 type ProtocolCustomSettingsFormat struct {
28489
28490 Protocol DdosCustomPolicyProtocol `json:"protocol,omitempty"`
28491
28492 TriggerRateOverride *string `json:"triggerRateOverride,omitempty"`
28493
28494 SourceRateOverride *string `json:"sourceRateOverride,omitempty"`
28495
28496 TriggerSensitivityOverride DdosCustomPolicyTriggerSensitivityOverride `json:"triggerSensitivityOverride,omitempty"`
28497 }
28498
28499
28500 type PublicIPAddress struct {
28501 autorest.Response `json:"-"`
28502
28503 Sku *PublicIPAddressSku `json:"sku,omitempty"`
28504
28505 *PublicIPAddressPropertiesFormat `json:"properties,omitempty"`
28506
28507 Etag *string `json:"etag,omitempty"`
28508
28509 Zones *[]string `json:"zones,omitempty"`
28510
28511 ID *string `json:"id,omitempty"`
28512
28513 Name *string `json:"name,omitempty"`
28514
28515 Type *string `json:"type,omitempty"`
28516
28517 Location *string `json:"location,omitempty"`
28518
28519 Tags map[string]*string `json:"tags"`
28520 }
28521
28522
28523 func (pia PublicIPAddress) MarshalJSON() ([]byte, error) {
28524 objectMap := make(map[string]interface{})
28525 if pia.Sku != nil {
28526 objectMap["sku"] = pia.Sku
28527 }
28528 if pia.PublicIPAddressPropertiesFormat != nil {
28529 objectMap["properties"] = pia.PublicIPAddressPropertiesFormat
28530 }
28531 if pia.Zones != nil {
28532 objectMap["zones"] = pia.Zones
28533 }
28534 if pia.ID != nil {
28535 objectMap["id"] = pia.ID
28536 }
28537 if pia.Location != nil {
28538 objectMap["location"] = pia.Location
28539 }
28540 if pia.Tags != nil {
28541 objectMap["tags"] = pia.Tags
28542 }
28543 return json.Marshal(objectMap)
28544 }
28545
28546
28547 func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error {
28548 var m map[string]*json.RawMessage
28549 err := json.Unmarshal(body, &m)
28550 if err != nil {
28551 return err
28552 }
28553 for k, v := range m {
28554 switch k {
28555 case "sku":
28556 if v != nil {
28557 var sku PublicIPAddressSku
28558 err = json.Unmarshal(*v, &sku)
28559 if err != nil {
28560 return err
28561 }
28562 pia.Sku = &sku
28563 }
28564 case "properties":
28565 if v != nil {
28566 var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat
28567 err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat)
28568 if err != nil {
28569 return err
28570 }
28571 pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat
28572 }
28573 case "etag":
28574 if v != nil {
28575 var etag string
28576 err = json.Unmarshal(*v, &etag)
28577 if err != nil {
28578 return err
28579 }
28580 pia.Etag = &etag
28581 }
28582 case "zones":
28583 if v != nil {
28584 var zones []string
28585 err = json.Unmarshal(*v, &zones)
28586 if err != nil {
28587 return err
28588 }
28589 pia.Zones = &zones
28590 }
28591 case "id":
28592 if v != nil {
28593 var ID string
28594 err = json.Unmarshal(*v, &ID)
28595 if err != nil {
28596 return err
28597 }
28598 pia.ID = &ID
28599 }
28600 case "name":
28601 if v != nil {
28602 var name string
28603 err = json.Unmarshal(*v, &name)
28604 if err != nil {
28605 return err
28606 }
28607 pia.Name = &name
28608 }
28609 case "type":
28610 if v != nil {
28611 var typeVar string
28612 err = json.Unmarshal(*v, &typeVar)
28613 if err != nil {
28614 return err
28615 }
28616 pia.Type = &typeVar
28617 }
28618 case "location":
28619 if v != nil {
28620 var location string
28621 err = json.Unmarshal(*v, &location)
28622 if err != nil {
28623 return err
28624 }
28625 pia.Location = &location
28626 }
28627 case "tags":
28628 if v != nil {
28629 var tags map[string]*string
28630 err = json.Unmarshal(*v, &tags)
28631 if err != nil {
28632 return err
28633 }
28634 pia.Tags = tags
28635 }
28636 }
28637 }
28638
28639 return nil
28640 }
28641
28642
28643 type PublicIPAddressDNSSettings struct {
28644
28645 DomainNameLabel *string `json:"domainNameLabel,omitempty"`
28646
28647 Fqdn *string `json:"fqdn,omitempty"`
28648
28649 ReverseFqdn *string `json:"reverseFqdn,omitempty"`
28650 }
28651
28652
28653
28654 type PublicIPAddressesCreateOrUpdateFuture struct {
28655 azure.FutureAPI
28656
28657
28658 Result func(PublicIPAddressesClient) (PublicIPAddress, error)
28659 }
28660
28661
28662 func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
28663 var azFuture azure.Future
28664 if err := json.Unmarshal(body, &azFuture); err != nil {
28665 return err
28666 }
28667 future.FutureAPI = &azFuture
28668 future.Result = future.result
28669 return nil
28670 }
28671
28672
28673 func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) {
28674 var done bool
28675 done, err = future.DoneWithContext(context.Background(), client)
28676 if err != nil {
28677 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
28678 return
28679 }
28680 if !done {
28681 pia.Response.Response = future.Response()
28682 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture")
28683 return
28684 }
28685 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
28686 if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent {
28687 pia, err = client.CreateOrUpdateResponder(pia.Response.Response)
28688 if err != nil {
28689 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", pia.Response.Response, "Failure responding to request")
28690 }
28691 }
28692 return
28693 }
28694
28695
28696
28697 type PublicIPAddressesDeleteFuture struct {
28698 azure.FutureAPI
28699
28700
28701 Result func(PublicIPAddressesClient) (autorest.Response, error)
28702 }
28703
28704
28705 func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error {
28706 var azFuture azure.Future
28707 if err := json.Unmarshal(body, &azFuture); err != nil {
28708 return err
28709 }
28710 future.FutureAPI = &azFuture
28711 future.Result = future.result
28712 return nil
28713 }
28714
28715
28716 func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) {
28717 var done bool
28718 done, err = future.DoneWithContext(context.Background(), client)
28719 if err != nil {
28720 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure")
28721 return
28722 }
28723 if !done {
28724 ar.Response = future.Response()
28725 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture")
28726 return
28727 }
28728 ar.Response = future.Response()
28729 return
28730 }
28731
28732
28733 type PublicIPAddressListResult struct {
28734 autorest.Response `json:"-"`
28735
28736 Value *[]PublicIPAddress `json:"value,omitempty"`
28737
28738 NextLink *string `json:"nextLink,omitempty"`
28739 }
28740
28741
28742 type PublicIPAddressListResultIterator struct {
28743 i int
28744 page PublicIPAddressListResultPage
28745 }
28746
28747
28748
28749 func (iter *PublicIPAddressListResultIterator) NextWithContext(ctx context.Context) (err error) {
28750 if tracing.IsEnabled() {
28751 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultIterator.NextWithContext")
28752 defer func() {
28753 sc := -1
28754 if iter.Response().Response.Response != nil {
28755 sc = iter.Response().Response.Response.StatusCode
28756 }
28757 tracing.EndSpan(ctx, sc, err)
28758 }()
28759 }
28760 iter.i++
28761 if iter.i < len(iter.page.Values()) {
28762 return nil
28763 }
28764 err = iter.page.NextWithContext(ctx)
28765 if err != nil {
28766 iter.i--
28767 return err
28768 }
28769 iter.i = 0
28770 return nil
28771 }
28772
28773
28774
28775
28776 func (iter *PublicIPAddressListResultIterator) Next() error {
28777 return iter.NextWithContext(context.Background())
28778 }
28779
28780
28781 func (iter PublicIPAddressListResultIterator) NotDone() bool {
28782 return iter.page.NotDone() && iter.i < len(iter.page.Values())
28783 }
28784
28785
28786 func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult {
28787 return iter.page.Response()
28788 }
28789
28790
28791
28792 func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress {
28793 if !iter.page.NotDone() {
28794 return PublicIPAddress{}
28795 }
28796 return iter.page.Values()[iter.i]
28797 }
28798
28799
28800 func NewPublicIPAddressListResultIterator(page PublicIPAddressListResultPage) PublicIPAddressListResultIterator {
28801 return PublicIPAddressListResultIterator{page: page}
28802 }
28803
28804
28805 func (pialr PublicIPAddressListResult) IsEmpty() bool {
28806 return pialr.Value == nil || len(*pialr.Value) == 0
28807 }
28808
28809
28810 func (pialr PublicIPAddressListResult) hasNextLink() bool {
28811 return pialr.NextLink != nil && len(*pialr.NextLink) != 0
28812 }
28813
28814
28815
28816 func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) {
28817 if !pialr.hasNextLink() {
28818 return nil, nil
28819 }
28820 return autorest.Prepare((&http.Request{}).WithContext(ctx),
28821 autorest.AsJSON(),
28822 autorest.AsGet(),
28823 autorest.WithBaseURL(to.String(pialr.NextLink)))
28824 }
28825
28826
28827 type PublicIPAddressListResultPage struct {
28828 fn func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)
28829 pialr PublicIPAddressListResult
28830 }
28831
28832
28833
28834 func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) (err error) {
28835 if tracing.IsEnabled() {
28836 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultPage.NextWithContext")
28837 defer func() {
28838 sc := -1
28839 if page.Response().Response.Response != nil {
28840 sc = page.Response().Response.Response.StatusCode
28841 }
28842 tracing.EndSpan(ctx, sc, err)
28843 }()
28844 }
28845 for {
28846 next, err := page.fn(ctx, page.pialr)
28847 if err != nil {
28848 return err
28849 }
28850 page.pialr = next
28851 if !next.hasNextLink() || !next.IsEmpty() {
28852 break
28853 }
28854 }
28855 return nil
28856 }
28857
28858
28859
28860
28861 func (page *PublicIPAddressListResultPage) Next() error {
28862 return page.NextWithContext(context.Background())
28863 }
28864
28865
28866 func (page PublicIPAddressListResultPage) NotDone() bool {
28867 return !page.pialr.IsEmpty()
28868 }
28869
28870
28871 func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult {
28872 return page.pialr
28873 }
28874
28875
28876 func (page PublicIPAddressListResultPage) Values() []PublicIPAddress {
28877 if page.pialr.IsEmpty() {
28878 return nil
28879 }
28880 return *page.pialr.Value
28881 }
28882
28883
28884 func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage {
28885 return PublicIPAddressListResultPage{
28886 fn: getNextPage,
28887 pialr: cur,
28888 }
28889 }
28890
28891
28892 type PublicIPAddressPropertiesFormat struct {
28893
28894 PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"`
28895
28896 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"`
28897
28898 IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"`
28899
28900 DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"`
28901
28902 DdosSettings *DdosSettings `json:"ddosSettings,omitempty"`
28903
28904 IPTags *[]IPTag `json:"ipTags,omitempty"`
28905
28906 IPAddress *string `json:"ipAddress,omitempty"`
28907
28908 PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"`
28909
28910 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
28911
28912 ResourceGUID *string `json:"resourceGuid,omitempty"`
28913
28914 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
28915 }
28916
28917
28918 func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) {
28919 objectMap := make(map[string]interface{})
28920 if piapf.PublicIPAllocationMethod != "" {
28921 objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod
28922 }
28923 if piapf.PublicIPAddressVersion != "" {
28924 objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion
28925 }
28926 if piapf.DNSSettings != nil {
28927 objectMap["dnsSettings"] = piapf.DNSSettings
28928 }
28929 if piapf.DdosSettings != nil {
28930 objectMap["ddosSettings"] = piapf.DdosSettings
28931 }
28932 if piapf.IPTags != nil {
28933 objectMap["ipTags"] = piapf.IPTags
28934 }
28935 if piapf.IPAddress != nil {
28936 objectMap["ipAddress"] = piapf.IPAddress
28937 }
28938 if piapf.PublicIPPrefix != nil {
28939 objectMap["publicIPPrefix"] = piapf.PublicIPPrefix
28940 }
28941 if piapf.IdleTimeoutInMinutes != nil {
28942 objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes
28943 }
28944 return json.Marshal(objectMap)
28945 }
28946
28947
28948 type PublicIPAddressSku struct {
28949
28950 Name PublicIPAddressSkuName `json:"name,omitempty"`
28951 }
28952
28953
28954 type PublicIPPrefix struct {
28955 autorest.Response `json:"-"`
28956
28957 Sku *PublicIPPrefixSku `json:"sku,omitempty"`
28958
28959 *PublicIPPrefixPropertiesFormat `json:"properties,omitempty"`
28960
28961 Etag *string `json:"etag,omitempty"`
28962
28963 Zones *[]string `json:"zones,omitempty"`
28964
28965 ID *string `json:"id,omitempty"`
28966
28967 Name *string `json:"name,omitempty"`
28968
28969 Type *string `json:"type,omitempty"`
28970
28971 Location *string `json:"location,omitempty"`
28972
28973 Tags map[string]*string `json:"tags"`
28974 }
28975
28976
28977 func (pip PublicIPPrefix) MarshalJSON() ([]byte, error) {
28978 objectMap := make(map[string]interface{})
28979 if pip.Sku != nil {
28980 objectMap["sku"] = pip.Sku
28981 }
28982 if pip.PublicIPPrefixPropertiesFormat != nil {
28983 objectMap["properties"] = pip.PublicIPPrefixPropertiesFormat
28984 }
28985 if pip.Zones != nil {
28986 objectMap["zones"] = pip.Zones
28987 }
28988 if pip.ID != nil {
28989 objectMap["id"] = pip.ID
28990 }
28991 if pip.Location != nil {
28992 objectMap["location"] = pip.Location
28993 }
28994 if pip.Tags != nil {
28995 objectMap["tags"] = pip.Tags
28996 }
28997 return json.Marshal(objectMap)
28998 }
28999
29000
29001 func (pip *PublicIPPrefix) UnmarshalJSON(body []byte) error {
29002 var m map[string]*json.RawMessage
29003 err := json.Unmarshal(body, &m)
29004 if err != nil {
29005 return err
29006 }
29007 for k, v := range m {
29008 switch k {
29009 case "sku":
29010 if v != nil {
29011 var sku PublicIPPrefixSku
29012 err = json.Unmarshal(*v, &sku)
29013 if err != nil {
29014 return err
29015 }
29016 pip.Sku = &sku
29017 }
29018 case "properties":
29019 if v != nil {
29020 var publicIPPrefixPropertiesFormat PublicIPPrefixPropertiesFormat
29021 err = json.Unmarshal(*v, &publicIPPrefixPropertiesFormat)
29022 if err != nil {
29023 return err
29024 }
29025 pip.PublicIPPrefixPropertiesFormat = &publicIPPrefixPropertiesFormat
29026 }
29027 case "etag":
29028 if v != nil {
29029 var etag string
29030 err = json.Unmarshal(*v, &etag)
29031 if err != nil {
29032 return err
29033 }
29034 pip.Etag = &etag
29035 }
29036 case "zones":
29037 if v != nil {
29038 var zones []string
29039 err = json.Unmarshal(*v, &zones)
29040 if err != nil {
29041 return err
29042 }
29043 pip.Zones = &zones
29044 }
29045 case "id":
29046 if v != nil {
29047 var ID string
29048 err = json.Unmarshal(*v, &ID)
29049 if err != nil {
29050 return err
29051 }
29052 pip.ID = &ID
29053 }
29054 case "name":
29055 if v != nil {
29056 var name string
29057 err = json.Unmarshal(*v, &name)
29058 if err != nil {
29059 return err
29060 }
29061 pip.Name = &name
29062 }
29063 case "type":
29064 if v != nil {
29065 var typeVar string
29066 err = json.Unmarshal(*v, &typeVar)
29067 if err != nil {
29068 return err
29069 }
29070 pip.Type = &typeVar
29071 }
29072 case "location":
29073 if v != nil {
29074 var location string
29075 err = json.Unmarshal(*v, &location)
29076 if err != nil {
29077 return err
29078 }
29079 pip.Location = &location
29080 }
29081 case "tags":
29082 if v != nil {
29083 var tags map[string]*string
29084 err = json.Unmarshal(*v, &tags)
29085 if err != nil {
29086 return err
29087 }
29088 pip.Tags = tags
29089 }
29090 }
29091 }
29092
29093 return nil
29094 }
29095
29096
29097
29098 type PublicIPPrefixesCreateOrUpdateFuture struct {
29099 azure.FutureAPI
29100
29101
29102 Result func(PublicIPPrefixesClient) (PublicIPPrefix, error)
29103 }
29104
29105
29106 func (future *PublicIPPrefixesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
29107 var azFuture azure.Future
29108 if err := json.Unmarshal(body, &azFuture); err != nil {
29109 return err
29110 }
29111 future.FutureAPI = &azFuture
29112 future.Result = future.result
29113 return nil
29114 }
29115
29116
29117 func (future *PublicIPPrefixesCreateOrUpdateFuture) result(client PublicIPPrefixesClient) (pip PublicIPPrefix, err error) {
29118 var done bool
29119 done, err = future.DoneWithContext(context.Background(), client)
29120 if err != nil {
29121 err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
29122 return
29123 }
29124 if !done {
29125 pip.Response.Response = future.Response()
29126 err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesCreateOrUpdateFuture")
29127 return
29128 }
29129 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
29130 if pip.Response.Response, err = future.GetResult(sender); err == nil && pip.Response.Response.StatusCode != http.StatusNoContent {
29131 pip, err = client.CreateOrUpdateResponder(pip.Response.Response)
29132 if err != nil {
29133 err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesCreateOrUpdateFuture", "Result", pip.Response.Response, "Failure responding to request")
29134 }
29135 }
29136 return
29137 }
29138
29139
29140
29141 type PublicIPPrefixesDeleteFuture struct {
29142 azure.FutureAPI
29143
29144
29145 Result func(PublicIPPrefixesClient) (autorest.Response, error)
29146 }
29147
29148
29149 func (future *PublicIPPrefixesDeleteFuture) UnmarshalJSON(body []byte) error {
29150 var azFuture azure.Future
29151 if err := json.Unmarshal(body, &azFuture); err != nil {
29152 return err
29153 }
29154 future.FutureAPI = &azFuture
29155 future.Result = future.result
29156 return nil
29157 }
29158
29159
29160 func (future *PublicIPPrefixesDeleteFuture) result(client PublicIPPrefixesClient) (ar autorest.Response, err error) {
29161 var done bool
29162 done, err = future.DoneWithContext(context.Background(), client)
29163 if err != nil {
29164 err = autorest.NewErrorWithError(err, "network.PublicIPPrefixesDeleteFuture", "Result", future.Response(), "Polling failure")
29165 return
29166 }
29167 if !done {
29168 ar.Response = future.Response()
29169 err = azure.NewAsyncOpIncompleteError("network.PublicIPPrefixesDeleteFuture")
29170 return
29171 }
29172 ar.Response = future.Response()
29173 return
29174 }
29175
29176
29177 type PublicIPPrefixListResult struct {
29178 autorest.Response `json:"-"`
29179
29180 Value *[]PublicIPPrefix `json:"value,omitempty"`
29181
29182 NextLink *string `json:"nextLink,omitempty"`
29183 }
29184
29185
29186 type PublicIPPrefixListResultIterator struct {
29187 i int
29188 page PublicIPPrefixListResultPage
29189 }
29190
29191
29192
29193 func (iter *PublicIPPrefixListResultIterator) NextWithContext(ctx context.Context) (err error) {
29194 if tracing.IsEnabled() {
29195 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixListResultIterator.NextWithContext")
29196 defer func() {
29197 sc := -1
29198 if iter.Response().Response.Response != nil {
29199 sc = iter.Response().Response.Response.StatusCode
29200 }
29201 tracing.EndSpan(ctx, sc, err)
29202 }()
29203 }
29204 iter.i++
29205 if iter.i < len(iter.page.Values()) {
29206 return nil
29207 }
29208 err = iter.page.NextWithContext(ctx)
29209 if err != nil {
29210 iter.i--
29211 return err
29212 }
29213 iter.i = 0
29214 return nil
29215 }
29216
29217
29218
29219
29220 func (iter *PublicIPPrefixListResultIterator) Next() error {
29221 return iter.NextWithContext(context.Background())
29222 }
29223
29224
29225 func (iter PublicIPPrefixListResultIterator) NotDone() bool {
29226 return iter.page.NotDone() && iter.i < len(iter.page.Values())
29227 }
29228
29229
29230 func (iter PublicIPPrefixListResultIterator) Response() PublicIPPrefixListResult {
29231 return iter.page.Response()
29232 }
29233
29234
29235
29236 func (iter PublicIPPrefixListResultIterator) Value() PublicIPPrefix {
29237 if !iter.page.NotDone() {
29238 return PublicIPPrefix{}
29239 }
29240 return iter.page.Values()[iter.i]
29241 }
29242
29243
29244 func NewPublicIPPrefixListResultIterator(page PublicIPPrefixListResultPage) PublicIPPrefixListResultIterator {
29245 return PublicIPPrefixListResultIterator{page: page}
29246 }
29247
29248
29249 func (piplr PublicIPPrefixListResult) IsEmpty() bool {
29250 return piplr.Value == nil || len(*piplr.Value) == 0
29251 }
29252
29253
29254 func (piplr PublicIPPrefixListResult) hasNextLink() bool {
29255 return piplr.NextLink != nil && len(*piplr.NextLink) != 0
29256 }
29257
29258
29259
29260 func (piplr PublicIPPrefixListResult) publicIPPrefixListResultPreparer(ctx context.Context) (*http.Request, error) {
29261 if !piplr.hasNextLink() {
29262 return nil, nil
29263 }
29264 return autorest.Prepare((&http.Request{}).WithContext(ctx),
29265 autorest.AsJSON(),
29266 autorest.AsGet(),
29267 autorest.WithBaseURL(to.String(piplr.NextLink)))
29268 }
29269
29270
29271 type PublicIPPrefixListResultPage struct {
29272 fn func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error)
29273 piplr PublicIPPrefixListResult
29274 }
29275
29276
29277
29278 func (page *PublicIPPrefixListResultPage) NextWithContext(ctx context.Context) (err error) {
29279 if tracing.IsEnabled() {
29280 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPPrefixListResultPage.NextWithContext")
29281 defer func() {
29282 sc := -1
29283 if page.Response().Response.Response != nil {
29284 sc = page.Response().Response.Response.StatusCode
29285 }
29286 tracing.EndSpan(ctx, sc, err)
29287 }()
29288 }
29289 for {
29290 next, err := page.fn(ctx, page.piplr)
29291 if err != nil {
29292 return err
29293 }
29294 page.piplr = next
29295 if !next.hasNextLink() || !next.IsEmpty() {
29296 break
29297 }
29298 }
29299 return nil
29300 }
29301
29302
29303
29304
29305 func (page *PublicIPPrefixListResultPage) Next() error {
29306 return page.NextWithContext(context.Background())
29307 }
29308
29309
29310 func (page PublicIPPrefixListResultPage) NotDone() bool {
29311 return !page.piplr.IsEmpty()
29312 }
29313
29314
29315 func (page PublicIPPrefixListResultPage) Response() PublicIPPrefixListResult {
29316 return page.piplr
29317 }
29318
29319
29320 func (page PublicIPPrefixListResultPage) Values() []PublicIPPrefix {
29321 if page.piplr.IsEmpty() {
29322 return nil
29323 }
29324 return *page.piplr.Value
29325 }
29326
29327
29328 func NewPublicIPPrefixListResultPage(cur PublicIPPrefixListResult, getNextPage func(context.Context, PublicIPPrefixListResult) (PublicIPPrefixListResult, error)) PublicIPPrefixListResultPage {
29329 return PublicIPPrefixListResultPage{
29330 fn: getNextPage,
29331 piplr: cur,
29332 }
29333 }
29334
29335
29336 type PublicIPPrefixPropertiesFormat struct {
29337
29338 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"`
29339
29340 IPTags *[]IPTag `json:"ipTags,omitempty"`
29341
29342 PrefixLength *int32 `json:"prefixLength,omitempty"`
29343
29344 IPPrefix *string `json:"ipPrefix,omitempty"`
29345
29346 PublicIPAddresses *[]ReferencedPublicIPAddress `json:"publicIPAddresses,omitempty"`
29347
29348 LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIpConfiguration,omitempty"`
29349
29350 ResourceGUID *string `json:"resourceGuid,omitempty"`
29351
29352 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
29353 }
29354
29355
29356 func (pippf PublicIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) {
29357 objectMap := make(map[string]interface{})
29358 if pippf.PublicIPAddressVersion != "" {
29359 objectMap["publicIPAddressVersion"] = pippf.PublicIPAddressVersion
29360 }
29361 if pippf.IPTags != nil {
29362 objectMap["ipTags"] = pippf.IPTags
29363 }
29364 if pippf.PrefixLength != nil {
29365 objectMap["prefixLength"] = pippf.PrefixLength
29366 }
29367 return json.Marshal(objectMap)
29368 }
29369
29370
29371 type PublicIPPrefixSku struct {
29372
29373 Name PublicIPPrefixSkuName `json:"name,omitempty"`
29374 }
29375
29376
29377
29378 type PutBastionShareableLinkAllFuture struct {
29379 azure.FutureAPI
29380
29381
29382 Result func(BaseClient) (BastionShareableLinkListResultPage, error)
29383 }
29384
29385
29386 func (future *PutBastionShareableLinkAllFuture) UnmarshalJSON(body []byte) error {
29387 var azFuture azure.Future
29388 if err := json.Unmarshal(body, &azFuture); err != nil {
29389 return err
29390 }
29391 future.FutureAPI = &azFuture
29392 future.Result = future.result
29393 return nil
29394 }
29395
29396
29397 func (future *PutBastionShareableLinkAllFuture) result(client BaseClient) (bsllrp BastionShareableLinkListResultPage, err error) {
29398 var done bool
29399 done, err = future.DoneWithContext(context.Background(), client)
29400 if err != nil {
29401 err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkAllFuture", "Result", future.Response(), "Polling failure")
29402 return
29403 }
29404 if !done {
29405 bsllrp.bsllr.Response.Response = future.Response()
29406 err = azure.NewAsyncOpIncompleteError("network.PutBastionShareableLinkAllFuture")
29407 return
29408 }
29409 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
29410 if bsllrp.bsllr.Response.Response, err = future.GetResult(sender); err == nil && bsllrp.bsllr.Response.Response.StatusCode != http.StatusNoContent {
29411 bsllrp, err = client.PutBastionShareableLinkResponder(bsllrp.bsllr.Response.Response)
29412 if err != nil {
29413 err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkAllFuture", "Result", bsllrp.bsllr.Response.Response, "Failure responding to request")
29414 }
29415 }
29416 return
29417 }
29418
29419
29420
29421 type PutBastionShareableLinkFuture struct {
29422 azure.FutureAPI
29423
29424
29425 Result func(BaseClient) (BastionShareableLinkListResultPage, error)
29426 }
29427
29428
29429 func (future *PutBastionShareableLinkFuture) UnmarshalJSON(body []byte) error {
29430 var azFuture azure.Future
29431 if err := json.Unmarshal(body, &azFuture); err != nil {
29432 return err
29433 }
29434 future.FutureAPI = &azFuture
29435 future.Result = future.result
29436 return nil
29437 }
29438
29439
29440 func (future *PutBastionShareableLinkFuture) result(client BaseClient) (bsllrp BastionShareableLinkListResultPage, err error) {
29441 var done bool
29442 done, err = future.DoneWithContext(context.Background(), client)
29443 if err != nil {
29444 err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkFuture", "Result", future.Response(), "Polling failure")
29445 return
29446 }
29447 if !done {
29448 bsllrp.bsllr.Response.Response = future.Response()
29449 err = azure.NewAsyncOpIncompleteError("network.PutBastionShareableLinkFuture")
29450 return
29451 }
29452 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
29453 if bsllrp.bsllr.Response.Response, err = future.GetResult(sender); err == nil && bsllrp.bsllr.Response.Response.StatusCode != http.StatusNoContent {
29454 bsllrp, err = client.PutBastionShareableLinkResponder(bsllrp.bsllr.Response.Response)
29455 if err != nil {
29456 err = autorest.NewErrorWithError(err, "network.PutBastionShareableLinkFuture", "Result", bsllrp.bsllr.Response.Response, "Failure responding to request")
29457 }
29458 }
29459 return
29460 }
29461
29462
29463 type QueryTroubleshootingParameters struct {
29464
29465 TargetResourceID *string `json:"targetResourceId,omitempty"`
29466 }
29467
29468
29469 type RadiusServer struct {
29470
29471 RadiusServerAddress *string `json:"radiusServerAddress,omitempty"`
29472
29473 RadiusServerScore *int64 `json:"radiusServerScore,omitempty"`
29474
29475 RadiusServerSecret *string `json:"radiusServerSecret,omitempty"`
29476 }
29477
29478
29479 type RecordSet struct {
29480
29481 RecordType *string `json:"recordType,omitempty"`
29482
29483 RecordSetName *string `json:"recordSetName,omitempty"`
29484
29485 Fqdn *string `json:"fqdn,omitempty"`
29486
29487 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
29488
29489 TTL *int32 `json:"ttl,omitempty"`
29490
29491 IPAddresses *[]string `json:"ipAddresses,omitempty"`
29492 }
29493
29494
29495 func (rs RecordSet) MarshalJSON() ([]byte, error) {
29496 objectMap := make(map[string]interface{})
29497 if rs.RecordType != nil {
29498 objectMap["recordType"] = rs.RecordType
29499 }
29500 if rs.RecordSetName != nil {
29501 objectMap["recordSetName"] = rs.RecordSetName
29502 }
29503 if rs.Fqdn != nil {
29504 objectMap["fqdn"] = rs.Fqdn
29505 }
29506 if rs.TTL != nil {
29507 objectMap["ttl"] = rs.TTL
29508 }
29509 if rs.IPAddresses != nil {
29510 objectMap["ipAddresses"] = rs.IPAddresses
29511 }
29512 return json.Marshal(objectMap)
29513 }
29514
29515
29516 type ReferencedPublicIPAddress struct {
29517
29518 ID *string `json:"id,omitempty"`
29519 }
29520
29521
29522 type Resource struct {
29523
29524 ID *string `json:"id,omitempty"`
29525
29526 Name *string `json:"name,omitempty"`
29527
29528 Type *string `json:"type,omitempty"`
29529
29530 Location *string `json:"location,omitempty"`
29531
29532 Tags map[string]*string `json:"tags"`
29533 }
29534
29535
29536 func (r Resource) MarshalJSON() ([]byte, error) {
29537 objectMap := make(map[string]interface{})
29538 if r.ID != nil {
29539 objectMap["id"] = r.ID
29540 }
29541 if r.Location != nil {
29542 objectMap["location"] = r.Location
29543 }
29544 if r.Tags != nil {
29545 objectMap["tags"] = r.Tags
29546 }
29547 return json.Marshal(objectMap)
29548 }
29549
29550
29551 type ResourceNavigationLink struct {
29552
29553 *ResourceNavigationLinkFormat `json:"properties,omitempty"`
29554
29555 Name *string `json:"name,omitempty"`
29556
29557 Etag *string `json:"etag,omitempty"`
29558
29559 Type *string `json:"type,omitempty"`
29560
29561 ID *string `json:"id,omitempty"`
29562 }
29563
29564
29565 func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) {
29566 objectMap := make(map[string]interface{})
29567 if rnl.ResourceNavigationLinkFormat != nil {
29568 objectMap["properties"] = rnl.ResourceNavigationLinkFormat
29569 }
29570 if rnl.Name != nil {
29571 objectMap["name"] = rnl.Name
29572 }
29573 if rnl.ID != nil {
29574 objectMap["id"] = rnl.ID
29575 }
29576 return json.Marshal(objectMap)
29577 }
29578
29579
29580 func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error {
29581 var m map[string]*json.RawMessage
29582 err := json.Unmarshal(body, &m)
29583 if err != nil {
29584 return err
29585 }
29586 for k, v := range m {
29587 switch k {
29588 case "properties":
29589 if v != nil {
29590 var resourceNavigationLinkFormat ResourceNavigationLinkFormat
29591 err = json.Unmarshal(*v, &resourceNavigationLinkFormat)
29592 if err != nil {
29593 return err
29594 }
29595 rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat
29596 }
29597 case "name":
29598 if v != nil {
29599 var name string
29600 err = json.Unmarshal(*v, &name)
29601 if err != nil {
29602 return err
29603 }
29604 rnl.Name = &name
29605 }
29606 case "etag":
29607 if v != nil {
29608 var etag string
29609 err = json.Unmarshal(*v, &etag)
29610 if err != nil {
29611 return err
29612 }
29613 rnl.Etag = &etag
29614 }
29615 case "type":
29616 if v != nil {
29617 var typeVar string
29618 err = json.Unmarshal(*v, &typeVar)
29619 if err != nil {
29620 return err
29621 }
29622 rnl.Type = &typeVar
29623 }
29624 case "id":
29625 if v != nil {
29626 var ID string
29627 err = json.Unmarshal(*v, &ID)
29628 if err != nil {
29629 return err
29630 }
29631 rnl.ID = &ID
29632 }
29633 }
29634 }
29635
29636 return nil
29637 }
29638
29639
29640 type ResourceNavigationLinkFormat struct {
29641
29642 LinkedResourceType *string `json:"linkedResourceType,omitempty"`
29643
29644 Link *string `json:"link,omitempty"`
29645
29646 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
29647 }
29648
29649
29650 func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) {
29651 objectMap := make(map[string]interface{})
29652 if rnlf.LinkedResourceType != nil {
29653 objectMap["linkedResourceType"] = rnlf.LinkedResourceType
29654 }
29655 if rnlf.Link != nil {
29656 objectMap["link"] = rnlf.Link
29657 }
29658 return json.Marshal(objectMap)
29659 }
29660
29661
29662 type ResourceNavigationLinksListResult struct {
29663 autorest.Response `json:"-"`
29664
29665 Value *[]ResourceNavigationLink `json:"value,omitempty"`
29666
29667 NextLink *string `json:"nextLink,omitempty"`
29668 }
29669
29670
29671 func (rnllr ResourceNavigationLinksListResult) MarshalJSON() ([]byte, error) {
29672 objectMap := make(map[string]interface{})
29673 if rnllr.Value != nil {
29674 objectMap["value"] = rnllr.Value
29675 }
29676 return json.Marshal(objectMap)
29677 }
29678
29679
29680 type ResourceSet struct {
29681
29682 Subscriptions *[]string `json:"subscriptions,omitempty"`
29683 }
29684
29685
29686 type RetentionPolicyParameters struct {
29687
29688 Days *int32 `json:"days,omitempty"`
29689
29690 Enabled *bool `json:"enabled,omitempty"`
29691 }
29692
29693
29694 type Route struct {
29695 autorest.Response `json:"-"`
29696
29697 *RoutePropertiesFormat `json:"properties,omitempty"`
29698
29699 Name *string `json:"name,omitempty"`
29700
29701 Etag *string `json:"etag,omitempty"`
29702
29703 ID *string `json:"id,omitempty"`
29704 }
29705
29706
29707 func (r Route) MarshalJSON() ([]byte, error) {
29708 objectMap := make(map[string]interface{})
29709 if r.RoutePropertiesFormat != nil {
29710 objectMap["properties"] = r.RoutePropertiesFormat
29711 }
29712 if r.Name != nil {
29713 objectMap["name"] = r.Name
29714 }
29715 if r.ID != nil {
29716 objectMap["id"] = r.ID
29717 }
29718 return json.Marshal(objectMap)
29719 }
29720
29721
29722 func (r *Route) UnmarshalJSON(body []byte) error {
29723 var m map[string]*json.RawMessage
29724 err := json.Unmarshal(body, &m)
29725 if err != nil {
29726 return err
29727 }
29728 for k, v := range m {
29729 switch k {
29730 case "properties":
29731 if v != nil {
29732 var routePropertiesFormat RoutePropertiesFormat
29733 err = json.Unmarshal(*v, &routePropertiesFormat)
29734 if err != nil {
29735 return err
29736 }
29737 r.RoutePropertiesFormat = &routePropertiesFormat
29738 }
29739 case "name":
29740 if v != nil {
29741 var name string
29742 err = json.Unmarshal(*v, &name)
29743 if err != nil {
29744 return err
29745 }
29746 r.Name = &name
29747 }
29748 case "etag":
29749 if v != nil {
29750 var etag string
29751 err = json.Unmarshal(*v, &etag)
29752 if err != nil {
29753 return err
29754 }
29755 r.Etag = &etag
29756 }
29757 case "id":
29758 if v != nil {
29759 var ID string
29760 err = json.Unmarshal(*v, &ID)
29761 if err != nil {
29762 return err
29763 }
29764 r.ID = &ID
29765 }
29766 }
29767 }
29768
29769 return nil
29770 }
29771
29772
29773 type RouteFilter struct {
29774 autorest.Response `json:"-"`
29775
29776 *RouteFilterPropertiesFormat `json:"properties,omitempty"`
29777
29778 Etag *string `json:"etag,omitempty"`
29779
29780 ID *string `json:"id,omitempty"`
29781
29782 Name *string `json:"name,omitempty"`
29783
29784 Type *string `json:"type,omitempty"`
29785
29786 Location *string `json:"location,omitempty"`
29787
29788 Tags map[string]*string `json:"tags"`
29789 }
29790
29791
29792 func (rf RouteFilter) MarshalJSON() ([]byte, error) {
29793 objectMap := make(map[string]interface{})
29794 if rf.RouteFilterPropertiesFormat != nil {
29795 objectMap["properties"] = rf.RouteFilterPropertiesFormat
29796 }
29797 if rf.ID != nil {
29798 objectMap["id"] = rf.ID
29799 }
29800 if rf.Location != nil {
29801 objectMap["location"] = rf.Location
29802 }
29803 if rf.Tags != nil {
29804 objectMap["tags"] = rf.Tags
29805 }
29806 return json.Marshal(objectMap)
29807 }
29808
29809
29810 func (rf *RouteFilter) UnmarshalJSON(body []byte) error {
29811 var m map[string]*json.RawMessage
29812 err := json.Unmarshal(body, &m)
29813 if err != nil {
29814 return err
29815 }
29816 for k, v := range m {
29817 switch k {
29818 case "properties":
29819 if v != nil {
29820 var routeFilterPropertiesFormat RouteFilterPropertiesFormat
29821 err = json.Unmarshal(*v, &routeFilterPropertiesFormat)
29822 if err != nil {
29823 return err
29824 }
29825 rf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat
29826 }
29827 case "etag":
29828 if v != nil {
29829 var etag string
29830 err = json.Unmarshal(*v, &etag)
29831 if err != nil {
29832 return err
29833 }
29834 rf.Etag = &etag
29835 }
29836 case "id":
29837 if v != nil {
29838 var ID string
29839 err = json.Unmarshal(*v, &ID)
29840 if err != nil {
29841 return err
29842 }
29843 rf.ID = &ID
29844 }
29845 case "name":
29846 if v != nil {
29847 var name string
29848 err = json.Unmarshal(*v, &name)
29849 if err != nil {
29850 return err
29851 }
29852 rf.Name = &name
29853 }
29854 case "type":
29855 if v != nil {
29856 var typeVar string
29857 err = json.Unmarshal(*v, &typeVar)
29858 if err != nil {
29859 return err
29860 }
29861 rf.Type = &typeVar
29862 }
29863 case "location":
29864 if v != nil {
29865 var location string
29866 err = json.Unmarshal(*v, &location)
29867 if err != nil {
29868 return err
29869 }
29870 rf.Location = &location
29871 }
29872 case "tags":
29873 if v != nil {
29874 var tags map[string]*string
29875 err = json.Unmarshal(*v, &tags)
29876 if err != nil {
29877 return err
29878 }
29879 rf.Tags = tags
29880 }
29881 }
29882 }
29883
29884 return nil
29885 }
29886
29887
29888 type RouteFilterListResult struct {
29889 autorest.Response `json:"-"`
29890
29891 Value *[]RouteFilter `json:"value,omitempty"`
29892
29893 NextLink *string `json:"nextLink,omitempty"`
29894 }
29895
29896
29897 type RouteFilterListResultIterator struct {
29898 i int
29899 page RouteFilterListResultPage
29900 }
29901
29902
29903
29904 func (iter *RouteFilterListResultIterator) NextWithContext(ctx context.Context) (err error) {
29905 if tracing.IsEnabled() {
29906 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultIterator.NextWithContext")
29907 defer func() {
29908 sc := -1
29909 if iter.Response().Response.Response != nil {
29910 sc = iter.Response().Response.Response.StatusCode
29911 }
29912 tracing.EndSpan(ctx, sc, err)
29913 }()
29914 }
29915 iter.i++
29916 if iter.i < len(iter.page.Values()) {
29917 return nil
29918 }
29919 err = iter.page.NextWithContext(ctx)
29920 if err != nil {
29921 iter.i--
29922 return err
29923 }
29924 iter.i = 0
29925 return nil
29926 }
29927
29928
29929
29930
29931 func (iter *RouteFilterListResultIterator) Next() error {
29932 return iter.NextWithContext(context.Background())
29933 }
29934
29935
29936 func (iter RouteFilterListResultIterator) NotDone() bool {
29937 return iter.page.NotDone() && iter.i < len(iter.page.Values())
29938 }
29939
29940
29941 func (iter RouteFilterListResultIterator) Response() RouteFilterListResult {
29942 return iter.page.Response()
29943 }
29944
29945
29946
29947 func (iter RouteFilterListResultIterator) Value() RouteFilter {
29948 if !iter.page.NotDone() {
29949 return RouteFilter{}
29950 }
29951 return iter.page.Values()[iter.i]
29952 }
29953
29954
29955 func NewRouteFilterListResultIterator(page RouteFilterListResultPage) RouteFilterListResultIterator {
29956 return RouteFilterListResultIterator{page: page}
29957 }
29958
29959
29960 func (rflr RouteFilterListResult) IsEmpty() bool {
29961 return rflr.Value == nil || len(*rflr.Value) == 0
29962 }
29963
29964
29965 func (rflr RouteFilterListResult) hasNextLink() bool {
29966 return rflr.NextLink != nil && len(*rflr.NextLink) != 0
29967 }
29968
29969
29970
29971 func (rflr RouteFilterListResult) routeFilterListResultPreparer(ctx context.Context) (*http.Request, error) {
29972 if !rflr.hasNextLink() {
29973 return nil, nil
29974 }
29975 return autorest.Prepare((&http.Request{}).WithContext(ctx),
29976 autorest.AsJSON(),
29977 autorest.AsGet(),
29978 autorest.WithBaseURL(to.String(rflr.NextLink)))
29979 }
29980
29981
29982 type RouteFilterListResultPage struct {
29983 fn func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)
29984 rflr RouteFilterListResult
29985 }
29986
29987
29988
29989 func (page *RouteFilterListResultPage) NextWithContext(ctx context.Context) (err error) {
29990 if tracing.IsEnabled() {
29991 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultPage.NextWithContext")
29992 defer func() {
29993 sc := -1
29994 if page.Response().Response.Response != nil {
29995 sc = page.Response().Response.Response.StatusCode
29996 }
29997 tracing.EndSpan(ctx, sc, err)
29998 }()
29999 }
30000 for {
30001 next, err := page.fn(ctx, page.rflr)
30002 if err != nil {
30003 return err
30004 }
30005 page.rflr = next
30006 if !next.hasNextLink() || !next.IsEmpty() {
30007 break
30008 }
30009 }
30010 return nil
30011 }
30012
30013
30014
30015
30016 func (page *RouteFilterListResultPage) Next() error {
30017 return page.NextWithContext(context.Background())
30018 }
30019
30020
30021 func (page RouteFilterListResultPage) NotDone() bool {
30022 return !page.rflr.IsEmpty()
30023 }
30024
30025
30026 func (page RouteFilterListResultPage) Response() RouteFilterListResult {
30027 return page.rflr
30028 }
30029
30030
30031 func (page RouteFilterListResultPage) Values() []RouteFilter {
30032 if page.rflr.IsEmpty() {
30033 return nil
30034 }
30035 return *page.rflr.Value
30036 }
30037
30038
30039 func NewRouteFilterListResultPage(cur RouteFilterListResult, getNextPage func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)) RouteFilterListResultPage {
30040 return RouteFilterListResultPage{
30041 fn: getNextPage,
30042 rflr: cur,
30043 }
30044 }
30045
30046
30047 type RouteFilterPropertiesFormat struct {
30048
30049 Rules *[]RouteFilterRule `json:"rules,omitempty"`
30050
30051 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"`
30052
30053 Ipv6Peerings *[]ExpressRouteCircuitPeering `json:"ipv6Peerings,omitempty"`
30054
30055 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
30056 }
30057
30058
30059 func (rfpf RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) {
30060 objectMap := make(map[string]interface{})
30061 if rfpf.Rules != nil {
30062 objectMap["rules"] = rfpf.Rules
30063 }
30064 return json.Marshal(objectMap)
30065 }
30066
30067
30068 type RouteFilterRule struct {
30069 autorest.Response `json:"-"`
30070
30071 *RouteFilterRulePropertiesFormat `json:"properties,omitempty"`
30072
30073 Name *string `json:"name,omitempty"`
30074
30075 Location *string `json:"location,omitempty"`
30076
30077 Etag *string `json:"etag,omitempty"`
30078
30079 ID *string `json:"id,omitempty"`
30080 }
30081
30082
30083 func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) {
30084 objectMap := make(map[string]interface{})
30085 if rfr.RouteFilterRulePropertiesFormat != nil {
30086 objectMap["properties"] = rfr.RouteFilterRulePropertiesFormat
30087 }
30088 if rfr.Name != nil {
30089 objectMap["name"] = rfr.Name
30090 }
30091 if rfr.Location != nil {
30092 objectMap["location"] = rfr.Location
30093 }
30094 if rfr.ID != nil {
30095 objectMap["id"] = rfr.ID
30096 }
30097 return json.Marshal(objectMap)
30098 }
30099
30100
30101 func (rfr *RouteFilterRule) UnmarshalJSON(body []byte) error {
30102 var m map[string]*json.RawMessage
30103 err := json.Unmarshal(body, &m)
30104 if err != nil {
30105 return err
30106 }
30107 for k, v := range m {
30108 switch k {
30109 case "properties":
30110 if v != nil {
30111 var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat
30112 err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat)
30113 if err != nil {
30114 return err
30115 }
30116 rfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat
30117 }
30118 case "name":
30119 if v != nil {
30120 var name string
30121 err = json.Unmarshal(*v, &name)
30122 if err != nil {
30123 return err
30124 }
30125 rfr.Name = &name
30126 }
30127 case "location":
30128 if v != nil {
30129 var location string
30130 err = json.Unmarshal(*v, &location)
30131 if err != nil {
30132 return err
30133 }
30134 rfr.Location = &location
30135 }
30136 case "etag":
30137 if v != nil {
30138 var etag string
30139 err = json.Unmarshal(*v, &etag)
30140 if err != nil {
30141 return err
30142 }
30143 rfr.Etag = &etag
30144 }
30145 case "id":
30146 if v != nil {
30147 var ID string
30148 err = json.Unmarshal(*v, &ID)
30149 if err != nil {
30150 return err
30151 }
30152 rfr.ID = &ID
30153 }
30154 }
30155 }
30156
30157 return nil
30158 }
30159
30160
30161 type RouteFilterRuleListResult struct {
30162 autorest.Response `json:"-"`
30163
30164 Value *[]RouteFilterRule `json:"value,omitempty"`
30165
30166 NextLink *string `json:"nextLink,omitempty"`
30167 }
30168
30169
30170 type RouteFilterRuleListResultIterator struct {
30171 i int
30172 page RouteFilterRuleListResultPage
30173 }
30174
30175
30176
30177 func (iter *RouteFilterRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
30178 if tracing.IsEnabled() {
30179 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultIterator.NextWithContext")
30180 defer func() {
30181 sc := -1
30182 if iter.Response().Response.Response != nil {
30183 sc = iter.Response().Response.Response.StatusCode
30184 }
30185 tracing.EndSpan(ctx, sc, err)
30186 }()
30187 }
30188 iter.i++
30189 if iter.i < len(iter.page.Values()) {
30190 return nil
30191 }
30192 err = iter.page.NextWithContext(ctx)
30193 if err != nil {
30194 iter.i--
30195 return err
30196 }
30197 iter.i = 0
30198 return nil
30199 }
30200
30201
30202
30203
30204 func (iter *RouteFilterRuleListResultIterator) Next() error {
30205 return iter.NextWithContext(context.Background())
30206 }
30207
30208
30209 func (iter RouteFilterRuleListResultIterator) NotDone() bool {
30210 return iter.page.NotDone() && iter.i < len(iter.page.Values())
30211 }
30212
30213
30214 func (iter RouteFilterRuleListResultIterator) Response() RouteFilterRuleListResult {
30215 return iter.page.Response()
30216 }
30217
30218
30219
30220 func (iter RouteFilterRuleListResultIterator) Value() RouteFilterRule {
30221 if !iter.page.NotDone() {
30222 return RouteFilterRule{}
30223 }
30224 return iter.page.Values()[iter.i]
30225 }
30226
30227
30228 func NewRouteFilterRuleListResultIterator(page RouteFilterRuleListResultPage) RouteFilterRuleListResultIterator {
30229 return RouteFilterRuleListResultIterator{page: page}
30230 }
30231
30232
30233 func (rfrlr RouteFilterRuleListResult) IsEmpty() bool {
30234 return rfrlr.Value == nil || len(*rfrlr.Value) == 0
30235 }
30236
30237
30238 func (rfrlr RouteFilterRuleListResult) hasNextLink() bool {
30239 return rfrlr.NextLink != nil && len(*rfrlr.NextLink) != 0
30240 }
30241
30242
30243
30244 func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
30245 if !rfrlr.hasNextLink() {
30246 return nil, nil
30247 }
30248 return autorest.Prepare((&http.Request{}).WithContext(ctx),
30249 autorest.AsJSON(),
30250 autorest.AsGet(),
30251 autorest.WithBaseURL(to.String(rfrlr.NextLink)))
30252 }
30253
30254
30255 type RouteFilterRuleListResultPage struct {
30256 fn func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)
30257 rfrlr RouteFilterRuleListResult
30258 }
30259
30260
30261
30262 func (page *RouteFilterRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
30263 if tracing.IsEnabled() {
30264 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultPage.NextWithContext")
30265 defer func() {
30266 sc := -1
30267 if page.Response().Response.Response != nil {
30268 sc = page.Response().Response.Response.StatusCode
30269 }
30270 tracing.EndSpan(ctx, sc, err)
30271 }()
30272 }
30273 for {
30274 next, err := page.fn(ctx, page.rfrlr)
30275 if err != nil {
30276 return err
30277 }
30278 page.rfrlr = next
30279 if !next.hasNextLink() || !next.IsEmpty() {
30280 break
30281 }
30282 }
30283 return nil
30284 }
30285
30286
30287
30288
30289 func (page *RouteFilterRuleListResultPage) Next() error {
30290 return page.NextWithContext(context.Background())
30291 }
30292
30293
30294 func (page RouteFilterRuleListResultPage) NotDone() bool {
30295 return !page.rfrlr.IsEmpty()
30296 }
30297
30298
30299 func (page RouteFilterRuleListResultPage) Response() RouteFilterRuleListResult {
30300 return page.rfrlr
30301 }
30302
30303
30304 func (page RouteFilterRuleListResultPage) Values() []RouteFilterRule {
30305 if page.rfrlr.IsEmpty() {
30306 return nil
30307 }
30308 return *page.rfrlr.Value
30309 }
30310
30311
30312 func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)) RouteFilterRuleListResultPage {
30313 return RouteFilterRuleListResultPage{
30314 fn: getNextPage,
30315 rfrlr: cur,
30316 }
30317 }
30318
30319
30320 type RouteFilterRulePropertiesFormat struct {
30321
30322 Access Access `json:"access,omitempty"`
30323
30324 RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"`
30325
30326 Communities *[]string `json:"communities,omitempty"`
30327
30328 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
30329 }
30330
30331
30332 func (rfrpf RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) {
30333 objectMap := make(map[string]interface{})
30334 if rfrpf.Access != "" {
30335 objectMap["access"] = rfrpf.Access
30336 }
30337 if rfrpf.RouteFilterRuleType != nil {
30338 objectMap["routeFilterRuleType"] = rfrpf.RouteFilterRuleType
30339 }
30340 if rfrpf.Communities != nil {
30341 objectMap["communities"] = rfrpf.Communities
30342 }
30343 return json.Marshal(objectMap)
30344 }
30345
30346
30347
30348 type RouteFilterRulesCreateOrUpdateFuture struct {
30349 azure.FutureAPI
30350
30351
30352 Result func(RouteFilterRulesClient) (RouteFilterRule, error)
30353 }
30354
30355
30356 func (future *RouteFilterRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
30357 var azFuture azure.Future
30358 if err := json.Unmarshal(body, &azFuture); err != nil {
30359 return err
30360 }
30361 future.FutureAPI = &azFuture
30362 future.Result = future.result
30363 return nil
30364 }
30365
30366
30367 func (future *RouteFilterRulesCreateOrUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) {
30368 var done bool
30369 done, err = future.DoneWithContext(context.Background(), client)
30370 if err != nil {
30371 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
30372 return
30373 }
30374 if !done {
30375 rfr.Response.Response = future.Response()
30376 err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture")
30377 return
30378 }
30379 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
30380 if rfr.Response.Response, err = future.GetResult(sender); err == nil && rfr.Response.Response.StatusCode != http.StatusNoContent {
30381 rfr, err = client.CreateOrUpdateResponder(rfr.Response.Response)
30382 if err != nil {
30383 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", rfr.Response.Response, "Failure responding to request")
30384 }
30385 }
30386 return
30387 }
30388
30389
30390
30391 type RouteFilterRulesDeleteFuture struct {
30392 azure.FutureAPI
30393
30394
30395 Result func(RouteFilterRulesClient) (autorest.Response, error)
30396 }
30397
30398
30399 func (future *RouteFilterRulesDeleteFuture) UnmarshalJSON(body []byte) error {
30400 var azFuture azure.Future
30401 if err := json.Unmarshal(body, &azFuture); err != nil {
30402 return err
30403 }
30404 future.FutureAPI = &azFuture
30405 future.Result = future.result
30406 return nil
30407 }
30408
30409
30410 func (future *RouteFilterRulesDeleteFuture) result(client RouteFilterRulesClient) (ar autorest.Response, err error) {
30411 var done bool
30412 done, err = future.DoneWithContext(context.Background(), client)
30413 if err != nil {
30414 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure")
30415 return
30416 }
30417 if !done {
30418 ar.Response = future.Response()
30419 err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture")
30420 return
30421 }
30422 ar.Response = future.Response()
30423 return
30424 }
30425
30426
30427
30428 type RouteFiltersCreateOrUpdateFuture struct {
30429 azure.FutureAPI
30430
30431
30432 Result func(RouteFiltersClient) (RouteFilter, error)
30433 }
30434
30435
30436 func (future *RouteFiltersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
30437 var azFuture azure.Future
30438 if err := json.Unmarshal(body, &azFuture); err != nil {
30439 return err
30440 }
30441 future.FutureAPI = &azFuture
30442 future.Result = future.result
30443 return nil
30444 }
30445
30446
30447 func (future *RouteFiltersCreateOrUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) {
30448 var done bool
30449 done, err = future.DoneWithContext(context.Background(), client)
30450 if err != nil {
30451 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
30452 return
30453 }
30454 if !done {
30455 rf.Response.Response = future.Response()
30456 err = azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture")
30457 return
30458 }
30459 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
30460 if rf.Response.Response, err = future.GetResult(sender); err == nil && rf.Response.Response.StatusCode != http.StatusNoContent {
30461 rf, err = client.CreateOrUpdateResponder(rf.Response.Response)
30462 if err != nil {
30463 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", rf.Response.Response, "Failure responding to request")
30464 }
30465 }
30466 return
30467 }
30468
30469
30470
30471 type RouteFiltersDeleteFuture struct {
30472 azure.FutureAPI
30473
30474
30475 Result func(RouteFiltersClient) (autorest.Response, error)
30476 }
30477
30478
30479 func (future *RouteFiltersDeleteFuture) UnmarshalJSON(body []byte) error {
30480 var azFuture azure.Future
30481 if err := json.Unmarshal(body, &azFuture); err != nil {
30482 return err
30483 }
30484 future.FutureAPI = &azFuture
30485 future.Result = future.result
30486 return nil
30487 }
30488
30489
30490 func (future *RouteFiltersDeleteFuture) result(client RouteFiltersClient) (ar autorest.Response, err error) {
30491 var done bool
30492 done, err = future.DoneWithContext(context.Background(), client)
30493 if err != nil {
30494 err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure")
30495 return
30496 }
30497 if !done {
30498 ar.Response = future.Response()
30499 err = azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture")
30500 return
30501 }
30502 ar.Response = future.Response()
30503 return
30504 }
30505
30506
30507 type RouteListResult struct {
30508 autorest.Response `json:"-"`
30509
30510 Value *[]Route `json:"value,omitempty"`
30511
30512 NextLink *string `json:"nextLink,omitempty"`
30513 }
30514
30515
30516 type RouteListResultIterator struct {
30517 i int
30518 page RouteListResultPage
30519 }
30520
30521
30522
30523 func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) {
30524 if tracing.IsEnabled() {
30525 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext")
30526 defer func() {
30527 sc := -1
30528 if iter.Response().Response.Response != nil {
30529 sc = iter.Response().Response.Response.StatusCode
30530 }
30531 tracing.EndSpan(ctx, sc, err)
30532 }()
30533 }
30534 iter.i++
30535 if iter.i < len(iter.page.Values()) {
30536 return nil
30537 }
30538 err = iter.page.NextWithContext(ctx)
30539 if err != nil {
30540 iter.i--
30541 return err
30542 }
30543 iter.i = 0
30544 return nil
30545 }
30546
30547
30548
30549
30550 func (iter *RouteListResultIterator) Next() error {
30551 return iter.NextWithContext(context.Background())
30552 }
30553
30554
30555 func (iter RouteListResultIterator) NotDone() bool {
30556 return iter.page.NotDone() && iter.i < len(iter.page.Values())
30557 }
30558
30559
30560 func (iter RouteListResultIterator) Response() RouteListResult {
30561 return iter.page.Response()
30562 }
30563
30564
30565
30566 func (iter RouteListResultIterator) Value() Route {
30567 if !iter.page.NotDone() {
30568 return Route{}
30569 }
30570 return iter.page.Values()[iter.i]
30571 }
30572
30573
30574 func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator {
30575 return RouteListResultIterator{page: page}
30576 }
30577
30578
30579 func (rlr RouteListResult) IsEmpty() bool {
30580 return rlr.Value == nil || len(*rlr.Value) == 0
30581 }
30582
30583
30584 func (rlr RouteListResult) hasNextLink() bool {
30585 return rlr.NextLink != nil && len(*rlr.NextLink) != 0
30586 }
30587
30588
30589
30590 func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) {
30591 if !rlr.hasNextLink() {
30592 return nil, nil
30593 }
30594 return autorest.Prepare((&http.Request{}).WithContext(ctx),
30595 autorest.AsJSON(),
30596 autorest.AsGet(),
30597 autorest.WithBaseURL(to.String(rlr.NextLink)))
30598 }
30599
30600
30601 type RouteListResultPage struct {
30602 fn func(context.Context, RouteListResult) (RouteListResult, error)
30603 rlr RouteListResult
30604 }
30605
30606
30607
30608 func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) {
30609 if tracing.IsEnabled() {
30610 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext")
30611 defer func() {
30612 sc := -1
30613 if page.Response().Response.Response != nil {
30614 sc = page.Response().Response.Response.StatusCode
30615 }
30616 tracing.EndSpan(ctx, sc, err)
30617 }()
30618 }
30619 for {
30620 next, err := page.fn(ctx, page.rlr)
30621 if err != nil {
30622 return err
30623 }
30624 page.rlr = next
30625 if !next.hasNextLink() || !next.IsEmpty() {
30626 break
30627 }
30628 }
30629 return nil
30630 }
30631
30632
30633
30634
30635 func (page *RouteListResultPage) Next() error {
30636 return page.NextWithContext(context.Background())
30637 }
30638
30639
30640 func (page RouteListResultPage) NotDone() bool {
30641 return !page.rlr.IsEmpty()
30642 }
30643
30644
30645 func (page RouteListResultPage) Response() RouteListResult {
30646 return page.rlr
30647 }
30648
30649
30650 func (page RouteListResultPage) Values() []Route {
30651 if page.rlr.IsEmpty() {
30652 return nil
30653 }
30654 return *page.rlr.Value
30655 }
30656
30657
30658 func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage {
30659 return RouteListResultPage{
30660 fn: getNextPage,
30661 rlr: cur,
30662 }
30663 }
30664
30665
30666 type RoutePropertiesFormat struct {
30667
30668 AddressPrefix *string `json:"addressPrefix,omitempty"`
30669
30670 NextHopType RouteNextHopType `json:"nextHopType,omitempty"`
30671
30672 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"`
30673
30674 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
30675 }
30676
30677
30678 func (rpf RoutePropertiesFormat) MarshalJSON() ([]byte, error) {
30679 objectMap := make(map[string]interface{})
30680 if rpf.AddressPrefix != nil {
30681 objectMap["addressPrefix"] = rpf.AddressPrefix
30682 }
30683 if rpf.NextHopType != "" {
30684 objectMap["nextHopType"] = rpf.NextHopType
30685 }
30686 if rpf.NextHopIPAddress != nil {
30687 objectMap["nextHopIpAddress"] = rpf.NextHopIPAddress
30688 }
30689 return json.Marshal(objectMap)
30690 }
30691
30692
30693
30694 type RoutesCreateOrUpdateFuture struct {
30695 azure.FutureAPI
30696
30697
30698 Result func(RoutesClient) (Route, error)
30699 }
30700
30701
30702 func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
30703 var azFuture azure.Future
30704 if err := json.Unmarshal(body, &azFuture); err != nil {
30705 return err
30706 }
30707 future.FutureAPI = &azFuture
30708 future.Result = future.result
30709 return nil
30710 }
30711
30712
30713 func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) {
30714 var done bool
30715 done, err = future.DoneWithContext(context.Background(), client)
30716 if err != nil {
30717 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
30718 return
30719 }
30720 if !done {
30721 r.Response.Response = future.Response()
30722 err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture")
30723 return
30724 }
30725 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
30726 if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
30727 r, err = client.CreateOrUpdateResponder(r.Response.Response)
30728 if err != nil {
30729 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", r.Response.Response, "Failure responding to request")
30730 }
30731 }
30732 return
30733 }
30734
30735
30736 type RoutesDeleteFuture struct {
30737 azure.FutureAPI
30738
30739
30740 Result func(RoutesClient) (autorest.Response, error)
30741 }
30742
30743
30744 func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error {
30745 var azFuture azure.Future
30746 if err := json.Unmarshal(body, &azFuture); err != nil {
30747 return err
30748 }
30749 future.FutureAPI = &azFuture
30750 future.Result = future.result
30751 return nil
30752 }
30753
30754
30755 func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) {
30756 var done bool
30757 done, err = future.DoneWithContext(context.Background(), client)
30758 if err != nil {
30759 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure")
30760 return
30761 }
30762 if !done {
30763 ar.Response = future.Response()
30764 err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture")
30765 return
30766 }
30767 ar.Response = future.Response()
30768 return
30769 }
30770
30771
30772 type RouteTable struct {
30773 autorest.Response `json:"-"`
30774
30775 *RouteTablePropertiesFormat `json:"properties,omitempty"`
30776
30777 Etag *string `json:"etag,omitempty"`
30778
30779 ID *string `json:"id,omitempty"`
30780
30781 Name *string `json:"name,omitempty"`
30782
30783 Type *string `json:"type,omitempty"`
30784
30785 Location *string `json:"location,omitempty"`
30786
30787 Tags map[string]*string `json:"tags"`
30788 }
30789
30790
30791 func (rt RouteTable) MarshalJSON() ([]byte, error) {
30792 objectMap := make(map[string]interface{})
30793 if rt.RouteTablePropertiesFormat != nil {
30794 objectMap["properties"] = rt.RouteTablePropertiesFormat
30795 }
30796 if rt.ID != nil {
30797 objectMap["id"] = rt.ID
30798 }
30799 if rt.Location != nil {
30800 objectMap["location"] = rt.Location
30801 }
30802 if rt.Tags != nil {
30803 objectMap["tags"] = rt.Tags
30804 }
30805 return json.Marshal(objectMap)
30806 }
30807
30808
30809 func (rt *RouteTable) UnmarshalJSON(body []byte) error {
30810 var m map[string]*json.RawMessage
30811 err := json.Unmarshal(body, &m)
30812 if err != nil {
30813 return err
30814 }
30815 for k, v := range m {
30816 switch k {
30817 case "properties":
30818 if v != nil {
30819 var routeTablePropertiesFormat RouteTablePropertiesFormat
30820 err = json.Unmarshal(*v, &routeTablePropertiesFormat)
30821 if err != nil {
30822 return err
30823 }
30824 rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat
30825 }
30826 case "etag":
30827 if v != nil {
30828 var etag string
30829 err = json.Unmarshal(*v, &etag)
30830 if err != nil {
30831 return err
30832 }
30833 rt.Etag = &etag
30834 }
30835 case "id":
30836 if v != nil {
30837 var ID string
30838 err = json.Unmarshal(*v, &ID)
30839 if err != nil {
30840 return err
30841 }
30842 rt.ID = &ID
30843 }
30844 case "name":
30845 if v != nil {
30846 var name string
30847 err = json.Unmarshal(*v, &name)
30848 if err != nil {
30849 return err
30850 }
30851 rt.Name = &name
30852 }
30853 case "type":
30854 if v != nil {
30855 var typeVar string
30856 err = json.Unmarshal(*v, &typeVar)
30857 if err != nil {
30858 return err
30859 }
30860 rt.Type = &typeVar
30861 }
30862 case "location":
30863 if v != nil {
30864 var location string
30865 err = json.Unmarshal(*v, &location)
30866 if err != nil {
30867 return err
30868 }
30869 rt.Location = &location
30870 }
30871 case "tags":
30872 if v != nil {
30873 var tags map[string]*string
30874 err = json.Unmarshal(*v, &tags)
30875 if err != nil {
30876 return err
30877 }
30878 rt.Tags = tags
30879 }
30880 }
30881 }
30882
30883 return nil
30884 }
30885
30886
30887 type RouteTableListResult struct {
30888 autorest.Response `json:"-"`
30889
30890 Value *[]RouteTable `json:"value,omitempty"`
30891
30892 NextLink *string `json:"nextLink,omitempty"`
30893 }
30894
30895
30896 type RouteTableListResultIterator struct {
30897 i int
30898 page RouteTableListResultPage
30899 }
30900
30901
30902
30903 func (iter *RouteTableListResultIterator) NextWithContext(ctx context.Context) (err error) {
30904 if tracing.IsEnabled() {
30905 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultIterator.NextWithContext")
30906 defer func() {
30907 sc := -1
30908 if iter.Response().Response.Response != nil {
30909 sc = iter.Response().Response.Response.StatusCode
30910 }
30911 tracing.EndSpan(ctx, sc, err)
30912 }()
30913 }
30914 iter.i++
30915 if iter.i < len(iter.page.Values()) {
30916 return nil
30917 }
30918 err = iter.page.NextWithContext(ctx)
30919 if err != nil {
30920 iter.i--
30921 return err
30922 }
30923 iter.i = 0
30924 return nil
30925 }
30926
30927
30928
30929
30930 func (iter *RouteTableListResultIterator) Next() error {
30931 return iter.NextWithContext(context.Background())
30932 }
30933
30934
30935 func (iter RouteTableListResultIterator) NotDone() bool {
30936 return iter.page.NotDone() && iter.i < len(iter.page.Values())
30937 }
30938
30939
30940 func (iter RouteTableListResultIterator) Response() RouteTableListResult {
30941 return iter.page.Response()
30942 }
30943
30944
30945
30946 func (iter RouteTableListResultIterator) Value() RouteTable {
30947 if !iter.page.NotDone() {
30948 return RouteTable{}
30949 }
30950 return iter.page.Values()[iter.i]
30951 }
30952
30953
30954 func NewRouteTableListResultIterator(page RouteTableListResultPage) RouteTableListResultIterator {
30955 return RouteTableListResultIterator{page: page}
30956 }
30957
30958
30959 func (rtlr RouteTableListResult) IsEmpty() bool {
30960 return rtlr.Value == nil || len(*rtlr.Value) == 0
30961 }
30962
30963
30964 func (rtlr RouteTableListResult) hasNextLink() bool {
30965 return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0
30966 }
30967
30968
30969
30970 func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) {
30971 if !rtlr.hasNextLink() {
30972 return nil, nil
30973 }
30974 return autorest.Prepare((&http.Request{}).WithContext(ctx),
30975 autorest.AsJSON(),
30976 autorest.AsGet(),
30977 autorest.WithBaseURL(to.String(rtlr.NextLink)))
30978 }
30979
30980
30981 type RouteTableListResultPage struct {
30982 fn func(context.Context, RouteTableListResult) (RouteTableListResult, error)
30983 rtlr RouteTableListResult
30984 }
30985
30986
30987
30988 func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err error) {
30989 if tracing.IsEnabled() {
30990 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultPage.NextWithContext")
30991 defer func() {
30992 sc := -1
30993 if page.Response().Response.Response != nil {
30994 sc = page.Response().Response.Response.StatusCode
30995 }
30996 tracing.EndSpan(ctx, sc, err)
30997 }()
30998 }
30999 for {
31000 next, err := page.fn(ctx, page.rtlr)
31001 if err != nil {
31002 return err
31003 }
31004 page.rtlr = next
31005 if !next.hasNextLink() || !next.IsEmpty() {
31006 break
31007 }
31008 }
31009 return nil
31010 }
31011
31012
31013
31014
31015 func (page *RouteTableListResultPage) Next() error {
31016 return page.NextWithContext(context.Background())
31017 }
31018
31019
31020 func (page RouteTableListResultPage) NotDone() bool {
31021 return !page.rtlr.IsEmpty()
31022 }
31023
31024
31025 func (page RouteTableListResultPage) Response() RouteTableListResult {
31026 return page.rtlr
31027 }
31028
31029
31030 func (page RouteTableListResultPage) Values() []RouteTable {
31031 if page.rtlr.IsEmpty() {
31032 return nil
31033 }
31034 return *page.rtlr.Value
31035 }
31036
31037
31038 func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage {
31039 return RouteTableListResultPage{
31040 fn: getNextPage,
31041 rtlr: cur,
31042 }
31043 }
31044
31045
31046 type RouteTablePropertiesFormat struct {
31047
31048 Routes *[]Route `json:"routes,omitempty"`
31049
31050 Subnets *[]Subnet `json:"subnets,omitempty"`
31051
31052 DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"`
31053
31054 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
31055 }
31056
31057
31058 func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) {
31059 objectMap := make(map[string]interface{})
31060 if rtpf.Routes != nil {
31061 objectMap["routes"] = rtpf.Routes
31062 }
31063 if rtpf.DisableBgpRoutePropagation != nil {
31064 objectMap["disableBgpRoutePropagation"] = rtpf.DisableBgpRoutePropagation
31065 }
31066 return json.Marshal(objectMap)
31067 }
31068
31069
31070
31071 type RouteTablesCreateOrUpdateFuture struct {
31072 azure.FutureAPI
31073
31074
31075 Result func(RouteTablesClient) (RouteTable, error)
31076 }
31077
31078
31079 func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
31080 var azFuture azure.Future
31081 if err := json.Unmarshal(body, &azFuture); err != nil {
31082 return err
31083 }
31084 future.FutureAPI = &azFuture
31085 future.Result = future.result
31086 return nil
31087 }
31088
31089
31090 func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) {
31091 var done bool
31092 done, err = future.DoneWithContext(context.Background(), client)
31093 if err != nil {
31094 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
31095 return
31096 }
31097 if !done {
31098 rt.Response.Response = future.Response()
31099 err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture")
31100 return
31101 }
31102 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
31103 if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent {
31104 rt, err = client.CreateOrUpdateResponder(rt.Response.Response)
31105 if err != nil {
31106 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request")
31107 }
31108 }
31109 return
31110 }
31111
31112
31113
31114 type RouteTablesDeleteFuture struct {
31115 azure.FutureAPI
31116
31117
31118 Result func(RouteTablesClient) (autorest.Response, error)
31119 }
31120
31121
31122 func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error {
31123 var azFuture azure.Future
31124 if err := json.Unmarshal(body, &azFuture); err != nil {
31125 return err
31126 }
31127 future.FutureAPI = &azFuture
31128 future.Result = future.result
31129 return nil
31130 }
31131
31132
31133 func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) {
31134 var done bool
31135 done, err = future.DoneWithContext(context.Background(), client)
31136 if err != nil {
31137 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure")
31138 return
31139 }
31140 if !done {
31141 ar.Response = future.Response()
31142 err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture")
31143 return
31144 }
31145 ar.Response = future.Response()
31146 return
31147 }
31148
31149
31150
31151 type RoutingConfiguration struct {
31152
31153 AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"`
31154
31155 PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"`
31156
31157 VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"`
31158 }
31159
31160
31161 type RuleCondition struct {
31162
31163 IPProtocols *[]FirewallPolicyRuleConditionNetworkProtocol `json:"ipProtocols,omitempty"`
31164
31165 SourceAddresses *[]string `json:"sourceAddresses,omitempty"`
31166
31167 DestinationAddresses *[]string `json:"destinationAddresses,omitempty"`
31168
31169 DestinationPorts *[]string `json:"destinationPorts,omitempty"`
31170
31171 SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"`
31172
31173 DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"`
31174
31175 Name *string `json:"name,omitempty"`
31176
31177 Description *string `json:"description,omitempty"`
31178
31179 RuleConditionType RuleConditionType `json:"ruleConditionType,omitempty"`
31180 }
31181
31182
31183 func (rc RuleCondition) MarshalJSON() ([]byte, error) {
31184 rc.RuleConditionType = RuleConditionTypeNetworkRuleCondition
31185 objectMap := make(map[string]interface{})
31186 if rc.IPProtocols != nil {
31187 objectMap["ipProtocols"] = rc.IPProtocols
31188 }
31189 if rc.SourceAddresses != nil {
31190 objectMap["sourceAddresses"] = rc.SourceAddresses
31191 }
31192 if rc.DestinationAddresses != nil {
31193 objectMap["destinationAddresses"] = rc.DestinationAddresses
31194 }
31195 if rc.DestinationPorts != nil {
31196 objectMap["destinationPorts"] = rc.DestinationPorts
31197 }
31198 if rc.SourceIPGroups != nil {
31199 objectMap["sourceIpGroups"] = rc.SourceIPGroups
31200 }
31201 if rc.DestinationIPGroups != nil {
31202 objectMap["destinationIpGroups"] = rc.DestinationIPGroups
31203 }
31204 if rc.Name != nil {
31205 objectMap["name"] = rc.Name
31206 }
31207 if rc.Description != nil {
31208 objectMap["description"] = rc.Description
31209 }
31210 if rc.RuleConditionType != "" {
31211 objectMap["ruleConditionType"] = rc.RuleConditionType
31212 }
31213 return json.Marshal(objectMap)
31214 }
31215
31216
31217 func (rc RuleCondition) AsApplicationRuleCondition() (*ApplicationRuleCondition, bool) {
31218 return nil, false
31219 }
31220
31221
31222 func (rc RuleCondition) AsNatRuleCondition() (*NatRuleCondition, bool) {
31223 return nil, false
31224 }
31225
31226
31227 func (rc RuleCondition) AsRuleCondition() (*RuleCondition, bool) {
31228 return &rc, true
31229 }
31230
31231
31232 func (rc RuleCondition) AsFirewallPolicyRuleCondition() (*FirewallPolicyRuleCondition, bool) {
31233 return nil, false
31234 }
31235
31236
31237 func (rc RuleCondition) AsBasicFirewallPolicyRuleCondition() (BasicFirewallPolicyRuleCondition, bool) {
31238 return &rc, true
31239 }
31240
31241
31242 type SecurityGroup struct {
31243 autorest.Response `json:"-"`
31244
31245 *SecurityGroupPropertiesFormat `json:"properties,omitempty"`
31246
31247 Etag *string `json:"etag,omitempty"`
31248
31249 ID *string `json:"id,omitempty"`
31250
31251 Name *string `json:"name,omitempty"`
31252
31253 Type *string `json:"type,omitempty"`
31254
31255 Location *string `json:"location,omitempty"`
31256
31257 Tags map[string]*string `json:"tags"`
31258 }
31259
31260
31261 func (sg SecurityGroup) MarshalJSON() ([]byte, error) {
31262 objectMap := make(map[string]interface{})
31263 if sg.SecurityGroupPropertiesFormat != nil {
31264 objectMap["properties"] = sg.SecurityGroupPropertiesFormat
31265 }
31266 if sg.ID != nil {
31267 objectMap["id"] = sg.ID
31268 }
31269 if sg.Location != nil {
31270 objectMap["location"] = sg.Location
31271 }
31272 if sg.Tags != nil {
31273 objectMap["tags"] = sg.Tags
31274 }
31275 return json.Marshal(objectMap)
31276 }
31277
31278
31279 func (sg *SecurityGroup) UnmarshalJSON(body []byte) error {
31280 var m map[string]*json.RawMessage
31281 err := json.Unmarshal(body, &m)
31282 if err != nil {
31283 return err
31284 }
31285 for k, v := range m {
31286 switch k {
31287 case "properties":
31288 if v != nil {
31289 var securityGroupPropertiesFormat SecurityGroupPropertiesFormat
31290 err = json.Unmarshal(*v, &securityGroupPropertiesFormat)
31291 if err != nil {
31292 return err
31293 }
31294 sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat
31295 }
31296 case "etag":
31297 if v != nil {
31298 var etag string
31299 err = json.Unmarshal(*v, &etag)
31300 if err != nil {
31301 return err
31302 }
31303 sg.Etag = &etag
31304 }
31305 case "id":
31306 if v != nil {
31307 var ID string
31308 err = json.Unmarshal(*v, &ID)
31309 if err != nil {
31310 return err
31311 }
31312 sg.ID = &ID
31313 }
31314 case "name":
31315 if v != nil {
31316 var name string
31317 err = json.Unmarshal(*v, &name)
31318 if err != nil {
31319 return err
31320 }
31321 sg.Name = &name
31322 }
31323 case "type":
31324 if v != nil {
31325 var typeVar string
31326 err = json.Unmarshal(*v, &typeVar)
31327 if err != nil {
31328 return err
31329 }
31330 sg.Type = &typeVar
31331 }
31332 case "location":
31333 if v != nil {
31334 var location string
31335 err = json.Unmarshal(*v, &location)
31336 if err != nil {
31337 return err
31338 }
31339 sg.Location = &location
31340 }
31341 case "tags":
31342 if v != nil {
31343 var tags map[string]*string
31344 err = json.Unmarshal(*v, &tags)
31345 if err != nil {
31346 return err
31347 }
31348 sg.Tags = tags
31349 }
31350 }
31351 }
31352
31353 return nil
31354 }
31355
31356
31357 type SecurityGroupListResult struct {
31358 autorest.Response `json:"-"`
31359
31360 Value *[]SecurityGroup `json:"value,omitempty"`
31361
31362 NextLink *string `json:"nextLink,omitempty"`
31363 }
31364
31365
31366 type SecurityGroupListResultIterator struct {
31367 i int
31368 page SecurityGroupListResultPage
31369 }
31370
31371
31372
31373 func (iter *SecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
31374 if tracing.IsEnabled() {
31375 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultIterator.NextWithContext")
31376 defer func() {
31377 sc := -1
31378 if iter.Response().Response.Response != nil {
31379 sc = iter.Response().Response.Response.StatusCode
31380 }
31381 tracing.EndSpan(ctx, sc, err)
31382 }()
31383 }
31384 iter.i++
31385 if iter.i < len(iter.page.Values()) {
31386 return nil
31387 }
31388 err = iter.page.NextWithContext(ctx)
31389 if err != nil {
31390 iter.i--
31391 return err
31392 }
31393 iter.i = 0
31394 return nil
31395 }
31396
31397
31398
31399
31400 func (iter *SecurityGroupListResultIterator) Next() error {
31401 return iter.NextWithContext(context.Background())
31402 }
31403
31404
31405 func (iter SecurityGroupListResultIterator) NotDone() bool {
31406 return iter.page.NotDone() && iter.i < len(iter.page.Values())
31407 }
31408
31409
31410 func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult {
31411 return iter.page.Response()
31412 }
31413
31414
31415
31416 func (iter SecurityGroupListResultIterator) Value() SecurityGroup {
31417 if !iter.page.NotDone() {
31418 return SecurityGroup{}
31419 }
31420 return iter.page.Values()[iter.i]
31421 }
31422
31423
31424 func NewSecurityGroupListResultIterator(page SecurityGroupListResultPage) SecurityGroupListResultIterator {
31425 return SecurityGroupListResultIterator{page: page}
31426 }
31427
31428
31429 func (sglr SecurityGroupListResult) IsEmpty() bool {
31430 return sglr.Value == nil || len(*sglr.Value) == 0
31431 }
31432
31433
31434 func (sglr SecurityGroupListResult) hasNextLink() bool {
31435 return sglr.NextLink != nil && len(*sglr.NextLink) != 0
31436 }
31437
31438
31439
31440 func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
31441 if !sglr.hasNextLink() {
31442 return nil, nil
31443 }
31444 return autorest.Prepare((&http.Request{}).WithContext(ctx),
31445 autorest.AsJSON(),
31446 autorest.AsGet(),
31447 autorest.WithBaseURL(to.String(sglr.NextLink)))
31448 }
31449
31450
31451 type SecurityGroupListResultPage struct {
31452 fn func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)
31453 sglr SecurityGroupListResult
31454 }
31455
31456
31457
31458 func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
31459 if tracing.IsEnabled() {
31460 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultPage.NextWithContext")
31461 defer func() {
31462 sc := -1
31463 if page.Response().Response.Response != nil {
31464 sc = page.Response().Response.Response.StatusCode
31465 }
31466 tracing.EndSpan(ctx, sc, err)
31467 }()
31468 }
31469 for {
31470 next, err := page.fn(ctx, page.sglr)
31471 if err != nil {
31472 return err
31473 }
31474 page.sglr = next
31475 if !next.hasNextLink() || !next.IsEmpty() {
31476 break
31477 }
31478 }
31479 return nil
31480 }
31481
31482
31483
31484
31485 func (page *SecurityGroupListResultPage) Next() error {
31486 return page.NextWithContext(context.Background())
31487 }
31488
31489
31490 func (page SecurityGroupListResultPage) NotDone() bool {
31491 return !page.sglr.IsEmpty()
31492 }
31493
31494
31495 func (page SecurityGroupListResultPage) Response() SecurityGroupListResult {
31496 return page.sglr
31497 }
31498
31499
31500 func (page SecurityGroupListResultPage) Values() []SecurityGroup {
31501 if page.sglr.IsEmpty() {
31502 return nil
31503 }
31504 return *page.sglr.Value
31505 }
31506
31507
31508 func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage {
31509 return SecurityGroupListResultPage{
31510 fn: getNextPage,
31511 sglr: cur,
31512 }
31513 }
31514
31515
31516 type SecurityGroupNetworkInterface struct {
31517
31518 ID *string `json:"id,omitempty"`
31519
31520 SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"`
31521 }
31522
31523
31524 type SecurityGroupPropertiesFormat struct {
31525
31526 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
31527
31528 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"`
31529
31530 NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"`
31531
31532 Subnets *[]Subnet `json:"subnets,omitempty"`
31533
31534 FlowLogs *[]FlowLog `json:"flowLogs,omitempty"`
31535
31536 ResourceGUID *string `json:"resourceGuid,omitempty"`
31537
31538 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
31539 }
31540
31541
31542 func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) {
31543 objectMap := make(map[string]interface{})
31544 if sgpf.SecurityRules != nil {
31545 objectMap["securityRules"] = sgpf.SecurityRules
31546 }
31547 return json.Marshal(objectMap)
31548 }
31549
31550
31551 type SecurityGroupResult struct {
31552
31553 SecurityRuleAccessResult SecurityRuleAccess `json:"securityRuleAccessResult,omitempty"`
31554
31555 EvaluatedNetworkSecurityGroups *[]EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty"`
31556 }
31557
31558
31559 func (sgr SecurityGroupResult) MarshalJSON() ([]byte, error) {
31560 objectMap := make(map[string]interface{})
31561 if sgr.SecurityRuleAccessResult != "" {
31562 objectMap["securityRuleAccessResult"] = sgr.SecurityRuleAccessResult
31563 }
31564 return json.Marshal(objectMap)
31565 }
31566
31567
31568
31569 type SecurityGroupsCreateOrUpdateFuture struct {
31570 azure.FutureAPI
31571
31572
31573 Result func(SecurityGroupsClient) (SecurityGroup, error)
31574 }
31575
31576
31577 func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
31578 var azFuture azure.Future
31579 if err := json.Unmarshal(body, &azFuture); err != nil {
31580 return err
31581 }
31582 future.FutureAPI = &azFuture
31583 future.Result = future.result
31584 return nil
31585 }
31586
31587
31588 func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) {
31589 var done bool
31590 done, err = future.DoneWithContext(context.Background(), client)
31591 if err != nil {
31592 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
31593 return
31594 }
31595 if !done {
31596 sg.Response.Response = future.Response()
31597 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture")
31598 return
31599 }
31600 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
31601 if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
31602 sg, err = client.CreateOrUpdateResponder(sg.Response.Response)
31603 if err != nil {
31604 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
31605 }
31606 }
31607 return
31608 }
31609
31610
31611
31612 type SecurityGroupsDeleteFuture struct {
31613 azure.FutureAPI
31614
31615
31616 Result func(SecurityGroupsClient) (autorest.Response, error)
31617 }
31618
31619
31620 func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
31621 var azFuture azure.Future
31622 if err := json.Unmarshal(body, &azFuture); err != nil {
31623 return err
31624 }
31625 future.FutureAPI = &azFuture
31626 future.Result = future.result
31627 return nil
31628 }
31629
31630
31631 func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) {
31632 var done bool
31633 done, err = future.DoneWithContext(context.Background(), client)
31634 if err != nil {
31635 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
31636 return
31637 }
31638 if !done {
31639 ar.Response = future.Response()
31640 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture")
31641 return
31642 }
31643 ar.Response = future.Response()
31644 return
31645 }
31646
31647
31648 type SecurityGroupViewParameters struct {
31649
31650 TargetResourceID *string `json:"targetResourceId,omitempty"`
31651 }
31652
31653
31654 type SecurityGroupViewResult struct {
31655 autorest.Response `json:"-"`
31656
31657 NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"`
31658 }
31659
31660
31661 type SecurityPartnerProvider struct {
31662 autorest.Response `json:"-"`
31663
31664 *SecurityPartnerProviderPropertiesFormat `json:"properties,omitempty"`
31665
31666 Etag *string `json:"etag,omitempty"`
31667
31668 ID *string `json:"id,omitempty"`
31669
31670 Name *string `json:"name,omitempty"`
31671
31672 Type *string `json:"type,omitempty"`
31673
31674 Location *string `json:"location,omitempty"`
31675
31676 Tags map[string]*string `json:"tags"`
31677 }
31678
31679
31680 func (spp SecurityPartnerProvider) MarshalJSON() ([]byte, error) {
31681 objectMap := make(map[string]interface{})
31682 if spp.SecurityPartnerProviderPropertiesFormat != nil {
31683 objectMap["properties"] = spp.SecurityPartnerProviderPropertiesFormat
31684 }
31685 if spp.ID != nil {
31686 objectMap["id"] = spp.ID
31687 }
31688 if spp.Location != nil {
31689 objectMap["location"] = spp.Location
31690 }
31691 if spp.Tags != nil {
31692 objectMap["tags"] = spp.Tags
31693 }
31694 return json.Marshal(objectMap)
31695 }
31696
31697
31698 func (spp *SecurityPartnerProvider) UnmarshalJSON(body []byte) error {
31699 var m map[string]*json.RawMessage
31700 err := json.Unmarshal(body, &m)
31701 if err != nil {
31702 return err
31703 }
31704 for k, v := range m {
31705 switch k {
31706 case "properties":
31707 if v != nil {
31708 var securityPartnerProviderPropertiesFormat SecurityPartnerProviderPropertiesFormat
31709 err = json.Unmarshal(*v, &securityPartnerProviderPropertiesFormat)
31710 if err != nil {
31711 return err
31712 }
31713 spp.SecurityPartnerProviderPropertiesFormat = &securityPartnerProviderPropertiesFormat
31714 }
31715 case "etag":
31716 if v != nil {
31717 var etag string
31718 err = json.Unmarshal(*v, &etag)
31719 if err != nil {
31720 return err
31721 }
31722 spp.Etag = &etag
31723 }
31724 case "id":
31725 if v != nil {
31726 var ID string
31727 err = json.Unmarshal(*v, &ID)
31728 if err != nil {
31729 return err
31730 }
31731 spp.ID = &ID
31732 }
31733 case "name":
31734 if v != nil {
31735 var name string
31736 err = json.Unmarshal(*v, &name)
31737 if err != nil {
31738 return err
31739 }
31740 spp.Name = &name
31741 }
31742 case "type":
31743 if v != nil {
31744 var typeVar string
31745 err = json.Unmarshal(*v, &typeVar)
31746 if err != nil {
31747 return err
31748 }
31749 spp.Type = &typeVar
31750 }
31751 case "location":
31752 if v != nil {
31753 var location string
31754 err = json.Unmarshal(*v, &location)
31755 if err != nil {
31756 return err
31757 }
31758 spp.Location = &location
31759 }
31760 case "tags":
31761 if v != nil {
31762 var tags map[string]*string
31763 err = json.Unmarshal(*v, &tags)
31764 if err != nil {
31765 return err
31766 }
31767 spp.Tags = tags
31768 }
31769 }
31770 }
31771
31772 return nil
31773 }
31774
31775
31776 type SecurityPartnerProviderListResult struct {
31777 autorest.Response `json:"-"`
31778
31779 Value *[]SecurityPartnerProvider `json:"value,omitempty"`
31780
31781 NextLink *string `json:"nextLink,omitempty"`
31782 }
31783
31784
31785
31786 type SecurityPartnerProviderListResultIterator struct {
31787 i int
31788 page SecurityPartnerProviderListResultPage
31789 }
31790
31791
31792
31793 func (iter *SecurityPartnerProviderListResultIterator) NextWithContext(ctx context.Context) (err error) {
31794 if tracing.IsEnabled() {
31795 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProviderListResultIterator.NextWithContext")
31796 defer func() {
31797 sc := -1
31798 if iter.Response().Response.Response != nil {
31799 sc = iter.Response().Response.Response.StatusCode
31800 }
31801 tracing.EndSpan(ctx, sc, err)
31802 }()
31803 }
31804 iter.i++
31805 if iter.i < len(iter.page.Values()) {
31806 return nil
31807 }
31808 err = iter.page.NextWithContext(ctx)
31809 if err != nil {
31810 iter.i--
31811 return err
31812 }
31813 iter.i = 0
31814 return nil
31815 }
31816
31817
31818
31819
31820 func (iter *SecurityPartnerProviderListResultIterator) Next() error {
31821 return iter.NextWithContext(context.Background())
31822 }
31823
31824
31825 func (iter SecurityPartnerProviderListResultIterator) NotDone() bool {
31826 return iter.page.NotDone() && iter.i < len(iter.page.Values())
31827 }
31828
31829
31830 func (iter SecurityPartnerProviderListResultIterator) Response() SecurityPartnerProviderListResult {
31831 return iter.page.Response()
31832 }
31833
31834
31835
31836 func (iter SecurityPartnerProviderListResultIterator) Value() SecurityPartnerProvider {
31837 if !iter.page.NotDone() {
31838 return SecurityPartnerProvider{}
31839 }
31840 return iter.page.Values()[iter.i]
31841 }
31842
31843
31844 func NewSecurityPartnerProviderListResultIterator(page SecurityPartnerProviderListResultPage) SecurityPartnerProviderListResultIterator {
31845 return SecurityPartnerProviderListResultIterator{page: page}
31846 }
31847
31848
31849 func (spplr SecurityPartnerProviderListResult) IsEmpty() bool {
31850 return spplr.Value == nil || len(*spplr.Value) == 0
31851 }
31852
31853
31854 func (spplr SecurityPartnerProviderListResult) hasNextLink() bool {
31855 return spplr.NextLink != nil && len(*spplr.NextLink) != 0
31856 }
31857
31858
31859
31860 func (spplr SecurityPartnerProviderListResult) securityPartnerProviderListResultPreparer(ctx context.Context) (*http.Request, error) {
31861 if !spplr.hasNextLink() {
31862 return nil, nil
31863 }
31864 return autorest.Prepare((&http.Request{}).WithContext(ctx),
31865 autorest.AsJSON(),
31866 autorest.AsGet(),
31867 autorest.WithBaseURL(to.String(spplr.NextLink)))
31868 }
31869
31870
31871 type SecurityPartnerProviderListResultPage struct {
31872 fn func(context.Context, SecurityPartnerProviderListResult) (SecurityPartnerProviderListResult, error)
31873 spplr SecurityPartnerProviderListResult
31874 }
31875
31876
31877
31878 func (page *SecurityPartnerProviderListResultPage) NextWithContext(ctx context.Context) (err error) {
31879 if tracing.IsEnabled() {
31880 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityPartnerProviderListResultPage.NextWithContext")
31881 defer func() {
31882 sc := -1
31883 if page.Response().Response.Response != nil {
31884 sc = page.Response().Response.Response.StatusCode
31885 }
31886 tracing.EndSpan(ctx, sc, err)
31887 }()
31888 }
31889 for {
31890 next, err := page.fn(ctx, page.spplr)
31891 if err != nil {
31892 return err
31893 }
31894 page.spplr = next
31895 if !next.hasNextLink() || !next.IsEmpty() {
31896 break
31897 }
31898 }
31899 return nil
31900 }
31901
31902
31903
31904
31905 func (page *SecurityPartnerProviderListResultPage) Next() error {
31906 return page.NextWithContext(context.Background())
31907 }
31908
31909
31910 func (page SecurityPartnerProviderListResultPage) NotDone() bool {
31911 return !page.spplr.IsEmpty()
31912 }
31913
31914
31915 func (page SecurityPartnerProviderListResultPage) Response() SecurityPartnerProviderListResult {
31916 return page.spplr
31917 }
31918
31919
31920 func (page SecurityPartnerProviderListResultPage) Values() []SecurityPartnerProvider {
31921 if page.spplr.IsEmpty() {
31922 return nil
31923 }
31924 return *page.spplr.Value
31925 }
31926
31927
31928 func NewSecurityPartnerProviderListResultPage(cur SecurityPartnerProviderListResult, getNextPage func(context.Context, SecurityPartnerProviderListResult) (SecurityPartnerProviderListResult, error)) SecurityPartnerProviderListResultPage {
31929 return SecurityPartnerProviderListResultPage{
31930 fn: getNextPage,
31931 spplr: cur,
31932 }
31933 }
31934
31935
31936 type SecurityPartnerProviderPropertiesFormat struct {
31937
31938 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
31939
31940 SecurityProviderName SecurityProviderName `json:"securityProviderName,omitempty"`
31941
31942 ConnectionStatus SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty"`
31943
31944 VirtualHub *SubResource `json:"virtualHub,omitempty"`
31945 }
31946
31947
31948 func (spppf SecurityPartnerProviderPropertiesFormat) MarshalJSON() ([]byte, error) {
31949 objectMap := make(map[string]interface{})
31950 if spppf.SecurityProviderName != "" {
31951 objectMap["securityProviderName"] = spppf.SecurityProviderName
31952 }
31953 if spppf.VirtualHub != nil {
31954 objectMap["virtualHub"] = spppf.VirtualHub
31955 }
31956 return json.Marshal(objectMap)
31957 }
31958
31959
31960
31961 type SecurityPartnerProvidersCreateOrUpdateFuture struct {
31962 azure.FutureAPI
31963
31964
31965 Result func(SecurityPartnerProvidersClient) (SecurityPartnerProvider, error)
31966 }
31967
31968
31969 func (future *SecurityPartnerProvidersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
31970 var azFuture azure.Future
31971 if err := json.Unmarshal(body, &azFuture); err != nil {
31972 return err
31973 }
31974 future.FutureAPI = &azFuture
31975 future.Result = future.result
31976 return nil
31977 }
31978
31979
31980 func (future *SecurityPartnerProvidersCreateOrUpdateFuture) result(client SecurityPartnerProvidersClient) (spp SecurityPartnerProvider, err error) {
31981 var done bool
31982 done, err = future.DoneWithContext(context.Background(), client)
31983 if err != nil {
31984 err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
31985 return
31986 }
31987 if !done {
31988 spp.Response.Response = future.Response()
31989 err = azure.NewAsyncOpIncompleteError("network.SecurityPartnerProvidersCreateOrUpdateFuture")
31990 return
31991 }
31992 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
31993 if spp.Response.Response, err = future.GetResult(sender); err == nil && spp.Response.Response.StatusCode != http.StatusNoContent {
31994 spp, err = client.CreateOrUpdateResponder(spp.Response.Response)
31995 if err != nil {
31996 err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersCreateOrUpdateFuture", "Result", spp.Response.Response, "Failure responding to request")
31997 }
31998 }
31999 return
32000 }
32001
32002
32003
32004 type SecurityPartnerProvidersDeleteFuture struct {
32005 azure.FutureAPI
32006
32007
32008 Result func(SecurityPartnerProvidersClient) (autorest.Response, error)
32009 }
32010
32011
32012 func (future *SecurityPartnerProvidersDeleteFuture) UnmarshalJSON(body []byte) error {
32013 var azFuture azure.Future
32014 if err := json.Unmarshal(body, &azFuture); err != nil {
32015 return err
32016 }
32017 future.FutureAPI = &azFuture
32018 future.Result = future.result
32019 return nil
32020 }
32021
32022
32023 func (future *SecurityPartnerProvidersDeleteFuture) result(client SecurityPartnerProvidersClient) (ar autorest.Response, err error) {
32024 var done bool
32025 done, err = future.DoneWithContext(context.Background(), client)
32026 if err != nil {
32027 err = autorest.NewErrorWithError(err, "network.SecurityPartnerProvidersDeleteFuture", "Result", future.Response(), "Polling failure")
32028 return
32029 }
32030 if !done {
32031 ar.Response = future.Response()
32032 err = azure.NewAsyncOpIncompleteError("network.SecurityPartnerProvidersDeleteFuture")
32033 return
32034 }
32035 ar.Response = future.Response()
32036 return
32037 }
32038
32039
32040 type SecurityRule struct {
32041 autorest.Response `json:"-"`
32042
32043 *SecurityRulePropertiesFormat `json:"properties,omitempty"`
32044
32045 Name *string `json:"name,omitempty"`
32046
32047 Etag *string `json:"etag,omitempty"`
32048
32049 ID *string `json:"id,omitempty"`
32050 }
32051
32052
32053 func (sr SecurityRule) MarshalJSON() ([]byte, error) {
32054 objectMap := make(map[string]interface{})
32055 if sr.SecurityRulePropertiesFormat != nil {
32056 objectMap["properties"] = sr.SecurityRulePropertiesFormat
32057 }
32058 if sr.Name != nil {
32059 objectMap["name"] = sr.Name
32060 }
32061 if sr.ID != nil {
32062 objectMap["id"] = sr.ID
32063 }
32064 return json.Marshal(objectMap)
32065 }
32066
32067
32068 func (sr *SecurityRule) UnmarshalJSON(body []byte) error {
32069 var m map[string]*json.RawMessage
32070 err := json.Unmarshal(body, &m)
32071 if err != nil {
32072 return err
32073 }
32074 for k, v := range m {
32075 switch k {
32076 case "properties":
32077 if v != nil {
32078 var securityRulePropertiesFormat SecurityRulePropertiesFormat
32079 err = json.Unmarshal(*v, &securityRulePropertiesFormat)
32080 if err != nil {
32081 return err
32082 }
32083 sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat
32084 }
32085 case "name":
32086 if v != nil {
32087 var name string
32088 err = json.Unmarshal(*v, &name)
32089 if err != nil {
32090 return err
32091 }
32092 sr.Name = &name
32093 }
32094 case "etag":
32095 if v != nil {
32096 var etag string
32097 err = json.Unmarshal(*v, &etag)
32098 if err != nil {
32099 return err
32100 }
32101 sr.Etag = &etag
32102 }
32103 case "id":
32104 if v != nil {
32105 var ID string
32106 err = json.Unmarshal(*v, &ID)
32107 if err != nil {
32108 return err
32109 }
32110 sr.ID = &ID
32111 }
32112 }
32113 }
32114
32115 return nil
32116 }
32117
32118
32119 type SecurityRuleAssociations struct {
32120
32121 NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"`
32122
32123 SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"`
32124
32125 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"`
32126
32127 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"`
32128 }
32129
32130
32131
32132 type SecurityRuleListResult struct {
32133 autorest.Response `json:"-"`
32134
32135 Value *[]SecurityRule `json:"value,omitempty"`
32136
32137 NextLink *string `json:"nextLink,omitempty"`
32138 }
32139
32140
32141 type SecurityRuleListResultIterator struct {
32142 i int
32143 page SecurityRuleListResultPage
32144 }
32145
32146
32147
32148 func (iter *SecurityRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
32149 if tracing.IsEnabled() {
32150 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultIterator.NextWithContext")
32151 defer func() {
32152 sc := -1
32153 if iter.Response().Response.Response != nil {
32154 sc = iter.Response().Response.Response.StatusCode
32155 }
32156 tracing.EndSpan(ctx, sc, err)
32157 }()
32158 }
32159 iter.i++
32160 if iter.i < len(iter.page.Values()) {
32161 return nil
32162 }
32163 err = iter.page.NextWithContext(ctx)
32164 if err != nil {
32165 iter.i--
32166 return err
32167 }
32168 iter.i = 0
32169 return nil
32170 }
32171
32172
32173
32174
32175 func (iter *SecurityRuleListResultIterator) Next() error {
32176 return iter.NextWithContext(context.Background())
32177 }
32178
32179
32180 func (iter SecurityRuleListResultIterator) NotDone() bool {
32181 return iter.page.NotDone() && iter.i < len(iter.page.Values())
32182 }
32183
32184
32185 func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult {
32186 return iter.page.Response()
32187 }
32188
32189
32190
32191 func (iter SecurityRuleListResultIterator) Value() SecurityRule {
32192 if !iter.page.NotDone() {
32193 return SecurityRule{}
32194 }
32195 return iter.page.Values()[iter.i]
32196 }
32197
32198
32199 func NewSecurityRuleListResultIterator(page SecurityRuleListResultPage) SecurityRuleListResultIterator {
32200 return SecurityRuleListResultIterator{page: page}
32201 }
32202
32203
32204 func (srlr SecurityRuleListResult) IsEmpty() bool {
32205 return srlr.Value == nil || len(*srlr.Value) == 0
32206 }
32207
32208
32209 func (srlr SecurityRuleListResult) hasNextLink() bool {
32210 return srlr.NextLink != nil && len(*srlr.NextLink) != 0
32211 }
32212
32213
32214
32215 func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
32216 if !srlr.hasNextLink() {
32217 return nil, nil
32218 }
32219 return autorest.Prepare((&http.Request{}).WithContext(ctx),
32220 autorest.AsJSON(),
32221 autorest.AsGet(),
32222 autorest.WithBaseURL(to.String(srlr.NextLink)))
32223 }
32224
32225
32226 type SecurityRuleListResultPage struct {
32227 fn func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)
32228 srlr SecurityRuleListResult
32229 }
32230
32231
32232
32233 func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
32234 if tracing.IsEnabled() {
32235 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultPage.NextWithContext")
32236 defer func() {
32237 sc := -1
32238 if page.Response().Response.Response != nil {
32239 sc = page.Response().Response.Response.StatusCode
32240 }
32241 tracing.EndSpan(ctx, sc, err)
32242 }()
32243 }
32244 for {
32245 next, err := page.fn(ctx, page.srlr)
32246 if err != nil {
32247 return err
32248 }
32249 page.srlr = next
32250 if !next.hasNextLink() || !next.IsEmpty() {
32251 break
32252 }
32253 }
32254 return nil
32255 }
32256
32257
32258
32259
32260 func (page *SecurityRuleListResultPage) Next() error {
32261 return page.NextWithContext(context.Background())
32262 }
32263
32264
32265 func (page SecurityRuleListResultPage) NotDone() bool {
32266 return !page.srlr.IsEmpty()
32267 }
32268
32269
32270 func (page SecurityRuleListResultPage) Response() SecurityRuleListResult {
32271 return page.srlr
32272 }
32273
32274
32275 func (page SecurityRuleListResultPage) Values() []SecurityRule {
32276 if page.srlr.IsEmpty() {
32277 return nil
32278 }
32279 return *page.srlr.Value
32280 }
32281
32282
32283 func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage {
32284 return SecurityRuleListResultPage{
32285 fn: getNextPage,
32286 srlr: cur,
32287 }
32288 }
32289
32290
32291 type SecurityRulePropertiesFormat struct {
32292
32293 Description *string `json:"description,omitempty"`
32294
32295 Protocol SecurityRuleProtocol `json:"protocol,omitempty"`
32296
32297 SourcePortRange *string `json:"sourcePortRange,omitempty"`
32298
32299 DestinationPortRange *string `json:"destinationPortRange,omitempty"`
32300
32301 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
32302
32303 SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"`
32304
32305 SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"`
32306
32307 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"`
32308
32309 DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"`
32310
32311 DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"`
32312
32313 SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"`
32314
32315 DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"`
32316
32317 Access SecurityRuleAccess `json:"access,omitempty"`
32318
32319 Priority *int32 `json:"priority,omitempty"`
32320
32321 Direction SecurityRuleDirection `json:"direction,omitempty"`
32322
32323 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
32324 }
32325
32326
32327 func (srpf SecurityRulePropertiesFormat) MarshalJSON() ([]byte, error) {
32328 objectMap := make(map[string]interface{})
32329 if srpf.Description != nil {
32330 objectMap["description"] = srpf.Description
32331 }
32332 if srpf.Protocol != "" {
32333 objectMap["protocol"] = srpf.Protocol
32334 }
32335 if srpf.SourcePortRange != nil {
32336 objectMap["sourcePortRange"] = srpf.SourcePortRange
32337 }
32338 if srpf.DestinationPortRange != nil {
32339 objectMap["destinationPortRange"] = srpf.DestinationPortRange
32340 }
32341 if srpf.SourceAddressPrefix != nil {
32342 objectMap["sourceAddressPrefix"] = srpf.SourceAddressPrefix
32343 }
32344 if srpf.SourceAddressPrefixes != nil {
32345 objectMap["sourceAddressPrefixes"] = srpf.SourceAddressPrefixes
32346 }
32347 if srpf.SourceApplicationSecurityGroups != nil {
32348 objectMap["sourceApplicationSecurityGroups"] = srpf.SourceApplicationSecurityGroups
32349 }
32350 if srpf.DestinationAddressPrefix != nil {
32351 objectMap["destinationAddressPrefix"] = srpf.DestinationAddressPrefix
32352 }
32353 if srpf.DestinationAddressPrefixes != nil {
32354 objectMap["destinationAddressPrefixes"] = srpf.DestinationAddressPrefixes
32355 }
32356 if srpf.DestinationApplicationSecurityGroups != nil {
32357 objectMap["destinationApplicationSecurityGroups"] = srpf.DestinationApplicationSecurityGroups
32358 }
32359 if srpf.SourcePortRanges != nil {
32360 objectMap["sourcePortRanges"] = srpf.SourcePortRanges
32361 }
32362 if srpf.DestinationPortRanges != nil {
32363 objectMap["destinationPortRanges"] = srpf.DestinationPortRanges
32364 }
32365 if srpf.Access != "" {
32366 objectMap["access"] = srpf.Access
32367 }
32368 if srpf.Priority != nil {
32369 objectMap["priority"] = srpf.Priority
32370 }
32371 if srpf.Direction != "" {
32372 objectMap["direction"] = srpf.Direction
32373 }
32374 return json.Marshal(objectMap)
32375 }
32376
32377
32378
32379 type SecurityRulesCreateOrUpdateFuture struct {
32380 azure.FutureAPI
32381
32382
32383 Result func(SecurityRulesClient) (SecurityRule, error)
32384 }
32385
32386
32387 func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
32388 var azFuture azure.Future
32389 if err := json.Unmarshal(body, &azFuture); err != nil {
32390 return err
32391 }
32392 future.FutureAPI = &azFuture
32393 future.Result = future.result
32394 return nil
32395 }
32396
32397
32398 func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) {
32399 var done bool
32400 done, err = future.DoneWithContext(context.Background(), client)
32401 if err != nil {
32402 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
32403 return
32404 }
32405 if !done {
32406 sr.Response.Response = future.Response()
32407 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture")
32408 return
32409 }
32410 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
32411 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
32412 sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
32413 if err != nil {
32414 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
32415 }
32416 }
32417 return
32418 }
32419
32420
32421
32422 type SecurityRulesDeleteFuture struct {
32423 azure.FutureAPI
32424
32425
32426 Result func(SecurityRulesClient) (autorest.Response, error)
32427 }
32428
32429
32430 func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error {
32431 var azFuture azure.Future
32432 if err := json.Unmarshal(body, &azFuture); err != nil {
32433 return err
32434 }
32435 future.FutureAPI = &azFuture
32436 future.Result = future.result
32437 return nil
32438 }
32439
32440
32441 func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) {
32442 var done bool
32443 done, err = future.DoneWithContext(context.Background(), client)
32444 if err != nil {
32445 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure")
32446 return
32447 }
32448 if !done {
32449 ar.Response = future.Response()
32450 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture")
32451 return
32452 }
32453 ar.Response = future.Response()
32454 return
32455 }
32456
32457
32458 type SecurityRulesEvaluationResult struct {
32459
32460 Name *string `json:"name,omitempty"`
32461
32462 ProtocolMatched *bool `json:"protocolMatched,omitempty"`
32463
32464 SourceMatched *bool `json:"sourceMatched,omitempty"`
32465
32466 SourcePortMatched *bool `json:"sourcePortMatched,omitempty"`
32467
32468 DestinationMatched *bool `json:"destinationMatched,omitempty"`
32469
32470 DestinationPortMatched *bool `json:"destinationPortMatched,omitempty"`
32471 }
32472
32473
32474 type ServiceAssociationLink struct {
32475
32476 *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"`
32477
32478 Name *string `json:"name,omitempty"`
32479
32480 Etag *string `json:"etag,omitempty"`
32481
32482 Type *string `json:"type,omitempty"`
32483
32484 ID *string `json:"id,omitempty"`
32485 }
32486
32487
32488 func (sal ServiceAssociationLink) MarshalJSON() ([]byte, error) {
32489 objectMap := make(map[string]interface{})
32490 if sal.ServiceAssociationLinkPropertiesFormat != nil {
32491 objectMap["properties"] = sal.ServiceAssociationLinkPropertiesFormat
32492 }
32493 if sal.Name != nil {
32494 objectMap["name"] = sal.Name
32495 }
32496 if sal.ID != nil {
32497 objectMap["id"] = sal.ID
32498 }
32499 return json.Marshal(objectMap)
32500 }
32501
32502
32503 func (sal *ServiceAssociationLink) UnmarshalJSON(body []byte) error {
32504 var m map[string]*json.RawMessage
32505 err := json.Unmarshal(body, &m)
32506 if err != nil {
32507 return err
32508 }
32509 for k, v := range m {
32510 switch k {
32511 case "properties":
32512 if v != nil {
32513 var serviceAssociationLinkPropertiesFormat ServiceAssociationLinkPropertiesFormat
32514 err = json.Unmarshal(*v, &serviceAssociationLinkPropertiesFormat)
32515 if err != nil {
32516 return err
32517 }
32518 sal.ServiceAssociationLinkPropertiesFormat = &serviceAssociationLinkPropertiesFormat
32519 }
32520 case "name":
32521 if v != nil {
32522 var name string
32523 err = json.Unmarshal(*v, &name)
32524 if err != nil {
32525 return err
32526 }
32527 sal.Name = &name
32528 }
32529 case "etag":
32530 if v != nil {
32531 var etag string
32532 err = json.Unmarshal(*v, &etag)
32533 if err != nil {
32534 return err
32535 }
32536 sal.Etag = &etag
32537 }
32538 case "type":
32539 if v != nil {
32540 var typeVar string
32541 err = json.Unmarshal(*v, &typeVar)
32542 if err != nil {
32543 return err
32544 }
32545 sal.Type = &typeVar
32546 }
32547 case "id":
32548 if v != nil {
32549 var ID string
32550 err = json.Unmarshal(*v, &ID)
32551 if err != nil {
32552 return err
32553 }
32554 sal.ID = &ID
32555 }
32556 }
32557 }
32558
32559 return nil
32560 }
32561
32562
32563 type ServiceAssociationLinkPropertiesFormat struct {
32564
32565 LinkedResourceType *string `json:"linkedResourceType,omitempty"`
32566
32567 Link *string `json:"link,omitempty"`
32568
32569 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
32570
32571 AllowDelete *bool `json:"allowDelete,omitempty"`
32572
32573 Locations *[]string `json:"locations,omitempty"`
32574 }
32575
32576
32577 func (salpf ServiceAssociationLinkPropertiesFormat) MarshalJSON() ([]byte, error) {
32578 objectMap := make(map[string]interface{})
32579 if salpf.LinkedResourceType != nil {
32580 objectMap["linkedResourceType"] = salpf.LinkedResourceType
32581 }
32582 if salpf.Link != nil {
32583 objectMap["link"] = salpf.Link
32584 }
32585 if salpf.AllowDelete != nil {
32586 objectMap["allowDelete"] = salpf.AllowDelete
32587 }
32588 if salpf.Locations != nil {
32589 objectMap["locations"] = salpf.Locations
32590 }
32591 return json.Marshal(objectMap)
32592 }
32593
32594
32595 type ServiceAssociationLinksListResult struct {
32596 autorest.Response `json:"-"`
32597
32598 Value *[]ServiceAssociationLink `json:"value,omitempty"`
32599
32600 NextLink *string `json:"nextLink,omitempty"`
32601 }
32602
32603
32604 func (sallr ServiceAssociationLinksListResult) MarshalJSON() ([]byte, error) {
32605 objectMap := make(map[string]interface{})
32606 if sallr.Value != nil {
32607 objectMap["value"] = sallr.Value
32608 }
32609 return json.Marshal(objectMap)
32610 }
32611
32612
32613 type ServiceDelegationPropertiesFormat struct {
32614
32615 ServiceName *string `json:"serviceName,omitempty"`
32616
32617 Actions *[]string `json:"actions,omitempty"`
32618
32619 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
32620 }
32621
32622
32623 func (sdpf ServiceDelegationPropertiesFormat) MarshalJSON() ([]byte, error) {
32624 objectMap := make(map[string]interface{})
32625 if sdpf.ServiceName != nil {
32626 objectMap["serviceName"] = sdpf.ServiceName
32627 }
32628 return json.Marshal(objectMap)
32629 }
32630
32631
32632
32633 type ServiceEndpointPoliciesCreateOrUpdateFuture struct {
32634 azure.FutureAPI
32635
32636
32637 Result func(ServiceEndpointPoliciesClient) (ServiceEndpointPolicy, error)
32638 }
32639
32640
32641 func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
32642 var azFuture azure.Future
32643 if err := json.Unmarshal(body, &azFuture); err != nil {
32644 return err
32645 }
32646 future.FutureAPI = &azFuture
32647 future.Result = future.result
32648 return nil
32649 }
32650
32651
32652 func (future *ServiceEndpointPoliciesCreateOrUpdateFuture) result(client ServiceEndpointPoliciesClient) (sep ServiceEndpointPolicy, err error) {
32653 var done bool
32654 done, err = future.DoneWithContext(context.Background(), client)
32655 if err != nil {
32656 err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
32657 return
32658 }
32659 if !done {
32660 sep.Response.Response = future.Response()
32661 err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesCreateOrUpdateFuture")
32662 return
32663 }
32664 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
32665 if sep.Response.Response, err = future.GetResult(sender); err == nil && sep.Response.Response.StatusCode != http.StatusNoContent {
32666 sep, err = client.CreateOrUpdateResponder(sep.Response.Response)
32667 if err != nil {
32668 err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesCreateOrUpdateFuture", "Result", sep.Response.Response, "Failure responding to request")
32669 }
32670 }
32671 return
32672 }
32673
32674
32675
32676 type ServiceEndpointPoliciesDeleteFuture struct {
32677 azure.FutureAPI
32678
32679
32680 Result func(ServiceEndpointPoliciesClient) (autorest.Response, error)
32681 }
32682
32683
32684 func (future *ServiceEndpointPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
32685 var azFuture azure.Future
32686 if err := json.Unmarshal(body, &azFuture); err != nil {
32687 return err
32688 }
32689 future.FutureAPI = &azFuture
32690 future.Result = future.result
32691 return nil
32692 }
32693
32694
32695 func (future *ServiceEndpointPoliciesDeleteFuture) result(client ServiceEndpointPoliciesClient) (ar autorest.Response, err error) {
32696 var done bool
32697 done, err = future.DoneWithContext(context.Background(), client)
32698 if err != nil {
32699 err = autorest.NewErrorWithError(err, "network.ServiceEndpointPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
32700 return
32701 }
32702 if !done {
32703 ar.Response = future.Response()
32704 err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPoliciesDeleteFuture")
32705 return
32706 }
32707 ar.Response = future.Response()
32708 return
32709 }
32710
32711
32712 type ServiceEndpointPolicy struct {
32713 autorest.Response `json:"-"`
32714
32715 *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"`
32716
32717 Etag *string `json:"etag,omitempty"`
32718
32719 ID *string `json:"id,omitempty"`
32720
32721 Name *string `json:"name,omitempty"`
32722
32723 Type *string `json:"type,omitempty"`
32724
32725 Location *string `json:"location,omitempty"`
32726
32727 Tags map[string]*string `json:"tags"`
32728 }
32729
32730
32731 func (sep ServiceEndpointPolicy) MarshalJSON() ([]byte, error) {
32732 objectMap := make(map[string]interface{})
32733 if sep.ServiceEndpointPolicyPropertiesFormat != nil {
32734 objectMap["properties"] = sep.ServiceEndpointPolicyPropertiesFormat
32735 }
32736 if sep.ID != nil {
32737 objectMap["id"] = sep.ID
32738 }
32739 if sep.Location != nil {
32740 objectMap["location"] = sep.Location
32741 }
32742 if sep.Tags != nil {
32743 objectMap["tags"] = sep.Tags
32744 }
32745 return json.Marshal(objectMap)
32746 }
32747
32748
32749 func (sep *ServiceEndpointPolicy) UnmarshalJSON(body []byte) error {
32750 var m map[string]*json.RawMessage
32751 err := json.Unmarshal(body, &m)
32752 if err != nil {
32753 return err
32754 }
32755 for k, v := range m {
32756 switch k {
32757 case "properties":
32758 if v != nil {
32759 var serviceEndpointPolicyPropertiesFormat ServiceEndpointPolicyPropertiesFormat
32760 err = json.Unmarshal(*v, &serviceEndpointPolicyPropertiesFormat)
32761 if err != nil {
32762 return err
32763 }
32764 sep.ServiceEndpointPolicyPropertiesFormat = &serviceEndpointPolicyPropertiesFormat
32765 }
32766 case "etag":
32767 if v != nil {
32768 var etag string
32769 err = json.Unmarshal(*v, &etag)
32770 if err != nil {
32771 return err
32772 }
32773 sep.Etag = &etag
32774 }
32775 case "id":
32776 if v != nil {
32777 var ID string
32778 err = json.Unmarshal(*v, &ID)
32779 if err != nil {
32780 return err
32781 }
32782 sep.ID = &ID
32783 }
32784 case "name":
32785 if v != nil {
32786 var name string
32787 err = json.Unmarshal(*v, &name)
32788 if err != nil {
32789 return err
32790 }
32791 sep.Name = &name
32792 }
32793 case "type":
32794 if v != nil {
32795 var typeVar string
32796 err = json.Unmarshal(*v, &typeVar)
32797 if err != nil {
32798 return err
32799 }
32800 sep.Type = &typeVar
32801 }
32802 case "location":
32803 if v != nil {
32804 var location string
32805 err = json.Unmarshal(*v, &location)
32806 if err != nil {
32807 return err
32808 }
32809 sep.Location = &location
32810 }
32811 case "tags":
32812 if v != nil {
32813 var tags map[string]*string
32814 err = json.Unmarshal(*v, &tags)
32815 if err != nil {
32816 return err
32817 }
32818 sep.Tags = tags
32819 }
32820 }
32821 }
32822
32823 return nil
32824 }
32825
32826
32827 type ServiceEndpointPolicyDefinition struct {
32828 autorest.Response `json:"-"`
32829
32830 *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"`
32831
32832 Name *string `json:"name,omitempty"`
32833
32834 Etag *string `json:"etag,omitempty"`
32835
32836 ID *string `json:"id,omitempty"`
32837 }
32838
32839
32840 func (sepd ServiceEndpointPolicyDefinition) MarshalJSON() ([]byte, error) {
32841 objectMap := make(map[string]interface{})
32842 if sepd.ServiceEndpointPolicyDefinitionPropertiesFormat != nil {
32843 objectMap["properties"] = sepd.ServiceEndpointPolicyDefinitionPropertiesFormat
32844 }
32845 if sepd.Name != nil {
32846 objectMap["name"] = sepd.Name
32847 }
32848 if sepd.ID != nil {
32849 objectMap["id"] = sepd.ID
32850 }
32851 return json.Marshal(objectMap)
32852 }
32853
32854
32855 func (sepd *ServiceEndpointPolicyDefinition) UnmarshalJSON(body []byte) error {
32856 var m map[string]*json.RawMessage
32857 err := json.Unmarshal(body, &m)
32858 if err != nil {
32859 return err
32860 }
32861 for k, v := range m {
32862 switch k {
32863 case "properties":
32864 if v != nil {
32865 var serviceEndpointPolicyDefinitionPropertiesFormat ServiceEndpointPolicyDefinitionPropertiesFormat
32866 err = json.Unmarshal(*v, &serviceEndpointPolicyDefinitionPropertiesFormat)
32867 if err != nil {
32868 return err
32869 }
32870 sepd.ServiceEndpointPolicyDefinitionPropertiesFormat = &serviceEndpointPolicyDefinitionPropertiesFormat
32871 }
32872 case "name":
32873 if v != nil {
32874 var name string
32875 err = json.Unmarshal(*v, &name)
32876 if err != nil {
32877 return err
32878 }
32879 sepd.Name = &name
32880 }
32881 case "etag":
32882 if v != nil {
32883 var etag string
32884 err = json.Unmarshal(*v, &etag)
32885 if err != nil {
32886 return err
32887 }
32888 sepd.Etag = &etag
32889 }
32890 case "id":
32891 if v != nil {
32892 var ID string
32893 err = json.Unmarshal(*v, &ID)
32894 if err != nil {
32895 return err
32896 }
32897 sepd.ID = &ID
32898 }
32899 }
32900 }
32901
32902 return nil
32903 }
32904
32905
32906
32907 type ServiceEndpointPolicyDefinitionListResult struct {
32908 autorest.Response `json:"-"`
32909
32910 Value *[]ServiceEndpointPolicyDefinition `json:"value,omitempty"`
32911
32912 NextLink *string `json:"nextLink,omitempty"`
32913 }
32914
32915
32916
32917 type ServiceEndpointPolicyDefinitionListResultIterator struct {
32918 i int
32919 page ServiceEndpointPolicyDefinitionListResultPage
32920 }
32921
32922
32923
32924 func (iter *ServiceEndpointPolicyDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) {
32925 if tracing.IsEnabled() {
32926 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionListResultIterator.NextWithContext")
32927 defer func() {
32928 sc := -1
32929 if iter.Response().Response.Response != nil {
32930 sc = iter.Response().Response.Response.StatusCode
32931 }
32932 tracing.EndSpan(ctx, sc, err)
32933 }()
32934 }
32935 iter.i++
32936 if iter.i < len(iter.page.Values()) {
32937 return nil
32938 }
32939 err = iter.page.NextWithContext(ctx)
32940 if err != nil {
32941 iter.i--
32942 return err
32943 }
32944 iter.i = 0
32945 return nil
32946 }
32947
32948
32949
32950
32951 func (iter *ServiceEndpointPolicyDefinitionListResultIterator) Next() error {
32952 return iter.NextWithContext(context.Background())
32953 }
32954
32955
32956 func (iter ServiceEndpointPolicyDefinitionListResultIterator) NotDone() bool {
32957 return iter.page.NotDone() && iter.i < len(iter.page.Values())
32958 }
32959
32960
32961 func (iter ServiceEndpointPolicyDefinitionListResultIterator) Response() ServiceEndpointPolicyDefinitionListResult {
32962 return iter.page.Response()
32963 }
32964
32965
32966
32967 func (iter ServiceEndpointPolicyDefinitionListResultIterator) Value() ServiceEndpointPolicyDefinition {
32968 if !iter.page.NotDone() {
32969 return ServiceEndpointPolicyDefinition{}
32970 }
32971 return iter.page.Values()[iter.i]
32972 }
32973
32974
32975 func NewServiceEndpointPolicyDefinitionListResultIterator(page ServiceEndpointPolicyDefinitionListResultPage) ServiceEndpointPolicyDefinitionListResultIterator {
32976 return ServiceEndpointPolicyDefinitionListResultIterator{page: page}
32977 }
32978
32979
32980 func (sepdlr ServiceEndpointPolicyDefinitionListResult) IsEmpty() bool {
32981 return sepdlr.Value == nil || len(*sepdlr.Value) == 0
32982 }
32983
32984
32985 func (sepdlr ServiceEndpointPolicyDefinitionListResult) hasNextLink() bool {
32986 return sepdlr.NextLink != nil && len(*sepdlr.NextLink) != 0
32987 }
32988
32989
32990
32991 func (sepdlr ServiceEndpointPolicyDefinitionListResult) serviceEndpointPolicyDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) {
32992 if !sepdlr.hasNextLink() {
32993 return nil, nil
32994 }
32995 return autorest.Prepare((&http.Request{}).WithContext(ctx),
32996 autorest.AsJSON(),
32997 autorest.AsGet(),
32998 autorest.WithBaseURL(to.String(sepdlr.NextLink)))
32999 }
33000
33001
33002 type ServiceEndpointPolicyDefinitionListResultPage struct {
33003 fn func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error)
33004 sepdlr ServiceEndpointPolicyDefinitionListResult
33005 }
33006
33007
33008
33009 func (page *ServiceEndpointPolicyDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) {
33010 if tracing.IsEnabled() {
33011 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyDefinitionListResultPage.NextWithContext")
33012 defer func() {
33013 sc := -1
33014 if page.Response().Response.Response != nil {
33015 sc = page.Response().Response.Response.StatusCode
33016 }
33017 tracing.EndSpan(ctx, sc, err)
33018 }()
33019 }
33020 for {
33021 next, err := page.fn(ctx, page.sepdlr)
33022 if err != nil {
33023 return err
33024 }
33025 page.sepdlr = next
33026 if !next.hasNextLink() || !next.IsEmpty() {
33027 break
33028 }
33029 }
33030 return nil
33031 }
33032
33033
33034
33035
33036 func (page *ServiceEndpointPolicyDefinitionListResultPage) Next() error {
33037 return page.NextWithContext(context.Background())
33038 }
33039
33040
33041 func (page ServiceEndpointPolicyDefinitionListResultPage) NotDone() bool {
33042 return !page.sepdlr.IsEmpty()
33043 }
33044
33045
33046 func (page ServiceEndpointPolicyDefinitionListResultPage) Response() ServiceEndpointPolicyDefinitionListResult {
33047 return page.sepdlr
33048 }
33049
33050
33051 func (page ServiceEndpointPolicyDefinitionListResultPage) Values() []ServiceEndpointPolicyDefinition {
33052 if page.sepdlr.IsEmpty() {
33053 return nil
33054 }
33055 return *page.sepdlr.Value
33056 }
33057
33058
33059 func NewServiceEndpointPolicyDefinitionListResultPage(cur ServiceEndpointPolicyDefinitionListResult, getNextPage func(context.Context, ServiceEndpointPolicyDefinitionListResult) (ServiceEndpointPolicyDefinitionListResult, error)) ServiceEndpointPolicyDefinitionListResultPage {
33060 return ServiceEndpointPolicyDefinitionListResultPage{
33061 fn: getNextPage,
33062 sepdlr: cur,
33063 }
33064 }
33065
33066
33067 type ServiceEndpointPolicyDefinitionPropertiesFormat struct {
33068
33069 Description *string `json:"description,omitempty"`
33070
33071 Service *string `json:"service,omitempty"`
33072
33073 ServiceResources *[]string `json:"serviceResources,omitempty"`
33074
33075 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
33076 }
33077
33078
33079 func (sepdpf ServiceEndpointPolicyDefinitionPropertiesFormat) MarshalJSON() ([]byte, error) {
33080 objectMap := make(map[string]interface{})
33081 if sepdpf.Description != nil {
33082 objectMap["description"] = sepdpf.Description
33083 }
33084 if sepdpf.Service != nil {
33085 objectMap["service"] = sepdpf.Service
33086 }
33087 if sepdpf.ServiceResources != nil {
33088 objectMap["serviceResources"] = sepdpf.ServiceResources
33089 }
33090 return json.Marshal(objectMap)
33091 }
33092
33093
33094
33095 type ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture struct {
33096 azure.FutureAPI
33097
33098
33099 Result func(ServiceEndpointPolicyDefinitionsClient) (ServiceEndpointPolicyDefinition, error)
33100 }
33101
33102
33103 func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
33104 var azFuture azure.Future
33105 if err := json.Unmarshal(body, &azFuture); err != nil {
33106 return err
33107 }
33108 future.FutureAPI = &azFuture
33109 future.Result = future.result
33110 return nil
33111 }
33112
33113
33114 func (future *ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture) result(client ServiceEndpointPolicyDefinitionsClient) (sepd ServiceEndpointPolicyDefinition, err error) {
33115 var done bool
33116 done, err = future.DoneWithContext(context.Background(), client)
33117 if err != nil {
33118 err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
33119 return
33120 }
33121 if !done {
33122 sepd.Response.Response = future.Response()
33123 err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture")
33124 return
33125 }
33126 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
33127 if sepd.Response.Response, err = future.GetResult(sender); err == nil && sepd.Response.Response.StatusCode != http.StatusNoContent {
33128 sepd, err = client.CreateOrUpdateResponder(sepd.Response.Response)
33129 if err != nil {
33130 err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsCreateOrUpdateFuture", "Result", sepd.Response.Response, "Failure responding to request")
33131 }
33132 }
33133 return
33134 }
33135
33136
33137
33138 type ServiceEndpointPolicyDefinitionsDeleteFuture struct {
33139 azure.FutureAPI
33140
33141
33142 Result func(ServiceEndpointPolicyDefinitionsClient) (autorest.Response, error)
33143 }
33144
33145
33146 func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) UnmarshalJSON(body []byte) error {
33147 var azFuture azure.Future
33148 if err := json.Unmarshal(body, &azFuture); err != nil {
33149 return err
33150 }
33151 future.FutureAPI = &azFuture
33152 future.Result = future.result
33153 return nil
33154 }
33155
33156
33157 func (future *ServiceEndpointPolicyDefinitionsDeleteFuture) result(client ServiceEndpointPolicyDefinitionsClient) (ar autorest.Response, err error) {
33158 var done bool
33159 done, err = future.DoneWithContext(context.Background(), client)
33160 if err != nil {
33161 err = autorest.NewErrorWithError(err, "network.ServiceEndpointPolicyDefinitionsDeleteFuture", "Result", future.Response(), "Polling failure")
33162 return
33163 }
33164 if !done {
33165 ar.Response = future.Response()
33166 err = azure.NewAsyncOpIncompleteError("network.ServiceEndpointPolicyDefinitionsDeleteFuture")
33167 return
33168 }
33169 ar.Response = future.Response()
33170 return
33171 }
33172
33173
33174 type ServiceEndpointPolicyListResult struct {
33175 autorest.Response `json:"-"`
33176
33177 Value *[]ServiceEndpointPolicy `json:"value,omitempty"`
33178
33179 NextLink *string `json:"nextLink,omitempty"`
33180 }
33181
33182
33183 func (seplr ServiceEndpointPolicyListResult) MarshalJSON() ([]byte, error) {
33184 objectMap := make(map[string]interface{})
33185 if seplr.Value != nil {
33186 objectMap["value"] = seplr.Value
33187 }
33188 return json.Marshal(objectMap)
33189 }
33190
33191
33192
33193 type ServiceEndpointPolicyListResultIterator struct {
33194 i int
33195 page ServiceEndpointPolicyListResultPage
33196 }
33197
33198
33199
33200 func (iter *ServiceEndpointPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
33201 if tracing.IsEnabled() {
33202 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyListResultIterator.NextWithContext")
33203 defer func() {
33204 sc := -1
33205 if iter.Response().Response.Response != nil {
33206 sc = iter.Response().Response.Response.StatusCode
33207 }
33208 tracing.EndSpan(ctx, sc, err)
33209 }()
33210 }
33211 iter.i++
33212 if iter.i < len(iter.page.Values()) {
33213 return nil
33214 }
33215 err = iter.page.NextWithContext(ctx)
33216 if err != nil {
33217 iter.i--
33218 return err
33219 }
33220 iter.i = 0
33221 return nil
33222 }
33223
33224
33225
33226
33227 func (iter *ServiceEndpointPolicyListResultIterator) Next() error {
33228 return iter.NextWithContext(context.Background())
33229 }
33230
33231
33232 func (iter ServiceEndpointPolicyListResultIterator) NotDone() bool {
33233 return iter.page.NotDone() && iter.i < len(iter.page.Values())
33234 }
33235
33236
33237 func (iter ServiceEndpointPolicyListResultIterator) Response() ServiceEndpointPolicyListResult {
33238 return iter.page.Response()
33239 }
33240
33241
33242
33243 func (iter ServiceEndpointPolicyListResultIterator) Value() ServiceEndpointPolicy {
33244 if !iter.page.NotDone() {
33245 return ServiceEndpointPolicy{}
33246 }
33247 return iter.page.Values()[iter.i]
33248 }
33249
33250
33251 func NewServiceEndpointPolicyListResultIterator(page ServiceEndpointPolicyListResultPage) ServiceEndpointPolicyListResultIterator {
33252 return ServiceEndpointPolicyListResultIterator{page: page}
33253 }
33254
33255
33256 func (seplr ServiceEndpointPolicyListResult) IsEmpty() bool {
33257 return seplr.Value == nil || len(*seplr.Value) == 0
33258 }
33259
33260
33261 func (seplr ServiceEndpointPolicyListResult) hasNextLink() bool {
33262 return seplr.NextLink != nil && len(*seplr.NextLink) != 0
33263 }
33264
33265
33266
33267 func (seplr ServiceEndpointPolicyListResult) serviceEndpointPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
33268 if !seplr.hasNextLink() {
33269 return nil, nil
33270 }
33271 return autorest.Prepare((&http.Request{}).WithContext(ctx),
33272 autorest.AsJSON(),
33273 autorest.AsGet(),
33274 autorest.WithBaseURL(to.String(seplr.NextLink)))
33275 }
33276
33277
33278 type ServiceEndpointPolicyListResultPage struct {
33279 fn func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error)
33280 seplr ServiceEndpointPolicyListResult
33281 }
33282
33283
33284
33285 func (page *ServiceEndpointPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
33286 if tracing.IsEnabled() {
33287 ctx = tracing.StartSpan(ctx, fqdn+"/ServiceEndpointPolicyListResultPage.NextWithContext")
33288 defer func() {
33289 sc := -1
33290 if page.Response().Response.Response != nil {
33291 sc = page.Response().Response.Response.StatusCode
33292 }
33293 tracing.EndSpan(ctx, sc, err)
33294 }()
33295 }
33296 for {
33297 next, err := page.fn(ctx, page.seplr)
33298 if err != nil {
33299 return err
33300 }
33301 page.seplr = next
33302 if !next.hasNextLink() || !next.IsEmpty() {
33303 break
33304 }
33305 }
33306 return nil
33307 }
33308
33309
33310
33311
33312 func (page *ServiceEndpointPolicyListResultPage) Next() error {
33313 return page.NextWithContext(context.Background())
33314 }
33315
33316
33317 func (page ServiceEndpointPolicyListResultPage) NotDone() bool {
33318 return !page.seplr.IsEmpty()
33319 }
33320
33321
33322 func (page ServiceEndpointPolicyListResultPage) Response() ServiceEndpointPolicyListResult {
33323 return page.seplr
33324 }
33325
33326
33327 func (page ServiceEndpointPolicyListResultPage) Values() []ServiceEndpointPolicy {
33328 if page.seplr.IsEmpty() {
33329 return nil
33330 }
33331 return *page.seplr.Value
33332 }
33333
33334
33335 func NewServiceEndpointPolicyListResultPage(cur ServiceEndpointPolicyListResult, getNextPage func(context.Context, ServiceEndpointPolicyListResult) (ServiceEndpointPolicyListResult, error)) ServiceEndpointPolicyListResultPage {
33336 return ServiceEndpointPolicyListResultPage{
33337 fn: getNextPage,
33338 seplr: cur,
33339 }
33340 }
33341
33342
33343 type ServiceEndpointPolicyPropertiesFormat struct {
33344
33345 ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"`
33346
33347 Subnets *[]Subnet `json:"subnets,omitempty"`
33348
33349 ResourceGUID *string `json:"resourceGuid,omitempty"`
33350
33351 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
33352 }
33353
33354
33355 func (seppf ServiceEndpointPolicyPropertiesFormat) MarshalJSON() ([]byte, error) {
33356 objectMap := make(map[string]interface{})
33357 if seppf.ServiceEndpointPolicyDefinitions != nil {
33358 objectMap["serviceEndpointPolicyDefinitions"] = seppf.ServiceEndpointPolicyDefinitions
33359 }
33360 return json.Marshal(objectMap)
33361 }
33362
33363
33364 type ServiceEndpointPropertiesFormat struct {
33365
33366 Service *string `json:"service,omitempty"`
33367
33368 Locations *[]string `json:"locations,omitempty"`
33369
33370 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
33371 }
33372
33373
33374 func (sepf ServiceEndpointPropertiesFormat) MarshalJSON() ([]byte, error) {
33375 objectMap := make(map[string]interface{})
33376 if sepf.Service != nil {
33377 objectMap["service"] = sepf.Service
33378 }
33379 if sepf.Locations != nil {
33380 objectMap["locations"] = sepf.Locations
33381 }
33382 return json.Marshal(objectMap)
33383 }
33384
33385
33386 type ServiceTagInformation struct {
33387
33388 Properties *ServiceTagInformationPropertiesFormat `json:"properties,omitempty"`
33389
33390 Name *string `json:"name,omitempty"`
33391
33392 ID *string `json:"id,omitempty"`
33393 }
33394
33395
33396 func (sti ServiceTagInformation) MarshalJSON() ([]byte, error) {
33397 objectMap := make(map[string]interface{})
33398 return json.Marshal(objectMap)
33399 }
33400
33401
33402 type ServiceTagInformationPropertiesFormat struct {
33403
33404 ChangeNumber *string `json:"changeNumber,omitempty"`
33405
33406 Region *string `json:"region,omitempty"`
33407
33408 SystemService *string `json:"systemService,omitempty"`
33409
33410 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"`
33411 }
33412
33413
33414 func (stipf ServiceTagInformationPropertiesFormat) MarshalJSON() ([]byte, error) {
33415 objectMap := make(map[string]interface{})
33416 return json.Marshal(objectMap)
33417 }
33418
33419
33420 type ServiceTagsListResult struct {
33421 autorest.Response `json:"-"`
33422
33423 Name *string `json:"name,omitempty"`
33424
33425 ID *string `json:"id,omitempty"`
33426
33427 Type *string `json:"type,omitempty"`
33428
33429 ChangeNumber *string `json:"changeNumber,omitempty"`
33430
33431 Cloud *string `json:"cloud,omitempty"`
33432
33433 Values *[]ServiceTagInformation `json:"values,omitempty"`
33434 }
33435
33436
33437 func (stlr ServiceTagsListResult) MarshalJSON() ([]byte, error) {
33438 objectMap := make(map[string]interface{})
33439 return json.Marshal(objectMap)
33440 }
33441
33442
33443 type SessionIds struct {
33444
33445 SessionIds *[]string `json:"sessionIds,omitempty"`
33446 }
33447
33448
33449 type StaticRoute struct {
33450
33451 Name *string `json:"name,omitempty"`
33452
33453 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"`
33454
33455 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"`
33456 }
33457
33458
33459 type String struct {
33460 autorest.Response `json:"-"`
33461 Value *string `json:"value,omitempty"`
33462 }
33463
33464
33465 type Subnet struct {
33466 autorest.Response `json:"-"`
33467
33468 *SubnetPropertiesFormat `json:"properties,omitempty"`
33469
33470 Name *string `json:"name,omitempty"`
33471
33472 Etag *string `json:"etag,omitempty"`
33473
33474 ID *string `json:"id,omitempty"`
33475 }
33476
33477
33478 func (s Subnet) MarshalJSON() ([]byte, error) {
33479 objectMap := make(map[string]interface{})
33480 if s.SubnetPropertiesFormat != nil {
33481 objectMap["properties"] = s.SubnetPropertiesFormat
33482 }
33483 if s.Name != nil {
33484 objectMap["name"] = s.Name
33485 }
33486 if s.ID != nil {
33487 objectMap["id"] = s.ID
33488 }
33489 return json.Marshal(objectMap)
33490 }
33491
33492
33493 func (s *Subnet) UnmarshalJSON(body []byte) error {
33494 var m map[string]*json.RawMessage
33495 err := json.Unmarshal(body, &m)
33496 if err != nil {
33497 return err
33498 }
33499 for k, v := range m {
33500 switch k {
33501 case "properties":
33502 if v != nil {
33503 var subnetPropertiesFormat SubnetPropertiesFormat
33504 err = json.Unmarshal(*v, &subnetPropertiesFormat)
33505 if err != nil {
33506 return err
33507 }
33508 s.SubnetPropertiesFormat = &subnetPropertiesFormat
33509 }
33510 case "name":
33511 if v != nil {
33512 var name string
33513 err = json.Unmarshal(*v, &name)
33514 if err != nil {
33515 return err
33516 }
33517 s.Name = &name
33518 }
33519 case "etag":
33520 if v != nil {
33521 var etag string
33522 err = json.Unmarshal(*v, &etag)
33523 if err != nil {
33524 return err
33525 }
33526 s.Etag = &etag
33527 }
33528 case "id":
33529 if v != nil {
33530 var ID string
33531 err = json.Unmarshal(*v, &ID)
33532 if err != nil {
33533 return err
33534 }
33535 s.ID = &ID
33536 }
33537 }
33538 }
33539
33540 return nil
33541 }
33542
33543
33544 type SubnetAssociation struct {
33545
33546 ID *string `json:"id,omitempty"`
33547
33548 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
33549 }
33550
33551
33552 func (sa SubnetAssociation) MarshalJSON() ([]byte, error) {
33553 objectMap := make(map[string]interface{})
33554 if sa.SecurityRules != nil {
33555 objectMap["securityRules"] = sa.SecurityRules
33556 }
33557 return json.Marshal(objectMap)
33558 }
33559
33560
33561
33562 type SubnetListResult struct {
33563 autorest.Response `json:"-"`
33564
33565 Value *[]Subnet `json:"value,omitempty"`
33566
33567 NextLink *string `json:"nextLink,omitempty"`
33568 }
33569
33570
33571 type SubnetListResultIterator struct {
33572 i int
33573 page SubnetListResultPage
33574 }
33575
33576
33577
33578 func (iter *SubnetListResultIterator) NextWithContext(ctx context.Context) (err error) {
33579 if tracing.IsEnabled() {
33580 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultIterator.NextWithContext")
33581 defer func() {
33582 sc := -1
33583 if iter.Response().Response.Response != nil {
33584 sc = iter.Response().Response.Response.StatusCode
33585 }
33586 tracing.EndSpan(ctx, sc, err)
33587 }()
33588 }
33589 iter.i++
33590 if iter.i < len(iter.page.Values()) {
33591 return nil
33592 }
33593 err = iter.page.NextWithContext(ctx)
33594 if err != nil {
33595 iter.i--
33596 return err
33597 }
33598 iter.i = 0
33599 return nil
33600 }
33601
33602
33603
33604
33605 func (iter *SubnetListResultIterator) Next() error {
33606 return iter.NextWithContext(context.Background())
33607 }
33608
33609
33610 func (iter SubnetListResultIterator) NotDone() bool {
33611 return iter.page.NotDone() && iter.i < len(iter.page.Values())
33612 }
33613
33614
33615 func (iter SubnetListResultIterator) Response() SubnetListResult {
33616 return iter.page.Response()
33617 }
33618
33619
33620
33621 func (iter SubnetListResultIterator) Value() Subnet {
33622 if !iter.page.NotDone() {
33623 return Subnet{}
33624 }
33625 return iter.page.Values()[iter.i]
33626 }
33627
33628
33629 func NewSubnetListResultIterator(page SubnetListResultPage) SubnetListResultIterator {
33630 return SubnetListResultIterator{page: page}
33631 }
33632
33633
33634 func (slr SubnetListResult) IsEmpty() bool {
33635 return slr.Value == nil || len(*slr.Value) == 0
33636 }
33637
33638
33639 func (slr SubnetListResult) hasNextLink() bool {
33640 return slr.NextLink != nil && len(*slr.NextLink) != 0
33641 }
33642
33643
33644
33645 func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) {
33646 if !slr.hasNextLink() {
33647 return nil, nil
33648 }
33649 return autorest.Prepare((&http.Request{}).WithContext(ctx),
33650 autorest.AsJSON(),
33651 autorest.AsGet(),
33652 autorest.WithBaseURL(to.String(slr.NextLink)))
33653 }
33654
33655
33656 type SubnetListResultPage struct {
33657 fn func(context.Context, SubnetListResult) (SubnetListResult, error)
33658 slr SubnetListResult
33659 }
33660
33661
33662
33663 func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err error) {
33664 if tracing.IsEnabled() {
33665 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultPage.NextWithContext")
33666 defer func() {
33667 sc := -1
33668 if page.Response().Response.Response != nil {
33669 sc = page.Response().Response.Response.StatusCode
33670 }
33671 tracing.EndSpan(ctx, sc, err)
33672 }()
33673 }
33674 for {
33675 next, err := page.fn(ctx, page.slr)
33676 if err != nil {
33677 return err
33678 }
33679 page.slr = next
33680 if !next.hasNextLink() || !next.IsEmpty() {
33681 break
33682 }
33683 }
33684 return nil
33685 }
33686
33687
33688
33689
33690 func (page *SubnetListResultPage) Next() error {
33691 return page.NextWithContext(context.Background())
33692 }
33693
33694
33695 func (page SubnetListResultPage) NotDone() bool {
33696 return !page.slr.IsEmpty()
33697 }
33698
33699
33700 func (page SubnetListResultPage) Response() SubnetListResult {
33701 return page.slr
33702 }
33703
33704
33705 func (page SubnetListResultPage) Values() []Subnet {
33706 if page.slr.IsEmpty() {
33707 return nil
33708 }
33709 return *page.slr.Value
33710 }
33711
33712
33713 func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage {
33714 return SubnetListResultPage{
33715 fn: getNextPage,
33716 slr: cur,
33717 }
33718 }
33719
33720
33721 type SubnetPropertiesFormat struct {
33722
33723 AddressPrefix *string `json:"addressPrefix,omitempty"`
33724
33725 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"`
33726
33727 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
33728
33729 RouteTable *RouteTable `json:"routeTable,omitempty"`
33730
33731 NatGateway *SubResource `json:"natGateway,omitempty"`
33732
33733 ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"`
33734
33735 ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"`
33736
33737 PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"`
33738
33739 IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"`
33740
33741 IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"`
33742
33743 IPAllocations *[]SubResource `json:"ipAllocations,omitempty"`
33744
33745 ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"`
33746
33747 ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"`
33748
33749 Delegations *[]Delegation `json:"delegations,omitempty"`
33750
33751 Purpose *string `json:"purpose,omitempty"`
33752
33753 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
33754
33755 PrivateEndpointNetworkPolicies *string `json:"privateEndpointNetworkPolicies,omitempty"`
33756
33757 PrivateLinkServiceNetworkPolicies *string `json:"privateLinkServiceNetworkPolicies,omitempty"`
33758 }
33759
33760
33761 func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) {
33762 objectMap := make(map[string]interface{})
33763 if spf.AddressPrefix != nil {
33764 objectMap["addressPrefix"] = spf.AddressPrefix
33765 }
33766 if spf.AddressPrefixes != nil {
33767 objectMap["addressPrefixes"] = spf.AddressPrefixes
33768 }
33769 if spf.NetworkSecurityGroup != nil {
33770 objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup
33771 }
33772 if spf.RouteTable != nil {
33773 objectMap["routeTable"] = spf.RouteTable
33774 }
33775 if spf.NatGateway != nil {
33776 objectMap["natGateway"] = spf.NatGateway
33777 }
33778 if spf.ServiceEndpoints != nil {
33779 objectMap["serviceEndpoints"] = spf.ServiceEndpoints
33780 }
33781 if spf.ServiceEndpointPolicies != nil {
33782 objectMap["serviceEndpointPolicies"] = spf.ServiceEndpointPolicies
33783 }
33784 if spf.IPAllocations != nil {
33785 objectMap["ipAllocations"] = spf.IPAllocations
33786 }
33787 if spf.Delegations != nil {
33788 objectMap["delegations"] = spf.Delegations
33789 }
33790 if spf.PrivateEndpointNetworkPolicies != nil {
33791 objectMap["privateEndpointNetworkPolicies"] = spf.PrivateEndpointNetworkPolicies
33792 }
33793 if spf.PrivateLinkServiceNetworkPolicies != nil {
33794 objectMap["privateLinkServiceNetworkPolicies"] = spf.PrivateLinkServiceNetworkPolicies
33795 }
33796 return json.Marshal(objectMap)
33797 }
33798
33799
33800
33801 type SubnetsCreateOrUpdateFuture struct {
33802 azure.FutureAPI
33803
33804
33805 Result func(SubnetsClient) (Subnet, error)
33806 }
33807
33808
33809 func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
33810 var azFuture azure.Future
33811 if err := json.Unmarshal(body, &azFuture); err != nil {
33812 return err
33813 }
33814 future.FutureAPI = &azFuture
33815 future.Result = future.result
33816 return nil
33817 }
33818
33819
33820 func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) {
33821 var done bool
33822 done, err = future.DoneWithContext(context.Background(), client)
33823 if err != nil {
33824 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
33825 return
33826 }
33827 if !done {
33828 s.Response.Response = future.Response()
33829 err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture")
33830 return
33831 }
33832 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
33833 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
33834 s, err = client.CreateOrUpdateResponder(s.Response.Response)
33835 if err != nil {
33836 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
33837 }
33838 }
33839 return
33840 }
33841
33842
33843
33844 type SubnetsDeleteFuture struct {
33845 azure.FutureAPI
33846
33847
33848 Result func(SubnetsClient) (autorest.Response, error)
33849 }
33850
33851
33852 func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error {
33853 var azFuture azure.Future
33854 if err := json.Unmarshal(body, &azFuture); err != nil {
33855 return err
33856 }
33857 future.FutureAPI = &azFuture
33858 future.Result = future.result
33859 return nil
33860 }
33861
33862
33863 func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) {
33864 var done bool
33865 done, err = future.DoneWithContext(context.Background(), client)
33866 if err != nil {
33867 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure")
33868 return
33869 }
33870 if !done {
33871 ar.Response = future.Response()
33872 err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture")
33873 return
33874 }
33875 ar.Response = future.Response()
33876 return
33877 }
33878
33879
33880
33881 type SubnetsPrepareNetworkPoliciesFuture struct {
33882 azure.FutureAPI
33883
33884
33885 Result func(SubnetsClient) (autorest.Response, error)
33886 }
33887
33888
33889 func (future *SubnetsPrepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error {
33890 var azFuture azure.Future
33891 if err := json.Unmarshal(body, &azFuture); err != nil {
33892 return err
33893 }
33894 future.FutureAPI = &azFuture
33895 future.Result = future.result
33896 return nil
33897 }
33898
33899
33900 func (future *SubnetsPrepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) {
33901 var done bool
33902 done, err = future.DoneWithContext(context.Background(), client)
33903 if err != nil {
33904 err = autorest.NewErrorWithError(err, "network.SubnetsPrepareNetworkPoliciesFuture", "Result", future.Response(), "Polling failure")
33905 return
33906 }
33907 if !done {
33908 ar.Response = future.Response()
33909 err = azure.NewAsyncOpIncompleteError("network.SubnetsPrepareNetworkPoliciesFuture")
33910 return
33911 }
33912 ar.Response = future.Response()
33913 return
33914 }
33915
33916
33917
33918 type SubnetsUnprepareNetworkPoliciesFuture struct {
33919 azure.FutureAPI
33920
33921
33922 Result func(SubnetsClient) (autorest.Response, error)
33923 }
33924
33925
33926 func (future *SubnetsUnprepareNetworkPoliciesFuture) UnmarshalJSON(body []byte) error {
33927 var azFuture azure.Future
33928 if err := json.Unmarshal(body, &azFuture); err != nil {
33929 return err
33930 }
33931 future.FutureAPI = &azFuture
33932 future.Result = future.result
33933 return nil
33934 }
33935
33936
33937 func (future *SubnetsUnprepareNetworkPoliciesFuture) result(client SubnetsClient) (ar autorest.Response, err error) {
33938 var done bool
33939 done, err = future.DoneWithContext(context.Background(), client)
33940 if err != nil {
33941 err = autorest.NewErrorWithError(err, "network.SubnetsUnprepareNetworkPoliciesFuture", "Result", future.Response(), "Polling failure")
33942 return
33943 }
33944 if !done {
33945 ar.Response = future.Response()
33946 err = azure.NewAsyncOpIncompleteError("network.SubnetsUnprepareNetworkPoliciesFuture")
33947 return
33948 }
33949 ar.Response = future.Response()
33950 return
33951 }
33952
33953
33954 type SubResource struct {
33955
33956 ID *string `json:"id,omitempty"`
33957 }
33958
33959
33960 type TagsObject struct {
33961
33962 Tags map[string]*string `json:"tags"`
33963 }
33964
33965
33966 func (toVar TagsObject) MarshalJSON() ([]byte, error) {
33967 objectMap := make(map[string]interface{})
33968 if toVar.Tags != nil {
33969 objectMap["tags"] = toVar.Tags
33970 }
33971 return json.Marshal(objectMap)
33972 }
33973
33974
33975 type Topology struct {
33976 autorest.Response `json:"-"`
33977
33978 ID *string `json:"id,omitempty"`
33979
33980 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
33981
33982 LastModified *date.Time `json:"lastModified,omitempty"`
33983
33984 Resources *[]TopologyResource `json:"resources,omitempty"`
33985 }
33986
33987
33988 func (t Topology) MarshalJSON() ([]byte, error) {
33989 objectMap := make(map[string]interface{})
33990 if t.Resources != nil {
33991 objectMap["resources"] = t.Resources
33992 }
33993 return json.Marshal(objectMap)
33994 }
33995
33996
33997 type TopologyAssociation struct {
33998
33999 Name *string `json:"name,omitempty"`
34000
34001 ResourceID *string `json:"resourceId,omitempty"`
34002
34003 AssociationType AssociationType `json:"associationType,omitempty"`
34004 }
34005
34006
34007 type TopologyParameters struct {
34008
34009 TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"`
34010
34011 TargetVirtualNetwork *SubResource `json:"targetVirtualNetwork,omitempty"`
34012
34013 TargetSubnet *SubResource `json:"targetSubnet,omitempty"`
34014 }
34015
34016
34017 type TopologyResource struct {
34018
34019 Name *string `json:"name,omitempty"`
34020
34021 ID *string `json:"id,omitempty"`
34022
34023 Location *string `json:"location,omitempty"`
34024
34025 Associations *[]TopologyAssociation `json:"associations,omitempty"`
34026 }
34027
34028
34029 type TrafficAnalyticsConfigurationProperties struct {
34030
34031 Enabled *bool `json:"enabled,omitempty"`
34032
34033 WorkspaceID *string `json:"workspaceId,omitempty"`
34034
34035 WorkspaceRegion *string `json:"workspaceRegion,omitempty"`
34036
34037 WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"`
34038
34039 TrafficAnalyticsInterval *int32 `json:"trafficAnalyticsInterval,omitempty"`
34040 }
34041
34042
34043 type TrafficAnalyticsProperties struct {
34044
34045 NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"`
34046 }
34047
34048
34049 type TrafficSelectorPolicy struct {
34050
34051 LocalAddressRanges *[]string `json:"localAddressRanges,omitempty"`
34052
34053 RemoteAddressRanges *[]string `json:"remoteAddressRanges,omitempty"`
34054 }
34055
34056
34057 type TroubleshootingDetails struct {
34058
34059 ID *string `json:"id,omitempty"`
34060
34061 ReasonType *string `json:"reasonType,omitempty"`
34062
34063 Summary *string `json:"summary,omitempty"`
34064
34065 Detail *string `json:"detail,omitempty"`
34066
34067 RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"`
34068 }
34069
34070
34071 type TroubleshootingParameters struct {
34072
34073 TargetResourceID *string `json:"targetResourceId,omitempty"`
34074
34075 *TroubleshootingProperties `json:"properties,omitempty"`
34076 }
34077
34078
34079 func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) {
34080 objectMap := make(map[string]interface{})
34081 if tp.TargetResourceID != nil {
34082 objectMap["targetResourceId"] = tp.TargetResourceID
34083 }
34084 if tp.TroubleshootingProperties != nil {
34085 objectMap["properties"] = tp.TroubleshootingProperties
34086 }
34087 return json.Marshal(objectMap)
34088 }
34089
34090
34091 func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error {
34092 var m map[string]*json.RawMessage
34093 err := json.Unmarshal(body, &m)
34094 if err != nil {
34095 return err
34096 }
34097 for k, v := range m {
34098 switch k {
34099 case "targetResourceId":
34100 if v != nil {
34101 var targetResourceID string
34102 err = json.Unmarshal(*v, &targetResourceID)
34103 if err != nil {
34104 return err
34105 }
34106 tp.TargetResourceID = &targetResourceID
34107 }
34108 case "properties":
34109 if v != nil {
34110 var troubleshootingProperties TroubleshootingProperties
34111 err = json.Unmarshal(*v, &troubleshootingProperties)
34112 if err != nil {
34113 return err
34114 }
34115 tp.TroubleshootingProperties = &troubleshootingProperties
34116 }
34117 }
34118 }
34119
34120 return nil
34121 }
34122
34123
34124 type TroubleshootingProperties struct {
34125
34126 StorageID *string `json:"storageId,omitempty"`
34127
34128 StoragePath *string `json:"storagePath,omitempty"`
34129 }
34130
34131
34132 type TroubleshootingRecommendedActions struct {
34133
34134 ActionID *string `json:"actionId,omitempty"`
34135
34136 ActionText *string `json:"actionText,omitempty"`
34137
34138 ActionURI *string `json:"actionUri,omitempty"`
34139
34140 ActionURIText *string `json:"actionUriText,omitempty"`
34141 }
34142
34143
34144 type TroubleshootingResult struct {
34145 autorest.Response `json:"-"`
34146
34147 StartTime *date.Time `json:"startTime,omitempty"`
34148
34149 EndTime *date.Time `json:"endTime,omitempty"`
34150
34151 Code *string `json:"code,omitempty"`
34152
34153 Results *[]TroubleshootingDetails `json:"results,omitempty"`
34154 }
34155
34156
34157 type TunnelConnectionHealth struct {
34158
34159 Tunnel *string `json:"tunnel,omitempty"`
34160
34161 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
34162
34163 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
34164
34165 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
34166
34167 LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"`
34168 }
34169
34170
34171 func (tch TunnelConnectionHealth) MarshalJSON() ([]byte, error) {
34172 objectMap := make(map[string]interface{})
34173 return json.Marshal(objectMap)
34174 }
34175
34176
34177 type UnprepareNetworkPoliciesRequest struct {
34178
34179 ServiceName *string `json:"serviceName,omitempty"`
34180 }
34181
34182
34183 type Usage struct {
34184
34185 ID *string `json:"id,omitempty"`
34186
34187 Unit *string `json:"unit,omitempty"`
34188
34189 CurrentValue *int64 `json:"currentValue,omitempty"`
34190
34191 Limit *int64 `json:"limit,omitempty"`
34192
34193 Name *UsageName `json:"name,omitempty"`
34194 }
34195
34196
34197 func (u Usage) MarshalJSON() ([]byte, error) {
34198 objectMap := make(map[string]interface{})
34199 if u.Unit != nil {
34200 objectMap["unit"] = u.Unit
34201 }
34202 if u.CurrentValue != nil {
34203 objectMap["currentValue"] = u.CurrentValue
34204 }
34205 if u.Limit != nil {
34206 objectMap["limit"] = u.Limit
34207 }
34208 if u.Name != nil {
34209 objectMap["name"] = u.Name
34210 }
34211 return json.Marshal(objectMap)
34212 }
34213
34214
34215 type UsageName struct {
34216
34217 Value *string `json:"value,omitempty"`
34218
34219 LocalizedValue *string `json:"localizedValue,omitempty"`
34220 }
34221
34222
34223 type UsagesListResult struct {
34224 autorest.Response `json:"-"`
34225
34226 Value *[]Usage `json:"value,omitempty"`
34227
34228 NextLink *string `json:"nextLink,omitempty"`
34229 }
34230
34231
34232 type UsagesListResultIterator struct {
34233 i int
34234 page UsagesListResultPage
34235 }
34236
34237
34238
34239 func (iter *UsagesListResultIterator) NextWithContext(ctx context.Context) (err error) {
34240 if tracing.IsEnabled() {
34241 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultIterator.NextWithContext")
34242 defer func() {
34243 sc := -1
34244 if iter.Response().Response.Response != nil {
34245 sc = iter.Response().Response.Response.StatusCode
34246 }
34247 tracing.EndSpan(ctx, sc, err)
34248 }()
34249 }
34250 iter.i++
34251 if iter.i < len(iter.page.Values()) {
34252 return nil
34253 }
34254 err = iter.page.NextWithContext(ctx)
34255 if err != nil {
34256 iter.i--
34257 return err
34258 }
34259 iter.i = 0
34260 return nil
34261 }
34262
34263
34264
34265
34266 func (iter *UsagesListResultIterator) Next() error {
34267 return iter.NextWithContext(context.Background())
34268 }
34269
34270
34271 func (iter UsagesListResultIterator) NotDone() bool {
34272 return iter.page.NotDone() && iter.i < len(iter.page.Values())
34273 }
34274
34275
34276 func (iter UsagesListResultIterator) Response() UsagesListResult {
34277 return iter.page.Response()
34278 }
34279
34280
34281
34282 func (iter UsagesListResultIterator) Value() Usage {
34283 if !iter.page.NotDone() {
34284 return Usage{}
34285 }
34286 return iter.page.Values()[iter.i]
34287 }
34288
34289
34290 func NewUsagesListResultIterator(page UsagesListResultPage) UsagesListResultIterator {
34291 return UsagesListResultIterator{page: page}
34292 }
34293
34294
34295 func (ulr UsagesListResult) IsEmpty() bool {
34296 return ulr.Value == nil || len(*ulr.Value) == 0
34297 }
34298
34299
34300 func (ulr UsagesListResult) hasNextLink() bool {
34301 return ulr.NextLink != nil && len(*ulr.NextLink) != 0
34302 }
34303
34304
34305
34306 func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) {
34307 if !ulr.hasNextLink() {
34308 return nil, nil
34309 }
34310 return autorest.Prepare((&http.Request{}).WithContext(ctx),
34311 autorest.AsJSON(),
34312 autorest.AsGet(),
34313 autorest.WithBaseURL(to.String(ulr.NextLink)))
34314 }
34315
34316
34317 type UsagesListResultPage struct {
34318 fn func(context.Context, UsagesListResult) (UsagesListResult, error)
34319 ulr UsagesListResult
34320 }
34321
34322
34323
34324 func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err error) {
34325 if tracing.IsEnabled() {
34326 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultPage.NextWithContext")
34327 defer func() {
34328 sc := -1
34329 if page.Response().Response.Response != nil {
34330 sc = page.Response().Response.Response.StatusCode
34331 }
34332 tracing.EndSpan(ctx, sc, err)
34333 }()
34334 }
34335 for {
34336 next, err := page.fn(ctx, page.ulr)
34337 if err != nil {
34338 return err
34339 }
34340 page.ulr = next
34341 if !next.hasNextLink() || !next.IsEmpty() {
34342 break
34343 }
34344 }
34345 return nil
34346 }
34347
34348
34349
34350
34351 func (page *UsagesListResultPage) Next() error {
34352 return page.NextWithContext(context.Background())
34353 }
34354
34355
34356 func (page UsagesListResultPage) NotDone() bool {
34357 return !page.ulr.IsEmpty()
34358 }
34359
34360
34361 func (page UsagesListResultPage) Response() UsagesListResult {
34362 return page.ulr
34363 }
34364
34365
34366 func (page UsagesListResultPage) Values() []Usage {
34367 if page.ulr.IsEmpty() {
34368 return nil
34369 }
34370 return *page.ulr.Value
34371 }
34372
34373
34374 func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage {
34375 return UsagesListResultPage{
34376 fn: getNextPage,
34377 ulr: cur,
34378 }
34379 }
34380
34381
34382 type VerificationIPFlowParameters struct {
34383
34384 TargetResourceID *string `json:"targetResourceId,omitempty"`
34385
34386 Direction Direction `json:"direction,omitempty"`
34387
34388 Protocol IPFlowProtocol `json:"protocol,omitempty"`
34389
34390 LocalPort *string `json:"localPort,omitempty"`
34391
34392 RemotePort *string `json:"remotePort,omitempty"`
34393
34394 LocalIPAddress *string `json:"localIPAddress,omitempty"`
34395
34396 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"`
34397
34398 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"`
34399 }
34400
34401
34402 type VerificationIPFlowResult struct {
34403 autorest.Response `json:"-"`
34404
34405 Access Access `json:"access,omitempty"`
34406
34407 RuleName *string `json:"ruleName,omitempty"`
34408 }
34409
34410
34411 type VirtualAppliance struct {
34412 autorest.Response `json:"-"`
34413
34414 *VirtualAppliancePropertiesFormat `json:"properties,omitempty"`
34415
34416 Identity *ManagedServiceIdentity `json:"identity,omitempty"`
34417
34418 Sku *VirtualApplianceSkuProperties `json:"sku,omitempty"`
34419
34420 Etag *string `json:"etag,omitempty"`
34421
34422 ID *string `json:"id,omitempty"`
34423
34424 Name *string `json:"name,omitempty"`
34425
34426 Type *string `json:"type,omitempty"`
34427
34428 Location *string `json:"location,omitempty"`
34429
34430 Tags map[string]*string `json:"tags"`
34431 }
34432
34433
34434 func (va VirtualAppliance) MarshalJSON() ([]byte, error) {
34435 objectMap := make(map[string]interface{})
34436 if va.VirtualAppliancePropertiesFormat != nil {
34437 objectMap["properties"] = va.VirtualAppliancePropertiesFormat
34438 }
34439 if va.Identity != nil {
34440 objectMap["identity"] = va.Identity
34441 }
34442 if va.Sku != nil {
34443 objectMap["sku"] = va.Sku
34444 }
34445 if va.ID != nil {
34446 objectMap["id"] = va.ID
34447 }
34448 if va.Location != nil {
34449 objectMap["location"] = va.Location
34450 }
34451 if va.Tags != nil {
34452 objectMap["tags"] = va.Tags
34453 }
34454 return json.Marshal(objectMap)
34455 }
34456
34457
34458 func (va *VirtualAppliance) UnmarshalJSON(body []byte) error {
34459 var m map[string]*json.RawMessage
34460 err := json.Unmarshal(body, &m)
34461 if err != nil {
34462 return err
34463 }
34464 for k, v := range m {
34465 switch k {
34466 case "properties":
34467 if v != nil {
34468 var virtualAppliancePropertiesFormat VirtualAppliancePropertiesFormat
34469 err = json.Unmarshal(*v, &virtualAppliancePropertiesFormat)
34470 if err != nil {
34471 return err
34472 }
34473 va.VirtualAppliancePropertiesFormat = &virtualAppliancePropertiesFormat
34474 }
34475 case "identity":
34476 if v != nil {
34477 var identity ManagedServiceIdentity
34478 err = json.Unmarshal(*v, &identity)
34479 if err != nil {
34480 return err
34481 }
34482 va.Identity = &identity
34483 }
34484 case "sku":
34485 if v != nil {
34486 var sku VirtualApplianceSkuProperties
34487 err = json.Unmarshal(*v, &sku)
34488 if err != nil {
34489 return err
34490 }
34491 va.Sku = &sku
34492 }
34493 case "etag":
34494 if v != nil {
34495 var etag string
34496 err = json.Unmarshal(*v, &etag)
34497 if err != nil {
34498 return err
34499 }
34500 va.Etag = &etag
34501 }
34502 case "id":
34503 if v != nil {
34504 var ID string
34505 err = json.Unmarshal(*v, &ID)
34506 if err != nil {
34507 return err
34508 }
34509 va.ID = &ID
34510 }
34511 case "name":
34512 if v != nil {
34513 var name string
34514 err = json.Unmarshal(*v, &name)
34515 if err != nil {
34516 return err
34517 }
34518 va.Name = &name
34519 }
34520 case "type":
34521 if v != nil {
34522 var typeVar string
34523 err = json.Unmarshal(*v, &typeVar)
34524 if err != nil {
34525 return err
34526 }
34527 va.Type = &typeVar
34528 }
34529 case "location":
34530 if v != nil {
34531 var location string
34532 err = json.Unmarshal(*v, &location)
34533 if err != nil {
34534 return err
34535 }
34536 va.Location = &location
34537 }
34538 case "tags":
34539 if v != nil {
34540 var tags map[string]*string
34541 err = json.Unmarshal(*v, &tags)
34542 if err != nil {
34543 return err
34544 }
34545 va.Tags = tags
34546 }
34547 }
34548 }
34549
34550 return nil
34551 }
34552
34553
34554 type VirtualApplianceListResult struct {
34555 autorest.Response `json:"-"`
34556
34557 Value *[]VirtualAppliance `json:"value,omitempty"`
34558
34559 NextLink *string `json:"nextLink,omitempty"`
34560 }
34561
34562
34563 type VirtualApplianceListResultIterator struct {
34564 i int
34565 page VirtualApplianceListResultPage
34566 }
34567
34568
34569
34570 func (iter *VirtualApplianceListResultIterator) NextWithContext(ctx context.Context) (err error) {
34571 if tracing.IsEnabled() {
34572 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceListResultIterator.NextWithContext")
34573 defer func() {
34574 sc := -1
34575 if iter.Response().Response.Response != nil {
34576 sc = iter.Response().Response.Response.StatusCode
34577 }
34578 tracing.EndSpan(ctx, sc, err)
34579 }()
34580 }
34581 iter.i++
34582 if iter.i < len(iter.page.Values()) {
34583 return nil
34584 }
34585 err = iter.page.NextWithContext(ctx)
34586 if err != nil {
34587 iter.i--
34588 return err
34589 }
34590 iter.i = 0
34591 return nil
34592 }
34593
34594
34595
34596
34597 func (iter *VirtualApplianceListResultIterator) Next() error {
34598 return iter.NextWithContext(context.Background())
34599 }
34600
34601
34602 func (iter VirtualApplianceListResultIterator) NotDone() bool {
34603 return iter.page.NotDone() && iter.i < len(iter.page.Values())
34604 }
34605
34606
34607 func (iter VirtualApplianceListResultIterator) Response() VirtualApplianceListResult {
34608 return iter.page.Response()
34609 }
34610
34611
34612
34613 func (iter VirtualApplianceListResultIterator) Value() VirtualAppliance {
34614 if !iter.page.NotDone() {
34615 return VirtualAppliance{}
34616 }
34617 return iter.page.Values()[iter.i]
34618 }
34619
34620
34621 func NewVirtualApplianceListResultIterator(page VirtualApplianceListResultPage) VirtualApplianceListResultIterator {
34622 return VirtualApplianceListResultIterator{page: page}
34623 }
34624
34625
34626 func (valr VirtualApplianceListResult) IsEmpty() bool {
34627 return valr.Value == nil || len(*valr.Value) == 0
34628 }
34629
34630
34631 func (valr VirtualApplianceListResult) hasNextLink() bool {
34632 return valr.NextLink != nil && len(*valr.NextLink) != 0
34633 }
34634
34635
34636
34637 func (valr VirtualApplianceListResult) virtualApplianceListResultPreparer(ctx context.Context) (*http.Request, error) {
34638 if !valr.hasNextLink() {
34639 return nil, nil
34640 }
34641 return autorest.Prepare((&http.Request{}).WithContext(ctx),
34642 autorest.AsJSON(),
34643 autorest.AsGet(),
34644 autorest.WithBaseURL(to.String(valr.NextLink)))
34645 }
34646
34647
34648 type VirtualApplianceListResultPage struct {
34649 fn func(context.Context, VirtualApplianceListResult) (VirtualApplianceListResult, error)
34650 valr VirtualApplianceListResult
34651 }
34652
34653
34654
34655 func (page *VirtualApplianceListResultPage) NextWithContext(ctx context.Context) (err error) {
34656 if tracing.IsEnabled() {
34657 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualApplianceListResultPage.NextWithContext")
34658 defer func() {
34659 sc := -1
34660 if page.Response().Response.Response != nil {
34661 sc = page.Response().Response.Response.StatusCode
34662 }
34663 tracing.EndSpan(ctx, sc, err)
34664 }()
34665 }
34666 for {
34667 next, err := page.fn(ctx, page.valr)
34668 if err != nil {
34669 return err
34670 }
34671 page.valr = next
34672 if !next.hasNextLink() || !next.IsEmpty() {
34673 break
34674 }
34675 }
34676 return nil
34677 }
34678
34679
34680
34681
34682 func (page *VirtualApplianceListResultPage) Next() error {
34683 return page.NextWithContext(context.Background())
34684 }
34685
34686
34687 func (page VirtualApplianceListResultPage) NotDone() bool {
34688 return !page.valr.IsEmpty()
34689 }
34690
34691
34692 func (page VirtualApplianceListResultPage) Response() VirtualApplianceListResult {
34693 return page.valr
34694 }
34695
34696
34697 func (page VirtualApplianceListResultPage) Values() []VirtualAppliance {
34698 if page.valr.IsEmpty() {
34699 return nil
34700 }
34701 return *page.valr.Value
34702 }
34703
34704
34705 func NewVirtualApplianceListResultPage(cur VirtualApplianceListResult, getNextPage func(context.Context, VirtualApplianceListResult) (VirtualApplianceListResult, error)) VirtualApplianceListResultPage {
34706 return VirtualApplianceListResultPage{
34707 fn: getNextPage,
34708 valr: cur,
34709 }
34710 }
34711
34712
34713 type VirtualApplianceNicProperties struct {
34714
34715 Name *string `json:"name,omitempty"`
34716
34717 PublicIPAddress *string `json:"publicIpAddress,omitempty"`
34718
34719 PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
34720 }
34721
34722
34723 func (vanp VirtualApplianceNicProperties) MarshalJSON() ([]byte, error) {
34724 objectMap := make(map[string]interface{})
34725 return json.Marshal(objectMap)
34726 }
34727
34728
34729 type VirtualAppliancePropertiesFormat struct {
34730
34731 BootStrapConfigurationBlob *[]string `json:"bootStrapConfigurationBlob,omitempty"`
34732
34733 VirtualHub *SubResource `json:"virtualHub,omitempty"`
34734
34735 CloudInitConfigurationBlob *[]string `json:"cloudInitConfigurationBlob,omitempty"`
34736
34737 VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"`
34738
34739 VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"`
34740
34741 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
34742 }
34743
34744
34745 func (vapf VirtualAppliancePropertiesFormat) MarshalJSON() ([]byte, error) {
34746 objectMap := make(map[string]interface{})
34747 if vapf.BootStrapConfigurationBlob != nil {
34748 objectMap["bootStrapConfigurationBlob"] = vapf.BootStrapConfigurationBlob
34749 }
34750 if vapf.VirtualHub != nil {
34751 objectMap["virtualHub"] = vapf.VirtualHub
34752 }
34753 if vapf.CloudInitConfigurationBlob != nil {
34754 objectMap["cloudInitConfigurationBlob"] = vapf.CloudInitConfigurationBlob
34755 }
34756 if vapf.VirtualApplianceAsn != nil {
34757 objectMap["virtualApplianceAsn"] = vapf.VirtualApplianceAsn
34758 }
34759 return json.Marshal(objectMap)
34760 }
34761
34762
34763
34764 type VirtualAppliancesCreateOrUpdateFuture struct {
34765 azure.FutureAPI
34766
34767
34768 Result func(VirtualAppliancesClient) (VirtualAppliance, error)
34769 }
34770
34771
34772 func (future *VirtualAppliancesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
34773 var azFuture azure.Future
34774 if err := json.Unmarshal(body, &azFuture); err != nil {
34775 return err
34776 }
34777 future.FutureAPI = &azFuture
34778 future.Result = future.result
34779 return nil
34780 }
34781
34782
34783 func (future *VirtualAppliancesCreateOrUpdateFuture) result(client VirtualAppliancesClient) (va VirtualAppliance, err error) {
34784 var done bool
34785 done, err = future.DoneWithContext(context.Background(), client)
34786 if err != nil {
34787 err = autorest.NewErrorWithError(err, "network.VirtualAppliancesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
34788 return
34789 }
34790 if !done {
34791 va.Response.Response = future.Response()
34792 err = azure.NewAsyncOpIncompleteError("network.VirtualAppliancesCreateOrUpdateFuture")
34793 return
34794 }
34795 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
34796 if va.Response.Response, err = future.GetResult(sender); err == nil && va.Response.Response.StatusCode != http.StatusNoContent {
34797 va, err = client.CreateOrUpdateResponder(va.Response.Response)
34798 if err != nil {
34799 err = autorest.NewErrorWithError(err, "network.VirtualAppliancesCreateOrUpdateFuture", "Result", va.Response.Response, "Failure responding to request")
34800 }
34801 }
34802 return
34803 }
34804
34805
34806
34807 type VirtualAppliancesDeleteFuture struct {
34808 azure.FutureAPI
34809
34810
34811 Result func(VirtualAppliancesClient) (autorest.Response, error)
34812 }
34813
34814
34815 func (future *VirtualAppliancesDeleteFuture) UnmarshalJSON(body []byte) error {
34816 var azFuture azure.Future
34817 if err := json.Unmarshal(body, &azFuture); err != nil {
34818 return err
34819 }
34820 future.FutureAPI = &azFuture
34821 future.Result = future.result
34822 return nil
34823 }
34824
34825
34826 func (future *VirtualAppliancesDeleteFuture) result(client VirtualAppliancesClient) (ar autorest.Response, err error) {
34827 var done bool
34828 done, err = future.DoneWithContext(context.Background(), client)
34829 if err != nil {
34830 err = autorest.NewErrorWithError(err, "network.VirtualAppliancesDeleteFuture", "Result", future.Response(), "Polling failure")
34831 return
34832 }
34833 if !done {
34834 ar.Response = future.Response()
34835 err = azure.NewAsyncOpIncompleteError("network.VirtualAppliancesDeleteFuture")
34836 return
34837 }
34838 ar.Response = future.Response()
34839 return
34840 }
34841
34842
34843 type VirtualApplianceSkuProperties struct {
34844
34845 Vendor *string `json:"vendor,omitempty"`
34846
34847 BundledScaleUnit *string `json:"bundledScaleUnit,omitempty"`
34848
34849 MarketPlaceVersion *string `json:"marketPlaceVersion,omitempty"`
34850 }
34851
34852
34853 type VirtualHub struct {
34854 autorest.Response `json:"-"`
34855
34856 *VirtualHubProperties `json:"properties,omitempty"`
34857
34858 Etag *string `json:"etag,omitempty"`
34859
34860 ID *string `json:"id,omitempty"`
34861
34862 Name *string `json:"name,omitempty"`
34863
34864 Type *string `json:"type,omitempty"`
34865
34866 Location *string `json:"location,omitempty"`
34867
34868 Tags map[string]*string `json:"tags"`
34869 }
34870
34871
34872 func (vh VirtualHub) MarshalJSON() ([]byte, error) {
34873 objectMap := make(map[string]interface{})
34874 if vh.VirtualHubProperties != nil {
34875 objectMap["properties"] = vh.VirtualHubProperties
34876 }
34877 if vh.ID != nil {
34878 objectMap["id"] = vh.ID
34879 }
34880 if vh.Location != nil {
34881 objectMap["location"] = vh.Location
34882 }
34883 if vh.Tags != nil {
34884 objectMap["tags"] = vh.Tags
34885 }
34886 return json.Marshal(objectMap)
34887 }
34888
34889
34890 func (vh *VirtualHub) UnmarshalJSON(body []byte) error {
34891 var m map[string]*json.RawMessage
34892 err := json.Unmarshal(body, &m)
34893 if err != nil {
34894 return err
34895 }
34896 for k, v := range m {
34897 switch k {
34898 case "properties":
34899 if v != nil {
34900 var virtualHubProperties VirtualHubProperties
34901 err = json.Unmarshal(*v, &virtualHubProperties)
34902 if err != nil {
34903 return err
34904 }
34905 vh.VirtualHubProperties = &virtualHubProperties
34906 }
34907 case "etag":
34908 if v != nil {
34909 var etag string
34910 err = json.Unmarshal(*v, &etag)
34911 if err != nil {
34912 return err
34913 }
34914 vh.Etag = &etag
34915 }
34916 case "id":
34917 if v != nil {
34918 var ID string
34919 err = json.Unmarshal(*v, &ID)
34920 if err != nil {
34921 return err
34922 }
34923 vh.ID = &ID
34924 }
34925 case "name":
34926 if v != nil {
34927 var name string
34928 err = json.Unmarshal(*v, &name)
34929 if err != nil {
34930 return err
34931 }
34932 vh.Name = &name
34933 }
34934 case "type":
34935 if v != nil {
34936 var typeVar string
34937 err = json.Unmarshal(*v, &typeVar)
34938 if err != nil {
34939 return err
34940 }
34941 vh.Type = &typeVar
34942 }
34943 case "location":
34944 if v != nil {
34945 var location string
34946 err = json.Unmarshal(*v, &location)
34947 if err != nil {
34948 return err
34949 }
34950 vh.Location = &location
34951 }
34952 case "tags":
34953 if v != nil {
34954 var tags map[string]*string
34955 err = json.Unmarshal(*v, &tags)
34956 if err != nil {
34957 return err
34958 }
34959 vh.Tags = tags
34960 }
34961 }
34962 }
34963
34964 return nil
34965 }
34966
34967
34968 type VirtualHubID struct {
34969
34970 ID *string `json:"id,omitempty"`
34971 }
34972
34973
34974 type VirtualHubProperties struct {
34975
34976 VirtualWan *SubResource `json:"virtualWan,omitempty"`
34977
34978 VpnGateway *SubResource `json:"vpnGateway,omitempty"`
34979
34980 P2SVpnGateway *SubResource `json:"p2SVpnGateway,omitempty"`
34981
34982 ExpressRouteGateway *SubResource `json:"expressRouteGateway,omitempty"`
34983
34984 AzureFirewall *SubResource `json:"azureFirewall,omitempty"`
34985
34986 SecurityPartnerProvider *SubResource `json:"securityPartnerProvider,omitempty"`
34987
34988 VirtualNetworkConnections *[]HubVirtualNetworkConnection `json:"virtualNetworkConnections,omitempty"`
34989
34990 AddressPrefix *string `json:"addressPrefix,omitempty"`
34991
34992 RouteTable *VirtualHubRouteTable `json:"routeTable,omitempty"`
34993
34994 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
34995
34996 SecurityProviderName *string `json:"securityProviderName,omitempty"`
34997
34998 VirtualHubRouteTableV2s *[]VirtualHubRouteTableV2 `json:"virtualHubRouteTableV2s,omitempty"`
34999
35000 Sku *string `json:"sku,omitempty"`
35001 }
35002
35003
35004 func (vhp VirtualHubProperties) MarshalJSON() ([]byte, error) {
35005 objectMap := make(map[string]interface{})
35006 if vhp.VirtualWan != nil {
35007 objectMap["virtualWan"] = vhp.VirtualWan
35008 }
35009 if vhp.VpnGateway != nil {
35010 objectMap["vpnGateway"] = vhp.VpnGateway
35011 }
35012 if vhp.P2SVpnGateway != nil {
35013 objectMap["p2SVpnGateway"] = vhp.P2SVpnGateway
35014 }
35015 if vhp.ExpressRouteGateway != nil {
35016 objectMap["expressRouteGateway"] = vhp.ExpressRouteGateway
35017 }
35018 if vhp.AzureFirewall != nil {
35019 objectMap["azureFirewall"] = vhp.AzureFirewall
35020 }
35021 if vhp.SecurityPartnerProvider != nil {
35022 objectMap["securityPartnerProvider"] = vhp.SecurityPartnerProvider
35023 }
35024 if vhp.VirtualNetworkConnections != nil {
35025 objectMap["virtualNetworkConnections"] = vhp.VirtualNetworkConnections
35026 }
35027 if vhp.AddressPrefix != nil {
35028 objectMap["addressPrefix"] = vhp.AddressPrefix
35029 }
35030 if vhp.RouteTable != nil {
35031 objectMap["routeTable"] = vhp.RouteTable
35032 }
35033 if vhp.SecurityProviderName != nil {
35034 objectMap["securityProviderName"] = vhp.SecurityProviderName
35035 }
35036 if vhp.VirtualHubRouteTableV2s != nil {
35037 objectMap["virtualHubRouteTableV2s"] = vhp.VirtualHubRouteTableV2s
35038 }
35039 if vhp.Sku != nil {
35040 objectMap["sku"] = vhp.Sku
35041 }
35042 return json.Marshal(objectMap)
35043 }
35044
35045
35046 type VirtualHubRoute struct {
35047
35048 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"`
35049
35050 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"`
35051 }
35052
35053
35054 type VirtualHubRouteTable struct {
35055
35056 Routes *[]VirtualHubRoute `json:"routes,omitempty"`
35057 }
35058
35059
35060 type VirtualHubRouteTableV2 struct {
35061 autorest.Response `json:"-"`
35062
35063 *VirtualHubRouteTableV2Properties `json:"properties,omitempty"`
35064
35065 Name *string `json:"name,omitempty"`
35066
35067 Etag *string `json:"etag,omitempty"`
35068
35069 ID *string `json:"id,omitempty"`
35070 }
35071
35072
35073 func (vhrtv VirtualHubRouteTableV2) MarshalJSON() ([]byte, error) {
35074 objectMap := make(map[string]interface{})
35075 if vhrtv.VirtualHubRouteTableV2Properties != nil {
35076 objectMap["properties"] = vhrtv.VirtualHubRouteTableV2Properties
35077 }
35078 if vhrtv.Name != nil {
35079 objectMap["name"] = vhrtv.Name
35080 }
35081 if vhrtv.ID != nil {
35082 objectMap["id"] = vhrtv.ID
35083 }
35084 return json.Marshal(objectMap)
35085 }
35086
35087
35088 func (vhrtv *VirtualHubRouteTableV2) UnmarshalJSON(body []byte) error {
35089 var m map[string]*json.RawMessage
35090 err := json.Unmarshal(body, &m)
35091 if err != nil {
35092 return err
35093 }
35094 for k, v := range m {
35095 switch k {
35096 case "properties":
35097 if v != nil {
35098 var virtualHubRouteTableV2Properties VirtualHubRouteTableV2Properties
35099 err = json.Unmarshal(*v, &virtualHubRouteTableV2Properties)
35100 if err != nil {
35101 return err
35102 }
35103 vhrtv.VirtualHubRouteTableV2Properties = &virtualHubRouteTableV2Properties
35104 }
35105 case "name":
35106 if v != nil {
35107 var name string
35108 err = json.Unmarshal(*v, &name)
35109 if err != nil {
35110 return err
35111 }
35112 vhrtv.Name = &name
35113 }
35114 case "etag":
35115 if v != nil {
35116 var etag string
35117 err = json.Unmarshal(*v, &etag)
35118 if err != nil {
35119 return err
35120 }
35121 vhrtv.Etag = &etag
35122 }
35123 case "id":
35124 if v != nil {
35125 var ID string
35126 err = json.Unmarshal(*v, &ID)
35127 if err != nil {
35128 return err
35129 }
35130 vhrtv.ID = &ID
35131 }
35132 }
35133 }
35134
35135 return nil
35136 }
35137
35138
35139 type VirtualHubRouteTableV2Properties struct {
35140
35141 Routes *[]VirtualHubRouteV2 `json:"routes,omitempty"`
35142
35143 AttachedConnections *[]string `json:"attachedConnections,omitempty"`
35144
35145 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
35146 }
35147
35148
35149 func (vhrtvp VirtualHubRouteTableV2Properties) MarshalJSON() ([]byte, error) {
35150 objectMap := make(map[string]interface{})
35151 if vhrtvp.Routes != nil {
35152 objectMap["routes"] = vhrtvp.Routes
35153 }
35154 if vhrtvp.AttachedConnections != nil {
35155 objectMap["attachedConnections"] = vhrtvp.AttachedConnections
35156 }
35157 return json.Marshal(objectMap)
35158 }
35159
35160
35161
35162 type VirtualHubRouteTableV2sCreateOrUpdateFuture struct {
35163 azure.FutureAPI
35164
35165
35166 Result func(VirtualHubRouteTableV2sClient) (VirtualHubRouteTableV2, error)
35167 }
35168
35169
35170 func (future *VirtualHubRouteTableV2sCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
35171 var azFuture azure.Future
35172 if err := json.Unmarshal(body, &azFuture); err != nil {
35173 return err
35174 }
35175 future.FutureAPI = &azFuture
35176 future.Result = future.result
35177 return nil
35178 }
35179
35180
35181 func (future *VirtualHubRouteTableV2sCreateOrUpdateFuture) result(client VirtualHubRouteTableV2sClient) (vhrtv VirtualHubRouteTableV2, err error) {
35182 var done bool
35183 done, err = future.DoneWithContext(context.Background(), client)
35184 if err != nil {
35185 err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
35186 return
35187 }
35188 if !done {
35189 vhrtv.Response.Response = future.Response()
35190 err = azure.NewAsyncOpIncompleteError("network.VirtualHubRouteTableV2sCreateOrUpdateFuture")
35191 return
35192 }
35193 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
35194 if vhrtv.Response.Response, err = future.GetResult(sender); err == nil && vhrtv.Response.Response.StatusCode != http.StatusNoContent {
35195 vhrtv, err = client.CreateOrUpdateResponder(vhrtv.Response.Response)
35196 if err != nil {
35197 err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sCreateOrUpdateFuture", "Result", vhrtv.Response.Response, "Failure responding to request")
35198 }
35199 }
35200 return
35201 }
35202
35203
35204
35205 type VirtualHubRouteTableV2sDeleteFuture struct {
35206 azure.FutureAPI
35207
35208
35209 Result func(VirtualHubRouteTableV2sClient) (autorest.Response, error)
35210 }
35211
35212
35213 func (future *VirtualHubRouteTableV2sDeleteFuture) UnmarshalJSON(body []byte) error {
35214 var azFuture azure.Future
35215 if err := json.Unmarshal(body, &azFuture); err != nil {
35216 return err
35217 }
35218 future.FutureAPI = &azFuture
35219 future.Result = future.result
35220 return nil
35221 }
35222
35223
35224 func (future *VirtualHubRouteTableV2sDeleteFuture) result(client VirtualHubRouteTableV2sClient) (ar autorest.Response, err error) {
35225 var done bool
35226 done, err = future.DoneWithContext(context.Background(), client)
35227 if err != nil {
35228 err = autorest.NewErrorWithError(err, "network.VirtualHubRouteTableV2sDeleteFuture", "Result", future.Response(), "Polling failure")
35229 return
35230 }
35231 if !done {
35232 ar.Response = future.Response()
35233 err = azure.NewAsyncOpIncompleteError("network.VirtualHubRouteTableV2sDeleteFuture")
35234 return
35235 }
35236 ar.Response = future.Response()
35237 return
35238 }
35239
35240
35241 type VirtualHubRouteV2 struct {
35242
35243 DestinationType *string `json:"destinationType,omitempty"`
35244
35245 Destinations *[]string `json:"destinations,omitempty"`
35246
35247 NextHopType *string `json:"nextHopType,omitempty"`
35248
35249 NextHops *[]string `json:"nextHops,omitempty"`
35250 }
35251
35252
35253
35254 type VirtualHubsCreateOrUpdateFuture struct {
35255 azure.FutureAPI
35256
35257
35258 Result func(VirtualHubsClient) (VirtualHub, error)
35259 }
35260
35261
35262 func (future *VirtualHubsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
35263 var azFuture azure.Future
35264 if err := json.Unmarshal(body, &azFuture); err != nil {
35265 return err
35266 }
35267 future.FutureAPI = &azFuture
35268 future.Result = future.result
35269 return nil
35270 }
35271
35272
35273 func (future *VirtualHubsCreateOrUpdateFuture) result(client VirtualHubsClient) (vh VirtualHub, err error) {
35274 var done bool
35275 done, err = future.DoneWithContext(context.Background(), client)
35276 if err != nil {
35277 err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
35278 return
35279 }
35280 if !done {
35281 vh.Response.Response = future.Response()
35282 err = azure.NewAsyncOpIncompleteError("network.VirtualHubsCreateOrUpdateFuture")
35283 return
35284 }
35285 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
35286 if vh.Response.Response, err = future.GetResult(sender); err == nil && vh.Response.Response.StatusCode != http.StatusNoContent {
35287 vh, err = client.CreateOrUpdateResponder(vh.Response.Response)
35288 if err != nil {
35289 err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", vh.Response.Response, "Failure responding to request")
35290 }
35291 }
35292 return
35293 }
35294
35295
35296
35297 type VirtualHubsDeleteFuture struct {
35298 azure.FutureAPI
35299
35300
35301 Result func(VirtualHubsClient) (autorest.Response, error)
35302 }
35303
35304
35305 func (future *VirtualHubsDeleteFuture) UnmarshalJSON(body []byte) error {
35306 var azFuture azure.Future
35307 if err := json.Unmarshal(body, &azFuture); err != nil {
35308 return err
35309 }
35310 future.FutureAPI = &azFuture
35311 future.Result = future.result
35312 return nil
35313 }
35314
35315
35316 func (future *VirtualHubsDeleteFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) {
35317 var done bool
35318 done, err = future.DoneWithContext(context.Background(), client)
35319 if err != nil {
35320 err = autorest.NewErrorWithError(err, "network.VirtualHubsDeleteFuture", "Result", future.Response(), "Polling failure")
35321 return
35322 }
35323 if !done {
35324 ar.Response = future.Response()
35325 err = azure.NewAsyncOpIncompleteError("network.VirtualHubsDeleteFuture")
35326 return
35327 }
35328 ar.Response = future.Response()
35329 return
35330 }
35331
35332
35333 type VirtualNetwork struct {
35334 autorest.Response `json:"-"`
35335
35336 *VirtualNetworkPropertiesFormat `json:"properties,omitempty"`
35337
35338 Etag *string `json:"etag,omitempty"`
35339
35340 ID *string `json:"id,omitempty"`
35341
35342 Name *string `json:"name,omitempty"`
35343
35344 Type *string `json:"type,omitempty"`
35345
35346 Location *string `json:"location,omitempty"`
35347
35348 Tags map[string]*string `json:"tags"`
35349 }
35350
35351
35352 func (vn VirtualNetwork) MarshalJSON() ([]byte, error) {
35353 objectMap := make(map[string]interface{})
35354 if vn.VirtualNetworkPropertiesFormat != nil {
35355 objectMap["properties"] = vn.VirtualNetworkPropertiesFormat
35356 }
35357 if vn.ID != nil {
35358 objectMap["id"] = vn.ID
35359 }
35360 if vn.Location != nil {
35361 objectMap["location"] = vn.Location
35362 }
35363 if vn.Tags != nil {
35364 objectMap["tags"] = vn.Tags
35365 }
35366 return json.Marshal(objectMap)
35367 }
35368
35369
35370 func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error {
35371 var m map[string]*json.RawMessage
35372 err := json.Unmarshal(body, &m)
35373 if err != nil {
35374 return err
35375 }
35376 for k, v := range m {
35377 switch k {
35378 case "properties":
35379 if v != nil {
35380 var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat
35381 err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat)
35382 if err != nil {
35383 return err
35384 }
35385 vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat
35386 }
35387 case "etag":
35388 if v != nil {
35389 var etag string
35390 err = json.Unmarshal(*v, &etag)
35391 if err != nil {
35392 return err
35393 }
35394 vn.Etag = &etag
35395 }
35396 case "id":
35397 if v != nil {
35398 var ID string
35399 err = json.Unmarshal(*v, &ID)
35400 if err != nil {
35401 return err
35402 }
35403 vn.ID = &ID
35404 }
35405 case "name":
35406 if v != nil {
35407 var name string
35408 err = json.Unmarshal(*v, &name)
35409 if err != nil {
35410 return err
35411 }
35412 vn.Name = &name
35413 }
35414 case "type":
35415 if v != nil {
35416 var typeVar string
35417 err = json.Unmarshal(*v, &typeVar)
35418 if err != nil {
35419 return err
35420 }
35421 vn.Type = &typeVar
35422 }
35423 case "location":
35424 if v != nil {
35425 var location string
35426 err = json.Unmarshal(*v, &location)
35427 if err != nil {
35428 return err
35429 }
35430 vn.Location = &location
35431 }
35432 case "tags":
35433 if v != nil {
35434 var tags map[string]*string
35435 err = json.Unmarshal(*v, &tags)
35436 if err != nil {
35437 return err
35438 }
35439 vn.Tags = tags
35440 }
35441 }
35442 }
35443
35444 return nil
35445 }
35446
35447
35448
35449 type VirtualNetworkBgpCommunities struct {
35450
35451 VirtualNetworkCommunity *string `json:"virtualNetworkCommunity,omitempty"`
35452
35453 RegionalCommunity *string `json:"regionalCommunity,omitempty"`
35454 }
35455
35456
35457 func (vnbc VirtualNetworkBgpCommunities) MarshalJSON() ([]byte, error) {
35458 objectMap := make(map[string]interface{})
35459 if vnbc.VirtualNetworkCommunity != nil {
35460 objectMap["virtualNetworkCommunity"] = vnbc.VirtualNetworkCommunity
35461 }
35462 return json.Marshal(objectMap)
35463 }
35464
35465
35466
35467 type VirtualNetworkConnectionGatewayReference struct {
35468
35469 ID *string `json:"id,omitempty"`
35470 }
35471
35472
35473 type VirtualNetworkGateway struct {
35474 autorest.Response `json:"-"`
35475
35476 *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"`
35477
35478 Etag *string `json:"etag,omitempty"`
35479
35480 ID *string `json:"id,omitempty"`
35481
35482 Name *string `json:"name,omitempty"`
35483
35484 Type *string `json:"type,omitempty"`
35485
35486 Location *string `json:"location,omitempty"`
35487
35488 Tags map[string]*string `json:"tags"`
35489 }
35490
35491
35492 func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) {
35493 objectMap := make(map[string]interface{})
35494 if vng.VirtualNetworkGatewayPropertiesFormat != nil {
35495 objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat
35496 }
35497 if vng.ID != nil {
35498 objectMap["id"] = vng.ID
35499 }
35500 if vng.Location != nil {
35501 objectMap["location"] = vng.Location
35502 }
35503 if vng.Tags != nil {
35504 objectMap["tags"] = vng.Tags
35505 }
35506 return json.Marshal(objectMap)
35507 }
35508
35509
35510 func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error {
35511 var m map[string]*json.RawMessage
35512 err := json.Unmarshal(body, &m)
35513 if err != nil {
35514 return err
35515 }
35516 for k, v := range m {
35517 switch k {
35518 case "properties":
35519 if v != nil {
35520 var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat
35521 err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat)
35522 if err != nil {
35523 return err
35524 }
35525 vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat
35526 }
35527 case "etag":
35528 if v != nil {
35529 var etag string
35530 err = json.Unmarshal(*v, &etag)
35531 if err != nil {
35532 return err
35533 }
35534 vng.Etag = &etag
35535 }
35536 case "id":
35537 if v != nil {
35538 var ID string
35539 err = json.Unmarshal(*v, &ID)
35540 if err != nil {
35541 return err
35542 }
35543 vng.ID = &ID
35544 }
35545 case "name":
35546 if v != nil {
35547 var name string
35548 err = json.Unmarshal(*v, &name)
35549 if err != nil {
35550 return err
35551 }
35552 vng.Name = &name
35553 }
35554 case "type":
35555 if v != nil {
35556 var typeVar string
35557 err = json.Unmarshal(*v, &typeVar)
35558 if err != nil {
35559 return err
35560 }
35561 vng.Type = &typeVar
35562 }
35563 case "location":
35564 if v != nil {
35565 var location string
35566 err = json.Unmarshal(*v, &location)
35567 if err != nil {
35568 return err
35569 }
35570 vng.Location = &location
35571 }
35572 case "tags":
35573 if v != nil {
35574 var tags map[string]*string
35575 err = json.Unmarshal(*v, &tags)
35576 if err != nil {
35577 return err
35578 }
35579 vng.Tags = tags
35580 }
35581 }
35582 }
35583
35584 return nil
35585 }
35586
35587
35588 type VirtualNetworkGatewayConnection struct {
35589 autorest.Response `json:"-"`
35590
35591 *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"`
35592
35593 Etag *string `json:"etag,omitempty"`
35594
35595 ID *string `json:"id,omitempty"`
35596
35597 Name *string `json:"name,omitempty"`
35598
35599 Type *string `json:"type,omitempty"`
35600
35601 Location *string `json:"location,omitempty"`
35602
35603 Tags map[string]*string `json:"tags"`
35604 }
35605
35606
35607 func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) {
35608 objectMap := make(map[string]interface{})
35609 if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil {
35610 objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat
35611 }
35612 if vngc.ID != nil {
35613 objectMap["id"] = vngc.ID
35614 }
35615 if vngc.Location != nil {
35616 objectMap["location"] = vngc.Location
35617 }
35618 if vngc.Tags != nil {
35619 objectMap["tags"] = vngc.Tags
35620 }
35621 return json.Marshal(objectMap)
35622 }
35623
35624
35625 func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error {
35626 var m map[string]*json.RawMessage
35627 err := json.Unmarshal(body, &m)
35628 if err != nil {
35629 return err
35630 }
35631 for k, v := range m {
35632 switch k {
35633 case "properties":
35634 if v != nil {
35635 var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat
35636 err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat)
35637 if err != nil {
35638 return err
35639 }
35640 vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat
35641 }
35642 case "etag":
35643 if v != nil {
35644 var etag string
35645 err = json.Unmarshal(*v, &etag)
35646 if err != nil {
35647 return err
35648 }
35649 vngc.Etag = &etag
35650 }
35651 case "id":
35652 if v != nil {
35653 var ID string
35654 err = json.Unmarshal(*v, &ID)
35655 if err != nil {
35656 return err
35657 }
35658 vngc.ID = &ID
35659 }
35660 case "name":
35661 if v != nil {
35662 var name string
35663 err = json.Unmarshal(*v, &name)
35664 if err != nil {
35665 return err
35666 }
35667 vngc.Name = &name
35668 }
35669 case "type":
35670 if v != nil {
35671 var typeVar string
35672 err = json.Unmarshal(*v, &typeVar)
35673 if err != nil {
35674 return err
35675 }
35676 vngc.Type = &typeVar
35677 }
35678 case "location":
35679 if v != nil {
35680 var location string
35681 err = json.Unmarshal(*v, &location)
35682 if err != nil {
35683 return err
35684 }
35685 vngc.Location = &location
35686 }
35687 case "tags":
35688 if v != nil {
35689 var tags map[string]*string
35690 err = json.Unmarshal(*v, &tags)
35691 if err != nil {
35692 return err
35693 }
35694 vngc.Tags = tags
35695 }
35696 }
35697 }
35698
35699 return nil
35700 }
35701
35702
35703 type VirtualNetworkGatewayConnectionListEntity struct {
35704
35705 *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"`
35706
35707 Etag *string `json:"etag,omitempty"`
35708
35709 ID *string `json:"id,omitempty"`
35710
35711 Name *string `json:"name,omitempty"`
35712
35713 Type *string `json:"type,omitempty"`
35714
35715 Location *string `json:"location,omitempty"`
35716
35717 Tags map[string]*string `json:"tags"`
35718 }
35719
35720
35721 func (vngcle VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, error) {
35722 objectMap := make(map[string]interface{})
35723 if vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat != nil {
35724 objectMap["properties"] = vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat
35725 }
35726 if vngcle.ID != nil {
35727 objectMap["id"] = vngcle.ID
35728 }
35729 if vngcle.Location != nil {
35730 objectMap["location"] = vngcle.Location
35731 }
35732 if vngcle.Tags != nil {
35733 objectMap["tags"] = vngcle.Tags
35734 }
35735 return json.Marshal(objectMap)
35736 }
35737
35738
35739 func (vngcle *VirtualNetworkGatewayConnectionListEntity) UnmarshalJSON(body []byte) error {
35740 var m map[string]*json.RawMessage
35741 err := json.Unmarshal(body, &m)
35742 if err != nil {
35743 return err
35744 }
35745 for k, v := range m {
35746 switch k {
35747 case "properties":
35748 if v != nil {
35749 var virtualNetworkGatewayConnectionListEntityPropertiesFormat VirtualNetworkGatewayConnectionListEntityPropertiesFormat
35750 err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionListEntityPropertiesFormat)
35751 if err != nil {
35752 return err
35753 }
35754 vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat = &virtualNetworkGatewayConnectionListEntityPropertiesFormat
35755 }
35756 case "etag":
35757 if v != nil {
35758 var etag string
35759 err = json.Unmarshal(*v, &etag)
35760 if err != nil {
35761 return err
35762 }
35763 vngcle.Etag = &etag
35764 }
35765 case "id":
35766 if v != nil {
35767 var ID string
35768 err = json.Unmarshal(*v, &ID)
35769 if err != nil {
35770 return err
35771 }
35772 vngcle.ID = &ID
35773 }
35774 case "name":
35775 if v != nil {
35776 var name string
35777 err = json.Unmarshal(*v, &name)
35778 if err != nil {
35779 return err
35780 }
35781 vngcle.Name = &name
35782 }
35783 case "type":
35784 if v != nil {
35785 var typeVar string
35786 err = json.Unmarshal(*v, &typeVar)
35787 if err != nil {
35788 return err
35789 }
35790 vngcle.Type = &typeVar
35791 }
35792 case "location":
35793 if v != nil {
35794 var location string
35795 err = json.Unmarshal(*v, &location)
35796 if err != nil {
35797 return err
35798 }
35799 vngcle.Location = &location
35800 }
35801 case "tags":
35802 if v != nil {
35803 var tags map[string]*string
35804 err = json.Unmarshal(*v, &tags)
35805 if err != nil {
35806 return err
35807 }
35808 vngcle.Tags = tags
35809 }
35810 }
35811 }
35812
35813 return nil
35814 }
35815
35816
35817 type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct {
35818
35819 AuthorizationKey *string `json:"authorizationKey,omitempty"`
35820
35821 VirtualNetworkGateway1 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1,omitempty"`
35822
35823 VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"`
35824
35825 LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"`
35826
35827 ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"`
35828
35829 ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"`
35830
35831 RoutingWeight *int32 `json:"routingWeight,omitempty"`
35832
35833 SharedKey *string `json:"sharedKey,omitempty"`
35834
35835 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
35836
35837 TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"`
35838
35839 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
35840
35841 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
35842
35843 Peer *SubResource `json:"peer,omitempty"`
35844
35845 EnableBgp *bool `json:"enableBgp,omitempty"`
35846
35847 UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"`
35848
35849 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"`
35850
35851 TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"`
35852
35853 ResourceGUID *string `json:"resourceGuid,omitempty"`
35854
35855 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
35856
35857 ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"`
35858 }
35859
35860
35861 func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) {
35862 objectMap := make(map[string]interface{})
35863 if vngclepf.AuthorizationKey != nil {
35864 objectMap["authorizationKey"] = vngclepf.AuthorizationKey
35865 }
35866 if vngclepf.VirtualNetworkGateway1 != nil {
35867 objectMap["virtualNetworkGateway1"] = vngclepf.VirtualNetworkGateway1
35868 }
35869 if vngclepf.VirtualNetworkGateway2 != nil {
35870 objectMap["virtualNetworkGateway2"] = vngclepf.VirtualNetworkGateway2
35871 }
35872 if vngclepf.LocalNetworkGateway2 != nil {
35873 objectMap["localNetworkGateway2"] = vngclepf.LocalNetworkGateway2
35874 }
35875 if vngclepf.ConnectionType != "" {
35876 objectMap["connectionType"] = vngclepf.ConnectionType
35877 }
35878 if vngclepf.ConnectionProtocol != "" {
35879 objectMap["connectionProtocol"] = vngclepf.ConnectionProtocol
35880 }
35881 if vngclepf.RoutingWeight != nil {
35882 objectMap["routingWeight"] = vngclepf.RoutingWeight
35883 }
35884 if vngclepf.SharedKey != nil {
35885 objectMap["sharedKey"] = vngclepf.SharedKey
35886 }
35887 if vngclepf.Peer != nil {
35888 objectMap["peer"] = vngclepf.Peer
35889 }
35890 if vngclepf.EnableBgp != nil {
35891 objectMap["enableBgp"] = vngclepf.EnableBgp
35892 }
35893 if vngclepf.UsePolicyBasedTrafficSelectors != nil {
35894 objectMap["usePolicyBasedTrafficSelectors"] = vngclepf.UsePolicyBasedTrafficSelectors
35895 }
35896 if vngclepf.IpsecPolicies != nil {
35897 objectMap["ipsecPolicies"] = vngclepf.IpsecPolicies
35898 }
35899 if vngclepf.TrafficSelectorPolicies != nil {
35900 objectMap["trafficSelectorPolicies"] = vngclepf.TrafficSelectorPolicies
35901 }
35902 if vngclepf.ExpressRouteGatewayBypass != nil {
35903 objectMap["expressRouteGatewayBypass"] = vngclepf.ExpressRouteGatewayBypass
35904 }
35905 return json.Marshal(objectMap)
35906 }
35907
35908
35909
35910 type VirtualNetworkGatewayConnectionListResult struct {
35911 autorest.Response `json:"-"`
35912
35913 Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"`
35914
35915 NextLink *string `json:"nextLink,omitempty"`
35916 }
35917
35918
35919 func (vngclr VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) {
35920 objectMap := make(map[string]interface{})
35921 if vngclr.Value != nil {
35922 objectMap["value"] = vngclr.Value
35923 }
35924 return json.Marshal(objectMap)
35925 }
35926
35927
35928
35929 type VirtualNetworkGatewayConnectionListResultIterator struct {
35930 i int
35931 page VirtualNetworkGatewayConnectionListResultPage
35932 }
35933
35934
35935
35936 func (iter *VirtualNetworkGatewayConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
35937 if tracing.IsEnabled() {
35938 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultIterator.NextWithContext")
35939 defer func() {
35940 sc := -1
35941 if iter.Response().Response.Response != nil {
35942 sc = iter.Response().Response.Response.StatusCode
35943 }
35944 tracing.EndSpan(ctx, sc, err)
35945 }()
35946 }
35947 iter.i++
35948 if iter.i < len(iter.page.Values()) {
35949 return nil
35950 }
35951 err = iter.page.NextWithContext(ctx)
35952 if err != nil {
35953 iter.i--
35954 return err
35955 }
35956 iter.i = 0
35957 return nil
35958 }
35959
35960
35961
35962
35963 func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error {
35964 return iter.NextWithContext(context.Background())
35965 }
35966
35967
35968 func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool {
35969 return iter.page.NotDone() && iter.i < len(iter.page.Values())
35970 }
35971
35972
35973 func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult {
35974 return iter.page.Response()
35975 }
35976
35977
35978
35979 func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection {
35980 if !iter.page.NotDone() {
35981 return VirtualNetworkGatewayConnection{}
35982 }
35983 return iter.page.Values()[iter.i]
35984 }
35985
35986
35987 func NewVirtualNetworkGatewayConnectionListResultIterator(page VirtualNetworkGatewayConnectionListResultPage) VirtualNetworkGatewayConnectionListResultIterator {
35988 return VirtualNetworkGatewayConnectionListResultIterator{page: page}
35989 }
35990
35991
35992 func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool {
35993 return vngclr.Value == nil || len(*vngclr.Value) == 0
35994 }
35995
35996
35997 func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool {
35998 return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0
35999 }
36000
36001
36002
36003 func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
36004 if !vngclr.hasNextLink() {
36005 return nil, nil
36006 }
36007 return autorest.Prepare((&http.Request{}).WithContext(ctx),
36008 autorest.AsJSON(),
36009 autorest.AsGet(),
36010 autorest.WithBaseURL(to.String(vngclr.NextLink)))
36011 }
36012
36013
36014 type VirtualNetworkGatewayConnectionListResultPage struct {
36015 fn func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)
36016 vngclr VirtualNetworkGatewayConnectionListResult
36017 }
36018
36019
36020
36021 func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
36022 if tracing.IsEnabled() {
36023 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultPage.NextWithContext")
36024 defer func() {
36025 sc := -1
36026 if page.Response().Response.Response != nil {
36027 sc = page.Response().Response.Response.StatusCode
36028 }
36029 tracing.EndSpan(ctx, sc, err)
36030 }()
36031 }
36032 for {
36033 next, err := page.fn(ctx, page.vngclr)
36034 if err != nil {
36035 return err
36036 }
36037 page.vngclr = next
36038 if !next.hasNextLink() || !next.IsEmpty() {
36039 break
36040 }
36041 }
36042 return nil
36043 }
36044
36045
36046
36047
36048 func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error {
36049 return page.NextWithContext(context.Background())
36050 }
36051
36052
36053 func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool {
36054 return !page.vngclr.IsEmpty()
36055 }
36056
36057
36058 func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult {
36059 return page.vngclr
36060 }
36061
36062
36063 func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection {
36064 if page.vngclr.IsEmpty() {
36065 return nil
36066 }
36067 return *page.vngclr.Value
36068 }
36069
36070
36071 func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage {
36072 return VirtualNetworkGatewayConnectionListResultPage{
36073 fn: getNextPage,
36074 vngclr: cur,
36075 }
36076 }
36077
36078
36079 type VirtualNetworkGatewayConnectionPropertiesFormat struct {
36080
36081 AuthorizationKey *string `json:"authorizationKey,omitempty"`
36082
36083 VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"`
36084
36085 VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"`
36086
36087 LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"`
36088
36089 ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"`
36090
36091 ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"`
36092
36093 RoutingWeight *int32 `json:"routingWeight,omitempty"`
36094
36095 DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"`
36096
36097 SharedKey *string `json:"sharedKey,omitempty"`
36098
36099 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
36100
36101 TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"`
36102
36103 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
36104
36105 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
36106
36107 Peer *SubResource `json:"peer,omitempty"`
36108
36109 EnableBgp *bool `json:"enableBgp,omitempty"`
36110
36111 UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"`
36112
36113 UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"`
36114
36115 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"`
36116
36117 TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"`
36118
36119 ResourceGUID *string `json:"resourceGuid,omitempty"`
36120
36121 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
36122
36123 ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"`
36124 }
36125
36126
36127 func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) {
36128 objectMap := make(map[string]interface{})
36129 if vngcpf.AuthorizationKey != nil {
36130 objectMap["authorizationKey"] = vngcpf.AuthorizationKey
36131 }
36132 if vngcpf.VirtualNetworkGateway1 != nil {
36133 objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1
36134 }
36135 if vngcpf.VirtualNetworkGateway2 != nil {
36136 objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2
36137 }
36138 if vngcpf.LocalNetworkGateway2 != nil {
36139 objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2
36140 }
36141 if vngcpf.ConnectionType != "" {
36142 objectMap["connectionType"] = vngcpf.ConnectionType
36143 }
36144 if vngcpf.ConnectionProtocol != "" {
36145 objectMap["connectionProtocol"] = vngcpf.ConnectionProtocol
36146 }
36147 if vngcpf.RoutingWeight != nil {
36148 objectMap["routingWeight"] = vngcpf.RoutingWeight
36149 }
36150 if vngcpf.DpdTimeoutSeconds != nil {
36151 objectMap["dpdTimeoutSeconds"] = vngcpf.DpdTimeoutSeconds
36152 }
36153 if vngcpf.SharedKey != nil {
36154 objectMap["sharedKey"] = vngcpf.SharedKey
36155 }
36156 if vngcpf.Peer != nil {
36157 objectMap["peer"] = vngcpf.Peer
36158 }
36159 if vngcpf.EnableBgp != nil {
36160 objectMap["enableBgp"] = vngcpf.EnableBgp
36161 }
36162 if vngcpf.UseLocalAzureIPAddress != nil {
36163 objectMap["useLocalAzureIpAddress"] = vngcpf.UseLocalAzureIPAddress
36164 }
36165 if vngcpf.UsePolicyBasedTrafficSelectors != nil {
36166 objectMap["usePolicyBasedTrafficSelectors"] = vngcpf.UsePolicyBasedTrafficSelectors
36167 }
36168 if vngcpf.IpsecPolicies != nil {
36169 objectMap["ipsecPolicies"] = vngcpf.IpsecPolicies
36170 }
36171 if vngcpf.TrafficSelectorPolicies != nil {
36172 objectMap["trafficSelectorPolicies"] = vngcpf.TrafficSelectorPolicies
36173 }
36174 if vngcpf.ExpressRouteGatewayBypass != nil {
36175 objectMap["expressRouteGatewayBypass"] = vngcpf.ExpressRouteGatewayBypass
36176 }
36177 return json.Marshal(objectMap)
36178 }
36179
36180
36181
36182 type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct {
36183 azure.FutureAPI
36184
36185
36186 Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error)
36187 }
36188
36189
36190 func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
36191 var azFuture azure.Future
36192 if err := json.Unmarshal(body, &azFuture); err != nil {
36193 return err
36194 }
36195 future.FutureAPI = &azFuture
36196 future.Result = future.result
36197 return nil
36198 }
36199
36200
36201 func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) {
36202 var done bool
36203 done, err = future.DoneWithContext(context.Background(), client)
36204 if err != nil {
36205 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
36206 return
36207 }
36208 if !done {
36209 vngc.Response.Response = future.Response()
36210 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture")
36211 return
36212 }
36213 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
36214 if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent {
36215 vngc, err = client.CreateOrUpdateResponder(vngc.Response.Response)
36216 if err != nil {
36217 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", vngc.Response.Response, "Failure responding to request")
36218 }
36219 }
36220 return
36221 }
36222
36223
36224
36225 type VirtualNetworkGatewayConnectionsDeleteFuture struct {
36226 azure.FutureAPI
36227
36228
36229 Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error)
36230 }
36231
36232
36233 func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
36234 var azFuture azure.Future
36235 if err := json.Unmarshal(body, &azFuture); err != nil {
36236 return err
36237 }
36238 future.FutureAPI = &azFuture
36239 future.Result = future.result
36240 return nil
36241 }
36242
36243
36244 func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) {
36245 var done bool
36246 done, err = future.DoneWithContext(context.Background(), client)
36247 if err != nil {
36248 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
36249 return
36250 }
36251 if !done {
36252 ar.Response = future.Response()
36253 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture")
36254 return
36255 }
36256 ar.Response = future.Response()
36257 return
36258 }
36259
36260
36261
36262 type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct {
36263 azure.FutureAPI
36264
36265
36266 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error)
36267 }
36268
36269
36270 func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error {
36271 var azFuture azure.Future
36272 if err := json.Unmarshal(body, &azFuture); err != nil {
36273 return err
36274 }
36275 future.FutureAPI = &azFuture
36276 future.Result = future.result
36277 return nil
36278 }
36279
36280
36281 func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) {
36282 var done bool
36283 done, err = future.DoneWithContext(context.Background(), client)
36284 if err != nil {
36285 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure")
36286 return
36287 }
36288 if !done {
36289 crsk.Response.Response = future.Response()
36290 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture")
36291 return
36292 }
36293 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
36294 if crsk.Response.Response, err = future.GetResult(sender); err == nil && crsk.Response.Response.StatusCode != http.StatusNoContent {
36295 crsk, err = client.ResetSharedKeyResponder(crsk.Response.Response)
36296 if err != nil {
36297 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", crsk.Response.Response, "Failure responding to request")
36298 }
36299 }
36300 return
36301 }
36302
36303
36304
36305 type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct {
36306 azure.FutureAPI
36307
36308
36309 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error)
36310 }
36311
36312
36313 func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error {
36314 var azFuture azure.Future
36315 if err := json.Unmarshal(body, &azFuture); err != nil {
36316 return err
36317 }
36318 future.FutureAPI = &azFuture
36319 future.Result = future.result
36320 return nil
36321 }
36322
36323
36324 func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) {
36325 var done bool
36326 done, err = future.DoneWithContext(context.Background(), client)
36327 if err != nil {
36328 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure")
36329 return
36330 }
36331 if !done {
36332 csk.Response.Response = future.Response()
36333 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture")
36334 return
36335 }
36336 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
36337 if csk.Response.Response, err = future.GetResult(sender); err == nil && csk.Response.Response.StatusCode != http.StatusNoContent {
36338 csk, err = client.SetSharedKeyResponder(csk.Response.Response)
36339 if err != nil {
36340 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", csk.Response.Response, "Failure responding to request")
36341 }
36342 }
36343 return
36344 }
36345
36346
36347
36348 type VirtualNetworkGatewayConnectionsStartPacketCaptureFuture struct {
36349 azure.FutureAPI
36350
36351
36352 Result func(VirtualNetworkGatewayConnectionsClient) (String, error)
36353 }
36354
36355
36356 func (future *VirtualNetworkGatewayConnectionsStartPacketCaptureFuture) UnmarshalJSON(body []byte) error {
36357 var azFuture azure.Future
36358 if err := json.Unmarshal(body, &azFuture); err != nil {
36359 return err
36360 }
36361 future.FutureAPI = &azFuture
36362 future.Result = future.result
36363 return nil
36364 }
36365
36366
36367 func (future *VirtualNetworkGatewayConnectionsStartPacketCaptureFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) {
36368 var done bool
36369 done, err = future.DoneWithContext(context.Background(), client)
36370 if err != nil {
36371 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture", "Result", future.Response(), "Polling failure")
36372 return
36373 }
36374 if !done {
36375 s.Response.Response = future.Response()
36376 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture")
36377 return
36378 }
36379 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
36380 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
36381 s, err = client.StartPacketCaptureResponder(s.Response.Response)
36382 if err != nil {
36383 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request")
36384 }
36385 }
36386 return
36387 }
36388
36389
36390
36391 type VirtualNetworkGatewayConnectionsStopPacketCaptureFuture struct {
36392 azure.FutureAPI
36393
36394
36395 Result func(VirtualNetworkGatewayConnectionsClient) (String, error)
36396 }
36397
36398
36399 func (future *VirtualNetworkGatewayConnectionsStopPacketCaptureFuture) UnmarshalJSON(body []byte) error {
36400 var azFuture azure.Future
36401 if err := json.Unmarshal(body, &azFuture); err != nil {
36402 return err
36403 }
36404 future.FutureAPI = &azFuture
36405 future.Result = future.result
36406 return nil
36407 }
36408
36409
36410 func (future *VirtualNetworkGatewayConnectionsStopPacketCaptureFuture) result(client VirtualNetworkGatewayConnectionsClient) (s String, err error) {
36411 var done bool
36412 done, err = future.DoneWithContext(context.Background(), client)
36413 if err != nil {
36414 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture", "Result", future.Response(), "Polling failure")
36415 return
36416 }
36417 if !done {
36418 s.Response.Response = future.Response()
36419 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture")
36420 return
36421 }
36422 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
36423 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
36424 s, err = client.StopPacketCaptureResponder(s.Response.Response)
36425 if err != nil {
36426 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request")
36427 }
36428 }
36429 return
36430 }
36431
36432
36433
36434 type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct {
36435 azure.FutureAPI
36436
36437
36438 Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error)
36439 }
36440
36441
36442 func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error {
36443 var azFuture azure.Future
36444 if err := json.Unmarshal(body, &azFuture); err != nil {
36445 return err
36446 }
36447 future.FutureAPI = &azFuture
36448 future.Result = future.result
36449 return nil
36450 }
36451
36452
36453 func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) {
36454 var done bool
36455 done, err = future.DoneWithContext(context.Background(), client)
36456 if err != nil {
36457 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure")
36458 return
36459 }
36460 if !done {
36461 vngc.Response.Response = future.Response()
36462 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsUpdateTagsFuture")
36463 return
36464 }
36465 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
36466 if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent {
36467 vngc, err = client.UpdateTagsResponder(vngc.Response.Response)
36468 if err != nil {
36469 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", vngc.Response.Response, "Failure responding to request")
36470 }
36471 }
36472 return
36473 }
36474
36475
36476 type VirtualNetworkGatewayIPConfiguration struct {
36477
36478 *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"`
36479
36480 Name *string `json:"name,omitempty"`
36481
36482 Etag *string `json:"etag,omitempty"`
36483
36484 ID *string `json:"id,omitempty"`
36485 }
36486
36487
36488 func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) {
36489 objectMap := make(map[string]interface{})
36490 if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil {
36491 objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat
36492 }
36493 if vngic.Name != nil {
36494 objectMap["name"] = vngic.Name
36495 }
36496 if vngic.ID != nil {
36497 objectMap["id"] = vngic.ID
36498 }
36499 return json.Marshal(objectMap)
36500 }
36501
36502
36503 func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error {
36504 var m map[string]*json.RawMessage
36505 err := json.Unmarshal(body, &m)
36506 if err != nil {
36507 return err
36508 }
36509 for k, v := range m {
36510 switch k {
36511 case "properties":
36512 if v != nil {
36513 var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat
36514 err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat)
36515 if err != nil {
36516 return err
36517 }
36518 vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat
36519 }
36520 case "name":
36521 if v != nil {
36522 var name string
36523 err = json.Unmarshal(*v, &name)
36524 if err != nil {
36525 return err
36526 }
36527 vngic.Name = &name
36528 }
36529 case "etag":
36530 if v != nil {
36531 var etag string
36532 err = json.Unmarshal(*v, &etag)
36533 if err != nil {
36534 return err
36535 }
36536 vngic.Etag = &etag
36537 }
36538 case "id":
36539 if v != nil {
36540 var ID string
36541 err = json.Unmarshal(*v, &ID)
36542 if err != nil {
36543 return err
36544 }
36545 vngic.ID = &ID
36546 }
36547 }
36548 }
36549
36550 return nil
36551 }
36552
36553
36554 type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct {
36555
36556 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
36557
36558 Subnet *SubResource `json:"subnet,omitempty"`
36559
36560 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
36561
36562 PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
36563
36564 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
36565 }
36566
36567
36568 func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
36569 objectMap := make(map[string]interface{})
36570 if vngicpf.PrivateIPAllocationMethod != "" {
36571 objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod
36572 }
36573 if vngicpf.Subnet != nil {
36574 objectMap["subnet"] = vngicpf.Subnet
36575 }
36576 if vngicpf.PublicIPAddress != nil {
36577 objectMap["publicIPAddress"] = vngicpf.PublicIPAddress
36578 }
36579 return json.Marshal(objectMap)
36580 }
36581
36582
36583
36584 type VirtualNetworkGatewayListConnectionsResult struct {
36585 autorest.Response `json:"-"`
36586
36587 Value *[]VirtualNetworkGatewayConnectionListEntity `json:"value,omitempty"`
36588
36589 NextLink *string `json:"nextLink,omitempty"`
36590 }
36591
36592
36593 func (vnglcr VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) {
36594 objectMap := make(map[string]interface{})
36595 if vnglcr.Value != nil {
36596 objectMap["value"] = vnglcr.Value
36597 }
36598 return json.Marshal(objectMap)
36599 }
36600
36601
36602
36603 type VirtualNetworkGatewayListConnectionsResultIterator struct {
36604 i int
36605 page VirtualNetworkGatewayListConnectionsResultPage
36606 }
36607
36608
36609
36610 func (iter *VirtualNetworkGatewayListConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) {
36611 if tracing.IsEnabled() {
36612 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultIterator.NextWithContext")
36613 defer func() {
36614 sc := -1
36615 if iter.Response().Response.Response != nil {
36616 sc = iter.Response().Response.Response.StatusCode
36617 }
36618 tracing.EndSpan(ctx, sc, err)
36619 }()
36620 }
36621 iter.i++
36622 if iter.i < len(iter.page.Values()) {
36623 return nil
36624 }
36625 err = iter.page.NextWithContext(ctx)
36626 if err != nil {
36627 iter.i--
36628 return err
36629 }
36630 iter.i = 0
36631 return nil
36632 }
36633
36634
36635
36636
36637 func (iter *VirtualNetworkGatewayListConnectionsResultIterator) Next() error {
36638 return iter.NextWithContext(context.Background())
36639 }
36640
36641
36642 func (iter VirtualNetworkGatewayListConnectionsResultIterator) NotDone() bool {
36643 return iter.page.NotDone() && iter.i < len(iter.page.Values())
36644 }
36645
36646
36647 func (iter VirtualNetworkGatewayListConnectionsResultIterator) Response() VirtualNetworkGatewayListConnectionsResult {
36648 return iter.page.Response()
36649 }
36650
36651
36652
36653 func (iter VirtualNetworkGatewayListConnectionsResultIterator) Value() VirtualNetworkGatewayConnectionListEntity {
36654 if !iter.page.NotDone() {
36655 return VirtualNetworkGatewayConnectionListEntity{}
36656 }
36657 return iter.page.Values()[iter.i]
36658 }
36659
36660
36661 func NewVirtualNetworkGatewayListConnectionsResultIterator(page VirtualNetworkGatewayListConnectionsResultPage) VirtualNetworkGatewayListConnectionsResultIterator {
36662 return VirtualNetworkGatewayListConnectionsResultIterator{page: page}
36663 }
36664
36665
36666 func (vnglcr VirtualNetworkGatewayListConnectionsResult) IsEmpty() bool {
36667 return vnglcr.Value == nil || len(*vnglcr.Value) == 0
36668 }
36669
36670
36671 func (vnglcr VirtualNetworkGatewayListConnectionsResult) hasNextLink() bool {
36672 return vnglcr.NextLink != nil && len(*vnglcr.NextLink) != 0
36673 }
36674
36675
36676
36677 func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayListConnectionsResultPreparer(ctx context.Context) (*http.Request, error) {
36678 if !vnglcr.hasNextLink() {
36679 return nil, nil
36680 }
36681 return autorest.Prepare((&http.Request{}).WithContext(ctx),
36682 autorest.AsJSON(),
36683 autorest.AsGet(),
36684 autorest.WithBaseURL(to.String(vnglcr.NextLink)))
36685 }
36686
36687
36688
36689 type VirtualNetworkGatewayListConnectionsResultPage struct {
36690 fn func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error)
36691 vnglcr VirtualNetworkGatewayListConnectionsResult
36692 }
36693
36694
36695
36696 func (page *VirtualNetworkGatewayListConnectionsResultPage) NextWithContext(ctx context.Context) (err error) {
36697 if tracing.IsEnabled() {
36698 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultPage.NextWithContext")
36699 defer func() {
36700 sc := -1
36701 if page.Response().Response.Response != nil {
36702 sc = page.Response().Response.Response.StatusCode
36703 }
36704 tracing.EndSpan(ctx, sc, err)
36705 }()
36706 }
36707 for {
36708 next, err := page.fn(ctx, page.vnglcr)
36709 if err != nil {
36710 return err
36711 }
36712 page.vnglcr = next
36713 if !next.hasNextLink() || !next.IsEmpty() {
36714 break
36715 }
36716 }
36717 return nil
36718 }
36719
36720
36721
36722
36723 func (page *VirtualNetworkGatewayListConnectionsResultPage) Next() error {
36724 return page.NextWithContext(context.Background())
36725 }
36726
36727
36728 func (page VirtualNetworkGatewayListConnectionsResultPage) NotDone() bool {
36729 return !page.vnglcr.IsEmpty()
36730 }
36731
36732
36733 func (page VirtualNetworkGatewayListConnectionsResultPage) Response() VirtualNetworkGatewayListConnectionsResult {
36734 return page.vnglcr
36735 }
36736
36737
36738 func (page VirtualNetworkGatewayListConnectionsResultPage) Values() []VirtualNetworkGatewayConnectionListEntity {
36739 if page.vnglcr.IsEmpty() {
36740 return nil
36741 }
36742 return *page.vnglcr.Value
36743 }
36744
36745
36746 func NewVirtualNetworkGatewayListConnectionsResultPage(cur VirtualNetworkGatewayListConnectionsResult, getNextPage func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error)) VirtualNetworkGatewayListConnectionsResultPage {
36747 return VirtualNetworkGatewayListConnectionsResultPage{
36748 fn: getNextPage,
36749 vnglcr: cur,
36750 }
36751 }
36752
36753
36754 type VirtualNetworkGatewayListResult struct {
36755 autorest.Response `json:"-"`
36756
36757 Value *[]VirtualNetworkGateway `json:"value,omitempty"`
36758
36759 NextLink *string `json:"nextLink,omitempty"`
36760 }
36761
36762
36763 func (vnglr VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) {
36764 objectMap := make(map[string]interface{})
36765 if vnglr.Value != nil {
36766 objectMap["value"] = vnglr.Value
36767 }
36768 return json.Marshal(objectMap)
36769 }
36770
36771
36772
36773 type VirtualNetworkGatewayListResultIterator struct {
36774 i int
36775 page VirtualNetworkGatewayListResultPage
36776 }
36777
36778
36779
36780 func (iter *VirtualNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) {
36781 if tracing.IsEnabled() {
36782 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultIterator.NextWithContext")
36783 defer func() {
36784 sc := -1
36785 if iter.Response().Response.Response != nil {
36786 sc = iter.Response().Response.Response.StatusCode
36787 }
36788 tracing.EndSpan(ctx, sc, err)
36789 }()
36790 }
36791 iter.i++
36792 if iter.i < len(iter.page.Values()) {
36793 return nil
36794 }
36795 err = iter.page.NextWithContext(ctx)
36796 if err != nil {
36797 iter.i--
36798 return err
36799 }
36800 iter.i = 0
36801 return nil
36802 }
36803
36804
36805
36806
36807 func (iter *VirtualNetworkGatewayListResultIterator) Next() error {
36808 return iter.NextWithContext(context.Background())
36809 }
36810
36811
36812 func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool {
36813 return iter.page.NotDone() && iter.i < len(iter.page.Values())
36814 }
36815
36816
36817 func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult {
36818 return iter.page.Response()
36819 }
36820
36821
36822
36823 func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway {
36824 if !iter.page.NotDone() {
36825 return VirtualNetworkGateway{}
36826 }
36827 return iter.page.Values()[iter.i]
36828 }
36829
36830
36831 func NewVirtualNetworkGatewayListResultIterator(page VirtualNetworkGatewayListResultPage) VirtualNetworkGatewayListResultIterator {
36832 return VirtualNetworkGatewayListResultIterator{page: page}
36833 }
36834
36835
36836 func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool {
36837 return vnglr.Value == nil || len(*vnglr.Value) == 0
36838 }
36839
36840
36841 func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool {
36842 return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0
36843 }
36844
36845
36846
36847 func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) {
36848 if !vnglr.hasNextLink() {
36849 return nil, nil
36850 }
36851 return autorest.Prepare((&http.Request{}).WithContext(ctx),
36852 autorest.AsJSON(),
36853 autorest.AsGet(),
36854 autorest.WithBaseURL(to.String(vnglr.NextLink)))
36855 }
36856
36857
36858 type VirtualNetworkGatewayListResultPage struct {
36859 fn func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)
36860 vnglr VirtualNetworkGatewayListResult
36861 }
36862
36863
36864
36865 func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) {
36866 if tracing.IsEnabled() {
36867 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultPage.NextWithContext")
36868 defer func() {
36869 sc := -1
36870 if page.Response().Response.Response != nil {
36871 sc = page.Response().Response.Response.StatusCode
36872 }
36873 tracing.EndSpan(ctx, sc, err)
36874 }()
36875 }
36876 for {
36877 next, err := page.fn(ctx, page.vnglr)
36878 if err != nil {
36879 return err
36880 }
36881 page.vnglr = next
36882 if !next.hasNextLink() || !next.IsEmpty() {
36883 break
36884 }
36885 }
36886 return nil
36887 }
36888
36889
36890
36891
36892 func (page *VirtualNetworkGatewayListResultPage) Next() error {
36893 return page.NextWithContext(context.Background())
36894 }
36895
36896
36897 func (page VirtualNetworkGatewayListResultPage) NotDone() bool {
36898 return !page.vnglr.IsEmpty()
36899 }
36900
36901
36902 func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult {
36903 return page.vnglr
36904 }
36905
36906
36907 func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway {
36908 if page.vnglr.IsEmpty() {
36909 return nil
36910 }
36911 return *page.vnglr.Value
36912 }
36913
36914
36915 func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage {
36916 return VirtualNetworkGatewayListResultPage{
36917 fn: getNextPage,
36918 vnglr: cur,
36919 }
36920 }
36921
36922
36923 type VirtualNetworkGatewayPropertiesFormat struct {
36924
36925 IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"`
36926
36927 GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"`
36928
36929 VpnType VpnType `json:"vpnType,omitempty"`
36930
36931 VpnGatewayGeneration VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"`
36932
36933 EnableBgp *bool `json:"enableBgp,omitempty"`
36934
36935 EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"`
36936
36937 ActiveActive *bool `json:"activeActive,omitempty"`
36938
36939 GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"`
36940
36941 Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"`
36942
36943 VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"`
36944
36945 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
36946
36947 CustomRoutes *AddressSpace `json:"customRoutes,omitempty"`
36948
36949 ResourceGUID *string `json:"resourceGuid,omitempty"`
36950
36951 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
36952
36953 EnableDNSForwarding *bool `json:"enableDnsForwarding,omitempty"`
36954
36955 InboundDNSForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"`
36956 }
36957
36958
36959 func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) {
36960 objectMap := make(map[string]interface{})
36961 if vngpf.IPConfigurations != nil {
36962 objectMap["ipConfigurations"] = vngpf.IPConfigurations
36963 }
36964 if vngpf.GatewayType != "" {
36965 objectMap["gatewayType"] = vngpf.GatewayType
36966 }
36967 if vngpf.VpnType != "" {
36968 objectMap["vpnType"] = vngpf.VpnType
36969 }
36970 if vngpf.VpnGatewayGeneration != "" {
36971 objectMap["vpnGatewayGeneration"] = vngpf.VpnGatewayGeneration
36972 }
36973 if vngpf.EnableBgp != nil {
36974 objectMap["enableBgp"] = vngpf.EnableBgp
36975 }
36976 if vngpf.EnablePrivateIPAddress != nil {
36977 objectMap["enablePrivateIpAddress"] = vngpf.EnablePrivateIPAddress
36978 }
36979 if vngpf.ActiveActive != nil {
36980 objectMap["activeActive"] = vngpf.ActiveActive
36981 }
36982 if vngpf.GatewayDefaultSite != nil {
36983 objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite
36984 }
36985 if vngpf.Sku != nil {
36986 objectMap["sku"] = vngpf.Sku
36987 }
36988 if vngpf.VpnClientConfiguration != nil {
36989 objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration
36990 }
36991 if vngpf.BgpSettings != nil {
36992 objectMap["bgpSettings"] = vngpf.BgpSettings
36993 }
36994 if vngpf.CustomRoutes != nil {
36995 objectMap["customRoutes"] = vngpf.CustomRoutes
36996 }
36997 if vngpf.EnableDNSForwarding != nil {
36998 objectMap["enableDnsForwarding"] = vngpf.EnableDNSForwarding
36999 }
37000 return json.Marshal(objectMap)
37001 }
37002
37003
37004
37005 type VirtualNetworkGatewaysCreateOrUpdateFuture struct {
37006 azure.FutureAPI
37007
37008
37009 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error)
37010 }
37011
37012
37013 func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
37014 var azFuture azure.Future
37015 if err := json.Unmarshal(body, &azFuture); err != nil {
37016 return err
37017 }
37018 future.FutureAPI = &azFuture
37019 future.Result = future.result
37020 return nil
37021 }
37022
37023
37024 func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
37025 var done bool
37026 done, err = future.DoneWithContext(context.Background(), client)
37027 if err != nil {
37028 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
37029 return
37030 }
37031 if !done {
37032 vng.Response.Response = future.Response()
37033 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture")
37034 return
37035 }
37036 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37037 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent {
37038 vng, err = client.CreateOrUpdateResponder(vng.Response.Response)
37039 if err != nil {
37040 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", vng.Response.Response, "Failure responding to request")
37041 }
37042 }
37043 return
37044 }
37045
37046
37047
37048 type VirtualNetworkGatewaysDeleteFuture struct {
37049 azure.FutureAPI
37050
37051
37052 Result func(VirtualNetworkGatewaysClient) (autorest.Response, error)
37053 }
37054
37055
37056 func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
37057 var azFuture azure.Future
37058 if err := json.Unmarshal(body, &azFuture); err != nil {
37059 return err
37060 }
37061 future.FutureAPI = &azFuture
37062 future.Result = future.result
37063 return nil
37064 }
37065
37066
37067 func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) {
37068 var done bool
37069 done, err = future.DoneWithContext(context.Background(), client)
37070 if err != nil {
37071 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
37072 return
37073 }
37074 if !done {
37075 ar.Response = future.Response()
37076 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture")
37077 return
37078 }
37079 ar.Response = future.Response()
37080 return
37081 }
37082
37083
37084
37085 type VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture struct {
37086 azure.FutureAPI
37087
37088
37089 Result func(VirtualNetworkGatewaysClient) (autorest.Response, error)
37090 }
37091
37092
37093 func (future *VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture) UnmarshalJSON(body []byte) error {
37094 var azFuture azure.Future
37095 if err := json.Unmarshal(body, &azFuture); err != nil {
37096 return err
37097 }
37098 future.FutureAPI = &azFuture
37099 future.Result = future.result
37100 return nil
37101 }
37102
37103
37104 func (future *VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) {
37105 var done bool
37106 done, err = future.DoneWithContext(context.Background(), client)
37107 if err != nil {
37108 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture", "Result", future.Response(), "Polling failure")
37109 return
37110 }
37111 if !done {
37112 ar.Response = future.Response()
37113 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDisconnectVirtualNetworkGatewayVpnConnectionsFuture")
37114 return
37115 }
37116 ar.Response = future.Response()
37117 return
37118 }
37119
37120
37121
37122 type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct {
37123 azure.FutureAPI
37124
37125
37126 Result func(VirtualNetworkGatewaysClient) (String, error)
37127 }
37128
37129
37130 func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) UnmarshalJSON(body []byte) error {
37131 var azFuture azure.Future
37132 if err := json.Unmarshal(body, &azFuture); err != nil {
37133 return err
37134 }
37135 future.FutureAPI = &azFuture
37136 future.Result = future.result
37137 return nil
37138 }
37139
37140
37141 func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) {
37142 var done bool
37143 done, err = future.DoneWithContext(context.Background(), client)
37144 if err != nil {
37145 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure")
37146 return
37147 }
37148 if !done {
37149 s.Response.Response = future.Response()
37150 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture")
37151 return
37152 }
37153 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37154 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
37155 s, err = client.GeneratevpnclientpackageResponder(s.Response.Response)
37156 if err != nil {
37157 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", s.Response.Response, "Failure responding to request")
37158 }
37159 }
37160 return
37161 }
37162
37163
37164
37165 type VirtualNetworkGatewaysGenerateVpnProfileFuture struct {
37166 azure.FutureAPI
37167
37168
37169 Result func(VirtualNetworkGatewaysClient) (String, error)
37170 }
37171
37172
37173 func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error {
37174 var azFuture azure.Future
37175 if err := json.Unmarshal(body, &azFuture); err != nil {
37176 return err
37177 }
37178 future.FutureAPI = &azFuture
37179 future.Result = future.result
37180 return nil
37181 }
37182
37183
37184 func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) {
37185 var done bool
37186 done, err = future.DoneWithContext(context.Background(), client)
37187 if err != nil {
37188 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure")
37189 return
37190 }
37191 if !done {
37192 s.Response.Response = future.Response()
37193 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture")
37194 return
37195 }
37196 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37197 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
37198 s, err = client.GenerateVpnProfileResponder(s.Response.Response)
37199 if err != nil {
37200 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", s.Response.Response, "Failure responding to request")
37201 }
37202 }
37203 return
37204 }
37205
37206
37207
37208 type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct {
37209 azure.FutureAPI
37210
37211
37212 Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error)
37213 }
37214
37215
37216 func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error {
37217 var azFuture azure.Future
37218 if err := json.Unmarshal(body, &azFuture); err != nil {
37219 return err
37220 }
37221 future.FutureAPI = &azFuture
37222 future.Result = future.result
37223 return nil
37224 }
37225
37226
37227 func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) {
37228 var done bool
37229 done, err = future.DoneWithContext(context.Background(), client)
37230 if err != nil {
37231 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure")
37232 return
37233 }
37234 if !done {
37235 grlr.Response.Response = future.Response()
37236 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture")
37237 return
37238 }
37239 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37240 if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent {
37241 grlr, err = client.GetAdvertisedRoutesResponder(grlr.Response.Response)
37242 if err != nil {
37243 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request")
37244 }
37245 }
37246 return
37247 }
37248
37249
37250
37251 type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct {
37252 azure.FutureAPI
37253
37254
37255 Result func(VirtualNetworkGatewaysClient) (BgpPeerStatusListResult, error)
37256 }
37257
37258
37259 func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) UnmarshalJSON(body []byte) error {
37260 var azFuture azure.Future
37261 if err := json.Unmarshal(body, &azFuture); err != nil {
37262 return err
37263 }
37264 future.FutureAPI = &azFuture
37265 future.Result = future.result
37266 return nil
37267 }
37268
37269
37270 func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) {
37271 var done bool
37272 done, err = future.DoneWithContext(context.Background(), client)
37273 if err != nil {
37274 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure")
37275 return
37276 }
37277 if !done {
37278 bpslr.Response.Response = future.Response()
37279 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture")
37280 return
37281 }
37282 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37283 if bpslr.Response.Response, err = future.GetResult(sender); err == nil && bpslr.Response.Response.StatusCode != http.StatusNoContent {
37284 bpslr, err = client.GetBgpPeerStatusResponder(bpslr.Response.Response)
37285 if err != nil {
37286 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", bpslr.Response.Response, "Failure responding to request")
37287 }
37288 }
37289 return
37290 }
37291
37292
37293
37294 type VirtualNetworkGatewaysGetLearnedRoutesFuture struct {
37295 azure.FutureAPI
37296
37297
37298 Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error)
37299 }
37300
37301
37302 func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) UnmarshalJSON(body []byte) error {
37303 var azFuture azure.Future
37304 if err := json.Unmarshal(body, &azFuture); err != nil {
37305 return err
37306 }
37307 future.FutureAPI = &azFuture
37308 future.Result = future.result
37309 return nil
37310 }
37311
37312
37313 func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) {
37314 var done bool
37315 done, err = future.DoneWithContext(context.Background(), client)
37316 if err != nil {
37317 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure")
37318 return
37319 }
37320 if !done {
37321 grlr.Response.Response = future.Response()
37322 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture")
37323 return
37324 }
37325 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37326 if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent {
37327 grlr, err = client.GetLearnedRoutesResponder(grlr.Response.Response)
37328 if err != nil {
37329 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request")
37330 }
37331 }
37332 return
37333 }
37334
37335
37336
37337 type VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture struct {
37338 azure.FutureAPI
37339
37340
37341 Result func(VirtualNetworkGatewaysClient) (VpnClientConnectionHealthDetailListResult, error)
37342 }
37343
37344
37345 func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) UnmarshalJSON(body []byte) error {
37346 var azFuture azure.Future
37347 if err := json.Unmarshal(body, &azFuture); err != nil {
37348 return err
37349 }
37350 future.FutureAPI = &azFuture
37351 future.Result = future.result
37352 return nil
37353 }
37354
37355
37356 func (future *VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture) result(client VirtualNetworkGatewaysClient) (vcchdlr VpnClientConnectionHealthDetailListResult, err error) {
37357 var done bool
37358 done, err = future.DoneWithContext(context.Background(), client)
37359 if err != nil {
37360 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture", "Result", future.Response(), "Polling failure")
37361 return
37362 }
37363 if !done {
37364 vcchdlr.Response.Response = future.Response()
37365 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture")
37366 return
37367 }
37368 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37369 if vcchdlr.Response.Response, err = future.GetResult(sender); err == nil && vcchdlr.Response.Response.StatusCode != http.StatusNoContent {
37370 vcchdlr, err = client.GetVpnclientConnectionHealthResponder(vcchdlr.Response.Response)
37371 if err != nil {
37372 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientConnectionHealthFuture", "Result", vcchdlr.Response.Response, "Failure responding to request")
37373 }
37374 }
37375 return
37376 }
37377
37378
37379
37380 type VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture struct {
37381 azure.FutureAPI
37382
37383
37384 Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error)
37385 }
37386
37387
37388 func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error {
37389 var azFuture azure.Future
37390 if err := json.Unmarshal(body, &azFuture); err != nil {
37391 return err
37392 }
37393 future.FutureAPI = &azFuture
37394 future.Result = future.result
37395 return nil
37396 }
37397
37398
37399 func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) {
37400 var done bool
37401 done, err = future.DoneWithContext(context.Background(), client)
37402 if err != nil {
37403 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure")
37404 return
37405 }
37406 if !done {
37407 vcipp.Response.Response = future.Response()
37408 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture")
37409 return
37410 }
37411 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37412 if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent {
37413 vcipp, err = client.GetVpnclientIpsecParametersResponder(vcipp.Response.Response)
37414 if err != nil {
37415 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request")
37416 }
37417 }
37418 return
37419 }
37420
37421
37422
37423 type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct {
37424 azure.FutureAPI
37425
37426
37427 Result func(VirtualNetworkGatewaysClient) (String, error)
37428 }
37429
37430
37431 func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) UnmarshalJSON(body []byte) error {
37432 var azFuture azure.Future
37433 if err := json.Unmarshal(body, &azFuture); err != nil {
37434 return err
37435 }
37436 future.FutureAPI = &azFuture
37437 future.Result = future.result
37438 return nil
37439 }
37440
37441
37442 func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) {
37443 var done bool
37444 done, err = future.DoneWithContext(context.Background(), client)
37445 if err != nil {
37446 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", future.Response(), "Polling failure")
37447 return
37448 }
37449 if !done {
37450 s.Response.Response = future.Response()
37451 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture")
37452 return
37453 }
37454 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37455 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
37456 s, err = client.GetVpnProfilePackageURLResponder(s.Response.Response)
37457 if err != nil {
37458 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", s.Response.Response, "Failure responding to request")
37459 }
37460 }
37461 return
37462 }
37463
37464
37465 type VirtualNetworkGatewaySku struct {
37466
37467 Name VirtualNetworkGatewaySkuName `json:"name,omitempty"`
37468
37469 Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"`
37470
37471 Capacity *int32 `json:"capacity,omitempty"`
37472 }
37473
37474
37475 func (vngs VirtualNetworkGatewaySku) MarshalJSON() ([]byte, error) {
37476 objectMap := make(map[string]interface{})
37477 if vngs.Name != "" {
37478 objectMap["name"] = vngs.Name
37479 }
37480 if vngs.Tier != "" {
37481 objectMap["tier"] = vngs.Tier
37482 }
37483 return json.Marshal(objectMap)
37484 }
37485
37486
37487
37488 type VirtualNetworkGatewaysResetFuture struct {
37489 azure.FutureAPI
37490
37491
37492 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error)
37493 }
37494
37495
37496 func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error {
37497 var azFuture azure.Future
37498 if err := json.Unmarshal(body, &azFuture); err != nil {
37499 return err
37500 }
37501 future.FutureAPI = &azFuture
37502 future.Result = future.result
37503 return nil
37504 }
37505
37506
37507 func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
37508 var done bool
37509 done, err = future.DoneWithContext(context.Background(), client)
37510 if err != nil {
37511 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure")
37512 return
37513 }
37514 if !done {
37515 vng.Response.Response = future.Response()
37516 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture")
37517 return
37518 }
37519 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37520 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent {
37521 vng, err = client.ResetResponder(vng.Response.Response)
37522 if err != nil {
37523 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", vng.Response.Response, "Failure responding to request")
37524 }
37525 }
37526 return
37527 }
37528
37529
37530
37531 type VirtualNetworkGatewaysResetVpnClientSharedKeyFuture struct {
37532 azure.FutureAPI
37533
37534
37535 Result func(VirtualNetworkGatewaysClient) (autorest.Response, error)
37536 }
37537
37538
37539 func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) UnmarshalJSON(body []byte) error {
37540 var azFuture azure.Future
37541 if err := json.Unmarshal(body, &azFuture); err != nil {
37542 return err
37543 }
37544 future.FutureAPI = &azFuture
37545 future.Result = future.result
37546 return nil
37547 }
37548
37549
37550 func (future *VirtualNetworkGatewaysResetVpnClientSharedKeyFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) {
37551 var done bool
37552 done, err = future.DoneWithContext(context.Background(), client)
37553 if err != nil {
37554 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetVpnClientSharedKeyFuture", "Result", future.Response(), "Polling failure")
37555 return
37556 }
37557 if !done {
37558 ar.Response = future.Response()
37559 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetVpnClientSharedKeyFuture")
37560 return
37561 }
37562 ar.Response = future.Response()
37563 return
37564 }
37565
37566
37567
37568 type VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture struct {
37569 azure.FutureAPI
37570
37571
37572 Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error)
37573 }
37574
37575
37576 func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error {
37577 var azFuture azure.Future
37578 if err := json.Unmarshal(body, &azFuture); err != nil {
37579 return err
37580 }
37581 future.FutureAPI = &azFuture
37582 future.Result = future.result
37583 return nil
37584 }
37585
37586
37587 func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) {
37588 var done bool
37589 done, err = future.DoneWithContext(context.Background(), client)
37590 if err != nil {
37591 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure")
37592 return
37593 }
37594 if !done {
37595 vcipp.Response.Response = future.Response()
37596 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture")
37597 return
37598 }
37599 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37600 if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent {
37601 vcipp, err = client.SetVpnclientIpsecParametersResponder(vcipp.Response.Response)
37602 if err != nil {
37603 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request")
37604 }
37605 }
37606 return
37607 }
37608
37609
37610
37611 type VirtualNetworkGatewaysStartPacketCaptureFuture struct {
37612 azure.FutureAPI
37613
37614
37615 Result func(VirtualNetworkGatewaysClient) (String, error)
37616 }
37617
37618
37619 func (future *VirtualNetworkGatewaysStartPacketCaptureFuture) UnmarshalJSON(body []byte) error {
37620 var azFuture azure.Future
37621 if err := json.Unmarshal(body, &azFuture); err != nil {
37622 return err
37623 }
37624 future.FutureAPI = &azFuture
37625 future.Result = future.result
37626 return nil
37627 }
37628
37629
37630 func (future *VirtualNetworkGatewaysStartPacketCaptureFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) {
37631 var done bool
37632 done, err = future.DoneWithContext(context.Background(), client)
37633 if err != nil {
37634 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStartPacketCaptureFuture", "Result", future.Response(), "Polling failure")
37635 return
37636 }
37637 if !done {
37638 s.Response.Response = future.Response()
37639 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysStartPacketCaptureFuture")
37640 return
37641 }
37642 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37643 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
37644 s, err = client.StartPacketCaptureResponder(s.Response.Response)
37645 if err != nil {
37646 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStartPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request")
37647 }
37648 }
37649 return
37650 }
37651
37652
37653
37654 type VirtualNetworkGatewaysStopPacketCaptureFuture struct {
37655 azure.FutureAPI
37656
37657
37658 Result func(VirtualNetworkGatewaysClient) (String, error)
37659 }
37660
37661
37662 func (future *VirtualNetworkGatewaysStopPacketCaptureFuture) UnmarshalJSON(body []byte) error {
37663 var azFuture azure.Future
37664 if err := json.Unmarshal(body, &azFuture); err != nil {
37665 return err
37666 }
37667 future.FutureAPI = &azFuture
37668 future.Result = future.result
37669 return nil
37670 }
37671
37672
37673 func (future *VirtualNetworkGatewaysStopPacketCaptureFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) {
37674 var done bool
37675 done, err = future.DoneWithContext(context.Background(), client)
37676 if err != nil {
37677 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStopPacketCaptureFuture", "Result", future.Response(), "Polling failure")
37678 return
37679 }
37680 if !done {
37681 s.Response.Response = future.Response()
37682 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysStopPacketCaptureFuture")
37683 return
37684 }
37685 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37686 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
37687 s, err = client.StopPacketCaptureResponder(s.Response.Response)
37688 if err != nil {
37689 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysStopPacketCaptureFuture", "Result", s.Response.Response, "Failure responding to request")
37690 }
37691 }
37692 return
37693 }
37694
37695
37696
37697 type VirtualNetworkGatewaysUpdateTagsFuture struct {
37698 azure.FutureAPI
37699
37700
37701 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error)
37702 }
37703
37704
37705 func (future *VirtualNetworkGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error {
37706 var azFuture azure.Future
37707 if err := json.Unmarshal(body, &azFuture); err != nil {
37708 return err
37709 }
37710 future.FutureAPI = &azFuture
37711 future.Result = future.result
37712 return nil
37713 }
37714
37715
37716 func (future *VirtualNetworkGatewaysUpdateTagsFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
37717 var done bool
37718 done, err = future.DoneWithContext(context.Background(), client)
37719 if err != nil {
37720 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure")
37721 return
37722 }
37723 if !done {
37724 vng.Response.Response = future.Response()
37725 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysUpdateTagsFuture")
37726 return
37727 }
37728 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
37729 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent {
37730 vng, err = client.UpdateTagsResponder(vng.Response.Response)
37731 if err != nil {
37732 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", vng.Response.Response, "Failure responding to request")
37733 }
37734 }
37735 return
37736 }
37737
37738
37739 type VirtualNetworkListResult struct {
37740 autorest.Response `json:"-"`
37741
37742 Value *[]VirtualNetwork `json:"value,omitempty"`
37743
37744 NextLink *string `json:"nextLink,omitempty"`
37745 }
37746
37747
37748 type VirtualNetworkListResultIterator struct {
37749 i int
37750 page VirtualNetworkListResultPage
37751 }
37752
37753
37754
37755 func (iter *VirtualNetworkListResultIterator) NextWithContext(ctx context.Context) (err error) {
37756 if tracing.IsEnabled() {
37757 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultIterator.NextWithContext")
37758 defer func() {
37759 sc := -1
37760 if iter.Response().Response.Response != nil {
37761 sc = iter.Response().Response.Response.StatusCode
37762 }
37763 tracing.EndSpan(ctx, sc, err)
37764 }()
37765 }
37766 iter.i++
37767 if iter.i < len(iter.page.Values()) {
37768 return nil
37769 }
37770 err = iter.page.NextWithContext(ctx)
37771 if err != nil {
37772 iter.i--
37773 return err
37774 }
37775 iter.i = 0
37776 return nil
37777 }
37778
37779
37780
37781
37782 func (iter *VirtualNetworkListResultIterator) Next() error {
37783 return iter.NextWithContext(context.Background())
37784 }
37785
37786
37787 func (iter VirtualNetworkListResultIterator) NotDone() bool {
37788 return iter.page.NotDone() && iter.i < len(iter.page.Values())
37789 }
37790
37791
37792 func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult {
37793 return iter.page.Response()
37794 }
37795
37796
37797
37798 func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork {
37799 if !iter.page.NotDone() {
37800 return VirtualNetwork{}
37801 }
37802 return iter.page.Values()[iter.i]
37803 }
37804
37805
37806 func NewVirtualNetworkListResultIterator(page VirtualNetworkListResultPage) VirtualNetworkListResultIterator {
37807 return VirtualNetworkListResultIterator{page: page}
37808 }
37809
37810
37811 func (vnlr VirtualNetworkListResult) IsEmpty() bool {
37812 return vnlr.Value == nil || len(*vnlr.Value) == 0
37813 }
37814
37815
37816 func (vnlr VirtualNetworkListResult) hasNextLink() bool {
37817 return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0
37818 }
37819
37820
37821
37822 func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) {
37823 if !vnlr.hasNextLink() {
37824 return nil, nil
37825 }
37826 return autorest.Prepare((&http.Request{}).WithContext(ctx),
37827 autorest.AsJSON(),
37828 autorest.AsGet(),
37829 autorest.WithBaseURL(to.String(vnlr.NextLink)))
37830 }
37831
37832
37833 type VirtualNetworkListResultPage struct {
37834 fn func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)
37835 vnlr VirtualNetworkListResult
37836 }
37837
37838
37839
37840 func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) (err error) {
37841 if tracing.IsEnabled() {
37842 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultPage.NextWithContext")
37843 defer func() {
37844 sc := -1
37845 if page.Response().Response.Response != nil {
37846 sc = page.Response().Response.Response.StatusCode
37847 }
37848 tracing.EndSpan(ctx, sc, err)
37849 }()
37850 }
37851 for {
37852 next, err := page.fn(ctx, page.vnlr)
37853 if err != nil {
37854 return err
37855 }
37856 page.vnlr = next
37857 if !next.hasNextLink() || !next.IsEmpty() {
37858 break
37859 }
37860 }
37861 return nil
37862 }
37863
37864
37865
37866
37867 func (page *VirtualNetworkListResultPage) Next() error {
37868 return page.NextWithContext(context.Background())
37869 }
37870
37871
37872 func (page VirtualNetworkListResultPage) NotDone() bool {
37873 return !page.vnlr.IsEmpty()
37874 }
37875
37876
37877 func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult {
37878 return page.vnlr
37879 }
37880
37881
37882 func (page VirtualNetworkListResultPage) Values() []VirtualNetwork {
37883 if page.vnlr.IsEmpty() {
37884 return nil
37885 }
37886 return *page.vnlr.Value
37887 }
37888
37889
37890 func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage {
37891 return VirtualNetworkListResultPage{
37892 fn: getNextPage,
37893 vnlr: cur,
37894 }
37895 }
37896
37897
37898 type VirtualNetworkListUsageResult struct {
37899 autorest.Response `json:"-"`
37900
37901 Value *[]VirtualNetworkUsage `json:"value,omitempty"`
37902
37903 NextLink *string `json:"nextLink,omitempty"`
37904 }
37905
37906
37907 func (vnlur VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) {
37908 objectMap := make(map[string]interface{})
37909 if vnlur.NextLink != nil {
37910 objectMap["nextLink"] = vnlur.NextLink
37911 }
37912 return json.Marshal(objectMap)
37913 }
37914
37915
37916
37917 type VirtualNetworkListUsageResultIterator struct {
37918 i int
37919 page VirtualNetworkListUsageResultPage
37920 }
37921
37922
37923
37924 func (iter *VirtualNetworkListUsageResultIterator) NextWithContext(ctx context.Context) (err error) {
37925 if tracing.IsEnabled() {
37926 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultIterator.NextWithContext")
37927 defer func() {
37928 sc := -1
37929 if iter.Response().Response.Response != nil {
37930 sc = iter.Response().Response.Response.StatusCode
37931 }
37932 tracing.EndSpan(ctx, sc, err)
37933 }()
37934 }
37935 iter.i++
37936 if iter.i < len(iter.page.Values()) {
37937 return nil
37938 }
37939 err = iter.page.NextWithContext(ctx)
37940 if err != nil {
37941 iter.i--
37942 return err
37943 }
37944 iter.i = 0
37945 return nil
37946 }
37947
37948
37949
37950
37951 func (iter *VirtualNetworkListUsageResultIterator) Next() error {
37952 return iter.NextWithContext(context.Background())
37953 }
37954
37955
37956 func (iter VirtualNetworkListUsageResultIterator) NotDone() bool {
37957 return iter.page.NotDone() && iter.i < len(iter.page.Values())
37958 }
37959
37960
37961 func (iter VirtualNetworkListUsageResultIterator) Response() VirtualNetworkListUsageResult {
37962 return iter.page.Response()
37963 }
37964
37965
37966
37967 func (iter VirtualNetworkListUsageResultIterator) Value() VirtualNetworkUsage {
37968 if !iter.page.NotDone() {
37969 return VirtualNetworkUsage{}
37970 }
37971 return iter.page.Values()[iter.i]
37972 }
37973
37974
37975 func NewVirtualNetworkListUsageResultIterator(page VirtualNetworkListUsageResultPage) VirtualNetworkListUsageResultIterator {
37976 return VirtualNetworkListUsageResultIterator{page: page}
37977 }
37978
37979
37980 func (vnlur VirtualNetworkListUsageResult) IsEmpty() bool {
37981 return vnlur.Value == nil || len(*vnlur.Value) == 0
37982 }
37983
37984
37985 func (vnlur VirtualNetworkListUsageResult) hasNextLink() bool {
37986 return vnlur.NextLink != nil && len(*vnlur.NextLink) != 0
37987 }
37988
37989
37990
37991 func (vnlur VirtualNetworkListUsageResult) virtualNetworkListUsageResultPreparer(ctx context.Context) (*http.Request, error) {
37992 if !vnlur.hasNextLink() {
37993 return nil, nil
37994 }
37995 return autorest.Prepare((&http.Request{}).WithContext(ctx),
37996 autorest.AsJSON(),
37997 autorest.AsGet(),
37998 autorest.WithBaseURL(to.String(vnlur.NextLink)))
37999 }
38000
38001
38002 type VirtualNetworkListUsageResultPage struct {
38003 fn func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error)
38004 vnlur VirtualNetworkListUsageResult
38005 }
38006
38007
38008
38009 func (page *VirtualNetworkListUsageResultPage) NextWithContext(ctx context.Context) (err error) {
38010 if tracing.IsEnabled() {
38011 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultPage.NextWithContext")
38012 defer func() {
38013 sc := -1
38014 if page.Response().Response.Response != nil {
38015 sc = page.Response().Response.Response.StatusCode
38016 }
38017 tracing.EndSpan(ctx, sc, err)
38018 }()
38019 }
38020 for {
38021 next, err := page.fn(ctx, page.vnlur)
38022 if err != nil {
38023 return err
38024 }
38025 page.vnlur = next
38026 if !next.hasNextLink() || !next.IsEmpty() {
38027 break
38028 }
38029 }
38030 return nil
38031 }
38032
38033
38034
38035
38036 func (page *VirtualNetworkListUsageResultPage) Next() error {
38037 return page.NextWithContext(context.Background())
38038 }
38039
38040
38041 func (page VirtualNetworkListUsageResultPage) NotDone() bool {
38042 return !page.vnlur.IsEmpty()
38043 }
38044
38045
38046 func (page VirtualNetworkListUsageResultPage) Response() VirtualNetworkListUsageResult {
38047 return page.vnlur
38048 }
38049
38050
38051 func (page VirtualNetworkListUsageResultPage) Values() []VirtualNetworkUsage {
38052 if page.vnlur.IsEmpty() {
38053 return nil
38054 }
38055 return *page.vnlur.Value
38056 }
38057
38058
38059 func NewVirtualNetworkListUsageResultPage(cur VirtualNetworkListUsageResult, getNextPage func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error)) VirtualNetworkListUsageResultPage {
38060 return VirtualNetworkListUsageResultPage{
38061 fn: getNextPage,
38062 vnlur: cur,
38063 }
38064 }
38065
38066
38067 type VirtualNetworkPeering struct {
38068 autorest.Response `json:"-"`
38069
38070 *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"`
38071
38072 Name *string `json:"name,omitempty"`
38073
38074 Etag *string `json:"etag,omitempty"`
38075
38076 ID *string `json:"id,omitempty"`
38077 }
38078
38079
38080 func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) {
38081 objectMap := make(map[string]interface{})
38082 if vnp.VirtualNetworkPeeringPropertiesFormat != nil {
38083 objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat
38084 }
38085 if vnp.Name != nil {
38086 objectMap["name"] = vnp.Name
38087 }
38088 if vnp.ID != nil {
38089 objectMap["id"] = vnp.ID
38090 }
38091 return json.Marshal(objectMap)
38092 }
38093
38094
38095 func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error {
38096 var m map[string]*json.RawMessage
38097 err := json.Unmarshal(body, &m)
38098 if err != nil {
38099 return err
38100 }
38101 for k, v := range m {
38102 switch k {
38103 case "properties":
38104 if v != nil {
38105 var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat
38106 err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat)
38107 if err != nil {
38108 return err
38109 }
38110 vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat
38111 }
38112 case "name":
38113 if v != nil {
38114 var name string
38115 err = json.Unmarshal(*v, &name)
38116 if err != nil {
38117 return err
38118 }
38119 vnp.Name = &name
38120 }
38121 case "etag":
38122 if v != nil {
38123 var etag string
38124 err = json.Unmarshal(*v, &etag)
38125 if err != nil {
38126 return err
38127 }
38128 vnp.Etag = &etag
38129 }
38130 case "id":
38131 if v != nil {
38132 var ID string
38133 err = json.Unmarshal(*v, &ID)
38134 if err != nil {
38135 return err
38136 }
38137 vnp.ID = &ID
38138 }
38139 }
38140 }
38141
38142 return nil
38143 }
38144
38145
38146
38147 type VirtualNetworkPeeringListResult struct {
38148 autorest.Response `json:"-"`
38149
38150 Value *[]VirtualNetworkPeering `json:"value,omitempty"`
38151
38152 NextLink *string `json:"nextLink,omitempty"`
38153 }
38154
38155
38156
38157 type VirtualNetworkPeeringListResultIterator struct {
38158 i int
38159 page VirtualNetworkPeeringListResultPage
38160 }
38161
38162
38163
38164 func (iter *VirtualNetworkPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) {
38165 if tracing.IsEnabled() {
38166 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultIterator.NextWithContext")
38167 defer func() {
38168 sc := -1
38169 if iter.Response().Response.Response != nil {
38170 sc = iter.Response().Response.Response.StatusCode
38171 }
38172 tracing.EndSpan(ctx, sc, err)
38173 }()
38174 }
38175 iter.i++
38176 if iter.i < len(iter.page.Values()) {
38177 return nil
38178 }
38179 err = iter.page.NextWithContext(ctx)
38180 if err != nil {
38181 iter.i--
38182 return err
38183 }
38184 iter.i = 0
38185 return nil
38186 }
38187
38188
38189
38190
38191 func (iter *VirtualNetworkPeeringListResultIterator) Next() error {
38192 return iter.NextWithContext(context.Background())
38193 }
38194
38195
38196 func (iter VirtualNetworkPeeringListResultIterator) NotDone() bool {
38197 return iter.page.NotDone() && iter.i < len(iter.page.Values())
38198 }
38199
38200
38201 func (iter VirtualNetworkPeeringListResultIterator) Response() VirtualNetworkPeeringListResult {
38202 return iter.page.Response()
38203 }
38204
38205
38206
38207 func (iter VirtualNetworkPeeringListResultIterator) Value() VirtualNetworkPeering {
38208 if !iter.page.NotDone() {
38209 return VirtualNetworkPeering{}
38210 }
38211 return iter.page.Values()[iter.i]
38212 }
38213
38214
38215 func NewVirtualNetworkPeeringListResultIterator(page VirtualNetworkPeeringListResultPage) VirtualNetworkPeeringListResultIterator {
38216 return VirtualNetworkPeeringListResultIterator{page: page}
38217 }
38218
38219
38220 func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool {
38221 return vnplr.Value == nil || len(*vnplr.Value) == 0
38222 }
38223
38224
38225 func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool {
38226 return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0
38227 }
38228
38229
38230
38231 func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) {
38232 if !vnplr.hasNextLink() {
38233 return nil, nil
38234 }
38235 return autorest.Prepare((&http.Request{}).WithContext(ctx),
38236 autorest.AsJSON(),
38237 autorest.AsGet(),
38238 autorest.WithBaseURL(to.String(vnplr.NextLink)))
38239 }
38240
38241
38242 type VirtualNetworkPeeringListResultPage struct {
38243 fn func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)
38244 vnplr VirtualNetworkPeeringListResult
38245 }
38246
38247
38248
38249 func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Context) (err error) {
38250 if tracing.IsEnabled() {
38251 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultPage.NextWithContext")
38252 defer func() {
38253 sc := -1
38254 if page.Response().Response.Response != nil {
38255 sc = page.Response().Response.Response.StatusCode
38256 }
38257 tracing.EndSpan(ctx, sc, err)
38258 }()
38259 }
38260 for {
38261 next, err := page.fn(ctx, page.vnplr)
38262 if err != nil {
38263 return err
38264 }
38265 page.vnplr = next
38266 if !next.hasNextLink() || !next.IsEmpty() {
38267 break
38268 }
38269 }
38270 return nil
38271 }
38272
38273
38274
38275
38276 func (page *VirtualNetworkPeeringListResultPage) Next() error {
38277 return page.NextWithContext(context.Background())
38278 }
38279
38280
38281 func (page VirtualNetworkPeeringListResultPage) NotDone() bool {
38282 return !page.vnplr.IsEmpty()
38283 }
38284
38285
38286 func (page VirtualNetworkPeeringListResultPage) Response() VirtualNetworkPeeringListResult {
38287 return page.vnplr
38288 }
38289
38290
38291 func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering {
38292 if page.vnplr.IsEmpty() {
38293 return nil
38294 }
38295 return *page.vnplr.Value
38296 }
38297
38298
38299 func NewVirtualNetworkPeeringListResultPage(cur VirtualNetworkPeeringListResult, getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage {
38300 return VirtualNetworkPeeringListResultPage{
38301 fn: getNextPage,
38302 vnplr: cur,
38303 }
38304 }
38305
38306
38307 type VirtualNetworkPeeringPropertiesFormat struct {
38308
38309 AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"`
38310
38311 AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"`
38312
38313 AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"`
38314
38315 UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"`
38316
38317 RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"`
38318
38319 RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"`
38320
38321 PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"`
38322
38323 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
38324 }
38325
38326
38327 func (vnppf VirtualNetworkPeeringPropertiesFormat) MarshalJSON() ([]byte, error) {
38328 objectMap := make(map[string]interface{})
38329 if vnppf.AllowVirtualNetworkAccess != nil {
38330 objectMap["allowVirtualNetworkAccess"] = vnppf.AllowVirtualNetworkAccess
38331 }
38332 if vnppf.AllowForwardedTraffic != nil {
38333 objectMap["allowForwardedTraffic"] = vnppf.AllowForwardedTraffic
38334 }
38335 if vnppf.AllowGatewayTransit != nil {
38336 objectMap["allowGatewayTransit"] = vnppf.AllowGatewayTransit
38337 }
38338 if vnppf.UseRemoteGateways != nil {
38339 objectMap["useRemoteGateways"] = vnppf.UseRemoteGateways
38340 }
38341 if vnppf.RemoteVirtualNetwork != nil {
38342 objectMap["remoteVirtualNetwork"] = vnppf.RemoteVirtualNetwork
38343 }
38344 if vnppf.RemoteAddressSpace != nil {
38345 objectMap["remoteAddressSpace"] = vnppf.RemoteAddressSpace
38346 }
38347 if vnppf.PeeringState != "" {
38348 objectMap["peeringState"] = vnppf.PeeringState
38349 }
38350 return json.Marshal(objectMap)
38351 }
38352
38353
38354
38355 type VirtualNetworkPeeringsCreateOrUpdateFuture struct {
38356 azure.FutureAPI
38357
38358
38359 Result func(VirtualNetworkPeeringsClient) (VirtualNetworkPeering, error)
38360 }
38361
38362
38363 func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
38364 var azFuture azure.Future
38365 if err := json.Unmarshal(body, &azFuture); err != nil {
38366 return err
38367 }
38368 future.FutureAPI = &azFuture
38369 future.Result = future.result
38370 return nil
38371 }
38372
38373
38374 func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) {
38375 var done bool
38376 done, err = future.DoneWithContext(context.Background(), client)
38377 if err != nil {
38378 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
38379 return
38380 }
38381 if !done {
38382 vnp.Response.Response = future.Response()
38383 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture")
38384 return
38385 }
38386 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
38387 if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent {
38388 vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response)
38389 if err != nil {
38390 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request")
38391 }
38392 }
38393 return
38394 }
38395
38396
38397
38398 type VirtualNetworkPeeringsDeleteFuture struct {
38399 azure.FutureAPI
38400
38401
38402 Result func(VirtualNetworkPeeringsClient) (autorest.Response, error)
38403 }
38404
38405
38406 func (future *VirtualNetworkPeeringsDeleteFuture) UnmarshalJSON(body []byte) error {
38407 var azFuture azure.Future
38408 if err := json.Unmarshal(body, &azFuture); err != nil {
38409 return err
38410 }
38411 future.FutureAPI = &azFuture
38412 future.Result = future.result
38413 return nil
38414 }
38415
38416
38417 func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) {
38418 var done bool
38419 done, err = future.DoneWithContext(context.Background(), client)
38420 if err != nil {
38421 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
38422 return
38423 }
38424 if !done {
38425 ar.Response = future.Response()
38426 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture")
38427 return
38428 }
38429 ar.Response = future.Response()
38430 return
38431 }
38432
38433
38434 type VirtualNetworkPropertiesFormat struct {
38435
38436 AddressSpace *AddressSpace `json:"addressSpace,omitempty"`
38437
38438 DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"`
38439
38440 Subnets *[]Subnet `json:"subnets,omitempty"`
38441
38442 VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"`
38443
38444 ResourceGUID *string `json:"resourceGuid,omitempty"`
38445
38446 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
38447
38448 EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"`
38449
38450 EnableVMProtection *bool `json:"enableVmProtection,omitempty"`
38451
38452 DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"`
38453
38454 BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"`
38455
38456 IPAllocations *[]SubResource `json:"ipAllocations,omitempty"`
38457 }
38458
38459
38460 func (vnpf VirtualNetworkPropertiesFormat) MarshalJSON() ([]byte, error) {
38461 objectMap := make(map[string]interface{})
38462 if vnpf.AddressSpace != nil {
38463 objectMap["addressSpace"] = vnpf.AddressSpace
38464 }
38465 if vnpf.DhcpOptions != nil {
38466 objectMap["dhcpOptions"] = vnpf.DhcpOptions
38467 }
38468 if vnpf.Subnets != nil {
38469 objectMap["subnets"] = vnpf.Subnets
38470 }
38471 if vnpf.VirtualNetworkPeerings != nil {
38472 objectMap["virtualNetworkPeerings"] = vnpf.VirtualNetworkPeerings
38473 }
38474 if vnpf.EnableDdosProtection != nil {
38475 objectMap["enableDdosProtection"] = vnpf.EnableDdosProtection
38476 }
38477 if vnpf.EnableVMProtection != nil {
38478 objectMap["enableVmProtection"] = vnpf.EnableVMProtection
38479 }
38480 if vnpf.DdosProtectionPlan != nil {
38481 objectMap["ddosProtectionPlan"] = vnpf.DdosProtectionPlan
38482 }
38483 if vnpf.BgpCommunities != nil {
38484 objectMap["bgpCommunities"] = vnpf.BgpCommunities
38485 }
38486 if vnpf.IPAllocations != nil {
38487 objectMap["ipAllocations"] = vnpf.IPAllocations
38488 }
38489 return json.Marshal(objectMap)
38490 }
38491
38492
38493
38494 type VirtualNetworksCreateOrUpdateFuture struct {
38495 azure.FutureAPI
38496
38497
38498 Result func(VirtualNetworksClient) (VirtualNetwork, error)
38499 }
38500
38501
38502 func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
38503 var azFuture azure.Future
38504 if err := json.Unmarshal(body, &azFuture); err != nil {
38505 return err
38506 }
38507 future.FutureAPI = &azFuture
38508 future.Result = future.result
38509 return nil
38510 }
38511
38512
38513 func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) {
38514 var done bool
38515 done, err = future.DoneWithContext(context.Background(), client)
38516 if err != nil {
38517 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
38518 return
38519 }
38520 if !done {
38521 vn.Response.Response = future.Response()
38522 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture")
38523 return
38524 }
38525 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
38526 if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent {
38527 vn, err = client.CreateOrUpdateResponder(vn.Response.Response)
38528 if err != nil {
38529 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request")
38530 }
38531 }
38532 return
38533 }
38534
38535
38536
38537 type VirtualNetworksDeleteFuture struct {
38538 azure.FutureAPI
38539
38540
38541 Result func(VirtualNetworksClient) (autorest.Response, error)
38542 }
38543
38544
38545 func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error {
38546 var azFuture azure.Future
38547 if err := json.Unmarshal(body, &azFuture); err != nil {
38548 return err
38549 }
38550 future.FutureAPI = &azFuture
38551 future.Result = future.result
38552 return nil
38553 }
38554
38555
38556 func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) {
38557 var done bool
38558 done, err = future.DoneWithContext(context.Background(), client)
38559 if err != nil {
38560 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure")
38561 return
38562 }
38563 if !done {
38564 ar.Response = future.Response()
38565 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture")
38566 return
38567 }
38568 ar.Response = future.Response()
38569 return
38570 }
38571
38572
38573 type VirtualNetworkTap struct {
38574 autorest.Response `json:"-"`
38575
38576 *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"`
38577
38578 Etag *string `json:"etag,omitempty"`
38579
38580 ID *string `json:"id,omitempty"`
38581
38582 Name *string `json:"name,omitempty"`
38583
38584 Type *string `json:"type,omitempty"`
38585
38586 Location *string `json:"location,omitempty"`
38587
38588 Tags map[string]*string `json:"tags"`
38589 }
38590
38591
38592 func (vnt VirtualNetworkTap) MarshalJSON() ([]byte, error) {
38593 objectMap := make(map[string]interface{})
38594 if vnt.VirtualNetworkTapPropertiesFormat != nil {
38595 objectMap["properties"] = vnt.VirtualNetworkTapPropertiesFormat
38596 }
38597 if vnt.ID != nil {
38598 objectMap["id"] = vnt.ID
38599 }
38600 if vnt.Location != nil {
38601 objectMap["location"] = vnt.Location
38602 }
38603 if vnt.Tags != nil {
38604 objectMap["tags"] = vnt.Tags
38605 }
38606 return json.Marshal(objectMap)
38607 }
38608
38609
38610 func (vnt *VirtualNetworkTap) UnmarshalJSON(body []byte) error {
38611 var m map[string]*json.RawMessage
38612 err := json.Unmarshal(body, &m)
38613 if err != nil {
38614 return err
38615 }
38616 for k, v := range m {
38617 switch k {
38618 case "properties":
38619 if v != nil {
38620 var virtualNetworkTapPropertiesFormat VirtualNetworkTapPropertiesFormat
38621 err = json.Unmarshal(*v, &virtualNetworkTapPropertiesFormat)
38622 if err != nil {
38623 return err
38624 }
38625 vnt.VirtualNetworkTapPropertiesFormat = &virtualNetworkTapPropertiesFormat
38626 }
38627 case "etag":
38628 if v != nil {
38629 var etag string
38630 err = json.Unmarshal(*v, &etag)
38631 if err != nil {
38632 return err
38633 }
38634 vnt.Etag = &etag
38635 }
38636 case "id":
38637 if v != nil {
38638 var ID string
38639 err = json.Unmarshal(*v, &ID)
38640 if err != nil {
38641 return err
38642 }
38643 vnt.ID = &ID
38644 }
38645 case "name":
38646 if v != nil {
38647 var name string
38648 err = json.Unmarshal(*v, &name)
38649 if err != nil {
38650 return err
38651 }
38652 vnt.Name = &name
38653 }
38654 case "type":
38655 if v != nil {
38656 var typeVar string
38657 err = json.Unmarshal(*v, &typeVar)
38658 if err != nil {
38659 return err
38660 }
38661 vnt.Type = &typeVar
38662 }
38663 case "location":
38664 if v != nil {
38665 var location string
38666 err = json.Unmarshal(*v, &location)
38667 if err != nil {
38668 return err
38669 }
38670 vnt.Location = &location
38671 }
38672 case "tags":
38673 if v != nil {
38674 var tags map[string]*string
38675 err = json.Unmarshal(*v, &tags)
38676 if err != nil {
38677 return err
38678 }
38679 vnt.Tags = tags
38680 }
38681 }
38682 }
38683
38684 return nil
38685 }
38686
38687
38688 type VirtualNetworkTapListResult struct {
38689 autorest.Response `json:"-"`
38690
38691 Value *[]VirtualNetworkTap `json:"value,omitempty"`
38692
38693 NextLink *string `json:"nextLink,omitempty"`
38694 }
38695
38696
38697 type VirtualNetworkTapListResultIterator struct {
38698 i int
38699 page VirtualNetworkTapListResultPage
38700 }
38701
38702
38703
38704 func (iter *VirtualNetworkTapListResultIterator) NextWithContext(ctx context.Context) (err error) {
38705 if tracing.IsEnabled() {
38706 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapListResultIterator.NextWithContext")
38707 defer func() {
38708 sc := -1
38709 if iter.Response().Response.Response != nil {
38710 sc = iter.Response().Response.Response.StatusCode
38711 }
38712 tracing.EndSpan(ctx, sc, err)
38713 }()
38714 }
38715 iter.i++
38716 if iter.i < len(iter.page.Values()) {
38717 return nil
38718 }
38719 err = iter.page.NextWithContext(ctx)
38720 if err != nil {
38721 iter.i--
38722 return err
38723 }
38724 iter.i = 0
38725 return nil
38726 }
38727
38728
38729
38730
38731 func (iter *VirtualNetworkTapListResultIterator) Next() error {
38732 return iter.NextWithContext(context.Background())
38733 }
38734
38735
38736 func (iter VirtualNetworkTapListResultIterator) NotDone() bool {
38737 return iter.page.NotDone() && iter.i < len(iter.page.Values())
38738 }
38739
38740
38741 func (iter VirtualNetworkTapListResultIterator) Response() VirtualNetworkTapListResult {
38742 return iter.page.Response()
38743 }
38744
38745
38746
38747 func (iter VirtualNetworkTapListResultIterator) Value() VirtualNetworkTap {
38748 if !iter.page.NotDone() {
38749 return VirtualNetworkTap{}
38750 }
38751 return iter.page.Values()[iter.i]
38752 }
38753
38754
38755 func NewVirtualNetworkTapListResultIterator(page VirtualNetworkTapListResultPage) VirtualNetworkTapListResultIterator {
38756 return VirtualNetworkTapListResultIterator{page: page}
38757 }
38758
38759
38760 func (vntlr VirtualNetworkTapListResult) IsEmpty() bool {
38761 return vntlr.Value == nil || len(*vntlr.Value) == 0
38762 }
38763
38764
38765 func (vntlr VirtualNetworkTapListResult) hasNextLink() bool {
38766 return vntlr.NextLink != nil && len(*vntlr.NextLink) != 0
38767 }
38768
38769
38770
38771 func (vntlr VirtualNetworkTapListResult) virtualNetworkTapListResultPreparer(ctx context.Context) (*http.Request, error) {
38772 if !vntlr.hasNextLink() {
38773 return nil, nil
38774 }
38775 return autorest.Prepare((&http.Request{}).WithContext(ctx),
38776 autorest.AsJSON(),
38777 autorest.AsGet(),
38778 autorest.WithBaseURL(to.String(vntlr.NextLink)))
38779 }
38780
38781
38782 type VirtualNetworkTapListResultPage struct {
38783 fn func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error)
38784 vntlr VirtualNetworkTapListResult
38785 }
38786
38787
38788
38789 func (page *VirtualNetworkTapListResultPage) NextWithContext(ctx context.Context) (err error) {
38790 if tracing.IsEnabled() {
38791 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkTapListResultPage.NextWithContext")
38792 defer func() {
38793 sc := -1
38794 if page.Response().Response.Response != nil {
38795 sc = page.Response().Response.Response.StatusCode
38796 }
38797 tracing.EndSpan(ctx, sc, err)
38798 }()
38799 }
38800 for {
38801 next, err := page.fn(ctx, page.vntlr)
38802 if err != nil {
38803 return err
38804 }
38805 page.vntlr = next
38806 if !next.hasNextLink() || !next.IsEmpty() {
38807 break
38808 }
38809 }
38810 return nil
38811 }
38812
38813
38814
38815
38816 func (page *VirtualNetworkTapListResultPage) Next() error {
38817 return page.NextWithContext(context.Background())
38818 }
38819
38820
38821 func (page VirtualNetworkTapListResultPage) NotDone() bool {
38822 return !page.vntlr.IsEmpty()
38823 }
38824
38825
38826 func (page VirtualNetworkTapListResultPage) Response() VirtualNetworkTapListResult {
38827 return page.vntlr
38828 }
38829
38830
38831 func (page VirtualNetworkTapListResultPage) Values() []VirtualNetworkTap {
38832 if page.vntlr.IsEmpty() {
38833 return nil
38834 }
38835 return *page.vntlr.Value
38836 }
38837
38838
38839 func NewVirtualNetworkTapListResultPage(cur VirtualNetworkTapListResult, getNextPage func(context.Context, VirtualNetworkTapListResult) (VirtualNetworkTapListResult, error)) VirtualNetworkTapListResultPage {
38840 return VirtualNetworkTapListResultPage{
38841 fn: getNextPage,
38842 vntlr: cur,
38843 }
38844 }
38845
38846
38847 type VirtualNetworkTapPropertiesFormat struct {
38848
38849 NetworkInterfaceTapConfigurations *[]InterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"`
38850
38851 ResourceGUID *string `json:"resourceGuid,omitempty"`
38852
38853 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
38854
38855 DestinationNetworkInterfaceIPConfiguration *InterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"`
38856
38857 DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"`
38858
38859 DestinationPort *int32 `json:"destinationPort,omitempty"`
38860 }
38861
38862
38863 func (vntpf VirtualNetworkTapPropertiesFormat) MarshalJSON() ([]byte, error) {
38864 objectMap := make(map[string]interface{})
38865 if vntpf.DestinationNetworkInterfaceIPConfiguration != nil {
38866 objectMap["destinationNetworkInterfaceIPConfiguration"] = vntpf.DestinationNetworkInterfaceIPConfiguration
38867 }
38868 if vntpf.DestinationLoadBalancerFrontEndIPConfiguration != nil {
38869 objectMap["destinationLoadBalancerFrontEndIPConfiguration"] = vntpf.DestinationLoadBalancerFrontEndIPConfiguration
38870 }
38871 if vntpf.DestinationPort != nil {
38872 objectMap["destinationPort"] = vntpf.DestinationPort
38873 }
38874 return json.Marshal(objectMap)
38875 }
38876
38877
38878
38879 type VirtualNetworkTapsCreateOrUpdateFuture struct {
38880 azure.FutureAPI
38881
38882
38883 Result func(VirtualNetworkTapsClient) (VirtualNetworkTap, error)
38884 }
38885
38886
38887 func (future *VirtualNetworkTapsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
38888 var azFuture azure.Future
38889 if err := json.Unmarshal(body, &azFuture); err != nil {
38890 return err
38891 }
38892 future.FutureAPI = &azFuture
38893 future.Result = future.result
38894 return nil
38895 }
38896
38897
38898 func (future *VirtualNetworkTapsCreateOrUpdateFuture) result(client VirtualNetworkTapsClient) (vnt VirtualNetworkTap, err error) {
38899 var done bool
38900 done, err = future.DoneWithContext(context.Background(), client)
38901 if err != nil {
38902 err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
38903 return
38904 }
38905 if !done {
38906 vnt.Response.Response = future.Response()
38907 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsCreateOrUpdateFuture")
38908 return
38909 }
38910 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
38911 if vnt.Response.Response, err = future.GetResult(sender); err == nil && vnt.Response.Response.StatusCode != http.StatusNoContent {
38912 vnt, err = client.CreateOrUpdateResponder(vnt.Response.Response)
38913 if err != nil {
38914 err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsCreateOrUpdateFuture", "Result", vnt.Response.Response, "Failure responding to request")
38915 }
38916 }
38917 return
38918 }
38919
38920
38921
38922 type VirtualNetworkTapsDeleteFuture struct {
38923 azure.FutureAPI
38924
38925
38926 Result func(VirtualNetworkTapsClient) (autorest.Response, error)
38927 }
38928
38929
38930 func (future *VirtualNetworkTapsDeleteFuture) UnmarshalJSON(body []byte) error {
38931 var azFuture azure.Future
38932 if err := json.Unmarshal(body, &azFuture); err != nil {
38933 return err
38934 }
38935 future.FutureAPI = &azFuture
38936 future.Result = future.result
38937 return nil
38938 }
38939
38940
38941 func (future *VirtualNetworkTapsDeleteFuture) result(client VirtualNetworkTapsClient) (ar autorest.Response, err error) {
38942 var done bool
38943 done, err = future.DoneWithContext(context.Background(), client)
38944 if err != nil {
38945 err = autorest.NewErrorWithError(err, "network.VirtualNetworkTapsDeleteFuture", "Result", future.Response(), "Polling failure")
38946 return
38947 }
38948 if !done {
38949 ar.Response = future.Response()
38950 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkTapsDeleteFuture")
38951 return
38952 }
38953 ar.Response = future.Response()
38954 return
38955 }
38956
38957
38958 type VirtualNetworkUsage struct {
38959
38960 CurrentValue *float64 `json:"currentValue,omitempty"`
38961
38962 ID *string `json:"id,omitempty"`
38963
38964 Limit *float64 `json:"limit,omitempty"`
38965
38966 Name *VirtualNetworkUsageName `json:"name,omitempty"`
38967
38968 Unit *string `json:"unit,omitempty"`
38969 }
38970
38971
38972 func (vnu VirtualNetworkUsage) MarshalJSON() ([]byte, error) {
38973 objectMap := make(map[string]interface{})
38974 return json.Marshal(objectMap)
38975 }
38976
38977
38978 type VirtualNetworkUsageName struct {
38979
38980 LocalizedValue *string `json:"localizedValue,omitempty"`
38981
38982 Value *string `json:"value,omitempty"`
38983 }
38984
38985
38986 func (vnun VirtualNetworkUsageName) MarshalJSON() ([]byte, error) {
38987 objectMap := make(map[string]interface{})
38988 return json.Marshal(objectMap)
38989 }
38990
38991
38992 type VirtualRouter struct {
38993 autorest.Response `json:"-"`
38994
38995 *VirtualRouterPropertiesFormat `json:"properties,omitempty"`
38996
38997 Etag *string `json:"etag,omitempty"`
38998
38999 ID *string `json:"id,omitempty"`
39000
39001 Name *string `json:"name,omitempty"`
39002
39003 Type *string `json:"type,omitempty"`
39004
39005 Location *string `json:"location,omitempty"`
39006
39007 Tags map[string]*string `json:"tags"`
39008 }
39009
39010
39011 func (vr VirtualRouter) MarshalJSON() ([]byte, error) {
39012 objectMap := make(map[string]interface{})
39013 if vr.VirtualRouterPropertiesFormat != nil {
39014 objectMap["properties"] = vr.VirtualRouterPropertiesFormat
39015 }
39016 if vr.ID != nil {
39017 objectMap["id"] = vr.ID
39018 }
39019 if vr.Location != nil {
39020 objectMap["location"] = vr.Location
39021 }
39022 if vr.Tags != nil {
39023 objectMap["tags"] = vr.Tags
39024 }
39025 return json.Marshal(objectMap)
39026 }
39027
39028
39029 func (vr *VirtualRouter) UnmarshalJSON(body []byte) error {
39030 var m map[string]*json.RawMessage
39031 err := json.Unmarshal(body, &m)
39032 if err != nil {
39033 return err
39034 }
39035 for k, v := range m {
39036 switch k {
39037 case "properties":
39038 if v != nil {
39039 var virtualRouterPropertiesFormat VirtualRouterPropertiesFormat
39040 err = json.Unmarshal(*v, &virtualRouterPropertiesFormat)
39041 if err != nil {
39042 return err
39043 }
39044 vr.VirtualRouterPropertiesFormat = &virtualRouterPropertiesFormat
39045 }
39046 case "etag":
39047 if v != nil {
39048 var etag string
39049 err = json.Unmarshal(*v, &etag)
39050 if err != nil {
39051 return err
39052 }
39053 vr.Etag = &etag
39054 }
39055 case "id":
39056 if v != nil {
39057 var ID string
39058 err = json.Unmarshal(*v, &ID)
39059 if err != nil {
39060 return err
39061 }
39062 vr.ID = &ID
39063 }
39064 case "name":
39065 if v != nil {
39066 var name string
39067 err = json.Unmarshal(*v, &name)
39068 if err != nil {
39069 return err
39070 }
39071 vr.Name = &name
39072 }
39073 case "type":
39074 if v != nil {
39075 var typeVar string
39076 err = json.Unmarshal(*v, &typeVar)
39077 if err != nil {
39078 return err
39079 }
39080 vr.Type = &typeVar
39081 }
39082 case "location":
39083 if v != nil {
39084 var location string
39085 err = json.Unmarshal(*v, &location)
39086 if err != nil {
39087 return err
39088 }
39089 vr.Location = &location
39090 }
39091 case "tags":
39092 if v != nil {
39093 var tags map[string]*string
39094 err = json.Unmarshal(*v, &tags)
39095 if err != nil {
39096 return err
39097 }
39098 vr.Tags = tags
39099 }
39100 }
39101 }
39102
39103 return nil
39104 }
39105
39106
39107 type VirtualRouterListResult struct {
39108 autorest.Response `json:"-"`
39109
39110 Value *[]VirtualRouter `json:"value,omitempty"`
39111
39112 NextLink *string `json:"nextLink,omitempty"`
39113 }
39114
39115
39116 type VirtualRouterListResultIterator struct {
39117 i int
39118 page VirtualRouterListResultPage
39119 }
39120
39121
39122
39123 func (iter *VirtualRouterListResultIterator) NextWithContext(ctx context.Context) (err error) {
39124 if tracing.IsEnabled() {
39125 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterListResultIterator.NextWithContext")
39126 defer func() {
39127 sc := -1
39128 if iter.Response().Response.Response != nil {
39129 sc = iter.Response().Response.Response.StatusCode
39130 }
39131 tracing.EndSpan(ctx, sc, err)
39132 }()
39133 }
39134 iter.i++
39135 if iter.i < len(iter.page.Values()) {
39136 return nil
39137 }
39138 err = iter.page.NextWithContext(ctx)
39139 if err != nil {
39140 iter.i--
39141 return err
39142 }
39143 iter.i = 0
39144 return nil
39145 }
39146
39147
39148
39149
39150 func (iter *VirtualRouterListResultIterator) Next() error {
39151 return iter.NextWithContext(context.Background())
39152 }
39153
39154
39155 func (iter VirtualRouterListResultIterator) NotDone() bool {
39156 return iter.page.NotDone() && iter.i < len(iter.page.Values())
39157 }
39158
39159
39160 func (iter VirtualRouterListResultIterator) Response() VirtualRouterListResult {
39161 return iter.page.Response()
39162 }
39163
39164
39165
39166 func (iter VirtualRouterListResultIterator) Value() VirtualRouter {
39167 if !iter.page.NotDone() {
39168 return VirtualRouter{}
39169 }
39170 return iter.page.Values()[iter.i]
39171 }
39172
39173
39174 func NewVirtualRouterListResultIterator(page VirtualRouterListResultPage) VirtualRouterListResultIterator {
39175 return VirtualRouterListResultIterator{page: page}
39176 }
39177
39178
39179 func (vrlr VirtualRouterListResult) IsEmpty() bool {
39180 return vrlr.Value == nil || len(*vrlr.Value) == 0
39181 }
39182
39183
39184 func (vrlr VirtualRouterListResult) hasNextLink() bool {
39185 return vrlr.NextLink != nil && len(*vrlr.NextLink) != 0
39186 }
39187
39188
39189
39190 func (vrlr VirtualRouterListResult) virtualRouterListResultPreparer(ctx context.Context) (*http.Request, error) {
39191 if !vrlr.hasNextLink() {
39192 return nil, nil
39193 }
39194 return autorest.Prepare((&http.Request{}).WithContext(ctx),
39195 autorest.AsJSON(),
39196 autorest.AsGet(),
39197 autorest.WithBaseURL(to.String(vrlr.NextLink)))
39198 }
39199
39200
39201 type VirtualRouterListResultPage struct {
39202 fn func(context.Context, VirtualRouterListResult) (VirtualRouterListResult, error)
39203 vrlr VirtualRouterListResult
39204 }
39205
39206
39207
39208 func (page *VirtualRouterListResultPage) NextWithContext(ctx context.Context) (err error) {
39209 if tracing.IsEnabled() {
39210 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterListResultPage.NextWithContext")
39211 defer func() {
39212 sc := -1
39213 if page.Response().Response.Response != nil {
39214 sc = page.Response().Response.Response.StatusCode
39215 }
39216 tracing.EndSpan(ctx, sc, err)
39217 }()
39218 }
39219 for {
39220 next, err := page.fn(ctx, page.vrlr)
39221 if err != nil {
39222 return err
39223 }
39224 page.vrlr = next
39225 if !next.hasNextLink() || !next.IsEmpty() {
39226 break
39227 }
39228 }
39229 return nil
39230 }
39231
39232
39233
39234
39235 func (page *VirtualRouterListResultPage) Next() error {
39236 return page.NextWithContext(context.Background())
39237 }
39238
39239
39240 func (page VirtualRouterListResultPage) NotDone() bool {
39241 return !page.vrlr.IsEmpty()
39242 }
39243
39244
39245 func (page VirtualRouterListResultPage) Response() VirtualRouterListResult {
39246 return page.vrlr
39247 }
39248
39249
39250 func (page VirtualRouterListResultPage) Values() []VirtualRouter {
39251 if page.vrlr.IsEmpty() {
39252 return nil
39253 }
39254 return *page.vrlr.Value
39255 }
39256
39257
39258 func NewVirtualRouterListResultPage(cur VirtualRouterListResult, getNextPage func(context.Context, VirtualRouterListResult) (VirtualRouterListResult, error)) VirtualRouterListResultPage {
39259 return VirtualRouterListResultPage{
39260 fn: getNextPage,
39261 vrlr: cur,
39262 }
39263 }
39264
39265
39266 type VirtualRouterPeering struct {
39267 autorest.Response `json:"-"`
39268
39269 *VirtualRouterPeeringProperties `json:"properties,omitempty"`
39270
39271 Name *string `json:"name,omitempty"`
39272
39273 Etag *string `json:"etag,omitempty"`
39274
39275 Type *string `json:"type,omitempty"`
39276
39277 ID *string `json:"id,omitempty"`
39278 }
39279
39280
39281 func (vrp VirtualRouterPeering) MarshalJSON() ([]byte, error) {
39282 objectMap := make(map[string]interface{})
39283 if vrp.VirtualRouterPeeringProperties != nil {
39284 objectMap["properties"] = vrp.VirtualRouterPeeringProperties
39285 }
39286 if vrp.Name != nil {
39287 objectMap["name"] = vrp.Name
39288 }
39289 if vrp.ID != nil {
39290 objectMap["id"] = vrp.ID
39291 }
39292 return json.Marshal(objectMap)
39293 }
39294
39295
39296 func (vrp *VirtualRouterPeering) UnmarshalJSON(body []byte) error {
39297 var m map[string]*json.RawMessage
39298 err := json.Unmarshal(body, &m)
39299 if err != nil {
39300 return err
39301 }
39302 for k, v := range m {
39303 switch k {
39304 case "properties":
39305 if v != nil {
39306 var virtualRouterPeeringProperties VirtualRouterPeeringProperties
39307 err = json.Unmarshal(*v, &virtualRouterPeeringProperties)
39308 if err != nil {
39309 return err
39310 }
39311 vrp.VirtualRouterPeeringProperties = &virtualRouterPeeringProperties
39312 }
39313 case "name":
39314 if v != nil {
39315 var name string
39316 err = json.Unmarshal(*v, &name)
39317 if err != nil {
39318 return err
39319 }
39320 vrp.Name = &name
39321 }
39322 case "etag":
39323 if v != nil {
39324 var etag string
39325 err = json.Unmarshal(*v, &etag)
39326 if err != nil {
39327 return err
39328 }
39329 vrp.Etag = &etag
39330 }
39331 case "type":
39332 if v != nil {
39333 var typeVar string
39334 err = json.Unmarshal(*v, &typeVar)
39335 if err != nil {
39336 return err
39337 }
39338 vrp.Type = &typeVar
39339 }
39340 case "id":
39341 if v != nil {
39342 var ID string
39343 err = json.Unmarshal(*v, &ID)
39344 if err != nil {
39345 return err
39346 }
39347 vrp.ID = &ID
39348 }
39349 }
39350 }
39351
39352 return nil
39353 }
39354
39355
39356 type VirtualRouterPeeringListResult struct {
39357 autorest.Response `json:"-"`
39358
39359 Value *[]VirtualRouterPeering `json:"value,omitempty"`
39360
39361 NextLink *string `json:"nextLink,omitempty"`
39362 }
39363
39364
39365
39366 type VirtualRouterPeeringListResultIterator struct {
39367 i int
39368 page VirtualRouterPeeringListResultPage
39369 }
39370
39371
39372
39373 func (iter *VirtualRouterPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) {
39374 if tracing.IsEnabled() {
39375 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringListResultIterator.NextWithContext")
39376 defer func() {
39377 sc := -1
39378 if iter.Response().Response.Response != nil {
39379 sc = iter.Response().Response.Response.StatusCode
39380 }
39381 tracing.EndSpan(ctx, sc, err)
39382 }()
39383 }
39384 iter.i++
39385 if iter.i < len(iter.page.Values()) {
39386 return nil
39387 }
39388 err = iter.page.NextWithContext(ctx)
39389 if err != nil {
39390 iter.i--
39391 return err
39392 }
39393 iter.i = 0
39394 return nil
39395 }
39396
39397
39398
39399
39400 func (iter *VirtualRouterPeeringListResultIterator) Next() error {
39401 return iter.NextWithContext(context.Background())
39402 }
39403
39404
39405 func (iter VirtualRouterPeeringListResultIterator) NotDone() bool {
39406 return iter.page.NotDone() && iter.i < len(iter.page.Values())
39407 }
39408
39409
39410 func (iter VirtualRouterPeeringListResultIterator) Response() VirtualRouterPeeringListResult {
39411 return iter.page.Response()
39412 }
39413
39414
39415
39416 func (iter VirtualRouterPeeringListResultIterator) Value() VirtualRouterPeering {
39417 if !iter.page.NotDone() {
39418 return VirtualRouterPeering{}
39419 }
39420 return iter.page.Values()[iter.i]
39421 }
39422
39423
39424 func NewVirtualRouterPeeringListResultIterator(page VirtualRouterPeeringListResultPage) VirtualRouterPeeringListResultIterator {
39425 return VirtualRouterPeeringListResultIterator{page: page}
39426 }
39427
39428
39429 func (vrplr VirtualRouterPeeringListResult) IsEmpty() bool {
39430 return vrplr.Value == nil || len(*vrplr.Value) == 0
39431 }
39432
39433
39434 func (vrplr VirtualRouterPeeringListResult) hasNextLink() bool {
39435 return vrplr.NextLink != nil && len(*vrplr.NextLink) != 0
39436 }
39437
39438
39439
39440 func (vrplr VirtualRouterPeeringListResult) virtualRouterPeeringListResultPreparer(ctx context.Context) (*http.Request, error) {
39441 if !vrplr.hasNextLink() {
39442 return nil, nil
39443 }
39444 return autorest.Prepare((&http.Request{}).WithContext(ctx),
39445 autorest.AsJSON(),
39446 autorest.AsGet(),
39447 autorest.WithBaseURL(to.String(vrplr.NextLink)))
39448 }
39449
39450
39451 type VirtualRouterPeeringListResultPage struct {
39452 fn func(context.Context, VirtualRouterPeeringListResult) (VirtualRouterPeeringListResult, error)
39453 vrplr VirtualRouterPeeringListResult
39454 }
39455
39456
39457
39458 func (page *VirtualRouterPeeringListResultPage) NextWithContext(ctx context.Context) (err error) {
39459 if tracing.IsEnabled() {
39460 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualRouterPeeringListResultPage.NextWithContext")
39461 defer func() {
39462 sc := -1
39463 if page.Response().Response.Response != nil {
39464 sc = page.Response().Response.Response.StatusCode
39465 }
39466 tracing.EndSpan(ctx, sc, err)
39467 }()
39468 }
39469 for {
39470 next, err := page.fn(ctx, page.vrplr)
39471 if err != nil {
39472 return err
39473 }
39474 page.vrplr = next
39475 if !next.hasNextLink() || !next.IsEmpty() {
39476 break
39477 }
39478 }
39479 return nil
39480 }
39481
39482
39483
39484
39485 func (page *VirtualRouterPeeringListResultPage) Next() error {
39486 return page.NextWithContext(context.Background())
39487 }
39488
39489
39490 func (page VirtualRouterPeeringListResultPage) NotDone() bool {
39491 return !page.vrplr.IsEmpty()
39492 }
39493
39494
39495 func (page VirtualRouterPeeringListResultPage) Response() VirtualRouterPeeringListResult {
39496 return page.vrplr
39497 }
39498
39499
39500 func (page VirtualRouterPeeringListResultPage) Values() []VirtualRouterPeering {
39501 if page.vrplr.IsEmpty() {
39502 return nil
39503 }
39504 return *page.vrplr.Value
39505 }
39506
39507
39508 func NewVirtualRouterPeeringListResultPage(cur VirtualRouterPeeringListResult, getNextPage func(context.Context, VirtualRouterPeeringListResult) (VirtualRouterPeeringListResult, error)) VirtualRouterPeeringListResultPage {
39509 return VirtualRouterPeeringListResultPage{
39510 fn: getNextPage,
39511 vrplr: cur,
39512 }
39513 }
39514
39515
39516 type VirtualRouterPeeringProperties struct {
39517
39518 PeerAsn *int64 `json:"peerAsn,omitempty"`
39519
39520 PeerIP *string `json:"peerIp,omitempty"`
39521
39522 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
39523 }
39524
39525
39526 func (vrpp VirtualRouterPeeringProperties) MarshalJSON() ([]byte, error) {
39527 objectMap := make(map[string]interface{})
39528 if vrpp.PeerAsn != nil {
39529 objectMap["peerAsn"] = vrpp.PeerAsn
39530 }
39531 if vrpp.PeerIP != nil {
39532 objectMap["peerIp"] = vrpp.PeerIP
39533 }
39534 return json.Marshal(objectMap)
39535 }
39536
39537
39538
39539 type VirtualRouterPeeringsCreateOrUpdateFuture struct {
39540 azure.FutureAPI
39541
39542
39543 Result func(VirtualRouterPeeringsClient) (VirtualRouterPeering, error)
39544 }
39545
39546
39547 func (future *VirtualRouterPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
39548 var azFuture azure.Future
39549 if err := json.Unmarshal(body, &azFuture); err != nil {
39550 return err
39551 }
39552 future.FutureAPI = &azFuture
39553 future.Result = future.result
39554 return nil
39555 }
39556
39557
39558 func (future *VirtualRouterPeeringsCreateOrUpdateFuture) result(client VirtualRouterPeeringsClient) (vrp VirtualRouterPeering, err error) {
39559 var done bool
39560 done, err = future.DoneWithContext(context.Background(), client)
39561 if err != nil {
39562 err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
39563 return
39564 }
39565 if !done {
39566 vrp.Response.Response = future.Response()
39567 err = azure.NewAsyncOpIncompleteError("network.VirtualRouterPeeringsCreateOrUpdateFuture")
39568 return
39569 }
39570 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
39571 if vrp.Response.Response, err = future.GetResult(sender); err == nil && vrp.Response.Response.StatusCode != http.StatusNoContent {
39572 vrp, err = client.CreateOrUpdateResponder(vrp.Response.Response)
39573 if err != nil {
39574 err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsCreateOrUpdateFuture", "Result", vrp.Response.Response, "Failure responding to request")
39575 }
39576 }
39577 return
39578 }
39579
39580
39581
39582 type VirtualRouterPeeringsDeleteFuture struct {
39583 azure.FutureAPI
39584
39585
39586 Result func(VirtualRouterPeeringsClient) (autorest.Response, error)
39587 }
39588
39589
39590 func (future *VirtualRouterPeeringsDeleteFuture) UnmarshalJSON(body []byte) error {
39591 var azFuture azure.Future
39592 if err := json.Unmarshal(body, &azFuture); err != nil {
39593 return err
39594 }
39595 future.FutureAPI = &azFuture
39596 future.Result = future.result
39597 return nil
39598 }
39599
39600
39601 func (future *VirtualRouterPeeringsDeleteFuture) result(client VirtualRouterPeeringsClient) (ar autorest.Response, err error) {
39602 var done bool
39603 done, err = future.DoneWithContext(context.Background(), client)
39604 if err != nil {
39605 err = autorest.NewErrorWithError(err, "network.VirtualRouterPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
39606 return
39607 }
39608 if !done {
39609 ar.Response = future.Response()
39610 err = azure.NewAsyncOpIncompleteError("network.VirtualRouterPeeringsDeleteFuture")
39611 return
39612 }
39613 ar.Response = future.Response()
39614 return
39615 }
39616
39617
39618 type VirtualRouterPropertiesFormat struct {
39619
39620 VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"`
39621
39622 VirtualRouterIps *[]string `json:"virtualRouterIps,omitempty"`
39623
39624 HostedSubnet *SubResource `json:"hostedSubnet,omitempty"`
39625
39626 HostedGateway *SubResource `json:"hostedGateway,omitempty"`
39627
39628 Peerings *[]SubResource `json:"peerings,omitempty"`
39629
39630 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
39631 }
39632
39633
39634 func (vrpf VirtualRouterPropertiesFormat) MarshalJSON() ([]byte, error) {
39635 objectMap := make(map[string]interface{})
39636 if vrpf.VirtualRouterAsn != nil {
39637 objectMap["virtualRouterAsn"] = vrpf.VirtualRouterAsn
39638 }
39639 if vrpf.VirtualRouterIps != nil {
39640 objectMap["virtualRouterIps"] = vrpf.VirtualRouterIps
39641 }
39642 if vrpf.HostedSubnet != nil {
39643 objectMap["hostedSubnet"] = vrpf.HostedSubnet
39644 }
39645 if vrpf.HostedGateway != nil {
39646 objectMap["hostedGateway"] = vrpf.HostedGateway
39647 }
39648 return json.Marshal(objectMap)
39649 }
39650
39651
39652
39653 type VirtualRoutersCreateOrUpdateFuture struct {
39654 azure.FutureAPI
39655
39656
39657 Result func(VirtualRoutersClient) (VirtualRouter, error)
39658 }
39659
39660
39661 func (future *VirtualRoutersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
39662 var azFuture azure.Future
39663 if err := json.Unmarshal(body, &azFuture); err != nil {
39664 return err
39665 }
39666 future.FutureAPI = &azFuture
39667 future.Result = future.result
39668 return nil
39669 }
39670
39671
39672 func (future *VirtualRoutersCreateOrUpdateFuture) result(client VirtualRoutersClient) (vr VirtualRouter, err error) {
39673 var done bool
39674 done, err = future.DoneWithContext(context.Background(), client)
39675 if err != nil {
39676 err = autorest.NewErrorWithError(err, "network.VirtualRoutersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
39677 return
39678 }
39679 if !done {
39680 vr.Response.Response = future.Response()
39681 err = azure.NewAsyncOpIncompleteError("network.VirtualRoutersCreateOrUpdateFuture")
39682 return
39683 }
39684 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
39685 if vr.Response.Response, err = future.GetResult(sender); err == nil && vr.Response.Response.StatusCode != http.StatusNoContent {
39686 vr, err = client.CreateOrUpdateResponder(vr.Response.Response)
39687 if err != nil {
39688 err = autorest.NewErrorWithError(err, "network.VirtualRoutersCreateOrUpdateFuture", "Result", vr.Response.Response, "Failure responding to request")
39689 }
39690 }
39691 return
39692 }
39693
39694
39695
39696 type VirtualRoutersDeleteFuture struct {
39697 azure.FutureAPI
39698
39699
39700 Result func(VirtualRoutersClient) (autorest.Response, error)
39701 }
39702
39703
39704 func (future *VirtualRoutersDeleteFuture) UnmarshalJSON(body []byte) error {
39705 var azFuture azure.Future
39706 if err := json.Unmarshal(body, &azFuture); err != nil {
39707 return err
39708 }
39709 future.FutureAPI = &azFuture
39710 future.Result = future.result
39711 return nil
39712 }
39713
39714
39715 func (future *VirtualRoutersDeleteFuture) result(client VirtualRoutersClient) (ar autorest.Response, err error) {
39716 var done bool
39717 done, err = future.DoneWithContext(context.Background(), client)
39718 if err != nil {
39719 err = autorest.NewErrorWithError(err, "network.VirtualRoutersDeleteFuture", "Result", future.Response(), "Polling failure")
39720 return
39721 }
39722 if !done {
39723 ar.Response = future.Response()
39724 err = azure.NewAsyncOpIncompleteError("network.VirtualRoutersDeleteFuture")
39725 return
39726 }
39727 ar.Response = future.Response()
39728 return
39729 }
39730
39731
39732 type VirtualWAN struct {
39733 autorest.Response `json:"-"`
39734
39735 *VirtualWanProperties `json:"properties,omitempty"`
39736
39737 Etag *string `json:"etag,omitempty"`
39738
39739 ID *string `json:"id,omitempty"`
39740
39741 Name *string `json:"name,omitempty"`
39742
39743 Type *string `json:"type,omitempty"`
39744
39745 Location *string `json:"location,omitempty"`
39746
39747 Tags map[string]*string `json:"tags"`
39748 }
39749
39750
39751 func (vw VirtualWAN) MarshalJSON() ([]byte, error) {
39752 objectMap := make(map[string]interface{})
39753 if vw.VirtualWanProperties != nil {
39754 objectMap["properties"] = vw.VirtualWanProperties
39755 }
39756 if vw.ID != nil {
39757 objectMap["id"] = vw.ID
39758 }
39759 if vw.Location != nil {
39760 objectMap["location"] = vw.Location
39761 }
39762 if vw.Tags != nil {
39763 objectMap["tags"] = vw.Tags
39764 }
39765 return json.Marshal(objectMap)
39766 }
39767
39768
39769 func (vw *VirtualWAN) UnmarshalJSON(body []byte) error {
39770 var m map[string]*json.RawMessage
39771 err := json.Unmarshal(body, &m)
39772 if err != nil {
39773 return err
39774 }
39775 for k, v := range m {
39776 switch k {
39777 case "properties":
39778 if v != nil {
39779 var virtualWanProperties VirtualWanProperties
39780 err = json.Unmarshal(*v, &virtualWanProperties)
39781 if err != nil {
39782 return err
39783 }
39784 vw.VirtualWanProperties = &virtualWanProperties
39785 }
39786 case "etag":
39787 if v != nil {
39788 var etag string
39789 err = json.Unmarshal(*v, &etag)
39790 if err != nil {
39791 return err
39792 }
39793 vw.Etag = &etag
39794 }
39795 case "id":
39796 if v != nil {
39797 var ID string
39798 err = json.Unmarshal(*v, &ID)
39799 if err != nil {
39800 return err
39801 }
39802 vw.ID = &ID
39803 }
39804 case "name":
39805 if v != nil {
39806 var name string
39807 err = json.Unmarshal(*v, &name)
39808 if err != nil {
39809 return err
39810 }
39811 vw.Name = &name
39812 }
39813 case "type":
39814 if v != nil {
39815 var typeVar string
39816 err = json.Unmarshal(*v, &typeVar)
39817 if err != nil {
39818 return err
39819 }
39820 vw.Type = &typeVar
39821 }
39822 case "location":
39823 if v != nil {
39824 var location string
39825 err = json.Unmarshal(*v, &location)
39826 if err != nil {
39827 return err
39828 }
39829 vw.Location = &location
39830 }
39831 case "tags":
39832 if v != nil {
39833 var tags map[string]*string
39834 err = json.Unmarshal(*v, &tags)
39835 if err != nil {
39836 return err
39837 }
39838 vw.Tags = tags
39839 }
39840 }
39841 }
39842
39843 return nil
39844 }
39845
39846
39847 type VirtualWanProperties struct {
39848
39849 DisableVpnEncryption *bool `json:"disableVpnEncryption,omitempty"`
39850
39851 VirtualHubs *[]SubResource `json:"virtualHubs,omitempty"`
39852
39853 VpnSites *[]SubResource `json:"vpnSites,omitempty"`
39854
39855 AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"`
39856
39857 AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"`
39858
39859 Office365LocalBreakoutCategory OfficeTrafficCategory `json:"office365LocalBreakoutCategory,omitempty"`
39860
39861 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
39862
39863 Type *string `json:"type,omitempty"`
39864 }
39865
39866
39867 func (vwp VirtualWanProperties) MarshalJSON() ([]byte, error) {
39868 objectMap := make(map[string]interface{})
39869 if vwp.DisableVpnEncryption != nil {
39870 objectMap["disableVpnEncryption"] = vwp.DisableVpnEncryption
39871 }
39872 if vwp.AllowBranchToBranchTraffic != nil {
39873 objectMap["allowBranchToBranchTraffic"] = vwp.AllowBranchToBranchTraffic
39874 }
39875 if vwp.AllowVnetToVnetTraffic != nil {
39876 objectMap["allowVnetToVnetTraffic"] = vwp.AllowVnetToVnetTraffic
39877 }
39878 if vwp.Office365LocalBreakoutCategory != "" {
39879 objectMap["office365LocalBreakoutCategory"] = vwp.Office365LocalBreakoutCategory
39880 }
39881 if vwp.Type != nil {
39882 objectMap["type"] = vwp.Type
39883 }
39884 return json.Marshal(objectMap)
39885 }
39886
39887
39888
39889 type VirtualWansCreateOrUpdateFuture struct {
39890 azure.FutureAPI
39891
39892
39893 Result func(VirtualWansClient) (VirtualWAN, error)
39894 }
39895
39896
39897 func (future *VirtualWansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
39898 var azFuture azure.Future
39899 if err := json.Unmarshal(body, &azFuture); err != nil {
39900 return err
39901 }
39902 future.FutureAPI = &azFuture
39903 future.Result = future.result
39904 return nil
39905 }
39906
39907
39908 func (future *VirtualWansCreateOrUpdateFuture) result(client VirtualWansClient) (vw VirtualWAN, err error) {
39909 var done bool
39910 done, err = future.DoneWithContext(context.Background(), client)
39911 if err != nil {
39912 err = autorest.NewErrorWithError(err, "network.VirtualWansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
39913 return
39914 }
39915 if !done {
39916 vw.Response.Response = future.Response()
39917 err = azure.NewAsyncOpIncompleteError("network.VirtualWansCreateOrUpdateFuture")
39918 return
39919 }
39920 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
39921 if vw.Response.Response, err = future.GetResult(sender); err == nil && vw.Response.Response.StatusCode != http.StatusNoContent {
39922 vw, err = client.CreateOrUpdateResponder(vw.Response.Response)
39923 if err != nil {
39924 err = autorest.NewErrorWithError(err, "network.VirtualWansCreateOrUpdateFuture", "Result", vw.Response.Response, "Failure responding to request")
39925 }
39926 }
39927 return
39928 }
39929
39930
39931
39932 type VirtualWansDeleteFuture struct {
39933 azure.FutureAPI
39934
39935
39936 Result func(VirtualWansClient) (autorest.Response, error)
39937 }
39938
39939
39940 func (future *VirtualWansDeleteFuture) UnmarshalJSON(body []byte) error {
39941 var azFuture azure.Future
39942 if err := json.Unmarshal(body, &azFuture); err != nil {
39943 return err
39944 }
39945 future.FutureAPI = &azFuture
39946 future.Result = future.result
39947 return nil
39948 }
39949
39950
39951 func (future *VirtualWansDeleteFuture) result(client VirtualWansClient) (ar autorest.Response, err error) {
39952 var done bool
39953 done, err = future.DoneWithContext(context.Background(), client)
39954 if err != nil {
39955 err = autorest.NewErrorWithError(err, "network.VirtualWansDeleteFuture", "Result", future.Response(), "Polling failure")
39956 return
39957 }
39958 if !done {
39959 ar.Response = future.Response()
39960 err = azure.NewAsyncOpIncompleteError("network.VirtualWansDeleteFuture")
39961 return
39962 }
39963 ar.Response = future.Response()
39964 return
39965 }
39966
39967
39968 type VirtualWanSecurityProvider struct {
39969
39970 Name *string `json:"name,omitempty"`
39971
39972 URL *string `json:"url,omitempty"`
39973
39974 Type VirtualWanSecurityProviderType `json:"type,omitempty"`
39975 }
39976
39977
39978 type VirtualWanSecurityProviders struct {
39979 autorest.Response `json:"-"`
39980
39981 SupportedProviders *[]VirtualWanSecurityProvider `json:"supportedProviders,omitempty"`
39982 }
39983
39984
39985 type VirtualWanVpnProfileParameters struct {
39986
39987 VpnServerConfigurationResourceID *string `json:"vpnServerConfigurationResourceId,omitempty"`
39988
39989 AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"`
39990 }
39991
39992
39993 type VM struct {
39994
39995 ID *string `json:"id,omitempty"`
39996
39997 Name *string `json:"name,omitempty"`
39998
39999 Type *string `json:"type,omitempty"`
40000
40001 Location *string `json:"location,omitempty"`
40002
40003 Tags map[string]*string `json:"tags"`
40004 }
40005
40006
40007 func (vVar VM) MarshalJSON() ([]byte, error) {
40008 objectMap := make(map[string]interface{})
40009 if vVar.ID != nil {
40010 objectMap["id"] = vVar.ID
40011 }
40012 if vVar.Location != nil {
40013 objectMap["location"] = vVar.Location
40014 }
40015 if vVar.Tags != nil {
40016 objectMap["tags"] = vVar.Tags
40017 }
40018 return json.Marshal(objectMap)
40019 }
40020
40021
40022 type VnetRoute struct {
40023
40024 StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"`
40025 }
40026
40027
40028 type VpnClientConfiguration struct {
40029
40030 VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"`
40031
40032 VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"`
40033
40034 VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"`
40035
40036 VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"`
40037
40038 VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"`
40039
40040 RadiusServerAddress *string `json:"radiusServerAddress,omitempty"`
40041
40042 RadiusServerSecret *string `json:"radiusServerSecret,omitempty"`
40043
40044 RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"`
40045
40046 AadTenant *string `json:"aadTenant,omitempty"`
40047
40048 AadAudience *string `json:"aadAudience,omitempty"`
40049
40050 AadIssuer *string `json:"aadIssuer,omitempty"`
40051 }
40052
40053
40054 type VpnClientConnectionHealth struct {
40055
40056 TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"`
40057
40058 TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"`
40059
40060 VpnClientConnectionsCount *int32 `json:"vpnClientConnectionsCount,omitempty"`
40061
40062 AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"`
40063 }
40064
40065
40066 func (vcch VpnClientConnectionHealth) MarshalJSON() ([]byte, error) {
40067 objectMap := make(map[string]interface{})
40068 if vcch.VpnClientConnectionsCount != nil {
40069 objectMap["vpnClientConnectionsCount"] = vcch.VpnClientConnectionsCount
40070 }
40071 if vcch.AllocatedIPAddresses != nil {
40072 objectMap["allocatedIpAddresses"] = vcch.AllocatedIPAddresses
40073 }
40074 return json.Marshal(objectMap)
40075 }
40076
40077
40078 type VpnClientConnectionHealthDetail struct {
40079
40080 VpnConnectionID *string `json:"vpnConnectionId,omitempty"`
40081
40082 VpnConnectionDuration *int64 `json:"vpnConnectionDuration,omitempty"`
40083
40084 VpnConnectionTime *string `json:"vpnConnectionTime,omitempty"`
40085
40086 PublicIPAddress *string `json:"publicIpAddress,omitempty"`
40087
40088 PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
40089
40090 VpnUserName *string `json:"vpnUserName,omitempty"`
40091
40092 MaxBandwidth *int64 `json:"maxBandwidth,omitempty"`
40093
40094 EgressPacketsTransferred *int64 `json:"egressPacketsTransferred,omitempty"`
40095
40096 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
40097
40098 IngressPacketsTransferred *int64 `json:"ingressPacketsTransferred,omitempty"`
40099
40100 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
40101
40102 MaxPacketsPerSecond *int64 `json:"maxPacketsPerSecond,omitempty"`
40103 }
40104
40105
40106 func (vcchd VpnClientConnectionHealthDetail) MarshalJSON() ([]byte, error) {
40107 objectMap := make(map[string]interface{})
40108 return json.Marshal(objectMap)
40109 }
40110
40111
40112 type VpnClientConnectionHealthDetailListResult struct {
40113 autorest.Response `json:"-"`
40114
40115 Value *[]VpnClientConnectionHealthDetail `json:"value,omitempty"`
40116 }
40117
40118
40119 type VpnClientIPsecParameters struct {
40120 autorest.Response `json:"-"`
40121
40122 SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"`
40123
40124 SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"`
40125
40126 IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"`
40127
40128 IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"`
40129
40130 IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"`
40131
40132 IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"`
40133
40134 DhGroup DhGroup `json:"dhGroup,omitempty"`
40135
40136 PfsGroup PfsGroup `json:"pfsGroup,omitempty"`
40137 }
40138
40139
40140 type VpnClientParameters struct {
40141
40142 ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"`
40143
40144 AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"`
40145
40146 RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"`
40147
40148 ClientRootCertificates *[]string `json:"clientRootCertificates,omitempty"`
40149 }
40150
40151
40152 type VpnClientRevokedCertificate struct {
40153
40154 *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"`
40155
40156 Name *string `json:"name,omitempty"`
40157
40158 Etag *string `json:"etag,omitempty"`
40159
40160 ID *string `json:"id,omitempty"`
40161 }
40162
40163
40164 func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) {
40165 objectMap := make(map[string]interface{})
40166 if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil {
40167 objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat
40168 }
40169 if vcrc.Name != nil {
40170 objectMap["name"] = vcrc.Name
40171 }
40172 if vcrc.ID != nil {
40173 objectMap["id"] = vcrc.ID
40174 }
40175 return json.Marshal(objectMap)
40176 }
40177
40178
40179 func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error {
40180 var m map[string]*json.RawMessage
40181 err := json.Unmarshal(body, &m)
40182 if err != nil {
40183 return err
40184 }
40185 for k, v := range m {
40186 switch k {
40187 case "properties":
40188 if v != nil {
40189 var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat
40190 err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat)
40191 if err != nil {
40192 return err
40193 }
40194 vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat
40195 }
40196 case "name":
40197 if v != nil {
40198 var name string
40199 err = json.Unmarshal(*v, &name)
40200 if err != nil {
40201 return err
40202 }
40203 vcrc.Name = &name
40204 }
40205 case "etag":
40206 if v != nil {
40207 var etag string
40208 err = json.Unmarshal(*v, &etag)
40209 if err != nil {
40210 return err
40211 }
40212 vcrc.Etag = &etag
40213 }
40214 case "id":
40215 if v != nil {
40216 var ID string
40217 err = json.Unmarshal(*v, &ID)
40218 if err != nil {
40219 return err
40220 }
40221 vcrc.ID = &ID
40222 }
40223 }
40224 }
40225
40226 return nil
40227 }
40228
40229
40230
40231 type VpnClientRevokedCertificatePropertiesFormat struct {
40232
40233 Thumbprint *string `json:"thumbprint,omitempty"`
40234
40235 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
40236 }
40237
40238
40239 func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) {
40240 objectMap := make(map[string]interface{})
40241 if vcrcpf.Thumbprint != nil {
40242 objectMap["thumbprint"] = vcrcpf.Thumbprint
40243 }
40244 return json.Marshal(objectMap)
40245 }
40246
40247
40248 type VpnClientRootCertificate struct {
40249
40250 *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"`
40251
40252 Name *string `json:"name,omitempty"`
40253
40254 Etag *string `json:"etag,omitempty"`
40255
40256 ID *string `json:"id,omitempty"`
40257 }
40258
40259
40260 func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) {
40261 objectMap := make(map[string]interface{})
40262 if vcrc.VpnClientRootCertificatePropertiesFormat != nil {
40263 objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat
40264 }
40265 if vcrc.Name != nil {
40266 objectMap["name"] = vcrc.Name
40267 }
40268 if vcrc.ID != nil {
40269 objectMap["id"] = vcrc.ID
40270 }
40271 return json.Marshal(objectMap)
40272 }
40273
40274
40275 func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error {
40276 var m map[string]*json.RawMessage
40277 err := json.Unmarshal(body, &m)
40278 if err != nil {
40279 return err
40280 }
40281 for k, v := range m {
40282 switch k {
40283 case "properties":
40284 if v != nil {
40285 var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat
40286 err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat)
40287 if err != nil {
40288 return err
40289 }
40290 vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat
40291 }
40292 case "name":
40293 if v != nil {
40294 var name string
40295 err = json.Unmarshal(*v, &name)
40296 if err != nil {
40297 return err
40298 }
40299 vcrc.Name = &name
40300 }
40301 case "etag":
40302 if v != nil {
40303 var etag string
40304 err = json.Unmarshal(*v, &etag)
40305 if err != nil {
40306 return err
40307 }
40308 vcrc.Etag = &etag
40309 }
40310 case "id":
40311 if v != nil {
40312 var ID string
40313 err = json.Unmarshal(*v, &ID)
40314 if err != nil {
40315 return err
40316 }
40317 vcrc.ID = &ID
40318 }
40319 }
40320 }
40321
40322 return nil
40323 }
40324
40325
40326 type VpnClientRootCertificatePropertiesFormat struct {
40327
40328 PublicCertData *string `json:"publicCertData,omitempty"`
40329
40330 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
40331 }
40332
40333
40334 func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) {
40335 objectMap := make(map[string]interface{})
40336 if vcrcpf.PublicCertData != nil {
40337 objectMap["publicCertData"] = vcrcpf.PublicCertData
40338 }
40339 return json.Marshal(objectMap)
40340 }
40341
40342
40343 type VpnConnection struct {
40344 autorest.Response `json:"-"`
40345
40346 *VpnConnectionProperties `json:"properties,omitempty"`
40347
40348 Name *string `json:"name,omitempty"`
40349
40350 Etag *string `json:"etag,omitempty"`
40351
40352 ID *string `json:"id,omitempty"`
40353 }
40354
40355
40356 func (vc VpnConnection) MarshalJSON() ([]byte, error) {
40357 objectMap := make(map[string]interface{})
40358 if vc.VpnConnectionProperties != nil {
40359 objectMap["properties"] = vc.VpnConnectionProperties
40360 }
40361 if vc.Name != nil {
40362 objectMap["name"] = vc.Name
40363 }
40364 if vc.ID != nil {
40365 objectMap["id"] = vc.ID
40366 }
40367 return json.Marshal(objectMap)
40368 }
40369
40370
40371 func (vc *VpnConnection) UnmarshalJSON(body []byte) error {
40372 var m map[string]*json.RawMessage
40373 err := json.Unmarshal(body, &m)
40374 if err != nil {
40375 return err
40376 }
40377 for k, v := range m {
40378 switch k {
40379 case "properties":
40380 if v != nil {
40381 var vpnConnectionProperties VpnConnectionProperties
40382 err = json.Unmarshal(*v, &vpnConnectionProperties)
40383 if err != nil {
40384 return err
40385 }
40386 vc.VpnConnectionProperties = &vpnConnectionProperties
40387 }
40388 case "name":
40389 if v != nil {
40390 var name string
40391 err = json.Unmarshal(*v, &name)
40392 if err != nil {
40393 return err
40394 }
40395 vc.Name = &name
40396 }
40397 case "etag":
40398 if v != nil {
40399 var etag string
40400 err = json.Unmarshal(*v, &etag)
40401 if err != nil {
40402 return err
40403 }
40404 vc.Etag = &etag
40405 }
40406 case "id":
40407 if v != nil {
40408 var ID string
40409 err = json.Unmarshal(*v, &ID)
40410 if err != nil {
40411 return err
40412 }
40413 vc.ID = &ID
40414 }
40415 }
40416 }
40417
40418 return nil
40419 }
40420
40421
40422 type VpnConnectionProperties struct {
40423
40424 RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"`
40425
40426 RoutingWeight *int32 `json:"routingWeight,omitempty"`
40427
40428 DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"`
40429
40430 ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"`
40431
40432 VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"`
40433
40434 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
40435
40436 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
40437
40438 ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"`
40439
40440 SharedKey *string `json:"sharedKey,omitempty"`
40441
40442 EnableBgp *bool `json:"enableBgp,omitempty"`
40443
40444 UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"`
40445
40446 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"`
40447
40448 EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"`
40449
40450 EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"`
40451
40452 UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"`
40453
40454 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
40455
40456 VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"`
40457
40458 RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"`
40459 }
40460
40461
40462 func (vcp VpnConnectionProperties) MarshalJSON() ([]byte, error) {
40463 objectMap := make(map[string]interface{})
40464 if vcp.RemoteVpnSite != nil {
40465 objectMap["remoteVpnSite"] = vcp.RemoteVpnSite
40466 }
40467 if vcp.RoutingWeight != nil {
40468 objectMap["routingWeight"] = vcp.RoutingWeight
40469 }
40470 if vcp.DpdTimeoutSeconds != nil {
40471 objectMap["dpdTimeoutSeconds"] = vcp.DpdTimeoutSeconds
40472 }
40473 if vcp.ConnectionStatus != "" {
40474 objectMap["connectionStatus"] = vcp.ConnectionStatus
40475 }
40476 if vcp.VpnConnectionProtocolType != "" {
40477 objectMap["vpnConnectionProtocolType"] = vcp.VpnConnectionProtocolType
40478 }
40479 if vcp.ConnectionBandwidth != nil {
40480 objectMap["connectionBandwidth"] = vcp.ConnectionBandwidth
40481 }
40482 if vcp.SharedKey != nil {
40483 objectMap["sharedKey"] = vcp.SharedKey
40484 }
40485 if vcp.EnableBgp != nil {
40486 objectMap["enableBgp"] = vcp.EnableBgp
40487 }
40488 if vcp.UsePolicyBasedTrafficSelectors != nil {
40489 objectMap["usePolicyBasedTrafficSelectors"] = vcp.UsePolicyBasedTrafficSelectors
40490 }
40491 if vcp.IpsecPolicies != nil {
40492 objectMap["ipsecPolicies"] = vcp.IpsecPolicies
40493 }
40494 if vcp.EnableRateLimiting != nil {
40495 objectMap["enableRateLimiting"] = vcp.EnableRateLimiting
40496 }
40497 if vcp.EnableInternetSecurity != nil {
40498 objectMap["enableInternetSecurity"] = vcp.EnableInternetSecurity
40499 }
40500 if vcp.UseLocalAzureIPAddress != nil {
40501 objectMap["useLocalAzureIpAddress"] = vcp.UseLocalAzureIPAddress
40502 }
40503 if vcp.VpnLinkConnections != nil {
40504 objectMap["vpnLinkConnections"] = vcp.VpnLinkConnections
40505 }
40506 if vcp.RoutingConfiguration != nil {
40507 objectMap["routingConfiguration"] = vcp.RoutingConfiguration
40508 }
40509 return json.Marshal(objectMap)
40510 }
40511
40512
40513
40514 type VpnConnectionsCreateOrUpdateFuture struct {
40515 azure.FutureAPI
40516
40517
40518 Result func(VpnConnectionsClient) (VpnConnection, error)
40519 }
40520
40521
40522 func (future *VpnConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
40523 var azFuture azure.Future
40524 if err := json.Unmarshal(body, &azFuture); err != nil {
40525 return err
40526 }
40527 future.FutureAPI = &azFuture
40528 future.Result = future.result
40529 return nil
40530 }
40531
40532
40533 func (future *VpnConnectionsCreateOrUpdateFuture) result(client VpnConnectionsClient) (vc VpnConnection, err error) {
40534 var done bool
40535 done, err = future.DoneWithContext(context.Background(), client)
40536 if err != nil {
40537 err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
40538 return
40539 }
40540 if !done {
40541 vc.Response.Response = future.Response()
40542 err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsCreateOrUpdateFuture")
40543 return
40544 }
40545 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
40546 if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent {
40547 vc, err = client.CreateOrUpdateResponder(vc.Response.Response)
40548 if err != nil {
40549 err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", vc.Response.Response, "Failure responding to request")
40550 }
40551 }
40552 return
40553 }
40554
40555
40556
40557 type VpnConnectionsDeleteFuture struct {
40558 azure.FutureAPI
40559
40560
40561 Result func(VpnConnectionsClient) (autorest.Response, error)
40562 }
40563
40564
40565 func (future *VpnConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
40566 var azFuture azure.Future
40567 if err := json.Unmarshal(body, &azFuture); err != nil {
40568 return err
40569 }
40570 future.FutureAPI = &azFuture
40571 future.Result = future.result
40572 return nil
40573 }
40574
40575
40576 func (future *VpnConnectionsDeleteFuture) result(client VpnConnectionsClient) (ar autorest.Response, err error) {
40577 var done bool
40578 done, err = future.DoneWithContext(context.Background(), client)
40579 if err != nil {
40580 err = autorest.NewErrorWithError(err, "network.VpnConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
40581 return
40582 }
40583 if !done {
40584 ar.Response = future.Response()
40585 err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsDeleteFuture")
40586 return
40587 }
40588 ar.Response = future.Response()
40589 return
40590 }
40591
40592
40593 type VpnDeviceScriptParameters struct {
40594
40595 Vendor *string `json:"vendor,omitempty"`
40596
40597 DeviceFamily *string `json:"deviceFamily,omitempty"`
40598
40599 FirmwareVersion *string `json:"firmwareVersion,omitempty"`
40600 }
40601
40602
40603 type VpnGateway struct {
40604 autorest.Response `json:"-"`
40605
40606 *VpnGatewayProperties `json:"properties,omitempty"`
40607
40608 Etag *string `json:"etag,omitempty"`
40609
40610 ID *string `json:"id,omitempty"`
40611
40612 Name *string `json:"name,omitempty"`
40613
40614 Type *string `json:"type,omitempty"`
40615
40616 Location *string `json:"location,omitempty"`
40617
40618 Tags map[string]*string `json:"tags"`
40619 }
40620
40621
40622 func (vg VpnGateway) MarshalJSON() ([]byte, error) {
40623 objectMap := make(map[string]interface{})
40624 if vg.VpnGatewayProperties != nil {
40625 objectMap["properties"] = vg.VpnGatewayProperties
40626 }
40627 if vg.ID != nil {
40628 objectMap["id"] = vg.ID
40629 }
40630 if vg.Location != nil {
40631 objectMap["location"] = vg.Location
40632 }
40633 if vg.Tags != nil {
40634 objectMap["tags"] = vg.Tags
40635 }
40636 return json.Marshal(objectMap)
40637 }
40638
40639
40640 func (vg *VpnGateway) UnmarshalJSON(body []byte) error {
40641 var m map[string]*json.RawMessage
40642 err := json.Unmarshal(body, &m)
40643 if err != nil {
40644 return err
40645 }
40646 for k, v := range m {
40647 switch k {
40648 case "properties":
40649 if v != nil {
40650 var vpnGatewayProperties VpnGatewayProperties
40651 err = json.Unmarshal(*v, &vpnGatewayProperties)
40652 if err != nil {
40653 return err
40654 }
40655 vg.VpnGatewayProperties = &vpnGatewayProperties
40656 }
40657 case "etag":
40658 if v != nil {
40659 var etag string
40660 err = json.Unmarshal(*v, &etag)
40661 if err != nil {
40662 return err
40663 }
40664 vg.Etag = &etag
40665 }
40666 case "id":
40667 if v != nil {
40668 var ID string
40669 err = json.Unmarshal(*v, &ID)
40670 if err != nil {
40671 return err
40672 }
40673 vg.ID = &ID
40674 }
40675 case "name":
40676 if v != nil {
40677 var name string
40678 err = json.Unmarshal(*v, &name)
40679 if err != nil {
40680 return err
40681 }
40682 vg.Name = &name
40683 }
40684 case "type":
40685 if v != nil {
40686 var typeVar string
40687 err = json.Unmarshal(*v, &typeVar)
40688 if err != nil {
40689 return err
40690 }
40691 vg.Type = &typeVar
40692 }
40693 case "location":
40694 if v != nil {
40695 var location string
40696 err = json.Unmarshal(*v, &location)
40697 if err != nil {
40698 return err
40699 }
40700 vg.Location = &location
40701 }
40702 case "tags":
40703 if v != nil {
40704 var tags map[string]*string
40705 err = json.Unmarshal(*v, &tags)
40706 if err != nil {
40707 return err
40708 }
40709 vg.Tags = tags
40710 }
40711 }
40712 }
40713
40714 return nil
40715 }
40716
40717
40718 type VpnGatewayProperties struct {
40719
40720 VirtualHub *SubResource `json:"virtualHub,omitempty"`
40721
40722 Connections *[]VpnConnection `json:"connections,omitempty"`
40723
40724 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
40725
40726 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
40727
40728 VpnGatewayScaleUnit *int32 `json:"vpnGatewayScaleUnit,omitempty"`
40729 }
40730
40731
40732 func (vgp VpnGatewayProperties) MarshalJSON() ([]byte, error) {
40733 objectMap := make(map[string]interface{})
40734 if vgp.VirtualHub != nil {
40735 objectMap["virtualHub"] = vgp.VirtualHub
40736 }
40737 if vgp.Connections != nil {
40738 objectMap["connections"] = vgp.Connections
40739 }
40740 if vgp.BgpSettings != nil {
40741 objectMap["bgpSettings"] = vgp.BgpSettings
40742 }
40743 if vgp.VpnGatewayScaleUnit != nil {
40744 objectMap["vpnGatewayScaleUnit"] = vgp.VpnGatewayScaleUnit
40745 }
40746 return json.Marshal(objectMap)
40747 }
40748
40749
40750
40751 type VpnGatewaysCreateOrUpdateFuture struct {
40752 azure.FutureAPI
40753
40754
40755 Result func(VpnGatewaysClient) (VpnGateway, error)
40756 }
40757
40758
40759 func (future *VpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
40760 var azFuture azure.Future
40761 if err := json.Unmarshal(body, &azFuture); err != nil {
40762 return err
40763 }
40764 future.FutureAPI = &azFuture
40765 future.Result = future.result
40766 return nil
40767 }
40768
40769
40770 func (future *VpnGatewaysCreateOrUpdateFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) {
40771 var done bool
40772 done, err = future.DoneWithContext(context.Background(), client)
40773 if err != nil {
40774 err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
40775 return
40776 }
40777 if !done {
40778 vg.Response.Response = future.Response()
40779 err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysCreateOrUpdateFuture")
40780 return
40781 }
40782 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
40783 if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent {
40784 vg, err = client.CreateOrUpdateResponder(vg.Response.Response)
40785 if err != nil {
40786 err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", vg.Response.Response, "Failure responding to request")
40787 }
40788 }
40789 return
40790 }
40791
40792
40793
40794 type VpnGatewaysDeleteFuture struct {
40795 azure.FutureAPI
40796
40797
40798 Result func(VpnGatewaysClient) (autorest.Response, error)
40799 }
40800
40801
40802 func (future *VpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
40803 var azFuture azure.Future
40804 if err := json.Unmarshal(body, &azFuture); err != nil {
40805 return err
40806 }
40807 future.FutureAPI = &azFuture
40808 future.Result = future.result
40809 return nil
40810 }
40811
40812
40813 func (future *VpnGatewaysDeleteFuture) result(client VpnGatewaysClient) (ar autorest.Response, err error) {
40814 var done bool
40815 done, err = future.DoneWithContext(context.Background(), client)
40816 if err != nil {
40817 err = autorest.NewErrorWithError(err, "network.VpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
40818 return
40819 }
40820 if !done {
40821 ar.Response = future.Response()
40822 err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysDeleteFuture")
40823 return
40824 }
40825 ar.Response = future.Response()
40826 return
40827 }
40828
40829
40830
40831 type VpnGatewaysResetFuture struct {
40832 azure.FutureAPI
40833
40834
40835 Result func(VpnGatewaysClient) (VpnGateway, error)
40836 }
40837
40838
40839 func (future *VpnGatewaysResetFuture) UnmarshalJSON(body []byte) error {
40840 var azFuture azure.Future
40841 if err := json.Unmarshal(body, &azFuture); err != nil {
40842 return err
40843 }
40844 future.FutureAPI = &azFuture
40845 future.Result = future.result
40846 return nil
40847 }
40848
40849
40850 func (future *VpnGatewaysResetFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) {
40851 var done bool
40852 done, err = future.DoneWithContext(context.Background(), client)
40853 if err != nil {
40854 err = autorest.NewErrorWithError(err, "network.VpnGatewaysResetFuture", "Result", future.Response(), "Polling failure")
40855 return
40856 }
40857 if !done {
40858 vg.Response.Response = future.Response()
40859 err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysResetFuture")
40860 return
40861 }
40862 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
40863 if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent {
40864 vg, err = client.ResetResponder(vg.Response.Response)
40865 if err != nil {
40866 err = autorest.NewErrorWithError(err, "network.VpnGatewaysResetFuture", "Result", vg.Response.Response, "Failure responding to request")
40867 }
40868 }
40869 return
40870 }
40871
40872
40873 type VpnLinkBgpSettings struct {
40874
40875 Asn *int64 `json:"asn,omitempty"`
40876
40877 BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"`
40878 }
40879
40880
40881 type VpnLinkProviderProperties struct {
40882
40883 LinkProviderName *string `json:"linkProviderName,omitempty"`
40884
40885 LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"`
40886 }
40887
40888
40889 type VpnPacketCaptureStartParameters struct {
40890
40891 FilterData *string `json:"filterData,omitempty"`
40892 }
40893
40894
40895 type VpnPacketCaptureStopParameters struct {
40896
40897 SasURL *string `json:"sasUrl,omitempty"`
40898 }
40899
40900
40901 type VpnProfileResponse struct {
40902 autorest.Response `json:"-"`
40903
40904 ProfileURL *string `json:"profileUrl,omitempty"`
40905 }
40906
40907
40908
40909 type VpnServerConfigRadiusClientRootCertificate struct {
40910
40911 Name *string `json:"name,omitempty"`
40912
40913 Thumbprint *string `json:"thumbprint,omitempty"`
40914 }
40915
40916
40917
40918 type VpnServerConfigRadiusServerRootCertificate struct {
40919
40920 Name *string `json:"name,omitempty"`
40921
40922 PublicCertData *string `json:"publicCertData,omitempty"`
40923 }
40924
40925
40926 type VpnServerConfiguration struct {
40927 autorest.Response `json:"-"`
40928
40929 *VpnServerConfigurationProperties `json:"properties,omitempty"`
40930
40931 Etag *string `json:"etag,omitempty"`
40932
40933 ID *string `json:"id,omitempty"`
40934
40935 Name *string `json:"name,omitempty"`
40936
40937 Type *string `json:"type,omitempty"`
40938
40939 Location *string `json:"location,omitempty"`
40940
40941 Tags map[string]*string `json:"tags"`
40942 }
40943
40944
40945 func (vsc VpnServerConfiguration) MarshalJSON() ([]byte, error) {
40946 objectMap := make(map[string]interface{})
40947 if vsc.VpnServerConfigurationProperties != nil {
40948 objectMap["properties"] = vsc.VpnServerConfigurationProperties
40949 }
40950 if vsc.ID != nil {
40951 objectMap["id"] = vsc.ID
40952 }
40953 if vsc.Location != nil {
40954 objectMap["location"] = vsc.Location
40955 }
40956 if vsc.Tags != nil {
40957 objectMap["tags"] = vsc.Tags
40958 }
40959 return json.Marshal(objectMap)
40960 }
40961
40962
40963 func (vsc *VpnServerConfiguration) UnmarshalJSON(body []byte) error {
40964 var m map[string]*json.RawMessage
40965 err := json.Unmarshal(body, &m)
40966 if err != nil {
40967 return err
40968 }
40969 for k, v := range m {
40970 switch k {
40971 case "properties":
40972 if v != nil {
40973 var vpnServerConfigurationProperties VpnServerConfigurationProperties
40974 err = json.Unmarshal(*v, &vpnServerConfigurationProperties)
40975 if err != nil {
40976 return err
40977 }
40978 vsc.VpnServerConfigurationProperties = &vpnServerConfigurationProperties
40979 }
40980 case "etag":
40981 if v != nil {
40982 var etag string
40983 err = json.Unmarshal(*v, &etag)
40984 if err != nil {
40985 return err
40986 }
40987 vsc.Etag = &etag
40988 }
40989 case "id":
40990 if v != nil {
40991 var ID string
40992 err = json.Unmarshal(*v, &ID)
40993 if err != nil {
40994 return err
40995 }
40996 vsc.ID = &ID
40997 }
40998 case "name":
40999 if v != nil {
41000 var name string
41001 err = json.Unmarshal(*v, &name)
41002 if err != nil {
41003 return err
41004 }
41005 vsc.Name = &name
41006 }
41007 case "type":
41008 if v != nil {
41009 var typeVar string
41010 err = json.Unmarshal(*v, &typeVar)
41011 if err != nil {
41012 return err
41013 }
41014 vsc.Type = &typeVar
41015 }
41016 case "location":
41017 if v != nil {
41018 var location string
41019 err = json.Unmarshal(*v, &location)
41020 if err != nil {
41021 return err
41022 }
41023 vsc.Location = &location
41024 }
41025 case "tags":
41026 if v != nil {
41027 var tags map[string]*string
41028 err = json.Unmarshal(*v, &tags)
41029 if err != nil {
41030 return err
41031 }
41032 vsc.Tags = tags
41033 }
41034 }
41035 }
41036
41037 return nil
41038 }
41039
41040
41041 type VpnServerConfigurationProperties struct {
41042
41043 Name *string `json:"name,omitempty"`
41044
41045 VpnProtocols *[]VpnGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"`
41046
41047 VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"`
41048
41049 VpnClientRootCertificates *[]VpnServerConfigVpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"`
41050
41051 VpnClientRevokedCertificates *[]VpnServerConfigVpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"`
41052
41053 RadiusServerRootCertificates *[]VpnServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"`
41054
41055 RadiusClientRootCertificates *[]VpnServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"`
41056
41057 VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"`
41058
41059 RadiusServerAddress *string `json:"radiusServerAddress,omitempty"`
41060
41061 RadiusServerSecret *string `json:"radiusServerSecret,omitempty"`
41062
41063 RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"`
41064
41065 AadAuthenticationParameters *AadAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"`
41066
41067 ProvisioningState *string `json:"provisioningState,omitempty"`
41068
41069 P2SVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"`
41070
41071 Etag *string `json:"etag,omitempty"`
41072 }
41073
41074
41075 func (vscp VpnServerConfigurationProperties) MarshalJSON() ([]byte, error) {
41076 objectMap := make(map[string]interface{})
41077 if vscp.Name != nil {
41078 objectMap["name"] = vscp.Name
41079 }
41080 if vscp.VpnProtocols != nil {
41081 objectMap["vpnProtocols"] = vscp.VpnProtocols
41082 }
41083 if vscp.VpnAuthenticationTypes != nil {
41084 objectMap["vpnAuthenticationTypes"] = vscp.VpnAuthenticationTypes
41085 }
41086 if vscp.VpnClientRootCertificates != nil {
41087 objectMap["vpnClientRootCertificates"] = vscp.VpnClientRootCertificates
41088 }
41089 if vscp.VpnClientRevokedCertificates != nil {
41090 objectMap["vpnClientRevokedCertificates"] = vscp.VpnClientRevokedCertificates
41091 }
41092 if vscp.RadiusServerRootCertificates != nil {
41093 objectMap["radiusServerRootCertificates"] = vscp.RadiusServerRootCertificates
41094 }
41095 if vscp.RadiusClientRootCertificates != nil {
41096 objectMap["radiusClientRootCertificates"] = vscp.RadiusClientRootCertificates
41097 }
41098 if vscp.VpnClientIpsecPolicies != nil {
41099 objectMap["vpnClientIpsecPolicies"] = vscp.VpnClientIpsecPolicies
41100 }
41101 if vscp.RadiusServerAddress != nil {
41102 objectMap["radiusServerAddress"] = vscp.RadiusServerAddress
41103 }
41104 if vscp.RadiusServerSecret != nil {
41105 objectMap["radiusServerSecret"] = vscp.RadiusServerSecret
41106 }
41107 if vscp.RadiusServers != nil {
41108 objectMap["radiusServers"] = vscp.RadiusServers
41109 }
41110 if vscp.AadAuthenticationParameters != nil {
41111 objectMap["aadAuthenticationParameters"] = vscp.AadAuthenticationParameters
41112 }
41113 return json.Marshal(objectMap)
41114 }
41115
41116
41117
41118 type VpnServerConfigurationsAssociatedWithVirtualWanListFuture struct {
41119 azure.FutureAPI
41120
41121
41122 Result func(VpnServerConfigurationsAssociatedWithVirtualWanClient) (VpnServerConfigurationsResponse, error)
41123 }
41124
41125
41126 func (future *VpnServerConfigurationsAssociatedWithVirtualWanListFuture) UnmarshalJSON(body []byte) error {
41127 var azFuture azure.Future
41128 if err := json.Unmarshal(body, &azFuture); err != nil {
41129 return err
41130 }
41131 future.FutureAPI = &azFuture
41132 future.Result = future.result
41133 return nil
41134 }
41135
41136
41137 func (future *VpnServerConfigurationsAssociatedWithVirtualWanListFuture) result(client VpnServerConfigurationsAssociatedWithVirtualWanClient) (vscr VpnServerConfigurationsResponse, err error) {
41138 var done bool
41139 done, err = future.DoneWithContext(context.Background(), client)
41140 if err != nil {
41141 err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture", "Result", future.Response(), "Polling failure")
41142 return
41143 }
41144 if !done {
41145 vscr.Response.Response = future.Response()
41146 err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture")
41147 return
41148 }
41149 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
41150 if vscr.Response.Response, err = future.GetResult(sender); err == nil && vscr.Response.Response.StatusCode != http.StatusNoContent {
41151 vscr, err = client.ListResponder(vscr.Response.Response)
41152 if err != nil {
41153 err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsAssociatedWithVirtualWanListFuture", "Result", vscr.Response.Response, "Failure responding to request")
41154 }
41155 }
41156 return
41157 }
41158
41159
41160
41161 type VpnServerConfigurationsCreateOrUpdateFuture struct {
41162 azure.FutureAPI
41163
41164
41165 Result func(VpnServerConfigurationsClient) (VpnServerConfiguration, error)
41166 }
41167
41168
41169 func (future *VpnServerConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
41170 var azFuture azure.Future
41171 if err := json.Unmarshal(body, &azFuture); err != nil {
41172 return err
41173 }
41174 future.FutureAPI = &azFuture
41175 future.Result = future.result
41176 return nil
41177 }
41178
41179
41180 func (future *VpnServerConfigurationsCreateOrUpdateFuture) result(client VpnServerConfigurationsClient) (vsc VpnServerConfiguration, err error) {
41181 var done bool
41182 done, err = future.DoneWithContext(context.Background(), client)
41183 if err != nil {
41184 err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
41185 return
41186 }
41187 if !done {
41188 vsc.Response.Response = future.Response()
41189 err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsCreateOrUpdateFuture")
41190 return
41191 }
41192 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
41193 if vsc.Response.Response, err = future.GetResult(sender); err == nil && vsc.Response.Response.StatusCode != http.StatusNoContent {
41194 vsc, err = client.CreateOrUpdateResponder(vsc.Response.Response)
41195 if err != nil {
41196 err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsCreateOrUpdateFuture", "Result", vsc.Response.Response, "Failure responding to request")
41197 }
41198 }
41199 return
41200 }
41201
41202
41203
41204 type VpnServerConfigurationsDeleteFuture struct {
41205 azure.FutureAPI
41206
41207
41208 Result func(VpnServerConfigurationsClient) (autorest.Response, error)
41209 }
41210
41211
41212 func (future *VpnServerConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error {
41213 var azFuture azure.Future
41214 if err := json.Unmarshal(body, &azFuture); err != nil {
41215 return err
41216 }
41217 future.FutureAPI = &azFuture
41218 future.Result = future.result
41219 return nil
41220 }
41221
41222
41223 func (future *VpnServerConfigurationsDeleteFuture) result(client VpnServerConfigurationsClient) (ar autorest.Response, err error) {
41224 var done bool
41225 done, err = future.DoneWithContext(context.Background(), client)
41226 if err != nil {
41227 err = autorest.NewErrorWithError(err, "network.VpnServerConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure")
41228 return
41229 }
41230 if !done {
41231 ar.Response = future.Response()
41232 err = azure.NewAsyncOpIncompleteError("network.VpnServerConfigurationsDeleteFuture")
41233 return
41234 }
41235 ar.Response = future.Response()
41236 return
41237 }
41238
41239
41240 type VpnServerConfigurationsResponse struct {
41241 autorest.Response `json:"-"`
41242
41243 VpnServerConfigurationResourceIds *[]string `json:"vpnServerConfigurationResourceIds,omitempty"`
41244 }
41245
41246
41247
41248 type VpnServerConfigVpnClientRevokedCertificate struct {
41249
41250 Name *string `json:"name,omitempty"`
41251
41252 Thumbprint *string `json:"thumbprint,omitempty"`
41253 }
41254
41255
41256
41257 type VpnServerConfigVpnClientRootCertificate struct {
41258
41259 Name *string `json:"name,omitempty"`
41260
41261 PublicCertData *string `json:"publicCertData,omitempty"`
41262 }
41263
41264
41265 type VpnSite struct {
41266 autorest.Response `json:"-"`
41267
41268 *VpnSiteProperties `json:"properties,omitempty"`
41269
41270 Etag *string `json:"etag,omitempty"`
41271
41272 ID *string `json:"id,omitempty"`
41273
41274 Name *string `json:"name,omitempty"`
41275
41276 Type *string `json:"type,omitempty"`
41277
41278 Location *string `json:"location,omitempty"`
41279
41280 Tags map[string]*string `json:"tags"`
41281 }
41282
41283
41284 func (vs VpnSite) MarshalJSON() ([]byte, error) {
41285 objectMap := make(map[string]interface{})
41286 if vs.VpnSiteProperties != nil {
41287 objectMap["properties"] = vs.VpnSiteProperties
41288 }
41289 if vs.ID != nil {
41290 objectMap["id"] = vs.ID
41291 }
41292 if vs.Location != nil {
41293 objectMap["location"] = vs.Location
41294 }
41295 if vs.Tags != nil {
41296 objectMap["tags"] = vs.Tags
41297 }
41298 return json.Marshal(objectMap)
41299 }
41300
41301
41302 func (vs *VpnSite) UnmarshalJSON(body []byte) error {
41303 var m map[string]*json.RawMessage
41304 err := json.Unmarshal(body, &m)
41305 if err != nil {
41306 return err
41307 }
41308 for k, v := range m {
41309 switch k {
41310 case "properties":
41311 if v != nil {
41312 var vpnSiteProperties VpnSiteProperties
41313 err = json.Unmarshal(*v, &vpnSiteProperties)
41314 if err != nil {
41315 return err
41316 }
41317 vs.VpnSiteProperties = &vpnSiteProperties
41318 }
41319 case "etag":
41320 if v != nil {
41321 var etag string
41322 err = json.Unmarshal(*v, &etag)
41323 if err != nil {
41324 return err
41325 }
41326 vs.Etag = &etag
41327 }
41328 case "id":
41329 if v != nil {
41330 var ID string
41331 err = json.Unmarshal(*v, &ID)
41332 if err != nil {
41333 return err
41334 }
41335 vs.ID = &ID
41336 }
41337 case "name":
41338 if v != nil {
41339 var name string
41340 err = json.Unmarshal(*v, &name)
41341 if err != nil {
41342 return err
41343 }
41344 vs.Name = &name
41345 }
41346 case "type":
41347 if v != nil {
41348 var typeVar string
41349 err = json.Unmarshal(*v, &typeVar)
41350 if err != nil {
41351 return err
41352 }
41353 vs.Type = &typeVar
41354 }
41355 case "location":
41356 if v != nil {
41357 var location string
41358 err = json.Unmarshal(*v, &location)
41359 if err != nil {
41360 return err
41361 }
41362 vs.Location = &location
41363 }
41364 case "tags":
41365 if v != nil {
41366 var tags map[string]*string
41367 err = json.Unmarshal(*v, &tags)
41368 if err != nil {
41369 return err
41370 }
41371 vs.Tags = tags
41372 }
41373 }
41374 }
41375
41376 return nil
41377 }
41378
41379
41380 type VpnSiteID struct {
41381
41382 VpnSite *string `json:"vpnSite,omitempty"`
41383 }
41384
41385
41386 func (vsi VpnSiteID) MarshalJSON() ([]byte, error) {
41387 objectMap := make(map[string]interface{})
41388 return json.Marshal(objectMap)
41389 }
41390
41391
41392 type VpnSiteLink struct {
41393 autorest.Response `json:"-"`
41394
41395 *VpnSiteLinkProperties `json:"properties,omitempty"`
41396
41397 Etag *string `json:"etag,omitempty"`
41398
41399 Name *string `json:"name,omitempty"`
41400
41401 Type *string `json:"type,omitempty"`
41402
41403 ID *string `json:"id,omitempty"`
41404 }
41405
41406
41407 func (vsl VpnSiteLink) MarshalJSON() ([]byte, error) {
41408 objectMap := make(map[string]interface{})
41409 if vsl.VpnSiteLinkProperties != nil {
41410 objectMap["properties"] = vsl.VpnSiteLinkProperties
41411 }
41412 if vsl.Name != nil {
41413 objectMap["name"] = vsl.Name
41414 }
41415 if vsl.ID != nil {
41416 objectMap["id"] = vsl.ID
41417 }
41418 return json.Marshal(objectMap)
41419 }
41420
41421
41422 func (vsl *VpnSiteLink) UnmarshalJSON(body []byte) error {
41423 var m map[string]*json.RawMessage
41424 err := json.Unmarshal(body, &m)
41425 if err != nil {
41426 return err
41427 }
41428 for k, v := range m {
41429 switch k {
41430 case "properties":
41431 if v != nil {
41432 var vpnSiteLinkProperties VpnSiteLinkProperties
41433 err = json.Unmarshal(*v, &vpnSiteLinkProperties)
41434 if err != nil {
41435 return err
41436 }
41437 vsl.VpnSiteLinkProperties = &vpnSiteLinkProperties
41438 }
41439 case "etag":
41440 if v != nil {
41441 var etag string
41442 err = json.Unmarshal(*v, &etag)
41443 if err != nil {
41444 return err
41445 }
41446 vsl.Etag = &etag
41447 }
41448 case "name":
41449 if v != nil {
41450 var name string
41451 err = json.Unmarshal(*v, &name)
41452 if err != nil {
41453 return err
41454 }
41455 vsl.Name = &name
41456 }
41457 case "type":
41458 if v != nil {
41459 var typeVar string
41460 err = json.Unmarshal(*v, &typeVar)
41461 if err != nil {
41462 return err
41463 }
41464 vsl.Type = &typeVar
41465 }
41466 case "id":
41467 if v != nil {
41468 var ID string
41469 err = json.Unmarshal(*v, &ID)
41470 if err != nil {
41471 return err
41472 }
41473 vsl.ID = &ID
41474 }
41475 }
41476 }
41477
41478 return nil
41479 }
41480
41481
41482 type VpnSiteLinkConnection struct {
41483 autorest.Response `json:"-"`
41484
41485 *VpnSiteLinkConnectionProperties `json:"properties,omitempty"`
41486
41487 Name *string `json:"name,omitempty"`
41488
41489 Etag *string `json:"etag,omitempty"`
41490
41491 Type *string `json:"type,omitempty"`
41492
41493 ID *string `json:"id,omitempty"`
41494 }
41495
41496
41497 func (vslc VpnSiteLinkConnection) MarshalJSON() ([]byte, error) {
41498 objectMap := make(map[string]interface{})
41499 if vslc.VpnSiteLinkConnectionProperties != nil {
41500 objectMap["properties"] = vslc.VpnSiteLinkConnectionProperties
41501 }
41502 if vslc.Name != nil {
41503 objectMap["name"] = vslc.Name
41504 }
41505 if vslc.ID != nil {
41506 objectMap["id"] = vslc.ID
41507 }
41508 return json.Marshal(objectMap)
41509 }
41510
41511
41512 func (vslc *VpnSiteLinkConnection) UnmarshalJSON(body []byte) error {
41513 var m map[string]*json.RawMessage
41514 err := json.Unmarshal(body, &m)
41515 if err != nil {
41516 return err
41517 }
41518 for k, v := range m {
41519 switch k {
41520 case "properties":
41521 if v != nil {
41522 var vpnSiteLinkConnectionProperties VpnSiteLinkConnectionProperties
41523 err = json.Unmarshal(*v, &vpnSiteLinkConnectionProperties)
41524 if err != nil {
41525 return err
41526 }
41527 vslc.VpnSiteLinkConnectionProperties = &vpnSiteLinkConnectionProperties
41528 }
41529 case "name":
41530 if v != nil {
41531 var name string
41532 err = json.Unmarshal(*v, &name)
41533 if err != nil {
41534 return err
41535 }
41536 vslc.Name = &name
41537 }
41538 case "etag":
41539 if v != nil {
41540 var etag string
41541 err = json.Unmarshal(*v, &etag)
41542 if err != nil {
41543 return err
41544 }
41545 vslc.Etag = &etag
41546 }
41547 case "type":
41548 if v != nil {
41549 var typeVar string
41550 err = json.Unmarshal(*v, &typeVar)
41551 if err != nil {
41552 return err
41553 }
41554 vslc.Type = &typeVar
41555 }
41556 case "id":
41557 if v != nil {
41558 var ID string
41559 err = json.Unmarshal(*v, &ID)
41560 if err != nil {
41561 return err
41562 }
41563 vslc.ID = &ID
41564 }
41565 }
41566 }
41567
41568 return nil
41569 }
41570
41571
41572 type VpnSiteLinkConnectionProperties struct {
41573
41574 VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"`
41575
41576 RoutingWeight *int32 `json:"routingWeight,omitempty"`
41577
41578 ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"`
41579
41580 VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"`
41581
41582 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
41583
41584 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
41585
41586 ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"`
41587
41588 SharedKey *string `json:"sharedKey,omitempty"`
41589
41590 EnableBgp *bool `json:"enableBgp,omitempty"`
41591
41592 UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"`
41593
41594 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"`
41595
41596 EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"`
41597
41598 UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"`
41599
41600 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
41601 }
41602
41603
41604 func (vslcp VpnSiteLinkConnectionProperties) MarshalJSON() ([]byte, error) {
41605 objectMap := make(map[string]interface{})
41606 if vslcp.VpnSiteLink != nil {
41607 objectMap["vpnSiteLink"] = vslcp.VpnSiteLink
41608 }
41609 if vslcp.RoutingWeight != nil {
41610 objectMap["routingWeight"] = vslcp.RoutingWeight
41611 }
41612 if vslcp.ConnectionStatus != "" {
41613 objectMap["connectionStatus"] = vslcp.ConnectionStatus
41614 }
41615 if vslcp.VpnConnectionProtocolType != "" {
41616 objectMap["vpnConnectionProtocolType"] = vslcp.VpnConnectionProtocolType
41617 }
41618 if vslcp.ConnectionBandwidth != nil {
41619 objectMap["connectionBandwidth"] = vslcp.ConnectionBandwidth
41620 }
41621 if vslcp.SharedKey != nil {
41622 objectMap["sharedKey"] = vslcp.SharedKey
41623 }
41624 if vslcp.EnableBgp != nil {
41625 objectMap["enableBgp"] = vslcp.EnableBgp
41626 }
41627 if vslcp.UsePolicyBasedTrafficSelectors != nil {
41628 objectMap["usePolicyBasedTrafficSelectors"] = vslcp.UsePolicyBasedTrafficSelectors
41629 }
41630 if vslcp.IpsecPolicies != nil {
41631 objectMap["ipsecPolicies"] = vslcp.IpsecPolicies
41632 }
41633 if vslcp.EnableRateLimiting != nil {
41634 objectMap["enableRateLimiting"] = vslcp.EnableRateLimiting
41635 }
41636 if vslcp.UseLocalAzureIPAddress != nil {
41637 objectMap["useLocalAzureIpAddress"] = vslcp.UseLocalAzureIPAddress
41638 }
41639 return json.Marshal(objectMap)
41640 }
41641
41642
41643 type VpnSiteLinkProperties struct {
41644
41645 LinkProperties *VpnLinkProviderProperties `json:"linkProperties,omitempty"`
41646
41647 IPAddress *string `json:"ipAddress,omitempty"`
41648
41649 Fqdn *string `json:"fqdn,omitempty"`
41650
41651 BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"`
41652
41653 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
41654 }
41655
41656
41657 func (vslp VpnSiteLinkProperties) MarshalJSON() ([]byte, error) {
41658 objectMap := make(map[string]interface{})
41659 if vslp.LinkProperties != nil {
41660 objectMap["linkProperties"] = vslp.LinkProperties
41661 }
41662 if vslp.IPAddress != nil {
41663 objectMap["ipAddress"] = vslp.IPAddress
41664 }
41665 if vslp.Fqdn != nil {
41666 objectMap["fqdn"] = vslp.Fqdn
41667 }
41668 if vslp.BgpProperties != nil {
41669 objectMap["bgpProperties"] = vslp.BgpProperties
41670 }
41671 return json.Marshal(objectMap)
41672 }
41673
41674
41675 type VpnSiteProperties struct {
41676
41677 VirtualWan *SubResource `json:"virtualWan,omitempty"`
41678
41679 DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"`
41680
41681 IPAddress *string `json:"ipAddress,omitempty"`
41682
41683 SiteKey *string `json:"siteKey,omitempty"`
41684
41685 AddressSpace *AddressSpace `json:"addressSpace,omitempty"`
41686
41687 BgpProperties *BgpSettings `json:"bgpProperties,omitempty"`
41688
41689 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
41690
41691 IsSecuritySite *bool `json:"isSecuritySite,omitempty"`
41692
41693 VpnSiteLinks *[]VpnSiteLink `json:"vpnSiteLinks,omitempty"`
41694 }
41695
41696
41697 func (vsp VpnSiteProperties) MarshalJSON() ([]byte, error) {
41698 objectMap := make(map[string]interface{})
41699 if vsp.VirtualWan != nil {
41700 objectMap["virtualWan"] = vsp.VirtualWan
41701 }
41702 if vsp.DeviceProperties != nil {
41703 objectMap["deviceProperties"] = vsp.DeviceProperties
41704 }
41705 if vsp.IPAddress != nil {
41706 objectMap["ipAddress"] = vsp.IPAddress
41707 }
41708 if vsp.SiteKey != nil {
41709 objectMap["siteKey"] = vsp.SiteKey
41710 }
41711 if vsp.AddressSpace != nil {
41712 objectMap["addressSpace"] = vsp.AddressSpace
41713 }
41714 if vsp.BgpProperties != nil {
41715 objectMap["bgpProperties"] = vsp.BgpProperties
41716 }
41717 if vsp.IsSecuritySite != nil {
41718 objectMap["isSecuritySite"] = vsp.IsSecuritySite
41719 }
41720 if vsp.VpnSiteLinks != nil {
41721 objectMap["vpnSiteLinks"] = vsp.VpnSiteLinks
41722 }
41723 return json.Marshal(objectMap)
41724 }
41725
41726
41727
41728 type VpnSitesConfigurationDownloadFuture struct {
41729 azure.FutureAPI
41730
41731
41732 Result func(VpnSitesConfigurationClient) (autorest.Response, error)
41733 }
41734
41735
41736 func (future *VpnSitesConfigurationDownloadFuture) UnmarshalJSON(body []byte) error {
41737 var azFuture azure.Future
41738 if err := json.Unmarshal(body, &azFuture); err != nil {
41739 return err
41740 }
41741 future.FutureAPI = &azFuture
41742 future.Result = future.result
41743 return nil
41744 }
41745
41746
41747 func (future *VpnSitesConfigurationDownloadFuture) result(client VpnSitesConfigurationClient) (ar autorest.Response, err error) {
41748 var done bool
41749 done, err = future.DoneWithContext(context.Background(), client)
41750 if err != nil {
41751 err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationDownloadFuture", "Result", future.Response(), "Polling failure")
41752 return
41753 }
41754 if !done {
41755 ar.Response = future.Response()
41756 err = azure.NewAsyncOpIncompleteError("network.VpnSitesConfigurationDownloadFuture")
41757 return
41758 }
41759 ar.Response = future.Response()
41760 return
41761 }
41762
41763
41764
41765 type VpnSitesCreateOrUpdateFuture struct {
41766 azure.FutureAPI
41767
41768
41769 Result func(VpnSitesClient) (VpnSite, error)
41770 }
41771
41772
41773 func (future *VpnSitesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
41774 var azFuture azure.Future
41775 if err := json.Unmarshal(body, &azFuture); err != nil {
41776 return err
41777 }
41778 future.FutureAPI = &azFuture
41779 future.Result = future.result
41780 return nil
41781 }
41782
41783
41784 func (future *VpnSitesCreateOrUpdateFuture) result(client VpnSitesClient) (vs VpnSite, err error) {
41785 var done bool
41786 done, err = future.DoneWithContext(context.Background(), client)
41787 if err != nil {
41788 err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
41789 return
41790 }
41791 if !done {
41792 vs.Response.Response = future.Response()
41793 err = azure.NewAsyncOpIncompleteError("network.VpnSitesCreateOrUpdateFuture")
41794 return
41795 }
41796 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
41797 if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent {
41798 vs, err = client.CreateOrUpdateResponder(vs.Response.Response)
41799 if err != nil {
41800 err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", vs.Response.Response, "Failure responding to request")
41801 }
41802 }
41803 return
41804 }
41805
41806
41807
41808 type VpnSitesDeleteFuture struct {
41809 azure.FutureAPI
41810
41811
41812 Result func(VpnSitesClient) (autorest.Response, error)
41813 }
41814
41815
41816 func (future *VpnSitesDeleteFuture) UnmarshalJSON(body []byte) error {
41817 var azFuture azure.Future
41818 if err := json.Unmarshal(body, &azFuture); err != nil {
41819 return err
41820 }
41821 future.FutureAPI = &azFuture
41822 future.Result = future.result
41823 return nil
41824 }
41825
41826
41827 func (future *VpnSitesDeleteFuture) result(client VpnSitesClient) (ar autorest.Response, err error) {
41828 var done bool
41829 done, err = future.DoneWithContext(context.Background(), client)
41830 if err != nil {
41831 err = autorest.NewErrorWithError(err, "network.VpnSitesDeleteFuture", "Result", future.Response(), "Polling failure")
41832 return
41833 }
41834 if !done {
41835 ar.Response = future.Response()
41836 err = azure.NewAsyncOpIncompleteError("network.VpnSitesDeleteFuture")
41837 return
41838 }
41839 ar.Response = future.Response()
41840 return
41841 }
41842
41843
41844 type Watcher struct {
41845 autorest.Response `json:"-"`
41846
41847 Etag *string `json:"etag,omitempty"`
41848
41849 *WatcherPropertiesFormat `json:"properties,omitempty"`
41850
41851 ID *string `json:"id,omitempty"`
41852
41853 Name *string `json:"name,omitempty"`
41854
41855 Type *string `json:"type,omitempty"`
41856
41857 Location *string `json:"location,omitempty"`
41858
41859 Tags map[string]*string `json:"tags"`
41860 }
41861
41862
41863 func (w Watcher) MarshalJSON() ([]byte, error) {
41864 objectMap := make(map[string]interface{})
41865 if w.WatcherPropertiesFormat != nil {
41866 objectMap["properties"] = w.WatcherPropertiesFormat
41867 }
41868 if w.ID != nil {
41869 objectMap["id"] = w.ID
41870 }
41871 if w.Location != nil {
41872 objectMap["location"] = w.Location
41873 }
41874 if w.Tags != nil {
41875 objectMap["tags"] = w.Tags
41876 }
41877 return json.Marshal(objectMap)
41878 }
41879
41880
41881 func (w *Watcher) UnmarshalJSON(body []byte) error {
41882 var m map[string]*json.RawMessage
41883 err := json.Unmarshal(body, &m)
41884 if err != nil {
41885 return err
41886 }
41887 for k, v := range m {
41888 switch k {
41889 case "etag":
41890 if v != nil {
41891 var etag string
41892 err = json.Unmarshal(*v, &etag)
41893 if err != nil {
41894 return err
41895 }
41896 w.Etag = &etag
41897 }
41898 case "properties":
41899 if v != nil {
41900 var watcherPropertiesFormat WatcherPropertiesFormat
41901 err = json.Unmarshal(*v, &watcherPropertiesFormat)
41902 if err != nil {
41903 return err
41904 }
41905 w.WatcherPropertiesFormat = &watcherPropertiesFormat
41906 }
41907 case "id":
41908 if v != nil {
41909 var ID string
41910 err = json.Unmarshal(*v, &ID)
41911 if err != nil {
41912 return err
41913 }
41914 w.ID = &ID
41915 }
41916 case "name":
41917 if v != nil {
41918 var name string
41919 err = json.Unmarshal(*v, &name)
41920 if err != nil {
41921 return err
41922 }
41923 w.Name = &name
41924 }
41925 case "type":
41926 if v != nil {
41927 var typeVar string
41928 err = json.Unmarshal(*v, &typeVar)
41929 if err != nil {
41930 return err
41931 }
41932 w.Type = &typeVar
41933 }
41934 case "location":
41935 if v != nil {
41936 var location string
41937 err = json.Unmarshal(*v, &location)
41938 if err != nil {
41939 return err
41940 }
41941 w.Location = &location
41942 }
41943 case "tags":
41944 if v != nil {
41945 var tags map[string]*string
41946 err = json.Unmarshal(*v, &tags)
41947 if err != nil {
41948 return err
41949 }
41950 w.Tags = tags
41951 }
41952 }
41953 }
41954
41955 return nil
41956 }
41957
41958
41959 type WatcherListResult struct {
41960 autorest.Response `json:"-"`
41961
41962 Value *[]Watcher `json:"value,omitempty"`
41963 }
41964
41965
41966 type WatcherPropertiesFormat struct {
41967
41968 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
41969 }
41970
41971
41972 func (wpf WatcherPropertiesFormat) MarshalJSON() ([]byte, error) {
41973 objectMap := make(map[string]interface{})
41974 return json.Marshal(objectMap)
41975 }
41976
41977
41978
41979 type WatchersCheckConnectivityFuture struct {
41980 azure.FutureAPI
41981
41982
41983 Result func(WatchersClient) (ConnectivityInformation, error)
41984 }
41985
41986
41987 func (future *WatchersCheckConnectivityFuture) UnmarshalJSON(body []byte) error {
41988 var azFuture azure.Future
41989 if err := json.Unmarshal(body, &azFuture); err != nil {
41990 return err
41991 }
41992 future.FutureAPI = &azFuture
41993 future.Result = future.result
41994 return nil
41995 }
41996
41997
41998 func (future *WatchersCheckConnectivityFuture) result(client WatchersClient) (ci ConnectivityInformation, err error) {
41999 var done bool
42000 done, err = future.DoneWithContext(context.Background(), client)
42001 if err != nil {
42002 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Polling failure")
42003 return
42004 }
42005 if !done {
42006 ci.Response.Response = future.Response()
42007 err = azure.NewAsyncOpIncompleteError("network.WatchersCheckConnectivityFuture")
42008 return
42009 }
42010 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42011 if ci.Response.Response, err = future.GetResult(sender); err == nil && ci.Response.Response.StatusCode != http.StatusNoContent {
42012 ci, err = client.CheckConnectivityResponder(ci.Response.Response)
42013 if err != nil {
42014 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", ci.Response.Response, "Failure responding to request")
42015 }
42016 }
42017 return
42018 }
42019
42020
42021
42022 type WatchersDeleteFuture struct {
42023 azure.FutureAPI
42024
42025
42026 Result func(WatchersClient) (autorest.Response, error)
42027 }
42028
42029
42030 func (future *WatchersDeleteFuture) UnmarshalJSON(body []byte) error {
42031 var azFuture azure.Future
42032 if err := json.Unmarshal(body, &azFuture); err != nil {
42033 return err
42034 }
42035 future.FutureAPI = &azFuture
42036 future.Result = future.result
42037 return nil
42038 }
42039
42040
42041 func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.Response, err error) {
42042 var done bool
42043 done, err = future.DoneWithContext(context.Background(), client)
42044 if err != nil {
42045 err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure")
42046 return
42047 }
42048 if !done {
42049 ar.Response = future.Response()
42050 err = azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture")
42051 return
42052 }
42053 ar.Response = future.Response()
42054 return
42055 }
42056
42057
42058
42059 type WatchersGetAzureReachabilityReportFuture struct {
42060 azure.FutureAPI
42061
42062
42063 Result func(WatchersClient) (AzureReachabilityReport, error)
42064 }
42065
42066
42067 func (future *WatchersGetAzureReachabilityReportFuture) UnmarshalJSON(body []byte) error {
42068 var azFuture azure.Future
42069 if err := json.Unmarshal(body, &azFuture); err != nil {
42070 return err
42071 }
42072 future.FutureAPI = &azFuture
42073 future.Result = future.result
42074 return nil
42075 }
42076
42077
42078 func (future *WatchersGetAzureReachabilityReportFuture) result(client WatchersClient) (arr AzureReachabilityReport, err error) {
42079 var done bool
42080 done, err = future.DoneWithContext(context.Background(), client)
42081 if err != nil {
42082 err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", future.Response(), "Polling failure")
42083 return
42084 }
42085 if !done {
42086 arr.Response.Response = future.Response()
42087 err = azure.NewAsyncOpIncompleteError("network.WatchersGetAzureReachabilityReportFuture")
42088 return
42089 }
42090 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42091 if arr.Response.Response, err = future.GetResult(sender); err == nil && arr.Response.Response.StatusCode != http.StatusNoContent {
42092 arr, err = client.GetAzureReachabilityReportResponder(arr.Response.Response)
42093 if err != nil {
42094 err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", arr.Response.Response, "Failure responding to request")
42095 }
42096 }
42097 return
42098 }
42099
42100
42101
42102 type WatchersGetFlowLogStatusFuture struct {
42103 azure.FutureAPI
42104
42105
42106 Result func(WatchersClient) (FlowLogInformation, error)
42107 }
42108
42109
42110 func (future *WatchersGetFlowLogStatusFuture) UnmarshalJSON(body []byte) error {
42111 var azFuture azure.Future
42112 if err := json.Unmarshal(body, &azFuture); err != nil {
42113 return err
42114 }
42115 future.FutureAPI = &azFuture
42116 future.Result = future.result
42117 return nil
42118 }
42119
42120
42121 func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli FlowLogInformation, err error) {
42122 var done bool
42123 done, err = future.DoneWithContext(context.Background(), client)
42124 if err != nil {
42125 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure")
42126 return
42127 }
42128 if !done {
42129 fli.Response.Response = future.Response()
42130 err = azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture")
42131 return
42132 }
42133 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42134 if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent {
42135 fli, err = client.GetFlowLogStatusResponder(fli.Response.Response)
42136 if err != nil {
42137 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", fli.Response.Response, "Failure responding to request")
42138 }
42139 }
42140 return
42141 }
42142
42143
42144
42145 type WatchersGetNetworkConfigurationDiagnosticFuture struct {
42146 azure.FutureAPI
42147
42148
42149 Result func(WatchersClient) (ConfigurationDiagnosticResponse, error)
42150 }
42151
42152
42153 func (future *WatchersGetNetworkConfigurationDiagnosticFuture) UnmarshalJSON(body []byte) error {
42154 var azFuture azure.Future
42155 if err := json.Unmarshal(body, &azFuture); err != nil {
42156 return err
42157 }
42158 future.FutureAPI = &azFuture
42159 future.Result = future.result
42160 return nil
42161 }
42162
42163
42164 func (future *WatchersGetNetworkConfigurationDiagnosticFuture) result(client WatchersClient) (cdr ConfigurationDiagnosticResponse, err error) {
42165 var done bool
42166 done, err = future.DoneWithContext(context.Background(), client)
42167 if err != nil {
42168 err = autorest.NewErrorWithError(err, "network.WatchersGetNetworkConfigurationDiagnosticFuture", "Result", future.Response(), "Polling failure")
42169 return
42170 }
42171 if !done {
42172 cdr.Response.Response = future.Response()
42173 err = azure.NewAsyncOpIncompleteError("network.WatchersGetNetworkConfigurationDiagnosticFuture")
42174 return
42175 }
42176 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42177 if cdr.Response.Response, err = future.GetResult(sender); err == nil && cdr.Response.Response.StatusCode != http.StatusNoContent {
42178 cdr, err = client.GetNetworkConfigurationDiagnosticResponder(cdr.Response.Response)
42179 if err != nil {
42180 err = autorest.NewErrorWithError(err, "network.WatchersGetNetworkConfigurationDiagnosticFuture", "Result", cdr.Response.Response, "Failure responding to request")
42181 }
42182 }
42183 return
42184 }
42185
42186
42187
42188 type WatchersGetNextHopFuture struct {
42189 azure.FutureAPI
42190
42191
42192 Result func(WatchersClient) (NextHopResult, error)
42193 }
42194
42195
42196 func (future *WatchersGetNextHopFuture) UnmarshalJSON(body []byte) error {
42197 var azFuture azure.Future
42198 if err := json.Unmarshal(body, &azFuture); err != nil {
42199 return err
42200 }
42201 future.FutureAPI = &azFuture
42202 future.Result = future.result
42203 return nil
42204 }
42205
42206
42207 func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextHopResult, err error) {
42208 var done bool
42209 done, err = future.DoneWithContext(context.Background(), client)
42210 if err != nil {
42211 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure")
42212 return
42213 }
42214 if !done {
42215 nhr.Response.Response = future.Response()
42216 err = azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture")
42217 return
42218 }
42219 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42220 if nhr.Response.Response, err = future.GetResult(sender); err == nil && nhr.Response.Response.StatusCode != http.StatusNoContent {
42221 nhr, err = client.GetNextHopResponder(nhr.Response.Response)
42222 if err != nil {
42223 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", nhr.Response.Response, "Failure responding to request")
42224 }
42225 }
42226 return
42227 }
42228
42229
42230
42231 type WatchersGetTroubleshootingFuture struct {
42232 azure.FutureAPI
42233
42234
42235 Result func(WatchersClient) (TroubleshootingResult, error)
42236 }
42237
42238
42239 func (future *WatchersGetTroubleshootingFuture) UnmarshalJSON(body []byte) error {
42240 var azFuture azure.Future
42241 if err := json.Unmarshal(body, &azFuture); err != nil {
42242 return err
42243 }
42244 future.FutureAPI = &azFuture
42245 future.Result = future.result
42246 return nil
42247 }
42248
42249
42250 func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) {
42251 var done bool
42252 done, err = future.DoneWithContext(context.Background(), client)
42253 if err != nil {
42254 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure")
42255 return
42256 }
42257 if !done {
42258 tr.Response.Response = future.Response()
42259 err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture")
42260 return
42261 }
42262 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42263 if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent {
42264 tr, err = client.GetTroubleshootingResponder(tr.Response.Response)
42265 if err != nil {
42266 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", tr.Response.Response, "Failure responding to request")
42267 }
42268 }
42269 return
42270 }
42271
42272
42273
42274 type WatchersGetTroubleshootingResultFuture struct {
42275 azure.FutureAPI
42276
42277
42278 Result func(WatchersClient) (TroubleshootingResult, error)
42279 }
42280
42281
42282 func (future *WatchersGetTroubleshootingResultFuture) UnmarshalJSON(body []byte) error {
42283 var azFuture azure.Future
42284 if err := json.Unmarshal(body, &azFuture); err != nil {
42285 return err
42286 }
42287 future.FutureAPI = &azFuture
42288 future.Result = future.result
42289 return nil
42290 }
42291
42292
42293 func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) {
42294 var done bool
42295 done, err = future.DoneWithContext(context.Background(), client)
42296 if err != nil {
42297 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure")
42298 return
42299 }
42300 if !done {
42301 tr.Response.Response = future.Response()
42302 err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture")
42303 return
42304 }
42305 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42306 if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent {
42307 tr, err = client.GetTroubleshootingResultResponder(tr.Response.Response)
42308 if err != nil {
42309 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", tr.Response.Response, "Failure responding to request")
42310 }
42311 }
42312 return
42313 }
42314
42315
42316
42317 type WatchersGetVMSecurityRulesFuture struct {
42318 azure.FutureAPI
42319
42320
42321 Result func(WatchersClient) (SecurityGroupViewResult, error)
42322 }
42323
42324
42325 func (future *WatchersGetVMSecurityRulesFuture) UnmarshalJSON(body []byte) error {
42326 var azFuture azure.Future
42327 if err := json.Unmarshal(body, &azFuture); err != nil {
42328 return err
42329 }
42330 future.FutureAPI = &azFuture
42331 future.Result = future.result
42332 return nil
42333 }
42334
42335
42336 func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) {
42337 var done bool
42338 done, err = future.DoneWithContext(context.Background(), client)
42339 if err != nil {
42340 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure")
42341 return
42342 }
42343 if !done {
42344 sgvr.Response.Response = future.Response()
42345 err = azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture")
42346 return
42347 }
42348 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42349 if sgvr.Response.Response, err = future.GetResult(sender); err == nil && sgvr.Response.Response.StatusCode != http.StatusNoContent {
42350 sgvr, err = client.GetVMSecurityRulesResponder(sgvr.Response.Response)
42351 if err != nil {
42352 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", sgvr.Response.Response, "Failure responding to request")
42353 }
42354 }
42355 return
42356 }
42357
42358
42359
42360 type WatchersListAvailableProvidersFuture struct {
42361 azure.FutureAPI
42362
42363
42364 Result func(WatchersClient) (AvailableProvidersList, error)
42365 }
42366
42367
42368 func (future *WatchersListAvailableProvidersFuture) UnmarshalJSON(body []byte) error {
42369 var azFuture azure.Future
42370 if err := json.Unmarshal(body, &azFuture); err != nil {
42371 return err
42372 }
42373 future.FutureAPI = &azFuture
42374 future.Result = future.result
42375 return nil
42376 }
42377
42378
42379 func (future *WatchersListAvailableProvidersFuture) result(client WatchersClient) (apl AvailableProvidersList, err error) {
42380 var done bool
42381 done, err = future.DoneWithContext(context.Background(), client)
42382 if err != nil {
42383 err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", future.Response(), "Polling failure")
42384 return
42385 }
42386 if !done {
42387 apl.Response.Response = future.Response()
42388 err = azure.NewAsyncOpIncompleteError("network.WatchersListAvailableProvidersFuture")
42389 return
42390 }
42391 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42392 if apl.Response.Response, err = future.GetResult(sender); err == nil && apl.Response.Response.StatusCode != http.StatusNoContent {
42393 apl, err = client.ListAvailableProvidersResponder(apl.Response.Response)
42394 if err != nil {
42395 err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", apl.Response.Response, "Failure responding to request")
42396 }
42397 }
42398 return
42399 }
42400
42401
42402
42403 type WatchersSetFlowLogConfigurationFuture struct {
42404 azure.FutureAPI
42405
42406
42407 Result func(WatchersClient) (FlowLogInformation, error)
42408 }
42409
42410
42411 func (future *WatchersSetFlowLogConfigurationFuture) UnmarshalJSON(body []byte) error {
42412 var azFuture azure.Future
42413 if err := json.Unmarshal(body, &azFuture); err != nil {
42414 return err
42415 }
42416 future.FutureAPI = &azFuture
42417 future.Result = future.result
42418 return nil
42419 }
42420
42421
42422 func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClient) (fli FlowLogInformation, err error) {
42423 var done bool
42424 done, err = future.DoneWithContext(context.Background(), client)
42425 if err != nil {
42426 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure")
42427 return
42428 }
42429 if !done {
42430 fli.Response.Response = future.Response()
42431 err = azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture")
42432 return
42433 }
42434 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42435 if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent {
42436 fli, err = client.SetFlowLogConfigurationResponder(fli.Response.Response)
42437 if err != nil {
42438 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", fli.Response.Response, "Failure responding to request")
42439 }
42440 }
42441 return
42442 }
42443
42444
42445
42446 type WatchersVerifyIPFlowFuture struct {
42447 azure.FutureAPI
42448
42449
42450 Result func(WatchersClient) (VerificationIPFlowResult, error)
42451 }
42452
42453
42454 func (future *WatchersVerifyIPFlowFuture) UnmarshalJSON(body []byte) error {
42455 var azFuture azure.Future
42456 if err := json.Unmarshal(body, &azFuture); err != nil {
42457 return err
42458 }
42459 future.FutureAPI = &azFuture
42460 future.Result = future.result
42461 return nil
42462 }
42463
42464
42465 func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr VerificationIPFlowResult, err error) {
42466 var done bool
42467 done, err = future.DoneWithContext(context.Background(), client)
42468 if err != nil {
42469 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure")
42470 return
42471 }
42472 if !done {
42473 vifr.Response.Response = future.Response()
42474 err = azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture")
42475 return
42476 }
42477 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
42478 if vifr.Response.Response, err = future.GetResult(sender); err == nil && vifr.Response.Response.StatusCode != http.StatusNoContent {
42479 vifr, err = client.VerifyIPFlowResponder(vifr.Response.Response)
42480 if err != nil {
42481 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", vifr.Response.Response, "Failure responding to request")
42482 }
42483 }
42484 return
42485 }
42486
42487
42488 type WebApplicationFirewallCustomRule struct {
42489
42490 Name *string `json:"name,omitempty"`
42491
42492 Etag *string `json:"etag,omitempty"`
42493
42494 Priority *int32 `json:"priority,omitempty"`
42495
42496 RuleType WebApplicationFirewallRuleType `json:"ruleType,omitempty"`
42497
42498 MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"`
42499
42500 Action WebApplicationFirewallAction `json:"action,omitempty"`
42501 }
42502
42503
42504 func (wafcr WebApplicationFirewallCustomRule) MarshalJSON() ([]byte, error) {
42505 objectMap := make(map[string]interface{})
42506 if wafcr.Name != nil {
42507 objectMap["name"] = wafcr.Name
42508 }
42509 if wafcr.Priority != nil {
42510 objectMap["priority"] = wafcr.Priority
42511 }
42512 if wafcr.RuleType != "" {
42513 objectMap["ruleType"] = wafcr.RuleType
42514 }
42515 if wafcr.MatchConditions != nil {
42516 objectMap["matchConditions"] = wafcr.MatchConditions
42517 }
42518 if wafcr.Action != "" {
42519 objectMap["action"] = wafcr.Action
42520 }
42521 return json.Marshal(objectMap)
42522 }
42523
42524
42525
42526 type WebApplicationFirewallPoliciesDeleteFuture struct {
42527 azure.FutureAPI
42528
42529
42530 Result func(WebApplicationFirewallPoliciesClient) (autorest.Response, error)
42531 }
42532
42533
42534 func (future *WebApplicationFirewallPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
42535 var azFuture azure.Future
42536 if err := json.Unmarshal(body, &azFuture); err != nil {
42537 return err
42538 }
42539 future.FutureAPI = &azFuture
42540 future.Result = future.result
42541 return nil
42542 }
42543
42544
42545 func (future *WebApplicationFirewallPoliciesDeleteFuture) result(client WebApplicationFirewallPoliciesClient) (ar autorest.Response, err error) {
42546 var done bool
42547 done, err = future.DoneWithContext(context.Background(), client)
42548 if err != nil {
42549 err = autorest.NewErrorWithError(err, "network.WebApplicationFirewallPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
42550 return
42551 }
42552 if !done {
42553 ar.Response = future.Response()
42554 err = azure.NewAsyncOpIncompleteError("network.WebApplicationFirewallPoliciesDeleteFuture")
42555 return
42556 }
42557 ar.Response = future.Response()
42558 return
42559 }
42560
42561
42562 type WebApplicationFirewallPolicy struct {
42563 autorest.Response `json:"-"`
42564
42565 *WebApplicationFirewallPolicyPropertiesFormat `json:"properties,omitempty"`
42566
42567 Etag *string `json:"etag,omitempty"`
42568
42569 ID *string `json:"id,omitempty"`
42570
42571 Name *string `json:"name,omitempty"`
42572
42573 Type *string `json:"type,omitempty"`
42574
42575 Location *string `json:"location,omitempty"`
42576
42577 Tags map[string]*string `json:"tags"`
42578 }
42579
42580
42581 func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) {
42582 objectMap := make(map[string]interface{})
42583 if wafp.WebApplicationFirewallPolicyPropertiesFormat != nil {
42584 objectMap["properties"] = wafp.WebApplicationFirewallPolicyPropertiesFormat
42585 }
42586 if wafp.ID != nil {
42587 objectMap["id"] = wafp.ID
42588 }
42589 if wafp.Location != nil {
42590 objectMap["location"] = wafp.Location
42591 }
42592 if wafp.Tags != nil {
42593 objectMap["tags"] = wafp.Tags
42594 }
42595 return json.Marshal(objectMap)
42596 }
42597
42598
42599 func (wafp *WebApplicationFirewallPolicy) UnmarshalJSON(body []byte) error {
42600 var m map[string]*json.RawMessage
42601 err := json.Unmarshal(body, &m)
42602 if err != nil {
42603 return err
42604 }
42605 for k, v := range m {
42606 switch k {
42607 case "properties":
42608 if v != nil {
42609 var webApplicationFirewallPolicyPropertiesFormat WebApplicationFirewallPolicyPropertiesFormat
42610 err = json.Unmarshal(*v, &webApplicationFirewallPolicyPropertiesFormat)
42611 if err != nil {
42612 return err
42613 }
42614 wafp.WebApplicationFirewallPolicyPropertiesFormat = &webApplicationFirewallPolicyPropertiesFormat
42615 }
42616 case "etag":
42617 if v != nil {
42618 var etag string
42619 err = json.Unmarshal(*v, &etag)
42620 if err != nil {
42621 return err
42622 }
42623 wafp.Etag = &etag
42624 }
42625 case "id":
42626 if v != nil {
42627 var ID string
42628 err = json.Unmarshal(*v, &ID)
42629 if err != nil {
42630 return err
42631 }
42632 wafp.ID = &ID
42633 }
42634 case "name":
42635 if v != nil {
42636 var name string
42637 err = json.Unmarshal(*v, &name)
42638 if err != nil {
42639 return err
42640 }
42641 wafp.Name = &name
42642 }
42643 case "type":
42644 if v != nil {
42645 var typeVar string
42646 err = json.Unmarshal(*v, &typeVar)
42647 if err != nil {
42648 return err
42649 }
42650 wafp.Type = &typeVar
42651 }
42652 case "location":
42653 if v != nil {
42654 var location string
42655 err = json.Unmarshal(*v, &location)
42656 if err != nil {
42657 return err
42658 }
42659 wafp.Location = &location
42660 }
42661 case "tags":
42662 if v != nil {
42663 var tags map[string]*string
42664 err = json.Unmarshal(*v, &tags)
42665 if err != nil {
42666 return err
42667 }
42668 wafp.Tags = tags
42669 }
42670 }
42671 }
42672
42673 return nil
42674 }
42675
42676
42677
42678 type WebApplicationFirewallPolicyListResult struct {
42679 autorest.Response `json:"-"`
42680
42681 Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"`
42682
42683 NextLink *string `json:"nextLink,omitempty"`
42684 }
42685
42686
42687 func (wafplr WebApplicationFirewallPolicyListResult) MarshalJSON() ([]byte, error) {
42688 objectMap := make(map[string]interface{})
42689 return json.Marshal(objectMap)
42690 }
42691
42692
42693
42694 type WebApplicationFirewallPolicyListResultIterator struct {
42695 i int
42696 page WebApplicationFirewallPolicyListResultPage
42697 }
42698
42699
42700
42701 func (iter *WebApplicationFirewallPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) {
42702 if tracing.IsEnabled() {
42703 ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListResultIterator.NextWithContext")
42704 defer func() {
42705 sc := -1
42706 if iter.Response().Response.Response != nil {
42707 sc = iter.Response().Response.Response.StatusCode
42708 }
42709 tracing.EndSpan(ctx, sc, err)
42710 }()
42711 }
42712 iter.i++
42713 if iter.i < len(iter.page.Values()) {
42714 return nil
42715 }
42716 err = iter.page.NextWithContext(ctx)
42717 if err != nil {
42718 iter.i--
42719 return err
42720 }
42721 iter.i = 0
42722 return nil
42723 }
42724
42725
42726
42727
42728 func (iter *WebApplicationFirewallPolicyListResultIterator) Next() error {
42729 return iter.NextWithContext(context.Background())
42730 }
42731
42732
42733 func (iter WebApplicationFirewallPolicyListResultIterator) NotDone() bool {
42734 return iter.page.NotDone() && iter.i < len(iter.page.Values())
42735 }
42736
42737
42738 func (iter WebApplicationFirewallPolicyListResultIterator) Response() WebApplicationFirewallPolicyListResult {
42739 return iter.page.Response()
42740 }
42741
42742
42743
42744 func (iter WebApplicationFirewallPolicyListResultIterator) Value() WebApplicationFirewallPolicy {
42745 if !iter.page.NotDone() {
42746 return WebApplicationFirewallPolicy{}
42747 }
42748 return iter.page.Values()[iter.i]
42749 }
42750
42751
42752 func NewWebApplicationFirewallPolicyListResultIterator(page WebApplicationFirewallPolicyListResultPage) WebApplicationFirewallPolicyListResultIterator {
42753 return WebApplicationFirewallPolicyListResultIterator{page: page}
42754 }
42755
42756
42757 func (wafplr WebApplicationFirewallPolicyListResult) IsEmpty() bool {
42758 return wafplr.Value == nil || len(*wafplr.Value) == 0
42759 }
42760
42761
42762 func (wafplr WebApplicationFirewallPolicyListResult) hasNextLink() bool {
42763 return wafplr.NextLink != nil && len(*wafplr.NextLink) != 0
42764 }
42765
42766
42767
42768 func (wafplr WebApplicationFirewallPolicyListResult) webApplicationFirewallPolicyListResultPreparer(ctx context.Context) (*http.Request, error) {
42769 if !wafplr.hasNextLink() {
42770 return nil, nil
42771 }
42772 return autorest.Prepare((&http.Request{}).WithContext(ctx),
42773 autorest.AsJSON(),
42774 autorest.AsGet(),
42775 autorest.WithBaseURL(to.String(wafplr.NextLink)))
42776 }
42777
42778
42779 type WebApplicationFirewallPolicyListResultPage struct {
42780 fn func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)
42781 wafplr WebApplicationFirewallPolicyListResult
42782 }
42783
42784
42785
42786 func (page *WebApplicationFirewallPolicyListResultPage) NextWithContext(ctx context.Context) (err error) {
42787 if tracing.IsEnabled() {
42788 ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListResultPage.NextWithContext")
42789 defer func() {
42790 sc := -1
42791 if page.Response().Response.Response != nil {
42792 sc = page.Response().Response.Response.StatusCode
42793 }
42794 tracing.EndSpan(ctx, sc, err)
42795 }()
42796 }
42797 for {
42798 next, err := page.fn(ctx, page.wafplr)
42799 if err != nil {
42800 return err
42801 }
42802 page.wafplr = next
42803 if !next.hasNextLink() || !next.IsEmpty() {
42804 break
42805 }
42806 }
42807 return nil
42808 }
42809
42810
42811
42812
42813 func (page *WebApplicationFirewallPolicyListResultPage) Next() error {
42814 return page.NextWithContext(context.Background())
42815 }
42816
42817
42818 func (page WebApplicationFirewallPolicyListResultPage) NotDone() bool {
42819 return !page.wafplr.IsEmpty()
42820 }
42821
42822
42823 func (page WebApplicationFirewallPolicyListResultPage) Response() WebApplicationFirewallPolicyListResult {
42824 return page.wafplr
42825 }
42826
42827
42828 func (page WebApplicationFirewallPolicyListResultPage) Values() []WebApplicationFirewallPolicy {
42829 if page.wafplr.IsEmpty() {
42830 return nil
42831 }
42832 return *page.wafplr.Value
42833 }
42834
42835
42836 func NewWebApplicationFirewallPolicyListResultPage(cur WebApplicationFirewallPolicyListResult, getNextPage func(context.Context, WebApplicationFirewallPolicyListResult) (WebApplicationFirewallPolicyListResult, error)) WebApplicationFirewallPolicyListResultPage {
42837 return WebApplicationFirewallPolicyListResultPage{
42838 fn: getNextPage,
42839 wafplr: cur,
42840 }
42841 }
42842
42843
42844 type WebApplicationFirewallPolicyPropertiesFormat struct {
42845
42846 PolicySettings *PolicySettings `json:"policySettings,omitempty"`
42847
42848 CustomRules *[]WebApplicationFirewallCustomRule `json:"customRules,omitempty"`
42849
42850 ApplicationGateways *[]ApplicationGateway `json:"applicationGateways,omitempty"`
42851
42852 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
42853
42854 ResourceState WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"`
42855
42856 ManagedRules *ManagedRulesDefinition `json:"managedRules,omitempty"`
42857
42858 HTTPListeners *[]SubResource `json:"httpListeners,omitempty"`
42859
42860 PathBasedRules *[]SubResource `json:"pathBasedRules,omitempty"`
42861 }
42862
42863
42864 func (wafppf WebApplicationFirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) {
42865 objectMap := make(map[string]interface{})
42866 if wafppf.PolicySettings != nil {
42867 objectMap["policySettings"] = wafppf.PolicySettings
42868 }
42869 if wafppf.CustomRules != nil {
42870 objectMap["customRules"] = wafppf.CustomRules
42871 }
42872 if wafppf.ManagedRules != nil {
42873 objectMap["managedRules"] = wafppf.ManagedRules
42874 }
42875 return json.Marshal(objectMap)
42876 }
42877
View as plain text