1package network 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 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// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-04-01/network" 22 23// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the 24// virtual network. 25type AddressSpace struct { 26 // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. 27 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` 28} 29 30// ApplicationGateway application gateway resource 31type ApplicationGateway struct { 32 autorest.Response `json:"-"` 33 *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` 34 // Etag - A unique read-only string that changes whenever the resource is updated. 35 Etag *string `json:"etag,omitempty"` 36 // Zones - A list of availability zones denoting where the resource needs to come from. 37 Zones *[]string `json:"zones,omitempty"` 38 // ID - Resource ID. 39 ID *string `json:"id,omitempty"` 40 // Name - READ-ONLY; Resource name. 41 Name *string `json:"name,omitempty"` 42 // Type - READ-ONLY; Resource type. 43 Type *string `json:"type,omitempty"` 44 // Location - Resource location. 45 Location *string `json:"location,omitempty"` 46 // Tags - Resource tags. 47 Tags map[string]*string `json:"tags"` 48} 49 50// MarshalJSON is the custom marshaler for ApplicationGateway. 51func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { 52 objectMap := make(map[string]interface{}) 53 if ag.ApplicationGatewayPropertiesFormat != nil { 54 objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat 55 } 56 if ag.Etag != nil { 57 objectMap["etag"] = ag.Etag 58 } 59 if ag.Zones != nil { 60 objectMap["zones"] = ag.Zones 61 } 62 if ag.ID != nil { 63 objectMap["id"] = ag.ID 64 } 65 if ag.Location != nil { 66 objectMap["location"] = ag.Location 67 } 68 if ag.Tags != nil { 69 objectMap["tags"] = ag.Tags 70 } 71 return json.Marshal(objectMap) 72} 73 74// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. 75func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { 76 var m map[string]*json.RawMessage 77 err := json.Unmarshal(body, &m) 78 if err != nil { 79 return err 80 } 81 for k, v := range m { 82 switch k { 83 case "properties": 84 if v != nil { 85 var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat 86 err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) 87 if err != nil { 88 return err 89 } 90 ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat 91 } 92 case "etag": 93 if v != nil { 94 var etag string 95 err = json.Unmarshal(*v, &etag) 96 if err != nil { 97 return err 98 } 99 ag.Etag = &etag 100 } 101 case "zones": 102 if v != nil { 103 var zones []string 104 err = json.Unmarshal(*v, &zones) 105 if err != nil { 106 return err 107 } 108 ag.Zones = &zones 109 } 110 case "id": 111 if v != nil { 112 var ID string 113 err = json.Unmarshal(*v, &ID) 114 if err != nil { 115 return err 116 } 117 ag.ID = &ID 118 } 119 case "name": 120 if v != nil { 121 var name string 122 err = json.Unmarshal(*v, &name) 123 if err != nil { 124 return err 125 } 126 ag.Name = &name 127 } 128 case "type": 129 if v != nil { 130 var typeVar string 131 err = json.Unmarshal(*v, &typeVar) 132 if err != nil { 133 return err 134 } 135 ag.Type = &typeVar 136 } 137 case "location": 138 if v != nil { 139 var location string 140 err = json.Unmarshal(*v, &location) 141 if err != nil { 142 return err 143 } 144 ag.Location = &location 145 } 146 case "tags": 147 if v != nil { 148 var tags map[string]*string 149 err = json.Unmarshal(*v, &tags) 150 if err != nil { 151 return err 152 } 153 ag.Tags = tags 154 } 155 } 156 } 157 158 return nil 159} 160 161// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. 162type ApplicationGatewayAuthenticationCertificate struct { 163 *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` 164 // Name - Name of the authentication certificate that is unique within an Application Gateway. 165 Name *string `json:"name,omitempty"` 166 // Etag - A unique read-only string that changes whenever the resource is updated. 167 Etag *string `json:"etag,omitempty"` 168 // Type - Type of the resource. 169 Type *string `json:"type,omitempty"` 170 // ID - Resource ID. 171 ID *string `json:"id,omitempty"` 172} 173 174// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. 175func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { 176 objectMap := make(map[string]interface{}) 177 if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { 178 objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat 179 } 180 if agac.Name != nil { 181 objectMap["name"] = agac.Name 182 } 183 if agac.Etag != nil { 184 objectMap["etag"] = agac.Etag 185 } 186 if agac.Type != nil { 187 objectMap["type"] = agac.Type 188 } 189 if agac.ID != nil { 190 objectMap["id"] = agac.ID 191 } 192 return json.Marshal(objectMap) 193} 194 195// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. 196func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error { 197 var m map[string]*json.RawMessage 198 err := json.Unmarshal(body, &m) 199 if err != nil { 200 return err 201 } 202 for k, v := range m { 203 switch k { 204 case "properties": 205 if v != nil { 206 var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat 207 err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) 208 if err != nil { 209 return err 210 } 211 agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat 212 } 213 case "name": 214 if v != nil { 215 var name string 216 err = json.Unmarshal(*v, &name) 217 if err != nil { 218 return err 219 } 220 agac.Name = &name 221 } 222 case "etag": 223 if v != nil { 224 var etag string 225 err = json.Unmarshal(*v, &etag) 226 if err != nil { 227 return err 228 } 229 agac.Etag = &etag 230 } 231 case "type": 232 if v != nil { 233 var typeVar string 234 err = json.Unmarshal(*v, &typeVar) 235 if err != nil { 236 return err 237 } 238 agac.Type = &typeVar 239 } 240 case "id": 241 if v != nil { 242 var ID string 243 err = json.Unmarshal(*v, &ID) 244 if err != nil { 245 return err 246 } 247 agac.ID = &ID 248 } 249 } 250 } 251 252 return nil 253} 254 255// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an 256// application gateway. 257type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { 258 // Data - Certificate public data. 259 Data *string `json:"data,omitempty"` 260 // ProvisioningState - Provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 261 ProvisioningState *string `json:"provisioningState,omitempty"` 262} 263 264// ApplicationGatewayAutoscaleBounds application Gateway autoscale bounds on number of Application Gateway 265// instance. 266type ApplicationGatewayAutoscaleBounds struct { 267 // Min - Lower bound on number of Application Gateway instances. 268 Min *int32 `json:"min,omitempty"` 269 // Max - Upper bound on number of Application Gateway instances. 270 Max *int32 `json:"max,omitempty"` 271} 272 273// ApplicationGatewayAutoscaleConfiguration application Gateway autoscale configuration. 274type ApplicationGatewayAutoscaleConfiguration struct { 275 // Bounds - Autoscale bounds 276 Bounds *ApplicationGatewayAutoscaleBounds `json:"bounds,omitempty"` 277} 278 279// ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service 280// call. 281type ApplicationGatewayAvailableSslOptions struct { 282 autorest.Response `json:"-"` 283 *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` 284 // ID - Resource ID. 285 ID *string `json:"id,omitempty"` 286 // Name - READ-ONLY; Resource name. 287 Name *string `json:"name,omitempty"` 288 // Type - READ-ONLY; Resource type. 289 Type *string `json:"type,omitempty"` 290 // Location - Resource location. 291 Location *string `json:"location,omitempty"` 292 // Tags - Resource tags. 293 Tags map[string]*string `json:"tags"` 294} 295 296// MarshalJSON is the custom marshaler for ApplicationGatewayAvailableSslOptions. 297func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error) { 298 objectMap := make(map[string]interface{}) 299 if agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat != nil { 300 objectMap["properties"] = agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat 301 } 302 if agaso.ID != nil { 303 objectMap["id"] = agaso.ID 304 } 305 if agaso.Location != nil { 306 objectMap["location"] = agaso.Location 307 } 308 if agaso.Tags != nil { 309 objectMap["tags"] = agaso.Tags 310 } 311 return json.Marshal(objectMap) 312} 313 314// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAvailableSslOptions struct. 315func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) error { 316 var m map[string]*json.RawMessage 317 err := json.Unmarshal(body, &m) 318 if err != nil { 319 return err 320 } 321 for k, v := range m { 322 switch k { 323 case "properties": 324 if v != nil { 325 var applicationGatewayAvailableSslOptionsPropertiesFormat ApplicationGatewayAvailableSslOptionsPropertiesFormat 326 err = json.Unmarshal(*v, &applicationGatewayAvailableSslOptionsPropertiesFormat) 327 if err != nil { 328 return err 329 } 330 agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &applicationGatewayAvailableSslOptionsPropertiesFormat 331 } 332 case "id": 333 if v != nil { 334 var ID string 335 err = json.Unmarshal(*v, &ID) 336 if err != nil { 337 return err 338 } 339 agaso.ID = &ID 340 } 341 case "name": 342 if v != nil { 343 var name string 344 err = json.Unmarshal(*v, &name) 345 if err != nil { 346 return err 347 } 348 agaso.Name = &name 349 } 350 case "type": 351 if v != nil { 352 var typeVar string 353 err = json.Unmarshal(*v, &typeVar) 354 if err != nil { 355 return err 356 } 357 agaso.Type = &typeVar 358 } 359 case "location": 360 if v != nil { 361 var location string 362 err = json.Unmarshal(*v, &location) 363 if err != nil { 364 return err 365 } 366 agaso.Location = &location 367 } 368 case "tags": 369 if v != nil { 370 var tags map[string]*string 371 err = json.Unmarshal(*v, &tags) 372 if err != nil { 373 return err 374 } 375 agaso.Tags = tags 376 } 377 } 378 } 379 380 return nil 381} 382 383// ApplicationGatewayAvailableSslOptionsPropertiesFormat properties of 384// ApplicationGatewayAvailableSslOptions 385type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { 386 // PredefinedPolicies - List of available Ssl predefined policy. 387 PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` 388 // DefaultPolicy - Name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' 389 DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` 390 // AvailableCipherSuites - List of available Ssl cipher suites. 391 AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` 392 // AvailableProtocols - List of available Ssl protocols. 393 AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` 394} 395 396// ApplicationGatewayAvailableSslPredefinedPolicies response for ApplicationGatewayAvailableSslOptions API 397// service call. 398type ApplicationGatewayAvailableSslPredefinedPolicies struct { 399 autorest.Response `json:"-"` 400 // Value - List of available Ssl predefined policy. 401 Value *[]ApplicationGatewaySslPredefinedPolicy `json:"value,omitempty"` 402 // NextLink - URL to get the next set of results. 403 NextLink *string `json:"nextLink,omitempty"` 404} 405 406// ApplicationGatewayAvailableSslPredefinedPoliciesIterator provides access to a complete listing of 407// ApplicationGatewaySslPredefinedPolicy values. 408type ApplicationGatewayAvailableSslPredefinedPoliciesIterator struct { 409 i int 410 page ApplicationGatewayAvailableSslPredefinedPoliciesPage 411} 412 413// NextWithContext advances to the next value. If there was an error making 414// the request the iterator does not advance and the error is returned. 415func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NextWithContext(ctx context.Context) (err error) { 416 if tracing.IsEnabled() { 417 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesIterator.NextWithContext") 418 defer func() { 419 sc := -1 420 if iter.Response().Response.Response != nil { 421 sc = iter.Response().Response.Response.StatusCode 422 } 423 tracing.EndSpan(ctx, sc, err) 424 }() 425 } 426 iter.i++ 427 if iter.i < len(iter.page.Values()) { 428 return nil 429 } 430 err = iter.page.NextWithContext(ctx) 431 if err != nil { 432 iter.i-- 433 return err 434 } 435 iter.i = 0 436 return nil 437} 438 439// Next advances to the next value. If there was an error making 440// the request the iterator does not advance and the error is returned. 441// Deprecated: Use NextWithContext() instead. 442func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Next() error { 443 return iter.NextWithContext(context.Background()) 444} 445 446// NotDone returns true if the enumeration should be started or is not yet complete. 447func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NotDone() bool { 448 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 449} 450 451// Response returns the raw server response from the last page request. 452func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Response() ApplicationGatewayAvailableSslPredefinedPolicies { 453 return iter.page.Response() 454} 455 456// Value returns the current value or a zero-initialized value if the 457// iterator has advanced beyond the end of the collection. 458func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Value() ApplicationGatewaySslPredefinedPolicy { 459 if !iter.page.NotDone() { 460 return ApplicationGatewaySslPredefinedPolicy{} 461 } 462 return iter.page.Values()[iter.i] 463} 464 465// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesIterator type. 466func NewApplicationGatewayAvailableSslPredefinedPoliciesIterator(page ApplicationGatewayAvailableSslPredefinedPoliciesPage) ApplicationGatewayAvailableSslPredefinedPoliciesIterator { 467 return ApplicationGatewayAvailableSslPredefinedPoliciesIterator{page: page} 468} 469 470// IsEmpty returns true if the ListResult contains no values. 471func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool { 472 return agaspp.Value == nil || len(*agaspp.Value) == 0 473} 474 475// hasNextLink returns true if the NextLink is not empty. 476func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool { 477 return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0 478} 479 480// applicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. 481// It returns nil if no more results exist. 482func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { 483 if !agaspp.hasNextLink() { 484 return nil, nil 485 } 486 return autorest.Prepare((&http.Request{}).WithContext(ctx), 487 autorest.AsJSON(), 488 autorest.AsGet(), 489 autorest.WithBaseURL(to.String(agaspp.NextLink))) 490} 491 492// ApplicationGatewayAvailableSslPredefinedPoliciesPage contains a page of 493// ApplicationGatewaySslPredefinedPolicy values. 494type ApplicationGatewayAvailableSslPredefinedPoliciesPage struct { 495 fn func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error) 496 agaspp ApplicationGatewayAvailableSslPredefinedPolicies 497} 498 499// NextWithContext advances to the next page of values. If there was an error making 500// the request the page does not advance and the error is returned. 501func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContext(ctx context.Context) (err error) { 502 if tracing.IsEnabled() { 503 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesPage.NextWithContext") 504 defer func() { 505 sc := -1 506 if page.Response().Response.Response != nil { 507 sc = page.Response().Response.Response.StatusCode 508 } 509 tracing.EndSpan(ctx, sc, err) 510 }() 511 } 512 for { 513 next, err := page.fn(ctx, page.agaspp) 514 if err != nil { 515 return err 516 } 517 page.agaspp = next 518 if !next.hasNextLink() || !next.IsEmpty() { 519 break 520 } 521 } 522 return nil 523} 524 525// Next advances to the next page of values. If there was an error making 526// the request the page does not advance and the error is returned. 527// Deprecated: Use NextWithContext() instead. 528func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) Next() error { 529 return page.NextWithContext(context.Background()) 530} 531 532// NotDone returns true if the page enumeration should be started or is not yet complete. 533func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) NotDone() bool { 534 return !page.agaspp.IsEmpty() 535} 536 537// Response returns the raw server response from the last page request. 538func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Response() ApplicationGatewayAvailableSslPredefinedPolicies { 539 return page.agaspp 540} 541 542// Values returns the slice of values for the current page or nil if there are no values. 543func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []ApplicationGatewaySslPredefinedPolicy { 544 if page.agaspp.IsEmpty() { 545 return nil 546 } 547 return *page.agaspp.Value 548} 549 550// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesPage type. 551func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(cur ApplicationGatewayAvailableSslPredefinedPolicies, getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage { 552 return ApplicationGatewayAvailableSslPredefinedPoliciesPage{ 553 fn: getNextPage, 554 agaspp: cur, 555 } 556} 557 558// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API 559// service call. 560type ApplicationGatewayAvailableWafRuleSetsResult struct { 561 autorest.Response `json:"-"` 562 // Value - The list of application gateway rule sets. 563 Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` 564} 565 566// ApplicationGatewayBackendAddress backend address of an application gateway. 567type ApplicationGatewayBackendAddress struct { 568 // Fqdn - Fully qualified domain name (FQDN). 569 Fqdn *string `json:"fqdn,omitempty"` 570 // IPAddress - IP address 571 IPAddress *string `json:"ipAddress,omitempty"` 572} 573 574// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. 575type ApplicationGatewayBackendAddressPool struct { 576 *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 577 // Name - Name of the backend address pool that is unique within an Application Gateway. 578 Name *string `json:"name,omitempty"` 579 // Etag - A unique read-only string that changes whenever the resource is updated. 580 Etag *string `json:"etag,omitempty"` 581 // Type - Type of the resource. 582 Type *string `json:"type,omitempty"` 583 // ID - Resource ID. 584 ID *string `json:"id,omitempty"` 585} 586 587// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. 588func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { 589 objectMap := make(map[string]interface{}) 590 if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { 591 objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat 592 } 593 if agbap.Name != nil { 594 objectMap["name"] = agbap.Name 595 } 596 if agbap.Etag != nil { 597 objectMap["etag"] = agbap.Etag 598 } 599 if agbap.Type != nil { 600 objectMap["type"] = agbap.Type 601 } 602 if agbap.ID != nil { 603 objectMap["id"] = agbap.ID 604 } 605 return json.Marshal(objectMap) 606} 607 608// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. 609func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { 610 var m map[string]*json.RawMessage 611 err := json.Unmarshal(body, &m) 612 if err != nil { 613 return err 614 } 615 for k, v := range m { 616 switch k { 617 case "properties": 618 if v != nil { 619 var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat 620 err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) 621 if err != nil { 622 return err 623 } 624 agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat 625 } 626 case "name": 627 if v != nil { 628 var name string 629 err = json.Unmarshal(*v, &name) 630 if err != nil { 631 return err 632 } 633 agbap.Name = &name 634 } 635 case "etag": 636 if v != nil { 637 var etag string 638 err = json.Unmarshal(*v, &etag) 639 if err != nil { 640 return err 641 } 642 agbap.Etag = &etag 643 } 644 case "type": 645 if v != nil { 646 var typeVar string 647 err = json.Unmarshal(*v, &typeVar) 648 if err != nil { 649 return err 650 } 651 agbap.Type = &typeVar 652 } 653 case "id": 654 if v != nil { 655 var ID string 656 err = json.Unmarshal(*v, &ID) 657 if err != nil { 658 return err 659 } 660 agbap.ID = &ID 661 } 662 } 663 } 664 665 return nil 666} 667 668// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an 669// application gateway. 670type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { 671 // BackendIPConfigurations - Collection of references to IPs defined in network interfaces. 672 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 673 // BackendAddresses - Backend addresses 674 BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` 675 // ProvisioningState - Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 676 ProvisioningState *string `json:"provisioningState,omitempty"` 677} 678 679// ApplicationGatewayBackendHealth list of ApplicationGatewayBackendHealthPool resources. 680type ApplicationGatewayBackendHealth struct { 681 autorest.Response `json:"-"` 682 BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` 683} 684 685// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings. 686type ApplicationGatewayBackendHealthHTTPSettings struct { 687 // BackendHTTPSettings - Reference of an ApplicationGatewayBackendHttpSettings resource. 688 BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` 689 // Servers - List of ApplicationGatewayBackendHealthServer resources. 690 Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` 691} 692 693// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool. 694type ApplicationGatewayBackendHealthPool struct { 695 // BackendAddressPool - Reference of an ApplicationGatewayBackendAddressPool resource. 696 BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` 697 // BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources. 698 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` 699} 700 701// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings. 702type ApplicationGatewayBackendHealthServer struct { 703 // Address - IP address or FQDN of backend server. 704 Address *string `json:"address,omitempty"` 705 // IPConfiguration - Reference of IP configuration of backend server. 706 IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` 707 // Health - Health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' 708 Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` 709} 710 711// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. 712type ApplicationGatewayBackendHTTPSettings struct { 713 *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` 714 // Name - Name of the backend http settings that is unique within an Application Gateway. 715 Name *string `json:"name,omitempty"` 716 // Etag - A unique read-only string that changes whenever the resource is updated. 717 Etag *string `json:"etag,omitempty"` 718 // Type - Type of the resource. 719 Type *string `json:"type,omitempty"` 720 // ID - Resource ID. 721 ID *string `json:"id,omitempty"` 722} 723 724// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. 725func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { 726 objectMap := make(map[string]interface{}) 727 if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { 728 objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat 729 } 730 if agbhs.Name != nil { 731 objectMap["name"] = agbhs.Name 732 } 733 if agbhs.Etag != nil { 734 objectMap["etag"] = agbhs.Etag 735 } 736 if agbhs.Type != nil { 737 objectMap["type"] = agbhs.Type 738 } 739 if agbhs.ID != nil { 740 objectMap["id"] = agbhs.ID 741 } 742 return json.Marshal(objectMap) 743} 744 745// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. 746func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { 747 var m map[string]*json.RawMessage 748 err := json.Unmarshal(body, &m) 749 if err != nil { 750 return err 751 } 752 for k, v := range m { 753 switch k { 754 case "properties": 755 if v != nil { 756 var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat 757 err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) 758 if err != nil { 759 return err 760 } 761 agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat 762 } 763 case "name": 764 if v != nil { 765 var name string 766 err = json.Unmarshal(*v, &name) 767 if err != nil { 768 return err 769 } 770 agbhs.Name = &name 771 } 772 case "etag": 773 if v != nil { 774 var etag string 775 err = json.Unmarshal(*v, &etag) 776 if err != nil { 777 return err 778 } 779 agbhs.Etag = &etag 780 } 781 case "type": 782 if v != nil { 783 var typeVar string 784 err = json.Unmarshal(*v, &typeVar) 785 if err != nil { 786 return err 787 } 788 agbhs.Type = &typeVar 789 } 790 case "id": 791 if v != nil { 792 var ID string 793 err = json.Unmarshal(*v, &ID) 794 if err != nil { 795 return err 796 } 797 agbhs.ID = &ID 798 } 799 } 800 } 801 802 return nil 803} 804 805// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an 806// application gateway. 807type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { 808 // Port - The destination port on the backend. 809 Port *int32 `json:"port,omitempty"` 810 // Protocol - The protocol used to communicate with the backend. Possible values are 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS' 811 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 812 // CookieBasedAffinity - Cookie based affinity. Possible values include: 'Enabled', 'Disabled' 813 CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` 814 // RequestTimeout - Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. 815 RequestTimeout *int32 `json:"requestTimeout,omitempty"` 816 // Probe - Probe resource of an application gateway. 817 Probe *SubResource `json:"probe,omitempty"` 818 // AuthenticationCertificates - Array of references to application gateway authentication certificates. 819 AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` 820 // ConnectionDraining - Connection draining of the backend http settings resource. 821 ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` 822 // HostName - Host header to be sent to the backend servers. 823 HostName *string `json:"hostName,omitempty"` 824 // PickHostNameFromBackendAddress - Whether to pick host header should be picked from the host name of the backend server. Default value is false. 825 PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` 826 // AffinityCookieName - Cookie name to use for the affinity cookie. 827 AffinityCookieName *string `json:"affinityCookieName,omitempty"` 828 // ProbeEnabled - Whether the probe is enabled. Default value is false. 829 ProbeEnabled *bool `json:"probeEnabled,omitempty"` 830 // Path - Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. 831 Path *string `json:"path,omitempty"` 832 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 833 ProvisioningState *string `json:"provisioningState,omitempty"` 834} 835 836// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to 837// be active for a specified time after the backend server got removed from the configuration. 838type ApplicationGatewayConnectionDraining struct { 839 // Enabled - Whether connection draining is enabled or not. 840 Enabled *bool `json:"enabled,omitempty"` 841 // DrainTimeoutInSec - The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. 842 DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` 843} 844 845// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire 846// rule group. 847type ApplicationGatewayFirewallDisabledRuleGroup struct { 848 // RuleGroupName - The name of the rule group that will be disabled. 849 RuleGroupName *string `json:"ruleGroupName,omitempty"` 850 // Rules - The list of rules that will be disabled. If null, all rules of the rule group will be disabled. 851 Rules *[]int32 `json:"rules,omitempty"` 852} 853 854// ApplicationGatewayFirewallRule a web application firewall rule. 855type ApplicationGatewayFirewallRule struct { 856 // RuleID - The identifier of the web application firewall rule. 857 RuleID *int32 `json:"ruleId,omitempty"` 858 // Description - The description of the web application firewall rule. 859 Description *string `json:"description,omitempty"` 860} 861 862// ApplicationGatewayFirewallRuleGroup a web application firewall rule group. 863type ApplicationGatewayFirewallRuleGroup struct { 864 // RuleGroupName - The name of the web application firewall rule group. 865 RuleGroupName *string `json:"ruleGroupName,omitempty"` 866 // Description - The description of the web application firewall rule group. 867 Description *string `json:"description,omitempty"` 868 // Rules - The rules of the web application firewall rule group. 869 Rules *[]ApplicationGatewayFirewallRule `json:"rules,omitempty"` 870} 871 872// ApplicationGatewayFirewallRuleSet a web application firewall rule set. 873type ApplicationGatewayFirewallRuleSet struct { 874 *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` 875 // ID - Resource ID. 876 ID *string `json:"id,omitempty"` 877 // Name - READ-ONLY; Resource name. 878 Name *string `json:"name,omitempty"` 879 // Type - READ-ONLY; Resource type. 880 Type *string `json:"type,omitempty"` 881 // Location - Resource location. 882 Location *string `json:"location,omitempty"` 883 // Tags - Resource tags. 884 Tags map[string]*string `json:"tags"` 885} 886 887// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSet. 888func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { 889 objectMap := make(map[string]interface{}) 890 if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil { 891 objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat 892 } 893 if agfrs.ID != nil { 894 objectMap["id"] = agfrs.ID 895 } 896 if agfrs.Location != nil { 897 objectMap["location"] = agfrs.Location 898 } 899 if agfrs.Tags != nil { 900 objectMap["tags"] = agfrs.Tags 901 } 902 return json.Marshal(objectMap) 903} 904 905// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. 906func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error { 907 var m map[string]*json.RawMessage 908 err := json.Unmarshal(body, &m) 909 if err != nil { 910 return err 911 } 912 for k, v := range m { 913 switch k { 914 case "properties": 915 if v != nil { 916 var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat 917 err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat) 918 if err != nil { 919 return err 920 } 921 agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat 922 } 923 case "id": 924 if v != nil { 925 var ID string 926 err = json.Unmarshal(*v, &ID) 927 if err != nil { 928 return err 929 } 930 agfrs.ID = &ID 931 } 932 case "name": 933 if v != nil { 934 var name string 935 err = json.Unmarshal(*v, &name) 936 if err != nil { 937 return err 938 } 939 agfrs.Name = &name 940 } 941 case "type": 942 if v != nil { 943 var typeVar string 944 err = json.Unmarshal(*v, &typeVar) 945 if err != nil { 946 return err 947 } 948 agfrs.Type = &typeVar 949 } 950 case "location": 951 if v != nil { 952 var location string 953 err = json.Unmarshal(*v, &location) 954 if err != nil { 955 return err 956 } 957 agfrs.Location = &location 958 } 959 case "tags": 960 if v != nil { 961 var tags map[string]*string 962 err = json.Unmarshal(*v, &tags) 963 if err != nil { 964 return err 965 } 966 agfrs.Tags = tags 967 } 968 } 969 } 970 971 return nil 972} 973 974// ApplicationGatewayFirewallRuleSetPropertiesFormat properties of the web application firewall rule set. 975type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { 976 // ProvisioningState - The provisioning state of the web application firewall rule set. 977 ProvisioningState *string `json:"provisioningState,omitempty"` 978 // RuleSetType - The type of the web application firewall rule set. 979 RuleSetType *string `json:"ruleSetType,omitempty"` 980 // RuleSetVersion - The version of the web application firewall rule set type. 981 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 982 // RuleGroups - The rule groups of the web application firewall rule set. 983 RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` 984} 985 986// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. 987type ApplicationGatewayFrontendIPConfiguration struct { 988 *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` 989 // Name - Name of the frontend IP configuration that is unique within an Application Gateway. 990 Name *string `json:"name,omitempty"` 991 // Etag - A unique read-only string that changes whenever the resource is updated. 992 Etag *string `json:"etag,omitempty"` 993 // Type - Type of the resource. 994 Type *string `json:"type,omitempty"` 995 // ID - Resource ID. 996 ID *string `json:"id,omitempty"` 997} 998 999// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. 1000func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { 1001 objectMap := make(map[string]interface{}) 1002 if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { 1003 objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat 1004 } 1005 if agfic.Name != nil { 1006 objectMap["name"] = agfic.Name 1007 } 1008 if agfic.Etag != nil { 1009 objectMap["etag"] = agfic.Etag 1010 } 1011 if agfic.Type != nil { 1012 objectMap["type"] = agfic.Type 1013 } 1014 if agfic.ID != nil { 1015 objectMap["id"] = agfic.ID 1016 } 1017 return json.Marshal(objectMap) 1018} 1019 1020// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. 1021func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { 1022 var m map[string]*json.RawMessage 1023 err := json.Unmarshal(body, &m) 1024 if err != nil { 1025 return err 1026 } 1027 for k, v := range m { 1028 switch k { 1029 case "properties": 1030 if v != nil { 1031 var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat 1032 err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) 1033 if err != nil { 1034 return err 1035 } 1036 agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat 1037 } 1038 case "name": 1039 if v != nil { 1040 var name string 1041 err = json.Unmarshal(*v, &name) 1042 if err != nil { 1043 return err 1044 } 1045 agfic.Name = &name 1046 } 1047 case "etag": 1048 if v != nil { 1049 var etag string 1050 err = json.Unmarshal(*v, &etag) 1051 if err != nil { 1052 return err 1053 } 1054 agfic.Etag = &etag 1055 } 1056 case "type": 1057 if v != nil { 1058 var typeVar string 1059 err = json.Unmarshal(*v, &typeVar) 1060 if err != nil { 1061 return err 1062 } 1063 agfic.Type = &typeVar 1064 } 1065 case "id": 1066 if v != nil { 1067 var ID string 1068 err = json.Unmarshal(*v, &ID) 1069 if err != nil { 1070 return err 1071 } 1072 agfic.ID = &ID 1073 } 1074 } 1075 } 1076 1077 return nil 1078} 1079 1080// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an 1081// application gateway. 1082type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { 1083 // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. 1084 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 1085 // PrivateIPAllocationMethod - PrivateIP allocation method. Possible values include: 'Static', 'Dynamic' 1086 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 1087 // Subnet - Reference of the subnet resource. 1088 Subnet *SubResource `json:"subnet,omitempty"` 1089 // PublicIPAddress - Reference of the PublicIP resource. 1090 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 1091 // ProvisioningState - Provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1092 ProvisioningState *string `json:"provisioningState,omitempty"` 1093} 1094 1095// ApplicationGatewayFrontendPort frontend port of an application gateway. 1096type ApplicationGatewayFrontendPort struct { 1097 *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` 1098 // Name - Name of the frontend port that is unique within an Application Gateway 1099 Name *string `json:"name,omitempty"` 1100 // Etag - A unique read-only string that changes whenever the resource is updated. 1101 Etag *string `json:"etag,omitempty"` 1102 // Type - Type of the resource. 1103 Type *string `json:"type,omitempty"` 1104 // ID - Resource ID. 1105 ID *string `json:"id,omitempty"` 1106} 1107 1108// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. 1109func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { 1110 objectMap := make(map[string]interface{}) 1111 if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { 1112 objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat 1113 } 1114 if agfp.Name != nil { 1115 objectMap["name"] = agfp.Name 1116 } 1117 if agfp.Etag != nil { 1118 objectMap["etag"] = agfp.Etag 1119 } 1120 if agfp.Type != nil { 1121 objectMap["type"] = agfp.Type 1122 } 1123 if agfp.ID != nil { 1124 objectMap["id"] = agfp.ID 1125 } 1126 return json.Marshal(objectMap) 1127} 1128 1129// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. 1130func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { 1131 var m map[string]*json.RawMessage 1132 err := json.Unmarshal(body, &m) 1133 if err != nil { 1134 return err 1135 } 1136 for k, v := range m { 1137 switch k { 1138 case "properties": 1139 if v != nil { 1140 var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat 1141 err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) 1142 if err != nil { 1143 return err 1144 } 1145 agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat 1146 } 1147 case "name": 1148 if v != nil { 1149 var name string 1150 err = json.Unmarshal(*v, &name) 1151 if err != nil { 1152 return err 1153 } 1154 agfp.Name = &name 1155 } 1156 case "etag": 1157 if v != nil { 1158 var etag string 1159 err = json.Unmarshal(*v, &etag) 1160 if err != nil { 1161 return err 1162 } 1163 agfp.Etag = &etag 1164 } 1165 case "type": 1166 if v != nil { 1167 var typeVar string 1168 err = json.Unmarshal(*v, &typeVar) 1169 if err != nil { 1170 return err 1171 } 1172 agfp.Type = &typeVar 1173 } 1174 case "id": 1175 if v != nil { 1176 var ID string 1177 err = json.Unmarshal(*v, &ID) 1178 if err != nil { 1179 return err 1180 } 1181 agfp.ID = &ID 1182 } 1183 } 1184 } 1185 1186 return nil 1187} 1188 1189// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway. 1190type ApplicationGatewayFrontendPortPropertiesFormat struct { 1191 // Port - Frontend port 1192 Port *int32 `json:"port,omitempty"` 1193 // ProvisioningState - Provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1194 ProvisioningState *string `json:"provisioningState,omitempty"` 1195} 1196 1197// ApplicationGatewayHTTPListener http listener of an application gateway. 1198type ApplicationGatewayHTTPListener struct { 1199 *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` 1200 // Name - Name of the HTTP listener that is unique within an Application Gateway. 1201 Name *string `json:"name,omitempty"` 1202 // Etag - A unique read-only string that changes whenever the resource is updated. 1203 Etag *string `json:"etag,omitempty"` 1204 // Type - Type of the resource. 1205 Type *string `json:"type,omitempty"` 1206 // ID - Resource ID. 1207 ID *string `json:"id,omitempty"` 1208} 1209 1210// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. 1211func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { 1212 objectMap := make(map[string]interface{}) 1213 if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { 1214 objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat 1215 } 1216 if aghl.Name != nil { 1217 objectMap["name"] = aghl.Name 1218 } 1219 if aghl.Etag != nil { 1220 objectMap["etag"] = aghl.Etag 1221 } 1222 if aghl.Type != nil { 1223 objectMap["type"] = aghl.Type 1224 } 1225 if aghl.ID != nil { 1226 objectMap["id"] = aghl.ID 1227 } 1228 return json.Marshal(objectMap) 1229} 1230 1231// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. 1232func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { 1233 var m map[string]*json.RawMessage 1234 err := json.Unmarshal(body, &m) 1235 if err != nil { 1236 return err 1237 } 1238 for k, v := range m { 1239 switch k { 1240 case "properties": 1241 if v != nil { 1242 var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat 1243 err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) 1244 if err != nil { 1245 return err 1246 } 1247 aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat 1248 } 1249 case "name": 1250 if v != nil { 1251 var name string 1252 err = json.Unmarshal(*v, &name) 1253 if err != nil { 1254 return err 1255 } 1256 aghl.Name = &name 1257 } 1258 case "etag": 1259 if v != nil { 1260 var etag string 1261 err = json.Unmarshal(*v, &etag) 1262 if err != nil { 1263 return err 1264 } 1265 aghl.Etag = &etag 1266 } 1267 case "type": 1268 if v != nil { 1269 var typeVar string 1270 err = json.Unmarshal(*v, &typeVar) 1271 if err != nil { 1272 return err 1273 } 1274 aghl.Type = &typeVar 1275 } 1276 case "id": 1277 if v != nil { 1278 var ID string 1279 err = json.Unmarshal(*v, &ID) 1280 if err != nil { 1281 return err 1282 } 1283 aghl.ID = &ID 1284 } 1285 } 1286 } 1287 1288 return nil 1289} 1290 1291// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway. 1292type ApplicationGatewayHTTPListenerPropertiesFormat struct { 1293 // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. 1294 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 1295 // FrontendPort - Frontend port resource of an application gateway. 1296 FrontendPort *SubResource `json:"frontendPort,omitempty"` 1297 // Protocol - Protocol of the HTTP listener. Possible values are 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS' 1298 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 1299 // HostName - Host name of HTTP listener. 1300 HostName *string `json:"hostName,omitempty"` 1301 // SslCertificate - SSL certificate resource of an application gateway. 1302 SslCertificate *SubResource `json:"sslCertificate,omitempty"` 1303 // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. 1304 RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` 1305 // ProvisioningState - Provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1306 ProvisioningState *string `json:"provisioningState,omitempty"` 1307} 1308 1309// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 1310// private IP configuration is allowed. 1311type ApplicationGatewayIPConfiguration struct { 1312 *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 1313 // Name - Name of the IP configuration that is unique within an Application Gateway. 1314 Name *string `json:"name,omitempty"` 1315 // Etag - A unique read-only string that changes whenever the resource is updated. 1316 Etag *string `json:"etag,omitempty"` 1317 // Type - Type of the resource. 1318 Type *string `json:"type,omitempty"` 1319 // ID - Resource ID. 1320 ID *string `json:"id,omitempty"` 1321} 1322 1323// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. 1324func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 1325 objectMap := make(map[string]interface{}) 1326 if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { 1327 objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat 1328 } 1329 if agic.Name != nil { 1330 objectMap["name"] = agic.Name 1331 } 1332 if agic.Etag != nil { 1333 objectMap["etag"] = agic.Etag 1334 } 1335 if agic.Type != nil { 1336 objectMap["type"] = agic.Type 1337 } 1338 if agic.ID != nil { 1339 objectMap["id"] = agic.ID 1340 } 1341 return json.Marshal(objectMap) 1342} 1343 1344// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. 1345func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 1346 var m map[string]*json.RawMessage 1347 err := json.Unmarshal(body, &m) 1348 if err != nil { 1349 return err 1350 } 1351 for k, v := range m { 1352 switch k { 1353 case "properties": 1354 if v != nil { 1355 var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat 1356 err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat) 1357 if err != nil { 1358 return err 1359 } 1360 agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat 1361 } 1362 case "name": 1363 if v != nil { 1364 var name string 1365 err = json.Unmarshal(*v, &name) 1366 if err != nil { 1367 return err 1368 } 1369 agic.Name = &name 1370 } 1371 case "etag": 1372 if v != nil { 1373 var etag string 1374 err = json.Unmarshal(*v, &etag) 1375 if err != nil { 1376 return err 1377 } 1378 agic.Etag = &etag 1379 } 1380 case "type": 1381 if v != nil { 1382 var typeVar string 1383 err = json.Unmarshal(*v, &typeVar) 1384 if err != nil { 1385 return err 1386 } 1387 agic.Type = &typeVar 1388 } 1389 case "id": 1390 if v != nil { 1391 var ID string 1392 err = json.Unmarshal(*v, &ID) 1393 if err != nil { 1394 return err 1395 } 1396 agic.ID = &ID 1397 } 1398 } 1399 } 1400 1401 return nil 1402} 1403 1404// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application 1405// gateway. 1406type ApplicationGatewayIPConfigurationPropertiesFormat struct { 1407 // Subnet - Reference of the subnet resource. A subnet from where application gateway gets its private address. 1408 Subnet *SubResource `json:"subnet,omitempty"` 1409 // ProvisioningState - Provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1410 ProvisioningState *string `json:"provisioningState,omitempty"` 1411} 1412 1413// ApplicationGatewayListResult response for ListApplicationGateways API service call. 1414type ApplicationGatewayListResult struct { 1415 autorest.Response `json:"-"` 1416 // Value - List of an application gateways in a resource group. 1417 Value *[]ApplicationGateway `json:"value,omitempty"` 1418 // NextLink - URL to get the next set of results. 1419 NextLink *string `json:"nextLink,omitempty"` 1420} 1421 1422// ApplicationGatewayListResultIterator provides access to a complete listing of ApplicationGateway values. 1423type ApplicationGatewayListResultIterator struct { 1424 i int 1425 page ApplicationGatewayListResultPage 1426} 1427 1428// NextWithContext advances to the next value. If there was an error making 1429// the request the iterator does not advance and the error is returned. 1430func (iter *ApplicationGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 1431 if tracing.IsEnabled() { 1432 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultIterator.NextWithContext") 1433 defer func() { 1434 sc := -1 1435 if iter.Response().Response.Response != nil { 1436 sc = iter.Response().Response.Response.StatusCode 1437 } 1438 tracing.EndSpan(ctx, sc, err) 1439 }() 1440 } 1441 iter.i++ 1442 if iter.i < len(iter.page.Values()) { 1443 return nil 1444 } 1445 err = iter.page.NextWithContext(ctx) 1446 if err != nil { 1447 iter.i-- 1448 return err 1449 } 1450 iter.i = 0 1451 return nil 1452} 1453 1454// Next advances to the next value. If there was an error making 1455// the request the iterator does not advance and the error is returned. 1456// Deprecated: Use NextWithContext() instead. 1457func (iter *ApplicationGatewayListResultIterator) Next() error { 1458 return iter.NextWithContext(context.Background()) 1459} 1460 1461// NotDone returns true if the enumeration should be started or is not yet complete. 1462func (iter ApplicationGatewayListResultIterator) NotDone() bool { 1463 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1464} 1465 1466// Response returns the raw server response from the last page request. 1467func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult { 1468 return iter.page.Response() 1469} 1470 1471// Value returns the current value or a zero-initialized value if the 1472// iterator has advanced beyond the end of the collection. 1473func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway { 1474 if !iter.page.NotDone() { 1475 return ApplicationGateway{} 1476 } 1477 return iter.page.Values()[iter.i] 1478} 1479 1480// Creates a new instance of the ApplicationGatewayListResultIterator type. 1481func NewApplicationGatewayListResultIterator(page ApplicationGatewayListResultPage) ApplicationGatewayListResultIterator { 1482 return ApplicationGatewayListResultIterator{page: page} 1483} 1484 1485// IsEmpty returns true if the ListResult contains no values. 1486func (aglr ApplicationGatewayListResult) IsEmpty() bool { 1487 return aglr.Value == nil || len(*aglr.Value) == 0 1488} 1489 1490// hasNextLink returns true if the NextLink is not empty. 1491func (aglr ApplicationGatewayListResult) hasNextLink() bool { 1492 return aglr.NextLink != nil && len(*aglr.NextLink) != 0 1493} 1494 1495// applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. 1496// It returns nil if no more results exist. 1497func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 1498 if !aglr.hasNextLink() { 1499 return nil, nil 1500 } 1501 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1502 autorest.AsJSON(), 1503 autorest.AsGet(), 1504 autorest.WithBaseURL(to.String(aglr.NextLink))) 1505} 1506 1507// ApplicationGatewayListResultPage contains a page of ApplicationGateway values. 1508type ApplicationGatewayListResultPage struct { 1509 fn func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error) 1510 aglr ApplicationGatewayListResult 1511} 1512 1513// NextWithContext advances to the next page of values. If there was an error making 1514// the request the page does not advance and the error is returned. 1515func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 1516 if tracing.IsEnabled() { 1517 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultPage.NextWithContext") 1518 defer func() { 1519 sc := -1 1520 if page.Response().Response.Response != nil { 1521 sc = page.Response().Response.Response.StatusCode 1522 } 1523 tracing.EndSpan(ctx, sc, err) 1524 }() 1525 } 1526 for { 1527 next, err := page.fn(ctx, page.aglr) 1528 if err != nil { 1529 return err 1530 } 1531 page.aglr = next 1532 if !next.hasNextLink() || !next.IsEmpty() { 1533 break 1534 } 1535 } 1536 return nil 1537} 1538 1539// Next advances to the next page of values. If there was an error making 1540// the request the page does not advance and the error is returned. 1541// Deprecated: Use NextWithContext() instead. 1542func (page *ApplicationGatewayListResultPage) Next() error { 1543 return page.NextWithContext(context.Background()) 1544} 1545 1546// NotDone returns true if the page enumeration should be started or is not yet complete. 1547func (page ApplicationGatewayListResultPage) NotDone() bool { 1548 return !page.aglr.IsEmpty() 1549} 1550 1551// Response returns the raw server response from the last page request. 1552func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult { 1553 return page.aglr 1554} 1555 1556// Values returns the slice of values for the current page or nil if there are no values. 1557func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { 1558 if page.aglr.IsEmpty() { 1559 return nil 1560 } 1561 return *page.aglr.Value 1562} 1563 1564// Creates a new instance of the ApplicationGatewayListResultPage type. 1565func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage { 1566 return ApplicationGatewayListResultPage{ 1567 fn: getNextPage, 1568 aglr: cur, 1569 } 1570} 1571 1572// ApplicationGatewayPathRule path rule of URL path map of an application gateway. 1573type ApplicationGatewayPathRule struct { 1574 *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` 1575 // Name - Name of the path rule that is unique within an Application Gateway. 1576 Name *string `json:"name,omitempty"` 1577 // Etag - A unique read-only string that changes whenever the resource is updated. 1578 Etag *string `json:"etag,omitempty"` 1579 // Type - Type of the resource. 1580 Type *string `json:"type,omitempty"` 1581 // ID - Resource ID. 1582 ID *string `json:"id,omitempty"` 1583} 1584 1585// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule. 1586func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { 1587 objectMap := make(map[string]interface{}) 1588 if agpr.ApplicationGatewayPathRulePropertiesFormat != nil { 1589 objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat 1590 } 1591 if agpr.Name != nil { 1592 objectMap["name"] = agpr.Name 1593 } 1594 if agpr.Etag != nil { 1595 objectMap["etag"] = agpr.Etag 1596 } 1597 if agpr.Type != nil { 1598 objectMap["type"] = agpr.Type 1599 } 1600 if agpr.ID != nil { 1601 objectMap["id"] = agpr.ID 1602 } 1603 return json.Marshal(objectMap) 1604} 1605 1606// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. 1607func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error { 1608 var m map[string]*json.RawMessage 1609 err := json.Unmarshal(body, &m) 1610 if err != nil { 1611 return err 1612 } 1613 for k, v := range m { 1614 switch k { 1615 case "properties": 1616 if v != nil { 1617 var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat 1618 err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat) 1619 if err != nil { 1620 return err 1621 } 1622 agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat 1623 } 1624 case "name": 1625 if v != nil { 1626 var name string 1627 err = json.Unmarshal(*v, &name) 1628 if err != nil { 1629 return err 1630 } 1631 agpr.Name = &name 1632 } 1633 case "etag": 1634 if v != nil { 1635 var etag string 1636 err = json.Unmarshal(*v, &etag) 1637 if err != nil { 1638 return err 1639 } 1640 agpr.Etag = &etag 1641 } 1642 case "type": 1643 if v != nil { 1644 var typeVar string 1645 err = json.Unmarshal(*v, &typeVar) 1646 if err != nil { 1647 return err 1648 } 1649 agpr.Type = &typeVar 1650 } 1651 case "id": 1652 if v != nil { 1653 var ID string 1654 err = json.Unmarshal(*v, &ID) 1655 if err != nil { 1656 return err 1657 } 1658 agpr.ID = &ID 1659 } 1660 } 1661 } 1662 1663 return nil 1664} 1665 1666// ApplicationGatewayPathRulePropertiesFormat properties of path rule of an application gateway. 1667type ApplicationGatewayPathRulePropertiesFormat struct { 1668 // Paths - Path rules of URL path map. 1669 Paths *[]string `json:"paths,omitempty"` 1670 // BackendAddressPool - Backend address pool resource of URL path map path rule. 1671 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 1672 // BackendHTTPSettings - Backend http settings resource of URL path map path rule. 1673 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 1674 // RedirectConfiguration - Redirect configuration resource of URL path map path rule. 1675 RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` 1676 // ProvisioningState - Path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1677 ProvisioningState *string `json:"provisioningState,omitempty"` 1678} 1679 1680// ApplicationGatewayProbe probe of the application gateway. 1681type ApplicationGatewayProbe struct { 1682 *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` 1683 // Name - Name of the probe that is unique within an Application Gateway. 1684 Name *string `json:"name,omitempty"` 1685 // Etag - A unique read-only string that changes whenever the resource is updated. 1686 Etag *string `json:"etag,omitempty"` 1687 // Type - Type of the resource. 1688 Type *string `json:"type,omitempty"` 1689 // ID - Resource ID. 1690 ID *string `json:"id,omitempty"` 1691} 1692 1693// MarshalJSON is the custom marshaler for ApplicationGatewayProbe. 1694func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { 1695 objectMap := make(map[string]interface{}) 1696 if agp.ApplicationGatewayProbePropertiesFormat != nil { 1697 objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat 1698 } 1699 if agp.Name != nil { 1700 objectMap["name"] = agp.Name 1701 } 1702 if agp.Etag != nil { 1703 objectMap["etag"] = agp.Etag 1704 } 1705 if agp.Type != nil { 1706 objectMap["type"] = agp.Type 1707 } 1708 if agp.ID != nil { 1709 objectMap["id"] = agp.ID 1710 } 1711 return json.Marshal(objectMap) 1712} 1713 1714// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. 1715func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error { 1716 var m map[string]*json.RawMessage 1717 err := json.Unmarshal(body, &m) 1718 if err != nil { 1719 return err 1720 } 1721 for k, v := range m { 1722 switch k { 1723 case "properties": 1724 if v != nil { 1725 var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat 1726 err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat) 1727 if err != nil { 1728 return err 1729 } 1730 agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat 1731 } 1732 case "name": 1733 if v != nil { 1734 var name string 1735 err = json.Unmarshal(*v, &name) 1736 if err != nil { 1737 return err 1738 } 1739 agp.Name = &name 1740 } 1741 case "etag": 1742 if v != nil { 1743 var etag string 1744 err = json.Unmarshal(*v, &etag) 1745 if err != nil { 1746 return err 1747 } 1748 agp.Etag = &etag 1749 } 1750 case "type": 1751 if v != nil { 1752 var typeVar string 1753 err = json.Unmarshal(*v, &typeVar) 1754 if err != nil { 1755 return err 1756 } 1757 agp.Type = &typeVar 1758 } 1759 case "id": 1760 if v != nil { 1761 var ID string 1762 err = json.Unmarshal(*v, &ID) 1763 if err != nil { 1764 return err 1765 } 1766 agp.ID = &ID 1767 } 1768 } 1769 } 1770 1771 return nil 1772} 1773 1774// ApplicationGatewayProbeHealthResponseMatch application gateway probe health response match 1775type ApplicationGatewayProbeHealthResponseMatch struct { 1776 // Body - Body that must be contained in the health response. Default value is empty. 1777 Body *string `json:"body,omitempty"` 1778 // StatusCodes - Allowed ranges of healthy status codes. Default range of healthy status codes is 200-399. 1779 StatusCodes *[]string `json:"statusCodes,omitempty"` 1780} 1781 1782// ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. 1783type ApplicationGatewayProbePropertiesFormat struct { 1784 // Protocol - The protocol used for the probe. Possible values are 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS' 1785 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 1786 // Host - Host name to send the probe to. 1787 Host *string `json:"host,omitempty"` 1788 // Path - Relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path> 1789 Path *string `json:"path,omitempty"` 1790 // Interval - The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. 1791 Interval *int32 `json:"interval,omitempty"` 1792 // Timeout - the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds. 1793 Timeout *int32 `json:"timeout,omitempty"` 1794 // UnhealthyThreshold - The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20. 1795 UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` 1796 // PickHostNameFromBackendHTTPSettings - Whether the host header should be picked from the backend http settings. Default value is false. 1797 PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` 1798 // MinServers - Minimum number of servers that are always marked healthy. Default value is 0. 1799 MinServers *int32 `json:"minServers,omitempty"` 1800 // Match - Criterion for classifying a healthy probe response. 1801 Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` 1802 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1803 ProvisioningState *string `json:"provisioningState,omitempty"` 1804} 1805 1806// ApplicationGatewayPropertiesFormat properties of the application gateway. 1807type ApplicationGatewayPropertiesFormat struct { 1808 // Sku - SKU of the application gateway resource. 1809 Sku *ApplicationGatewaySku `json:"sku,omitempty"` 1810 // SslPolicy - SSL policy of the application gateway resource. 1811 SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` 1812 // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' 1813 OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` 1814 // GatewayIPConfigurations - Subnets of application the gateway resource. 1815 GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` 1816 // AuthenticationCertificates - Authentication certificates of the application gateway resource. 1817 AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` 1818 // SslCertificates - SSL certificates of the application gateway resource. 1819 SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` 1820 // FrontendIPConfigurations - Frontend IP addresses of the application gateway resource. 1821 FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 1822 // FrontendPorts - Frontend ports of the application gateway resource. 1823 FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` 1824 // Probes - Probes of the application gateway resource. 1825 Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` 1826 // BackendAddressPools - Backend address pool of the application gateway resource. 1827 BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` 1828 // BackendHTTPSettingsCollection - Backend http settings of the application gateway resource. 1829 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` 1830 // HTTPListeners - Http listeners of the application gateway resource. 1831 HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` 1832 // URLPathMaps - URL path map of the application gateway resource. 1833 URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` 1834 // RequestRoutingRules - Request routing rules of the application gateway resource. 1835 RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` 1836 // RedirectConfigurations - Redirect configurations of the application gateway resource. 1837 RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` 1838 // WebApplicationFirewallConfiguration - Web application firewall configuration. 1839 WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` 1840 // EnableHTTP2 - Whether HTTP2 is enabled on the application gateway resource. 1841 EnableHTTP2 *bool `json:"enableHttp2,omitempty"` 1842 // EnableFips - Whether FIPS is enabled on the application gateway resource. 1843 EnableFips *bool `json:"enableFips,omitempty"` 1844 // AutoscaleConfiguration - Autoscale Configuration. 1845 AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` 1846 // ResourceGUID - Resource GUID property of the application gateway resource. 1847 ResourceGUID *string `json:"resourceGuid,omitempty"` 1848 // ProvisioningState - Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1849 ProvisioningState *string `json:"provisioningState,omitempty"` 1850} 1851 1852// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. 1853func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { 1854 objectMap := make(map[string]interface{}) 1855 if agpf.Sku != nil { 1856 objectMap["sku"] = agpf.Sku 1857 } 1858 if agpf.SslPolicy != nil { 1859 objectMap["sslPolicy"] = agpf.SslPolicy 1860 } 1861 if agpf.GatewayIPConfigurations != nil { 1862 objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations 1863 } 1864 if agpf.AuthenticationCertificates != nil { 1865 objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates 1866 } 1867 if agpf.SslCertificates != nil { 1868 objectMap["sslCertificates"] = agpf.SslCertificates 1869 } 1870 if agpf.FrontendIPConfigurations != nil { 1871 objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations 1872 } 1873 if agpf.FrontendPorts != nil { 1874 objectMap["frontendPorts"] = agpf.FrontendPorts 1875 } 1876 if agpf.Probes != nil { 1877 objectMap["probes"] = agpf.Probes 1878 } 1879 if agpf.BackendAddressPools != nil { 1880 objectMap["backendAddressPools"] = agpf.BackendAddressPools 1881 } 1882 if agpf.BackendHTTPSettingsCollection != nil { 1883 objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection 1884 } 1885 if agpf.HTTPListeners != nil { 1886 objectMap["httpListeners"] = agpf.HTTPListeners 1887 } 1888 if agpf.URLPathMaps != nil { 1889 objectMap["urlPathMaps"] = agpf.URLPathMaps 1890 } 1891 if agpf.RequestRoutingRules != nil { 1892 objectMap["requestRoutingRules"] = agpf.RequestRoutingRules 1893 } 1894 if agpf.RedirectConfigurations != nil { 1895 objectMap["redirectConfigurations"] = agpf.RedirectConfigurations 1896 } 1897 if agpf.WebApplicationFirewallConfiguration != nil { 1898 objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration 1899 } 1900 if agpf.EnableHTTP2 != nil { 1901 objectMap["enableHttp2"] = agpf.EnableHTTP2 1902 } 1903 if agpf.EnableFips != nil { 1904 objectMap["enableFips"] = agpf.EnableFips 1905 } 1906 if agpf.AutoscaleConfiguration != nil { 1907 objectMap["autoscaleConfiguration"] = agpf.AutoscaleConfiguration 1908 } 1909 if agpf.ResourceGUID != nil { 1910 objectMap["resourceGuid"] = agpf.ResourceGUID 1911 } 1912 if agpf.ProvisioningState != nil { 1913 objectMap["provisioningState"] = agpf.ProvisioningState 1914 } 1915 return json.Marshal(objectMap) 1916} 1917 1918// ApplicationGatewayRedirectConfiguration redirect configuration of an application gateway. 1919type ApplicationGatewayRedirectConfiguration struct { 1920 *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` 1921 // Name - Name of the redirect configuration that is unique within an Application Gateway. 1922 Name *string `json:"name,omitempty"` 1923 // Etag - A unique read-only string that changes whenever the resource is updated. 1924 Etag *string `json:"etag,omitempty"` 1925 // Type - Type of the resource. 1926 Type *string `json:"type,omitempty"` 1927 // ID - Resource ID. 1928 ID *string `json:"id,omitempty"` 1929} 1930 1931// MarshalJSON is the custom marshaler for ApplicationGatewayRedirectConfiguration. 1932func (agrc ApplicationGatewayRedirectConfiguration) MarshalJSON() ([]byte, error) { 1933 objectMap := make(map[string]interface{}) 1934 if agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat != nil { 1935 objectMap["properties"] = agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat 1936 } 1937 if agrc.Name != nil { 1938 objectMap["name"] = agrc.Name 1939 } 1940 if agrc.Etag != nil { 1941 objectMap["etag"] = agrc.Etag 1942 } 1943 if agrc.Type != nil { 1944 objectMap["type"] = agrc.Type 1945 } 1946 if agrc.ID != nil { 1947 objectMap["id"] = agrc.ID 1948 } 1949 return json.Marshal(objectMap) 1950} 1951 1952// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRedirectConfiguration struct. 1953func (agrc *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(body []byte) error { 1954 var m map[string]*json.RawMessage 1955 err := json.Unmarshal(body, &m) 1956 if err != nil { 1957 return err 1958 } 1959 for k, v := range m { 1960 switch k { 1961 case "properties": 1962 if v != nil { 1963 var applicationGatewayRedirectConfigurationPropertiesFormat ApplicationGatewayRedirectConfigurationPropertiesFormat 1964 err = json.Unmarshal(*v, &applicationGatewayRedirectConfigurationPropertiesFormat) 1965 if err != nil { 1966 return err 1967 } 1968 agrc.ApplicationGatewayRedirectConfigurationPropertiesFormat = &applicationGatewayRedirectConfigurationPropertiesFormat 1969 } 1970 case "name": 1971 if v != nil { 1972 var name string 1973 err = json.Unmarshal(*v, &name) 1974 if err != nil { 1975 return err 1976 } 1977 agrc.Name = &name 1978 } 1979 case "etag": 1980 if v != nil { 1981 var etag string 1982 err = json.Unmarshal(*v, &etag) 1983 if err != nil { 1984 return err 1985 } 1986 agrc.Etag = &etag 1987 } 1988 case "type": 1989 if v != nil { 1990 var typeVar string 1991 err = json.Unmarshal(*v, &typeVar) 1992 if err != nil { 1993 return err 1994 } 1995 agrc.Type = &typeVar 1996 } 1997 case "id": 1998 if v != nil { 1999 var ID string 2000 err = json.Unmarshal(*v, &ID) 2001 if err != nil { 2002 return err 2003 } 2004 agrc.ID = &ID 2005 } 2006 } 2007 } 2008 2009 return nil 2010} 2011 2012// ApplicationGatewayRedirectConfigurationPropertiesFormat properties of redirect configuration of the 2013// application gateway. 2014type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { 2015 // RedirectType - Supported http redirection types - Permanent, Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' 2016 RedirectType ApplicationGatewayRedirectType `json:"redirectType,omitempty"` 2017 // TargetListener - Reference to a listener to redirect the request to. 2018 TargetListener *SubResource `json:"targetListener,omitempty"` 2019 // TargetURL - Url to redirect the request to. 2020 TargetURL *string `json:"targetUrl,omitempty"` 2021 // IncludePath - Include path in the redirected url. 2022 IncludePath *bool `json:"includePath,omitempty"` 2023 // IncludeQueryString - Include query string in the redirected url. 2024 IncludeQueryString *bool `json:"includeQueryString,omitempty"` 2025 // RequestRoutingRules - Request routing specifying redirect configuration. 2026 RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` 2027 // URLPathMaps - Url path maps specifying default redirect configuration. 2028 URLPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` 2029 // PathRules - Path rules specifying redirect configuration. 2030 PathRules *[]SubResource `json:"pathRules,omitempty"` 2031} 2032 2033// ApplicationGatewayRequestRoutingRule request routing rule of an application gateway. 2034type ApplicationGatewayRequestRoutingRule struct { 2035 *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` 2036 // Name - Name of the request routing rule that is unique within an Application Gateway. 2037 Name *string `json:"name,omitempty"` 2038 // Etag - A unique read-only string that changes whenever the resource is updated. 2039 Etag *string `json:"etag,omitempty"` 2040 // Type - Type of the resource. 2041 Type *string `json:"type,omitempty"` 2042 // ID - Resource ID. 2043 ID *string `json:"id,omitempty"` 2044} 2045 2046// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule. 2047func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { 2048 objectMap := make(map[string]interface{}) 2049 if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil { 2050 objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat 2051 } 2052 if agrrr.Name != nil { 2053 objectMap["name"] = agrrr.Name 2054 } 2055 if agrrr.Etag != nil { 2056 objectMap["etag"] = agrrr.Etag 2057 } 2058 if agrrr.Type != nil { 2059 objectMap["type"] = agrrr.Type 2060 } 2061 if agrrr.ID != nil { 2062 objectMap["id"] = agrrr.ID 2063 } 2064 return json.Marshal(objectMap) 2065} 2066 2067// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. 2068func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error { 2069 var m map[string]*json.RawMessage 2070 err := json.Unmarshal(body, &m) 2071 if err != nil { 2072 return err 2073 } 2074 for k, v := range m { 2075 switch k { 2076 case "properties": 2077 if v != nil { 2078 var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat 2079 err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat) 2080 if err != nil { 2081 return err 2082 } 2083 agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat 2084 } 2085 case "name": 2086 if v != nil { 2087 var name string 2088 err = json.Unmarshal(*v, &name) 2089 if err != nil { 2090 return err 2091 } 2092 agrrr.Name = &name 2093 } 2094 case "etag": 2095 if v != nil { 2096 var etag string 2097 err = json.Unmarshal(*v, &etag) 2098 if err != nil { 2099 return err 2100 } 2101 agrrr.Etag = &etag 2102 } 2103 case "type": 2104 if v != nil { 2105 var typeVar string 2106 err = json.Unmarshal(*v, &typeVar) 2107 if err != nil { 2108 return err 2109 } 2110 agrrr.Type = &typeVar 2111 } 2112 case "id": 2113 if v != nil { 2114 var ID string 2115 err = json.Unmarshal(*v, &ID) 2116 if err != nil { 2117 return err 2118 } 2119 agrrr.ID = &ID 2120 } 2121 } 2122 } 2123 2124 return nil 2125} 2126 2127// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the 2128// application gateway. 2129type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { 2130 // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' 2131 RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` 2132 // BackendAddressPool - Backend address pool resource of the application gateway. 2133 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 2134 // BackendHTTPSettings - Backend http settings resource of the application gateway. 2135 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 2136 // HTTPListener - Http listener resource of the application gateway. 2137 HTTPListener *SubResource `json:"httpListener,omitempty"` 2138 // URLPathMap - URL path map resource of the application gateway. 2139 URLPathMap *SubResource `json:"urlPathMap,omitempty"` 2140 // RedirectConfiguration - Redirect configuration resource of the application gateway. 2141 RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` 2142 // ProvisioningState - Provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2143 ProvisioningState *string `json:"provisioningState,omitempty"` 2144} 2145 2146// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a 2147// long-running operation. 2148type ApplicationGatewaysBackendHealthFuture struct { 2149 azure.FutureAPI 2150 // Result returns the result of the asynchronous operation. 2151 // If the operation has not completed it will return an error. 2152 Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealth, error) 2153} 2154 2155// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2156func (future *ApplicationGatewaysBackendHealthFuture) UnmarshalJSON(body []byte) error { 2157 var azFuture azure.Future 2158 if err := json.Unmarshal(body, &azFuture); err != nil { 2159 return err 2160 } 2161 future.FutureAPI = &azFuture 2162 future.Result = future.result 2163 return nil 2164} 2165 2166// result is the default implementation for ApplicationGatewaysBackendHealthFuture.Result. 2167func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) { 2168 var done bool 2169 done, err = future.DoneWithContext(context.Background(), client) 2170 if err != nil { 2171 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure") 2172 return 2173 } 2174 if !done { 2175 agbh.Response.Response = future.Response() 2176 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture") 2177 return 2178 } 2179 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2180 if agbh.Response.Response, err = future.GetResult(sender); err == nil && agbh.Response.Response.StatusCode != http.StatusNoContent { 2181 agbh, err = client.BackendHealthResponder(agbh.Response.Response) 2182 if err != nil { 2183 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", agbh.Response.Response, "Failure responding to request") 2184 } 2185 } 2186 return 2187} 2188 2189// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2190// long-running operation. 2191type ApplicationGatewaysCreateOrUpdateFuture struct { 2192 azure.FutureAPI 2193 // Result returns the result of the asynchronous operation. 2194 // If the operation has not completed it will return an error. 2195 Result func(ApplicationGatewaysClient) (ApplicationGateway, error) 2196} 2197 2198// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2199func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2200 var azFuture azure.Future 2201 if err := json.Unmarshal(body, &azFuture); err != nil { 2202 return err 2203 } 2204 future.FutureAPI = &azFuture 2205 future.Result = future.result 2206 return nil 2207} 2208 2209// result is the default implementation for ApplicationGatewaysCreateOrUpdateFuture.Result. 2210func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { 2211 var done bool 2212 done, err = future.DoneWithContext(context.Background(), client) 2213 if err != nil { 2214 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2215 return 2216 } 2217 if !done { 2218 ag.Response.Response = future.Response() 2219 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") 2220 return 2221 } 2222 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2223 if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent { 2224 ag, err = client.CreateOrUpdateResponder(ag.Response.Response) 2225 if err != nil { 2226 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", ag.Response.Response, "Failure responding to request") 2227 } 2228 } 2229 return 2230} 2231 2232// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 2233// long-running operation. 2234type ApplicationGatewaysDeleteFuture struct { 2235 azure.FutureAPI 2236 // Result returns the result of the asynchronous operation. 2237 // If the operation has not completed it will return an error. 2238 Result func(ApplicationGatewaysClient) (autorest.Response, error) 2239} 2240 2241// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2242func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 2243 var azFuture azure.Future 2244 if err := json.Unmarshal(body, &azFuture); err != nil { 2245 return err 2246 } 2247 future.FutureAPI = &azFuture 2248 future.Result = future.result 2249 return nil 2250} 2251 2252// result is the default implementation for ApplicationGatewaysDeleteFuture.Result. 2253func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 2254 var done bool 2255 done, err = future.DoneWithContext(context.Background(), client) 2256 if err != nil { 2257 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 2258 return 2259 } 2260 if !done { 2261 ar.Response = future.Response() 2262 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") 2263 return 2264 } 2265 ar.Response = future.Response() 2266 return 2267} 2268 2269// ApplicationGatewaySku SKU of an application gateway 2270type ApplicationGatewaySku struct { 2271 // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge', 'StandardV2', 'WAFV2' 2272 Name ApplicationGatewaySkuName `json:"name,omitempty"` 2273 // Tier - Tier of an application gateway. Possible values include: 'ApplicationGatewayTierStandard', 'ApplicationGatewayTierWAF', 'ApplicationGatewayTierStandardV2', 'ApplicationGatewayTierWAFV2' 2274 Tier ApplicationGatewayTier `json:"tier,omitempty"` 2275 // Capacity - Capacity (instance count) of an application gateway. 2276 Capacity *int32 `json:"capacity,omitempty"` 2277} 2278 2279// ApplicationGatewaySslCertificate SSL certificates of an application gateway. 2280type ApplicationGatewaySslCertificate struct { 2281 *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` 2282 // Name - Name of the SSL certificate that is unique within an Application Gateway. 2283 Name *string `json:"name,omitempty"` 2284 // Etag - A unique read-only string that changes whenever the resource is updated. 2285 Etag *string `json:"etag,omitempty"` 2286 // Type - Type of the resource. 2287 Type *string `json:"type,omitempty"` 2288 // ID - Resource ID. 2289 ID *string `json:"id,omitempty"` 2290} 2291 2292// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate. 2293func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) { 2294 objectMap := make(map[string]interface{}) 2295 if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil { 2296 objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat 2297 } 2298 if agsc.Name != nil { 2299 objectMap["name"] = agsc.Name 2300 } 2301 if agsc.Etag != nil { 2302 objectMap["etag"] = agsc.Etag 2303 } 2304 if agsc.Type != nil { 2305 objectMap["type"] = agsc.Type 2306 } 2307 if agsc.ID != nil { 2308 objectMap["id"] = agsc.ID 2309 } 2310 return json.Marshal(objectMap) 2311} 2312 2313// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. 2314func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { 2315 var m map[string]*json.RawMessage 2316 err := json.Unmarshal(body, &m) 2317 if err != nil { 2318 return err 2319 } 2320 for k, v := range m { 2321 switch k { 2322 case "properties": 2323 if v != nil { 2324 var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat 2325 err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat) 2326 if err != nil { 2327 return err 2328 } 2329 agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat 2330 } 2331 case "name": 2332 if v != nil { 2333 var name string 2334 err = json.Unmarshal(*v, &name) 2335 if err != nil { 2336 return err 2337 } 2338 agsc.Name = &name 2339 } 2340 case "etag": 2341 if v != nil { 2342 var etag string 2343 err = json.Unmarshal(*v, &etag) 2344 if err != nil { 2345 return err 2346 } 2347 agsc.Etag = &etag 2348 } 2349 case "type": 2350 if v != nil { 2351 var typeVar string 2352 err = json.Unmarshal(*v, &typeVar) 2353 if err != nil { 2354 return err 2355 } 2356 agsc.Type = &typeVar 2357 } 2358 case "id": 2359 if v != nil { 2360 var ID string 2361 err = json.Unmarshal(*v, &ID) 2362 if err != nil { 2363 return err 2364 } 2365 agsc.ID = &ID 2366 } 2367 } 2368 } 2369 2370 return nil 2371} 2372 2373// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application 2374// gateway. 2375type ApplicationGatewaySslCertificatePropertiesFormat struct { 2376 // Data - Base-64 encoded pfx certificate. Only applicable in PUT Request. 2377 Data *string `json:"data,omitempty"` 2378 // Password - Password for the pfx file specified in data. Only applicable in PUT request. 2379 Password *string `json:"password,omitempty"` 2380 // PublicCertData - Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. 2381 PublicCertData *string `json:"publicCertData,omitempty"` 2382 // ProvisioningState - Provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. 2383 ProvisioningState *string `json:"provisioningState,omitempty"` 2384} 2385 2386// ApplicationGatewaySslPolicy application Gateway Ssl policy. 2387type ApplicationGatewaySslPolicy struct { 2388 // DisabledSslProtocols - Ssl protocols to be disabled on application gateway. 2389 DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` 2390 // PolicyType - Type of Ssl Policy. Possible values include: 'Predefined', 'Custom' 2391 PolicyType ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` 2392 // PolicyName - Name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S' 2393 PolicyName ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` 2394 // CipherSuites - Ssl cipher suites to be enabled in the specified order to application gateway. 2395 CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` 2396 // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12' 2397 MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` 2398} 2399 2400// ApplicationGatewaySslPredefinedPolicy an Ssl predefined policy 2401type ApplicationGatewaySslPredefinedPolicy struct { 2402 autorest.Response `json:"-"` 2403 // Name - Name of the Ssl predefined policy. 2404 Name *string `json:"name,omitempty"` 2405 *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` 2406 // ID - Resource ID. 2407 ID *string `json:"id,omitempty"` 2408} 2409 2410// MarshalJSON is the custom marshaler for ApplicationGatewaySslPredefinedPolicy. 2411func (agspp ApplicationGatewaySslPredefinedPolicy) MarshalJSON() ([]byte, error) { 2412 objectMap := make(map[string]interface{}) 2413 if agspp.Name != nil { 2414 objectMap["name"] = agspp.Name 2415 } 2416 if agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat != nil { 2417 objectMap["properties"] = agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat 2418 } 2419 if agspp.ID != nil { 2420 objectMap["id"] = agspp.ID 2421 } 2422 return json.Marshal(objectMap) 2423} 2424 2425// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslPredefinedPolicy struct. 2426func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) error { 2427 var m map[string]*json.RawMessage 2428 err := json.Unmarshal(body, &m) 2429 if err != nil { 2430 return err 2431 } 2432 for k, v := range m { 2433 switch k { 2434 case "name": 2435 if v != nil { 2436 var name string 2437 err = json.Unmarshal(*v, &name) 2438 if err != nil { 2439 return err 2440 } 2441 agspp.Name = &name 2442 } 2443 case "properties": 2444 if v != nil { 2445 var applicationGatewaySslPredefinedPolicyPropertiesFormat ApplicationGatewaySslPredefinedPolicyPropertiesFormat 2446 err = json.Unmarshal(*v, &applicationGatewaySslPredefinedPolicyPropertiesFormat) 2447 if err != nil { 2448 return err 2449 } 2450 agspp.ApplicationGatewaySslPredefinedPolicyPropertiesFormat = &applicationGatewaySslPredefinedPolicyPropertiesFormat 2451 } 2452 case "id": 2453 if v != nil { 2454 var ID string 2455 err = json.Unmarshal(*v, &ID) 2456 if err != nil { 2457 return err 2458 } 2459 agspp.ID = &ID 2460 } 2461 } 2462 } 2463 2464 return nil 2465} 2466 2467// ApplicationGatewaySslPredefinedPolicyPropertiesFormat properties of 2468// ApplicationGatewaySslPredefinedPolicy 2469type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { 2470 // CipherSuites - Ssl cipher suites to be enabled in the specified order for application gateway. 2471 CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` 2472 // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12' 2473 MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` 2474} 2475 2476// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a 2477// long-running operation. 2478type ApplicationGatewaysStartFuture struct { 2479 azure.FutureAPI 2480 // Result returns the result of the asynchronous operation. 2481 // If the operation has not completed it will return an error. 2482 Result func(ApplicationGatewaysClient) (autorest.Response, error) 2483} 2484 2485// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2486func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error { 2487 var azFuture azure.Future 2488 if err := json.Unmarshal(body, &azFuture); err != nil { 2489 return err 2490 } 2491 future.FutureAPI = &azFuture 2492 future.Result = future.result 2493 return nil 2494} 2495 2496// result is the default implementation for ApplicationGatewaysStartFuture.Result. 2497func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 2498 var done bool 2499 done, err = future.DoneWithContext(context.Background(), client) 2500 if err != nil { 2501 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure") 2502 return 2503 } 2504 if !done { 2505 ar.Response = future.Response() 2506 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") 2507 return 2508 } 2509 ar.Response = future.Response() 2510 return 2511} 2512 2513// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running 2514// operation. 2515type ApplicationGatewaysStopFuture struct { 2516 azure.FutureAPI 2517 // Result returns the result of the asynchronous operation. 2518 // If the operation has not completed it will return an error. 2519 Result func(ApplicationGatewaysClient) (autorest.Response, error) 2520} 2521 2522// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2523func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error { 2524 var azFuture azure.Future 2525 if err := json.Unmarshal(body, &azFuture); err != nil { 2526 return err 2527 } 2528 future.FutureAPI = &azFuture 2529 future.Result = future.result 2530 return nil 2531} 2532 2533// result is the default implementation for ApplicationGatewaysStopFuture.Result. 2534func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 2535 var done bool 2536 done, err = future.DoneWithContext(context.Background(), client) 2537 if err != nil { 2538 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure") 2539 return 2540 } 2541 if !done { 2542 ar.Response = future.Response() 2543 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") 2544 return 2545 } 2546 ar.Response = future.Response() 2547 return 2548} 2549 2550// ApplicationGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 2551// long-running operation. 2552type ApplicationGatewaysUpdateTagsFuture struct { 2553 azure.FutureAPI 2554 // Result returns the result of the asynchronous operation. 2555 // If the operation has not completed it will return an error. 2556 Result func(ApplicationGatewaysClient) (ApplicationGateway, error) 2557} 2558 2559// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2560func (future *ApplicationGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { 2561 var azFuture azure.Future 2562 if err := json.Unmarshal(body, &azFuture); err != nil { 2563 return err 2564 } 2565 future.FutureAPI = &azFuture 2566 future.Result = future.result 2567 return nil 2568} 2569 2570// result is the default implementation for ApplicationGatewaysUpdateTagsFuture.Result. 2571func (future *ApplicationGatewaysUpdateTagsFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { 2572 var done bool 2573 done, err = future.DoneWithContext(context.Background(), client) 2574 if err != nil { 2575 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") 2576 return 2577 } 2578 if !done { 2579 ag.Response.Response = future.Response() 2580 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysUpdateTagsFuture") 2581 return 2582 } 2583 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2584 if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent { 2585 ag, err = client.UpdateTagsResponder(ag.Response.Response) 2586 if err != nil { 2587 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysUpdateTagsFuture", "Result", ag.Response.Response, "Failure responding to request") 2588 } 2589 } 2590 return 2591} 2592 2593// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for 2594// PathBasedRouting. 2595type ApplicationGatewayURLPathMap struct { 2596 *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` 2597 // Name - Name of the URL path map that is unique within an Application Gateway. 2598 Name *string `json:"name,omitempty"` 2599 // Etag - A unique read-only string that changes whenever the resource is updated. 2600 Etag *string `json:"etag,omitempty"` 2601 // Type - Type of the resource. 2602 Type *string `json:"type,omitempty"` 2603 // ID - Resource ID. 2604 ID *string `json:"id,omitempty"` 2605} 2606 2607// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap. 2608func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { 2609 objectMap := make(map[string]interface{}) 2610 if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil { 2611 objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat 2612 } 2613 if agupm.Name != nil { 2614 objectMap["name"] = agupm.Name 2615 } 2616 if agupm.Etag != nil { 2617 objectMap["etag"] = agupm.Etag 2618 } 2619 if agupm.Type != nil { 2620 objectMap["type"] = agupm.Type 2621 } 2622 if agupm.ID != nil { 2623 objectMap["id"] = agupm.ID 2624 } 2625 return json.Marshal(objectMap) 2626} 2627 2628// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. 2629func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error { 2630 var m map[string]*json.RawMessage 2631 err := json.Unmarshal(body, &m) 2632 if err != nil { 2633 return err 2634 } 2635 for k, v := range m { 2636 switch k { 2637 case "properties": 2638 if v != nil { 2639 var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat 2640 err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat) 2641 if err != nil { 2642 return err 2643 } 2644 agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat 2645 } 2646 case "name": 2647 if v != nil { 2648 var name string 2649 err = json.Unmarshal(*v, &name) 2650 if err != nil { 2651 return err 2652 } 2653 agupm.Name = &name 2654 } 2655 case "etag": 2656 if v != nil { 2657 var etag string 2658 err = json.Unmarshal(*v, &etag) 2659 if err != nil { 2660 return err 2661 } 2662 agupm.Etag = &etag 2663 } 2664 case "type": 2665 if v != nil { 2666 var typeVar string 2667 err = json.Unmarshal(*v, &typeVar) 2668 if err != nil { 2669 return err 2670 } 2671 agupm.Type = &typeVar 2672 } 2673 case "id": 2674 if v != nil { 2675 var ID string 2676 err = json.Unmarshal(*v, &ID) 2677 if err != nil { 2678 return err 2679 } 2680 agupm.ID = &ID 2681 } 2682 } 2683 } 2684 2685 return nil 2686} 2687 2688// ApplicationGatewayURLPathMapPropertiesFormat properties of UrlPathMap of the application gateway. 2689type ApplicationGatewayURLPathMapPropertiesFormat struct { 2690 // DefaultBackendAddressPool - Default backend address pool resource of URL path map. 2691 DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` 2692 // DefaultBackendHTTPSettings - Default backend http settings resource of URL path map. 2693 DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` 2694 // DefaultRedirectConfiguration - Default redirect configuration resource of URL path map. 2695 DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` 2696 // PathRules - Path rule of URL path map resource. 2697 PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` 2698 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2699 ProvisioningState *string `json:"provisioningState,omitempty"` 2700} 2701 2702// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall 2703// configuration. 2704type ApplicationGatewayWebApplicationFirewallConfiguration struct { 2705 // Enabled - Whether the web application firewall is enabled or not. 2706 Enabled *bool `json:"enabled,omitempty"` 2707 // FirewallMode - Web application firewall mode. Possible values include: 'Detection', 'Prevention' 2708 FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` 2709 // RuleSetType - The type of the web application firewall rule set. Possible values are: 'OWASP'. 2710 RuleSetType *string `json:"ruleSetType,omitempty"` 2711 // RuleSetVersion - The version of the rule set type. 2712 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 2713 // DisabledRuleGroups - The disabled rule groups. 2714 DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` 2715 // RequestBodyCheck - Whether allow WAF to check request Body. 2716 RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` 2717 // MaxRequestBodySize - Maximum request body size for WAF. 2718 MaxRequestBodySize *int32 `json:"maxRequestBodySize,omitempty"` 2719} 2720 2721// ApplicationSecurityGroup an application security group in a resource group. 2722type ApplicationSecurityGroup struct { 2723 autorest.Response `json:"-"` 2724 // ApplicationSecurityGroupPropertiesFormat - Properties of the application security group. 2725 *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` 2726 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 2727 Etag *string `json:"etag,omitempty"` 2728 // ID - Resource ID. 2729 ID *string `json:"id,omitempty"` 2730 // Name - READ-ONLY; Resource name. 2731 Name *string `json:"name,omitempty"` 2732 // Type - READ-ONLY; Resource type. 2733 Type *string `json:"type,omitempty"` 2734 // Location - Resource location. 2735 Location *string `json:"location,omitempty"` 2736 // Tags - Resource tags. 2737 Tags map[string]*string `json:"tags"` 2738} 2739 2740// MarshalJSON is the custom marshaler for ApplicationSecurityGroup. 2741func (asg ApplicationSecurityGroup) MarshalJSON() ([]byte, error) { 2742 objectMap := make(map[string]interface{}) 2743 if asg.ApplicationSecurityGroupPropertiesFormat != nil { 2744 objectMap["properties"] = asg.ApplicationSecurityGroupPropertiesFormat 2745 } 2746 if asg.ID != nil { 2747 objectMap["id"] = asg.ID 2748 } 2749 if asg.Location != nil { 2750 objectMap["location"] = asg.Location 2751 } 2752 if asg.Tags != nil { 2753 objectMap["tags"] = asg.Tags 2754 } 2755 return json.Marshal(objectMap) 2756} 2757 2758// UnmarshalJSON is the custom unmarshaler for ApplicationSecurityGroup struct. 2759func (asg *ApplicationSecurityGroup) UnmarshalJSON(body []byte) error { 2760 var m map[string]*json.RawMessage 2761 err := json.Unmarshal(body, &m) 2762 if err != nil { 2763 return err 2764 } 2765 for k, v := range m { 2766 switch k { 2767 case "properties": 2768 if v != nil { 2769 var applicationSecurityGroupPropertiesFormat ApplicationSecurityGroupPropertiesFormat 2770 err = json.Unmarshal(*v, &applicationSecurityGroupPropertiesFormat) 2771 if err != nil { 2772 return err 2773 } 2774 asg.ApplicationSecurityGroupPropertiesFormat = &applicationSecurityGroupPropertiesFormat 2775 } 2776 case "etag": 2777 if v != nil { 2778 var etag string 2779 err = json.Unmarshal(*v, &etag) 2780 if err != nil { 2781 return err 2782 } 2783 asg.Etag = &etag 2784 } 2785 case "id": 2786 if v != nil { 2787 var ID string 2788 err = json.Unmarshal(*v, &ID) 2789 if err != nil { 2790 return err 2791 } 2792 asg.ID = &ID 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 asg.Name = &name 2802 } 2803 case "type": 2804 if v != nil { 2805 var typeVar string 2806 err = json.Unmarshal(*v, &typeVar) 2807 if err != nil { 2808 return err 2809 } 2810 asg.Type = &typeVar 2811 } 2812 case "location": 2813 if v != nil { 2814 var location string 2815 err = json.Unmarshal(*v, &location) 2816 if err != nil { 2817 return err 2818 } 2819 asg.Location = &location 2820 } 2821 case "tags": 2822 if v != nil { 2823 var tags map[string]*string 2824 err = json.Unmarshal(*v, &tags) 2825 if err != nil { 2826 return err 2827 } 2828 asg.Tags = tags 2829 } 2830 } 2831 } 2832 2833 return nil 2834} 2835 2836// ApplicationSecurityGroupListResult a list of application security groups. 2837type ApplicationSecurityGroupListResult struct { 2838 autorest.Response `json:"-"` 2839 // Value - A list of application security groups. 2840 Value *[]ApplicationSecurityGroup `json:"value,omitempty"` 2841 // NextLink - READ-ONLY; The URL to get the next set of results. 2842 NextLink *string `json:"nextLink,omitempty"` 2843} 2844 2845// MarshalJSON is the custom marshaler for ApplicationSecurityGroupListResult. 2846func (asglr ApplicationSecurityGroupListResult) MarshalJSON() ([]byte, error) { 2847 objectMap := make(map[string]interface{}) 2848 if asglr.Value != nil { 2849 objectMap["value"] = asglr.Value 2850 } 2851 return json.Marshal(objectMap) 2852} 2853 2854// ApplicationSecurityGroupListResultIterator provides access to a complete listing of 2855// ApplicationSecurityGroup values. 2856type ApplicationSecurityGroupListResultIterator struct { 2857 i int 2858 page ApplicationSecurityGroupListResultPage 2859} 2860 2861// NextWithContext advances to the next value. If there was an error making 2862// the request the iterator does not advance and the error is returned. 2863func (iter *ApplicationSecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 2864 if tracing.IsEnabled() { 2865 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultIterator.NextWithContext") 2866 defer func() { 2867 sc := -1 2868 if iter.Response().Response.Response != nil { 2869 sc = iter.Response().Response.Response.StatusCode 2870 } 2871 tracing.EndSpan(ctx, sc, err) 2872 }() 2873 } 2874 iter.i++ 2875 if iter.i < len(iter.page.Values()) { 2876 return nil 2877 } 2878 err = iter.page.NextWithContext(ctx) 2879 if err != nil { 2880 iter.i-- 2881 return err 2882 } 2883 iter.i = 0 2884 return nil 2885} 2886 2887// Next advances to the next value. If there was an error making 2888// the request the iterator does not advance and the error is returned. 2889// Deprecated: Use NextWithContext() instead. 2890func (iter *ApplicationSecurityGroupListResultIterator) Next() error { 2891 return iter.NextWithContext(context.Background()) 2892} 2893 2894// NotDone returns true if the enumeration should be started or is not yet complete. 2895func (iter ApplicationSecurityGroupListResultIterator) NotDone() bool { 2896 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2897} 2898 2899// Response returns the raw server response from the last page request. 2900func (iter ApplicationSecurityGroupListResultIterator) Response() ApplicationSecurityGroupListResult { 2901 return iter.page.Response() 2902} 2903 2904// Value returns the current value or a zero-initialized value if the 2905// iterator has advanced beyond the end of the collection. 2906func (iter ApplicationSecurityGroupListResultIterator) Value() ApplicationSecurityGroup { 2907 if !iter.page.NotDone() { 2908 return ApplicationSecurityGroup{} 2909 } 2910 return iter.page.Values()[iter.i] 2911} 2912 2913// Creates a new instance of the ApplicationSecurityGroupListResultIterator type. 2914func NewApplicationSecurityGroupListResultIterator(page ApplicationSecurityGroupListResultPage) ApplicationSecurityGroupListResultIterator { 2915 return ApplicationSecurityGroupListResultIterator{page: page} 2916} 2917 2918// IsEmpty returns true if the ListResult contains no values. 2919func (asglr ApplicationSecurityGroupListResult) IsEmpty() bool { 2920 return asglr.Value == nil || len(*asglr.Value) == 0 2921} 2922 2923// hasNextLink returns true if the NextLink is not empty. 2924func (asglr ApplicationSecurityGroupListResult) hasNextLink() bool { 2925 return asglr.NextLink != nil && len(*asglr.NextLink) != 0 2926} 2927 2928// applicationSecurityGroupListResultPreparer prepares a request to retrieve the next set of results. 2929// It returns nil if no more results exist. 2930func (asglr ApplicationSecurityGroupListResult) applicationSecurityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 2931 if !asglr.hasNextLink() { 2932 return nil, nil 2933 } 2934 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2935 autorest.AsJSON(), 2936 autorest.AsGet(), 2937 autorest.WithBaseURL(to.String(asglr.NextLink))) 2938} 2939 2940// ApplicationSecurityGroupListResultPage contains a page of ApplicationSecurityGroup values. 2941type ApplicationSecurityGroupListResultPage struct { 2942 fn func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error) 2943 asglr ApplicationSecurityGroupListResult 2944} 2945 2946// NextWithContext advances to the next page of values. If there was an error making 2947// the request the page does not advance and the error is returned. 2948func (page *ApplicationSecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 2949 if tracing.IsEnabled() { 2950 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationSecurityGroupListResultPage.NextWithContext") 2951 defer func() { 2952 sc := -1 2953 if page.Response().Response.Response != nil { 2954 sc = page.Response().Response.Response.StatusCode 2955 } 2956 tracing.EndSpan(ctx, sc, err) 2957 }() 2958 } 2959 for { 2960 next, err := page.fn(ctx, page.asglr) 2961 if err != nil { 2962 return err 2963 } 2964 page.asglr = next 2965 if !next.hasNextLink() || !next.IsEmpty() { 2966 break 2967 } 2968 } 2969 return nil 2970} 2971 2972// Next advances to the next page of values. If there was an error making 2973// the request the page does not advance and the error is returned. 2974// Deprecated: Use NextWithContext() instead. 2975func (page *ApplicationSecurityGroupListResultPage) Next() error { 2976 return page.NextWithContext(context.Background()) 2977} 2978 2979// NotDone returns true if the page enumeration should be started or is not yet complete. 2980func (page ApplicationSecurityGroupListResultPage) NotDone() bool { 2981 return !page.asglr.IsEmpty() 2982} 2983 2984// Response returns the raw server response from the last page request. 2985func (page ApplicationSecurityGroupListResultPage) Response() ApplicationSecurityGroupListResult { 2986 return page.asglr 2987} 2988 2989// Values returns the slice of values for the current page or nil if there are no values. 2990func (page ApplicationSecurityGroupListResultPage) Values() []ApplicationSecurityGroup { 2991 if page.asglr.IsEmpty() { 2992 return nil 2993 } 2994 return *page.asglr.Value 2995} 2996 2997// Creates a new instance of the ApplicationSecurityGroupListResultPage type. 2998func NewApplicationSecurityGroupListResultPage(cur ApplicationSecurityGroupListResult, getNextPage func(context.Context, ApplicationSecurityGroupListResult) (ApplicationSecurityGroupListResult, error)) ApplicationSecurityGroupListResultPage { 2999 return ApplicationSecurityGroupListResultPage{ 3000 fn: getNextPage, 3001 asglr: cur, 3002 } 3003} 3004 3005// ApplicationSecurityGroupPropertiesFormat application security group properties. 3006type ApplicationSecurityGroupPropertiesFormat struct { 3007 // ResourceGUID - READ-ONLY; The resource GUID property of the application security group resource. It uniquely identifies a resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. 3008 ResourceGUID *string `json:"resourceGuid,omitempty"` 3009 // ProvisioningState - READ-ONLY; The provisioning state of the application security group resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. 3010 ProvisioningState *string `json:"provisioningState,omitempty"` 3011} 3012 3013// MarshalJSON is the custom marshaler for ApplicationSecurityGroupPropertiesFormat. 3014func (asgpf ApplicationSecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { 3015 objectMap := make(map[string]interface{}) 3016 return json.Marshal(objectMap) 3017} 3018 3019// ApplicationSecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 3020// of a long-running operation. 3021type ApplicationSecurityGroupsCreateOrUpdateFuture struct { 3022 azure.FutureAPI 3023 // Result returns the result of the asynchronous operation. 3024 // If the operation has not completed it will return an error. 3025 Result func(ApplicationSecurityGroupsClient) (ApplicationSecurityGroup, error) 3026} 3027 3028// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3029func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3030 var azFuture azure.Future 3031 if err := json.Unmarshal(body, &azFuture); err != nil { 3032 return err 3033 } 3034 future.FutureAPI = &azFuture 3035 future.Result = future.result 3036 return nil 3037} 3038 3039// result is the default implementation for ApplicationSecurityGroupsCreateOrUpdateFuture.Result. 3040func (future *ApplicationSecurityGroupsCreateOrUpdateFuture) result(client ApplicationSecurityGroupsClient) (asg ApplicationSecurityGroup, err error) { 3041 var done bool 3042 done, err = future.DoneWithContext(context.Background(), client) 3043 if err != nil { 3044 err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3045 return 3046 } 3047 if !done { 3048 asg.Response.Response = future.Response() 3049 err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsCreateOrUpdateFuture") 3050 return 3051 } 3052 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3053 if asg.Response.Response, err = future.GetResult(sender); err == nil && asg.Response.Response.StatusCode != http.StatusNoContent { 3054 asg, err = client.CreateOrUpdateResponder(asg.Response.Response) 3055 if err != nil { 3056 err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsCreateOrUpdateFuture", "Result", asg.Response.Response, "Failure responding to request") 3057 } 3058 } 3059 return 3060} 3061 3062// ApplicationSecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a 3063// long-running operation. 3064type ApplicationSecurityGroupsDeleteFuture struct { 3065 azure.FutureAPI 3066 // Result returns the result of the asynchronous operation. 3067 // If the operation has not completed it will return an error. 3068 Result func(ApplicationSecurityGroupsClient) (autorest.Response, error) 3069} 3070 3071// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3072func (future *ApplicationSecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { 3073 var azFuture azure.Future 3074 if err := json.Unmarshal(body, &azFuture); err != nil { 3075 return err 3076 } 3077 future.FutureAPI = &azFuture 3078 future.Result = future.result 3079 return nil 3080} 3081 3082// result is the default implementation for ApplicationSecurityGroupsDeleteFuture.Result. 3083func (future *ApplicationSecurityGroupsDeleteFuture) result(client ApplicationSecurityGroupsClient) (ar autorest.Response, err error) { 3084 var done bool 3085 done, err = future.DoneWithContext(context.Background(), client) 3086 if err != nil { 3087 err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") 3088 return 3089 } 3090 if !done { 3091 ar.Response = future.Response() 3092 err = azure.NewAsyncOpIncompleteError("network.ApplicationSecurityGroupsDeleteFuture") 3093 return 3094 } 3095 ar.Response = future.Response() 3096 return 3097} 3098 3099// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations 3100// that belongs to an ExpressRouteCircuit. 3101type AuthorizationListResult struct { 3102 autorest.Response `json:"-"` 3103 // Value - The authorizations in an ExpressRoute Circuit. 3104 Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` 3105 // NextLink - The URL to get the next set of results. 3106 NextLink *string `json:"nextLink,omitempty"` 3107} 3108 3109// AuthorizationListResultIterator provides access to a complete listing of 3110// ExpressRouteCircuitAuthorization values. 3111type AuthorizationListResultIterator struct { 3112 i int 3113 page AuthorizationListResultPage 3114} 3115 3116// NextWithContext advances to the next value. If there was an error making 3117// the request the iterator does not advance and the error is returned. 3118func (iter *AuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) { 3119 if tracing.IsEnabled() { 3120 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultIterator.NextWithContext") 3121 defer func() { 3122 sc := -1 3123 if iter.Response().Response.Response != nil { 3124 sc = iter.Response().Response.Response.StatusCode 3125 } 3126 tracing.EndSpan(ctx, sc, err) 3127 }() 3128 } 3129 iter.i++ 3130 if iter.i < len(iter.page.Values()) { 3131 return nil 3132 } 3133 err = iter.page.NextWithContext(ctx) 3134 if err != nil { 3135 iter.i-- 3136 return err 3137 } 3138 iter.i = 0 3139 return nil 3140} 3141 3142// Next advances to the next value. If there was an error making 3143// the request the iterator does not advance and the error is returned. 3144// Deprecated: Use NextWithContext() instead. 3145func (iter *AuthorizationListResultIterator) Next() error { 3146 return iter.NextWithContext(context.Background()) 3147} 3148 3149// NotDone returns true if the enumeration should be started or is not yet complete. 3150func (iter AuthorizationListResultIterator) NotDone() bool { 3151 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3152} 3153 3154// Response returns the raw server response from the last page request. 3155func (iter AuthorizationListResultIterator) Response() AuthorizationListResult { 3156 return iter.page.Response() 3157} 3158 3159// Value returns the current value or a zero-initialized value if the 3160// iterator has advanced beyond the end of the collection. 3161func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization { 3162 if !iter.page.NotDone() { 3163 return ExpressRouteCircuitAuthorization{} 3164 } 3165 return iter.page.Values()[iter.i] 3166} 3167 3168// Creates a new instance of the AuthorizationListResultIterator type. 3169func NewAuthorizationListResultIterator(page AuthorizationListResultPage) AuthorizationListResultIterator { 3170 return AuthorizationListResultIterator{page: page} 3171} 3172 3173// IsEmpty returns true if the ListResult contains no values. 3174func (alr AuthorizationListResult) IsEmpty() bool { 3175 return alr.Value == nil || len(*alr.Value) == 0 3176} 3177 3178// hasNextLink returns true if the NextLink is not empty. 3179func (alr AuthorizationListResult) hasNextLink() bool { 3180 return alr.NextLink != nil && len(*alr.NextLink) != 0 3181} 3182 3183// authorizationListResultPreparer prepares a request to retrieve the next set of results. 3184// It returns nil if no more results exist. 3185func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) { 3186 if !alr.hasNextLink() { 3187 return nil, nil 3188 } 3189 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3190 autorest.AsJSON(), 3191 autorest.AsGet(), 3192 autorest.WithBaseURL(to.String(alr.NextLink))) 3193} 3194 3195// AuthorizationListResultPage contains a page of ExpressRouteCircuitAuthorization values. 3196type AuthorizationListResultPage struct { 3197 fn func(context.Context, AuthorizationListResult) (AuthorizationListResult, error) 3198 alr AuthorizationListResult 3199} 3200 3201// NextWithContext advances to the next page of values. If there was an error making 3202// the request the page does not advance and the error is returned. 3203func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) { 3204 if tracing.IsEnabled() { 3205 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultPage.NextWithContext") 3206 defer func() { 3207 sc := -1 3208 if page.Response().Response.Response != nil { 3209 sc = page.Response().Response.Response.StatusCode 3210 } 3211 tracing.EndSpan(ctx, sc, err) 3212 }() 3213 } 3214 for { 3215 next, err := page.fn(ctx, page.alr) 3216 if err != nil { 3217 return err 3218 } 3219 page.alr = next 3220 if !next.hasNextLink() || !next.IsEmpty() { 3221 break 3222 } 3223 } 3224 return nil 3225} 3226 3227// Next advances to the next page of values. If there was an error making 3228// the request the page does not advance and the error is returned. 3229// Deprecated: Use NextWithContext() instead. 3230func (page *AuthorizationListResultPage) Next() error { 3231 return page.NextWithContext(context.Background()) 3232} 3233 3234// NotDone returns true if the page enumeration should be started or is not yet complete. 3235func (page AuthorizationListResultPage) NotDone() bool { 3236 return !page.alr.IsEmpty() 3237} 3238 3239// Response returns the raw server response from the last page request. 3240func (page AuthorizationListResultPage) Response() AuthorizationListResult { 3241 return page.alr 3242} 3243 3244// Values returns the slice of values for the current page or nil if there are no values. 3245func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization { 3246 if page.alr.IsEmpty() { 3247 return nil 3248 } 3249 return *page.alr.Value 3250} 3251 3252// Creates a new instance of the AuthorizationListResultPage type. 3253func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage { 3254 return AuthorizationListResultPage{ 3255 fn: getNextPage, 3256 alr: cur, 3257 } 3258} 3259 3260// AuthorizationPropertiesFormat ... 3261type AuthorizationPropertiesFormat struct { 3262 // AuthorizationKey - The authorization key. 3263 AuthorizationKey *string `json:"authorizationKey,omitempty"` 3264 // AuthorizationUseStatus - AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' 3265 AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` 3266 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 3267 ProvisioningState *string `json:"provisioningState,omitempty"` 3268} 3269 3270// Availability availability of the metric. 3271type Availability struct { 3272 // TimeGrain - The time grain of the availability. 3273 TimeGrain *string `json:"timeGrain,omitempty"` 3274 // Retention - The retention of the availability. 3275 Retention *string `json:"retention,omitempty"` 3276 // BlobDuration - Duration of the availability blob. 3277 BlobDuration *string `json:"blobDuration,omitempty"` 3278} 3279 3280// AvailableProvidersList list of available countries with details. 3281type AvailableProvidersList struct { 3282 autorest.Response `json:"-"` 3283 // Countries - List of available countries. 3284 Countries *[]AvailableProvidersListCountry `json:"countries,omitempty"` 3285} 3286 3287// AvailableProvidersListCity city or town details. 3288type AvailableProvidersListCity struct { 3289 // CityName - The city or town name. 3290 CityName *string `json:"cityName,omitempty"` 3291 // Providers - A list of Internet service providers. 3292 Providers *[]string `json:"providers,omitempty"` 3293} 3294 3295// AvailableProvidersListCountry country details. 3296type AvailableProvidersListCountry struct { 3297 // CountryName - The country name. 3298 CountryName *string `json:"countryName,omitempty"` 3299 // Providers - A list of Internet service providers. 3300 Providers *[]string `json:"providers,omitempty"` 3301 // States - List of available states in the country. 3302 States *[]AvailableProvidersListState `json:"states,omitempty"` 3303} 3304 3305// AvailableProvidersListParameters constraints that determine the list of available Internet service 3306// providers. 3307type AvailableProvidersListParameters struct { 3308 // AzureLocations - A list of Azure regions. 3309 AzureLocations *[]string `json:"azureLocations,omitempty"` 3310 // Country - The country for available providers list. 3311 Country *string `json:"country,omitempty"` 3312 // State - The state for available providers list. 3313 State *string `json:"state,omitempty"` 3314 // City - The city or town for available providers list. 3315 City *string `json:"city,omitempty"` 3316} 3317 3318// AvailableProvidersListState state details. 3319type AvailableProvidersListState struct { 3320 // StateName - The state name. 3321 StateName *string `json:"stateName,omitempty"` 3322 // Providers - A list of Internet service providers. 3323 Providers *[]string `json:"providers,omitempty"` 3324 // Cities - List of available cities or towns in the state. 3325 Cities *[]AvailableProvidersListCity `json:"cities,omitempty"` 3326} 3327 3328// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, 3329// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct 3330// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous 3331// operation succeeded, the response body includes the HTTP status code for the successful request. If the 3332// asynchronous operation failed, the response body includes the HTTP status code for the failed request 3333// and error information regarding the failure. 3334type AzureAsyncOperationResult struct { 3335 // Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed' 3336 Status OperationStatus `json:"status,omitempty"` 3337 Error *Error `json:"error,omitempty"` 3338} 3339 3340// AzureFirewall azure Firewall resource 3341type AzureFirewall struct { 3342 autorest.Response `json:"-"` 3343 *AzureFirewallPropertiesFormat `json:"properties,omitempty"` 3344 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 3345 Etag *string `json:"etag,omitempty"` 3346 // ID - Resource ID. 3347 ID *string `json:"id,omitempty"` 3348 // Name - READ-ONLY; Resource name. 3349 Name *string `json:"name,omitempty"` 3350 // Type - READ-ONLY; Resource type. 3351 Type *string `json:"type,omitempty"` 3352 // Location - Resource location. 3353 Location *string `json:"location,omitempty"` 3354 // Tags - Resource tags. 3355 Tags map[string]*string `json:"tags"` 3356} 3357 3358// MarshalJSON is the custom marshaler for AzureFirewall. 3359func (af AzureFirewall) MarshalJSON() ([]byte, error) { 3360 objectMap := make(map[string]interface{}) 3361 if af.AzureFirewallPropertiesFormat != nil { 3362 objectMap["properties"] = af.AzureFirewallPropertiesFormat 3363 } 3364 if af.ID != nil { 3365 objectMap["id"] = af.ID 3366 } 3367 if af.Location != nil { 3368 objectMap["location"] = af.Location 3369 } 3370 if af.Tags != nil { 3371 objectMap["tags"] = af.Tags 3372 } 3373 return json.Marshal(objectMap) 3374} 3375 3376// UnmarshalJSON is the custom unmarshaler for AzureFirewall struct. 3377func (af *AzureFirewall) UnmarshalJSON(body []byte) error { 3378 var m map[string]*json.RawMessage 3379 err := json.Unmarshal(body, &m) 3380 if err != nil { 3381 return err 3382 } 3383 for k, v := range m { 3384 switch k { 3385 case "properties": 3386 if v != nil { 3387 var azureFirewallPropertiesFormat AzureFirewallPropertiesFormat 3388 err = json.Unmarshal(*v, &azureFirewallPropertiesFormat) 3389 if err != nil { 3390 return err 3391 } 3392 af.AzureFirewallPropertiesFormat = &azureFirewallPropertiesFormat 3393 } 3394 case "etag": 3395 if v != nil { 3396 var etag string 3397 err = json.Unmarshal(*v, &etag) 3398 if err != nil { 3399 return err 3400 } 3401 af.Etag = &etag 3402 } 3403 case "id": 3404 if v != nil { 3405 var ID string 3406 err = json.Unmarshal(*v, &ID) 3407 if err != nil { 3408 return err 3409 } 3410 af.ID = &ID 3411 } 3412 case "name": 3413 if v != nil { 3414 var name string 3415 err = json.Unmarshal(*v, &name) 3416 if err != nil { 3417 return err 3418 } 3419 af.Name = &name 3420 } 3421 case "type": 3422 if v != nil { 3423 var typeVar string 3424 err = json.Unmarshal(*v, &typeVar) 3425 if err != nil { 3426 return err 3427 } 3428 af.Type = &typeVar 3429 } 3430 case "location": 3431 if v != nil { 3432 var location string 3433 err = json.Unmarshal(*v, &location) 3434 if err != nil { 3435 return err 3436 } 3437 af.Location = &location 3438 } 3439 case "tags": 3440 if v != nil { 3441 var tags map[string]*string 3442 err = json.Unmarshal(*v, &tags) 3443 if err != nil { 3444 return err 3445 } 3446 af.Tags = tags 3447 } 3448 } 3449 } 3450 3451 return nil 3452} 3453 3454// AzureFirewallApplicationRule properties of an application rule. 3455type AzureFirewallApplicationRule struct { 3456 // Name - Name of the application rule. 3457 Name *string `json:"name,omitempty"` 3458 // Description - Description of the rule. 3459 Description *string `json:"description,omitempty"` 3460 // SourceAddresses - List of source IP addresses for this rule. 3461 SourceAddresses *[]string `json:"sourceAddresses,omitempty"` 3462 // Protocols - Array of ApplicationRuleProtocols. 3463 Protocols *[]AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"` 3464 // TargetUrls - List of URLs for this rule. 3465 TargetUrls *[]string `json:"targetUrls,omitempty"` 3466} 3467 3468// AzureFirewallApplicationRuleCollection application rule collection resource 3469type AzureFirewallApplicationRuleCollection struct { 3470 *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"` 3471 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 3472 Name *string `json:"name,omitempty"` 3473 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 3474 Etag *string `json:"etag,omitempty"` 3475 // ID - Resource ID. 3476 ID *string `json:"id,omitempty"` 3477} 3478 3479// MarshalJSON is the custom marshaler for AzureFirewallApplicationRuleCollection. 3480func (afarc AzureFirewallApplicationRuleCollection) MarshalJSON() ([]byte, error) { 3481 objectMap := make(map[string]interface{}) 3482 if afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat != nil { 3483 objectMap["properties"] = afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat 3484 } 3485 if afarc.Name != nil { 3486 objectMap["name"] = afarc.Name 3487 } 3488 if afarc.ID != nil { 3489 objectMap["id"] = afarc.ID 3490 } 3491 return json.Marshal(objectMap) 3492} 3493 3494// UnmarshalJSON is the custom unmarshaler for AzureFirewallApplicationRuleCollection struct. 3495func (afarc *AzureFirewallApplicationRuleCollection) UnmarshalJSON(body []byte) error { 3496 var m map[string]*json.RawMessage 3497 err := json.Unmarshal(body, &m) 3498 if err != nil { 3499 return err 3500 } 3501 for k, v := range m { 3502 switch k { 3503 case "properties": 3504 if v != nil { 3505 var azureFirewallApplicationRuleCollectionPropertiesFormat AzureFirewallApplicationRuleCollectionPropertiesFormat 3506 err = json.Unmarshal(*v, &azureFirewallApplicationRuleCollectionPropertiesFormat) 3507 if err != nil { 3508 return err 3509 } 3510 afarc.AzureFirewallApplicationRuleCollectionPropertiesFormat = &azureFirewallApplicationRuleCollectionPropertiesFormat 3511 } 3512 case "name": 3513 if v != nil { 3514 var name string 3515 err = json.Unmarshal(*v, &name) 3516 if err != nil { 3517 return err 3518 } 3519 afarc.Name = &name 3520 } 3521 case "etag": 3522 if v != nil { 3523 var etag string 3524 err = json.Unmarshal(*v, &etag) 3525 if err != nil { 3526 return err 3527 } 3528 afarc.Etag = &etag 3529 } 3530 case "id": 3531 if v != nil { 3532 var ID string 3533 err = json.Unmarshal(*v, &ID) 3534 if err != nil { 3535 return err 3536 } 3537 afarc.ID = &ID 3538 } 3539 } 3540 } 3541 3542 return nil 3543} 3544 3545// AzureFirewallApplicationRuleCollectionPropertiesFormat properties of the application rule collection. 3546type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { 3547 // Priority - Priority of the application rule collection resource. 3548 Priority *int32 `json:"priority,omitempty"` 3549 // Action - The action type of a rule collection 3550 Action *AzureFirewallRCAction `json:"action,omitempty"` 3551 // Rules - Collection of rules used by a application rule collection. 3552 Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"` 3553 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 3554 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3555} 3556 3557// AzureFirewallApplicationRuleProtocol properties of the application rule protocol. 3558type AzureFirewallApplicationRuleProtocol struct { 3559 // ProtocolType - Protocol type. Possible values include: 'AzureFirewallApplicationRuleProtocolTypeHTTP', 'AzureFirewallApplicationRuleProtocolTypeHTTPS' 3560 ProtocolType AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"` 3561 // Port - Port number for the protocol, cannot be greater than 64000. This field is optional. 3562 Port *int32 `json:"port,omitempty"` 3563} 3564 3565// AzureFirewallIPConfiguration IP configuration of an Azure Firewall. 3566type AzureFirewallIPConfiguration struct { 3567 *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"` 3568 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 3569 Name *string `json:"name,omitempty"` 3570 // Etag - A unique read-only string that changes whenever the resource is updated. 3571 Etag *string `json:"etag,omitempty"` 3572 // ID - Resource ID. 3573 ID *string `json:"id,omitempty"` 3574} 3575 3576// MarshalJSON is the custom marshaler for AzureFirewallIPConfiguration. 3577func (afic AzureFirewallIPConfiguration) MarshalJSON() ([]byte, error) { 3578 objectMap := make(map[string]interface{}) 3579 if afic.AzureFirewallIPConfigurationPropertiesFormat != nil { 3580 objectMap["properties"] = afic.AzureFirewallIPConfigurationPropertiesFormat 3581 } 3582 if afic.Name != nil { 3583 objectMap["name"] = afic.Name 3584 } 3585 if afic.Etag != nil { 3586 objectMap["etag"] = afic.Etag 3587 } 3588 if afic.ID != nil { 3589 objectMap["id"] = afic.ID 3590 } 3591 return json.Marshal(objectMap) 3592} 3593 3594// UnmarshalJSON is the custom unmarshaler for AzureFirewallIPConfiguration struct. 3595func (afic *AzureFirewallIPConfiguration) UnmarshalJSON(body []byte) error { 3596 var m map[string]*json.RawMessage 3597 err := json.Unmarshal(body, &m) 3598 if err != nil { 3599 return err 3600 } 3601 for k, v := range m { 3602 switch k { 3603 case "properties": 3604 if v != nil { 3605 var azureFirewallIPConfigurationPropertiesFormat AzureFirewallIPConfigurationPropertiesFormat 3606 err = json.Unmarshal(*v, &azureFirewallIPConfigurationPropertiesFormat) 3607 if err != nil { 3608 return err 3609 } 3610 afic.AzureFirewallIPConfigurationPropertiesFormat = &azureFirewallIPConfigurationPropertiesFormat 3611 } 3612 case "name": 3613 if v != nil { 3614 var name string 3615 err = json.Unmarshal(*v, &name) 3616 if err != nil { 3617 return err 3618 } 3619 afic.Name = &name 3620 } 3621 case "etag": 3622 if v != nil { 3623 var etag string 3624 err = json.Unmarshal(*v, &etag) 3625 if err != nil { 3626 return err 3627 } 3628 afic.Etag = &etag 3629 } 3630 case "id": 3631 if v != nil { 3632 var ID string 3633 err = json.Unmarshal(*v, &ID) 3634 if err != nil { 3635 return err 3636 } 3637 afic.ID = &ID 3638 } 3639 } 3640 } 3641 3642 return nil 3643} 3644 3645// AzureFirewallIPConfigurationPropertiesFormat properties of IP configuration of an Azure Firewall. 3646type AzureFirewallIPConfigurationPropertiesFormat struct { 3647 // PrivateIPAddress - The Firewall Internal Load Balancer IP to be used as the next hop in User Defined Routes. 3648 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 3649 // Subnet - Reference of the subnet resource. This resource must be named 'AzureFirewallSubnet'. 3650 Subnet *SubResource `json:"subnet,omitempty"` 3651 // InternalPublicIPAddress - Reference of the PublicIP resource. This field is a mandatory input. 3652 InternalPublicIPAddress *SubResource `json:"internalPublicIpAddress,omitempty"` 3653 // PublicIPAddress - Reference of the PublicIP resource. This field is populated in the output. 3654 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 3655 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 3656 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3657} 3658 3659// AzureFirewallListResult response for ListAzureFirewalls API service call. 3660type AzureFirewallListResult struct { 3661 autorest.Response `json:"-"` 3662 // Value - List of a Azure Firewalls in a resource group. 3663 Value *[]AzureFirewall `json:"value,omitempty"` 3664 // NextLink - URL to get the next set of results. 3665 NextLink *string `json:"nextLink,omitempty"` 3666} 3667 3668// AzureFirewallListResultIterator provides access to a complete listing of AzureFirewall values. 3669type AzureFirewallListResultIterator struct { 3670 i int 3671 page AzureFirewallListResultPage 3672} 3673 3674// NextWithContext advances to the next value. If there was an error making 3675// the request the iterator does not advance and the error is returned. 3676func (iter *AzureFirewallListResultIterator) NextWithContext(ctx context.Context) (err error) { 3677 if tracing.IsEnabled() { 3678 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultIterator.NextWithContext") 3679 defer func() { 3680 sc := -1 3681 if iter.Response().Response.Response != nil { 3682 sc = iter.Response().Response.Response.StatusCode 3683 } 3684 tracing.EndSpan(ctx, sc, err) 3685 }() 3686 } 3687 iter.i++ 3688 if iter.i < len(iter.page.Values()) { 3689 return nil 3690 } 3691 err = iter.page.NextWithContext(ctx) 3692 if err != nil { 3693 iter.i-- 3694 return err 3695 } 3696 iter.i = 0 3697 return nil 3698} 3699 3700// Next advances to the next value. If there was an error making 3701// the request the iterator does not advance and the error is returned. 3702// Deprecated: Use NextWithContext() instead. 3703func (iter *AzureFirewallListResultIterator) Next() error { 3704 return iter.NextWithContext(context.Background()) 3705} 3706 3707// NotDone returns true if the enumeration should be started or is not yet complete. 3708func (iter AzureFirewallListResultIterator) NotDone() bool { 3709 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3710} 3711 3712// Response returns the raw server response from the last page request. 3713func (iter AzureFirewallListResultIterator) Response() AzureFirewallListResult { 3714 return iter.page.Response() 3715} 3716 3717// Value returns the current value or a zero-initialized value if the 3718// iterator has advanced beyond the end of the collection. 3719func (iter AzureFirewallListResultIterator) Value() AzureFirewall { 3720 if !iter.page.NotDone() { 3721 return AzureFirewall{} 3722 } 3723 return iter.page.Values()[iter.i] 3724} 3725 3726// Creates a new instance of the AzureFirewallListResultIterator type. 3727func NewAzureFirewallListResultIterator(page AzureFirewallListResultPage) AzureFirewallListResultIterator { 3728 return AzureFirewallListResultIterator{page: page} 3729} 3730 3731// IsEmpty returns true if the ListResult contains no values. 3732func (aflr AzureFirewallListResult) IsEmpty() bool { 3733 return aflr.Value == nil || len(*aflr.Value) == 0 3734} 3735 3736// hasNextLink returns true if the NextLink is not empty. 3737func (aflr AzureFirewallListResult) hasNextLink() bool { 3738 return aflr.NextLink != nil && len(*aflr.NextLink) != 0 3739} 3740 3741// azureFirewallListResultPreparer prepares a request to retrieve the next set of results. 3742// It returns nil if no more results exist. 3743func (aflr AzureFirewallListResult) azureFirewallListResultPreparer(ctx context.Context) (*http.Request, error) { 3744 if !aflr.hasNextLink() { 3745 return nil, nil 3746 } 3747 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3748 autorest.AsJSON(), 3749 autorest.AsGet(), 3750 autorest.WithBaseURL(to.String(aflr.NextLink))) 3751} 3752 3753// AzureFirewallListResultPage contains a page of AzureFirewall values. 3754type AzureFirewallListResultPage struct { 3755 fn func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error) 3756 aflr AzureFirewallListResult 3757} 3758 3759// NextWithContext advances to the next page of values. If there was an error making 3760// the request the page does not advance and the error is returned. 3761func (page *AzureFirewallListResultPage) NextWithContext(ctx context.Context) (err error) { 3762 if tracing.IsEnabled() { 3763 ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallListResultPage.NextWithContext") 3764 defer func() { 3765 sc := -1 3766 if page.Response().Response.Response != nil { 3767 sc = page.Response().Response.Response.StatusCode 3768 } 3769 tracing.EndSpan(ctx, sc, err) 3770 }() 3771 } 3772 for { 3773 next, err := page.fn(ctx, page.aflr) 3774 if err != nil { 3775 return err 3776 } 3777 page.aflr = next 3778 if !next.hasNextLink() || !next.IsEmpty() { 3779 break 3780 } 3781 } 3782 return nil 3783} 3784 3785// Next advances to the next page of values. If there was an error making 3786// the request the page does not advance and the error is returned. 3787// Deprecated: Use NextWithContext() instead. 3788func (page *AzureFirewallListResultPage) Next() error { 3789 return page.NextWithContext(context.Background()) 3790} 3791 3792// NotDone returns true if the page enumeration should be started or is not yet complete. 3793func (page AzureFirewallListResultPage) NotDone() bool { 3794 return !page.aflr.IsEmpty() 3795} 3796 3797// Response returns the raw server response from the last page request. 3798func (page AzureFirewallListResultPage) Response() AzureFirewallListResult { 3799 return page.aflr 3800} 3801 3802// Values returns the slice of values for the current page or nil if there are no values. 3803func (page AzureFirewallListResultPage) Values() []AzureFirewall { 3804 if page.aflr.IsEmpty() { 3805 return nil 3806 } 3807 return *page.aflr.Value 3808} 3809 3810// Creates a new instance of the AzureFirewallListResultPage type. 3811func NewAzureFirewallListResultPage(cur AzureFirewallListResult, getNextPage func(context.Context, AzureFirewallListResult) (AzureFirewallListResult, error)) AzureFirewallListResultPage { 3812 return AzureFirewallListResultPage{ 3813 fn: getNextPage, 3814 aflr: cur, 3815 } 3816} 3817 3818// AzureFirewallNetworkRule properties of the network rule. 3819type AzureFirewallNetworkRule struct { 3820 // Name - Name of the network rule. 3821 Name *string `json:"name,omitempty"` 3822 // Description - Description of the rule. 3823 Description *string `json:"description,omitempty"` 3824 // Protocols - Array of AzureFirewallNetworkRuleProtocols. 3825 Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` 3826 // SourceAddresses - List of source IP addresses for this rule. 3827 SourceAddresses *[]string `json:"sourceAddresses,omitempty"` 3828 // DestinationAddresses - List of destination IP addresses. 3829 DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` 3830 // DestinationPorts - List of destination ports. 3831 DestinationPorts *[]string `json:"destinationPorts,omitempty"` 3832} 3833 3834// AzureFirewallNetworkRuleCollection network rule collection resource 3835type AzureFirewallNetworkRuleCollection struct { 3836 *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"` 3837 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 3838 Name *string `json:"name,omitempty"` 3839 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 3840 Etag *string `json:"etag,omitempty"` 3841 // ID - Resource ID. 3842 ID *string `json:"id,omitempty"` 3843} 3844 3845// MarshalJSON is the custom marshaler for AzureFirewallNetworkRuleCollection. 3846func (afnrc AzureFirewallNetworkRuleCollection) MarshalJSON() ([]byte, error) { 3847 objectMap := make(map[string]interface{}) 3848 if afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat != nil { 3849 objectMap["properties"] = afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat 3850 } 3851 if afnrc.Name != nil { 3852 objectMap["name"] = afnrc.Name 3853 } 3854 if afnrc.ID != nil { 3855 objectMap["id"] = afnrc.ID 3856 } 3857 return json.Marshal(objectMap) 3858} 3859 3860// UnmarshalJSON is the custom unmarshaler for AzureFirewallNetworkRuleCollection struct. 3861func (afnrc *AzureFirewallNetworkRuleCollection) UnmarshalJSON(body []byte) error { 3862 var m map[string]*json.RawMessage 3863 err := json.Unmarshal(body, &m) 3864 if err != nil { 3865 return err 3866 } 3867 for k, v := range m { 3868 switch k { 3869 case "properties": 3870 if v != nil { 3871 var azureFirewallNetworkRuleCollectionPropertiesFormat AzureFirewallNetworkRuleCollectionPropertiesFormat 3872 err = json.Unmarshal(*v, &azureFirewallNetworkRuleCollectionPropertiesFormat) 3873 if err != nil { 3874 return err 3875 } 3876 afnrc.AzureFirewallNetworkRuleCollectionPropertiesFormat = &azureFirewallNetworkRuleCollectionPropertiesFormat 3877 } 3878 case "name": 3879 if v != nil { 3880 var name string 3881 err = json.Unmarshal(*v, &name) 3882 if err != nil { 3883 return err 3884 } 3885 afnrc.Name = &name 3886 } 3887 case "etag": 3888 if v != nil { 3889 var etag string 3890 err = json.Unmarshal(*v, &etag) 3891 if err != nil { 3892 return err 3893 } 3894 afnrc.Etag = &etag 3895 } 3896 case "id": 3897 if v != nil { 3898 var ID string 3899 err = json.Unmarshal(*v, &ID) 3900 if err != nil { 3901 return err 3902 } 3903 afnrc.ID = &ID 3904 } 3905 } 3906 } 3907 3908 return nil 3909} 3910 3911// AzureFirewallNetworkRuleCollectionPropertiesFormat properties of the network rule collection. 3912type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { 3913 // Priority - Priority of the network rule collection resource. 3914 Priority *int32 `json:"priority,omitempty"` 3915 // Action - The action type of a rule collection 3916 Action *AzureFirewallRCAction `json:"action,omitempty"` 3917 // Rules - Collection of rules used by a network rule collection. 3918 Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"` 3919 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 3920 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3921} 3922 3923// AzureFirewallPropertiesFormat properties of the Azure Firewall. 3924type AzureFirewallPropertiesFormat struct { 3925 // ApplicationRuleCollections - Collection of application rule collections used by a Azure Firewall. 3926 ApplicationRuleCollections *[]AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"` 3927 // NetworkRuleCollections - Collection of network rule collections used by a Azure Firewall. 3928 NetworkRuleCollections *[]AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"` 3929 // IPConfigurations - IP configuration of the Azure Firewall resource. 3930 IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` 3931 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 3932 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3933} 3934 3935// AzureFirewallRCAction properties of the AzureFirewallRCAction. 3936type AzureFirewallRCAction struct { 3937 // Type - The type of action. Possible values include: 'AzureFirewallRCActionTypeAllow', 'AzureFirewallRCActionTypeDeny' 3938 Type AzureFirewallRCActionType `json:"type,omitempty"` 3939} 3940 3941// AzureFirewallsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3942// long-running operation. 3943type AzureFirewallsCreateOrUpdateFuture struct { 3944 azure.FutureAPI 3945 // Result returns the result of the asynchronous operation. 3946 // If the operation has not completed it will return an error. 3947 Result func(AzureFirewallsClient) (AzureFirewall, error) 3948} 3949 3950// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3951func (future *AzureFirewallsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3952 var azFuture azure.Future 3953 if err := json.Unmarshal(body, &azFuture); err != nil { 3954 return err 3955 } 3956 future.FutureAPI = &azFuture 3957 future.Result = future.result 3958 return nil 3959} 3960 3961// result is the default implementation for AzureFirewallsCreateOrUpdateFuture.Result. 3962func (future *AzureFirewallsCreateOrUpdateFuture) result(client AzureFirewallsClient) (af AzureFirewall, err error) { 3963 var done bool 3964 done, err = future.DoneWithContext(context.Background(), client) 3965 if err != nil { 3966 err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3967 return 3968 } 3969 if !done { 3970 af.Response.Response = future.Response() 3971 err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsCreateOrUpdateFuture") 3972 return 3973 } 3974 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3975 if af.Response.Response, err = future.GetResult(sender); err == nil && af.Response.Response.StatusCode != http.StatusNoContent { 3976 af, err = client.CreateOrUpdateResponder(af.Response.Response) 3977 if err != nil { 3978 err = autorest.NewErrorWithError(err, "network.AzureFirewallsCreateOrUpdateFuture", "Result", af.Response.Response, "Failure responding to request") 3979 } 3980 } 3981 return 3982} 3983 3984// AzureFirewallsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3985// operation. 3986type AzureFirewallsDeleteFuture struct { 3987 azure.FutureAPI 3988 // Result returns the result of the asynchronous operation. 3989 // If the operation has not completed it will return an error. 3990 Result func(AzureFirewallsClient) (autorest.Response, error) 3991} 3992 3993// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3994func (future *AzureFirewallsDeleteFuture) UnmarshalJSON(body []byte) error { 3995 var azFuture azure.Future 3996 if err := json.Unmarshal(body, &azFuture); err != nil { 3997 return err 3998 } 3999 future.FutureAPI = &azFuture 4000 future.Result = future.result 4001 return nil 4002} 4003 4004// result is the default implementation for AzureFirewallsDeleteFuture.Result. 4005func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (ar autorest.Response, err error) { 4006 var done bool 4007 done, err = future.DoneWithContext(context.Background(), client) 4008 if err != nil { 4009 err = autorest.NewErrorWithError(err, "network.AzureFirewallsDeleteFuture", "Result", future.Response(), "Polling failure") 4010 return 4011 } 4012 if !done { 4013 ar.Response = future.Response() 4014 err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsDeleteFuture") 4015 return 4016 } 4017 ar.Response = future.Response() 4018 return 4019} 4020 4021// AzureReachabilityReport azure reachability report details. 4022type AzureReachabilityReport struct { 4023 autorest.Response `json:"-"` 4024 // AggregationLevel - The aggregation level of Azure reachability report. Can be Country, State or City. 4025 AggregationLevel *string `json:"aggregationLevel,omitempty"` 4026 ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` 4027 // ReachabilityReport - List of Azure reachability report items. 4028 ReachabilityReport *[]AzureReachabilityReportItem `json:"reachabilityReport,omitempty"` 4029} 4030 4031// AzureReachabilityReportItem azure reachability report details for a given provider location. 4032type AzureReachabilityReportItem struct { 4033 // Provider - The Internet service provider. 4034 Provider *string `json:"provider,omitempty"` 4035 // AzureLocation - The Azure region. 4036 AzureLocation *string `json:"azureLocation,omitempty"` 4037 // Latencies - List of latency details for each of the time series. 4038 Latencies *[]AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"` 4039} 4040 4041// AzureReachabilityReportLatencyInfo details on latency for a time series. 4042type AzureReachabilityReportLatencyInfo struct { 4043 // TimeStamp - The time stamp. 4044 TimeStamp *date.Time `json:"timeStamp,omitempty"` 4045 // Score - The relative latency score between 1 and 100, higher values indicating a faster connection. 4046 Score *int32 `json:"score,omitempty"` 4047} 4048 4049// AzureReachabilityReportLocation parameters that define a geographic location. 4050type AzureReachabilityReportLocation struct { 4051 // Country - The name of the country. 4052 Country *string `json:"country,omitempty"` 4053 // State - The name of the state. 4054 State *string `json:"state,omitempty"` 4055 // City - The name of the city or town. 4056 City *string `json:"city,omitempty"` 4057} 4058 4059// AzureReachabilityReportParameters geographic and time constraints for Azure reachability report. 4060type AzureReachabilityReportParameters struct { 4061 ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` 4062 // Providers - List of Internet service providers. 4063 Providers *[]string `json:"providers,omitempty"` 4064 // AzureLocations - Optional Azure regions to scope the query to. 4065 AzureLocations *[]string `json:"azureLocations,omitempty"` 4066 // StartTime - The start time for the Azure reachability report. 4067 StartTime *date.Time `json:"startTime,omitempty"` 4068 // EndTime - The end time for the Azure reachability report. 4069 EndTime *date.Time `json:"endTime,omitempty"` 4070} 4071 4072// BackendAddressPool pool of backend IP addresses. 4073type BackendAddressPool struct { 4074 autorest.Response `json:"-"` 4075 // BackendAddressPoolPropertiesFormat - Properties of load balancer backend address pool. 4076 *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 4077 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 4078 Name *string `json:"name,omitempty"` 4079 // Etag - A unique read-only string that changes whenever the resource is updated. 4080 Etag *string `json:"etag,omitempty"` 4081 // ID - Resource ID. 4082 ID *string `json:"id,omitempty"` 4083} 4084 4085// MarshalJSON is the custom marshaler for BackendAddressPool. 4086func (bap BackendAddressPool) MarshalJSON() ([]byte, error) { 4087 objectMap := make(map[string]interface{}) 4088 if bap.BackendAddressPoolPropertiesFormat != nil { 4089 objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat 4090 } 4091 if bap.Name != nil { 4092 objectMap["name"] = bap.Name 4093 } 4094 if bap.Etag != nil { 4095 objectMap["etag"] = bap.Etag 4096 } 4097 if bap.ID != nil { 4098 objectMap["id"] = bap.ID 4099 } 4100 return json.Marshal(objectMap) 4101} 4102 4103// UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. 4104func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { 4105 var m map[string]*json.RawMessage 4106 err := json.Unmarshal(body, &m) 4107 if err != nil { 4108 return err 4109 } 4110 for k, v := range m { 4111 switch k { 4112 case "properties": 4113 if v != nil { 4114 var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat 4115 err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat) 4116 if err != nil { 4117 return err 4118 } 4119 bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat 4120 } 4121 case "name": 4122 if v != nil { 4123 var name string 4124 err = json.Unmarshal(*v, &name) 4125 if err != nil { 4126 return err 4127 } 4128 bap.Name = &name 4129 } 4130 case "etag": 4131 if v != nil { 4132 var etag string 4133 err = json.Unmarshal(*v, &etag) 4134 if err != nil { 4135 return err 4136 } 4137 bap.Etag = &etag 4138 } 4139 case "id": 4140 if v != nil { 4141 var ID string 4142 err = json.Unmarshal(*v, &ID) 4143 if err != nil { 4144 return err 4145 } 4146 bap.ID = &ID 4147 } 4148 } 4149 } 4150 4151 return nil 4152} 4153 4154// BackendAddressPoolPropertiesFormat properties of the backend address pool. 4155type BackendAddressPoolPropertiesFormat struct { 4156 // BackendIPConfigurations - READ-ONLY; Gets collection of references to IP addresses defined in network interfaces. 4157 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 4158 // LoadBalancingRules - READ-ONLY; Gets load balancing rules that use this backend address pool. 4159 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 4160 // OutboundNatRule - READ-ONLY; Gets outbound rules that use this backend address pool. 4161 OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"` 4162 // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 4163 ProvisioningState *string `json:"provisioningState,omitempty"` 4164} 4165 4166// MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. 4167func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { 4168 objectMap := make(map[string]interface{}) 4169 if bappf.ProvisioningState != nil { 4170 objectMap["provisioningState"] = bappf.ProvisioningState 4171 } 4172 return json.Marshal(objectMap) 4173} 4174 4175// BGPCommunity contains bgp community information offered in Service Community resources. 4176type BGPCommunity struct { 4177 // ServiceSupportedRegion - The region which the service support. e.g. For O365, region is Global. 4178 ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` 4179 // CommunityName - The name of the bgp community. e.g. Skype. 4180 CommunityName *string `json:"communityName,omitempty"` 4181 // CommunityValue - The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. 4182 CommunityValue *string `json:"communityValue,omitempty"` 4183 // CommunityPrefixes - The prefixes that the bgp community contains. 4184 CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"` 4185 // IsAuthorizedToUse - Customer is authorized to use bgp community or not. 4186 IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"` 4187 // ServiceGroup - The service group of the bgp community contains. 4188 ServiceGroup *string `json:"serviceGroup,omitempty"` 4189} 4190 4191// BgpPeerStatus BGP peer status details 4192type BgpPeerStatus struct { 4193 // LocalAddress - READ-ONLY; The virtual network gateway's local address 4194 LocalAddress *string `json:"localAddress,omitempty"` 4195 // Neighbor - READ-ONLY; The remote BGP peer 4196 Neighbor *string `json:"neighbor,omitempty"` 4197 // Asn - READ-ONLY; The autonomous system number of the remote BGP peer 4198 Asn *int32 `json:"asn,omitempty"` 4199 // State - READ-ONLY; The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected' 4200 State BgpPeerState `json:"state,omitempty"` 4201 // ConnectedDuration - READ-ONLY; For how long the peering has been up 4202 ConnectedDuration *string `json:"connectedDuration,omitempty"` 4203 // RoutesReceived - READ-ONLY; The number of routes learned from this peer 4204 RoutesReceived *int64 `json:"routesReceived,omitempty"` 4205 // MessagesSent - READ-ONLY; The number of BGP messages sent 4206 MessagesSent *int64 `json:"messagesSent,omitempty"` 4207 // MessagesReceived - READ-ONLY; The number of BGP messages received 4208 MessagesReceived *int64 `json:"messagesReceived,omitempty"` 4209} 4210 4211// MarshalJSON is the custom marshaler for BgpPeerStatus. 4212func (bps BgpPeerStatus) MarshalJSON() ([]byte, error) { 4213 objectMap := make(map[string]interface{}) 4214 return json.Marshal(objectMap) 4215} 4216 4217// BgpPeerStatusListResult response for list BGP peer status API service call 4218type BgpPeerStatusListResult struct { 4219 autorest.Response `json:"-"` 4220 // Value - List of BGP peers 4221 Value *[]BgpPeerStatus `json:"value,omitempty"` 4222} 4223 4224// BgpServiceCommunity service Community Properties. 4225type BgpServiceCommunity struct { 4226 *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` 4227 // ID - Resource ID. 4228 ID *string `json:"id,omitempty"` 4229 // Name - READ-ONLY; Resource name. 4230 Name *string `json:"name,omitempty"` 4231 // Type - READ-ONLY; Resource type. 4232 Type *string `json:"type,omitempty"` 4233 // Location - Resource location. 4234 Location *string `json:"location,omitempty"` 4235 // Tags - Resource tags. 4236 Tags map[string]*string `json:"tags"` 4237} 4238 4239// MarshalJSON is the custom marshaler for BgpServiceCommunity. 4240func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) { 4241 objectMap := make(map[string]interface{}) 4242 if bsc.BgpServiceCommunityPropertiesFormat != nil { 4243 objectMap["properties"] = bsc.BgpServiceCommunityPropertiesFormat 4244 } 4245 if bsc.ID != nil { 4246 objectMap["id"] = bsc.ID 4247 } 4248 if bsc.Location != nil { 4249 objectMap["location"] = bsc.Location 4250 } 4251 if bsc.Tags != nil { 4252 objectMap["tags"] = bsc.Tags 4253 } 4254 return json.Marshal(objectMap) 4255} 4256 4257// UnmarshalJSON is the custom unmarshaler for BgpServiceCommunity struct. 4258func (bsc *BgpServiceCommunity) UnmarshalJSON(body []byte) error { 4259 var m map[string]*json.RawMessage 4260 err := json.Unmarshal(body, &m) 4261 if err != nil { 4262 return err 4263 } 4264 for k, v := range m { 4265 switch k { 4266 case "properties": 4267 if v != nil { 4268 var bgpServiceCommunityPropertiesFormat BgpServiceCommunityPropertiesFormat 4269 err = json.Unmarshal(*v, &bgpServiceCommunityPropertiesFormat) 4270 if err != nil { 4271 return err 4272 } 4273 bsc.BgpServiceCommunityPropertiesFormat = &bgpServiceCommunityPropertiesFormat 4274 } 4275 case "id": 4276 if v != nil { 4277 var ID string 4278 err = json.Unmarshal(*v, &ID) 4279 if err != nil { 4280 return err 4281 } 4282 bsc.ID = &ID 4283 } 4284 case "name": 4285 if v != nil { 4286 var name string 4287 err = json.Unmarshal(*v, &name) 4288 if err != nil { 4289 return err 4290 } 4291 bsc.Name = &name 4292 } 4293 case "type": 4294 if v != nil { 4295 var typeVar string 4296 err = json.Unmarshal(*v, &typeVar) 4297 if err != nil { 4298 return err 4299 } 4300 bsc.Type = &typeVar 4301 } 4302 case "location": 4303 if v != nil { 4304 var location string 4305 err = json.Unmarshal(*v, &location) 4306 if err != nil { 4307 return err 4308 } 4309 bsc.Location = &location 4310 } 4311 case "tags": 4312 if v != nil { 4313 var tags map[string]*string 4314 err = json.Unmarshal(*v, &tags) 4315 if err != nil { 4316 return err 4317 } 4318 bsc.Tags = tags 4319 } 4320 } 4321 } 4322 4323 return nil 4324} 4325 4326// BgpServiceCommunityListResult response for the ListServiceCommunity API service call. 4327type BgpServiceCommunityListResult struct { 4328 autorest.Response `json:"-"` 4329 // Value - A list of service community resources. 4330 Value *[]BgpServiceCommunity `json:"value,omitempty"` 4331 // NextLink - The URL to get the next set of results. 4332 NextLink *string `json:"nextLink,omitempty"` 4333} 4334 4335// BgpServiceCommunityListResultIterator provides access to a complete listing of BgpServiceCommunity 4336// values. 4337type BgpServiceCommunityListResultIterator struct { 4338 i int 4339 page BgpServiceCommunityListResultPage 4340} 4341 4342// NextWithContext advances to the next value. If there was an error making 4343// the request the iterator does not advance and the error is returned. 4344func (iter *BgpServiceCommunityListResultIterator) NextWithContext(ctx context.Context) (err error) { 4345 if tracing.IsEnabled() { 4346 ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultIterator.NextWithContext") 4347 defer func() { 4348 sc := -1 4349 if iter.Response().Response.Response != nil { 4350 sc = iter.Response().Response.Response.StatusCode 4351 } 4352 tracing.EndSpan(ctx, sc, err) 4353 }() 4354 } 4355 iter.i++ 4356 if iter.i < len(iter.page.Values()) { 4357 return nil 4358 } 4359 err = iter.page.NextWithContext(ctx) 4360 if err != nil { 4361 iter.i-- 4362 return err 4363 } 4364 iter.i = 0 4365 return nil 4366} 4367 4368// Next advances to the next value. If there was an error making 4369// the request the iterator does not advance and the error is returned. 4370// Deprecated: Use NextWithContext() instead. 4371func (iter *BgpServiceCommunityListResultIterator) Next() error { 4372 return iter.NextWithContext(context.Background()) 4373} 4374 4375// NotDone returns true if the enumeration should be started or is not yet complete. 4376func (iter BgpServiceCommunityListResultIterator) NotDone() bool { 4377 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4378} 4379 4380// Response returns the raw server response from the last page request. 4381func (iter BgpServiceCommunityListResultIterator) Response() BgpServiceCommunityListResult { 4382 return iter.page.Response() 4383} 4384 4385// Value returns the current value or a zero-initialized value if the 4386// iterator has advanced beyond the end of the collection. 4387func (iter BgpServiceCommunityListResultIterator) Value() BgpServiceCommunity { 4388 if !iter.page.NotDone() { 4389 return BgpServiceCommunity{} 4390 } 4391 return iter.page.Values()[iter.i] 4392} 4393 4394// Creates a new instance of the BgpServiceCommunityListResultIterator type. 4395func NewBgpServiceCommunityListResultIterator(page BgpServiceCommunityListResultPage) BgpServiceCommunityListResultIterator { 4396 return BgpServiceCommunityListResultIterator{page: page} 4397} 4398 4399// IsEmpty returns true if the ListResult contains no values. 4400func (bsclr BgpServiceCommunityListResult) IsEmpty() bool { 4401 return bsclr.Value == nil || len(*bsclr.Value) == 0 4402} 4403 4404// hasNextLink returns true if the NextLink is not empty. 4405func (bsclr BgpServiceCommunityListResult) hasNextLink() bool { 4406 return bsclr.NextLink != nil && len(*bsclr.NextLink) != 0 4407} 4408 4409// bgpServiceCommunityListResultPreparer prepares a request to retrieve the next set of results. 4410// It returns nil if no more results exist. 4411func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer(ctx context.Context) (*http.Request, error) { 4412 if !bsclr.hasNextLink() { 4413 return nil, nil 4414 } 4415 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4416 autorest.AsJSON(), 4417 autorest.AsGet(), 4418 autorest.WithBaseURL(to.String(bsclr.NextLink))) 4419} 4420 4421// BgpServiceCommunityListResultPage contains a page of BgpServiceCommunity values. 4422type BgpServiceCommunityListResultPage struct { 4423 fn func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error) 4424 bsclr BgpServiceCommunityListResult 4425} 4426 4427// NextWithContext advances to the next page of values. If there was an error making 4428// the request the page does not advance and the error is returned. 4429func (page *BgpServiceCommunityListResultPage) NextWithContext(ctx context.Context) (err error) { 4430 if tracing.IsEnabled() { 4431 ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultPage.NextWithContext") 4432 defer func() { 4433 sc := -1 4434 if page.Response().Response.Response != nil { 4435 sc = page.Response().Response.Response.StatusCode 4436 } 4437 tracing.EndSpan(ctx, sc, err) 4438 }() 4439 } 4440 for { 4441 next, err := page.fn(ctx, page.bsclr) 4442 if err != nil { 4443 return err 4444 } 4445 page.bsclr = next 4446 if !next.hasNextLink() || !next.IsEmpty() { 4447 break 4448 } 4449 } 4450 return nil 4451} 4452 4453// Next advances to the next page of values. If there was an error making 4454// the request the page does not advance and the error is returned. 4455// Deprecated: Use NextWithContext() instead. 4456func (page *BgpServiceCommunityListResultPage) Next() error { 4457 return page.NextWithContext(context.Background()) 4458} 4459 4460// NotDone returns true if the page enumeration should be started or is not yet complete. 4461func (page BgpServiceCommunityListResultPage) NotDone() bool { 4462 return !page.bsclr.IsEmpty() 4463} 4464 4465// Response returns the raw server response from the last page request. 4466func (page BgpServiceCommunityListResultPage) Response() BgpServiceCommunityListResult { 4467 return page.bsclr 4468} 4469 4470// Values returns the slice of values for the current page or nil if there are no values. 4471func (page BgpServiceCommunityListResultPage) Values() []BgpServiceCommunity { 4472 if page.bsclr.IsEmpty() { 4473 return nil 4474 } 4475 return *page.bsclr.Value 4476} 4477 4478// Creates a new instance of the BgpServiceCommunityListResultPage type. 4479func NewBgpServiceCommunityListResultPage(cur BgpServiceCommunityListResult, getNextPage func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)) BgpServiceCommunityListResultPage { 4480 return BgpServiceCommunityListResultPage{ 4481 fn: getNextPage, 4482 bsclr: cur, 4483 } 4484} 4485 4486// BgpServiceCommunityPropertiesFormat properties of Service Community. 4487type BgpServiceCommunityPropertiesFormat struct { 4488 // ServiceName - The name of the bgp community. e.g. Skype. 4489 ServiceName *string `json:"serviceName,omitempty"` 4490 // BgpCommunities - Get a list of bgp communities. 4491 BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"` 4492} 4493 4494// BgpSettings BGP settings details 4495type BgpSettings struct { 4496 // Asn - The BGP speaker's ASN. 4497 Asn *int64 `json:"asn,omitempty"` 4498 // BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker. 4499 BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` 4500 // PeerWeight - The weight added to routes learned from this BGP speaker. 4501 PeerWeight *int32 `json:"peerWeight,omitempty"` 4502} 4503 4504// ConnectionMonitor parameters that define the operation to create a connection monitor. 4505type ConnectionMonitor struct { 4506 // Location - Connection monitor location. 4507 Location *string `json:"location,omitempty"` 4508 // Tags - Connection monitor tags. 4509 Tags map[string]*string `json:"tags"` 4510 *ConnectionMonitorParameters `json:"properties,omitempty"` 4511} 4512 4513// MarshalJSON is the custom marshaler for ConnectionMonitor. 4514func (cm ConnectionMonitor) MarshalJSON() ([]byte, error) { 4515 objectMap := make(map[string]interface{}) 4516 if cm.Location != nil { 4517 objectMap["location"] = cm.Location 4518 } 4519 if cm.Tags != nil { 4520 objectMap["tags"] = cm.Tags 4521 } 4522 if cm.ConnectionMonitorParameters != nil { 4523 objectMap["properties"] = cm.ConnectionMonitorParameters 4524 } 4525 return json.Marshal(objectMap) 4526} 4527 4528// UnmarshalJSON is the custom unmarshaler for ConnectionMonitor struct. 4529func (cm *ConnectionMonitor) UnmarshalJSON(body []byte) error { 4530 var m map[string]*json.RawMessage 4531 err := json.Unmarshal(body, &m) 4532 if err != nil { 4533 return err 4534 } 4535 for k, v := range m { 4536 switch k { 4537 case "location": 4538 if v != nil { 4539 var location string 4540 err = json.Unmarshal(*v, &location) 4541 if err != nil { 4542 return err 4543 } 4544 cm.Location = &location 4545 } 4546 case "tags": 4547 if v != nil { 4548 var tags map[string]*string 4549 err = json.Unmarshal(*v, &tags) 4550 if err != nil { 4551 return err 4552 } 4553 cm.Tags = tags 4554 } 4555 case "properties": 4556 if v != nil { 4557 var connectionMonitorParameters ConnectionMonitorParameters 4558 err = json.Unmarshal(*v, &connectionMonitorParameters) 4559 if err != nil { 4560 return err 4561 } 4562 cm.ConnectionMonitorParameters = &connectionMonitorParameters 4563 } 4564 } 4565 } 4566 4567 return nil 4568} 4569 4570// ConnectionMonitorDestination describes the destination of connection monitor. 4571type ConnectionMonitorDestination struct { 4572 // ResourceID - The ID of the resource used as the destination by connection monitor. 4573 ResourceID *string `json:"resourceId,omitempty"` 4574 // Address - Address of the connection monitor destination (IP or domain name). 4575 Address *string `json:"address,omitempty"` 4576 // Port - The destination port used by connection monitor. 4577 Port *int32 `json:"port,omitempty"` 4578} 4579 4580// ConnectionMonitorListResult list of connection monitors. 4581type ConnectionMonitorListResult struct { 4582 autorest.Response `json:"-"` 4583 // Value - Information about connection monitors. 4584 Value *[]ConnectionMonitorResult `json:"value,omitempty"` 4585} 4586 4587// ConnectionMonitorParameters parameters that define the operation to create a connection monitor. 4588type ConnectionMonitorParameters struct { 4589 Source *ConnectionMonitorSource `json:"source,omitempty"` 4590 Destination *ConnectionMonitorDestination `json:"destination,omitempty"` 4591 // AutoStart - Determines if the connection monitor will start automatically once created. 4592 AutoStart *bool `json:"autoStart,omitempty"` 4593 // MonitoringIntervalInSeconds - Monitoring interval in seconds. 4594 MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` 4595} 4596 4597// ConnectionMonitorQueryResult list of connection states snapshots. 4598type ConnectionMonitorQueryResult struct { 4599 autorest.Response `json:"-"` 4600 // SourceStatus - Status of connection monitor source. Possible values include: 'Uknown', 'Active', 'Inactive' 4601 SourceStatus ConnectionMonitorSourceStatus `json:"sourceStatus,omitempty"` 4602 // States - Information about connection states. 4603 States *[]ConnectionStateSnapshot `json:"states,omitempty"` 4604} 4605 4606// ConnectionMonitorResult information about the connection monitor. 4607type ConnectionMonitorResult struct { 4608 autorest.Response `json:"-"` 4609 // Name - READ-ONLY; Name of the connection monitor. 4610 Name *string `json:"name,omitempty"` 4611 // ID - READ-ONLY; ID of the connection monitor. 4612 ID *string `json:"id,omitempty"` 4613 Etag *string `json:"etag,omitempty"` 4614 // Type - READ-ONLY; Connection monitor type. 4615 Type *string `json:"type,omitempty"` 4616 // Location - Connection monitor location. 4617 Location *string `json:"location,omitempty"` 4618 // Tags - Connection monitor tags. 4619 Tags map[string]*string `json:"tags"` 4620 *ConnectionMonitorResultProperties `json:"properties,omitempty"` 4621} 4622 4623// MarshalJSON is the custom marshaler for ConnectionMonitorResult. 4624func (cmr ConnectionMonitorResult) MarshalJSON() ([]byte, error) { 4625 objectMap := make(map[string]interface{}) 4626 if cmr.Etag != nil { 4627 objectMap["etag"] = cmr.Etag 4628 } 4629 if cmr.Location != nil { 4630 objectMap["location"] = cmr.Location 4631 } 4632 if cmr.Tags != nil { 4633 objectMap["tags"] = cmr.Tags 4634 } 4635 if cmr.ConnectionMonitorResultProperties != nil { 4636 objectMap["properties"] = cmr.ConnectionMonitorResultProperties 4637 } 4638 return json.Marshal(objectMap) 4639} 4640 4641// UnmarshalJSON is the custom unmarshaler for ConnectionMonitorResult struct. 4642func (cmr *ConnectionMonitorResult) UnmarshalJSON(body []byte) error { 4643 var m map[string]*json.RawMessage 4644 err := json.Unmarshal(body, &m) 4645 if err != nil { 4646 return err 4647 } 4648 for k, v := range m { 4649 switch k { 4650 case "name": 4651 if v != nil { 4652 var name string 4653 err = json.Unmarshal(*v, &name) 4654 if err != nil { 4655 return err 4656 } 4657 cmr.Name = &name 4658 } 4659 case "id": 4660 if v != nil { 4661 var ID string 4662 err = json.Unmarshal(*v, &ID) 4663 if err != nil { 4664 return err 4665 } 4666 cmr.ID = &ID 4667 } 4668 case "etag": 4669 if v != nil { 4670 var etag string 4671 err = json.Unmarshal(*v, &etag) 4672 if err != nil { 4673 return err 4674 } 4675 cmr.Etag = &etag 4676 } 4677 case "type": 4678 if v != nil { 4679 var typeVar string 4680 err = json.Unmarshal(*v, &typeVar) 4681 if err != nil { 4682 return err 4683 } 4684 cmr.Type = &typeVar 4685 } 4686 case "location": 4687 if v != nil { 4688 var location string 4689 err = json.Unmarshal(*v, &location) 4690 if err != nil { 4691 return err 4692 } 4693 cmr.Location = &location 4694 } 4695 case "tags": 4696 if v != nil { 4697 var tags map[string]*string 4698 err = json.Unmarshal(*v, &tags) 4699 if err != nil { 4700 return err 4701 } 4702 cmr.Tags = tags 4703 } 4704 case "properties": 4705 if v != nil { 4706 var connectionMonitorResultProperties ConnectionMonitorResultProperties 4707 err = json.Unmarshal(*v, &connectionMonitorResultProperties) 4708 if err != nil { 4709 return err 4710 } 4711 cmr.ConnectionMonitorResultProperties = &connectionMonitorResultProperties 4712 } 4713 } 4714 } 4715 4716 return nil 4717} 4718 4719// ConnectionMonitorResultProperties describes the properties of a connection monitor. 4720type ConnectionMonitorResultProperties struct { 4721 // ProvisioningState - The provisioning state of the connection monitor. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 4722 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 4723 // StartTime - The date and time when the connection monitor was started. 4724 StartTime *date.Time `json:"startTime,omitempty"` 4725 // MonitoringStatus - The monitoring status of the connection monitor. 4726 MonitoringStatus *string `json:"monitoringStatus,omitempty"` 4727 Source *ConnectionMonitorSource `json:"source,omitempty"` 4728 Destination *ConnectionMonitorDestination `json:"destination,omitempty"` 4729 // AutoStart - Determines if the connection monitor will start automatically once created. 4730 AutoStart *bool `json:"autoStart,omitempty"` 4731 // MonitoringIntervalInSeconds - Monitoring interval in seconds. 4732 MonitoringIntervalInSeconds *int32 `json:"monitoringIntervalInSeconds,omitempty"` 4733} 4734 4735// ConnectionMonitorsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4736// long-running operation. 4737type ConnectionMonitorsCreateOrUpdateFuture struct { 4738 azure.FutureAPI 4739 // Result returns the result of the asynchronous operation. 4740 // If the operation has not completed it will return an error. 4741 Result func(ConnectionMonitorsClient) (ConnectionMonitorResult, error) 4742} 4743 4744// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4745func (future *ConnectionMonitorsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4746 var azFuture azure.Future 4747 if err := json.Unmarshal(body, &azFuture); err != nil { 4748 return err 4749 } 4750 future.FutureAPI = &azFuture 4751 future.Result = future.result 4752 return nil 4753} 4754 4755// result is the default implementation for ConnectionMonitorsCreateOrUpdateFuture.Result. 4756func (future *ConnectionMonitorsCreateOrUpdateFuture) result(client ConnectionMonitorsClient) (cmr ConnectionMonitorResult, err error) { 4757 var done bool 4758 done, err = future.DoneWithContext(context.Background(), client) 4759 if err != nil { 4760 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4761 return 4762 } 4763 if !done { 4764 cmr.Response.Response = future.Response() 4765 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsCreateOrUpdateFuture") 4766 return 4767 } 4768 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4769 if cmr.Response.Response, err = future.GetResult(sender); err == nil && cmr.Response.Response.StatusCode != http.StatusNoContent { 4770 cmr, err = client.CreateOrUpdateResponder(cmr.Response.Response) 4771 if err != nil { 4772 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsCreateOrUpdateFuture", "Result", cmr.Response.Response, "Failure responding to request") 4773 } 4774 } 4775 return 4776} 4777 4778// ConnectionMonitorsDeleteFuture an abstraction for monitoring and retrieving the results of a 4779// long-running operation. 4780type ConnectionMonitorsDeleteFuture struct { 4781 azure.FutureAPI 4782 // Result returns the result of the asynchronous operation. 4783 // If the operation has not completed it will return an error. 4784 Result func(ConnectionMonitorsClient) (autorest.Response, error) 4785} 4786 4787// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4788func (future *ConnectionMonitorsDeleteFuture) UnmarshalJSON(body []byte) error { 4789 var azFuture azure.Future 4790 if err := json.Unmarshal(body, &azFuture); err != nil { 4791 return err 4792 } 4793 future.FutureAPI = &azFuture 4794 future.Result = future.result 4795 return nil 4796} 4797 4798// result is the default implementation for ConnectionMonitorsDeleteFuture.Result. 4799func (future *ConnectionMonitorsDeleteFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { 4800 var done bool 4801 done, err = future.DoneWithContext(context.Background(), client) 4802 if err != nil { 4803 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsDeleteFuture", "Result", future.Response(), "Polling failure") 4804 return 4805 } 4806 if !done { 4807 ar.Response = future.Response() 4808 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsDeleteFuture") 4809 return 4810 } 4811 ar.Response = future.Response() 4812 return 4813} 4814 4815// ConnectionMonitorSource describes the source of connection monitor. 4816type ConnectionMonitorSource struct { 4817 // ResourceID - The ID of the resource used as the source by connection monitor. 4818 ResourceID *string `json:"resourceId,omitempty"` 4819 // Port - The source port used by connection monitor. 4820 Port *int32 `json:"port,omitempty"` 4821} 4822 4823// ConnectionMonitorsQueryFuture an abstraction for monitoring and retrieving the results of a long-running 4824// operation. 4825type ConnectionMonitorsQueryFuture struct { 4826 azure.FutureAPI 4827 // Result returns the result of the asynchronous operation. 4828 // If the operation has not completed it will return an error. 4829 Result func(ConnectionMonitorsClient) (ConnectionMonitorQueryResult, error) 4830} 4831 4832// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4833func (future *ConnectionMonitorsQueryFuture) UnmarshalJSON(body []byte) error { 4834 var azFuture azure.Future 4835 if err := json.Unmarshal(body, &azFuture); err != nil { 4836 return err 4837 } 4838 future.FutureAPI = &azFuture 4839 future.Result = future.result 4840 return nil 4841} 4842 4843// result is the default implementation for ConnectionMonitorsQueryFuture.Result. 4844func (future *ConnectionMonitorsQueryFuture) result(client ConnectionMonitorsClient) (cmqr ConnectionMonitorQueryResult, err error) { 4845 var done bool 4846 done, err = future.DoneWithContext(context.Background(), client) 4847 if err != nil { 4848 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", future.Response(), "Polling failure") 4849 return 4850 } 4851 if !done { 4852 cmqr.Response.Response = future.Response() 4853 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsQueryFuture") 4854 return 4855 } 4856 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4857 if cmqr.Response.Response, err = future.GetResult(sender); err == nil && cmqr.Response.Response.StatusCode != http.StatusNoContent { 4858 cmqr, err = client.QueryResponder(cmqr.Response.Response) 4859 if err != nil { 4860 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsQueryFuture", "Result", cmqr.Response.Response, "Failure responding to request") 4861 } 4862 } 4863 return 4864} 4865 4866// ConnectionMonitorsStartFuture an abstraction for monitoring and retrieving the results of a long-running 4867// operation. 4868type ConnectionMonitorsStartFuture struct { 4869 azure.FutureAPI 4870 // Result returns the result of the asynchronous operation. 4871 // If the operation has not completed it will return an error. 4872 Result func(ConnectionMonitorsClient) (autorest.Response, error) 4873} 4874 4875// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4876func (future *ConnectionMonitorsStartFuture) UnmarshalJSON(body []byte) error { 4877 var azFuture azure.Future 4878 if err := json.Unmarshal(body, &azFuture); err != nil { 4879 return err 4880 } 4881 future.FutureAPI = &azFuture 4882 future.Result = future.result 4883 return nil 4884} 4885 4886// result is the default implementation for ConnectionMonitorsStartFuture.Result. 4887func (future *ConnectionMonitorsStartFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { 4888 var done bool 4889 done, err = future.DoneWithContext(context.Background(), client) 4890 if err != nil { 4891 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStartFuture", "Result", future.Response(), "Polling failure") 4892 return 4893 } 4894 if !done { 4895 ar.Response = future.Response() 4896 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStartFuture") 4897 return 4898 } 4899 ar.Response = future.Response() 4900 return 4901} 4902 4903// ConnectionMonitorsStopFuture an abstraction for monitoring and retrieving the results of a long-running 4904// operation. 4905type ConnectionMonitorsStopFuture struct { 4906 azure.FutureAPI 4907 // Result returns the result of the asynchronous operation. 4908 // If the operation has not completed it will return an error. 4909 Result func(ConnectionMonitorsClient) (autorest.Response, error) 4910} 4911 4912// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4913func (future *ConnectionMonitorsStopFuture) UnmarshalJSON(body []byte) error { 4914 var azFuture azure.Future 4915 if err := json.Unmarshal(body, &azFuture); err != nil { 4916 return err 4917 } 4918 future.FutureAPI = &azFuture 4919 future.Result = future.result 4920 return nil 4921} 4922 4923// result is the default implementation for ConnectionMonitorsStopFuture.Result. 4924func (future *ConnectionMonitorsStopFuture) result(client ConnectionMonitorsClient) (ar autorest.Response, err error) { 4925 var done bool 4926 done, err = future.DoneWithContext(context.Background(), client) 4927 if err != nil { 4928 err = autorest.NewErrorWithError(err, "network.ConnectionMonitorsStopFuture", "Result", future.Response(), "Polling failure") 4929 return 4930 } 4931 if !done { 4932 ar.Response = future.Response() 4933 err = azure.NewAsyncOpIncompleteError("network.ConnectionMonitorsStopFuture") 4934 return 4935 } 4936 ar.Response = future.Response() 4937 return 4938} 4939 4940// ConnectionResetSharedKey the virtual network connection reset shared key 4941type ConnectionResetSharedKey struct { 4942 autorest.Response `json:"-"` 4943 // KeyLength - The virtual network connection reset shared key length, should between 1 and 128. 4944 KeyLength *int32 `json:"keyLength,omitempty"` 4945} 4946 4947// ConnectionSharedKey response for GetConnectionSharedKey API service call 4948type ConnectionSharedKey struct { 4949 autorest.Response `json:"-"` 4950 // Value - The virtual network connection shared key value. 4951 Value *string `json:"value,omitempty"` 4952 // ID - Resource ID. 4953 ID *string `json:"id,omitempty"` 4954} 4955 4956// ConnectionStateSnapshot connection state snapshot. 4957type ConnectionStateSnapshot struct { 4958 // ConnectionState - The connection state. Possible values include: 'ConnectionStateReachable', 'ConnectionStateUnreachable', 'ConnectionStateUnknown' 4959 ConnectionState ConnectionState `json:"connectionState,omitempty"` 4960 // StartTime - The start time of the connection snapshot. 4961 StartTime *date.Time `json:"startTime,omitempty"` 4962 // EndTime - The end time of the connection snapshot. 4963 EndTime *date.Time `json:"endTime,omitempty"` 4964 // EvaluationState - Connectivity analysis evaluation state. Possible values include: 'NotStarted', 'InProgress', 'Completed' 4965 EvaluationState EvaluationState `json:"evaluationState,omitempty"` 4966 // Hops - READ-ONLY; List of hops between the source and the destination. 4967 Hops *[]ConnectivityHop `json:"hops,omitempty"` 4968} 4969 4970// MarshalJSON is the custom marshaler for ConnectionStateSnapshot. 4971func (CSS ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { 4972 objectMap := make(map[string]interface{}) 4973 if CSS.ConnectionState != "" { 4974 objectMap["connectionState"] = CSS.ConnectionState 4975 } 4976 if CSS.StartTime != nil { 4977 objectMap["startTime"] = CSS.StartTime 4978 } 4979 if CSS.EndTime != nil { 4980 objectMap["endTime"] = CSS.EndTime 4981 } 4982 if CSS.EvaluationState != "" { 4983 objectMap["evaluationState"] = CSS.EvaluationState 4984 } 4985 return json.Marshal(objectMap) 4986} 4987 4988// ConnectivityDestination parameters that define destination of connection. 4989type ConnectivityDestination struct { 4990 // ResourceID - The ID of the resource to which a connection attempt will be made. 4991 ResourceID *string `json:"resourceId,omitempty"` 4992 // Address - The IP address or URI the resource to which a connection attempt will be made. 4993 Address *string `json:"address,omitempty"` 4994 // Port - Port on which check connectivity will be performed. 4995 Port *int32 `json:"port,omitempty"` 4996} 4997 4998// ConnectivityHop information about a hop between the source and the destination. 4999type ConnectivityHop struct { 5000 // Type - READ-ONLY; The type of the hop. 5001 Type *string `json:"type,omitempty"` 5002 // ID - READ-ONLY; The ID of the hop. 5003 ID *string `json:"id,omitempty"` 5004 // Address - READ-ONLY; The IP address of the hop. 5005 Address *string `json:"address,omitempty"` 5006 // ResourceID - READ-ONLY; The ID of the resource corresponding to this hop. 5007 ResourceID *string `json:"resourceId,omitempty"` 5008 // NextHopIds - READ-ONLY; List of next hop identifiers. 5009 NextHopIds *[]string `json:"nextHopIds,omitempty"` 5010 // Issues - READ-ONLY; List of issues. 5011 Issues *[]ConnectivityIssue `json:"issues,omitempty"` 5012} 5013 5014// MarshalJSON is the custom marshaler for ConnectivityHop. 5015func (ch ConnectivityHop) MarshalJSON() ([]byte, error) { 5016 objectMap := make(map[string]interface{}) 5017 return json.Marshal(objectMap) 5018} 5019 5020// ConnectivityInformation information on the connectivity status. 5021type ConnectivityInformation struct { 5022 autorest.Response `json:"-"` 5023 // Hops - READ-ONLY; List of hops between the source and the destination. 5024 Hops *[]ConnectivityHop `json:"hops,omitempty"` 5025 // ConnectionStatus - READ-ONLY; The connection status. Possible values include: 'ConnectionStatusUnknown', 'ConnectionStatusConnected', 'ConnectionStatusDisconnected', 'ConnectionStatusDegraded' 5026 ConnectionStatus ConnectionStatus `json:"connectionStatus,omitempty"` 5027 // AvgLatencyInMs - READ-ONLY; Average latency in milliseconds. 5028 AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"` 5029 // MinLatencyInMs - READ-ONLY; Minimum latency in milliseconds. 5030 MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"` 5031 // MaxLatencyInMs - READ-ONLY; Maximum latency in milliseconds. 5032 MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"` 5033 // ProbesSent - READ-ONLY; Total number of probes sent. 5034 ProbesSent *int32 `json:"probesSent,omitempty"` 5035 // ProbesFailed - READ-ONLY; Number of failed probes. 5036 ProbesFailed *int32 `json:"probesFailed,omitempty"` 5037} 5038 5039// MarshalJSON is the custom marshaler for ConnectivityInformation. 5040func (ci ConnectivityInformation) MarshalJSON() ([]byte, error) { 5041 objectMap := make(map[string]interface{}) 5042 return json.Marshal(objectMap) 5043} 5044 5045// ConnectivityIssue information about an issue encountered in the process of checking for connectivity. 5046type ConnectivityIssue struct { 5047 // Origin - READ-ONLY; The origin of the issue. Possible values include: 'OriginLocal', 'OriginInbound', 'OriginOutbound' 5048 Origin Origin `json:"origin,omitempty"` 5049 // Severity - READ-ONLY; The severity of the issue. Possible values include: 'SeverityError', 'SeverityWarning' 5050 Severity Severity `json:"severity,omitempty"` 5051 // Type - READ-ONLY; The type of issue. Possible values include: 'IssueTypeUnknown', 'IssueTypeAgentStopped', 'IssueTypeGuestFirewall', 'IssueTypeDNSResolution', 'IssueTypeSocketBind', 'IssueTypeNetworkSecurityRule', 'IssueTypeUserDefinedRoute', 'IssueTypePortThrottled', 'IssueTypePlatform' 5052 Type IssueType `json:"type,omitempty"` 5053 // Context - READ-ONLY; Provides additional context on the issue. 5054 Context *[]map[string]*string `json:"context,omitempty"` 5055} 5056 5057// MarshalJSON is the custom marshaler for ConnectivityIssue. 5058func (ci ConnectivityIssue) MarshalJSON() ([]byte, error) { 5059 objectMap := make(map[string]interface{}) 5060 return json.Marshal(objectMap) 5061} 5062 5063// ConnectivityParameters parameters that determine how the connectivity check will be performed. 5064type ConnectivityParameters struct { 5065 Source *ConnectivitySource `json:"source,omitempty"` 5066 Destination *ConnectivityDestination `json:"destination,omitempty"` 5067 // Protocol - Network protocol. Possible values include: 'ProtocolTCP', 'ProtocolHTTP', 'ProtocolHTTPS', 'ProtocolIcmp' 5068 Protocol Protocol `json:"protocol,omitempty"` 5069 ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` 5070} 5071 5072// ConnectivitySource parameters that define the source of the connection. 5073type ConnectivitySource struct { 5074 // ResourceID - The ID of the resource from which a connectivity check will be initiated. 5075 ResourceID *string `json:"resourceId,omitempty"` 5076 // Port - The source port from which a connectivity check will be performed. 5077 Port *int32 `json:"port,omitempty"` 5078} 5079 5080// DdosProtectionPlan a DDoS protection plan in a resource group. 5081type DdosProtectionPlan struct { 5082 autorest.Response `json:"-"` 5083 // ID - READ-ONLY; Resource ID. 5084 ID *string `json:"id,omitempty"` 5085 // Name - READ-ONLY; Resource name. 5086 Name *string `json:"name,omitempty"` 5087 // Type - READ-ONLY; Resource type. 5088 Type *string `json:"type,omitempty"` 5089 // Location - Resource location. 5090 Location *string `json:"location,omitempty"` 5091 // Tags - Resource tags. 5092 Tags map[string]*string `json:"tags"` 5093 // DdosProtectionPlanPropertiesFormat - Properties of the DDoS protection plan. 5094 *DdosProtectionPlanPropertiesFormat `json:"properties,omitempty"` 5095 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 5096 Etag *string `json:"etag,omitempty"` 5097} 5098 5099// MarshalJSON is the custom marshaler for DdosProtectionPlan. 5100func (dpp DdosProtectionPlan) MarshalJSON() ([]byte, error) { 5101 objectMap := make(map[string]interface{}) 5102 if dpp.Location != nil { 5103 objectMap["location"] = dpp.Location 5104 } 5105 if dpp.Tags != nil { 5106 objectMap["tags"] = dpp.Tags 5107 } 5108 if dpp.DdosProtectionPlanPropertiesFormat != nil { 5109 objectMap["properties"] = dpp.DdosProtectionPlanPropertiesFormat 5110 } 5111 return json.Marshal(objectMap) 5112} 5113 5114// UnmarshalJSON is the custom unmarshaler for DdosProtectionPlan struct. 5115func (dpp *DdosProtectionPlan) UnmarshalJSON(body []byte) error { 5116 var m map[string]*json.RawMessage 5117 err := json.Unmarshal(body, &m) 5118 if err != nil { 5119 return err 5120 } 5121 for k, v := range m { 5122 switch k { 5123 case "id": 5124 if v != nil { 5125 var ID string 5126 err = json.Unmarshal(*v, &ID) 5127 if err != nil { 5128 return err 5129 } 5130 dpp.ID = &ID 5131 } 5132 case "name": 5133 if v != nil { 5134 var name string 5135 err = json.Unmarshal(*v, &name) 5136 if err != nil { 5137 return err 5138 } 5139 dpp.Name = &name 5140 } 5141 case "type": 5142 if v != nil { 5143 var typeVar string 5144 err = json.Unmarshal(*v, &typeVar) 5145 if err != nil { 5146 return err 5147 } 5148 dpp.Type = &typeVar 5149 } 5150 case "location": 5151 if v != nil { 5152 var location string 5153 err = json.Unmarshal(*v, &location) 5154 if err != nil { 5155 return err 5156 } 5157 dpp.Location = &location 5158 } 5159 case "tags": 5160 if v != nil { 5161 var tags map[string]*string 5162 err = json.Unmarshal(*v, &tags) 5163 if err != nil { 5164 return err 5165 } 5166 dpp.Tags = tags 5167 } 5168 case "properties": 5169 if v != nil { 5170 var ddosProtectionPlanPropertiesFormat DdosProtectionPlanPropertiesFormat 5171 err = json.Unmarshal(*v, &ddosProtectionPlanPropertiesFormat) 5172 if err != nil { 5173 return err 5174 } 5175 dpp.DdosProtectionPlanPropertiesFormat = &ddosProtectionPlanPropertiesFormat 5176 } 5177 case "etag": 5178 if v != nil { 5179 var etag string 5180 err = json.Unmarshal(*v, &etag) 5181 if err != nil { 5182 return err 5183 } 5184 dpp.Etag = &etag 5185 } 5186 } 5187 } 5188 5189 return nil 5190} 5191 5192// DdosProtectionPlanListResult a list of DDoS protection plans. 5193type DdosProtectionPlanListResult struct { 5194 autorest.Response `json:"-"` 5195 // Value - A list of DDoS protection plans. 5196 Value *[]DdosProtectionPlan `json:"value,omitempty"` 5197 // NextLink - READ-ONLY; The URL to get the next set of results. 5198 NextLink *string `json:"nextLink,omitempty"` 5199} 5200 5201// MarshalJSON is the custom marshaler for DdosProtectionPlanListResult. 5202func (dpplr DdosProtectionPlanListResult) MarshalJSON() ([]byte, error) { 5203 objectMap := make(map[string]interface{}) 5204 if dpplr.Value != nil { 5205 objectMap["value"] = dpplr.Value 5206 } 5207 return json.Marshal(objectMap) 5208} 5209 5210// DdosProtectionPlanListResultIterator provides access to a complete listing of DdosProtectionPlan values. 5211type DdosProtectionPlanListResultIterator struct { 5212 i int 5213 page DdosProtectionPlanListResultPage 5214} 5215 5216// NextWithContext advances to the next value. If there was an error making 5217// the request the iterator does not advance and the error is returned. 5218func (iter *DdosProtectionPlanListResultIterator) NextWithContext(ctx context.Context) (err error) { 5219 if tracing.IsEnabled() { 5220 ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultIterator.NextWithContext") 5221 defer func() { 5222 sc := -1 5223 if iter.Response().Response.Response != nil { 5224 sc = iter.Response().Response.Response.StatusCode 5225 } 5226 tracing.EndSpan(ctx, sc, err) 5227 }() 5228 } 5229 iter.i++ 5230 if iter.i < len(iter.page.Values()) { 5231 return nil 5232 } 5233 err = iter.page.NextWithContext(ctx) 5234 if err != nil { 5235 iter.i-- 5236 return err 5237 } 5238 iter.i = 0 5239 return nil 5240} 5241 5242// Next advances to the next value. If there was an error making 5243// the request the iterator does not advance and the error is returned. 5244// Deprecated: Use NextWithContext() instead. 5245func (iter *DdosProtectionPlanListResultIterator) Next() error { 5246 return iter.NextWithContext(context.Background()) 5247} 5248 5249// NotDone returns true if the enumeration should be started or is not yet complete. 5250func (iter DdosProtectionPlanListResultIterator) NotDone() bool { 5251 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5252} 5253 5254// Response returns the raw server response from the last page request. 5255func (iter DdosProtectionPlanListResultIterator) Response() DdosProtectionPlanListResult { 5256 return iter.page.Response() 5257} 5258 5259// Value returns the current value or a zero-initialized value if the 5260// iterator has advanced beyond the end of the collection. 5261func (iter DdosProtectionPlanListResultIterator) Value() DdosProtectionPlan { 5262 if !iter.page.NotDone() { 5263 return DdosProtectionPlan{} 5264 } 5265 return iter.page.Values()[iter.i] 5266} 5267 5268// Creates a new instance of the DdosProtectionPlanListResultIterator type. 5269func NewDdosProtectionPlanListResultIterator(page DdosProtectionPlanListResultPage) DdosProtectionPlanListResultIterator { 5270 return DdosProtectionPlanListResultIterator{page: page} 5271} 5272 5273// IsEmpty returns true if the ListResult contains no values. 5274func (dpplr DdosProtectionPlanListResult) IsEmpty() bool { 5275 return dpplr.Value == nil || len(*dpplr.Value) == 0 5276} 5277 5278// hasNextLink returns true if the NextLink is not empty. 5279func (dpplr DdosProtectionPlanListResult) hasNextLink() bool { 5280 return dpplr.NextLink != nil && len(*dpplr.NextLink) != 0 5281} 5282 5283// ddosProtectionPlanListResultPreparer prepares a request to retrieve the next set of results. 5284// It returns nil if no more results exist. 5285func (dpplr DdosProtectionPlanListResult) ddosProtectionPlanListResultPreparer(ctx context.Context) (*http.Request, error) { 5286 if !dpplr.hasNextLink() { 5287 return nil, nil 5288 } 5289 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5290 autorest.AsJSON(), 5291 autorest.AsGet(), 5292 autorest.WithBaseURL(to.String(dpplr.NextLink))) 5293} 5294 5295// DdosProtectionPlanListResultPage contains a page of DdosProtectionPlan values. 5296type DdosProtectionPlanListResultPage struct { 5297 fn func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error) 5298 dpplr DdosProtectionPlanListResult 5299} 5300 5301// NextWithContext advances to the next page of values. If there was an error making 5302// the request the page does not advance and the error is returned. 5303func (page *DdosProtectionPlanListResultPage) NextWithContext(ctx context.Context) (err error) { 5304 if tracing.IsEnabled() { 5305 ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlanListResultPage.NextWithContext") 5306 defer func() { 5307 sc := -1 5308 if page.Response().Response.Response != nil { 5309 sc = page.Response().Response.Response.StatusCode 5310 } 5311 tracing.EndSpan(ctx, sc, err) 5312 }() 5313 } 5314 for { 5315 next, err := page.fn(ctx, page.dpplr) 5316 if err != nil { 5317 return err 5318 } 5319 page.dpplr = next 5320 if !next.hasNextLink() || !next.IsEmpty() { 5321 break 5322 } 5323 } 5324 return nil 5325} 5326 5327// Next advances to the next page of values. If there was an error making 5328// the request the page does not advance and the error is returned. 5329// Deprecated: Use NextWithContext() instead. 5330func (page *DdosProtectionPlanListResultPage) Next() error { 5331 return page.NextWithContext(context.Background()) 5332} 5333 5334// NotDone returns true if the page enumeration should be started or is not yet complete. 5335func (page DdosProtectionPlanListResultPage) NotDone() bool { 5336 return !page.dpplr.IsEmpty() 5337} 5338 5339// Response returns the raw server response from the last page request. 5340func (page DdosProtectionPlanListResultPage) Response() DdosProtectionPlanListResult { 5341 return page.dpplr 5342} 5343 5344// Values returns the slice of values for the current page or nil if there are no values. 5345func (page DdosProtectionPlanListResultPage) Values() []DdosProtectionPlan { 5346 if page.dpplr.IsEmpty() { 5347 return nil 5348 } 5349 return *page.dpplr.Value 5350} 5351 5352// Creates a new instance of the DdosProtectionPlanListResultPage type. 5353func NewDdosProtectionPlanListResultPage(cur DdosProtectionPlanListResult, getNextPage func(context.Context, DdosProtectionPlanListResult) (DdosProtectionPlanListResult, error)) DdosProtectionPlanListResultPage { 5354 return DdosProtectionPlanListResultPage{ 5355 fn: getNextPage, 5356 dpplr: cur, 5357 } 5358} 5359 5360// DdosProtectionPlanPropertiesFormat dDoS protection plan properties. 5361type DdosProtectionPlanPropertiesFormat struct { 5362 // ResourceGUID - READ-ONLY; The resource GUID property of the DDoS protection plan resource. It uniquely identifies the resource, even if the user changes its name or migrate the resource across subscriptions or resource groups. 5363 ResourceGUID *string `json:"resourceGuid,omitempty"` 5364 // ProvisioningState - READ-ONLY; The provisioning state of the DDoS protection plan resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. 5365 ProvisioningState *string `json:"provisioningState,omitempty"` 5366 // VirtualNetworks - READ-ONLY; The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. 5367 VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` 5368} 5369 5370// MarshalJSON is the custom marshaler for DdosProtectionPlanPropertiesFormat. 5371func (dpppf DdosProtectionPlanPropertiesFormat) MarshalJSON() ([]byte, error) { 5372 objectMap := make(map[string]interface{}) 5373 return json.Marshal(objectMap) 5374} 5375 5376// DdosProtectionPlansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5377// long-running operation. 5378type DdosProtectionPlansCreateOrUpdateFuture struct { 5379 azure.FutureAPI 5380 // Result returns the result of the asynchronous operation. 5381 // If the operation has not completed it will return an error. 5382 Result func(DdosProtectionPlansClient) (DdosProtectionPlan, error) 5383} 5384 5385// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5386func (future *DdosProtectionPlansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5387 var azFuture azure.Future 5388 if err := json.Unmarshal(body, &azFuture); err != nil { 5389 return err 5390 } 5391 future.FutureAPI = &azFuture 5392 future.Result = future.result 5393 return nil 5394} 5395 5396// result is the default implementation for DdosProtectionPlansCreateOrUpdateFuture.Result. 5397func (future *DdosProtectionPlansCreateOrUpdateFuture) result(client DdosProtectionPlansClient) (dpp DdosProtectionPlan, err error) { 5398 var done bool 5399 done, err = future.DoneWithContext(context.Background(), client) 5400 if err != nil { 5401 err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5402 return 5403 } 5404 if !done { 5405 dpp.Response.Response = future.Response() 5406 err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansCreateOrUpdateFuture") 5407 return 5408 } 5409 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5410 if dpp.Response.Response, err = future.GetResult(sender); err == nil && dpp.Response.Response.StatusCode != http.StatusNoContent { 5411 dpp, err = client.CreateOrUpdateResponder(dpp.Response.Response) 5412 if err != nil { 5413 err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansCreateOrUpdateFuture", "Result", dpp.Response.Response, "Failure responding to request") 5414 } 5415 } 5416 return 5417} 5418 5419// DdosProtectionPlansDeleteFuture an abstraction for monitoring and retrieving the results of a 5420// long-running operation. 5421type DdosProtectionPlansDeleteFuture struct { 5422 azure.FutureAPI 5423 // Result returns the result of the asynchronous operation. 5424 // If the operation has not completed it will return an error. 5425 Result func(DdosProtectionPlansClient) (autorest.Response, error) 5426} 5427 5428// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5429func (future *DdosProtectionPlansDeleteFuture) UnmarshalJSON(body []byte) error { 5430 var azFuture azure.Future 5431 if err := json.Unmarshal(body, &azFuture); err != nil { 5432 return err 5433 } 5434 future.FutureAPI = &azFuture 5435 future.Result = future.result 5436 return nil 5437} 5438 5439// result is the default implementation for DdosProtectionPlansDeleteFuture.Result. 5440func (future *DdosProtectionPlansDeleteFuture) result(client DdosProtectionPlansClient) (ar autorest.Response, err error) { 5441 var done bool 5442 done, err = future.DoneWithContext(context.Background(), client) 5443 if err != nil { 5444 err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansDeleteFuture", "Result", future.Response(), "Polling failure") 5445 return 5446 } 5447 if !done { 5448 ar.Response = future.Response() 5449 err = azure.NewAsyncOpIncompleteError("network.DdosProtectionPlansDeleteFuture") 5450 return 5451 } 5452 ar.Response = future.Response() 5453 return 5454} 5455 5456// DeviceProperties list of properties of the device. 5457type DeviceProperties struct { 5458 // DeviceVendor - Name of the device Vendor. 5459 DeviceVendor *string `json:"deviceVendor,omitempty"` 5460 // DeviceModel - Model of the device. 5461 DeviceModel *string `json:"deviceModel,omitempty"` 5462 // LinkSpeedInMbps - Link speed. 5463 LinkSpeedInMbps *int32 `json:"linkSpeedInMbps,omitempty"` 5464} 5465 5466// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual 5467// network. Standard DHCP option for a subnet overrides VNET DHCP options. 5468type DhcpOptions struct { 5469 // DNSServers - The list of DNS servers IP addresses. 5470 DNSServers *[]string `json:"dnsServers,omitempty"` 5471} 5472 5473// Dimension dimension of the metric. 5474type Dimension struct { 5475 // Name - The name of the dimension. 5476 Name *string `json:"name,omitempty"` 5477 // DisplayName - The display name of the dimension. 5478 DisplayName *string `json:"displayName,omitempty"` 5479 // InternalName - The internal name of the dimension. 5480 InternalName *string `json:"internalName,omitempty"` 5481} 5482 5483// DNSNameAvailabilityResult response for the CheckDnsNameAvailability API service call. 5484type DNSNameAvailabilityResult struct { 5485 autorest.Response `json:"-"` 5486 // Available - Domain availability (True/False). 5487 Available *bool `json:"available,omitempty"` 5488} 5489 5490// EffectiveNetworkSecurityGroup effective network security group. 5491type EffectiveNetworkSecurityGroup struct { 5492 // NetworkSecurityGroup - The ID of network security group that is applied. 5493 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 5494 // Association - Associated resources. 5495 Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` 5496 // EffectiveSecurityRules - A collection of effective security rules. 5497 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` 5498 // TagMap - Mapping of tags to list of IP Addresses included within the tag. 5499 TagMap map[string][]string `json:"tagMap"` 5500} 5501 5502// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroup. 5503func (ensg EffectiveNetworkSecurityGroup) MarshalJSON() ([]byte, error) { 5504 objectMap := make(map[string]interface{}) 5505 if ensg.NetworkSecurityGroup != nil { 5506 objectMap["networkSecurityGroup"] = ensg.NetworkSecurityGroup 5507 } 5508 if ensg.Association != nil { 5509 objectMap["association"] = ensg.Association 5510 } 5511 if ensg.EffectiveSecurityRules != nil { 5512 objectMap["effectiveSecurityRules"] = ensg.EffectiveSecurityRules 5513 } 5514 if ensg.TagMap != nil { 5515 objectMap["tagMap"] = ensg.TagMap 5516 } 5517 return json.Marshal(objectMap) 5518} 5519 5520// EffectiveNetworkSecurityGroupAssociation the effective network security group association. 5521type EffectiveNetworkSecurityGroupAssociation struct { 5522 // Subnet - The ID of the subnet if assigned. 5523 Subnet *SubResource `json:"subnet,omitempty"` 5524 // NetworkInterface - The ID of the network interface if assigned. 5525 NetworkInterface *SubResource `json:"networkInterface,omitempty"` 5526} 5527 5528// EffectiveNetworkSecurityGroupListResult response for list effective network security groups API service 5529// call. 5530type EffectiveNetworkSecurityGroupListResult struct { 5531 autorest.Response `json:"-"` 5532 // Value - A list of effective network security groups. 5533 Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"` 5534 // NextLink - READ-ONLY; The URL to get the next set of results. 5535 NextLink *string `json:"nextLink,omitempty"` 5536} 5537 5538// MarshalJSON is the custom marshaler for EffectiveNetworkSecurityGroupListResult. 5539func (ensglr EffectiveNetworkSecurityGroupListResult) MarshalJSON() ([]byte, error) { 5540 objectMap := make(map[string]interface{}) 5541 if ensglr.Value != nil { 5542 objectMap["value"] = ensglr.Value 5543 } 5544 return json.Marshal(objectMap) 5545} 5546 5547// EffectiveNetworkSecurityRule effective network security rules. 5548type EffectiveNetworkSecurityRule struct { 5549 // Name - The name of the security rule specified by the user (if created by the user). 5550 Name *string `json:"name,omitempty"` 5551 // Protocol - The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. Possible values include: 'EffectiveSecurityRuleProtocolTCP', 'EffectiveSecurityRuleProtocolUDP', 'EffectiveSecurityRuleProtocolAll' 5552 Protocol EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` 5553 // SourcePortRange - The source port or range. 5554 SourcePortRange *string `json:"sourcePortRange,omitempty"` 5555 // DestinationPortRange - The destination port or range. 5556 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 5557 // SourcePortRanges - The source port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*) 5558 SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` 5559 // DestinationPortRanges - The destination port ranges. Expected values include a single integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*) 5560 DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` 5561 // SourceAddressPrefix - The source address prefix. 5562 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 5563 // DestinationAddressPrefix - The destination address prefix. 5564 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 5565 // SourceAddressPrefixes - The source address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). 5566 SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` 5567 // DestinationAddressPrefixes - The destination address prefixes. Expected values include CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the asterisk (*). 5568 DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` 5569 // ExpandedSourceAddressPrefix - The expanded source address prefix. 5570 ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` 5571 // ExpandedDestinationAddressPrefix - Expanded destination address prefix. 5572 ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` 5573 // Access - Whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' 5574 Access SecurityRuleAccess `json:"access,omitempty"` 5575 // Priority - The priority of the rule. 5576 Priority *int32 `json:"priority,omitempty"` 5577 // Direction - The direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' 5578 Direction SecurityRuleDirection `json:"direction,omitempty"` 5579} 5580 5581// EffectiveRoute effective Route 5582type EffectiveRoute struct { 5583 // Name - The name of the user defined route. This is optional. 5584 Name *string `json:"name,omitempty"` 5585 // Source - Who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault' 5586 Source EffectiveRouteSource `json:"source,omitempty"` 5587 // State - The value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'EffectiveRouteStateActive', 'EffectiveRouteStateInvalid' 5588 State EffectiveRouteState `json:"state,omitempty"` 5589 // AddressPrefix - The address prefixes of the effective routes in CIDR notation. 5590 AddressPrefix *[]string `json:"addressPrefix,omitempty"` 5591 // NextHopIPAddress - The IP address of the next hop of the effective route. 5592 NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"` 5593 // NextHopType - The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'RouteNextHopTypeVirtualNetworkGateway', 'RouteNextHopTypeVnetLocal', 'RouteNextHopTypeInternet', 'RouteNextHopTypeVirtualAppliance', 'RouteNextHopTypeNone' 5594 NextHopType RouteNextHopType `json:"nextHopType,omitempty"` 5595} 5596 5597// EffectiveRouteListResult response for list effective route API service call. 5598type EffectiveRouteListResult struct { 5599 autorest.Response `json:"-"` 5600 // Value - A list of effective routes. 5601 Value *[]EffectiveRoute `json:"value,omitempty"` 5602 // NextLink - READ-ONLY; The URL to get the next set of results. 5603 NextLink *string `json:"nextLink,omitempty"` 5604} 5605 5606// MarshalJSON is the custom marshaler for EffectiveRouteListResult. 5607func (erlr EffectiveRouteListResult) MarshalJSON() ([]byte, error) { 5608 objectMap := make(map[string]interface{}) 5609 if erlr.Value != nil { 5610 objectMap["value"] = erlr.Value 5611 } 5612 return json.Marshal(objectMap) 5613} 5614 5615// EndpointServiceResult endpoint service. 5616type EndpointServiceResult struct { 5617 // Name - READ-ONLY; Name of the endpoint service. 5618 Name *string `json:"name,omitempty"` 5619 // Type - READ-ONLY; Type of the endpoint service. 5620 Type *string `json:"type,omitempty"` 5621 // ID - Resource ID. 5622 ID *string `json:"id,omitempty"` 5623} 5624 5625// MarshalJSON is the custom marshaler for EndpointServiceResult. 5626func (esr EndpointServiceResult) MarshalJSON() ([]byte, error) { 5627 objectMap := make(map[string]interface{}) 5628 if esr.ID != nil { 5629 objectMap["id"] = esr.ID 5630 } 5631 return json.Marshal(objectMap) 5632} 5633 5634// EndpointServicesListResult response for the ListAvailableEndpointServices API service call. 5635type EndpointServicesListResult struct { 5636 autorest.Response `json:"-"` 5637 // Value - List of available endpoint services in a region. 5638 Value *[]EndpointServiceResult `json:"value,omitempty"` 5639 // NextLink - The URL to get the next set of results. 5640 NextLink *string `json:"nextLink,omitempty"` 5641} 5642 5643// EndpointServicesListResultIterator provides access to a complete listing of EndpointServiceResult 5644// values. 5645type EndpointServicesListResultIterator struct { 5646 i int 5647 page EndpointServicesListResultPage 5648} 5649 5650// NextWithContext advances to the next value. If there was an error making 5651// the request the iterator does not advance and the error is returned. 5652func (iter *EndpointServicesListResultIterator) NextWithContext(ctx context.Context) (err error) { 5653 if tracing.IsEnabled() { 5654 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultIterator.NextWithContext") 5655 defer func() { 5656 sc := -1 5657 if iter.Response().Response.Response != nil { 5658 sc = iter.Response().Response.Response.StatusCode 5659 } 5660 tracing.EndSpan(ctx, sc, err) 5661 }() 5662 } 5663 iter.i++ 5664 if iter.i < len(iter.page.Values()) { 5665 return nil 5666 } 5667 err = iter.page.NextWithContext(ctx) 5668 if err != nil { 5669 iter.i-- 5670 return err 5671 } 5672 iter.i = 0 5673 return nil 5674} 5675 5676// Next advances to the next value. If there was an error making 5677// the request the iterator does not advance and the error is returned. 5678// Deprecated: Use NextWithContext() instead. 5679func (iter *EndpointServicesListResultIterator) Next() error { 5680 return iter.NextWithContext(context.Background()) 5681} 5682 5683// NotDone returns true if the enumeration should be started or is not yet complete. 5684func (iter EndpointServicesListResultIterator) NotDone() bool { 5685 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5686} 5687 5688// Response returns the raw server response from the last page request. 5689func (iter EndpointServicesListResultIterator) Response() EndpointServicesListResult { 5690 return iter.page.Response() 5691} 5692 5693// Value returns the current value or a zero-initialized value if the 5694// iterator has advanced beyond the end of the collection. 5695func (iter EndpointServicesListResultIterator) Value() EndpointServiceResult { 5696 if !iter.page.NotDone() { 5697 return EndpointServiceResult{} 5698 } 5699 return iter.page.Values()[iter.i] 5700} 5701 5702// Creates a new instance of the EndpointServicesListResultIterator type. 5703func NewEndpointServicesListResultIterator(page EndpointServicesListResultPage) EndpointServicesListResultIterator { 5704 return EndpointServicesListResultIterator{page: page} 5705} 5706 5707// IsEmpty returns true if the ListResult contains no values. 5708func (eslr EndpointServicesListResult) IsEmpty() bool { 5709 return eslr.Value == nil || len(*eslr.Value) == 0 5710} 5711 5712// hasNextLink returns true if the NextLink is not empty. 5713func (eslr EndpointServicesListResult) hasNextLink() bool { 5714 return eslr.NextLink != nil && len(*eslr.NextLink) != 0 5715} 5716 5717// endpointServicesListResultPreparer prepares a request to retrieve the next set of results. 5718// It returns nil if no more results exist. 5719func (eslr EndpointServicesListResult) endpointServicesListResultPreparer(ctx context.Context) (*http.Request, error) { 5720 if !eslr.hasNextLink() { 5721 return nil, nil 5722 } 5723 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5724 autorest.AsJSON(), 5725 autorest.AsGet(), 5726 autorest.WithBaseURL(to.String(eslr.NextLink))) 5727} 5728 5729// EndpointServicesListResultPage contains a page of EndpointServiceResult values. 5730type EndpointServicesListResultPage struct { 5731 fn func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error) 5732 eslr EndpointServicesListResult 5733} 5734 5735// NextWithContext advances to the next page of values. If there was an error making 5736// the request the page does not advance and the error is returned. 5737func (page *EndpointServicesListResultPage) NextWithContext(ctx context.Context) (err error) { 5738 if tracing.IsEnabled() { 5739 ctx = tracing.StartSpan(ctx, fqdn+"/EndpointServicesListResultPage.NextWithContext") 5740 defer func() { 5741 sc := -1 5742 if page.Response().Response.Response != nil { 5743 sc = page.Response().Response.Response.StatusCode 5744 } 5745 tracing.EndSpan(ctx, sc, err) 5746 }() 5747 } 5748 for { 5749 next, err := page.fn(ctx, page.eslr) 5750 if err != nil { 5751 return err 5752 } 5753 page.eslr = next 5754 if !next.hasNextLink() || !next.IsEmpty() { 5755 break 5756 } 5757 } 5758 return nil 5759} 5760 5761// Next advances to the next page of values. If there was an error making 5762// the request the page does not advance and the error is returned. 5763// Deprecated: Use NextWithContext() instead. 5764func (page *EndpointServicesListResultPage) Next() error { 5765 return page.NextWithContext(context.Background()) 5766} 5767 5768// NotDone returns true if the page enumeration should be started or is not yet complete. 5769func (page EndpointServicesListResultPage) NotDone() bool { 5770 return !page.eslr.IsEmpty() 5771} 5772 5773// Response returns the raw server response from the last page request. 5774func (page EndpointServicesListResultPage) Response() EndpointServicesListResult { 5775 return page.eslr 5776} 5777 5778// Values returns the slice of values for the current page or nil if there are no values. 5779func (page EndpointServicesListResultPage) Values() []EndpointServiceResult { 5780 if page.eslr.IsEmpty() { 5781 return nil 5782 } 5783 return *page.eslr.Value 5784} 5785 5786// Creates a new instance of the EndpointServicesListResultPage type. 5787func NewEndpointServicesListResultPage(cur EndpointServicesListResult, getNextPage func(context.Context, EndpointServicesListResult) (EndpointServicesListResult, error)) EndpointServicesListResultPage { 5788 return EndpointServicesListResultPage{ 5789 fn: getNextPage, 5790 eslr: cur, 5791 } 5792} 5793 5794// Error ... 5795type Error struct { 5796 Code *string `json:"code,omitempty"` 5797 Message *string `json:"message,omitempty"` 5798 Target *string `json:"target,omitempty"` 5799 Details *[]ErrorDetails `json:"details,omitempty"` 5800 InnerError *string `json:"innerError,omitempty"` 5801} 5802 5803// ErrorDetails ... 5804type ErrorDetails struct { 5805 Code *string `json:"code,omitempty"` 5806 Target *string `json:"target,omitempty"` 5807 Message *string `json:"message,omitempty"` 5808} 5809 5810// ExpressRouteCircuit expressRouteCircuit resource 5811type ExpressRouteCircuit struct { 5812 autorest.Response `json:"-"` 5813 // Sku - The SKU. 5814 Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` 5815 *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` 5816 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 5817 Etag *string `json:"etag,omitempty"` 5818 // ID - Resource ID. 5819 ID *string `json:"id,omitempty"` 5820 // Name - READ-ONLY; Resource name. 5821 Name *string `json:"name,omitempty"` 5822 // Type - READ-ONLY; Resource type. 5823 Type *string `json:"type,omitempty"` 5824 // Location - Resource location. 5825 Location *string `json:"location,omitempty"` 5826 // Tags - Resource tags. 5827 Tags map[string]*string `json:"tags"` 5828} 5829 5830// MarshalJSON is the custom marshaler for ExpressRouteCircuit. 5831func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) { 5832 objectMap := make(map[string]interface{}) 5833 if erc.Sku != nil { 5834 objectMap["sku"] = erc.Sku 5835 } 5836 if erc.ExpressRouteCircuitPropertiesFormat != nil { 5837 objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat 5838 } 5839 if erc.ID != nil { 5840 objectMap["id"] = erc.ID 5841 } 5842 if erc.Location != nil { 5843 objectMap["location"] = erc.Location 5844 } 5845 if erc.Tags != nil { 5846 objectMap["tags"] = erc.Tags 5847 } 5848 return json.Marshal(objectMap) 5849} 5850 5851// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. 5852func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error { 5853 var m map[string]*json.RawMessage 5854 err := json.Unmarshal(body, &m) 5855 if err != nil { 5856 return err 5857 } 5858 for k, v := range m { 5859 switch k { 5860 case "sku": 5861 if v != nil { 5862 var sku ExpressRouteCircuitSku 5863 err = json.Unmarshal(*v, &sku) 5864 if err != nil { 5865 return err 5866 } 5867 erc.Sku = &sku 5868 } 5869 case "properties": 5870 if v != nil { 5871 var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat 5872 err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat) 5873 if err != nil { 5874 return err 5875 } 5876 erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat 5877 } 5878 case "etag": 5879 if v != nil { 5880 var etag string 5881 err = json.Unmarshal(*v, &etag) 5882 if err != nil { 5883 return err 5884 } 5885 erc.Etag = &etag 5886 } 5887 case "id": 5888 if v != nil { 5889 var ID string 5890 err = json.Unmarshal(*v, &ID) 5891 if err != nil { 5892 return err 5893 } 5894 erc.ID = &ID 5895 } 5896 case "name": 5897 if v != nil { 5898 var name string 5899 err = json.Unmarshal(*v, &name) 5900 if err != nil { 5901 return err 5902 } 5903 erc.Name = &name 5904 } 5905 case "type": 5906 if v != nil { 5907 var typeVar string 5908 err = json.Unmarshal(*v, &typeVar) 5909 if err != nil { 5910 return err 5911 } 5912 erc.Type = &typeVar 5913 } 5914 case "location": 5915 if v != nil { 5916 var location string 5917 err = json.Unmarshal(*v, &location) 5918 if err != nil { 5919 return err 5920 } 5921 erc.Location = &location 5922 } 5923 case "tags": 5924 if v != nil { 5925 var tags map[string]*string 5926 err = json.Unmarshal(*v, &tags) 5927 if err != nil { 5928 return err 5929 } 5930 erc.Tags = tags 5931 } 5932 } 5933 } 5934 5935 return nil 5936} 5937 5938// ExpressRouteCircuitArpTable the ARP table associated with the ExpressRouteCircuit. 5939type ExpressRouteCircuitArpTable struct { 5940 // Age - Entry age in minutes 5941 Age *int32 `json:"age,omitempty"` 5942 // Interface - Interface address 5943 Interface *string `json:"interface,omitempty"` 5944 // IPAddress - The IP address. 5945 IPAddress *string `json:"ipAddress,omitempty"` 5946 // MacAddress - The MAC address. 5947 MacAddress *string `json:"macAddress,omitempty"` 5948} 5949 5950// ExpressRouteCircuitAuthorization authorization in an ExpressRouteCircuit resource. 5951type ExpressRouteCircuitAuthorization struct { 5952 autorest.Response `json:"-"` 5953 *AuthorizationPropertiesFormat `json:"properties,omitempty"` 5954 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 5955 Name *string `json:"name,omitempty"` 5956 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 5957 Etag *string `json:"etag,omitempty"` 5958 // ID - Resource ID. 5959 ID *string `json:"id,omitempty"` 5960} 5961 5962// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization. 5963func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { 5964 objectMap := make(map[string]interface{}) 5965 if erca.AuthorizationPropertiesFormat != nil { 5966 objectMap["properties"] = erca.AuthorizationPropertiesFormat 5967 } 5968 if erca.Name != nil { 5969 objectMap["name"] = erca.Name 5970 } 5971 if erca.ID != nil { 5972 objectMap["id"] = erca.ID 5973 } 5974 return json.Marshal(objectMap) 5975} 5976 5977// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. 5978func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { 5979 var m map[string]*json.RawMessage 5980 err := json.Unmarshal(body, &m) 5981 if err != nil { 5982 return err 5983 } 5984 for k, v := range m { 5985 switch k { 5986 case "properties": 5987 if v != nil { 5988 var authorizationPropertiesFormat AuthorizationPropertiesFormat 5989 err = json.Unmarshal(*v, &authorizationPropertiesFormat) 5990 if err != nil { 5991 return err 5992 } 5993 erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat 5994 } 5995 case "name": 5996 if v != nil { 5997 var name string 5998 err = json.Unmarshal(*v, &name) 5999 if err != nil { 6000 return err 6001 } 6002 erca.Name = &name 6003 } 6004 case "etag": 6005 if v != nil { 6006 var etag string 6007 err = json.Unmarshal(*v, &etag) 6008 if err != nil { 6009 return err 6010 } 6011 erca.Etag = &etag 6012 } 6013 case "id": 6014 if v != nil { 6015 var ID string 6016 err = json.Unmarshal(*v, &ID) 6017 if err != nil { 6018 return err 6019 } 6020 erca.ID = &ID 6021 } 6022 } 6023 } 6024 6025 return nil 6026} 6027 6028// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 6029// results of a long-running operation. 6030type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { 6031 azure.FutureAPI 6032 // Result returns the result of the asynchronous operation. 6033 // If the operation has not completed it will return an error. 6034 Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error) 6035} 6036 6037// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6038func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6039 var azFuture azure.Future 6040 if err := json.Unmarshal(body, &azFuture); err != nil { 6041 return err 6042 } 6043 future.FutureAPI = &azFuture 6044 future.Result = future.result 6045 return nil 6046} 6047 6048// result is the default implementation for ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.Result. 6049func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { 6050 var done bool 6051 done, err = future.DoneWithContext(context.Background(), client) 6052 if err != nil { 6053 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6054 return 6055 } 6056 if !done { 6057 erca.Response.Response = future.Response() 6058 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") 6059 return 6060 } 6061 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6062 if erca.Response.Response, err = future.GetResult(sender); err == nil && erca.Response.Response.StatusCode != http.StatusNoContent { 6063 erca, err = client.CreateOrUpdateResponder(erca.Response.Response) 6064 if err != nil { 6065 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", erca.Response.Response, "Failure responding to request") 6066 } 6067 } 6068 return 6069} 6070 6071// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results 6072// of a long-running operation. 6073type ExpressRouteCircuitAuthorizationsDeleteFuture struct { 6074 azure.FutureAPI 6075 // Result returns the result of the asynchronous operation. 6076 // If the operation has not completed it will return an error. 6077 Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error) 6078} 6079 6080// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6081func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { 6082 var azFuture azure.Future 6083 if err := json.Unmarshal(body, &azFuture); err != nil { 6084 return err 6085 } 6086 future.FutureAPI = &azFuture 6087 future.Result = future.result 6088 return nil 6089} 6090 6091// result is the default implementation for ExpressRouteCircuitAuthorizationsDeleteFuture.Result. 6092func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { 6093 var done bool 6094 done, err = future.DoneWithContext(context.Background(), client) 6095 if err != nil { 6096 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") 6097 return 6098 } 6099 if !done { 6100 ar.Response = future.Response() 6101 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") 6102 return 6103 } 6104 ar.Response = future.Response() 6105 return 6106} 6107 6108// ExpressRouteCircuitConnection express Route Circuit Connection in an ExpressRouteCircuitPeering 6109// resource. 6110type ExpressRouteCircuitConnection struct { 6111 autorest.Response `json:"-"` 6112 *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` 6113 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 6114 Name *string `json:"name,omitempty"` 6115 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 6116 Etag *string `json:"etag,omitempty"` 6117 // ID - Resource ID. 6118 ID *string `json:"id,omitempty"` 6119} 6120 6121// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnection. 6122func (ercc ExpressRouteCircuitConnection) MarshalJSON() ([]byte, error) { 6123 objectMap := make(map[string]interface{}) 6124 if ercc.ExpressRouteCircuitConnectionPropertiesFormat != nil { 6125 objectMap["properties"] = ercc.ExpressRouteCircuitConnectionPropertiesFormat 6126 } 6127 if ercc.Name != nil { 6128 objectMap["name"] = ercc.Name 6129 } 6130 if ercc.ID != nil { 6131 objectMap["id"] = ercc.ID 6132 } 6133 return json.Marshal(objectMap) 6134} 6135 6136// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitConnection struct. 6137func (ercc *ExpressRouteCircuitConnection) UnmarshalJSON(body []byte) error { 6138 var m map[string]*json.RawMessage 6139 err := json.Unmarshal(body, &m) 6140 if err != nil { 6141 return err 6142 } 6143 for k, v := range m { 6144 switch k { 6145 case "properties": 6146 if v != nil { 6147 var expressRouteCircuitConnectionPropertiesFormat ExpressRouteCircuitConnectionPropertiesFormat 6148 err = json.Unmarshal(*v, &expressRouteCircuitConnectionPropertiesFormat) 6149 if err != nil { 6150 return err 6151 } 6152 ercc.ExpressRouteCircuitConnectionPropertiesFormat = &expressRouteCircuitConnectionPropertiesFormat 6153 } 6154 case "name": 6155 if v != nil { 6156 var name string 6157 err = json.Unmarshal(*v, &name) 6158 if err != nil { 6159 return err 6160 } 6161 ercc.Name = &name 6162 } 6163 case "etag": 6164 if v != nil { 6165 var etag string 6166 err = json.Unmarshal(*v, &etag) 6167 if err != nil { 6168 return err 6169 } 6170 ercc.Etag = &etag 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 ercc.ID = &ID 6180 } 6181 } 6182 } 6183 6184 return nil 6185} 6186 6187// ExpressRouteCircuitConnectionPropertiesFormat ... 6188type ExpressRouteCircuitConnectionPropertiesFormat struct { 6189 // ExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the circuit initiating connection. 6190 ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` 6191 // PeerExpressRouteCircuitPeering - Reference to Express Route Circuit Private Peering Resource of the peered circuit. 6192 PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` 6193 // AddressPrefix - /29 IP address space to carve out Customer addresses for tunnels. 6194 AddressPrefix *string `json:"addressPrefix,omitempty"` 6195 // AuthorizationKey - The authorization key. 6196 AuthorizationKey *string `json:"authorizationKey,omitempty"` 6197 // CircuitConnectionStatus - READ-ONLY; Express Route Circuit Connection State. Possible values are: 'Connected' and 'Disconnected'. Possible values include: 'Connected', 'Connecting', 'Disconnected' 6198 CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` 6199 // ProvisioningState - READ-ONLY; Provisioning state of the circuit connection resource. Possible values are: 'Succeeded', 'Updating', 'Deleting', and 'Failed'. 6200 ProvisioningState *string `json:"provisioningState,omitempty"` 6201} 6202 6203// MarshalJSON is the custom marshaler for ExpressRouteCircuitConnectionPropertiesFormat. 6204func (erccpf ExpressRouteCircuitConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { 6205 objectMap := make(map[string]interface{}) 6206 if erccpf.ExpressRouteCircuitPeering != nil { 6207 objectMap["expressRouteCircuitPeering"] = erccpf.ExpressRouteCircuitPeering 6208 } 6209 if erccpf.PeerExpressRouteCircuitPeering != nil { 6210 objectMap["peerExpressRouteCircuitPeering"] = erccpf.PeerExpressRouteCircuitPeering 6211 } 6212 if erccpf.AddressPrefix != nil { 6213 objectMap["addressPrefix"] = erccpf.AddressPrefix 6214 } 6215 if erccpf.AuthorizationKey != nil { 6216 objectMap["authorizationKey"] = erccpf.AuthorizationKey 6217 } 6218 return json.Marshal(objectMap) 6219} 6220 6221// ExpressRouteCircuitConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 6222// results of a long-running operation. 6223type ExpressRouteCircuitConnectionsCreateOrUpdateFuture struct { 6224 azure.FutureAPI 6225 // Result returns the result of the asynchronous operation. 6226 // If the operation has not completed it will return an error. 6227 Result func(ExpressRouteCircuitConnectionsClient) (ExpressRouteCircuitConnection, error) 6228} 6229 6230// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6231func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6232 var azFuture azure.Future 6233 if err := json.Unmarshal(body, &azFuture); err != nil { 6234 return err 6235 } 6236 future.FutureAPI = &azFuture 6237 future.Result = future.result 6238 return nil 6239} 6240 6241// result is the default implementation for ExpressRouteCircuitConnectionsCreateOrUpdateFuture.Result. 6242func (future *ExpressRouteCircuitConnectionsCreateOrUpdateFuture) result(client ExpressRouteCircuitConnectionsClient) (ercc ExpressRouteCircuitConnection, err error) { 6243 var done bool 6244 done, err = future.DoneWithContext(context.Background(), client) 6245 if err != nil { 6246 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6247 return 6248 } 6249 if !done { 6250 ercc.Response.Response = future.Response() 6251 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture") 6252 return 6253 } 6254 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6255 if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent { 6256 ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response) 6257 if err != nil { 6258 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request") 6259 } 6260 } 6261 return 6262} 6263 6264// ExpressRouteCircuitConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 6265// long-running operation. 6266type ExpressRouteCircuitConnectionsDeleteFuture struct { 6267 azure.FutureAPI 6268 // Result returns the result of the asynchronous operation. 6269 // If the operation has not completed it will return an error. 6270 Result func(ExpressRouteCircuitConnectionsClient) (autorest.Response, error) 6271} 6272 6273// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6274func (future *ExpressRouteCircuitConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 6275 var azFuture azure.Future 6276 if err := json.Unmarshal(body, &azFuture); err != nil { 6277 return err 6278 } 6279 future.FutureAPI = &azFuture 6280 future.Result = future.result 6281 return nil 6282} 6283 6284// result is the default implementation for ExpressRouteCircuitConnectionsDeleteFuture.Result. 6285func (future *ExpressRouteCircuitConnectionsDeleteFuture) result(client ExpressRouteCircuitConnectionsClient) (ar autorest.Response, err error) { 6286 var done bool 6287 done, err = future.DoneWithContext(context.Background(), client) 6288 if err != nil { 6289 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 6290 return 6291 } 6292 if !done { 6293 ar.Response = future.Response() 6294 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitConnectionsDeleteFuture") 6295 return 6296 } 6297 ar.Response = future.Response() 6298 return 6299} 6300 6301// ExpressRouteCircuitListResult response for ListExpressRouteCircuit API service call. 6302type ExpressRouteCircuitListResult struct { 6303 autorest.Response `json:"-"` 6304 // Value - A list of ExpressRouteCircuits in a resource group. 6305 Value *[]ExpressRouteCircuit `json:"value,omitempty"` 6306 // NextLink - The URL to get the next set of results. 6307 NextLink *string `json:"nextLink,omitempty"` 6308} 6309 6310// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit 6311// values. 6312type ExpressRouteCircuitListResultIterator struct { 6313 i int 6314 page ExpressRouteCircuitListResultPage 6315} 6316 6317// NextWithContext advances to the next value. If there was an error making 6318// the request the iterator does not advance and the error is returned. 6319func (iter *ExpressRouteCircuitListResultIterator) NextWithContext(ctx context.Context) (err error) { 6320 if tracing.IsEnabled() { 6321 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultIterator.NextWithContext") 6322 defer func() { 6323 sc := -1 6324 if iter.Response().Response.Response != nil { 6325 sc = iter.Response().Response.Response.StatusCode 6326 } 6327 tracing.EndSpan(ctx, sc, err) 6328 }() 6329 } 6330 iter.i++ 6331 if iter.i < len(iter.page.Values()) { 6332 return nil 6333 } 6334 err = iter.page.NextWithContext(ctx) 6335 if err != nil { 6336 iter.i-- 6337 return err 6338 } 6339 iter.i = 0 6340 return nil 6341} 6342 6343// Next advances to the next value. If there was an error making 6344// the request the iterator does not advance and the error is returned. 6345// Deprecated: Use NextWithContext() instead. 6346func (iter *ExpressRouteCircuitListResultIterator) Next() error { 6347 return iter.NextWithContext(context.Background()) 6348} 6349 6350// NotDone returns true if the enumeration should be started or is not yet complete. 6351func (iter ExpressRouteCircuitListResultIterator) NotDone() bool { 6352 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6353} 6354 6355// Response returns the raw server response from the last page request. 6356func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult { 6357 return iter.page.Response() 6358} 6359 6360// Value returns the current value or a zero-initialized value if the 6361// iterator has advanced beyond the end of the collection. 6362func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit { 6363 if !iter.page.NotDone() { 6364 return ExpressRouteCircuit{} 6365 } 6366 return iter.page.Values()[iter.i] 6367} 6368 6369// Creates a new instance of the ExpressRouteCircuitListResultIterator type. 6370func NewExpressRouteCircuitListResultIterator(page ExpressRouteCircuitListResultPage) ExpressRouteCircuitListResultIterator { 6371 return ExpressRouteCircuitListResultIterator{page: page} 6372} 6373 6374// IsEmpty returns true if the ListResult contains no values. 6375func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { 6376 return erclr.Value == nil || len(*erclr.Value) == 0 6377} 6378 6379// hasNextLink returns true if the NextLink is not empty. 6380func (erclr ExpressRouteCircuitListResult) hasNextLink() bool { 6381 return erclr.NextLink != nil && len(*erclr.NextLink) != 0 6382} 6383 6384// expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. 6385// It returns nil if no more results exist. 6386func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) { 6387 if !erclr.hasNextLink() { 6388 return nil, nil 6389 } 6390 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6391 autorest.AsJSON(), 6392 autorest.AsGet(), 6393 autorest.WithBaseURL(to.String(erclr.NextLink))) 6394} 6395 6396// ExpressRouteCircuitListResultPage contains a page of ExpressRouteCircuit values. 6397type ExpressRouteCircuitListResultPage struct { 6398 fn func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error) 6399 erclr ExpressRouteCircuitListResult 6400} 6401 6402// NextWithContext advances to the next page of values. If there was an error making 6403// the request the page does not advance and the error is returned. 6404func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Context) (err error) { 6405 if tracing.IsEnabled() { 6406 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultPage.NextWithContext") 6407 defer func() { 6408 sc := -1 6409 if page.Response().Response.Response != nil { 6410 sc = page.Response().Response.Response.StatusCode 6411 } 6412 tracing.EndSpan(ctx, sc, err) 6413 }() 6414 } 6415 for { 6416 next, err := page.fn(ctx, page.erclr) 6417 if err != nil { 6418 return err 6419 } 6420 page.erclr = next 6421 if !next.hasNextLink() || !next.IsEmpty() { 6422 break 6423 } 6424 } 6425 return nil 6426} 6427 6428// Next advances to the next page of values. If there was an error making 6429// the request the page does not advance and the error is returned. 6430// Deprecated: Use NextWithContext() instead. 6431func (page *ExpressRouteCircuitListResultPage) Next() error { 6432 return page.NextWithContext(context.Background()) 6433} 6434 6435// NotDone returns true if the page enumeration should be started or is not yet complete. 6436func (page ExpressRouteCircuitListResultPage) NotDone() bool { 6437 return !page.erclr.IsEmpty() 6438} 6439 6440// Response returns the raw server response from the last page request. 6441func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult { 6442 return page.erclr 6443} 6444 6445// Values returns the slice of values for the current page or nil if there are no values. 6446func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { 6447 if page.erclr.IsEmpty() { 6448 return nil 6449 } 6450 return *page.erclr.Value 6451} 6452 6453// Creates a new instance of the ExpressRouteCircuitListResultPage type. 6454func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage { 6455 return ExpressRouteCircuitListResultPage{ 6456 fn: getNextPage, 6457 erclr: cur, 6458 } 6459} 6460 6461// ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource. 6462type ExpressRouteCircuitPeering struct { 6463 autorest.Response `json:"-"` 6464 *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` 6465 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 6466 Name *string `json:"name,omitempty"` 6467 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 6468 Etag *string `json:"etag,omitempty"` 6469 // ID - Resource ID. 6470 ID *string `json:"id,omitempty"` 6471} 6472 6473// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering. 6474func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { 6475 objectMap := make(map[string]interface{}) 6476 if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil { 6477 objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat 6478 } 6479 if ercp.Name != nil { 6480 objectMap["name"] = ercp.Name 6481 } 6482 if ercp.ID != nil { 6483 objectMap["id"] = ercp.ID 6484 } 6485 return json.Marshal(objectMap) 6486} 6487 6488// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. 6489func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error { 6490 var m map[string]*json.RawMessage 6491 err := json.Unmarshal(body, &m) 6492 if err != nil { 6493 return err 6494 } 6495 for k, v := range m { 6496 switch k { 6497 case "properties": 6498 if v != nil { 6499 var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat 6500 err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat) 6501 if err != nil { 6502 return err 6503 } 6504 ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat 6505 } 6506 case "name": 6507 if v != nil { 6508 var name string 6509 err = json.Unmarshal(*v, &name) 6510 if err != nil { 6511 return err 6512 } 6513 ercp.Name = &name 6514 } 6515 case "etag": 6516 if v != nil { 6517 var etag string 6518 err = json.Unmarshal(*v, &etag) 6519 if err != nil { 6520 return err 6521 } 6522 ercp.Etag = &etag 6523 } 6524 case "id": 6525 if v != nil { 6526 var ID string 6527 err = json.Unmarshal(*v, &ID) 6528 if err != nil { 6529 return err 6530 } 6531 ercp.ID = &ID 6532 } 6533 } 6534 } 6535 6536 return nil 6537} 6538 6539// ExpressRouteCircuitPeeringConfig specifies the peering configuration. 6540type ExpressRouteCircuitPeeringConfig struct { 6541 // AdvertisedPublicPrefixes - The reference of AdvertisedPublicPrefixes. 6542 AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` 6543 // AdvertisedCommunities - The communities of bgp peering. Specified for microsoft peering 6544 AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` 6545 // AdvertisedPublicPrefixesState - AdvertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' 6546 AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` 6547 // LegacyMode - The legacy mode of the peering. 6548 LegacyMode *int32 `json:"legacyMode,omitempty"` 6549 // CustomerASN - The CustomerASN of the peering. 6550 CustomerASN *int32 `json:"customerASN,omitempty"` 6551 // RoutingRegistryName - The RoutingRegistryName of the configuration. 6552 RoutingRegistryName *string `json:"routingRegistryName,omitempty"` 6553} 6554 6555// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings 6556// that belong to an ExpressRouteCircuit. 6557type ExpressRouteCircuitPeeringListResult struct { 6558 autorest.Response `json:"-"` 6559 // Value - The peerings in an express route circuit. 6560 Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` 6561 // NextLink - The URL to get the next set of results. 6562 NextLink *string `json:"nextLink,omitempty"` 6563} 6564 6565// ExpressRouteCircuitPeeringListResultIterator provides access to a complete listing of 6566// ExpressRouteCircuitPeering values. 6567type ExpressRouteCircuitPeeringListResultIterator struct { 6568 i int 6569 page ExpressRouteCircuitPeeringListResultPage 6570} 6571 6572// NextWithContext advances to the next value. If there was an error making 6573// the request the iterator does not advance and the error is returned. 6574func (iter *ExpressRouteCircuitPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { 6575 if tracing.IsEnabled() { 6576 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultIterator.NextWithContext") 6577 defer func() { 6578 sc := -1 6579 if iter.Response().Response.Response != nil { 6580 sc = iter.Response().Response.Response.StatusCode 6581 } 6582 tracing.EndSpan(ctx, sc, err) 6583 }() 6584 } 6585 iter.i++ 6586 if iter.i < len(iter.page.Values()) { 6587 return nil 6588 } 6589 err = iter.page.NextWithContext(ctx) 6590 if err != nil { 6591 iter.i-- 6592 return err 6593 } 6594 iter.i = 0 6595 return nil 6596} 6597 6598// Next advances to the next value. If there was an error making 6599// the request the iterator does not advance and the error is returned. 6600// Deprecated: Use NextWithContext() instead. 6601func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error { 6602 return iter.NextWithContext(context.Background()) 6603} 6604 6605// NotDone returns true if the enumeration should be started or is not yet complete. 6606func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool { 6607 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6608} 6609 6610// Response returns the raw server response from the last page request. 6611func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult { 6612 return iter.page.Response() 6613} 6614 6615// Value returns the current value or a zero-initialized value if the 6616// iterator has advanced beyond the end of the collection. 6617func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering { 6618 if !iter.page.NotDone() { 6619 return ExpressRouteCircuitPeering{} 6620 } 6621 return iter.page.Values()[iter.i] 6622} 6623 6624// Creates a new instance of the ExpressRouteCircuitPeeringListResultIterator type. 6625func NewExpressRouteCircuitPeeringListResultIterator(page ExpressRouteCircuitPeeringListResultPage) ExpressRouteCircuitPeeringListResultIterator { 6626 return ExpressRouteCircuitPeeringListResultIterator{page: page} 6627} 6628 6629// IsEmpty returns true if the ListResult contains no values. 6630func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { 6631 return ercplr.Value == nil || len(*ercplr.Value) == 0 6632} 6633 6634// hasNextLink returns true if the NextLink is not empty. 6635func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool { 6636 return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0 6637} 6638 6639// expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. 6640// It returns nil if no more results exist. 6641func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { 6642 if !ercplr.hasNextLink() { 6643 return nil, nil 6644 } 6645 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6646 autorest.AsJSON(), 6647 autorest.AsGet(), 6648 autorest.WithBaseURL(to.String(ercplr.NextLink))) 6649} 6650 6651// ExpressRouteCircuitPeeringListResultPage contains a page of ExpressRouteCircuitPeering values. 6652type ExpressRouteCircuitPeeringListResultPage struct { 6653 fn func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error) 6654 ercplr ExpressRouteCircuitPeeringListResult 6655} 6656 6657// NextWithContext advances to the next page of values. If there was an error making 6658// the request the page does not advance and the error is returned. 6659func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { 6660 if tracing.IsEnabled() { 6661 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultPage.NextWithContext") 6662 defer func() { 6663 sc := -1 6664 if page.Response().Response.Response != nil { 6665 sc = page.Response().Response.Response.StatusCode 6666 } 6667 tracing.EndSpan(ctx, sc, err) 6668 }() 6669 } 6670 for { 6671 next, err := page.fn(ctx, page.ercplr) 6672 if err != nil { 6673 return err 6674 } 6675 page.ercplr = next 6676 if !next.hasNextLink() || !next.IsEmpty() { 6677 break 6678 } 6679 } 6680 return nil 6681} 6682 6683// Next advances to the next page of values. If there was an error making 6684// the request the page does not advance and the error is returned. 6685// Deprecated: Use NextWithContext() instead. 6686func (page *ExpressRouteCircuitPeeringListResultPage) Next() error { 6687 return page.NextWithContext(context.Background()) 6688} 6689 6690// NotDone returns true if the page enumeration should be started or is not yet complete. 6691func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool { 6692 return !page.ercplr.IsEmpty() 6693} 6694 6695// Response returns the raw server response from the last page request. 6696func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult { 6697 return page.ercplr 6698} 6699 6700// Values returns the slice of values for the current page or nil if there are no values. 6701func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering { 6702 if page.ercplr.IsEmpty() { 6703 return nil 6704 } 6705 return *page.ercplr.Value 6706} 6707 6708// Creates a new instance of the ExpressRouteCircuitPeeringListResultPage type. 6709func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage { 6710 return ExpressRouteCircuitPeeringListResultPage{ 6711 fn: getNextPage, 6712 ercplr: cur, 6713 } 6714} 6715 6716// ExpressRouteCircuitPeeringPropertiesFormat ... 6717type ExpressRouteCircuitPeeringPropertiesFormat struct { 6718 // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' 6719 PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` 6720 // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' 6721 State ExpressRoutePeeringState `json:"state,omitempty"` 6722 // AzureASN - The Azure ASN. 6723 AzureASN *int32 `json:"azureASN,omitempty"` 6724 // PeerASN - The peer ASN. 6725 PeerASN *int64 `json:"peerASN,omitempty"` 6726 // PrimaryPeerAddressPrefix - The primary address prefix. 6727 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` 6728 // SecondaryPeerAddressPrefix - The secondary address prefix. 6729 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` 6730 // PrimaryAzurePort - The primary port. 6731 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` 6732 // SecondaryAzurePort - The secondary port. 6733 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` 6734 // SharedKey - The shared key. 6735 SharedKey *string `json:"sharedKey,omitempty"` 6736 // VlanID - The VLAN ID. 6737 VlanID *int32 `json:"vlanId,omitempty"` 6738 // MicrosoftPeeringConfig - The Microsoft peering configuration. 6739 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` 6740 // Stats - Gets peering stats. 6741 Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` 6742 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6743 ProvisioningState *string `json:"provisioningState,omitempty"` 6744 // GatewayManagerEtag - The GatewayManager Etag. 6745 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` 6746 // LastModifiedBy - Gets whether the provider or the customer last modified the peering. 6747 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 6748 // RouteFilter - The reference of the RouteFilter resource. 6749 RouteFilter *RouteFilter `json:"routeFilter,omitempty"` 6750 // Ipv6PeeringConfig - The IPv6 peering configuration. 6751 Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` 6752 // Connections - The list of circuit connections associated with Azure Private Peering for this circuit. 6753 Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` 6754} 6755 6756// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 6757// of a long-running operation. 6758type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { 6759 azure.FutureAPI 6760 // Result returns the result of the asynchronous operation. 6761 // If the operation has not completed it will return an error. 6762 Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error) 6763} 6764 6765// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6766func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6767 var azFuture azure.Future 6768 if err := json.Unmarshal(body, &azFuture); err != nil { 6769 return err 6770 } 6771 future.FutureAPI = &azFuture 6772 future.Result = future.result 6773 return nil 6774} 6775 6776// result is the default implementation for ExpressRouteCircuitPeeringsCreateOrUpdateFuture.Result. 6777func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { 6778 var done bool 6779 done, err = future.DoneWithContext(context.Background(), client) 6780 if err != nil { 6781 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6782 return 6783 } 6784 if !done { 6785 ercp.Response.Response = future.Response() 6786 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") 6787 return 6788 } 6789 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6790 if ercp.Response.Response, err = future.GetResult(sender); err == nil && ercp.Response.Response.StatusCode != http.StatusNoContent { 6791 ercp, err = client.CreateOrUpdateResponder(ercp.Response.Response) 6792 if err != nil { 6793 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", ercp.Response.Response, "Failure responding to request") 6794 } 6795 } 6796 return 6797} 6798 6799// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a 6800// long-running operation. 6801type ExpressRouteCircuitPeeringsDeleteFuture struct { 6802 azure.FutureAPI 6803 // Result returns the result of the asynchronous operation. 6804 // If the operation has not completed it will return an error. 6805 Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error) 6806} 6807 6808// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6809func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { 6810 var azFuture azure.Future 6811 if err := json.Unmarshal(body, &azFuture); err != nil { 6812 return err 6813 } 6814 future.FutureAPI = &azFuture 6815 future.Result = future.result 6816 return nil 6817} 6818 6819// result is the default implementation for ExpressRouteCircuitPeeringsDeleteFuture.Result. 6820func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { 6821 var done bool 6822 done, err = future.DoneWithContext(context.Background(), client) 6823 if err != nil { 6824 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 6825 return 6826 } 6827 if !done { 6828 ar.Response = future.Response() 6829 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") 6830 return 6831 } 6832 ar.Response = future.Response() 6833 return 6834} 6835 6836// ExpressRouteCircuitPropertiesFormat properties of ExpressRouteCircuit. 6837type ExpressRouteCircuitPropertiesFormat struct { 6838 // AllowClassicOperations - Allow classic operations 6839 AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` 6840 // CircuitProvisioningState - The CircuitProvisioningState state of the resource. 6841 CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` 6842 // ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' 6843 ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` 6844 // Authorizations - The list of authorizations. 6845 Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` 6846 // Peerings - The list of peerings. 6847 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` 6848 // ServiceKey - The ServiceKey. 6849 ServiceKey *string `json:"serviceKey,omitempty"` 6850 // ServiceProviderNotes - The ServiceProviderNotes. 6851 ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` 6852 // ServiceProviderProperties - The ServiceProviderProperties. 6853 ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` 6854 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6855 ProvisioningState *string `json:"provisioningState,omitempty"` 6856 // GatewayManagerEtag - The GatewayManager Etag. 6857 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` 6858} 6859 6860// ExpressRouteCircuitReference ... 6861type ExpressRouteCircuitReference struct { 6862 // ID - Corresponding Express Route Circuit Id. 6863 ID *string `json:"id,omitempty"` 6864} 6865 6866// ExpressRouteCircuitRoutesTable the routes table associated with the ExpressRouteCircuit 6867type ExpressRouteCircuitRoutesTable struct { 6868 // NetworkProperty - IP address of a network entity 6869 NetworkProperty *string `json:"network,omitempty"` 6870 // NextHop - NextHop address 6871 NextHop *string `json:"nextHop,omitempty"` 6872 // LocPrf - Local preference value as set with the set local-preference route-map configuration command 6873 LocPrf *string `json:"locPrf,omitempty"` 6874 // Weight - Route Weight. 6875 Weight *int32 `json:"weight,omitempty"` 6876 // Path - Autonomous system paths to the destination network. 6877 Path *string `json:"path,omitempty"` 6878} 6879 6880// ExpressRouteCircuitRoutesTableSummary the routes table associated with the ExpressRouteCircuit. 6881type ExpressRouteCircuitRoutesTableSummary struct { 6882 // Neighbor - IP address of the neighbor. 6883 Neighbor *string `json:"neighbor,omitempty"` 6884 // V - BGP version number spoken to the neighbor. 6885 V *int32 `json:"v,omitempty"` 6886 // As - Autonomous system number. 6887 As *int32 `json:"as,omitempty"` 6888 // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. 6889 UpDown *string `json:"upDown,omitempty"` 6890 // StatePfxRcd - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. 6891 StatePfxRcd *string `json:"statePfxRcd,omitempty"` 6892} 6893 6894// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route 6895// Circuits API. 6896type ExpressRouteCircuitsArpTableListResult struct { 6897 autorest.Response `json:"-"` 6898 // Value - Gets list of the ARP table. 6899 Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` 6900 // NextLink - The URL to get the next set of results. 6901 NextLink *string `json:"nextLink,omitempty"` 6902} 6903 6904// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6905// long-running operation. 6906type ExpressRouteCircuitsCreateOrUpdateFuture struct { 6907 azure.FutureAPI 6908 // Result returns the result of the asynchronous operation. 6909 // If the operation has not completed it will return an error. 6910 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) 6911} 6912 6913// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6914func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6915 var azFuture azure.Future 6916 if err := json.Unmarshal(body, &azFuture); err != nil { 6917 return err 6918 } 6919 future.FutureAPI = &azFuture 6920 future.Result = future.result 6921 return nil 6922} 6923 6924// result is the default implementation for ExpressRouteCircuitsCreateOrUpdateFuture.Result. 6925func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { 6926 var done bool 6927 done, err = future.DoneWithContext(context.Background(), client) 6928 if err != nil { 6929 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6930 return 6931 } 6932 if !done { 6933 erc.Response.Response = future.Response() 6934 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") 6935 return 6936 } 6937 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6938 if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { 6939 erc, err = client.CreateOrUpdateResponder(erc.Response.Response) 6940 if err != nil { 6941 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request") 6942 } 6943 } 6944 return 6945} 6946 6947// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a 6948// long-running operation. 6949type ExpressRouteCircuitsDeleteFuture struct { 6950 azure.FutureAPI 6951 // Result returns the result of the asynchronous operation. 6952 // If the operation has not completed it will return an error. 6953 Result func(ExpressRouteCircuitsClient) (autorest.Response, error) 6954} 6955 6956// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6957func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error { 6958 var azFuture azure.Future 6959 if err := json.Unmarshal(body, &azFuture); err != nil { 6960 return err 6961 } 6962 future.FutureAPI = &azFuture 6963 future.Result = future.result 6964 return nil 6965} 6966 6967// result is the default implementation for ExpressRouteCircuitsDeleteFuture.Result. 6968func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { 6969 var done bool 6970 done, err = future.DoneWithContext(context.Background(), client) 6971 if err != nil { 6972 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure") 6973 return 6974 } 6975 if !done { 6976 ar.Response = future.Response() 6977 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") 6978 return 6979 } 6980 ar.Response = future.Response() 6981 return 6982} 6983 6984// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an 6985// ExpressRouteCircuit. 6986type ExpressRouteCircuitServiceProviderProperties struct { 6987 // ServiceProviderName - The serviceProviderName. 6988 ServiceProviderName *string `json:"serviceProviderName,omitempty"` 6989 // PeeringLocation - The peering location. 6990 PeeringLocation *string `json:"peeringLocation,omitempty"` 6991 // BandwidthInMbps - The BandwidthInMbps. 6992 BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` 6993} 6994 6995// ExpressRouteCircuitSku contains SKU in an ExpressRouteCircuit. 6996type ExpressRouteCircuitSku struct { 6997 // Name - The name of the SKU. 6998 Name *string `json:"name,omitempty"` 6999 // Tier - The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'Standard', 'Premium' 7000 Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` 7001 // Family - The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' 7002 Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` 7003} 7004 7005// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a 7006// long-running operation. 7007type ExpressRouteCircuitsListArpTableFuture struct { 7008 azure.FutureAPI 7009 // Result returns the result of the asynchronous operation. 7010 // If the operation has not completed it will return an error. 7011 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error) 7012} 7013 7014// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7015func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error { 7016 var azFuture azure.Future 7017 if err := json.Unmarshal(body, &azFuture); err != nil { 7018 return err 7019 } 7020 future.FutureAPI = &azFuture 7021 future.Result = future.result 7022 return nil 7023} 7024 7025// result is the default implementation for ExpressRouteCircuitsListArpTableFuture.Result. 7026func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { 7027 var done bool 7028 done, err = future.DoneWithContext(context.Background(), client) 7029 if err != nil { 7030 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure") 7031 return 7032 } 7033 if !done { 7034 ercatlr.Response.Response = future.Response() 7035 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") 7036 return 7037 } 7038 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7039 if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { 7040 ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) 7041 if err != nil { 7042 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") 7043 } 7044 } 7045 return 7046} 7047 7048// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a 7049// long-running operation. 7050type ExpressRouteCircuitsListRoutesTableFuture struct { 7051 azure.FutureAPI 7052 // Result returns the result of the asynchronous operation. 7053 // If the operation has not completed it will return an error. 7054 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error) 7055} 7056 7057// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7058func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error { 7059 var azFuture azure.Future 7060 if err := json.Unmarshal(body, &azFuture); err != nil { 7061 return err 7062 } 7063 future.FutureAPI = &azFuture 7064 future.Result = future.result 7065 return nil 7066} 7067 7068// result is the default implementation for ExpressRouteCircuitsListRoutesTableFuture.Result. 7069func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { 7070 var done bool 7071 done, err = future.DoneWithContext(context.Background(), client) 7072 if err != nil { 7073 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure") 7074 return 7075 } 7076 if !done { 7077 ercrtlr.Response.Response = future.Response() 7078 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") 7079 return 7080 } 7081 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7082 if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { 7083 ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) 7084 if err != nil { 7085 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") 7086 } 7087 } 7088 return 7089} 7090 7091// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the 7092// results of a long-running operation. 7093type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { 7094 azure.FutureAPI 7095 // Result returns the result of the asynchronous operation. 7096 // If the operation has not completed it will return an error. 7097 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error) 7098} 7099 7100// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7101func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { 7102 var azFuture azure.Future 7103 if err := json.Unmarshal(body, &azFuture); err != nil { 7104 return err 7105 } 7106 future.FutureAPI = &azFuture 7107 future.Result = future.result 7108 return nil 7109} 7110 7111// result is the default implementation for ExpressRouteCircuitsListRoutesTableSummaryFuture.Result. 7112func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { 7113 var done bool 7114 done, err = future.DoneWithContext(context.Background(), client) 7115 if err != nil { 7116 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") 7117 return 7118 } 7119 if !done { 7120 ercrtslr.Response.Response = future.Response() 7121 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") 7122 return 7123 } 7124 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7125 if ercrtslr.Response.Response, err = future.GetResult(sender); err == nil && ercrtslr.Response.Response.StatusCode != http.StatusNoContent { 7126 ercrtslr, err = client.ListRoutesTableSummaryResponder(ercrtslr.Response.Response) 7127 if err != nil { 7128 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", ercrtslr.Response.Response, "Failure responding to request") 7129 } 7130 } 7131 return 7132} 7133 7134// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route 7135// Circuits API. 7136type ExpressRouteCircuitsRoutesTableListResult struct { 7137 autorest.Response `json:"-"` 7138 // Value - The list of routes table. 7139 Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` 7140 // NextLink - The URL to get the next set of results. 7141 NextLink *string `json:"nextLink,omitempty"` 7142} 7143 7144// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the 7145// Express Route Circuits API. 7146type ExpressRouteCircuitsRoutesTableSummaryListResult struct { 7147 autorest.Response `json:"-"` 7148 // Value - A list of the routes table. 7149 Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` 7150 // NextLink - The URL to get the next set of results. 7151 NextLink *string `json:"nextLink,omitempty"` 7152} 7153 7154// ExpressRouteCircuitStats contains stats associated with the peering. 7155type ExpressRouteCircuitStats struct { 7156 autorest.Response `json:"-"` 7157 // PrimarybytesIn - Gets BytesIn of the peering. 7158 PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` 7159 // PrimarybytesOut - Gets BytesOut of the peering. 7160 PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` 7161 // SecondarybytesIn - Gets BytesIn of the peering. 7162 SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` 7163 // SecondarybytesOut - Gets BytesOut of the peering. 7164 SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` 7165} 7166 7167// ExpressRouteCircuitsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 7168// long-running operation. 7169type ExpressRouteCircuitsUpdateTagsFuture struct { 7170 azure.FutureAPI 7171 // Result returns the result of the asynchronous operation. 7172 // If the operation has not completed it will return an error. 7173 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) 7174} 7175 7176// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7177func (future *ExpressRouteCircuitsUpdateTagsFuture) UnmarshalJSON(body []byte) error { 7178 var azFuture azure.Future 7179 if err := json.Unmarshal(body, &azFuture); err != nil { 7180 return err 7181 } 7182 future.FutureAPI = &azFuture 7183 future.Result = future.result 7184 return nil 7185} 7186 7187// result is the default implementation for ExpressRouteCircuitsUpdateTagsFuture.Result. 7188func (future *ExpressRouteCircuitsUpdateTagsFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { 7189 var done bool 7190 done, err = future.DoneWithContext(context.Background(), client) 7191 if err != nil { 7192 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsUpdateTagsFuture", "Result", future.Response(), "Polling failure") 7193 return 7194 } 7195 if !done { 7196 erc.Response.Response = future.Response() 7197 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsUpdateTagsFuture") 7198 return 7199 } 7200 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7201 if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { 7202 erc, err = client.UpdateTagsResponder(erc.Response.Response) 7203 if err != nil { 7204 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsUpdateTagsFuture", "Result", erc.Response.Response, "Failure responding to request") 7205 } 7206 } 7207 return 7208} 7209 7210// ExpressRouteCrossConnection expressRouteCrossConnection resource 7211type ExpressRouteCrossConnection struct { 7212 autorest.Response `json:"-"` 7213 *ExpressRouteCrossConnectionProperties `json:"properties,omitempty"` 7214 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 7215 Etag *string `json:"etag,omitempty"` 7216 // ID - Resource ID. 7217 ID *string `json:"id,omitempty"` 7218 // Name - READ-ONLY; Resource name. 7219 Name *string `json:"name,omitempty"` 7220 // Type - READ-ONLY; Resource type. 7221 Type *string `json:"type,omitempty"` 7222 // Location - Resource location. 7223 Location *string `json:"location,omitempty"` 7224 // Tags - Resource tags. 7225 Tags map[string]*string `json:"tags"` 7226} 7227 7228// MarshalJSON is the custom marshaler for ExpressRouteCrossConnection. 7229func (ercc ExpressRouteCrossConnection) MarshalJSON() ([]byte, error) { 7230 objectMap := make(map[string]interface{}) 7231 if ercc.ExpressRouteCrossConnectionProperties != nil { 7232 objectMap["properties"] = ercc.ExpressRouteCrossConnectionProperties 7233 } 7234 if ercc.ID != nil { 7235 objectMap["id"] = ercc.ID 7236 } 7237 if ercc.Location != nil { 7238 objectMap["location"] = ercc.Location 7239 } 7240 if ercc.Tags != nil { 7241 objectMap["tags"] = ercc.Tags 7242 } 7243 return json.Marshal(objectMap) 7244} 7245 7246// UnmarshalJSON is the custom unmarshaler for ExpressRouteCrossConnection struct. 7247func (ercc *ExpressRouteCrossConnection) UnmarshalJSON(body []byte) error { 7248 var m map[string]*json.RawMessage 7249 err := json.Unmarshal(body, &m) 7250 if err != nil { 7251 return err 7252 } 7253 for k, v := range m { 7254 switch k { 7255 case "properties": 7256 if v != nil { 7257 var expressRouteCrossConnectionProperties ExpressRouteCrossConnectionProperties 7258 err = json.Unmarshal(*v, &expressRouteCrossConnectionProperties) 7259 if err != nil { 7260 return err 7261 } 7262 ercc.ExpressRouteCrossConnectionProperties = &expressRouteCrossConnectionProperties 7263 } 7264 case "etag": 7265 if v != nil { 7266 var etag string 7267 err = json.Unmarshal(*v, &etag) 7268 if err != nil { 7269 return err 7270 } 7271 ercc.Etag = &etag 7272 } 7273 case "id": 7274 if v != nil { 7275 var ID string 7276 err = json.Unmarshal(*v, &ID) 7277 if err != nil { 7278 return err 7279 } 7280 ercc.ID = &ID 7281 } 7282 case "name": 7283 if v != nil { 7284 var name string 7285 err = json.Unmarshal(*v, &name) 7286 if err != nil { 7287 return err 7288 } 7289 ercc.Name = &name 7290 } 7291 case "type": 7292 if v != nil { 7293 var typeVar string 7294 err = json.Unmarshal(*v, &typeVar) 7295 if err != nil { 7296 return err 7297 } 7298 ercc.Type = &typeVar 7299 } 7300 case "location": 7301 if v != nil { 7302 var location string 7303 err = json.Unmarshal(*v, &location) 7304 if err != nil { 7305 return err 7306 } 7307 ercc.Location = &location 7308 } 7309 case "tags": 7310 if v != nil { 7311 var tags map[string]*string 7312 err = json.Unmarshal(*v, &tags) 7313 if err != nil { 7314 return err 7315 } 7316 ercc.Tags = tags 7317 } 7318 } 7319 } 7320 7321 return nil 7322} 7323 7324// ExpressRouteCrossConnectionListResult response for ListExpressRouteCrossConnection API service call. 7325type ExpressRouteCrossConnectionListResult struct { 7326 autorest.Response `json:"-"` 7327 // Value - A list of ExpressRouteCrossConnection resources. 7328 Value *[]ExpressRouteCrossConnection `json:"value,omitempty"` 7329 // NextLink - READ-ONLY; The URL to get the next set of results. 7330 NextLink *string `json:"nextLink,omitempty"` 7331} 7332 7333// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionListResult. 7334func (ercclr ExpressRouteCrossConnectionListResult) MarshalJSON() ([]byte, error) { 7335 objectMap := make(map[string]interface{}) 7336 if ercclr.Value != nil { 7337 objectMap["value"] = ercclr.Value 7338 } 7339 return json.Marshal(objectMap) 7340} 7341 7342// ExpressRouteCrossConnectionListResultIterator provides access to a complete listing of 7343// ExpressRouteCrossConnection values. 7344type ExpressRouteCrossConnectionListResultIterator struct { 7345 i int 7346 page ExpressRouteCrossConnectionListResultPage 7347} 7348 7349// NextWithContext advances to the next value. If there was an error making 7350// the request the iterator does not advance and the error is returned. 7351func (iter *ExpressRouteCrossConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 7352 if tracing.IsEnabled() { 7353 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultIterator.NextWithContext") 7354 defer func() { 7355 sc := -1 7356 if iter.Response().Response.Response != nil { 7357 sc = iter.Response().Response.Response.StatusCode 7358 } 7359 tracing.EndSpan(ctx, sc, err) 7360 }() 7361 } 7362 iter.i++ 7363 if iter.i < len(iter.page.Values()) { 7364 return nil 7365 } 7366 err = iter.page.NextWithContext(ctx) 7367 if err != nil { 7368 iter.i-- 7369 return err 7370 } 7371 iter.i = 0 7372 return nil 7373} 7374 7375// Next advances to the next value. If there was an error making 7376// the request the iterator does not advance and the error is returned. 7377// Deprecated: Use NextWithContext() instead. 7378func (iter *ExpressRouteCrossConnectionListResultIterator) Next() error { 7379 return iter.NextWithContext(context.Background()) 7380} 7381 7382// NotDone returns true if the enumeration should be started or is not yet complete. 7383func (iter ExpressRouteCrossConnectionListResultIterator) NotDone() bool { 7384 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7385} 7386 7387// Response returns the raw server response from the last page request. 7388func (iter ExpressRouteCrossConnectionListResultIterator) Response() ExpressRouteCrossConnectionListResult { 7389 return iter.page.Response() 7390} 7391 7392// Value returns the current value or a zero-initialized value if the 7393// iterator has advanced beyond the end of the collection. 7394func (iter ExpressRouteCrossConnectionListResultIterator) Value() ExpressRouteCrossConnection { 7395 if !iter.page.NotDone() { 7396 return ExpressRouteCrossConnection{} 7397 } 7398 return iter.page.Values()[iter.i] 7399} 7400 7401// Creates a new instance of the ExpressRouteCrossConnectionListResultIterator type. 7402func NewExpressRouteCrossConnectionListResultIterator(page ExpressRouteCrossConnectionListResultPage) ExpressRouteCrossConnectionListResultIterator { 7403 return ExpressRouteCrossConnectionListResultIterator{page: page} 7404} 7405 7406// IsEmpty returns true if the ListResult contains no values. 7407func (ercclr ExpressRouteCrossConnectionListResult) IsEmpty() bool { 7408 return ercclr.Value == nil || len(*ercclr.Value) == 0 7409} 7410 7411// hasNextLink returns true if the NextLink is not empty. 7412func (ercclr ExpressRouteCrossConnectionListResult) hasNextLink() bool { 7413 return ercclr.NextLink != nil && len(*ercclr.NextLink) != 0 7414} 7415 7416// expressRouteCrossConnectionListResultPreparer prepares a request to retrieve the next set of results. 7417// It returns nil if no more results exist. 7418func (ercclr ExpressRouteCrossConnectionListResult) expressRouteCrossConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 7419 if !ercclr.hasNextLink() { 7420 return nil, nil 7421 } 7422 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7423 autorest.AsJSON(), 7424 autorest.AsGet(), 7425 autorest.WithBaseURL(to.String(ercclr.NextLink))) 7426} 7427 7428// ExpressRouteCrossConnectionListResultPage contains a page of ExpressRouteCrossConnection values. 7429type ExpressRouteCrossConnectionListResultPage struct { 7430 fn func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error) 7431 ercclr ExpressRouteCrossConnectionListResult 7432} 7433 7434// NextWithContext advances to the next page of values. If there was an error making 7435// the request the page does not advance and the error is returned. 7436func (page *ExpressRouteCrossConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 7437 if tracing.IsEnabled() { 7438 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionListResultPage.NextWithContext") 7439 defer func() { 7440 sc := -1 7441 if page.Response().Response.Response != nil { 7442 sc = page.Response().Response.Response.StatusCode 7443 } 7444 tracing.EndSpan(ctx, sc, err) 7445 }() 7446 } 7447 for { 7448 next, err := page.fn(ctx, page.ercclr) 7449 if err != nil { 7450 return err 7451 } 7452 page.ercclr = next 7453 if !next.hasNextLink() || !next.IsEmpty() { 7454 break 7455 } 7456 } 7457 return nil 7458} 7459 7460// Next advances to the next page of values. If there was an error making 7461// the request the page does not advance and the error is returned. 7462// Deprecated: Use NextWithContext() instead. 7463func (page *ExpressRouteCrossConnectionListResultPage) Next() error { 7464 return page.NextWithContext(context.Background()) 7465} 7466 7467// NotDone returns true if the page enumeration should be started or is not yet complete. 7468func (page ExpressRouteCrossConnectionListResultPage) NotDone() bool { 7469 return !page.ercclr.IsEmpty() 7470} 7471 7472// Response returns the raw server response from the last page request. 7473func (page ExpressRouteCrossConnectionListResultPage) Response() ExpressRouteCrossConnectionListResult { 7474 return page.ercclr 7475} 7476 7477// Values returns the slice of values for the current page or nil if there are no values. 7478func (page ExpressRouteCrossConnectionListResultPage) Values() []ExpressRouteCrossConnection { 7479 if page.ercclr.IsEmpty() { 7480 return nil 7481 } 7482 return *page.ercclr.Value 7483} 7484 7485// Creates a new instance of the ExpressRouteCrossConnectionListResultPage type. 7486func NewExpressRouteCrossConnectionListResultPage(cur ExpressRouteCrossConnectionListResult, getNextPage func(context.Context, ExpressRouteCrossConnectionListResult) (ExpressRouteCrossConnectionListResult, error)) ExpressRouteCrossConnectionListResultPage { 7487 return ExpressRouteCrossConnectionListResultPage{ 7488 fn: getNextPage, 7489 ercclr: cur, 7490 } 7491} 7492 7493// ExpressRouteCrossConnectionPeering peering in an ExpressRoute Cross Connection resource. 7494type ExpressRouteCrossConnectionPeering struct { 7495 autorest.Response `json:"-"` 7496 *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` 7497 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 7498 Name *string `json:"name,omitempty"` 7499 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 7500 Etag *string `json:"etag,omitempty"` 7501 // ID - Resource ID. 7502 ID *string `json:"id,omitempty"` 7503} 7504 7505// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeering. 7506func (erccp ExpressRouteCrossConnectionPeering) MarshalJSON() ([]byte, error) { 7507 objectMap := make(map[string]interface{}) 7508 if erccp.ExpressRouteCrossConnectionPeeringProperties != nil { 7509 objectMap["properties"] = erccp.ExpressRouteCrossConnectionPeeringProperties 7510 } 7511 if erccp.Name != nil { 7512 objectMap["name"] = erccp.Name 7513 } 7514 if erccp.ID != nil { 7515 objectMap["id"] = erccp.ID 7516 } 7517 return json.Marshal(objectMap) 7518} 7519 7520// UnmarshalJSON is the custom unmarshaler for ExpressRouteCrossConnectionPeering struct. 7521func (erccp *ExpressRouteCrossConnectionPeering) UnmarshalJSON(body []byte) error { 7522 var m map[string]*json.RawMessage 7523 err := json.Unmarshal(body, &m) 7524 if err != nil { 7525 return err 7526 } 7527 for k, v := range m { 7528 switch k { 7529 case "properties": 7530 if v != nil { 7531 var expressRouteCrossConnectionPeeringProperties ExpressRouteCrossConnectionPeeringProperties 7532 err = json.Unmarshal(*v, &expressRouteCrossConnectionPeeringProperties) 7533 if err != nil { 7534 return err 7535 } 7536 erccp.ExpressRouteCrossConnectionPeeringProperties = &expressRouteCrossConnectionPeeringProperties 7537 } 7538 case "name": 7539 if v != nil { 7540 var name string 7541 err = json.Unmarshal(*v, &name) 7542 if err != nil { 7543 return err 7544 } 7545 erccp.Name = &name 7546 } 7547 case "etag": 7548 if v != nil { 7549 var etag string 7550 err = json.Unmarshal(*v, &etag) 7551 if err != nil { 7552 return err 7553 } 7554 erccp.Etag = &etag 7555 } 7556 case "id": 7557 if v != nil { 7558 var ID string 7559 err = json.Unmarshal(*v, &ID) 7560 if err != nil { 7561 return err 7562 } 7563 erccp.ID = &ID 7564 } 7565 } 7566 } 7567 7568 return nil 7569} 7570 7571// ExpressRouteCrossConnectionPeeringList response for ListPeering API service call retrieves all peerings 7572// that belong to an ExpressRouteCrossConnection. 7573type ExpressRouteCrossConnectionPeeringList struct { 7574 autorest.Response `json:"-"` 7575 // Value - The peerings in an express route cross connection. 7576 Value *[]ExpressRouteCrossConnectionPeering `json:"value,omitempty"` 7577 // NextLink - READ-ONLY; The URL to get the next set of results. 7578 NextLink *string `json:"nextLink,omitempty"` 7579} 7580 7581// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringList. 7582func (erccpl ExpressRouteCrossConnectionPeeringList) MarshalJSON() ([]byte, error) { 7583 objectMap := make(map[string]interface{}) 7584 if erccpl.Value != nil { 7585 objectMap["value"] = erccpl.Value 7586 } 7587 return json.Marshal(objectMap) 7588} 7589 7590// ExpressRouteCrossConnectionPeeringListIterator provides access to a complete listing of 7591// ExpressRouteCrossConnectionPeering values. 7592type ExpressRouteCrossConnectionPeeringListIterator struct { 7593 i int 7594 page ExpressRouteCrossConnectionPeeringListPage 7595} 7596 7597// NextWithContext advances to the next value. If there was an error making 7598// the request the iterator does not advance and the error is returned. 7599func (iter *ExpressRouteCrossConnectionPeeringListIterator) NextWithContext(ctx context.Context) (err error) { 7600 if tracing.IsEnabled() { 7601 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListIterator.NextWithContext") 7602 defer func() { 7603 sc := -1 7604 if iter.Response().Response.Response != nil { 7605 sc = iter.Response().Response.Response.StatusCode 7606 } 7607 tracing.EndSpan(ctx, sc, err) 7608 }() 7609 } 7610 iter.i++ 7611 if iter.i < len(iter.page.Values()) { 7612 return nil 7613 } 7614 err = iter.page.NextWithContext(ctx) 7615 if err != nil { 7616 iter.i-- 7617 return err 7618 } 7619 iter.i = 0 7620 return nil 7621} 7622 7623// Next advances to the next value. If there was an error making 7624// the request the iterator does not advance and the error is returned. 7625// Deprecated: Use NextWithContext() instead. 7626func (iter *ExpressRouteCrossConnectionPeeringListIterator) Next() error { 7627 return iter.NextWithContext(context.Background()) 7628} 7629 7630// NotDone returns true if the enumeration should be started or is not yet complete. 7631func (iter ExpressRouteCrossConnectionPeeringListIterator) NotDone() bool { 7632 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7633} 7634 7635// Response returns the raw server response from the last page request. 7636func (iter ExpressRouteCrossConnectionPeeringListIterator) Response() ExpressRouteCrossConnectionPeeringList { 7637 return iter.page.Response() 7638} 7639 7640// Value returns the current value or a zero-initialized value if the 7641// iterator has advanced beyond the end of the collection. 7642func (iter ExpressRouteCrossConnectionPeeringListIterator) Value() ExpressRouteCrossConnectionPeering { 7643 if !iter.page.NotDone() { 7644 return ExpressRouteCrossConnectionPeering{} 7645 } 7646 return iter.page.Values()[iter.i] 7647} 7648 7649// Creates a new instance of the ExpressRouteCrossConnectionPeeringListIterator type. 7650func NewExpressRouteCrossConnectionPeeringListIterator(page ExpressRouteCrossConnectionPeeringListPage) ExpressRouteCrossConnectionPeeringListIterator { 7651 return ExpressRouteCrossConnectionPeeringListIterator{page: page} 7652} 7653 7654// IsEmpty returns true if the ListResult contains no values. 7655func (erccpl ExpressRouteCrossConnectionPeeringList) IsEmpty() bool { 7656 return erccpl.Value == nil || len(*erccpl.Value) == 0 7657} 7658 7659// hasNextLink returns true if the NextLink is not empty. 7660func (erccpl ExpressRouteCrossConnectionPeeringList) hasNextLink() bool { 7661 return erccpl.NextLink != nil && len(*erccpl.NextLink) != 0 7662} 7663 7664// expressRouteCrossConnectionPeeringListPreparer prepares a request to retrieve the next set of results. 7665// It returns nil if no more results exist. 7666func (erccpl ExpressRouteCrossConnectionPeeringList) expressRouteCrossConnectionPeeringListPreparer(ctx context.Context) (*http.Request, error) { 7667 if !erccpl.hasNextLink() { 7668 return nil, nil 7669 } 7670 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7671 autorest.AsJSON(), 7672 autorest.AsGet(), 7673 autorest.WithBaseURL(to.String(erccpl.NextLink))) 7674} 7675 7676// ExpressRouteCrossConnectionPeeringListPage contains a page of ExpressRouteCrossConnectionPeering values. 7677type ExpressRouteCrossConnectionPeeringListPage struct { 7678 fn func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error) 7679 erccpl ExpressRouteCrossConnectionPeeringList 7680} 7681 7682// NextWithContext advances to the next page of values. If there was an error making 7683// the request the page does not advance and the error is returned. 7684func (page *ExpressRouteCrossConnectionPeeringListPage) NextWithContext(ctx context.Context) (err error) { 7685 if tracing.IsEnabled() { 7686 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCrossConnectionPeeringListPage.NextWithContext") 7687 defer func() { 7688 sc := -1 7689 if page.Response().Response.Response != nil { 7690 sc = page.Response().Response.Response.StatusCode 7691 } 7692 tracing.EndSpan(ctx, sc, err) 7693 }() 7694 } 7695 for { 7696 next, err := page.fn(ctx, page.erccpl) 7697 if err != nil { 7698 return err 7699 } 7700 page.erccpl = next 7701 if !next.hasNextLink() || !next.IsEmpty() { 7702 break 7703 } 7704 } 7705 return nil 7706} 7707 7708// Next advances to the next page of values. If there was an error making 7709// the request the page does not advance and the error is returned. 7710// Deprecated: Use NextWithContext() instead. 7711func (page *ExpressRouteCrossConnectionPeeringListPage) Next() error { 7712 return page.NextWithContext(context.Background()) 7713} 7714 7715// NotDone returns true if the page enumeration should be started or is not yet complete. 7716func (page ExpressRouteCrossConnectionPeeringListPage) NotDone() bool { 7717 return !page.erccpl.IsEmpty() 7718} 7719 7720// Response returns the raw server response from the last page request. 7721func (page ExpressRouteCrossConnectionPeeringListPage) Response() ExpressRouteCrossConnectionPeeringList { 7722 return page.erccpl 7723} 7724 7725// Values returns the slice of values for the current page or nil if there are no values. 7726func (page ExpressRouteCrossConnectionPeeringListPage) Values() []ExpressRouteCrossConnectionPeering { 7727 if page.erccpl.IsEmpty() { 7728 return nil 7729 } 7730 return *page.erccpl.Value 7731} 7732 7733// Creates a new instance of the ExpressRouteCrossConnectionPeeringListPage type. 7734func NewExpressRouteCrossConnectionPeeringListPage(cur ExpressRouteCrossConnectionPeeringList, getNextPage func(context.Context, ExpressRouteCrossConnectionPeeringList) (ExpressRouteCrossConnectionPeeringList, error)) ExpressRouteCrossConnectionPeeringListPage { 7735 return ExpressRouteCrossConnectionPeeringListPage{ 7736 fn: getNextPage, 7737 erccpl: cur, 7738 } 7739} 7740 7741// ExpressRouteCrossConnectionPeeringProperties ... 7742type ExpressRouteCrossConnectionPeeringProperties struct { 7743 // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' 7744 PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` 7745 // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' 7746 State ExpressRoutePeeringState `json:"state,omitempty"` 7747 // AzureASN - READ-ONLY; The Azure ASN. 7748 AzureASN *int32 `json:"azureASN,omitempty"` 7749 // PeerASN - The peer ASN. 7750 PeerASN *int64 `json:"peerASN,omitempty"` 7751 // PrimaryPeerAddressPrefix - The primary address prefix. 7752 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` 7753 // SecondaryPeerAddressPrefix - The secondary address prefix. 7754 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` 7755 // PrimaryAzurePort - READ-ONLY; The primary port. 7756 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` 7757 // SecondaryAzurePort - READ-ONLY; The secondary port. 7758 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` 7759 // SharedKey - The shared key. 7760 SharedKey *string `json:"sharedKey,omitempty"` 7761 // VlanID - The VLAN ID. 7762 VlanID *int32 `json:"vlanId,omitempty"` 7763 // MicrosoftPeeringConfig - The Microsoft peering configuration. 7764 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` 7765 // ProvisioningState - READ-ONLY; Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 7766 ProvisioningState *string `json:"provisioningState,omitempty"` 7767 // GatewayManagerEtag - The GatewayManager Etag. 7768 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` 7769 // LastModifiedBy - Gets whether the provider or the customer last modified the peering. 7770 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 7771 // Ipv6PeeringConfig - The IPv6 peering configuration. 7772 Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` 7773} 7774 7775// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionPeeringProperties. 7776func (erccpp ExpressRouteCrossConnectionPeeringProperties) MarshalJSON() ([]byte, error) { 7777 objectMap := make(map[string]interface{}) 7778 if erccpp.PeeringType != "" { 7779 objectMap["peeringType"] = erccpp.PeeringType 7780 } 7781 if erccpp.State != "" { 7782 objectMap["state"] = erccpp.State 7783 } 7784 if erccpp.PeerASN != nil { 7785 objectMap["peerASN"] = erccpp.PeerASN 7786 } 7787 if erccpp.PrimaryPeerAddressPrefix != nil { 7788 objectMap["primaryPeerAddressPrefix"] = erccpp.PrimaryPeerAddressPrefix 7789 } 7790 if erccpp.SecondaryPeerAddressPrefix != nil { 7791 objectMap["secondaryPeerAddressPrefix"] = erccpp.SecondaryPeerAddressPrefix 7792 } 7793 if erccpp.SharedKey != nil { 7794 objectMap["sharedKey"] = erccpp.SharedKey 7795 } 7796 if erccpp.VlanID != nil { 7797 objectMap["vlanId"] = erccpp.VlanID 7798 } 7799 if erccpp.MicrosoftPeeringConfig != nil { 7800 objectMap["microsoftPeeringConfig"] = erccpp.MicrosoftPeeringConfig 7801 } 7802 if erccpp.GatewayManagerEtag != nil { 7803 objectMap["gatewayManagerEtag"] = erccpp.GatewayManagerEtag 7804 } 7805 if erccpp.LastModifiedBy != nil { 7806 objectMap["lastModifiedBy"] = erccpp.LastModifiedBy 7807 } 7808 if erccpp.Ipv6PeeringConfig != nil { 7809 objectMap["ipv6PeeringConfig"] = erccpp.Ipv6PeeringConfig 7810 } 7811 return json.Marshal(objectMap) 7812} 7813 7814// ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 7815// results of a long-running operation. 7816type ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture struct { 7817 azure.FutureAPI 7818 // Result returns the result of the asynchronous operation. 7819 // If the operation has not completed it will return an error. 7820 Result func(ExpressRouteCrossConnectionPeeringsClient) (ExpressRouteCrossConnectionPeering, error) 7821} 7822 7823// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7824func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7825 var azFuture azure.Future 7826 if err := json.Unmarshal(body, &azFuture); err != nil { 7827 return err 7828 } 7829 future.FutureAPI = &azFuture 7830 future.Result = future.result 7831 return nil 7832} 7833 7834// result is the default implementation for ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture.Result. 7835func (future *ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (erccp ExpressRouteCrossConnectionPeering, err error) { 7836 var done bool 7837 done, err = future.DoneWithContext(context.Background(), client) 7838 if err != nil { 7839 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7840 return 7841 } 7842 if !done { 7843 erccp.Response.Response = future.Response() 7844 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture") 7845 return 7846 } 7847 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7848 if erccp.Response.Response, err = future.GetResult(sender); err == nil && erccp.Response.Response.StatusCode != http.StatusNoContent { 7849 erccp, err = client.CreateOrUpdateResponder(erccp.Response.Response) 7850 if err != nil { 7851 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsCreateOrUpdateFuture", "Result", erccp.Response.Response, "Failure responding to request") 7852 } 7853 } 7854 return 7855} 7856 7857// ExpressRouteCrossConnectionPeeringsDeleteFuture an abstraction for monitoring and retrieving the results 7858// of a long-running operation. 7859type ExpressRouteCrossConnectionPeeringsDeleteFuture struct { 7860 azure.FutureAPI 7861 // Result returns the result of the asynchronous operation. 7862 // If the operation has not completed it will return an error. 7863 Result func(ExpressRouteCrossConnectionPeeringsClient) (autorest.Response, error) 7864} 7865 7866// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7867func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { 7868 var azFuture azure.Future 7869 if err := json.Unmarshal(body, &azFuture); err != nil { 7870 return err 7871 } 7872 future.FutureAPI = &azFuture 7873 future.Result = future.result 7874 return nil 7875} 7876 7877// result is the default implementation for ExpressRouteCrossConnectionPeeringsDeleteFuture.Result. 7878func (future *ExpressRouteCrossConnectionPeeringsDeleteFuture) result(client ExpressRouteCrossConnectionPeeringsClient) (ar autorest.Response, err error) { 7879 var done bool 7880 done, err = future.DoneWithContext(context.Background(), client) 7881 if err != nil { 7882 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 7883 return 7884 } 7885 if !done { 7886 ar.Response = future.Response() 7887 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionPeeringsDeleteFuture") 7888 return 7889 } 7890 ar.Response = future.Response() 7891 return 7892} 7893 7894// ExpressRouteCrossConnectionProperties properties of ExpressRouteCrossConnection. 7895type ExpressRouteCrossConnectionProperties struct { 7896 // PrimaryAzurePort - READ-ONLY; The name of the primary port. 7897 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` 7898 // SecondaryAzurePort - READ-ONLY; The name of the secondary port. 7899 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` 7900 // STag - READ-ONLY; The identifier of the circuit traffic. 7901 STag *int32 `json:"sTag,omitempty"` 7902 // PeeringLocation - The peering location of the ExpressRoute circuit. 7903 PeeringLocation *string `json:"peeringLocation,omitempty"` 7904 // BandwidthInMbps - The circuit bandwidth In Mbps. 7905 BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` 7906 // ExpressRouteCircuit - The ExpressRouteCircuit 7907 ExpressRouteCircuit *ExpressRouteCircuitReference `json:"expressRouteCircuit,omitempty"` 7908 // ServiceProviderProvisioningState - The provisioning state of the circuit in the connectivity provider system. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' 7909 ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` 7910 // ServiceProviderNotes - Additional read only notes set by the connectivity provider. 7911 ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` 7912 // ProvisioningState - READ-ONLY; Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 7913 ProvisioningState *string `json:"provisioningState,omitempty"` 7914 // Peerings - The list of peerings. 7915 Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` 7916} 7917 7918// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionProperties. 7919func (erccp ExpressRouteCrossConnectionProperties) MarshalJSON() ([]byte, error) { 7920 objectMap := make(map[string]interface{}) 7921 if erccp.PeeringLocation != nil { 7922 objectMap["peeringLocation"] = erccp.PeeringLocation 7923 } 7924 if erccp.BandwidthInMbps != nil { 7925 objectMap["bandwidthInMbps"] = erccp.BandwidthInMbps 7926 } 7927 if erccp.ExpressRouteCircuit != nil { 7928 objectMap["expressRouteCircuit"] = erccp.ExpressRouteCircuit 7929 } 7930 if erccp.ServiceProviderProvisioningState != "" { 7931 objectMap["serviceProviderProvisioningState"] = erccp.ServiceProviderProvisioningState 7932 } 7933 if erccp.ServiceProviderNotes != nil { 7934 objectMap["serviceProviderNotes"] = erccp.ServiceProviderNotes 7935 } 7936 if erccp.Peerings != nil { 7937 objectMap["peerings"] = erccp.Peerings 7938 } 7939 return json.Marshal(objectMap) 7940} 7941 7942// ExpressRouteCrossConnectionRoutesTableSummary the routes table associated with the ExpressRouteCircuit. 7943type ExpressRouteCrossConnectionRoutesTableSummary struct { 7944 // Neighbor - IP address of Neighbor router 7945 Neighbor *string `json:"neighbor,omitempty"` 7946 // Asn - Autonomous system number. 7947 Asn *int32 `json:"asn,omitempty"` 7948 // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. 7949 UpDown *string `json:"upDown,omitempty"` 7950 // StateOrPrefixesReceived - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. 7951 StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"` 7952} 7953 7954// ExpressRouteCrossConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 7955// results of a long-running operation. 7956type ExpressRouteCrossConnectionsCreateOrUpdateFuture struct { 7957 azure.FutureAPI 7958 // Result returns the result of the asynchronous operation. 7959 // If the operation has not completed it will return an error. 7960 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnection, error) 7961} 7962 7963// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7964func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7965 var azFuture azure.Future 7966 if err := json.Unmarshal(body, &azFuture); err != nil { 7967 return err 7968 } 7969 future.FutureAPI = &azFuture 7970 future.Result = future.result 7971 return nil 7972} 7973 7974// result is the default implementation for ExpressRouteCrossConnectionsCreateOrUpdateFuture.Result. 7975func (future *ExpressRouteCrossConnectionsCreateOrUpdateFuture) result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { 7976 var done bool 7977 done, err = future.DoneWithContext(context.Background(), client) 7978 if err != nil { 7979 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7980 return 7981 } 7982 if !done { 7983 ercc.Response.Response = future.Response() 7984 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsCreateOrUpdateFuture") 7985 return 7986 } 7987 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7988 if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent { 7989 ercc, err = client.CreateOrUpdateResponder(ercc.Response.Response) 7990 if err != nil { 7991 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsCreateOrUpdateFuture", "Result", ercc.Response.Response, "Failure responding to request") 7992 } 7993 } 7994 return 7995} 7996 7997// ExpressRouteCrossConnectionsListArpTableFuture an abstraction for monitoring and retrieving the results 7998// of a long-running operation. 7999type ExpressRouteCrossConnectionsListArpTableFuture struct { 8000 azure.FutureAPI 8001 // Result returns the result of the asynchronous operation. 8002 // If the operation has not completed it will return an error. 8003 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsArpTableListResult, error) 8004} 8005 8006// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8007func (future *ExpressRouteCrossConnectionsListArpTableFuture) UnmarshalJSON(body []byte) error { 8008 var azFuture azure.Future 8009 if err := json.Unmarshal(body, &azFuture); err != nil { 8010 return err 8011 } 8012 future.FutureAPI = &azFuture 8013 future.Result = future.result 8014 return nil 8015} 8016 8017// result is the default implementation for ExpressRouteCrossConnectionsListArpTableFuture.Result. 8018func (future *ExpressRouteCrossConnectionsListArpTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { 8019 var done bool 8020 done, err = future.DoneWithContext(context.Background(), client) 8021 if err != nil { 8022 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", future.Response(), "Polling failure") 8023 return 8024 } 8025 if !done { 8026 ercatlr.Response.Response = future.Response() 8027 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListArpTableFuture") 8028 return 8029 } 8030 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8031 if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { 8032 ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) 8033 if err != nil { 8034 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") 8035 } 8036 } 8037 return 8038} 8039 8040// ExpressRouteCrossConnectionsListRoutesTableFuture an abstraction for monitoring and retrieving the 8041// results of a long-running operation. 8042type ExpressRouteCrossConnectionsListRoutesTableFuture struct { 8043 azure.FutureAPI 8044 // Result returns the result of the asynchronous operation. 8045 // If the operation has not completed it will return an error. 8046 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCircuitsRoutesTableListResult, error) 8047} 8048 8049// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8050func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) UnmarshalJSON(body []byte) error { 8051 var azFuture azure.Future 8052 if err := json.Unmarshal(body, &azFuture); err != nil { 8053 return err 8054 } 8055 future.FutureAPI = &azFuture 8056 future.Result = future.result 8057 return nil 8058} 8059 8060// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableFuture.Result. 8061func (future *ExpressRouteCrossConnectionsListRoutesTableFuture) result(client ExpressRouteCrossConnectionsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { 8062 var done bool 8063 done, err = future.DoneWithContext(context.Background(), client) 8064 if err != nil { 8065 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", future.Response(), "Polling failure") 8066 return 8067 } 8068 if !done { 8069 ercrtlr.Response.Response = future.Response() 8070 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableFuture") 8071 return 8072 } 8073 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8074 if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { 8075 ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) 8076 if err != nil { 8077 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") 8078 } 8079 } 8080 return 8081} 8082 8083// ExpressRouteCrossConnectionsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving 8084// the results of a long-running operation. 8085type ExpressRouteCrossConnectionsListRoutesTableSummaryFuture struct { 8086 azure.FutureAPI 8087 // Result returns the result of the asynchronous operation. 8088 // If the operation has not completed it will return an error. 8089 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnectionsRoutesTableSummaryListResult, error) 8090} 8091 8092// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8093func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { 8094 var azFuture azure.Future 8095 if err := json.Unmarshal(body, &azFuture); err != nil { 8096 return err 8097 } 8098 future.FutureAPI = &azFuture 8099 future.Result = future.result 8100 return nil 8101} 8102 8103// result is the default implementation for ExpressRouteCrossConnectionsListRoutesTableSummaryFuture.Result. 8104func (future *ExpressRouteCrossConnectionsListRoutesTableSummaryFuture) result(client ExpressRouteCrossConnectionsClient) (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult, err error) { 8105 var done bool 8106 done, err = future.DoneWithContext(context.Background(), client) 8107 if err != nil { 8108 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") 8109 return 8110 } 8111 if !done { 8112 erccrtslr.Response.Response = future.Response() 8113 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture") 8114 return 8115 } 8116 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8117 if erccrtslr.Response.Response, err = future.GetResult(sender); err == nil && erccrtslr.Response.Response.StatusCode != http.StatusNoContent { 8118 erccrtslr, err = client.ListRoutesTableSummaryResponder(erccrtslr.Response.Response) 8119 if err != nil { 8120 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsListRoutesTableSummaryFuture", "Result", erccrtslr.Response.Response, "Failure responding to request") 8121 } 8122 } 8123 return 8124} 8125 8126// ExpressRouteCrossConnectionsRoutesTableSummaryListResult response for ListRoutesTable associated with 8127// the Express Route Cross Connections. 8128type ExpressRouteCrossConnectionsRoutesTableSummaryListResult struct { 8129 autorest.Response `json:"-"` 8130 // Value - A list of the routes table. 8131 Value *[]ExpressRouteCrossConnectionRoutesTableSummary `json:"value,omitempty"` 8132 // NextLink - READ-ONLY; The URL to get the next set of results. 8133 NextLink *string `json:"nextLink,omitempty"` 8134} 8135 8136// MarshalJSON is the custom marshaler for ExpressRouteCrossConnectionsRoutesTableSummaryListResult. 8137func (erccrtslr ExpressRouteCrossConnectionsRoutesTableSummaryListResult) MarshalJSON() ([]byte, error) { 8138 objectMap := make(map[string]interface{}) 8139 if erccrtslr.Value != nil { 8140 objectMap["value"] = erccrtslr.Value 8141 } 8142 return json.Marshal(objectMap) 8143} 8144 8145// ExpressRouteCrossConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the results of 8146// a long-running operation. 8147type ExpressRouteCrossConnectionsUpdateTagsFuture struct { 8148 azure.FutureAPI 8149 // Result returns the result of the asynchronous operation. 8150 // If the operation has not completed it will return an error. 8151 Result func(ExpressRouteCrossConnectionsClient) (ExpressRouteCrossConnection, error) 8152} 8153 8154// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8155func (future *ExpressRouteCrossConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error { 8156 var azFuture azure.Future 8157 if err := json.Unmarshal(body, &azFuture); err != nil { 8158 return err 8159 } 8160 future.FutureAPI = &azFuture 8161 future.Result = future.result 8162 return nil 8163} 8164 8165// result is the default implementation for ExpressRouteCrossConnectionsUpdateTagsFuture.Result. 8166func (future *ExpressRouteCrossConnectionsUpdateTagsFuture) result(client ExpressRouteCrossConnectionsClient) (ercc ExpressRouteCrossConnection, err error) { 8167 var done bool 8168 done, err = future.DoneWithContext(context.Background(), client) 8169 if err != nil { 8170 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure") 8171 return 8172 } 8173 if !done { 8174 ercc.Response.Response = future.Response() 8175 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCrossConnectionsUpdateTagsFuture") 8176 return 8177 } 8178 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8179 if ercc.Response.Response, err = future.GetResult(sender); err == nil && ercc.Response.Response.StatusCode != http.StatusNoContent { 8180 ercc, err = client.UpdateTagsResponder(ercc.Response.Response) 8181 if err != nil { 8182 err = autorest.NewErrorWithError(err, "network.ExpressRouteCrossConnectionsUpdateTagsFuture", "Result", ercc.Response.Response, "Failure responding to request") 8183 } 8184 } 8185 return 8186} 8187 8188// ExpressRouteServiceProvider a ExpressRouteResourceProvider object. 8189type ExpressRouteServiceProvider struct { 8190 *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` 8191 // ID - Resource ID. 8192 ID *string `json:"id,omitempty"` 8193 // Name - READ-ONLY; Resource name. 8194 Name *string `json:"name,omitempty"` 8195 // Type - READ-ONLY; Resource type. 8196 Type *string `json:"type,omitempty"` 8197 // Location - Resource location. 8198 Location *string `json:"location,omitempty"` 8199 // Tags - Resource tags. 8200 Tags map[string]*string `json:"tags"` 8201} 8202 8203// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider. 8204func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { 8205 objectMap := make(map[string]interface{}) 8206 if ersp.ExpressRouteServiceProviderPropertiesFormat != nil { 8207 objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat 8208 } 8209 if ersp.ID != nil { 8210 objectMap["id"] = ersp.ID 8211 } 8212 if ersp.Location != nil { 8213 objectMap["location"] = ersp.Location 8214 } 8215 if ersp.Tags != nil { 8216 objectMap["tags"] = ersp.Tags 8217 } 8218 return json.Marshal(objectMap) 8219} 8220 8221// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. 8222func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error { 8223 var m map[string]*json.RawMessage 8224 err := json.Unmarshal(body, &m) 8225 if err != nil { 8226 return err 8227 } 8228 for k, v := range m { 8229 switch k { 8230 case "properties": 8231 if v != nil { 8232 var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat 8233 err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat) 8234 if err != nil { 8235 return err 8236 } 8237 ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat 8238 } 8239 case "id": 8240 if v != nil { 8241 var ID string 8242 err = json.Unmarshal(*v, &ID) 8243 if err != nil { 8244 return err 8245 } 8246 ersp.ID = &ID 8247 } 8248 case "name": 8249 if v != nil { 8250 var name string 8251 err = json.Unmarshal(*v, &name) 8252 if err != nil { 8253 return err 8254 } 8255 ersp.Name = &name 8256 } 8257 case "type": 8258 if v != nil { 8259 var typeVar string 8260 err = json.Unmarshal(*v, &typeVar) 8261 if err != nil { 8262 return err 8263 } 8264 ersp.Type = &typeVar 8265 } 8266 case "location": 8267 if v != nil { 8268 var location string 8269 err = json.Unmarshal(*v, &location) 8270 if err != nil { 8271 return err 8272 } 8273 ersp.Location = &location 8274 } 8275 case "tags": 8276 if v != nil { 8277 var tags map[string]*string 8278 err = json.Unmarshal(*v, &tags) 8279 if err != nil { 8280 return err 8281 } 8282 ersp.Tags = tags 8283 } 8284 } 8285 } 8286 8287 return nil 8288} 8289 8290// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider 8291// resources. 8292type ExpressRouteServiceProviderBandwidthsOffered struct { 8293 // OfferName - The OfferName. 8294 OfferName *string `json:"offerName,omitempty"` 8295 // ValueInMbps - The ValueInMbps. 8296 ValueInMbps *int32 `json:"valueInMbps,omitempty"` 8297} 8298 8299// ExpressRouteServiceProviderListResult response for the ListExpressRouteServiceProvider API service call. 8300type ExpressRouteServiceProviderListResult struct { 8301 autorest.Response `json:"-"` 8302 // Value - A list of ExpressRouteResourceProvider resources. 8303 Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` 8304 // NextLink - The URL to get the next set of results. 8305 NextLink *string `json:"nextLink,omitempty"` 8306} 8307 8308// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of 8309// ExpressRouteServiceProvider values. 8310type ExpressRouteServiceProviderListResultIterator struct { 8311 i int 8312 page ExpressRouteServiceProviderListResultPage 8313} 8314 8315// NextWithContext advances to the next value. If there was an error making 8316// the request the iterator does not advance and the error is returned. 8317func (iter *ExpressRouteServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { 8318 if tracing.IsEnabled() { 8319 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultIterator.NextWithContext") 8320 defer func() { 8321 sc := -1 8322 if iter.Response().Response.Response != nil { 8323 sc = iter.Response().Response.Response.StatusCode 8324 } 8325 tracing.EndSpan(ctx, sc, err) 8326 }() 8327 } 8328 iter.i++ 8329 if iter.i < len(iter.page.Values()) { 8330 return nil 8331 } 8332 err = iter.page.NextWithContext(ctx) 8333 if err != nil { 8334 iter.i-- 8335 return err 8336 } 8337 iter.i = 0 8338 return nil 8339} 8340 8341// Next advances to the next value. If there was an error making 8342// the request the iterator does not advance and the error is returned. 8343// Deprecated: Use NextWithContext() instead. 8344func (iter *ExpressRouteServiceProviderListResultIterator) Next() error { 8345 return iter.NextWithContext(context.Background()) 8346} 8347 8348// NotDone returns true if the enumeration should be started or is not yet complete. 8349func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool { 8350 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8351} 8352 8353// Response returns the raw server response from the last page request. 8354func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult { 8355 return iter.page.Response() 8356} 8357 8358// Value returns the current value or a zero-initialized value if the 8359// iterator has advanced beyond the end of the collection. 8360func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider { 8361 if !iter.page.NotDone() { 8362 return ExpressRouteServiceProvider{} 8363 } 8364 return iter.page.Values()[iter.i] 8365} 8366 8367// Creates a new instance of the ExpressRouteServiceProviderListResultIterator type. 8368func NewExpressRouteServiceProviderListResultIterator(page ExpressRouteServiceProviderListResultPage) ExpressRouteServiceProviderListResultIterator { 8369 return ExpressRouteServiceProviderListResultIterator{page: page} 8370} 8371 8372// IsEmpty returns true if the ListResult contains no values. 8373func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { 8374 return ersplr.Value == nil || len(*ersplr.Value) == 0 8375} 8376 8377// hasNextLink returns true if the NextLink is not empty. 8378func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool { 8379 return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0 8380} 8381 8382// expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. 8383// It returns nil if no more results exist. 8384func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { 8385 if !ersplr.hasNextLink() { 8386 return nil, nil 8387 } 8388 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8389 autorest.AsJSON(), 8390 autorest.AsGet(), 8391 autorest.WithBaseURL(to.String(ersplr.NextLink))) 8392} 8393 8394// ExpressRouteServiceProviderListResultPage contains a page of ExpressRouteServiceProvider values. 8395type ExpressRouteServiceProviderListResultPage struct { 8396 fn func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error) 8397 ersplr ExpressRouteServiceProviderListResult 8398} 8399 8400// NextWithContext advances to the next page of values. If there was an error making 8401// the request the page does not advance and the error is returned. 8402func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) { 8403 if tracing.IsEnabled() { 8404 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultPage.NextWithContext") 8405 defer func() { 8406 sc := -1 8407 if page.Response().Response.Response != nil { 8408 sc = page.Response().Response.Response.StatusCode 8409 } 8410 tracing.EndSpan(ctx, sc, err) 8411 }() 8412 } 8413 for { 8414 next, err := page.fn(ctx, page.ersplr) 8415 if err != nil { 8416 return err 8417 } 8418 page.ersplr = next 8419 if !next.hasNextLink() || !next.IsEmpty() { 8420 break 8421 } 8422 } 8423 return nil 8424} 8425 8426// Next advances to the next page of values. If there was an error making 8427// the request the page does not advance and the error is returned. 8428// Deprecated: Use NextWithContext() instead. 8429func (page *ExpressRouteServiceProviderListResultPage) Next() error { 8430 return page.NextWithContext(context.Background()) 8431} 8432 8433// NotDone returns true if the page enumeration should be started or is not yet complete. 8434func (page ExpressRouteServiceProviderListResultPage) NotDone() bool { 8435 return !page.ersplr.IsEmpty() 8436} 8437 8438// Response returns the raw server response from the last page request. 8439func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult { 8440 return page.ersplr 8441} 8442 8443// Values returns the slice of values for the current page or nil if there are no values. 8444func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider { 8445 if page.ersplr.IsEmpty() { 8446 return nil 8447 } 8448 return *page.ersplr.Value 8449} 8450 8451// Creates a new instance of the ExpressRouteServiceProviderListResultPage type. 8452func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage { 8453 return ExpressRouteServiceProviderListResultPage{ 8454 fn: getNextPage, 8455 ersplr: cur, 8456 } 8457} 8458 8459// ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider. 8460type ExpressRouteServiceProviderPropertiesFormat struct { 8461 // PeeringLocations - Get a list of peering locations. 8462 PeeringLocations *[]string `json:"peeringLocations,omitempty"` 8463 // BandwidthsOffered - Gets bandwidths offered. 8464 BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` 8465 // ProvisioningState - Gets the provisioning state of the resource. 8466 ProvisioningState *string `json:"provisioningState,omitempty"` 8467} 8468 8469// FlowLogInformation information on the configuration of flow log and traffic analytics (optional) . 8470type FlowLogInformation struct { 8471 autorest.Response `json:"-"` 8472 // TargetResourceID - The ID of the resource to configure for flow log and traffic analytics (optional) . 8473 TargetResourceID *string `json:"targetResourceId,omitempty"` 8474 *FlowLogProperties `json:"properties,omitempty"` 8475 FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` 8476} 8477 8478// MarshalJSON is the custom marshaler for FlowLogInformation. 8479func (fli FlowLogInformation) MarshalJSON() ([]byte, error) { 8480 objectMap := make(map[string]interface{}) 8481 if fli.TargetResourceID != nil { 8482 objectMap["targetResourceId"] = fli.TargetResourceID 8483 } 8484 if fli.FlowLogProperties != nil { 8485 objectMap["properties"] = fli.FlowLogProperties 8486 } 8487 if fli.FlowAnalyticsConfiguration != nil { 8488 objectMap["flowAnalyticsConfiguration"] = fli.FlowAnalyticsConfiguration 8489 } 8490 return json.Marshal(objectMap) 8491} 8492 8493// UnmarshalJSON is the custom unmarshaler for FlowLogInformation struct. 8494func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { 8495 var m map[string]*json.RawMessage 8496 err := json.Unmarshal(body, &m) 8497 if err != nil { 8498 return err 8499 } 8500 for k, v := range m { 8501 switch k { 8502 case "targetResourceId": 8503 if v != nil { 8504 var targetResourceID string 8505 err = json.Unmarshal(*v, &targetResourceID) 8506 if err != nil { 8507 return err 8508 } 8509 fli.TargetResourceID = &targetResourceID 8510 } 8511 case "properties": 8512 if v != nil { 8513 var flowLogProperties FlowLogProperties 8514 err = json.Unmarshal(*v, &flowLogProperties) 8515 if err != nil { 8516 return err 8517 } 8518 fli.FlowLogProperties = &flowLogProperties 8519 } 8520 case "flowAnalyticsConfiguration": 8521 if v != nil { 8522 var flowAnalyticsConfiguration TrafficAnalyticsProperties 8523 err = json.Unmarshal(*v, &flowAnalyticsConfiguration) 8524 if err != nil { 8525 return err 8526 } 8527 fli.FlowAnalyticsConfiguration = &flowAnalyticsConfiguration 8528 } 8529 } 8530 } 8531 8532 return nil 8533} 8534 8535// FlowLogProperties parameters that define the configuration of flow log. 8536type FlowLogProperties struct { 8537 // StorageID - ID of the storage account which is used to store the flow log. 8538 StorageID *string `json:"storageId,omitempty"` 8539 // Enabled - Flag to enable/disable flow logging. 8540 Enabled *bool `json:"enabled,omitempty"` 8541 RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` 8542} 8543 8544// FlowLogStatusParameters parameters that define a resource to query flow log and traffic analytics 8545// (optional) status. 8546type FlowLogStatusParameters struct { 8547 // TargetResourceID - The target resource where getting the flow log and traffic analytics (optional) status. 8548 TargetResourceID *string `json:"targetResourceId,omitempty"` 8549} 8550 8551// FrontendIPConfiguration frontend IP address of the load balancer. 8552type FrontendIPConfiguration struct { 8553 autorest.Response `json:"-"` 8554 // FrontendIPConfigurationPropertiesFormat - Properties of the load balancer probe. 8555 *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` 8556 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 8557 Name *string `json:"name,omitempty"` 8558 // Etag - A unique read-only string that changes whenever the resource is updated. 8559 Etag *string `json:"etag,omitempty"` 8560 // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. 8561 Zones *[]string `json:"zones,omitempty"` 8562 // ID - Resource ID. 8563 ID *string `json:"id,omitempty"` 8564} 8565 8566// MarshalJSON is the custom marshaler for FrontendIPConfiguration. 8567func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) { 8568 objectMap := make(map[string]interface{}) 8569 if fic.FrontendIPConfigurationPropertiesFormat != nil { 8570 objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat 8571 } 8572 if fic.Name != nil { 8573 objectMap["name"] = fic.Name 8574 } 8575 if fic.Etag != nil { 8576 objectMap["etag"] = fic.Etag 8577 } 8578 if fic.Zones != nil { 8579 objectMap["zones"] = fic.Zones 8580 } 8581 if fic.ID != nil { 8582 objectMap["id"] = fic.ID 8583 } 8584 return json.Marshal(objectMap) 8585} 8586 8587// UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. 8588func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error { 8589 var m map[string]*json.RawMessage 8590 err := json.Unmarshal(body, &m) 8591 if err != nil { 8592 return err 8593 } 8594 for k, v := range m { 8595 switch k { 8596 case "properties": 8597 if v != nil { 8598 var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat 8599 err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat) 8600 if err != nil { 8601 return err 8602 } 8603 fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat 8604 } 8605 case "name": 8606 if v != nil { 8607 var name string 8608 err = json.Unmarshal(*v, &name) 8609 if err != nil { 8610 return err 8611 } 8612 fic.Name = &name 8613 } 8614 case "etag": 8615 if v != nil { 8616 var etag string 8617 err = json.Unmarshal(*v, &etag) 8618 if err != nil { 8619 return err 8620 } 8621 fic.Etag = &etag 8622 } 8623 case "zones": 8624 if v != nil { 8625 var zones []string 8626 err = json.Unmarshal(*v, &zones) 8627 if err != nil { 8628 return err 8629 } 8630 fic.Zones = &zones 8631 } 8632 case "id": 8633 if v != nil { 8634 var ID string 8635 err = json.Unmarshal(*v, &ID) 8636 if err != nil { 8637 return err 8638 } 8639 fic.ID = &ID 8640 } 8641 } 8642 } 8643 8644 return nil 8645} 8646 8647// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer. 8648type FrontendIPConfigurationPropertiesFormat struct { 8649 // InboundNatRules - READ-ONLY; Read only. Inbound rules URIs that use this frontend IP. 8650 InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` 8651 // InboundNatPools - READ-ONLY; Read only. Inbound pools URIs that use this frontend IP. 8652 InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` 8653 // OutboundNatRules - READ-ONLY; Read only. Outbound rules URIs that use this frontend IP. 8654 OutboundNatRules *[]SubResource `json:"outboundNatRules,omitempty"` 8655 // LoadBalancingRules - READ-ONLY; Gets load balancing rules URIs that use this frontend IP. 8656 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 8657 // PrivateIPAddress - The private IP address of the IP configuration. 8658 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 8659 // PrivateIPAllocationMethod - The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 8660 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 8661 // Subnet - The reference of the subnet resource. 8662 Subnet *Subnet `json:"subnet,omitempty"` 8663 // PublicIPAddress - The reference of the Public IP resource. 8664 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 8665 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 8666 ProvisioningState *string `json:"provisioningState,omitempty"` 8667} 8668 8669// MarshalJSON is the custom marshaler for FrontendIPConfigurationPropertiesFormat. 8670func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { 8671 objectMap := make(map[string]interface{}) 8672 if ficpf.PrivateIPAddress != nil { 8673 objectMap["privateIPAddress"] = ficpf.PrivateIPAddress 8674 } 8675 if ficpf.PrivateIPAllocationMethod != "" { 8676 objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod 8677 } 8678 if ficpf.Subnet != nil { 8679 objectMap["subnet"] = ficpf.Subnet 8680 } 8681 if ficpf.PublicIPAddress != nil { 8682 objectMap["publicIPAddress"] = ficpf.PublicIPAddress 8683 } 8684 if ficpf.ProvisioningState != nil { 8685 objectMap["provisioningState"] = ficpf.ProvisioningState 8686 } 8687 return json.Marshal(objectMap) 8688} 8689 8690// GatewayRoute gateway routing details 8691type GatewayRoute struct { 8692 // LocalAddress - READ-ONLY; The gateway's local address 8693 LocalAddress *string `json:"localAddress,omitempty"` 8694 // NetworkProperty - READ-ONLY; The route's network prefix 8695 NetworkProperty *string `json:"network,omitempty"` 8696 // NextHop - READ-ONLY; The route's next hop 8697 NextHop *string `json:"nextHop,omitempty"` 8698 // SourcePeer - READ-ONLY; The peer this route was learned from 8699 SourcePeer *string `json:"sourcePeer,omitempty"` 8700 // Origin - READ-ONLY; The source this route was learned from 8701 Origin *string `json:"origin,omitempty"` 8702 // AsPath - READ-ONLY; The route's AS path sequence 8703 AsPath *string `json:"asPath,omitempty"` 8704 // Weight - READ-ONLY; The route's weight 8705 Weight *int32 `json:"weight,omitempty"` 8706} 8707 8708// MarshalJSON is the custom marshaler for GatewayRoute. 8709func (gr GatewayRoute) MarshalJSON() ([]byte, error) { 8710 objectMap := make(map[string]interface{}) 8711 return json.Marshal(objectMap) 8712} 8713 8714// GatewayRouteListResult list of virtual network gateway routes 8715type GatewayRouteListResult struct { 8716 autorest.Response `json:"-"` 8717 // Value - List of gateway routes 8718 Value *[]GatewayRoute `json:"value,omitempty"` 8719} 8720 8721// GetVpnSitesConfigurationRequest list of Vpn-Sites 8722type GetVpnSitesConfigurationRequest struct { 8723 // VpnSites - List of resource-ids of the vpn-sites for which config is to be downloaded. 8724 VpnSites *[]SubResource `json:"vpnSites,omitempty"` 8725 // OutputBlobSasURL - The sas-url to download the configurations for vpn-sites 8726 OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` 8727} 8728 8729// HTTPConfiguration HTTP configuration of the connectivity check. 8730type HTTPConfiguration struct { 8731 // Method - HTTP method. Possible values include: 'Get' 8732 Method HTTPMethod `json:"method,omitempty"` 8733 // Headers - List of HTTP headers. 8734 Headers *[]HTTPHeader `json:"headers,omitempty"` 8735 // ValidStatusCodes - Valid status codes. 8736 ValidStatusCodes *[]int32 `json:"validStatusCodes,omitempty"` 8737} 8738 8739// HTTPHeader describes the HTTP header. 8740type HTTPHeader struct { 8741 // Name - The name in HTTP header. 8742 Name *string `json:"name,omitempty"` 8743 // Value - The value in HTTP header. 8744 Value *string `json:"value,omitempty"` 8745} 8746 8747// HubVirtualNetworkConnection hubVirtualNetworkConnection Resource. 8748type HubVirtualNetworkConnection struct { 8749 autorest.Response `json:"-"` 8750 *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"` 8751 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 8752 Etag *string `json:"etag,omitempty"` 8753 // ID - Resource ID. 8754 ID *string `json:"id,omitempty"` 8755 // Name - READ-ONLY; Resource name. 8756 Name *string `json:"name,omitempty"` 8757 // Type - READ-ONLY; Resource type. 8758 Type *string `json:"type,omitempty"` 8759 // Location - Resource location. 8760 Location *string `json:"location,omitempty"` 8761 // Tags - Resource tags. 8762 Tags map[string]*string `json:"tags"` 8763} 8764 8765// MarshalJSON is the custom marshaler for HubVirtualNetworkConnection. 8766func (hvnc HubVirtualNetworkConnection) MarshalJSON() ([]byte, error) { 8767 objectMap := make(map[string]interface{}) 8768 if hvnc.HubVirtualNetworkConnectionProperties != nil { 8769 objectMap["properties"] = hvnc.HubVirtualNetworkConnectionProperties 8770 } 8771 if hvnc.ID != nil { 8772 objectMap["id"] = hvnc.ID 8773 } 8774 if hvnc.Location != nil { 8775 objectMap["location"] = hvnc.Location 8776 } 8777 if hvnc.Tags != nil { 8778 objectMap["tags"] = hvnc.Tags 8779 } 8780 return json.Marshal(objectMap) 8781} 8782 8783// UnmarshalJSON is the custom unmarshaler for HubVirtualNetworkConnection struct. 8784func (hvnc *HubVirtualNetworkConnection) UnmarshalJSON(body []byte) error { 8785 var m map[string]*json.RawMessage 8786 err := json.Unmarshal(body, &m) 8787 if err != nil { 8788 return err 8789 } 8790 for k, v := range m { 8791 switch k { 8792 case "properties": 8793 if v != nil { 8794 var hubVirtualNetworkConnectionProperties HubVirtualNetworkConnectionProperties 8795 err = json.Unmarshal(*v, &hubVirtualNetworkConnectionProperties) 8796 if err != nil { 8797 return err 8798 } 8799 hvnc.HubVirtualNetworkConnectionProperties = &hubVirtualNetworkConnectionProperties 8800 } 8801 case "etag": 8802 if v != nil { 8803 var etag string 8804 err = json.Unmarshal(*v, &etag) 8805 if err != nil { 8806 return err 8807 } 8808 hvnc.Etag = &etag 8809 } 8810 case "id": 8811 if v != nil { 8812 var ID string 8813 err = json.Unmarshal(*v, &ID) 8814 if err != nil { 8815 return err 8816 } 8817 hvnc.ID = &ID 8818 } 8819 case "name": 8820 if v != nil { 8821 var name string 8822 err = json.Unmarshal(*v, &name) 8823 if err != nil { 8824 return err 8825 } 8826 hvnc.Name = &name 8827 } 8828 case "type": 8829 if v != nil { 8830 var typeVar string 8831 err = json.Unmarshal(*v, &typeVar) 8832 if err != nil { 8833 return err 8834 } 8835 hvnc.Type = &typeVar 8836 } 8837 case "location": 8838 if v != nil { 8839 var location string 8840 err = json.Unmarshal(*v, &location) 8841 if err != nil { 8842 return err 8843 } 8844 hvnc.Location = &location 8845 } 8846 case "tags": 8847 if v != nil { 8848 var tags map[string]*string 8849 err = json.Unmarshal(*v, &tags) 8850 if err != nil { 8851 return err 8852 } 8853 hvnc.Tags = tags 8854 } 8855 } 8856 } 8857 8858 return nil 8859} 8860 8861// HubVirtualNetworkConnectionProperties parameters for HubVirtualNetworkConnection 8862type HubVirtualNetworkConnectionProperties struct { 8863 // RemoteVirtualNetwork - Reference to the remote virtual network. 8864 RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` 8865 // AllowHubToRemoteVnetTransit - VirtualHub to RemoteVnet transit to enabled or not. 8866 AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"` 8867 // AllowRemoteVnetToUseHubVnetGateways - Allow RemoteVnet to use Virtual Hub's gateways. 8868 AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"` 8869 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 8870 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 8871} 8872 8873// InboundNatPool inbound NAT pool of the load balancer. 8874type InboundNatPool struct { 8875 // InboundNatPoolPropertiesFormat - Properties of load balancer inbound nat pool. 8876 *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` 8877 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 8878 Name *string `json:"name,omitempty"` 8879 // Etag - A unique read-only string that changes whenever the resource is updated. 8880 Etag *string `json:"etag,omitempty"` 8881 // ID - Resource ID. 8882 ID *string `json:"id,omitempty"` 8883} 8884 8885// MarshalJSON is the custom marshaler for InboundNatPool. 8886func (inp InboundNatPool) MarshalJSON() ([]byte, error) { 8887 objectMap := make(map[string]interface{}) 8888 if inp.InboundNatPoolPropertiesFormat != nil { 8889 objectMap["properties"] = inp.InboundNatPoolPropertiesFormat 8890 } 8891 if inp.Name != nil { 8892 objectMap["name"] = inp.Name 8893 } 8894 if inp.Etag != nil { 8895 objectMap["etag"] = inp.Etag 8896 } 8897 if inp.ID != nil { 8898 objectMap["id"] = inp.ID 8899 } 8900 return json.Marshal(objectMap) 8901} 8902 8903// UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. 8904func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { 8905 var m map[string]*json.RawMessage 8906 err := json.Unmarshal(body, &m) 8907 if err != nil { 8908 return err 8909 } 8910 for k, v := range m { 8911 switch k { 8912 case "properties": 8913 if v != nil { 8914 var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat 8915 err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat) 8916 if err != nil { 8917 return err 8918 } 8919 inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat 8920 } 8921 case "name": 8922 if v != nil { 8923 var name string 8924 err = json.Unmarshal(*v, &name) 8925 if err != nil { 8926 return err 8927 } 8928 inp.Name = &name 8929 } 8930 case "etag": 8931 if v != nil { 8932 var etag string 8933 err = json.Unmarshal(*v, &etag) 8934 if err != nil { 8935 return err 8936 } 8937 inp.Etag = &etag 8938 } 8939 case "id": 8940 if v != nil { 8941 var ID string 8942 err = json.Unmarshal(*v, &ID) 8943 if err != nil { 8944 return err 8945 } 8946 inp.ID = &ID 8947 } 8948 } 8949 } 8950 8951 return nil 8952} 8953 8954// InboundNatPoolPropertiesFormat properties of Inbound NAT pool. 8955type InboundNatPoolPropertiesFormat struct { 8956 // FrontendIPConfiguration - A reference to frontend IP addresses. 8957 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 8958 // Protocol - Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' 8959 Protocol TransportProtocol `json:"protocol,omitempty"` 8960 // FrontendPortRangeStart - The first port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65534. 8961 FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` 8962 // FrontendPortRangeEnd - The last port number in the range of external ports that will be used to provide Inbound Nat to NICs associated with a load balancer. Acceptable values range between 1 and 65535. 8963 FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` 8964 // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. 8965 BackendPort *int32 `json:"backendPort,omitempty"` 8966 // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. 8967 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 8968 // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. 8969 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 8970 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 8971 ProvisioningState *string `json:"provisioningState,omitempty"` 8972} 8973 8974// InboundNatRule inbound NAT rule of the load balancer. 8975type InboundNatRule struct { 8976 autorest.Response `json:"-"` 8977 // InboundNatRulePropertiesFormat - Properties of load balancer inbound nat rule. 8978 *InboundNatRulePropertiesFormat `json:"properties,omitempty"` 8979 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 8980 Name *string `json:"name,omitempty"` 8981 // Etag - A unique read-only string that changes whenever the resource is updated. 8982 Etag *string `json:"etag,omitempty"` 8983 // ID - Resource ID. 8984 ID *string `json:"id,omitempty"` 8985} 8986 8987// MarshalJSON is the custom marshaler for InboundNatRule. 8988func (inr InboundNatRule) MarshalJSON() ([]byte, error) { 8989 objectMap := make(map[string]interface{}) 8990 if inr.InboundNatRulePropertiesFormat != nil { 8991 objectMap["properties"] = inr.InboundNatRulePropertiesFormat 8992 } 8993 if inr.Name != nil { 8994 objectMap["name"] = inr.Name 8995 } 8996 if inr.Etag != nil { 8997 objectMap["etag"] = inr.Etag 8998 } 8999 if inr.ID != nil { 9000 objectMap["id"] = inr.ID 9001 } 9002 return json.Marshal(objectMap) 9003} 9004 9005// UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. 9006func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { 9007 var m map[string]*json.RawMessage 9008 err := json.Unmarshal(body, &m) 9009 if err != nil { 9010 return err 9011 } 9012 for k, v := range m { 9013 switch k { 9014 case "properties": 9015 if v != nil { 9016 var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat 9017 err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat) 9018 if err != nil { 9019 return err 9020 } 9021 inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat 9022 } 9023 case "name": 9024 if v != nil { 9025 var name string 9026 err = json.Unmarshal(*v, &name) 9027 if err != nil { 9028 return err 9029 } 9030 inr.Name = &name 9031 } 9032 case "etag": 9033 if v != nil { 9034 var etag string 9035 err = json.Unmarshal(*v, &etag) 9036 if err != nil { 9037 return err 9038 } 9039 inr.Etag = &etag 9040 } 9041 case "id": 9042 if v != nil { 9043 var ID string 9044 err = json.Unmarshal(*v, &ID) 9045 if err != nil { 9046 return err 9047 } 9048 inr.ID = &ID 9049 } 9050 } 9051 } 9052 9053 return nil 9054} 9055 9056// InboundNatRuleListResult response for ListInboundNatRule API service call. 9057type InboundNatRuleListResult struct { 9058 autorest.Response `json:"-"` 9059 // Value - A list of inbound nat rules in a load balancer. 9060 Value *[]InboundNatRule `json:"value,omitempty"` 9061 // NextLink - READ-ONLY; The URL to get the next set of results. 9062 NextLink *string `json:"nextLink,omitempty"` 9063} 9064 9065// MarshalJSON is the custom marshaler for InboundNatRuleListResult. 9066func (inrlr InboundNatRuleListResult) MarshalJSON() ([]byte, error) { 9067 objectMap := make(map[string]interface{}) 9068 if inrlr.Value != nil { 9069 objectMap["value"] = inrlr.Value 9070 } 9071 return json.Marshal(objectMap) 9072} 9073 9074// InboundNatRuleListResultIterator provides access to a complete listing of InboundNatRule values. 9075type InboundNatRuleListResultIterator struct { 9076 i int 9077 page InboundNatRuleListResultPage 9078} 9079 9080// NextWithContext advances to the next value. If there was an error making 9081// the request the iterator does not advance and the error is returned. 9082func (iter *InboundNatRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 9083 if tracing.IsEnabled() { 9084 ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultIterator.NextWithContext") 9085 defer func() { 9086 sc := -1 9087 if iter.Response().Response.Response != nil { 9088 sc = iter.Response().Response.Response.StatusCode 9089 } 9090 tracing.EndSpan(ctx, sc, err) 9091 }() 9092 } 9093 iter.i++ 9094 if iter.i < len(iter.page.Values()) { 9095 return nil 9096 } 9097 err = iter.page.NextWithContext(ctx) 9098 if err != nil { 9099 iter.i-- 9100 return err 9101 } 9102 iter.i = 0 9103 return nil 9104} 9105 9106// Next advances to the next value. If there was an error making 9107// the request the iterator does not advance and the error is returned. 9108// Deprecated: Use NextWithContext() instead. 9109func (iter *InboundNatRuleListResultIterator) Next() error { 9110 return iter.NextWithContext(context.Background()) 9111} 9112 9113// NotDone returns true if the enumeration should be started or is not yet complete. 9114func (iter InboundNatRuleListResultIterator) NotDone() bool { 9115 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9116} 9117 9118// Response returns the raw server response from the last page request. 9119func (iter InboundNatRuleListResultIterator) Response() InboundNatRuleListResult { 9120 return iter.page.Response() 9121} 9122 9123// Value returns the current value or a zero-initialized value if the 9124// iterator has advanced beyond the end of the collection. 9125func (iter InboundNatRuleListResultIterator) Value() InboundNatRule { 9126 if !iter.page.NotDone() { 9127 return InboundNatRule{} 9128 } 9129 return iter.page.Values()[iter.i] 9130} 9131 9132// Creates a new instance of the InboundNatRuleListResultIterator type. 9133func NewInboundNatRuleListResultIterator(page InboundNatRuleListResultPage) InboundNatRuleListResultIterator { 9134 return InboundNatRuleListResultIterator{page: page} 9135} 9136 9137// IsEmpty returns true if the ListResult contains no values. 9138func (inrlr InboundNatRuleListResult) IsEmpty() bool { 9139 return inrlr.Value == nil || len(*inrlr.Value) == 0 9140} 9141 9142// hasNextLink returns true if the NextLink is not empty. 9143func (inrlr InboundNatRuleListResult) hasNextLink() bool { 9144 return inrlr.NextLink != nil && len(*inrlr.NextLink) != 0 9145} 9146 9147// inboundNatRuleListResultPreparer prepares a request to retrieve the next set of results. 9148// It returns nil if no more results exist. 9149func (inrlr InboundNatRuleListResult) inboundNatRuleListResultPreparer(ctx context.Context) (*http.Request, error) { 9150 if !inrlr.hasNextLink() { 9151 return nil, nil 9152 } 9153 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9154 autorest.AsJSON(), 9155 autorest.AsGet(), 9156 autorest.WithBaseURL(to.String(inrlr.NextLink))) 9157} 9158 9159// InboundNatRuleListResultPage contains a page of InboundNatRule values. 9160type InboundNatRuleListResultPage struct { 9161 fn func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error) 9162 inrlr InboundNatRuleListResult 9163} 9164 9165// NextWithContext advances to the next page of values. If there was an error making 9166// the request the page does not advance and the error is returned. 9167func (page *InboundNatRuleListResultPage) NextWithContext(ctx context.Context) (err error) { 9168 if tracing.IsEnabled() { 9169 ctx = tracing.StartSpan(ctx, fqdn+"/InboundNatRuleListResultPage.NextWithContext") 9170 defer func() { 9171 sc := -1 9172 if page.Response().Response.Response != nil { 9173 sc = page.Response().Response.Response.StatusCode 9174 } 9175 tracing.EndSpan(ctx, sc, err) 9176 }() 9177 } 9178 for { 9179 next, err := page.fn(ctx, page.inrlr) 9180 if err != nil { 9181 return err 9182 } 9183 page.inrlr = next 9184 if !next.hasNextLink() || !next.IsEmpty() { 9185 break 9186 } 9187 } 9188 return nil 9189} 9190 9191// Next advances to the next page of values. If there was an error making 9192// the request the page does not advance and the error is returned. 9193// Deprecated: Use NextWithContext() instead. 9194func (page *InboundNatRuleListResultPage) Next() error { 9195 return page.NextWithContext(context.Background()) 9196} 9197 9198// NotDone returns true if the page enumeration should be started or is not yet complete. 9199func (page InboundNatRuleListResultPage) NotDone() bool { 9200 return !page.inrlr.IsEmpty() 9201} 9202 9203// Response returns the raw server response from the last page request. 9204func (page InboundNatRuleListResultPage) Response() InboundNatRuleListResult { 9205 return page.inrlr 9206} 9207 9208// Values returns the slice of values for the current page or nil if there are no values. 9209func (page InboundNatRuleListResultPage) Values() []InboundNatRule { 9210 if page.inrlr.IsEmpty() { 9211 return nil 9212 } 9213 return *page.inrlr.Value 9214} 9215 9216// Creates a new instance of the InboundNatRuleListResultPage type. 9217func NewInboundNatRuleListResultPage(cur InboundNatRuleListResult, getNextPage func(context.Context, InboundNatRuleListResult) (InboundNatRuleListResult, error)) InboundNatRuleListResultPage { 9218 return InboundNatRuleListResultPage{ 9219 fn: getNextPage, 9220 inrlr: cur, 9221 } 9222} 9223 9224// InboundNatRulePropertiesFormat properties of the inbound NAT rule. 9225type InboundNatRulePropertiesFormat struct { 9226 // FrontendIPConfiguration - A reference to frontend IP addresses. 9227 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 9228 // BackendIPConfiguration - READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backend IP. 9229 BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` 9230 // Protocol - Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' 9231 Protocol TransportProtocol `json:"protocol,omitempty"` 9232 // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values range from 1 to 65534. 9233 FrontendPort *int32 `json:"frontendPort,omitempty"` 9234 // BackendPort - The port used for the internal endpoint. Acceptable values range from 1 to 65535. 9235 BackendPort *int32 `json:"backendPort,omitempty"` 9236 // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. 9237 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 9238 // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. 9239 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 9240 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 9241 ProvisioningState *string `json:"provisioningState,omitempty"` 9242} 9243 9244// MarshalJSON is the custom marshaler for InboundNatRulePropertiesFormat. 9245func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { 9246 objectMap := make(map[string]interface{}) 9247 if inrpf.FrontendIPConfiguration != nil { 9248 objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration 9249 } 9250 if inrpf.Protocol != "" { 9251 objectMap["protocol"] = inrpf.Protocol 9252 } 9253 if inrpf.FrontendPort != nil { 9254 objectMap["frontendPort"] = inrpf.FrontendPort 9255 } 9256 if inrpf.BackendPort != nil { 9257 objectMap["backendPort"] = inrpf.BackendPort 9258 } 9259 if inrpf.IdleTimeoutInMinutes != nil { 9260 objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes 9261 } 9262 if inrpf.EnableFloatingIP != nil { 9263 objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP 9264 } 9265 if inrpf.ProvisioningState != nil { 9266 objectMap["provisioningState"] = inrpf.ProvisioningState 9267 } 9268 return json.Marshal(objectMap) 9269} 9270 9271// InboundNatRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 9272// long-running operation. 9273type InboundNatRulesCreateOrUpdateFuture struct { 9274 azure.FutureAPI 9275 // Result returns the result of the asynchronous operation. 9276 // If the operation has not completed it will return an error. 9277 Result func(InboundNatRulesClient) (InboundNatRule, error) 9278} 9279 9280// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9281func (future *InboundNatRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9282 var azFuture azure.Future 9283 if err := json.Unmarshal(body, &azFuture); err != nil { 9284 return err 9285 } 9286 future.FutureAPI = &azFuture 9287 future.Result = future.result 9288 return nil 9289} 9290 9291// result is the default implementation for InboundNatRulesCreateOrUpdateFuture.Result. 9292func (future *InboundNatRulesCreateOrUpdateFuture) result(client InboundNatRulesClient) (inr InboundNatRule, err error) { 9293 var done bool 9294 done, err = future.DoneWithContext(context.Background(), client) 9295 if err != nil { 9296 err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9297 return 9298 } 9299 if !done { 9300 inr.Response.Response = future.Response() 9301 err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesCreateOrUpdateFuture") 9302 return 9303 } 9304 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9305 if inr.Response.Response, err = future.GetResult(sender); err == nil && inr.Response.Response.StatusCode != http.StatusNoContent { 9306 inr, err = client.CreateOrUpdateResponder(inr.Response.Response) 9307 if err != nil { 9308 err = autorest.NewErrorWithError(err, "network.InboundNatRulesCreateOrUpdateFuture", "Result", inr.Response.Response, "Failure responding to request") 9309 } 9310 } 9311 return 9312} 9313 9314// InboundNatRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 9315// operation. 9316type InboundNatRulesDeleteFuture struct { 9317 azure.FutureAPI 9318 // Result returns the result of the asynchronous operation. 9319 // If the operation has not completed it will return an error. 9320 Result func(InboundNatRulesClient) (autorest.Response, error) 9321} 9322 9323// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9324func (future *InboundNatRulesDeleteFuture) UnmarshalJSON(body []byte) error { 9325 var azFuture azure.Future 9326 if err := json.Unmarshal(body, &azFuture); err != nil { 9327 return err 9328 } 9329 future.FutureAPI = &azFuture 9330 future.Result = future.result 9331 return nil 9332} 9333 9334// result is the default implementation for InboundNatRulesDeleteFuture.Result. 9335func (future *InboundNatRulesDeleteFuture) result(client InboundNatRulesClient) (ar autorest.Response, err error) { 9336 var done bool 9337 done, err = future.DoneWithContext(context.Background(), client) 9338 if err != nil { 9339 err = autorest.NewErrorWithError(err, "network.InboundNatRulesDeleteFuture", "Result", future.Response(), "Polling failure") 9340 return 9341 } 9342 if !done { 9343 ar.Response = future.Response() 9344 err = azure.NewAsyncOpIncompleteError("network.InboundNatRulesDeleteFuture") 9345 return 9346 } 9347 ar.Response = future.Response() 9348 return 9349} 9350 9351// Interface a network interface in a resource group. 9352type Interface struct { 9353 autorest.Response `json:"-"` 9354 // InterfacePropertiesFormat - Properties of the network interface. 9355 *InterfacePropertiesFormat `json:"properties,omitempty"` 9356 // Etag - A unique read-only string that changes whenever the resource is updated. 9357 Etag *string `json:"etag,omitempty"` 9358 // ID - Resource ID. 9359 ID *string `json:"id,omitempty"` 9360 // Name - READ-ONLY; Resource name. 9361 Name *string `json:"name,omitempty"` 9362 // Type - READ-ONLY; Resource type. 9363 Type *string `json:"type,omitempty"` 9364 // Location - Resource location. 9365 Location *string `json:"location,omitempty"` 9366 // Tags - Resource tags. 9367 Tags map[string]*string `json:"tags"` 9368} 9369 9370// MarshalJSON is the custom marshaler for Interface. 9371func (i Interface) MarshalJSON() ([]byte, error) { 9372 objectMap := make(map[string]interface{}) 9373 if i.InterfacePropertiesFormat != nil { 9374 objectMap["properties"] = i.InterfacePropertiesFormat 9375 } 9376 if i.Etag != nil { 9377 objectMap["etag"] = i.Etag 9378 } 9379 if i.ID != nil { 9380 objectMap["id"] = i.ID 9381 } 9382 if i.Location != nil { 9383 objectMap["location"] = i.Location 9384 } 9385 if i.Tags != nil { 9386 objectMap["tags"] = i.Tags 9387 } 9388 return json.Marshal(objectMap) 9389} 9390 9391// UnmarshalJSON is the custom unmarshaler for Interface struct. 9392func (i *Interface) UnmarshalJSON(body []byte) error { 9393 var m map[string]*json.RawMessage 9394 err := json.Unmarshal(body, &m) 9395 if err != nil { 9396 return err 9397 } 9398 for k, v := range m { 9399 switch k { 9400 case "properties": 9401 if v != nil { 9402 var interfacePropertiesFormat InterfacePropertiesFormat 9403 err = json.Unmarshal(*v, &interfacePropertiesFormat) 9404 if err != nil { 9405 return err 9406 } 9407 i.InterfacePropertiesFormat = &interfacePropertiesFormat 9408 } 9409 case "etag": 9410 if v != nil { 9411 var etag string 9412 err = json.Unmarshal(*v, &etag) 9413 if err != nil { 9414 return err 9415 } 9416 i.Etag = &etag 9417 } 9418 case "id": 9419 if v != nil { 9420 var ID string 9421 err = json.Unmarshal(*v, &ID) 9422 if err != nil { 9423 return err 9424 } 9425 i.ID = &ID 9426 } 9427 case "name": 9428 if v != nil { 9429 var name string 9430 err = json.Unmarshal(*v, &name) 9431 if err != nil { 9432 return err 9433 } 9434 i.Name = &name 9435 } 9436 case "type": 9437 if v != nil { 9438 var typeVar string 9439 err = json.Unmarshal(*v, &typeVar) 9440 if err != nil { 9441 return err 9442 } 9443 i.Type = &typeVar 9444 } 9445 case "location": 9446 if v != nil { 9447 var location string 9448 err = json.Unmarshal(*v, &location) 9449 if err != nil { 9450 return err 9451 } 9452 i.Location = &location 9453 } 9454 case "tags": 9455 if v != nil { 9456 var tags map[string]*string 9457 err = json.Unmarshal(*v, &tags) 9458 if err != nil { 9459 return err 9460 } 9461 i.Tags = tags 9462 } 9463 } 9464 } 9465 9466 return nil 9467} 9468 9469// InterfaceAssociation network interface and its custom security rules. 9470type InterfaceAssociation struct { 9471 // ID - READ-ONLY; Network interface ID. 9472 ID *string `json:"id,omitempty"` 9473 // SecurityRules - Collection of custom security rules. 9474 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 9475} 9476 9477// MarshalJSON is the custom marshaler for InterfaceAssociation. 9478func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) { 9479 objectMap := make(map[string]interface{}) 9480 if ia.SecurityRules != nil { 9481 objectMap["securityRules"] = ia.SecurityRules 9482 } 9483 return json.Marshal(objectMap) 9484} 9485 9486// InterfaceDNSSettings DNS settings of a network interface. 9487type InterfaceDNSSettings struct { 9488 // DNSServers - List of DNS servers IP addresses. Use 'AzureProvidedDNS' to switch to azure provided DNS resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in dnsServers collection. 9489 DNSServers *[]string `json:"dnsServers,omitempty"` 9490 // AppliedDNSServers - If the VM that uses this NIC is part of an Availability Set, then this list will have the union of all DNS servers from all NICs that are part of the Availability Set. This property is what is configured on each of those VMs. 9491 AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` 9492 // InternalDNSNameLabel - Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. 9493 InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"` 9494 // InternalFqdn - Fully qualified DNS name supporting internal communications between VMs in the same virtual network. 9495 InternalFqdn *string `json:"internalFqdn,omitempty"` 9496 // InternalDomainNameSuffix - Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. 9497 InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` 9498} 9499 9500// InterfaceIPConfiguration iPConfiguration in a network interface. 9501type InterfaceIPConfiguration struct { 9502 autorest.Response `json:"-"` 9503 // InterfaceIPConfigurationPropertiesFormat - Network interface IP configuration properties. 9504 *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` 9505 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 9506 Name *string `json:"name,omitempty"` 9507 // Etag - A unique read-only string that changes whenever the resource is updated. 9508 Etag *string `json:"etag,omitempty"` 9509 // ID - Resource ID. 9510 ID *string `json:"id,omitempty"` 9511} 9512 9513// MarshalJSON is the custom marshaler for InterfaceIPConfiguration. 9514func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { 9515 objectMap := make(map[string]interface{}) 9516 if iic.InterfaceIPConfigurationPropertiesFormat != nil { 9517 objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat 9518 } 9519 if iic.Name != nil { 9520 objectMap["name"] = iic.Name 9521 } 9522 if iic.Etag != nil { 9523 objectMap["etag"] = iic.Etag 9524 } 9525 if iic.ID != nil { 9526 objectMap["id"] = iic.ID 9527 } 9528 return json.Marshal(objectMap) 9529} 9530 9531// UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. 9532func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error { 9533 var m map[string]*json.RawMessage 9534 err := json.Unmarshal(body, &m) 9535 if err != nil { 9536 return err 9537 } 9538 for k, v := range m { 9539 switch k { 9540 case "properties": 9541 if v != nil { 9542 var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat 9543 err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat) 9544 if err != nil { 9545 return err 9546 } 9547 iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat 9548 } 9549 case "name": 9550 if v != nil { 9551 var name string 9552 err = json.Unmarshal(*v, &name) 9553 if err != nil { 9554 return err 9555 } 9556 iic.Name = &name 9557 } 9558 case "etag": 9559 if v != nil { 9560 var etag string 9561 err = json.Unmarshal(*v, &etag) 9562 if err != nil { 9563 return err 9564 } 9565 iic.Etag = &etag 9566 } 9567 case "id": 9568 if v != nil { 9569 var ID string 9570 err = json.Unmarshal(*v, &ID) 9571 if err != nil { 9572 return err 9573 } 9574 iic.ID = &ID 9575 } 9576 } 9577 } 9578 9579 return nil 9580} 9581 9582// InterfaceIPConfigurationListResult response for list ip configurations API service call. 9583type InterfaceIPConfigurationListResult struct { 9584 autorest.Response `json:"-"` 9585 // Value - A list of ip configurations. 9586 Value *[]InterfaceIPConfiguration `json:"value,omitempty"` 9587 // NextLink - READ-ONLY; The URL to get the next set of results. 9588 NextLink *string `json:"nextLink,omitempty"` 9589} 9590 9591// MarshalJSON is the custom marshaler for InterfaceIPConfigurationListResult. 9592func (iiclr InterfaceIPConfigurationListResult) MarshalJSON() ([]byte, error) { 9593 objectMap := make(map[string]interface{}) 9594 if iiclr.Value != nil { 9595 objectMap["value"] = iiclr.Value 9596 } 9597 return json.Marshal(objectMap) 9598} 9599 9600// InterfaceIPConfigurationListResultIterator provides access to a complete listing of 9601// InterfaceIPConfiguration values. 9602type InterfaceIPConfigurationListResultIterator struct { 9603 i int 9604 page InterfaceIPConfigurationListResultPage 9605} 9606 9607// NextWithContext advances to the next value. If there was an error making 9608// the request the iterator does not advance and the error is returned. 9609func (iter *InterfaceIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { 9610 if tracing.IsEnabled() { 9611 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultIterator.NextWithContext") 9612 defer func() { 9613 sc := -1 9614 if iter.Response().Response.Response != nil { 9615 sc = iter.Response().Response.Response.StatusCode 9616 } 9617 tracing.EndSpan(ctx, sc, err) 9618 }() 9619 } 9620 iter.i++ 9621 if iter.i < len(iter.page.Values()) { 9622 return nil 9623 } 9624 err = iter.page.NextWithContext(ctx) 9625 if err != nil { 9626 iter.i-- 9627 return err 9628 } 9629 iter.i = 0 9630 return nil 9631} 9632 9633// Next advances to the next value. If there was an error making 9634// the request the iterator does not advance and the error is returned. 9635// Deprecated: Use NextWithContext() instead. 9636func (iter *InterfaceIPConfigurationListResultIterator) Next() error { 9637 return iter.NextWithContext(context.Background()) 9638} 9639 9640// NotDone returns true if the enumeration should be started or is not yet complete. 9641func (iter InterfaceIPConfigurationListResultIterator) NotDone() bool { 9642 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9643} 9644 9645// Response returns the raw server response from the last page request. 9646func (iter InterfaceIPConfigurationListResultIterator) Response() InterfaceIPConfigurationListResult { 9647 return iter.page.Response() 9648} 9649 9650// Value returns the current value or a zero-initialized value if the 9651// iterator has advanced beyond the end of the collection. 9652func (iter InterfaceIPConfigurationListResultIterator) Value() InterfaceIPConfiguration { 9653 if !iter.page.NotDone() { 9654 return InterfaceIPConfiguration{} 9655 } 9656 return iter.page.Values()[iter.i] 9657} 9658 9659// Creates a new instance of the InterfaceIPConfigurationListResultIterator type. 9660func NewInterfaceIPConfigurationListResultIterator(page InterfaceIPConfigurationListResultPage) InterfaceIPConfigurationListResultIterator { 9661 return InterfaceIPConfigurationListResultIterator{page: page} 9662} 9663 9664// IsEmpty returns true if the ListResult contains no values. 9665func (iiclr InterfaceIPConfigurationListResult) IsEmpty() bool { 9666 return iiclr.Value == nil || len(*iiclr.Value) == 0 9667} 9668 9669// hasNextLink returns true if the NextLink is not empty. 9670func (iiclr InterfaceIPConfigurationListResult) hasNextLink() bool { 9671 return iiclr.NextLink != nil && len(*iiclr.NextLink) != 0 9672} 9673 9674// interfaceIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. 9675// It returns nil if no more results exist. 9676func (iiclr InterfaceIPConfigurationListResult) interfaceIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { 9677 if !iiclr.hasNextLink() { 9678 return nil, nil 9679 } 9680 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9681 autorest.AsJSON(), 9682 autorest.AsGet(), 9683 autorest.WithBaseURL(to.String(iiclr.NextLink))) 9684} 9685 9686// InterfaceIPConfigurationListResultPage contains a page of InterfaceIPConfiguration values. 9687type InterfaceIPConfigurationListResultPage struct { 9688 fn func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error) 9689 iiclr InterfaceIPConfigurationListResult 9690} 9691 9692// NextWithContext advances to the next page of values. If there was an error making 9693// the request the page does not advance and the error is returned. 9694func (page *InterfaceIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { 9695 if tracing.IsEnabled() { 9696 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceIPConfigurationListResultPage.NextWithContext") 9697 defer func() { 9698 sc := -1 9699 if page.Response().Response.Response != nil { 9700 sc = page.Response().Response.Response.StatusCode 9701 } 9702 tracing.EndSpan(ctx, sc, err) 9703 }() 9704 } 9705 for { 9706 next, err := page.fn(ctx, page.iiclr) 9707 if err != nil { 9708 return err 9709 } 9710 page.iiclr = next 9711 if !next.hasNextLink() || !next.IsEmpty() { 9712 break 9713 } 9714 } 9715 return nil 9716} 9717 9718// Next advances to the next page of values. If there was an error making 9719// the request the page does not advance and the error is returned. 9720// Deprecated: Use NextWithContext() instead. 9721func (page *InterfaceIPConfigurationListResultPage) Next() error { 9722 return page.NextWithContext(context.Background()) 9723} 9724 9725// NotDone returns true if the page enumeration should be started or is not yet complete. 9726func (page InterfaceIPConfigurationListResultPage) NotDone() bool { 9727 return !page.iiclr.IsEmpty() 9728} 9729 9730// Response returns the raw server response from the last page request. 9731func (page InterfaceIPConfigurationListResultPage) Response() InterfaceIPConfigurationListResult { 9732 return page.iiclr 9733} 9734 9735// Values returns the slice of values for the current page or nil if there are no values. 9736func (page InterfaceIPConfigurationListResultPage) Values() []InterfaceIPConfiguration { 9737 if page.iiclr.IsEmpty() { 9738 return nil 9739 } 9740 return *page.iiclr.Value 9741} 9742 9743// Creates a new instance of the InterfaceIPConfigurationListResultPage type. 9744func NewInterfaceIPConfigurationListResultPage(cur InterfaceIPConfigurationListResult, getNextPage func(context.Context, InterfaceIPConfigurationListResult) (InterfaceIPConfigurationListResult, error)) InterfaceIPConfigurationListResultPage { 9745 return InterfaceIPConfigurationListResultPage{ 9746 fn: getNextPage, 9747 iiclr: cur, 9748 } 9749} 9750 9751// InterfaceIPConfigurationPropertiesFormat properties of IP configuration. 9752type InterfaceIPConfigurationPropertiesFormat struct { 9753 // ApplicationGatewayBackendAddressPools - The reference of ApplicationGatewayBackendAddressPool resource. 9754 ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` 9755 // LoadBalancerBackendAddressPools - The reference of LoadBalancerBackendAddressPool resource. 9756 LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` 9757 // LoadBalancerInboundNatRules - A list of references of LoadBalancerInboundNatRules. 9758 LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` 9759 // PrivateIPAddress - Private IP address of the IP configuration. 9760 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 9761 // PrivateIPAllocationMethod - Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 9762 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 9763 // PrivateIPAddressVersion - Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 9764 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 9765 // Subnet - Subnet bound to the IP configuration. 9766 Subnet *Subnet `json:"subnet,omitempty"` 9767 // Primary - Gets whether this is a primary customer address on the network interface. 9768 Primary *bool `json:"primary,omitempty"` 9769 // PublicIPAddress - Public IP address bound to the IP configuration. 9770 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 9771 // ApplicationSecurityGroups - Application security groups in which the IP configuration is included. 9772 ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` 9773 // ProvisioningState - The provisioning state of the network interface IP configuration. Possible values are: 'Updating', 'Deleting', and 'Failed'. 9774 ProvisioningState *string `json:"provisioningState,omitempty"` 9775} 9776 9777// InterfaceListResult response for the ListNetworkInterface API service call. 9778type InterfaceListResult struct { 9779 autorest.Response `json:"-"` 9780 // Value - A list of network interfaces in a resource group. 9781 Value *[]Interface `json:"value,omitempty"` 9782 // NextLink - READ-ONLY; The URL to get the next set of results. 9783 NextLink *string `json:"nextLink,omitempty"` 9784} 9785 9786// MarshalJSON is the custom marshaler for InterfaceListResult. 9787func (ilr InterfaceListResult) MarshalJSON() ([]byte, error) { 9788 objectMap := make(map[string]interface{}) 9789 if ilr.Value != nil { 9790 objectMap["value"] = ilr.Value 9791 } 9792 return json.Marshal(objectMap) 9793} 9794 9795// InterfaceListResultIterator provides access to a complete listing of Interface values. 9796type InterfaceListResultIterator struct { 9797 i int 9798 page InterfaceListResultPage 9799} 9800 9801// NextWithContext advances to the next value. If there was an error making 9802// the request the iterator does not advance and the error is returned. 9803func (iter *InterfaceListResultIterator) NextWithContext(ctx context.Context) (err error) { 9804 if tracing.IsEnabled() { 9805 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultIterator.NextWithContext") 9806 defer func() { 9807 sc := -1 9808 if iter.Response().Response.Response != nil { 9809 sc = iter.Response().Response.Response.StatusCode 9810 } 9811 tracing.EndSpan(ctx, sc, err) 9812 }() 9813 } 9814 iter.i++ 9815 if iter.i < len(iter.page.Values()) { 9816 return nil 9817 } 9818 err = iter.page.NextWithContext(ctx) 9819 if err != nil { 9820 iter.i-- 9821 return err 9822 } 9823 iter.i = 0 9824 return nil 9825} 9826 9827// Next advances to the next value. If there was an error making 9828// the request the iterator does not advance and the error is returned. 9829// Deprecated: Use NextWithContext() instead. 9830func (iter *InterfaceListResultIterator) Next() error { 9831 return iter.NextWithContext(context.Background()) 9832} 9833 9834// NotDone returns true if the enumeration should be started or is not yet complete. 9835func (iter InterfaceListResultIterator) NotDone() bool { 9836 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9837} 9838 9839// Response returns the raw server response from the last page request. 9840func (iter InterfaceListResultIterator) Response() InterfaceListResult { 9841 return iter.page.Response() 9842} 9843 9844// Value returns the current value or a zero-initialized value if the 9845// iterator has advanced beyond the end of the collection. 9846func (iter InterfaceListResultIterator) Value() Interface { 9847 if !iter.page.NotDone() { 9848 return Interface{} 9849 } 9850 return iter.page.Values()[iter.i] 9851} 9852 9853// Creates a new instance of the InterfaceListResultIterator type. 9854func NewInterfaceListResultIterator(page InterfaceListResultPage) InterfaceListResultIterator { 9855 return InterfaceListResultIterator{page: page} 9856} 9857 9858// IsEmpty returns true if the ListResult contains no values. 9859func (ilr InterfaceListResult) IsEmpty() bool { 9860 return ilr.Value == nil || len(*ilr.Value) == 0 9861} 9862 9863// hasNextLink returns true if the NextLink is not empty. 9864func (ilr InterfaceListResult) hasNextLink() bool { 9865 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 9866} 9867 9868// interfaceListResultPreparer prepares a request to retrieve the next set of results. 9869// It returns nil if no more results exist. 9870func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) { 9871 if !ilr.hasNextLink() { 9872 return nil, nil 9873 } 9874 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9875 autorest.AsJSON(), 9876 autorest.AsGet(), 9877 autorest.WithBaseURL(to.String(ilr.NextLink))) 9878} 9879 9880// InterfaceListResultPage contains a page of Interface values. 9881type InterfaceListResultPage struct { 9882 fn func(context.Context, InterfaceListResult) (InterfaceListResult, error) 9883 ilr InterfaceListResult 9884} 9885 9886// NextWithContext advances to the next page of values. If there was an error making 9887// the request the page does not advance and the error is returned. 9888func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err error) { 9889 if tracing.IsEnabled() { 9890 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultPage.NextWithContext") 9891 defer func() { 9892 sc := -1 9893 if page.Response().Response.Response != nil { 9894 sc = page.Response().Response.Response.StatusCode 9895 } 9896 tracing.EndSpan(ctx, sc, err) 9897 }() 9898 } 9899 for { 9900 next, err := page.fn(ctx, page.ilr) 9901 if err != nil { 9902 return err 9903 } 9904 page.ilr = next 9905 if !next.hasNextLink() || !next.IsEmpty() { 9906 break 9907 } 9908 } 9909 return nil 9910} 9911 9912// Next advances to the next page of values. If there was an error making 9913// the request the page does not advance and the error is returned. 9914// Deprecated: Use NextWithContext() instead. 9915func (page *InterfaceListResultPage) Next() error { 9916 return page.NextWithContext(context.Background()) 9917} 9918 9919// NotDone returns true if the page enumeration should be started or is not yet complete. 9920func (page InterfaceListResultPage) NotDone() bool { 9921 return !page.ilr.IsEmpty() 9922} 9923 9924// Response returns the raw server response from the last page request. 9925func (page InterfaceListResultPage) Response() InterfaceListResult { 9926 return page.ilr 9927} 9928 9929// Values returns the slice of values for the current page or nil if there are no values. 9930func (page InterfaceListResultPage) Values() []Interface { 9931 if page.ilr.IsEmpty() { 9932 return nil 9933 } 9934 return *page.ilr.Value 9935} 9936 9937// Creates a new instance of the InterfaceListResultPage type. 9938func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage { 9939 return InterfaceListResultPage{ 9940 fn: getNextPage, 9941 ilr: cur, 9942 } 9943} 9944 9945// InterfaceLoadBalancerListResult response for list ip configurations API service call. 9946type InterfaceLoadBalancerListResult struct { 9947 autorest.Response `json:"-"` 9948 // Value - A list of load balancers. 9949 Value *[]LoadBalancer `json:"value,omitempty"` 9950 // NextLink - READ-ONLY; The URL to get the next set of results. 9951 NextLink *string `json:"nextLink,omitempty"` 9952} 9953 9954// MarshalJSON is the custom marshaler for InterfaceLoadBalancerListResult. 9955func (ilblr InterfaceLoadBalancerListResult) MarshalJSON() ([]byte, error) { 9956 objectMap := make(map[string]interface{}) 9957 if ilblr.Value != nil { 9958 objectMap["value"] = ilblr.Value 9959 } 9960 return json.Marshal(objectMap) 9961} 9962 9963// InterfaceLoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. 9964type InterfaceLoadBalancerListResultIterator struct { 9965 i int 9966 page InterfaceLoadBalancerListResultPage 9967} 9968 9969// NextWithContext advances to the next value. If there was an error making 9970// the request the iterator does not advance and the error is returned. 9971func (iter *InterfaceLoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { 9972 if tracing.IsEnabled() { 9973 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultIterator.NextWithContext") 9974 defer func() { 9975 sc := -1 9976 if iter.Response().Response.Response != nil { 9977 sc = iter.Response().Response.Response.StatusCode 9978 } 9979 tracing.EndSpan(ctx, sc, err) 9980 }() 9981 } 9982 iter.i++ 9983 if iter.i < len(iter.page.Values()) { 9984 return nil 9985 } 9986 err = iter.page.NextWithContext(ctx) 9987 if err != nil { 9988 iter.i-- 9989 return err 9990 } 9991 iter.i = 0 9992 return nil 9993} 9994 9995// Next advances to the next value. If there was an error making 9996// the request the iterator does not advance and the error is returned. 9997// Deprecated: Use NextWithContext() instead. 9998func (iter *InterfaceLoadBalancerListResultIterator) Next() error { 9999 return iter.NextWithContext(context.Background()) 10000} 10001 10002// NotDone returns true if the enumeration should be started or is not yet complete. 10003func (iter InterfaceLoadBalancerListResultIterator) NotDone() bool { 10004 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10005} 10006 10007// Response returns the raw server response from the last page request. 10008func (iter InterfaceLoadBalancerListResultIterator) Response() InterfaceLoadBalancerListResult { 10009 return iter.page.Response() 10010} 10011 10012// Value returns the current value or a zero-initialized value if the 10013// iterator has advanced beyond the end of the collection. 10014func (iter InterfaceLoadBalancerListResultIterator) Value() LoadBalancer { 10015 if !iter.page.NotDone() { 10016 return LoadBalancer{} 10017 } 10018 return iter.page.Values()[iter.i] 10019} 10020 10021// Creates a new instance of the InterfaceLoadBalancerListResultIterator type. 10022func NewInterfaceLoadBalancerListResultIterator(page InterfaceLoadBalancerListResultPage) InterfaceLoadBalancerListResultIterator { 10023 return InterfaceLoadBalancerListResultIterator{page: page} 10024} 10025 10026// IsEmpty returns true if the ListResult contains no values. 10027func (ilblr InterfaceLoadBalancerListResult) IsEmpty() bool { 10028 return ilblr.Value == nil || len(*ilblr.Value) == 0 10029} 10030 10031// hasNextLink returns true if the NextLink is not empty. 10032func (ilblr InterfaceLoadBalancerListResult) hasNextLink() bool { 10033 return ilblr.NextLink != nil && len(*ilblr.NextLink) != 0 10034} 10035 10036// interfaceLoadBalancerListResultPreparer prepares a request to retrieve the next set of results. 10037// It returns nil if no more results exist. 10038func (ilblr InterfaceLoadBalancerListResult) interfaceLoadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { 10039 if !ilblr.hasNextLink() { 10040 return nil, nil 10041 } 10042 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10043 autorest.AsJSON(), 10044 autorest.AsGet(), 10045 autorest.WithBaseURL(to.String(ilblr.NextLink))) 10046} 10047 10048// InterfaceLoadBalancerListResultPage contains a page of LoadBalancer values. 10049type InterfaceLoadBalancerListResultPage struct { 10050 fn func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error) 10051 ilblr InterfaceLoadBalancerListResult 10052} 10053 10054// NextWithContext advances to the next page of values. If there was an error making 10055// the request the page does not advance and the error is returned. 10056func (page *InterfaceLoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { 10057 if tracing.IsEnabled() { 10058 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceLoadBalancerListResultPage.NextWithContext") 10059 defer func() { 10060 sc := -1 10061 if page.Response().Response.Response != nil { 10062 sc = page.Response().Response.Response.StatusCode 10063 } 10064 tracing.EndSpan(ctx, sc, err) 10065 }() 10066 } 10067 for { 10068 next, err := page.fn(ctx, page.ilblr) 10069 if err != nil { 10070 return err 10071 } 10072 page.ilblr = next 10073 if !next.hasNextLink() || !next.IsEmpty() { 10074 break 10075 } 10076 } 10077 return nil 10078} 10079 10080// Next advances to the next page of values. If there was an error making 10081// the request the page does not advance and the error is returned. 10082// Deprecated: Use NextWithContext() instead. 10083func (page *InterfaceLoadBalancerListResultPage) Next() error { 10084 return page.NextWithContext(context.Background()) 10085} 10086 10087// NotDone returns true if the page enumeration should be started or is not yet complete. 10088func (page InterfaceLoadBalancerListResultPage) NotDone() bool { 10089 return !page.ilblr.IsEmpty() 10090} 10091 10092// Response returns the raw server response from the last page request. 10093func (page InterfaceLoadBalancerListResultPage) Response() InterfaceLoadBalancerListResult { 10094 return page.ilblr 10095} 10096 10097// Values returns the slice of values for the current page or nil if there are no values. 10098func (page InterfaceLoadBalancerListResultPage) Values() []LoadBalancer { 10099 if page.ilblr.IsEmpty() { 10100 return nil 10101 } 10102 return *page.ilblr.Value 10103} 10104 10105// Creates a new instance of the InterfaceLoadBalancerListResultPage type. 10106func NewInterfaceLoadBalancerListResultPage(cur InterfaceLoadBalancerListResult, getNextPage func(context.Context, InterfaceLoadBalancerListResult) (InterfaceLoadBalancerListResult, error)) InterfaceLoadBalancerListResultPage { 10107 return InterfaceLoadBalancerListResultPage{ 10108 fn: getNextPage, 10109 ilblr: cur, 10110 } 10111} 10112 10113// InterfacePropertiesFormat networkInterface properties. 10114type InterfacePropertiesFormat struct { 10115 // VirtualMachine - The reference of a virtual machine. 10116 VirtualMachine *SubResource `json:"virtualMachine,omitempty"` 10117 // NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource. 10118 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 10119 // IPConfigurations - A list of IPConfigurations of the network interface. 10120 IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 10121 // DNSSettings - The DNS settings in network interface. 10122 DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` 10123 // MacAddress - The MAC address of the network interface. 10124 MacAddress *string `json:"macAddress,omitempty"` 10125 // Primary - Gets whether this is a primary network interface on a virtual machine. 10126 Primary *bool `json:"primary,omitempty"` 10127 // EnableAcceleratedNetworking - If the network interface is accelerated networking enabled. 10128 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 10129 // EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface. 10130 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 10131 // ResourceGUID - The resource GUID property of the network interface resource. 10132 ResourceGUID *string `json:"resourceGuid,omitempty"` 10133 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 10134 ProvisioningState *string `json:"provisioningState,omitempty"` 10135} 10136 10137// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 10138// long-running operation. 10139type InterfacesCreateOrUpdateFuture struct { 10140 azure.FutureAPI 10141 // Result returns the result of the asynchronous operation. 10142 // If the operation has not completed it will return an error. 10143 Result func(InterfacesClient) (Interface, error) 10144} 10145 10146// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10147func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10148 var azFuture azure.Future 10149 if err := json.Unmarshal(body, &azFuture); err != nil { 10150 return err 10151 } 10152 future.FutureAPI = &azFuture 10153 future.Result = future.result 10154 return nil 10155} 10156 10157// result is the default implementation for InterfacesCreateOrUpdateFuture.Result. 10158func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) { 10159 var done bool 10160 done, err = future.DoneWithContext(context.Background(), client) 10161 if err != nil { 10162 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10163 return 10164 } 10165 if !done { 10166 i.Response.Response = future.Response() 10167 err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") 10168 return 10169 } 10170 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10171 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 10172 i, err = client.CreateOrUpdateResponder(i.Response.Response) 10173 if err != nil { 10174 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 10175 } 10176 } 10177 return 10178} 10179 10180// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 10181// operation. 10182type InterfacesDeleteFuture struct { 10183 azure.FutureAPI 10184 // Result returns the result of the asynchronous operation. 10185 // If the operation has not completed it will return an error. 10186 Result func(InterfacesClient) (autorest.Response, error) 10187} 10188 10189// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10190func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error { 10191 var azFuture azure.Future 10192 if err := json.Unmarshal(body, &azFuture); err != nil { 10193 return err 10194 } 10195 future.FutureAPI = &azFuture 10196 future.Result = future.result 10197 return nil 10198} 10199 10200// result is the default implementation for InterfacesDeleteFuture.Result. 10201func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) { 10202 var done bool 10203 done, err = future.DoneWithContext(context.Background(), client) 10204 if err != nil { 10205 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure") 10206 return 10207 } 10208 if !done { 10209 ar.Response = future.Response() 10210 err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") 10211 return 10212 } 10213 ar.Response = future.Response() 10214 return 10215} 10216 10217// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a 10218// long-running operation. 10219type InterfacesGetEffectiveRouteTableFuture struct { 10220 azure.FutureAPI 10221 // Result returns the result of the asynchronous operation. 10222 // If the operation has not completed it will return an error. 10223 Result func(InterfacesClient) (EffectiveRouteListResult, error) 10224} 10225 10226// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10227func (future *InterfacesGetEffectiveRouteTableFuture) UnmarshalJSON(body []byte) error { 10228 var azFuture azure.Future 10229 if err := json.Unmarshal(body, &azFuture); err != nil { 10230 return err 10231 } 10232 future.FutureAPI = &azFuture 10233 future.Result = future.result 10234 return nil 10235} 10236 10237// result is the default implementation for InterfacesGetEffectiveRouteTableFuture.Result. 10238func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) { 10239 var done bool 10240 done, err = future.DoneWithContext(context.Background(), client) 10241 if err != nil { 10242 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure") 10243 return 10244 } 10245 if !done { 10246 erlr.Response.Response = future.Response() 10247 err = azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture") 10248 return 10249 } 10250 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10251 if erlr.Response.Response, err = future.GetResult(sender); err == nil && erlr.Response.Response.StatusCode != http.StatusNoContent { 10252 erlr, err = client.GetEffectiveRouteTableResponder(erlr.Response.Response) 10253 if err != nil { 10254 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", erlr.Response.Response, "Failure responding to request") 10255 } 10256 } 10257 return 10258} 10259 10260// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the 10261// results of a long-running operation. 10262type InterfacesListEffectiveNetworkSecurityGroupsFuture struct { 10263 azure.FutureAPI 10264 // Result returns the result of the asynchronous operation. 10265 // If the operation has not completed it will return an error. 10266 Result func(InterfacesClient) (EffectiveNetworkSecurityGroupListResult, error) 10267} 10268 10269// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10270func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) UnmarshalJSON(body []byte) error { 10271 var azFuture azure.Future 10272 if err := json.Unmarshal(body, &azFuture); err != nil { 10273 return err 10274 } 10275 future.FutureAPI = &azFuture 10276 future.Result = future.result 10277 return nil 10278} 10279 10280// result is the default implementation for InterfacesListEffectiveNetworkSecurityGroupsFuture.Result. 10281func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) { 10282 var done bool 10283 done, err = future.DoneWithContext(context.Background(), client) 10284 if err != nil { 10285 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure") 10286 return 10287 } 10288 if !done { 10289 ensglr.Response.Response = future.Response() 10290 err = azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture") 10291 return 10292 } 10293 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10294 if ensglr.Response.Response, err = future.GetResult(sender); err == nil && ensglr.Response.Response.StatusCode != http.StatusNoContent { 10295 ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(ensglr.Response.Response) 10296 if err != nil { 10297 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", ensglr.Response.Response, "Failure responding to request") 10298 } 10299 } 10300 return 10301} 10302 10303// InterfacesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running 10304// operation. 10305type InterfacesUpdateTagsFuture struct { 10306 azure.FutureAPI 10307 // Result returns the result of the asynchronous operation. 10308 // If the operation has not completed it will return an error. 10309 Result func(InterfacesClient) (Interface, error) 10310} 10311 10312// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10313func (future *InterfacesUpdateTagsFuture) UnmarshalJSON(body []byte) error { 10314 var azFuture azure.Future 10315 if err := json.Unmarshal(body, &azFuture); err != nil { 10316 return err 10317 } 10318 future.FutureAPI = &azFuture 10319 future.Result = future.result 10320 return nil 10321} 10322 10323// result is the default implementation for InterfacesUpdateTagsFuture.Result. 10324func (future *InterfacesUpdateTagsFuture) result(client InterfacesClient) (i Interface, err error) { 10325 var done bool 10326 done, err = future.DoneWithContext(context.Background(), client) 10327 if err != nil { 10328 err = autorest.NewErrorWithError(err, "network.InterfacesUpdateTagsFuture", "Result", future.Response(), "Polling failure") 10329 return 10330 } 10331 if !done { 10332 i.Response.Response = future.Response() 10333 err = azure.NewAsyncOpIncompleteError("network.InterfacesUpdateTagsFuture") 10334 return 10335 } 10336 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10337 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 10338 i, err = client.UpdateTagsResponder(i.Response.Response) 10339 if err != nil { 10340 err = autorest.NewErrorWithError(err, "network.InterfacesUpdateTagsFuture", "Result", i.Response.Response, "Failure responding to request") 10341 } 10342 } 10343 return 10344} 10345 10346// IPAddressAvailabilityResult response for CheckIPAddressAvailability API service call 10347type IPAddressAvailabilityResult struct { 10348 autorest.Response `json:"-"` 10349 // Available - Private IP address availability. 10350 Available *bool `json:"available,omitempty"` 10351 // AvailableIPAddresses - Contains other available private IP addresses if the asked for address is taken. 10352 AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` 10353} 10354 10355// IPConfiguration IP configuration 10356type IPConfiguration struct { 10357 // IPConfigurationPropertiesFormat - Properties of the IP configuration 10358 *IPConfigurationPropertiesFormat `json:"properties,omitempty"` 10359 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 10360 Name *string `json:"name,omitempty"` 10361 // Etag - A unique read-only string that changes whenever the resource is updated. 10362 Etag *string `json:"etag,omitempty"` 10363 // ID - Resource ID. 10364 ID *string `json:"id,omitempty"` 10365} 10366 10367// MarshalJSON is the custom marshaler for IPConfiguration. 10368func (ic IPConfiguration) MarshalJSON() ([]byte, error) { 10369 objectMap := make(map[string]interface{}) 10370 if ic.IPConfigurationPropertiesFormat != nil { 10371 objectMap["properties"] = ic.IPConfigurationPropertiesFormat 10372 } 10373 if ic.Name != nil { 10374 objectMap["name"] = ic.Name 10375 } 10376 if ic.Etag != nil { 10377 objectMap["etag"] = ic.Etag 10378 } 10379 if ic.ID != nil { 10380 objectMap["id"] = ic.ID 10381 } 10382 return json.Marshal(objectMap) 10383} 10384 10385// UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. 10386func (ic *IPConfiguration) UnmarshalJSON(body []byte) error { 10387 var m map[string]*json.RawMessage 10388 err := json.Unmarshal(body, &m) 10389 if err != nil { 10390 return err 10391 } 10392 for k, v := range m { 10393 switch k { 10394 case "properties": 10395 if v != nil { 10396 var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat 10397 err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat) 10398 if err != nil { 10399 return err 10400 } 10401 ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat 10402 } 10403 case "name": 10404 if v != nil { 10405 var name string 10406 err = json.Unmarshal(*v, &name) 10407 if err != nil { 10408 return err 10409 } 10410 ic.Name = &name 10411 } 10412 case "etag": 10413 if v != nil { 10414 var etag string 10415 err = json.Unmarshal(*v, &etag) 10416 if err != nil { 10417 return err 10418 } 10419 ic.Etag = &etag 10420 } 10421 case "id": 10422 if v != nil { 10423 var ID string 10424 err = json.Unmarshal(*v, &ID) 10425 if err != nil { 10426 return err 10427 } 10428 ic.ID = &ID 10429 } 10430 } 10431 } 10432 10433 return nil 10434} 10435 10436// IPConfigurationPropertiesFormat properties of IP configuration. 10437type IPConfigurationPropertiesFormat struct { 10438 // PrivateIPAddress - The private IP address of the IP configuration. 10439 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 10440 // PrivateIPAllocationMethod - The private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 10441 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 10442 // Subnet - The reference of the subnet resource. 10443 Subnet *Subnet `json:"subnet,omitempty"` 10444 // PublicIPAddress - The reference of the public IP resource. 10445 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 10446 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 10447 ProvisioningState *string `json:"provisioningState,omitempty"` 10448} 10449 10450// IpsecPolicy an IPSec Policy configuration for a virtual network gateway connection 10451type IpsecPolicy struct { 10452 // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. 10453 SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` 10454 // SaDataSizeKilobytes - The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. 10455 SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` 10456 // IpsecEncryption - The IPSec encryption algorithm (IKE phase 1). Possible values include: 'IpsecEncryptionNone', 'IpsecEncryptionDES', 'IpsecEncryptionDES3', 'IpsecEncryptionAES128', 'IpsecEncryptionAES192', 'IpsecEncryptionAES256', 'IpsecEncryptionGCMAES128', 'IpsecEncryptionGCMAES192', 'IpsecEncryptionGCMAES256' 10457 IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` 10458 // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' 10459 IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` 10460 // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' 10461 IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` 10462 // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' 10463 IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` 10464 // DhGroup - The DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' 10465 DhGroup DhGroup `json:"dhGroup,omitempty"` 10466 // PfsGroup - The Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'PfsGroupNone', 'PfsGroupPFS1', 'PfsGroupPFS2', 'PfsGroupPFS2048', 'PfsGroupECP256', 'PfsGroupECP384', 'PfsGroupPFS24', 'PfsGroupPFS14', 'PfsGroupPFSMM' 10467 PfsGroup PfsGroup `json:"pfsGroup,omitempty"` 10468} 10469 10470// IPTag contains the IpTag associated with the public IP address 10471type IPTag struct { 10472 // IPTagType - Gets or sets the ipTag type: Example FirstPartyUsage. 10473 IPTagType *string `json:"ipTagType,omitempty"` 10474 // Tag - Gets or sets value of the IpTag associated with the public IP. Example SQL, Storage etc 10475 Tag *string `json:"tag,omitempty"` 10476} 10477 10478// Ipv6ExpressRouteCircuitPeeringConfig contains IPv6 peering config. 10479type Ipv6ExpressRouteCircuitPeeringConfig struct { 10480 // PrimaryPeerAddressPrefix - The primary address prefix. 10481 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` 10482 // SecondaryPeerAddressPrefix - The secondary address prefix. 10483 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` 10484 // MicrosoftPeeringConfig - The Microsoft peering configuration. 10485 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` 10486 // RouteFilter - The reference of the RouteFilter resource. 10487 RouteFilter *RouteFilter `json:"routeFilter,omitempty"` 10488 // State - The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled' 10489 State ExpressRouteCircuitPeeringState `json:"state,omitempty"` 10490} 10491 10492// ListHubVirtualNetworkConnectionsResult list of HubVirtualNetworkConnections and a URL nextLink to get 10493// the next set of results. 10494type ListHubVirtualNetworkConnectionsResult struct { 10495 autorest.Response `json:"-"` 10496 // Value - List of HubVirtualNetworkConnections. 10497 Value *[]HubVirtualNetworkConnection `json:"value,omitempty"` 10498 // NextLink - URL to get the next set of operation list results if there are any. 10499 NextLink *string `json:"nextLink,omitempty"` 10500} 10501 10502// ListHubVirtualNetworkConnectionsResultIterator provides access to a complete listing of 10503// HubVirtualNetworkConnection values. 10504type ListHubVirtualNetworkConnectionsResultIterator struct { 10505 i int 10506 page ListHubVirtualNetworkConnectionsResultPage 10507} 10508 10509// NextWithContext advances to the next value. If there was an error making 10510// the request the iterator does not advance and the error is returned. 10511func (iter *ListHubVirtualNetworkConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { 10512 if tracing.IsEnabled() { 10513 ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultIterator.NextWithContext") 10514 defer func() { 10515 sc := -1 10516 if iter.Response().Response.Response != nil { 10517 sc = iter.Response().Response.Response.StatusCode 10518 } 10519 tracing.EndSpan(ctx, sc, err) 10520 }() 10521 } 10522 iter.i++ 10523 if iter.i < len(iter.page.Values()) { 10524 return nil 10525 } 10526 err = iter.page.NextWithContext(ctx) 10527 if err != nil { 10528 iter.i-- 10529 return err 10530 } 10531 iter.i = 0 10532 return nil 10533} 10534 10535// Next advances to the next value. If there was an error making 10536// the request the iterator does not advance and the error is returned. 10537// Deprecated: Use NextWithContext() instead. 10538func (iter *ListHubVirtualNetworkConnectionsResultIterator) Next() error { 10539 return iter.NextWithContext(context.Background()) 10540} 10541 10542// NotDone returns true if the enumeration should be started or is not yet complete. 10543func (iter ListHubVirtualNetworkConnectionsResultIterator) NotDone() bool { 10544 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10545} 10546 10547// Response returns the raw server response from the last page request. 10548func (iter ListHubVirtualNetworkConnectionsResultIterator) Response() ListHubVirtualNetworkConnectionsResult { 10549 return iter.page.Response() 10550} 10551 10552// Value returns the current value or a zero-initialized value if the 10553// iterator has advanced beyond the end of the collection. 10554func (iter ListHubVirtualNetworkConnectionsResultIterator) Value() HubVirtualNetworkConnection { 10555 if !iter.page.NotDone() { 10556 return HubVirtualNetworkConnection{} 10557 } 10558 return iter.page.Values()[iter.i] 10559} 10560 10561// Creates a new instance of the ListHubVirtualNetworkConnectionsResultIterator type. 10562func NewListHubVirtualNetworkConnectionsResultIterator(page ListHubVirtualNetworkConnectionsResultPage) ListHubVirtualNetworkConnectionsResultIterator { 10563 return ListHubVirtualNetworkConnectionsResultIterator{page: page} 10564} 10565 10566// IsEmpty returns true if the ListResult contains no values. 10567func (lhvncr ListHubVirtualNetworkConnectionsResult) IsEmpty() bool { 10568 return lhvncr.Value == nil || len(*lhvncr.Value) == 0 10569} 10570 10571// hasNextLink returns true if the NextLink is not empty. 10572func (lhvncr ListHubVirtualNetworkConnectionsResult) hasNextLink() bool { 10573 return lhvncr.NextLink != nil && len(*lhvncr.NextLink) != 0 10574} 10575 10576// listHubVirtualNetworkConnectionsResultPreparer prepares a request to retrieve the next set of results. 10577// It returns nil if no more results exist. 10578func (lhvncr ListHubVirtualNetworkConnectionsResult) listHubVirtualNetworkConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { 10579 if !lhvncr.hasNextLink() { 10580 return nil, nil 10581 } 10582 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10583 autorest.AsJSON(), 10584 autorest.AsGet(), 10585 autorest.WithBaseURL(to.String(lhvncr.NextLink))) 10586} 10587 10588// ListHubVirtualNetworkConnectionsResultPage contains a page of HubVirtualNetworkConnection values. 10589type ListHubVirtualNetworkConnectionsResultPage struct { 10590 fn func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error) 10591 lhvncr ListHubVirtualNetworkConnectionsResult 10592} 10593 10594// NextWithContext advances to the next page of values. If there was an error making 10595// the request the page does not advance and the error is returned. 10596func (page *ListHubVirtualNetworkConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { 10597 if tracing.IsEnabled() { 10598 ctx = tracing.StartSpan(ctx, fqdn+"/ListHubVirtualNetworkConnectionsResultPage.NextWithContext") 10599 defer func() { 10600 sc := -1 10601 if page.Response().Response.Response != nil { 10602 sc = page.Response().Response.Response.StatusCode 10603 } 10604 tracing.EndSpan(ctx, sc, err) 10605 }() 10606 } 10607 for { 10608 next, err := page.fn(ctx, page.lhvncr) 10609 if err != nil { 10610 return err 10611 } 10612 page.lhvncr = next 10613 if !next.hasNextLink() || !next.IsEmpty() { 10614 break 10615 } 10616 } 10617 return nil 10618} 10619 10620// Next advances to the next page of values. If there was an error making 10621// the request the page does not advance and the error is returned. 10622// Deprecated: Use NextWithContext() instead. 10623func (page *ListHubVirtualNetworkConnectionsResultPage) Next() error { 10624 return page.NextWithContext(context.Background()) 10625} 10626 10627// NotDone returns true if the page enumeration should be started or is not yet complete. 10628func (page ListHubVirtualNetworkConnectionsResultPage) NotDone() bool { 10629 return !page.lhvncr.IsEmpty() 10630} 10631 10632// Response returns the raw server response from the last page request. 10633func (page ListHubVirtualNetworkConnectionsResultPage) Response() ListHubVirtualNetworkConnectionsResult { 10634 return page.lhvncr 10635} 10636 10637// Values returns the slice of values for the current page or nil if there are no values. 10638func (page ListHubVirtualNetworkConnectionsResultPage) Values() []HubVirtualNetworkConnection { 10639 if page.lhvncr.IsEmpty() { 10640 return nil 10641 } 10642 return *page.lhvncr.Value 10643} 10644 10645// Creates a new instance of the ListHubVirtualNetworkConnectionsResultPage type. 10646func NewListHubVirtualNetworkConnectionsResultPage(cur ListHubVirtualNetworkConnectionsResult, getNextPage func(context.Context, ListHubVirtualNetworkConnectionsResult) (ListHubVirtualNetworkConnectionsResult, error)) ListHubVirtualNetworkConnectionsResultPage { 10647 return ListHubVirtualNetworkConnectionsResultPage{ 10648 fn: getNextPage, 10649 lhvncr: cur, 10650 } 10651} 10652 10653// ListVirtualHubsResult result of the request to list VirtualHubs. It contains a list of VirtualHubs and a 10654// URL nextLink to get the next set of results. 10655type ListVirtualHubsResult struct { 10656 autorest.Response `json:"-"` 10657 // Value - List of VirtualHubs. 10658 Value *[]VirtualHub `json:"value,omitempty"` 10659 // NextLink - URL to get the next set of operation list results if there are any. 10660 NextLink *string `json:"nextLink,omitempty"` 10661} 10662 10663// ListVirtualHubsResultIterator provides access to a complete listing of VirtualHub values. 10664type ListVirtualHubsResultIterator struct { 10665 i int 10666 page ListVirtualHubsResultPage 10667} 10668 10669// NextWithContext advances to the next value. If there was an error making 10670// the request the iterator does not advance and the error is returned. 10671func (iter *ListVirtualHubsResultIterator) NextWithContext(ctx context.Context) (err error) { 10672 if tracing.IsEnabled() { 10673 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultIterator.NextWithContext") 10674 defer func() { 10675 sc := -1 10676 if iter.Response().Response.Response != nil { 10677 sc = iter.Response().Response.Response.StatusCode 10678 } 10679 tracing.EndSpan(ctx, sc, err) 10680 }() 10681 } 10682 iter.i++ 10683 if iter.i < len(iter.page.Values()) { 10684 return nil 10685 } 10686 err = iter.page.NextWithContext(ctx) 10687 if err != nil { 10688 iter.i-- 10689 return err 10690 } 10691 iter.i = 0 10692 return nil 10693} 10694 10695// Next advances to the next value. If there was an error making 10696// the request the iterator does not advance and the error is returned. 10697// Deprecated: Use NextWithContext() instead. 10698func (iter *ListVirtualHubsResultIterator) Next() error { 10699 return iter.NextWithContext(context.Background()) 10700} 10701 10702// NotDone returns true if the enumeration should be started or is not yet complete. 10703func (iter ListVirtualHubsResultIterator) NotDone() bool { 10704 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10705} 10706 10707// Response returns the raw server response from the last page request. 10708func (iter ListVirtualHubsResultIterator) Response() ListVirtualHubsResult { 10709 return iter.page.Response() 10710} 10711 10712// Value returns the current value or a zero-initialized value if the 10713// iterator has advanced beyond the end of the collection. 10714func (iter ListVirtualHubsResultIterator) Value() VirtualHub { 10715 if !iter.page.NotDone() { 10716 return VirtualHub{} 10717 } 10718 return iter.page.Values()[iter.i] 10719} 10720 10721// Creates a new instance of the ListVirtualHubsResultIterator type. 10722func NewListVirtualHubsResultIterator(page ListVirtualHubsResultPage) ListVirtualHubsResultIterator { 10723 return ListVirtualHubsResultIterator{page: page} 10724} 10725 10726// IsEmpty returns true if the ListResult contains no values. 10727func (lvhr ListVirtualHubsResult) IsEmpty() bool { 10728 return lvhr.Value == nil || len(*lvhr.Value) == 0 10729} 10730 10731// hasNextLink returns true if the NextLink is not empty. 10732func (lvhr ListVirtualHubsResult) hasNextLink() bool { 10733 return lvhr.NextLink != nil && len(*lvhr.NextLink) != 0 10734} 10735 10736// listVirtualHubsResultPreparer prepares a request to retrieve the next set of results. 10737// It returns nil if no more results exist. 10738func (lvhr ListVirtualHubsResult) listVirtualHubsResultPreparer(ctx context.Context) (*http.Request, error) { 10739 if !lvhr.hasNextLink() { 10740 return nil, nil 10741 } 10742 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10743 autorest.AsJSON(), 10744 autorest.AsGet(), 10745 autorest.WithBaseURL(to.String(lvhr.NextLink))) 10746} 10747 10748// ListVirtualHubsResultPage contains a page of VirtualHub values. 10749type ListVirtualHubsResultPage struct { 10750 fn func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error) 10751 lvhr ListVirtualHubsResult 10752} 10753 10754// NextWithContext advances to the next page of values. If there was an error making 10755// the request the page does not advance and the error is returned. 10756func (page *ListVirtualHubsResultPage) NextWithContext(ctx context.Context) (err error) { 10757 if tracing.IsEnabled() { 10758 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubsResultPage.NextWithContext") 10759 defer func() { 10760 sc := -1 10761 if page.Response().Response.Response != nil { 10762 sc = page.Response().Response.Response.StatusCode 10763 } 10764 tracing.EndSpan(ctx, sc, err) 10765 }() 10766 } 10767 for { 10768 next, err := page.fn(ctx, page.lvhr) 10769 if err != nil { 10770 return err 10771 } 10772 page.lvhr = next 10773 if !next.hasNextLink() || !next.IsEmpty() { 10774 break 10775 } 10776 } 10777 return nil 10778} 10779 10780// Next advances to the next page of values. If there was an error making 10781// the request the page does not advance and the error is returned. 10782// Deprecated: Use NextWithContext() instead. 10783func (page *ListVirtualHubsResultPage) Next() error { 10784 return page.NextWithContext(context.Background()) 10785} 10786 10787// NotDone returns true if the page enumeration should be started or is not yet complete. 10788func (page ListVirtualHubsResultPage) NotDone() bool { 10789 return !page.lvhr.IsEmpty() 10790} 10791 10792// Response returns the raw server response from the last page request. 10793func (page ListVirtualHubsResultPage) Response() ListVirtualHubsResult { 10794 return page.lvhr 10795} 10796 10797// Values returns the slice of values for the current page or nil if there are no values. 10798func (page ListVirtualHubsResultPage) Values() []VirtualHub { 10799 if page.lvhr.IsEmpty() { 10800 return nil 10801 } 10802 return *page.lvhr.Value 10803} 10804 10805// Creates a new instance of the ListVirtualHubsResultPage type. 10806func NewListVirtualHubsResultPage(cur ListVirtualHubsResult, getNextPage func(context.Context, ListVirtualHubsResult) (ListVirtualHubsResult, error)) ListVirtualHubsResultPage { 10807 return ListVirtualHubsResultPage{ 10808 fn: getNextPage, 10809 lvhr: cur, 10810 } 10811} 10812 10813// ListVirtualWANsResult result of the request to list VirtualWANs. It contains a list of VirtualWANs and a 10814// URL nextLink to get the next set of results. 10815type ListVirtualWANsResult struct { 10816 autorest.Response `json:"-"` 10817 // Value - List of VirtualWANs. 10818 Value *[]VirtualWAN `json:"value,omitempty"` 10819 // NextLink - URL to get the next set of operation list results if there are any. 10820 NextLink *string `json:"nextLink,omitempty"` 10821} 10822 10823// ListVirtualWANsResultIterator provides access to a complete listing of VirtualWAN values. 10824type ListVirtualWANsResultIterator struct { 10825 i int 10826 page ListVirtualWANsResultPage 10827} 10828 10829// NextWithContext advances to the next value. If there was an error making 10830// the request the iterator does not advance and the error is returned. 10831func (iter *ListVirtualWANsResultIterator) NextWithContext(ctx context.Context) (err error) { 10832 if tracing.IsEnabled() { 10833 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultIterator.NextWithContext") 10834 defer func() { 10835 sc := -1 10836 if iter.Response().Response.Response != nil { 10837 sc = iter.Response().Response.Response.StatusCode 10838 } 10839 tracing.EndSpan(ctx, sc, err) 10840 }() 10841 } 10842 iter.i++ 10843 if iter.i < len(iter.page.Values()) { 10844 return nil 10845 } 10846 err = iter.page.NextWithContext(ctx) 10847 if err != nil { 10848 iter.i-- 10849 return err 10850 } 10851 iter.i = 0 10852 return nil 10853} 10854 10855// Next advances to the next value. If there was an error making 10856// the request the iterator does not advance and the error is returned. 10857// Deprecated: Use NextWithContext() instead. 10858func (iter *ListVirtualWANsResultIterator) Next() error { 10859 return iter.NextWithContext(context.Background()) 10860} 10861 10862// NotDone returns true if the enumeration should be started or is not yet complete. 10863func (iter ListVirtualWANsResultIterator) NotDone() bool { 10864 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10865} 10866 10867// Response returns the raw server response from the last page request. 10868func (iter ListVirtualWANsResultIterator) Response() ListVirtualWANsResult { 10869 return iter.page.Response() 10870} 10871 10872// Value returns the current value or a zero-initialized value if the 10873// iterator has advanced beyond the end of the collection. 10874func (iter ListVirtualWANsResultIterator) Value() VirtualWAN { 10875 if !iter.page.NotDone() { 10876 return VirtualWAN{} 10877 } 10878 return iter.page.Values()[iter.i] 10879} 10880 10881// Creates a new instance of the ListVirtualWANsResultIterator type. 10882func NewListVirtualWANsResultIterator(page ListVirtualWANsResultPage) ListVirtualWANsResultIterator { 10883 return ListVirtualWANsResultIterator{page: page} 10884} 10885 10886// IsEmpty returns true if the ListResult contains no values. 10887func (lvwnr ListVirtualWANsResult) IsEmpty() bool { 10888 return lvwnr.Value == nil || len(*lvwnr.Value) == 0 10889} 10890 10891// hasNextLink returns true if the NextLink is not empty. 10892func (lvwnr ListVirtualWANsResult) hasNextLink() bool { 10893 return lvwnr.NextLink != nil && len(*lvwnr.NextLink) != 0 10894} 10895 10896// listVirtualWANsResultPreparer prepares a request to retrieve the next set of results. 10897// It returns nil if no more results exist. 10898func (lvwnr ListVirtualWANsResult) listVirtualWANsResultPreparer(ctx context.Context) (*http.Request, error) { 10899 if !lvwnr.hasNextLink() { 10900 return nil, nil 10901 } 10902 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10903 autorest.AsJSON(), 10904 autorest.AsGet(), 10905 autorest.WithBaseURL(to.String(lvwnr.NextLink))) 10906} 10907 10908// ListVirtualWANsResultPage contains a page of VirtualWAN values. 10909type ListVirtualWANsResultPage struct { 10910 fn func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error) 10911 lvwnr ListVirtualWANsResult 10912} 10913 10914// NextWithContext advances to the next page of values. If there was an error making 10915// the request the page does not advance and the error is returned. 10916func (page *ListVirtualWANsResultPage) NextWithContext(ctx context.Context) (err error) { 10917 if tracing.IsEnabled() { 10918 ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualWANsResultPage.NextWithContext") 10919 defer func() { 10920 sc := -1 10921 if page.Response().Response.Response != nil { 10922 sc = page.Response().Response.Response.StatusCode 10923 } 10924 tracing.EndSpan(ctx, sc, err) 10925 }() 10926 } 10927 for { 10928 next, err := page.fn(ctx, page.lvwnr) 10929 if err != nil { 10930 return err 10931 } 10932 page.lvwnr = next 10933 if !next.hasNextLink() || !next.IsEmpty() { 10934 break 10935 } 10936 } 10937 return nil 10938} 10939 10940// Next advances to the next page of values. If there was an error making 10941// the request the page does not advance and the error is returned. 10942// Deprecated: Use NextWithContext() instead. 10943func (page *ListVirtualWANsResultPage) Next() error { 10944 return page.NextWithContext(context.Background()) 10945} 10946 10947// NotDone returns true if the page enumeration should be started or is not yet complete. 10948func (page ListVirtualWANsResultPage) NotDone() bool { 10949 return !page.lvwnr.IsEmpty() 10950} 10951 10952// Response returns the raw server response from the last page request. 10953func (page ListVirtualWANsResultPage) Response() ListVirtualWANsResult { 10954 return page.lvwnr 10955} 10956 10957// Values returns the slice of values for the current page or nil if there are no values. 10958func (page ListVirtualWANsResultPage) Values() []VirtualWAN { 10959 if page.lvwnr.IsEmpty() { 10960 return nil 10961 } 10962 return *page.lvwnr.Value 10963} 10964 10965// Creates a new instance of the ListVirtualWANsResultPage type. 10966func NewListVirtualWANsResultPage(cur ListVirtualWANsResult, getNextPage func(context.Context, ListVirtualWANsResult) (ListVirtualWANsResult, error)) ListVirtualWANsResultPage { 10967 return ListVirtualWANsResultPage{ 10968 fn: getNextPage, 10969 lvwnr: cur, 10970 } 10971} 10972 10973// ListVpnConnectionsResult result of the request to list all vpn connections to a virtual wan vpn gateway. 10974// It contains a list of Vpn Connections and a URL nextLink to get the next set of results. 10975type ListVpnConnectionsResult struct { 10976 autorest.Response `json:"-"` 10977 // Value - List of Vpn Connections. 10978 Value *[]VpnConnection `json:"value,omitempty"` 10979 // NextLink - URL to get the next set of operation list results if there are any. 10980 NextLink *string `json:"nextLink,omitempty"` 10981} 10982 10983// ListVpnConnectionsResultIterator provides access to a complete listing of VpnConnection values. 10984type ListVpnConnectionsResultIterator struct { 10985 i int 10986 page ListVpnConnectionsResultPage 10987} 10988 10989// NextWithContext advances to the next value. If there was an error making 10990// the request the iterator does not advance and the error is returned. 10991func (iter *ListVpnConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { 10992 if tracing.IsEnabled() { 10993 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultIterator.NextWithContext") 10994 defer func() { 10995 sc := -1 10996 if iter.Response().Response.Response != nil { 10997 sc = iter.Response().Response.Response.StatusCode 10998 } 10999 tracing.EndSpan(ctx, sc, err) 11000 }() 11001 } 11002 iter.i++ 11003 if iter.i < len(iter.page.Values()) { 11004 return nil 11005 } 11006 err = iter.page.NextWithContext(ctx) 11007 if err != nil { 11008 iter.i-- 11009 return err 11010 } 11011 iter.i = 0 11012 return nil 11013} 11014 11015// Next advances to the next value. If there was an error making 11016// the request the iterator does not advance and the error is returned. 11017// Deprecated: Use NextWithContext() instead. 11018func (iter *ListVpnConnectionsResultIterator) Next() error { 11019 return iter.NextWithContext(context.Background()) 11020} 11021 11022// NotDone returns true if the enumeration should be started or is not yet complete. 11023func (iter ListVpnConnectionsResultIterator) NotDone() bool { 11024 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11025} 11026 11027// Response returns the raw server response from the last page request. 11028func (iter ListVpnConnectionsResultIterator) Response() ListVpnConnectionsResult { 11029 return iter.page.Response() 11030} 11031 11032// Value returns the current value or a zero-initialized value if the 11033// iterator has advanced beyond the end of the collection. 11034func (iter ListVpnConnectionsResultIterator) Value() VpnConnection { 11035 if !iter.page.NotDone() { 11036 return VpnConnection{} 11037 } 11038 return iter.page.Values()[iter.i] 11039} 11040 11041// Creates a new instance of the ListVpnConnectionsResultIterator type. 11042func NewListVpnConnectionsResultIterator(page ListVpnConnectionsResultPage) ListVpnConnectionsResultIterator { 11043 return ListVpnConnectionsResultIterator{page: page} 11044} 11045 11046// IsEmpty returns true if the ListResult contains no values. 11047func (lvcr ListVpnConnectionsResult) IsEmpty() bool { 11048 return lvcr.Value == nil || len(*lvcr.Value) == 0 11049} 11050 11051// hasNextLink returns true if the NextLink is not empty. 11052func (lvcr ListVpnConnectionsResult) hasNextLink() bool { 11053 return lvcr.NextLink != nil && len(*lvcr.NextLink) != 0 11054} 11055 11056// listVpnConnectionsResultPreparer prepares a request to retrieve the next set of results. 11057// It returns nil if no more results exist. 11058func (lvcr ListVpnConnectionsResult) listVpnConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { 11059 if !lvcr.hasNextLink() { 11060 return nil, nil 11061 } 11062 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11063 autorest.AsJSON(), 11064 autorest.AsGet(), 11065 autorest.WithBaseURL(to.String(lvcr.NextLink))) 11066} 11067 11068// ListVpnConnectionsResultPage contains a page of VpnConnection values. 11069type ListVpnConnectionsResultPage struct { 11070 fn func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error) 11071 lvcr ListVpnConnectionsResult 11072} 11073 11074// NextWithContext advances to the next page of values. If there was an error making 11075// the request the page does not advance and the error is returned. 11076func (page *ListVpnConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { 11077 if tracing.IsEnabled() { 11078 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnConnectionsResultPage.NextWithContext") 11079 defer func() { 11080 sc := -1 11081 if page.Response().Response.Response != nil { 11082 sc = page.Response().Response.Response.StatusCode 11083 } 11084 tracing.EndSpan(ctx, sc, err) 11085 }() 11086 } 11087 for { 11088 next, err := page.fn(ctx, page.lvcr) 11089 if err != nil { 11090 return err 11091 } 11092 page.lvcr = next 11093 if !next.hasNextLink() || !next.IsEmpty() { 11094 break 11095 } 11096 } 11097 return nil 11098} 11099 11100// Next advances to the next page of values. If there was an error making 11101// the request the page does not advance and the error is returned. 11102// Deprecated: Use NextWithContext() instead. 11103func (page *ListVpnConnectionsResultPage) Next() error { 11104 return page.NextWithContext(context.Background()) 11105} 11106 11107// NotDone returns true if the page enumeration should be started or is not yet complete. 11108func (page ListVpnConnectionsResultPage) NotDone() bool { 11109 return !page.lvcr.IsEmpty() 11110} 11111 11112// Response returns the raw server response from the last page request. 11113func (page ListVpnConnectionsResultPage) Response() ListVpnConnectionsResult { 11114 return page.lvcr 11115} 11116 11117// Values returns the slice of values for the current page or nil if there are no values. 11118func (page ListVpnConnectionsResultPage) Values() []VpnConnection { 11119 if page.lvcr.IsEmpty() { 11120 return nil 11121 } 11122 return *page.lvcr.Value 11123} 11124 11125// Creates a new instance of the ListVpnConnectionsResultPage type. 11126func NewListVpnConnectionsResultPage(cur ListVpnConnectionsResult, getNextPage func(context.Context, ListVpnConnectionsResult) (ListVpnConnectionsResult, error)) ListVpnConnectionsResultPage { 11127 return ListVpnConnectionsResultPage{ 11128 fn: getNextPage, 11129 lvcr: cur, 11130 } 11131} 11132 11133// ListVpnGatewaysResult result of the request to list VpnGateways. It contains a list of VpnGateways and a 11134// URL nextLink to get the next set of results. 11135type ListVpnGatewaysResult struct { 11136 autorest.Response `json:"-"` 11137 // Value - List of VpnGateways. 11138 Value *[]VpnGateway `json:"value,omitempty"` 11139 // NextLink - URL to get the next set of operation list results if there are any. 11140 NextLink *string `json:"nextLink,omitempty"` 11141} 11142 11143// ListVpnGatewaysResultIterator provides access to a complete listing of VpnGateway values. 11144type ListVpnGatewaysResultIterator struct { 11145 i int 11146 page ListVpnGatewaysResultPage 11147} 11148 11149// NextWithContext advances to the next value. If there was an error making 11150// the request the iterator does not advance and the error is returned. 11151func (iter *ListVpnGatewaysResultIterator) NextWithContext(ctx context.Context) (err error) { 11152 if tracing.IsEnabled() { 11153 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultIterator.NextWithContext") 11154 defer func() { 11155 sc := -1 11156 if iter.Response().Response.Response != nil { 11157 sc = iter.Response().Response.Response.StatusCode 11158 } 11159 tracing.EndSpan(ctx, sc, err) 11160 }() 11161 } 11162 iter.i++ 11163 if iter.i < len(iter.page.Values()) { 11164 return nil 11165 } 11166 err = iter.page.NextWithContext(ctx) 11167 if err != nil { 11168 iter.i-- 11169 return err 11170 } 11171 iter.i = 0 11172 return nil 11173} 11174 11175// Next advances to the next value. If there was an error making 11176// the request the iterator does not advance and the error is returned. 11177// Deprecated: Use NextWithContext() instead. 11178func (iter *ListVpnGatewaysResultIterator) Next() error { 11179 return iter.NextWithContext(context.Background()) 11180} 11181 11182// NotDone returns true if the enumeration should be started or is not yet complete. 11183func (iter ListVpnGatewaysResultIterator) NotDone() bool { 11184 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11185} 11186 11187// Response returns the raw server response from the last page request. 11188func (iter ListVpnGatewaysResultIterator) Response() ListVpnGatewaysResult { 11189 return iter.page.Response() 11190} 11191 11192// Value returns the current value or a zero-initialized value if the 11193// iterator has advanced beyond the end of the collection. 11194func (iter ListVpnGatewaysResultIterator) Value() VpnGateway { 11195 if !iter.page.NotDone() { 11196 return VpnGateway{} 11197 } 11198 return iter.page.Values()[iter.i] 11199} 11200 11201// Creates a new instance of the ListVpnGatewaysResultIterator type. 11202func NewListVpnGatewaysResultIterator(page ListVpnGatewaysResultPage) ListVpnGatewaysResultIterator { 11203 return ListVpnGatewaysResultIterator{page: page} 11204} 11205 11206// IsEmpty returns true if the ListResult contains no values. 11207func (lvgr ListVpnGatewaysResult) IsEmpty() bool { 11208 return lvgr.Value == nil || len(*lvgr.Value) == 0 11209} 11210 11211// hasNextLink returns true if the NextLink is not empty. 11212func (lvgr ListVpnGatewaysResult) hasNextLink() bool { 11213 return lvgr.NextLink != nil && len(*lvgr.NextLink) != 0 11214} 11215 11216// listVpnGatewaysResultPreparer prepares a request to retrieve the next set of results. 11217// It returns nil if no more results exist. 11218func (lvgr ListVpnGatewaysResult) listVpnGatewaysResultPreparer(ctx context.Context) (*http.Request, error) { 11219 if !lvgr.hasNextLink() { 11220 return nil, nil 11221 } 11222 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11223 autorest.AsJSON(), 11224 autorest.AsGet(), 11225 autorest.WithBaseURL(to.String(lvgr.NextLink))) 11226} 11227 11228// ListVpnGatewaysResultPage contains a page of VpnGateway values. 11229type ListVpnGatewaysResultPage struct { 11230 fn func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error) 11231 lvgr ListVpnGatewaysResult 11232} 11233 11234// NextWithContext advances to the next page of values. If there was an error making 11235// the request the page does not advance and the error is returned. 11236func (page *ListVpnGatewaysResultPage) NextWithContext(ctx context.Context) (err error) { 11237 if tracing.IsEnabled() { 11238 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnGatewaysResultPage.NextWithContext") 11239 defer func() { 11240 sc := -1 11241 if page.Response().Response.Response != nil { 11242 sc = page.Response().Response.Response.StatusCode 11243 } 11244 tracing.EndSpan(ctx, sc, err) 11245 }() 11246 } 11247 for { 11248 next, err := page.fn(ctx, page.lvgr) 11249 if err != nil { 11250 return err 11251 } 11252 page.lvgr = next 11253 if !next.hasNextLink() || !next.IsEmpty() { 11254 break 11255 } 11256 } 11257 return nil 11258} 11259 11260// Next advances to the next page of values. If there was an error making 11261// the request the page does not advance and the error is returned. 11262// Deprecated: Use NextWithContext() instead. 11263func (page *ListVpnGatewaysResultPage) Next() error { 11264 return page.NextWithContext(context.Background()) 11265} 11266 11267// NotDone returns true if the page enumeration should be started or is not yet complete. 11268func (page ListVpnGatewaysResultPage) NotDone() bool { 11269 return !page.lvgr.IsEmpty() 11270} 11271 11272// Response returns the raw server response from the last page request. 11273func (page ListVpnGatewaysResultPage) Response() ListVpnGatewaysResult { 11274 return page.lvgr 11275} 11276 11277// Values returns the slice of values for the current page or nil if there are no values. 11278func (page ListVpnGatewaysResultPage) Values() []VpnGateway { 11279 if page.lvgr.IsEmpty() { 11280 return nil 11281 } 11282 return *page.lvgr.Value 11283} 11284 11285// Creates a new instance of the ListVpnGatewaysResultPage type. 11286func NewListVpnGatewaysResultPage(cur ListVpnGatewaysResult, getNextPage func(context.Context, ListVpnGatewaysResult) (ListVpnGatewaysResult, error)) ListVpnGatewaysResultPage { 11287 return ListVpnGatewaysResultPage{ 11288 fn: getNextPage, 11289 lvgr: cur, 11290 } 11291} 11292 11293// ListVpnSitesResult result of the request to list VpnSites. It contains a list of VpnSites and a URL 11294// nextLink to get the next set of results. 11295type ListVpnSitesResult struct { 11296 autorest.Response `json:"-"` 11297 // Value - List of VpnSites. 11298 Value *[]VpnSite `json:"value,omitempty"` 11299 // NextLink - URL to get the next set of operation list results if there are any. 11300 NextLink *string `json:"nextLink,omitempty"` 11301} 11302 11303// ListVpnSitesResultIterator provides access to a complete listing of VpnSite values. 11304type ListVpnSitesResultIterator struct { 11305 i int 11306 page ListVpnSitesResultPage 11307} 11308 11309// NextWithContext advances to the next value. If there was an error making 11310// the request the iterator does not advance and the error is returned. 11311func (iter *ListVpnSitesResultIterator) NextWithContext(ctx context.Context) (err error) { 11312 if tracing.IsEnabled() { 11313 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultIterator.NextWithContext") 11314 defer func() { 11315 sc := -1 11316 if iter.Response().Response.Response != nil { 11317 sc = iter.Response().Response.Response.StatusCode 11318 } 11319 tracing.EndSpan(ctx, sc, err) 11320 }() 11321 } 11322 iter.i++ 11323 if iter.i < len(iter.page.Values()) { 11324 return nil 11325 } 11326 err = iter.page.NextWithContext(ctx) 11327 if err != nil { 11328 iter.i-- 11329 return err 11330 } 11331 iter.i = 0 11332 return nil 11333} 11334 11335// Next advances to the next value. If there was an error making 11336// the request the iterator does not advance and the error is returned. 11337// Deprecated: Use NextWithContext() instead. 11338func (iter *ListVpnSitesResultIterator) Next() error { 11339 return iter.NextWithContext(context.Background()) 11340} 11341 11342// NotDone returns true if the enumeration should be started or is not yet complete. 11343func (iter ListVpnSitesResultIterator) NotDone() bool { 11344 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11345} 11346 11347// Response returns the raw server response from the last page request. 11348func (iter ListVpnSitesResultIterator) Response() ListVpnSitesResult { 11349 return iter.page.Response() 11350} 11351 11352// Value returns the current value or a zero-initialized value if the 11353// iterator has advanced beyond the end of the collection. 11354func (iter ListVpnSitesResultIterator) Value() VpnSite { 11355 if !iter.page.NotDone() { 11356 return VpnSite{} 11357 } 11358 return iter.page.Values()[iter.i] 11359} 11360 11361// Creates a new instance of the ListVpnSitesResultIterator type. 11362func NewListVpnSitesResultIterator(page ListVpnSitesResultPage) ListVpnSitesResultIterator { 11363 return ListVpnSitesResultIterator{page: page} 11364} 11365 11366// IsEmpty returns true if the ListResult contains no values. 11367func (lvsr ListVpnSitesResult) IsEmpty() bool { 11368 return lvsr.Value == nil || len(*lvsr.Value) == 0 11369} 11370 11371// hasNextLink returns true if the NextLink is not empty. 11372func (lvsr ListVpnSitesResult) hasNextLink() bool { 11373 return lvsr.NextLink != nil && len(*lvsr.NextLink) != 0 11374} 11375 11376// listVpnSitesResultPreparer prepares a request to retrieve the next set of results. 11377// It returns nil if no more results exist. 11378func (lvsr ListVpnSitesResult) listVpnSitesResultPreparer(ctx context.Context) (*http.Request, error) { 11379 if !lvsr.hasNextLink() { 11380 return nil, nil 11381 } 11382 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11383 autorest.AsJSON(), 11384 autorest.AsGet(), 11385 autorest.WithBaseURL(to.String(lvsr.NextLink))) 11386} 11387 11388// ListVpnSitesResultPage contains a page of VpnSite values. 11389type ListVpnSitesResultPage struct { 11390 fn func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error) 11391 lvsr ListVpnSitesResult 11392} 11393 11394// NextWithContext advances to the next page of values. If there was an error making 11395// the request the page does not advance and the error is returned. 11396func (page *ListVpnSitesResultPage) NextWithContext(ctx context.Context) (err error) { 11397 if tracing.IsEnabled() { 11398 ctx = tracing.StartSpan(ctx, fqdn+"/ListVpnSitesResultPage.NextWithContext") 11399 defer func() { 11400 sc := -1 11401 if page.Response().Response.Response != nil { 11402 sc = page.Response().Response.Response.StatusCode 11403 } 11404 tracing.EndSpan(ctx, sc, err) 11405 }() 11406 } 11407 for { 11408 next, err := page.fn(ctx, page.lvsr) 11409 if err != nil { 11410 return err 11411 } 11412 page.lvsr = next 11413 if !next.hasNextLink() || !next.IsEmpty() { 11414 break 11415 } 11416 } 11417 return nil 11418} 11419 11420// Next advances to the next page of values. If there was an error making 11421// the request the page does not advance and the error is returned. 11422// Deprecated: Use NextWithContext() instead. 11423func (page *ListVpnSitesResultPage) Next() error { 11424 return page.NextWithContext(context.Background()) 11425} 11426 11427// NotDone returns true if the page enumeration should be started or is not yet complete. 11428func (page ListVpnSitesResultPage) NotDone() bool { 11429 return !page.lvsr.IsEmpty() 11430} 11431 11432// Response returns the raw server response from the last page request. 11433func (page ListVpnSitesResultPage) Response() ListVpnSitesResult { 11434 return page.lvsr 11435} 11436 11437// Values returns the slice of values for the current page or nil if there are no values. 11438func (page ListVpnSitesResultPage) Values() []VpnSite { 11439 if page.lvsr.IsEmpty() { 11440 return nil 11441 } 11442 return *page.lvsr.Value 11443} 11444 11445// Creates a new instance of the ListVpnSitesResultPage type. 11446func NewListVpnSitesResultPage(cur ListVpnSitesResult, getNextPage func(context.Context, ListVpnSitesResult) (ListVpnSitesResult, error)) ListVpnSitesResultPage { 11447 return ListVpnSitesResultPage{ 11448 fn: getNextPage, 11449 lvsr: cur, 11450 } 11451} 11452 11453// LoadBalancer loadBalancer resource 11454type LoadBalancer struct { 11455 autorest.Response `json:"-"` 11456 // Sku - The load balancer SKU. 11457 Sku *LoadBalancerSku `json:"sku,omitempty"` 11458 // LoadBalancerPropertiesFormat - Properties of load balancer. 11459 *LoadBalancerPropertiesFormat `json:"properties,omitempty"` 11460 // Etag - A unique read-only string that changes whenever the resource is updated. 11461 Etag *string `json:"etag,omitempty"` 11462 // ID - Resource ID. 11463 ID *string `json:"id,omitempty"` 11464 // Name - READ-ONLY; Resource name. 11465 Name *string `json:"name,omitempty"` 11466 // Type - READ-ONLY; Resource type. 11467 Type *string `json:"type,omitempty"` 11468 // Location - Resource location. 11469 Location *string `json:"location,omitempty"` 11470 // Tags - Resource tags. 11471 Tags map[string]*string `json:"tags"` 11472} 11473 11474// MarshalJSON is the custom marshaler for LoadBalancer. 11475func (lb LoadBalancer) MarshalJSON() ([]byte, error) { 11476 objectMap := make(map[string]interface{}) 11477 if lb.Sku != nil { 11478 objectMap["sku"] = lb.Sku 11479 } 11480 if lb.LoadBalancerPropertiesFormat != nil { 11481 objectMap["properties"] = lb.LoadBalancerPropertiesFormat 11482 } 11483 if lb.Etag != nil { 11484 objectMap["etag"] = lb.Etag 11485 } 11486 if lb.ID != nil { 11487 objectMap["id"] = lb.ID 11488 } 11489 if lb.Location != nil { 11490 objectMap["location"] = lb.Location 11491 } 11492 if lb.Tags != nil { 11493 objectMap["tags"] = lb.Tags 11494 } 11495 return json.Marshal(objectMap) 11496} 11497 11498// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. 11499func (lb *LoadBalancer) UnmarshalJSON(body []byte) error { 11500 var m map[string]*json.RawMessage 11501 err := json.Unmarshal(body, &m) 11502 if err != nil { 11503 return err 11504 } 11505 for k, v := range m { 11506 switch k { 11507 case "sku": 11508 if v != nil { 11509 var sku LoadBalancerSku 11510 err = json.Unmarshal(*v, &sku) 11511 if err != nil { 11512 return err 11513 } 11514 lb.Sku = &sku 11515 } 11516 case "properties": 11517 if v != nil { 11518 var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat 11519 err = json.Unmarshal(*v, &loadBalancerPropertiesFormat) 11520 if err != nil { 11521 return err 11522 } 11523 lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat 11524 } 11525 case "etag": 11526 if v != nil { 11527 var etag string 11528 err = json.Unmarshal(*v, &etag) 11529 if err != nil { 11530 return err 11531 } 11532 lb.Etag = &etag 11533 } 11534 case "id": 11535 if v != nil { 11536 var ID string 11537 err = json.Unmarshal(*v, &ID) 11538 if err != nil { 11539 return err 11540 } 11541 lb.ID = &ID 11542 } 11543 case "name": 11544 if v != nil { 11545 var name string 11546 err = json.Unmarshal(*v, &name) 11547 if err != nil { 11548 return err 11549 } 11550 lb.Name = &name 11551 } 11552 case "type": 11553 if v != nil { 11554 var typeVar string 11555 err = json.Unmarshal(*v, &typeVar) 11556 if err != nil { 11557 return err 11558 } 11559 lb.Type = &typeVar 11560 } 11561 case "location": 11562 if v != nil { 11563 var location string 11564 err = json.Unmarshal(*v, &location) 11565 if err != nil { 11566 return err 11567 } 11568 lb.Location = &location 11569 } 11570 case "tags": 11571 if v != nil { 11572 var tags map[string]*string 11573 err = json.Unmarshal(*v, &tags) 11574 if err != nil { 11575 return err 11576 } 11577 lb.Tags = tags 11578 } 11579 } 11580 } 11581 11582 return nil 11583} 11584 11585// LoadBalancerBackendAddressPoolListResult response for ListBackendAddressPool API service call. 11586type LoadBalancerBackendAddressPoolListResult struct { 11587 autorest.Response `json:"-"` 11588 // Value - A list of backend address pools in a load balancer. 11589 Value *[]BackendAddressPool `json:"value,omitempty"` 11590 // NextLink - READ-ONLY; The URL to get the next set of results. 11591 NextLink *string `json:"nextLink,omitempty"` 11592} 11593 11594// MarshalJSON is the custom marshaler for LoadBalancerBackendAddressPoolListResult. 11595func (lbbaplr LoadBalancerBackendAddressPoolListResult) MarshalJSON() ([]byte, error) { 11596 objectMap := make(map[string]interface{}) 11597 if lbbaplr.Value != nil { 11598 objectMap["value"] = lbbaplr.Value 11599 } 11600 return json.Marshal(objectMap) 11601} 11602 11603// LoadBalancerBackendAddressPoolListResultIterator provides access to a complete listing of 11604// BackendAddressPool values. 11605type LoadBalancerBackendAddressPoolListResultIterator struct { 11606 i int 11607 page LoadBalancerBackendAddressPoolListResultPage 11608} 11609 11610// NextWithContext advances to the next value. If there was an error making 11611// the request the iterator does not advance and the error is returned. 11612func (iter *LoadBalancerBackendAddressPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { 11613 if tracing.IsEnabled() { 11614 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultIterator.NextWithContext") 11615 defer func() { 11616 sc := -1 11617 if iter.Response().Response.Response != nil { 11618 sc = iter.Response().Response.Response.StatusCode 11619 } 11620 tracing.EndSpan(ctx, sc, err) 11621 }() 11622 } 11623 iter.i++ 11624 if iter.i < len(iter.page.Values()) { 11625 return nil 11626 } 11627 err = iter.page.NextWithContext(ctx) 11628 if err != nil { 11629 iter.i-- 11630 return err 11631 } 11632 iter.i = 0 11633 return nil 11634} 11635 11636// Next advances to the next value. If there was an error making 11637// the request the iterator does not advance and the error is returned. 11638// Deprecated: Use NextWithContext() instead. 11639func (iter *LoadBalancerBackendAddressPoolListResultIterator) Next() error { 11640 return iter.NextWithContext(context.Background()) 11641} 11642 11643// NotDone returns true if the enumeration should be started or is not yet complete. 11644func (iter LoadBalancerBackendAddressPoolListResultIterator) NotDone() bool { 11645 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11646} 11647 11648// Response returns the raw server response from the last page request. 11649func (iter LoadBalancerBackendAddressPoolListResultIterator) Response() LoadBalancerBackendAddressPoolListResult { 11650 return iter.page.Response() 11651} 11652 11653// Value returns the current value or a zero-initialized value if the 11654// iterator has advanced beyond the end of the collection. 11655func (iter LoadBalancerBackendAddressPoolListResultIterator) Value() BackendAddressPool { 11656 if !iter.page.NotDone() { 11657 return BackendAddressPool{} 11658 } 11659 return iter.page.Values()[iter.i] 11660} 11661 11662// Creates a new instance of the LoadBalancerBackendAddressPoolListResultIterator type. 11663func NewLoadBalancerBackendAddressPoolListResultIterator(page LoadBalancerBackendAddressPoolListResultPage) LoadBalancerBackendAddressPoolListResultIterator { 11664 return LoadBalancerBackendAddressPoolListResultIterator{page: page} 11665} 11666 11667// IsEmpty returns true if the ListResult contains no values. 11668func (lbbaplr LoadBalancerBackendAddressPoolListResult) IsEmpty() bool { 11669 return lbbaplr.Value == nil || len(*lbbaplr.Value) == 0 11670} 11671 11672// hasNextLink returns true if the NextLink is not empty. 11673func (lbbaplr LoadBalancerBackendAddressPoolListResult) hasNextLink() bool { 11674 return lbbaplr.NextLink != nil && len(*lbbaplr.NextLink) != 0 11675} 11676 11677// loadBalancerBackendAddressPoolListResultPreparer prepares a request to retrieve the next set of results. 11678// It returns nil if no more results exist. 11679func (lbbaplr LoadBalancerBackendAddressPoolListResult) loadBalancerBackendAddressPoolListResultPreparer(ctx context.Context) (*http.Request, error) { 11680 if !lbbaplr.hasNextLink() { 11681 return nil, nil 11682 } 11683 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11684 autorest.AsJSON(), 11685 autorest.AsGet(), 11686 autorest.WithBaseURL(to.String(lbbaplr.NextLink))) 11687} 11688 11689// LoadBalancerBackendAddressPoolListResultPage contains a page of BackendAddressPool values. 11690type LoadBalancerBackendAddressPoolListResultPage struct { 11691 fn func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error) 11692 lbbaplr LoadBalancerBackendAddressPoolListResult 11693} 11694 11695// NextWithContext advances to the next page of values. If there was an error making 11696// the request the page does not advance and the error is returned. 11697func (page *LoadBalancerBackendAddressPoolListResultPage) NextWithContext(ctx context.Context) (err error) { 11698 if tracing.IsEnabled() { 11699 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerBackendAddressPoolListResultPage.NextWithContext") 11700 defer func() { 11701 sc := -1 11702 if page.Response().Response.Response != nil { 11703 sc = page.Response().Response.Response.StatusCode 11704 } 11705 tracing.EndSpan(ctx, sc, err) 11706 }() 11707 } 11708 for { 11709 next, err := page.fn(ctx, page.lbbaplr) 11710 if err != nil { 11711 return err 11712 } 11713 page.lbbaplr = next 11714 if !next.hasNextLink() || !next.IsEmpty() { 11715 break 11716 } 11717 } 11718 return nil 11719} 11720 11721// Next advances to the next page of values. If there was an error making 11722// the request the page does not advance and the error is returned. 11723// Deprecated: Use NextWithContext() instead. 11724func (page *LoadBalancerBackendAddressPoolListResultPage) Next() error { 11725 return page.NextWithContext(context.Background()) 11726} 11727 11728// NotDone returns true if the page enumeration should be started or is not yet complete. 11729func (page LoadBalancerBackendAddressPoolListResultPage) NotDone() bool { 11730 return !page.lbbaplr.IsEmpty() 11731} 11732 11733// Response returns the raw server response from the last page request. 11734func (page LoadBalancerBackendAddressPoolListResultPage) Response() LoadBalancerBackendAddressPoolListResult { 11735 return page.lbbaplr 11736} 11737 11738// Values returns the slice of values for the current page or nil if there are no values. 11739func (page LoadBalancerBackendAddressPoolListResultPage) Values() []BackendAddressPool { 11740 if page.lbbaplr.IsEmpty() { 11741 return nil 11742 } 11743 return *page.lbbaplr.Value 11744} 11745 11746// Creates a new instance of the LoadBalancerBackendAddressPoolListResultPage type. 11747func NewLoadBalancerBackendAddressPoolListResultPage(cur LoadBalancerBackendAddressPoolListResult, getNextPage func(context.Context, LoadBalancerBackendAddressPoolListResult) (LoadBalancerBackendAddressPoolListResult, error)) LoadBalancerBackendAddressPoolListResultPage { 11748 return LoadBalancerBackendAddressPoolListResultPage{ 11749 fn: getNextPage, 11750 lbbaplr: cur, 11751 } 11752} 11753 11754// LoadBalancerFrontendIPConfigurationListResult response for ListFrontendIPConfiguration API service call. 11755type LoadBalancerFrontendIPConfigurationListResult struct { 11756 autorest.Response `json:"-"` 11757 // Value - A list of frontend IP configurations in a load balancer. 11758 Value *[]FrontendIPConfiguration `json:"value,omitempty"` 11759 // NextLink - READ-ONLY; The URL to get the next set of results. 11760 NextLink *string `json:"nextLink,omitempty"` 11761} 11762 11763// MarshalJSON is the custom marshaler for LoadBalancerFrontendIPConfigurationListResult. 11764func (lbficlr LoadBalancerFrontendIPConfigurationListResult) MarshalJSON() ([]byte, error) { 11765 objectMap := make(map[string]interface{}) 11766 if lbficlr.Value != nil { 11767 objectMap["value"] = lbficlr.Value 11768 } 11769 return json.Marshal(objectMap) 11770} 11771 11772// LoadBalancerFrontendIPConfigurationListResultIterator provides access to a complete listing of 11773// FrontendIPConfiguration values. 11774type LoadBalancerFrontendIPConfigurationListResultIterator struct { 11775 i int 11776 page LoadBalancerFrontendIPConfigurationListResultPage 11777} 11778 11779// NextWithContext advances to the next value. If there was an error making 11780// the request the iterator does not advance and the error is returned. 11781func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { 11782 if tracing.IsEnabled() { 11783 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultIterator.NextWithContext") 11784 defer func() { 11785 sc := -1 11786 if iter.Response().Response.Response != nil { 11787 sc = iter.Response().Response.Response.StatusCode 11788 } 11789 tracing.EndSpan(ctx, sc, err) 11790 }() 11791 } 11792 iter.i++ 11793 if iter.i < len(iter.page.Values()) { 11794 return nil 11795 } 11796 err = iter.page.NextWithContext(ctx) 11797 if err != nil { 11798 iter.i-- 11799 return err 11800 } 11801 iter.i = 0 11802 return nil 11803} 11804 11805// Next advances to the next value. If there was an error making 11806// the request the iterator does not advance and the error is returned. 11807// Deprecated: Use NextWithContext() instead. 11808func (iter *LoadBalancerFrontendIPConfigurationListResultIterator) Next() error { 11809 return iter.NextWithContext(context.Background()) 11810} 11811 11812// NotDone returns true if the enumeration should be started or is not yet complete. 11813func (iter LoadBalancerFrontendIPConfigurationListResultIterator) NotDone() bool { 11814 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11815} 11816 11817// Response returns the raw server response from the last page request. 11818func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Response() LoadBalancerFrontendIPConfigurationListResult { 11819 return iter.page.Response() 11820} 11821 11822// Value returns the current value or a zero-initialized value if the 11823// iterator has advanced beyond the end of the collection. 11824func (iter LoadBalancerFrontendIPConfigurationListResultIterator) Value() FrontendIPConfiguration { 11825 if !iter.page.NotDone() { 11826 return FrontendIPConfiguration{} 11827 } 11828 return iter.page.Values()[iter.i] 11829} 11830 11831// Creates a new instance of the LoadBalancerFrontendIPConfigurationListResultIterator type. 11832func NewLoadBalancerFrontendIPConfigurationListResultIterator(page LoadBalancerFrontendIPConfigurationListResultPage) LoadBalancerFrontendIPConfigurationListResultIterator { 11833 return LoadBalancerFrontendIPConfigurationListResultIterator{page: page} 11834} 11835 11836// IsEmpty returns true if the ListResult contains no values. 11837func (lbficlr LoadBalancerFrontendIPConfigurationListResult) IsEmpty() bool { 11838 return lbficlr.Value == nil || len(*lbficlr.Value) == 0 11839} 11840 11841// hasNextLink returns true if the NextLink is not empty. 11842func (lbficlr LoadBalancerFrontendIPConfigurationListResult) hasNextLink() bool { 11843 return lbficlr.NextLink != nil && len(*lbficlr.NextLink) != 0 11844} 11845 11846// loadBalancerFrontendIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. 11847// It returns nil if no more results exist. 11848func (lbficlr LoadBalancerFrontendIPConfigurationListResult) loadBalancerFrontendIPConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { 11849 if !lbficlr.hasNextLink() { 11850 return nil, nil 11851 } 11852 return autorest.Prepare((&http.Request{}).WithContext(ctx), 11853 autorest.AsJSON(), 11854 autorest.AsGet(), 11855 autorest.WithBaseURL(to.String(lbficlr.NextLink))) 11856} 11857 11858// LoadBalancerFrontendIPConfigurationListResultPage contains a page of FrontendIPConfiguration values. 11859type LoadBalancerFrontendIPConfigurationListResultPage struct { 11860 fn func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error) 11861 lbficlr LoadBalancerFrontendIPConfigurationListResult 11862} 11863 11864// NextWithContext advances to the next page of values. If there was an error making 11865// the request the page does not advance and the error is returned. 11866func (page *LoadBalancerFrontendIPConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { 11867 if tracing.IsEnabled() { 11868 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerFrontendIPConfigurationListResultPage.NextWithContext") 11869 defer func() { 11870 sc := -1 11871 if page.Response().Response.Response != nil { 11872 sc = page.Response().Response.Response.StatusCode 11873 } 11874 tracing.EndSpan(ctx, sc, err) 11875 }() 11876 } 11877 for { 11878 next, err := page.fn(ctx, page.lbficlr) 11879 if err != nil { 11880 return err 11881 } 11882 page.lbficlr = next 11883 if !next.hasNextLink() || !next.IsEmpty() { 11884 break 11885 } 11886 } 11887 return nil 11888} 11889 11890// Next advances to the next page of values. If there was an error making 11891// the request the page does not advance and the error is returned. 11892// Deprecated: Use NextWithContext() instead. 11893func (page *LoadBalancerFrontendIPConfigurationListResultPage) Next() error { 11894 return page.NextWithContext(context.Background()) 11895} 11896 11897// NotDone returns true if the page enumeration should be started or is not yet complete. 11898func (page LoadBalancerFrontendIPConfigurationListResultPage) NotDone() bool { 11899 return !page.lbficlr.IsEmpty() 11900} 11901 11902// Response returns the raw server response from the last page request. 11903func (page LoadBalancerFrontendIPConfigurationListResultPage) Response() LoadBalancerFrontendIPConfigurationListResult { 11904 return page.lbficlr 11905} 11906 11907// Values returns the slice of values for the current page or nil if there are no values. 11908func (page LoadBalancerFrontendIPConfigurationListResultPage) Values() []FrontendIPConfiguration { 11909 if page.lbficlr.IsEmpty() { 11910 return nil 11911 } 11912 return *page.lbficlr.Value 11913} 11914 11915// Creates a new instance of the LoadBalancerFrontendIPConfigurationListResultPage type. 11916func NewLoadBalancerFrontendIPConfigurationListResultPage(cur LoadBalancerFrontendIPConfigurationListResult, getNextPage func(context.Context, LoadBalancerFrontendIPConfigurationListResult) (LoadBalancerFrontendIPConfigurationListResult, error)) LoadBalancerFrontendIPConfigurationListResultPage { 11917 return LoadBalancerFrontendIPConfigurationListResultPage{ 11918 fn: getNextPage, 11919 lbficlr: cur, 11920 } 11921} 11922 11923// LoadBalancerListResult response for ListLoadBalancers API service call. 11924type LoadBalancerListResult struct { 11925 autorest.Response `json:"-"` 11926 // Value - A list of load balancers in a resource group. 11927 Value *[]LoadBalancer `json:"value,omitempty"` 11928 // NextLink - READ-ONLY; The URL to get the next set of results. 11929 NextLink *string `json:"nextLink,omitempty"` 11930} 11931 11932// MarshalJSON is the custom marshaler for LoadBalancerListResult. 11933func (lblr LoadBalancerListResult) MarshalJSON() ([]byte, error) { 11934 objectMap := make(map[string]interface{}) 11935 if lblr.Value != nil { 11936 objectMap["value"] = lblr.Value 11937 } 11938 return json.Marshal(objectMap) 11939} 11940 11941// LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. 11942type LoadBalancerListResultIterator struct { 11943 i int 11944 page LoadBalancerListResultPage 11945} 11946 11947// NextWithContext advances to the next value. If there was an error making 11948// the request the iterator does not advance and the error is returned. 11949func (iter *LoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { 11950 if tracing.IsEnabled() { 11951 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultIterator.NextWithContext") 11952 defer func() { 11953 sc := -1 11954 if iter.Response().Response.Response != nil { 11955 sc = iter.Response().Response.Response.StatusCode 11956 } 11957 tracing.EndSpan(ctx, sc, err) 11958 }() 11959 } 11960 iter.i++ 11961 if iter.i < len(iter.page.Values()) { 11962 return nil 11963 } 11964 err = iter.page.NextWithContext(ctx) 11965 if err != nil { 11966 iter.i-- 11967 return err 11968 } 11969 iter.i = 0 11970 return nil 11971} 11972 11973// Next advances to the next value. If there was an error making 11974// the request the iterator does not advance and the error is returned. 11975// Deprecated: Use NextWithContext() instead. 11976func (iter *LoadBalancerListResultIterator) Next() error { 11977 return iter.NextWithContext(context.Background()) 11978} 11979 11980// NotDone returns true if the enumeration should be started or is not yet complete. 11981func (iter LoadBalancerListResultIterator) NotDone() bool { 11982 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11983} 11984 11985// Response returns the raw server response from the last page request. 11986func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult { 11987 return iter.page.Response() 11988} 11989 11990// Value returns the current value or a zero-initialized value if the 11991// iterator has advanced beyond the end of the collection. 11992func (iter LoadBalancerListResultIterator) Value() LoadBalancer { 11993 if !iter.page.NotDone() { 11994 return LoadBalancer{} 11995 } 11996 return iter.page.Values()[iter.i] 11997} 11998 11999// Creates a new instance of the LoadBalancerListResultIterator type. 12000func NewLoadBalancerListResultIterator(page LoadBalancerListResultPage) LoadBalancerListResultIterator { 12001 return LoadBalancerListResultIterator{page: page} 12002} 12003 12004// IsEmpty returns true if the ListResult contains no values. 12005func (lblr LoadBalancerListResult) IsEmpty() bool { 12006 return lblr.Value == nil || len(*lblr.Value) == 0 12007} 12008 12009// hasNextLink returns true if the NextLink is not empty. 12010func (lblr LoadBalancerListResult) hasNextLink() bool { 12011 return lblr.NextLink != nil && len(*lblr.NextLink) != 0 12012} 12013 12014// loadBalancerListResultPreparer prepares a request to retrieve the next set of results. 12015// It returns nil if no more results exist. 12016func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { 12017 if !lblr.hasNextLink() { 12018 return nil, nil 12019 } 12020 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12021 autorest.AsJSON(), 12022 autorest.AsGet(), 12023 autorest.WithBaseURL(to.String(lblr.NextLink))) 12024} 12025 12026// LoadBalancerListResultPage contains a page of LoadBalancer values. 12027type LoadBalancerListResultPage struct { 12028 fn func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error) 12029 lblr LoadBalancerListResult 12030} 12031 12032// NextWithContext advances to the next page of values. If there was an error making 12033// the request the page does not advance and the error is returned. 12034func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { 12035 if tracing.IsEnabled() { 12036 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultPage.NextWithContext") 12037 defer func() { 12038 sc := -1 12039 if page.Response().Response.Response != nil { 12040 sc = page.Response().Response.Response.StatusCode 12041 } 12042 tracing.EndSpan(ctx, sc, err) 12043 }() 12044 } 12045 for { 12046 next, err := page.fn(ctx, page.lblr) 12047 if err != nil { 12048 return err 12049 } 12050 page.lblr = next 12051 if !next.hasNextLink() || !next.IsEmpty() { 12052 break 12053 } 12054 } 12055 return nil 12056} 12057 12058// Next advances to the next page of values. If there was an error making 12059// the request the page does not advance and the error is returned. 12060// Deprecated: Use NextWithContext() instead. 12061func (page *LoadBalancerListResultPage) Next() error { 12062 return page.NextWithContext(context.Background()) 12063} 12064 12065// NotDone returns true if the page enumeration should be started or is not yet complete. 12066func (page LoadBalancerListResultPage) NotDone() bool { 12067 return !page.lblr.IsEmpty() 12068} 12069 12070// Response returns the raw server response from the last page request. 12071func (page LoadBalancerListResultPage) Response() LoadBalancerListResult { 12072 return page.lblr 12073} 12074 12075// Values returns the slice of values for the current page or nil if there are no values. 12076func (page LoadBalancerListResultPage) Values() []LoadBalancer { 12077 if page.lblr.IsEmpty() { 12078 return nil 12079 } 12080 return *page.lblr.Value 12081} 12082 12083// Creates a new instance of the LoadBalancerListResultPage type. 12084func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage { 12085 return LoadBalancerListResultPage{ 12086 fn: getNextPage, 12087 lblr: cur, 12088 } 12089} 12090 12091// LoadBalancerLoadBalancingRuleListResult response for ListLoadBalancingRule API service call. 12092type LoadBalancerLoadBalancingRuleListResult struct { 12093 autorest.Response `json:"-"` 12094 // Value - A list of load balancing rules in a load balancer. 12095 Value *[]LoadBalancingRule `json:"value,omitempty"` 12096 // NextLink - READ-ONLY; The URL to get the next set of results. 12097 NextLink *string `json:"nextLink,omitempty"` 12098} 12099 12100// MarshalJSON is the custom marshaler for LoadBalancerLoadBalancingRuleListResult. 12101func (lblbrlr LoadBalancerLoadBalancingRuleListResult) MarshalJSON() ([]byte, error) { 12102 objectMap := make(map[string]interface{}) 12103 if lblbrlr.Value != nil { 12104 objectMap["value"] = lblbrlr.Value 12105 } 12106 return json.Marshal(objectMap) 12107} 12108 12109// LoadBalancerLoadBalancingRuleListResultIterator provides access to a complete listing of 12110// LoadBalancingRule values. 12111type LoadBalancerLoadBalancingRuleListResultIterator struct { 12112 i int 12113 page LoadBalancerLoadBalancingRuleListResultPage 12114} 12115 12116// NextWithContext advances to the next value. If there was an error making 12117// the request the iterator does not advance and the error is returned. 12118func (iter *LoadBalancerLoadBalancingRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 12119 if tracing.IsEnabled() { 12120 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultIterator.NextWithContext") 12121 defer func() { 12122 sc := -1 12123 if iter.Response().Response.Response != nil { 12124 sc = iter.Response().Response.Response.StatusCode 12125 } 12126 tracing.EndSpan(ctx, sc, err) 12127 }() 12128 } 12129 iter.i++ 12130 if iter.i < len(iter.page.Values()) { 12131 return nil 12132 } 12133 err = iter.page.NextWithContext(ctx) 12134 if err != nil { 12135 iter.i-- 12136 return err 12137 } 12138 iter.i = 0 12139 return nil 12140} 12141 12142// Next advances to the next value. If there was an error making 12143// the request the iterator does not advance and the error is returned. 12144// Deprecated: Use NextWithContext() instead. 12145func (iter *LoadBalancerLoadBalancingRuleListResultIterator) Next() error { 12146 return iter.NextWithContext(context.Background()) 12147} 12148 12149// NotDone returns true if the enumeration should be started or is not yet complete. 12150func (iter LoadBalancerLoadBalancingRuleListResultIterator) NotDone() bool { 12151 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12152} 12153 12154// Response returns the raw server response from the last page request. 12155func (iter LoadBalancerLoadBalancingRuleListResultIterator) Response() LoadBalancerLoadBalancingRuleListResult { 12156 return iter.page.Response() 12157} 12158 12159// Value returns the current value or a zero-initialized value if the 12160// iterator has advanced beyond the end of the collection. 12161func (iter LoadBalancerLoadBalancingRuleListResultIterator) Value() LoadBalancingRule { 12162 if !iter.page.NotDone() { 12163 return LoadBalancingRule{} 12164 } 12165 return iter.page.Values()[iter.i] 12166} 12167 12168// Creates a new instance of the LoadBalancerLoadBalancingRuleListResultIterator type. 12169func NewLoadBalancerLoadBalancingRuleListResultIterator(page LoadBalancerLoadBalancingRuleListResultPage) LoadBalancerLoadBalancingRuleListResultIterator { 12170 return LoadBalancerLoadBalancingRuleListResultIterator{page: page} 12171} 12172 12173// IsEmpty returns true if the ListResult contains no values. 12174func (lblbrlr LoadBalancerLoadBalancingRuleListResult) IsEmpty() bool { 12175 return lblbrlr.Value == nil || len(*lblbrlr.Value) == 0 12176} 12177 12178// hasNextLink returns true if the NextLink is not empty. 12179func (lblbrlr LoadBalancerLoadBalancingRuleListResult) hasNextLink() bool { 12180 return lblbrlr.NextLink != nil && len(*lblbrlr.NextLink) != 0 12181} 12182 12183// loadBalancerLoadBalancingRuleListResultPreparer prepares a request to retrieve the next set of results. 12184// It returns nil if no more results exist. 12185func (lblbrlr LoadBalancerLoadBalancingRuleListResult) loadBalancerLoadBalancingRuleListResultPreparer(ctx context.Context) (*http.Request, error) { 12186 if !lblbrlr.hasNextLink() { 12187 return nil, nil 12188 } 12189 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12190 autorest.AsJSON(), 12191 autorest.AsGet(), 12192 autorest.WithBaseURL(to.String(lblbrlr.NextLink))) 12193} 12194 12195// LoadBalancerLoadBalancingRuleListResultPage contains a page of LoadBalancingRule values. 12196type LoadBalancerLoadBalancingRuleListResultPage struct { 12197 fn func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error) 12198 lblbrlr LoadBalancerLoadBalancingRuleListResult 12199} 12200 12201// NextWithContext advances to the next page of values. If there was an error making 12202// the request the page does not advance and the error is returned. 12203func (page *LoadBalancerLoadBalancingRuleListResultPage) NextWithContext(ctx context.Context) (err error) { 12204 if tracing.IsEnabled() { 12205 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerLoadBalancingRuleListResultPage.NextWithContext") 12206 defer func() { 12207 sc := -1 12208 if page.Response().Response.Response != nil { 12209 sc = page.Response().Response.Response.StatusCode 12210 } 12211 tracing.EndSpan(ctx, sc, err) 12212 }() 12213 } 12214 for { 12215 next, err := page.fn(ctx, page.lblbrlr) 12216 if err != nil { 12217 return err 12218 } 12219 page.lblbrlr = next 12220 if !next.hasNextLink() || !next.IsEmpty() { 12221 break 12222 } 12223 } 12224 return nil 12225} 12226 12227// Next advances to the next page of values. If there was an error making 12228// the request the page does not advance and the error is returned. 12229// Deprecated: Use NextWithContext() instead. 12230func (page *LoadBalancerLoadBalancingRuleListResultPage) Next() error { 12231 return page.NextWithContext(context.Background()) 12232} 12233 12234// NotDone returns true if the page enumeration should be started or is not yet complete. 12235func (page LoadBalancerLoadBalancingRuleListResultPage) NotDone() bool { 12236 return !page.lblbrlr.IsEmpty() 12237} 12238 12239// Response returns the raw server response from the last page request. 12240func (page LoadBalancerLoadBalancingRuleListResultPage) Response() LoadBalancerLoadBalancingRuleListResult { 12241 return page.lblbrlr 12242} 12243 12244// Values returns the slice of values for the current page or nil if there are no values. 12245func (page LoadBalancerLoadBalancingRuleListResultPage) Values() []LoadBalancingRule { 12246 if page.lblbrlr.IsEmpty() { 12247 return nil 12248 } 12249 return *page.lblbrlr.Value 12250} 12251 12252// Creates a new instance of the LoadBalancerLoadBalancingRuleListResultPage type. 12253func NewLoadBalancerLoadBalancingRuleListResultPage(cur LoadBalancerLoadBalancingRuleListResult, getNextPage func(context.Context, LoadBalancerLoadBalancingRuleListResult) (LoadBalancerLoadBalancingRuleListResult, error)) LoadBalancerLoadBalancingRuleListResultPage { 12254 return LoadBalancerLoadBalancingRuleListResultPage{ 12255 fn: getNextPage, 12256 lblbrlr: cur, 12257 } 12258} 12259 12260// LoadBalancerProbeListResult response for ListProbe API service call. 12261type LoadBalancerProbeListResult struct { 12262 autorest.Response `json:"-"` 12263 // Value - A list of probes in a load balancer. 12264 Value *[]Probe `json:"value,omitempty"` 12265 // NextLink - READ-ONLY; The URL to get the next set of results. 12266 NextLink *string `json:"nextLink,omitempty"` 12267} 12268 12269// MarshalJSON is the custom marshaler for LoadBalancerProbeListResult. 12270func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { 12271 objectMap := make(map[string]interface{}) 12272 if lbplr.Value != nil { 12273 objectMap["value"] = lbplr.Value 12274 } 12275 return json.Marshal(objectMap) 12276} 12277 12278// LoadBalancerProbeListResultIterator provides access to a complete listing of Probe values. 12279type LoadBalancerProbeListResultIterator struct { 12280 i int 12281 page LoadBalancerProbeListResultPage 12282} 12283 12284// NextWithContext advances to the next value. If there was an error making 12285// the request the iterator does not advance and the error is returned. 12286func (iter *LoadBalancerProbeListResultIterator) NextWithContext(ctx context.Context) (err error) { 12287 if tracing.IsEnabled() { 12288 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultIterator.NextWithContext") 12289 defer func() { 12290 sc := -1 12291 if iter.Response().Response.Response != nil { 12292 sc = iter.Response().Response.Response.StatusCode 12293 } 12294 tracing.EndSpan(ctx, sc, err) 12295 }() 12296 } 12297 iter.i++ 12298 if iter.i < len(iter.page.Values()) { 12299 return nil 12300 } 12301 err = iter.page.NextWithContext(ctx) 12302 if err != nil { 12303 iter.i-- 12304 return err 12305 } 12306 iter.i = 0 12307 return nil 12308} 12309 12310// Next advances to the next value. If there was an error making 12311// the request the iterator does not advance and the error is returned. 12312// Deprecated: Use NextWithContext() instead. 12313func (iter *LoadBalancerProbeListResultIterator) Next() error { 12314 return iter.NextWithContext(context.Background()) 12315} 12316 12317// NotDone returns true if the enumeration should be started or is not yet complete. 12318func (iter LoadBalancerProbeListResultIterator) NotDone() bool { 12319 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12320} 12321 12322// Response returns the raw server response from the last page request. 12323func (iter LoadBalancerProbeListResultIterator) Response() LoadBalancerProbeListResult { 12324 return iter.page.Response() 12325} 12326 12327// Value returns the current value or a zero-initialized value if the 12328// iterator has advanced beyond the end of the collection. 12329func (iter LoadBalancerProbeListResultIterator) Value() Probe { 12330 if !iter.page.NotDone() { 12331 return Probe{} 12332 } 12333 return iter.page.Values()[iter.i] 12334} 12335 12336// Creates a new instance of the LoadBalancerProbeListResultIterator type. 12337func NewLoadBalancerProbeListResultIterator(page LoadBalancerProbeListResultPage) LoadBalancerProbeListResultIterator { 12338 return LoadBalancerProbeListResultIterator{page: page} 12339} 12340 12341// IsEmpty returns true if the ListResult contains no values. 12342func (lbplr LoadBalancerProbeListResult) IsEmpty() bool { 12343 return lbplr.Value == nil || len(*lbplr.Value) == 0 12344} 12345 12346// hasNextLink returns true if the NextLink is not empty. 12347func (lbplr LoadBalancerProbeListResult) hasNextLink() bool { 12348 return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0 12349} 12350 12351// loadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. 12352// It returns nil if no more results exist. 12353func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) { 12354 if !lbplr.hasNextLink() { 12355 return nil, nil 12356 } 12357 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12358 autorest.AsJSON(), 12359 autorest.AsGet(), 12360 autorest.WithBaseURL(to.String(lbplr.NextLink))) 12361} 12362 12363// LoadBalancerProbeListResultPage contains a page of Probe values. 12364type LoadBalancerProbeListResultPage struct { 12365 fn func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error) 12366 lbplr LoadBalancerProbeListResult 12367} 12368 12369// NextWithContext advances to the next page of values. If there was an error making 12370// the request the page does not advance and the error is returned. 12371func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context) (err error) { 12372 if tracing.IsEnabled() { 12373 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultPage.NextWithContext") 12374 defer func() { 12375 sc := -1 12376 if page.Response().Response.Response != nil { 12377 sc = page.Response().Response.Response.StatusCode 12378 } 12379 tracing.EndSpan(ctx, sc, err) 12380 }() 12381 } 12382 for { 12383 next, err := page.fn(ctx, page.lbplr) 12384 if err != nil { 12385 return err 12386 } 12387 page.lbplr = next 12388 if !next.hasNextLink() || !next.IsEmpty() { 12389 break 12390 } 12391 } 12392 return nil 12393} 12394 12395// Next advances to the next page of values. If there was an error making 12396// the request the page does not advance and the error is returned. 12397// Deprecated: Use NextWithContext() instead. 12398func (page *LoadBalancerProbeListResultPage) Next() error { 12399 return page.NextWithContext(context.Background()) 12400} 12401 12402// NotDone returns true if the page enumeration should be started or is not yet complete. 12403func (page LoadBalancerProbeListResultPage) NotDone() bool { 12404 return !page.lbplr.IsEmpty() 12405} 12406 12407// Response returns the raw server response from the last page request. 12408func (page LoadBalancerProbeListResultPage) Response() LoadBalancerProbeListResult { 12409 return page.lbplr 12410} 12411 12412// Values returns the slice of values for the current page or nil if there are no values. 12413func (page LoadBalancerProbeListResultPage) Values() []Probe { 12414 if page.lbplr.IsEmpty() { 12415 return nil 12416 } 12417 return *page.lbplr.Value 12418} 12419 12420// Creates a new instance of the LoadBalancerProbeListResultPage type. 12421func NewLoadBalancerProbeListResultPage(cur LoadBalancerProbeListResult, getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage { 12422 return LoadBalancerProbeListResultPage{ 12423 fn: getNextPage, 12424 lbplr: cur, 12425 } 12426} 12427 12428// LoadBalancerPropertiesFormat properties of the load balancer. 12429type LoadBalancerPropertiesFormat struct { 12430 // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer 12431 FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 12432 // BackendAddressPools - Collection of backend address pools used by a load balancer 12433 BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` 12434 // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning 12435 LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` 12436 // Probes - Collection of probe objects used in the load balancer 12437 Probes *[]Probe `json:"probes,omitempty"` 12438 // InboundNatRules - Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. 12439 InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` 12440 // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound Nat rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. 12441 InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` 12442 // OutboundNatRules - The outbound NAT rules. 12443 OutboundNatRules *[]OutboundNatRule `json:"outboundNatRules,omitempty"` 12444 // ResourceGUID - The resource GUID property of the load balancer resource. 12445 ResourceGUID *string `json:"resourceGuid,omitempty"` 12446 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 12447 ProvisioningState *string `json:"provisioningState,omitempty"` 12448} 12449 12450// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 12451// long-running operation. 12452type LoadBalancersCreateOrUpdateFuture struct { 12453 azure.FutureAPI 12454 // Result returns the result of the asynchronous operation. 12455 // If the operation has not completed it will return an error. 12456 Result func(LoadBalancersClient) (LoadBalancer, error) 12457} 12458 12459// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12460func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 12461 var azFuture azure.Future 12462 if err := json.Unmarshal(body, &azFuture); err != nil { 12463 return err 12464 } 12465 future.FutureAPI = &azFuture 12466 future.Result = future.result 12467 return nil 12468} 12469 12470// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. 12471func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { 12472 var done bool 12473 done, err = future.DoneWithContext(context.Background(), client) 12474 if err != nil { 12475 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12476 return 12477 } 12478 if !done { 12479 lb.Response.Response = future.Response() 12480 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") 12481 return 12482 } 12483 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12484 if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { 12485 lb, err = client.CreateOrUpdateResponder(lb.Response.Response) 12486 if err != nil { 12487 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request") 12488 } 12489 } 12490 return 12491} 12492 12493// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12494// operation. 12495type LoadBalancersDeleteFuture struct { 12496 azure.FutureAPI 12497 // Result returns the result of the asynchronous operation. 12498 // If the operation has not completed it will return an error. 12499 Result func(LoadBalancersClient) (autorest.Response, error) 12500} 12501 12502// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12503func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { 12504 var azFuture azure.Future 12505 if err := json.Unmarshal(body, &azFuture); err != nil { 12506 return err 12507 } 12508 future.FutureAPI = &azFuture 12509 future.Result = future.result 12510 return nil 12511} 12512 12513// result is the default implementation for LoadBalancersDeleteFuture.Result. 12514func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { 12515 var done bool 12516 done, err = future.DoneWithContext(context.Background(), client) 12517 if err != nil { 12518 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") 12519 return 12520 } 12521 if !done { 12522 ar.Response = future.Response() 12523 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") 12524 return 12525 } 12526 ar.Response = future.Response() 12527 return 12528} 12529 12530// LoadBalancerSku SKU of a load balancer 12531type LoadBalancerSku struct { 12532 // Name - Name of a load balancer SKU. Possible values include: 'LoadBalancerSkuNameBasic', 'LoadBalancerSkuNameStandard' 12533 Name LoadBalancerSkuName `json:"name,omitempty"` 12534} 12535 12536// LoadBalancersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running 12537// operation. 12538type LoadBalancersUpdateTagsFuture struct { 12539 azure.FutureAPI 12540 // Result returns the result of the asynchronous operation. 12541 // If the operation has not completed it will return an error. 12542 Result func(LoadBalancersClient) (LoadBalancer, error) 12543} 12544 12545// UnmarshalJSON is the custom unmarshaller for CreateFuture. 12546func (future *LoadBalancersUpdateTagsFuture) UnmarshalJSON(body []byte) error { 12547 var azFuture azure.Future 12548 if err := json.Unmarshal(body, &azFuture); err != nil { 12549 return err 12550 } 12551 future.FutureAPI = &azFuture 12552 future.Result = future.result 12553 return nil 12554} 12555 12556// result is the default implementation for LoadBalancersUpdateTagsFuture.Result. 12557func (future *LoadBalancersUpdateTagsFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { 12558 var done bool 12559 done, err = future.DoneWithContext(context.Background(), client) 12560 if err != nil { 12561 err = autorest.NewErrorWithError(err, "network.LoadBalancersUpdateTagsFuture", "Result", future.Response(), "Polling failure") 12562 return 12563 } 12564 if !done { 12565 lb.Response.Response = future.Response() 12566 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersUpdateTagsFuture") 12567 return 12568 } 12569 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12570 if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { 12571 lb, err = client.UpdateTagsResponder(lb.Response.Response) 12572 if err != nil { 12573 err = autorest.NewErrorWithError(err, "network.LoadBalancersUpdateTagsFuture", "Result", lb.Response.Response, "Failure responding to request") 12574 } 12575 } 12576 return 12577} 12578 12579// LoadBalancingRule a load balancing rule for a load balancer. 12580type LoadBalancingRule struct { 12581 autorest.Response `json:"-"` 12582 // LoadBalancingRulePropertiesFormat - Properties of load balancer load balancing rule. 12583 *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` 12584 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 12585 Name *string `json:"name,omitempty"` 12586 // Etag - A unique read-only string that changes whenever the resource is updated. 12587 Etag *string `json:"etag,omitempty"` 12588 // ID - Resource ID. 12589 ID *string `json:"id,omitempty"` 12590} 12591 12592// MarshalJSON is the custom marshaler for LoadBalancingRule. 12593func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { 12594 objectMap := make(map[string]interface{}) 12595 if lbr.LoadBalancingRulePropertiesFormat != nil { 12596 objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat 12597 } 12598 if lbr.Name != nil { 12599 objectMap["name"] = lbr.Name 12600 } 12601 if lbr.Etag != nil { 12602 objectMap["etag"] = lbr.Etag 12603 } 12604 if lbr.ID != nil { 12605 objectMap["id"] = lbr.ID 12606 } 12607 return json.Marshal(objectMap) 12608} 12609 12610// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. 12611func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { 12612 var m map[string]*json.RawMessage 12613 err := json.Unmarshal(body, &m) 12614 if err != nil { 12615 return err 12616 } 12617 for k, v := range m { 12618 switch k { 12619 case "properties": 12620 if v != nil { 12621 var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat 12622 err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) 12623 if err != nil { 12624 return err 12625 } 12626 lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat 12627 } 12628 case "name": 12629 if v != nil { 12630 var name string 12631 err = json.Unmarshal(*v, &name) 12632 if err != nil { 12633 return err 12634 } 12635 lbr.Name = &name 12636 } 12637 case "etag": 12638 if v != nil { 12639 var etag string 12640 err = json.Unmarshal(*v, &etag) 12641 if err != nil { 12642 return err 12643 } 12644 lbr.Etag = &etag 12645 } 12646 case "id": 12647 if v != nil { 12648 var ID string 12649 err = json.Unmarshal(*v, &ID) 12650 if err != nil { 12651 return err 12652 } 12653 lbr.ID = &ID 12654 } 12655 } 12656 } 12657 12658 return nil 12659} 12660 12661// LoadBalancingRulePropertiesFormat properties of the load balancer. 12662type LoadBalancingRulePropertiesFormat struct { 12663 // FrontendIPConfiguration - A reference to frontend IP addresses. 12664 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 12665 // BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. 12666 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 12667 // Probe - The reference of the load balancer probe used by the load balancing rule. 12668 Probe *SubResource `json:"probe,omitempty"` 12669 // Protocol - Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' 12670 Protocol TransportProtocol `json:"protocol,omitempty"` 12671 // LoadDistribution - The load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' 12672 LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` 12673 // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port" 12674 FrontendPort *int32 `json:"frontendPort,omitempty"` 12675 // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port" 12676 BackendPort *int32 `json:"backendPort,omitempty"` 12677 // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. 12678 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 12679 // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. 12680 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 12681 // DisableOutboundSnat - Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. 12682 DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` 12683 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 12684 ProvisioningState *string `json:"provisioningState,omitempty"` 12685} 12686 12687// LocalNetworkGateway a common class for general resource information 12688type LocalNetworkGateway struct { 12689 autorest.Response `json:"-"` 12690 // LocalNetworkGatewayPropertiesFormat - Properties of the local network gateway. 12691 *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 12692 // Etag - A unique read-only string that changes whenever the resource is updated. 12693 Etag *string `json:"etag,omitempty"` 12694 // ID - Resource ID. 12695 ID *string `json:"id,omitempty"` 12696 // Name - READ-ONLY; Resource name. 12697 Name *string `json:"name,omitempty"` 12698 // Type - READ-ONLY; Resource type. 12699 Type *string `json:"type,omitempty"` 12700 // Location - Resource location. 12701 Location *string `json:"location,omitempty"` 12702 // Tags - Resource tags. 12703 Tags map[string]*string `json:"tags"` 12704} 12705 12706// MarshalJSON is the custom marshaler for LocalNetworkGateway. 12707func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { 12708 objectMap := make(map[string]interface{}) 12709 if lng.LocalNetworkGatewayPropertiesFormat != nil { 12710 objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat 12711 } 12712 if lng.Etag != nil { 12713 objectMap["etag"] = lng.Etag 12714 } 12715 if lng.ID != nil { 12716 objectMap["id"] = lng.ID 12717 } 12718 if lng.Location != nil { 12719 objectMap["location"] = lng.Location 12720 } 12721 if lng.Tags != nil { 12722 objectMap["tags"] = lng.Tags 12723 } 12724 return json.Marshal(objectMap) 12725} 12726 12727// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. 12728func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { 12729 var m map[string]*json.RawMessage 12730 err := json.Unmarshal(body, &m) 12731 if err != nil { 12732 return err 12733 } 12734 for k, v := range m { 12735 switch k { 12736 case "properties": 12737 if v != nil { 12738 var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat 12739 err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) 12740 if err != nil { 12741 return err 12742 } 12743 lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat 12744 } 12745 case "etag": 12746 if v != nil { 12747 var etag string 12748 err = json.Unmarshal(*v, &etag) 12749 if err != nil { 12750 return err 12751 } 12752 lng.Etag = &etag 12753 } 12754 case "id": 12755 if v != nil { 12756 var ID string 12757 err = json.Unmarshal(*v, &ID) 12758 if err != nil { 12759 return err 12760 } 12761 lng.ID = &ID 12762 } 12763 case "name": 12764 if v != nil { 12765 var name string 12766 err = json.Unmarshal(*v, &name) 12767 if err != nil { 12768 return err 12769 } 12770 lng.Name = &name 12771 } 12772 case "type": 12773 if v != nil { 12774 var typeVar string 12775 err = json.Unmarshal(*v, &typeVar) 12776 if err != nil { 12777 return err 12778 } 12779 lng.Type = &typeVar 12780 } 12781 case "location": 12782 if v != nil { 12783 var location string 12784 err = json.Unmarshal(*v, &location) 12785 if err != nil { 12786 return err 12787 } 12788 lng.Location = &location 12789 } 12790 case "tags": 12791 if v != nil { 12792 var tags map[string]*string 12793 err = json.Unmarshal(*v, &tags) 12794 if err != nil { 12795 return err 12796 } 12797 lng.Tags = tags 12798 } 12799 } 12800 } 12801 12802 return nil 12803} 12804 12805// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call. 12806type LocalNetworkGatewayListResult struct { 12807 autorest.Response `json:"-"` 12808 // Value - A list of local network gateways that exists in a resource group. 12809 Value *[]LocalNetworkGateway `json:"value,omitempty"` 12810 // NextLink - READ-ONLY; The URL to get the next set of results. 12811 NextLink *string `json:"nextLink,omitempty"` 12812} 12813 12814// MarshalJSON is the custom marshaler for LocalNetworkGatewayListResult. 12815func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { 12816 objectMap := make(map[string]interface{}) 12817 if lnglr.Value != nil { 12818 objectMap["value"] = lnglr.Value 12819 } 12820 return json.Marshal(objectMap) 12821} 12822 12823// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway 12824// values. 12825type LocalNetworkGatewayListResultIterator struct { 12826 i int 12827 page LocalNetworkGatewayListResultPage 12828} 12829 12830// NextWithContext advances to the next value. If there was an error making 12831// the request the iterator does not advance and the error is returned. 12832func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 12833 if tracing.IsEnabled() { 12834 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext") 12835 defer func() { 12836 sc := -1 12837 if iter.Response().Response.Response != nil { 12838 sc = iter.Response().Response.Response.StatusCode 12839 } 12840 tracing.EndSpan(ctx, sc, err) 12841 }() 12842 } 12843 iter.i++ 12844 if iter.i < len(iter.page.Values()) { 12845 return nil 12846 } 12847 err = iter.page.NextWithContext(ctx) 12848 if err != nil { 12849 iter.i-- 12850 return err 12851 } 12852 iter.i = 0 12853 return nil 12854} 12855 12856// Next advances to the next value. If there was an error making 12857// the request the iterator does not advance and the error is returned. 12858// Deprecated: Use NextWithContext() instead. 12859func (iter *LocalNetworkGatewayListResultIterator) Next() error { 12860 return iter.NextWithContext(context.Background()) 12861} 12862 12863// NotDone returns true if the enumeration should be started or is not yet complete. 12864func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { 12865 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12866} 12867 12868// Response returns the raw server response from the last page request. 12869func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { 12870 return iter.page.Response() 12871} 12872 12873// Value returns the current value or a zero-initialized value if the 12874// iterator has advanced beyond the end of the collection. 12875func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { 12876 if !iter.page.NotDone() { 12877 return LocalNetworkGateway{} 12878 } 12879 return iter.page.Values()[iter.i] 12880} 12881 12882// Creates a new instance of the LocalNetworkGatewayListResultIterator type. 12883func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator { 12884 return LocalNetworkGatewayListResultIterator{page: page} 12885} 12886 12887// IsEmpty returns true if the ListResult contains no values. 12888func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { 12889 return lnglr.Value == nil || len(*lnglr.Value) == 0 12890} 12891 12892// hasNextLink returns true if the NextLink is not empty. 12893func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { 12894 return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 12895} 12896 12897// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 12898// It returns nil if no more results exist. 12899func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 12900 if !lnglr.hasNextLink() { 12901 return nil, nil 12902 } 12903 return autorest.Prepare((&http.Request{}).WithContext(ctx), 12904 autorest.AsJSON(), 12905 autorest.AsGet(), 12906 autorest.WithBaseURL(to.String(lnglr.NextLink))) 12907} 12908 12909// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. 12910type LocalNetworkGatewayListResultPage struct { 12911 fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) 12912 lnglr LocalNetworkGatewayListResult 12913} 12914 12915// NextWithContext advances to the next page of values. If there was an error making 12916// the request the page does not advance and the error is returned. 12917func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 12918 if tracing.IsEnabled() { 12919 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext") 12920 defer func() { 12921 sc := -1 12922 if page.Response().Response.Response != nil { 12923 sc = page.Response().Response.Response.StatusCode 12924 } 12925 tracing.EndSpan(ctx, sc, err) 12926 }() 12927 } 12928 for { 12929 next, err := page.fn(ctx, page.lnglr) 12930 if err != nil { 12931 return err 12932 } 12933 page.lnglr = next 12934 if !next.hasNextLink() || !next.IsEmpty() { 12935 break 12936 } 12937 } 12938 return nil 12939} 12940 12941// Next advances to the next page of values. If there was an error making 12942// the request the page does not advance and the error is returned. 12943// Deprecated: Use NextWithContext() instead. 12944func (page *LocalNetworkGatewayListResultPage) Next() error { 12945 return page.NextWithContext(context.Background()) 12946} 12947 12948// NotDone returns true if the page enumeration should be started or is not yet complete. 12949func (page LocalNetworkGatewayListResultPage) NotDone() bool { 12950 return !page.lnglr.IsEmpty() 12951} 12952 12953// Response returns the raw server response from the last page request. 12954func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { 12955 return page.lnglr 12956} 12957 12958// Values returns the slice of values for the current page or nil if there are no values. 12959func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { 12960 if page.lnglr.IsEmpty() { 12961 return nil 12962 } 12963 return *page.lnglr.Value 12964} 12965 12966// Creates a new instance of the LocalNetworkGatewayListResultPage type. 12967func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { 12968 return LocalNetworkGatewayListResultPage{ 12969 fn: getNextPage, 12970 lnglr: cur, 12971 } 12972} 12973 12974// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties 12975type LocalNetworkGatewayPropertiesFormat struct { 12976 // LocalNetworkAddressSpace - Local network site address space. 12977 LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` 12978 // GatewayIPAddress - IP address of local network gateway. 12979 GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` 12980 // BgpSettings - Local network gateway's BGP speaker settings. 12981 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 12982 // ResourceGUID - The resource GUID property of the LocalNetworkGateway resource. 12983 ResourceGUID *string `json:"resourceGuid,omitempty"` 12984 // ProvisioningState - READ-ONLY; The provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 12985 ProvisioningState *string `json:"provisioningState,omitempty"` 12986} 12987 12988// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. 12989func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { 12990 objectMap := make(map[string]interface{}) 12991 if lngpf.LocalNetworkAddressSpace != nil { 12992 objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace 12993 } 12994 if lngpf.GatewayIPAddress != nil { 12995 objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress 12996 } 12997 if lngpf.BgpSettings != nil { 12998 objectMap["bgpSettings"] = lngpf.BgpSettings 12999 } 13000 if lngpf.ResourceGUID != nil { 13001 objectMap["resourceGuid"] = lngpf.ResourceGUID 13002 } 13003 return json.Marshal(objectMap) 13004} 13005 13006// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 13007// long-running operation. 13008type LocalNetworkGatewaysCreateOrUpdateFuture struct { 13009 azure.FutureAPI 13010 // Result returns the result of the asynchronous operation. 13011 // If the operation has not completed it will return an error. 13012 Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) 13013} 13014 13015// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13016func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 13017 var azFuture azure.Future 13018 if err := json.Unmarshal(body, &azFuture); err != nil { 13019 return err 13020 } 13021 future.FutureAPI = &azFuture 13022 future.Result = future.result 13023 return nil 13024} 13025 13026// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. 13027func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { 13028 var done bool 13029 done, err = future.DoneWithContext(context.Background(), client) 13030 if err != nil { 13031 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 13032 return 13033 } 13034 if !done { 13035 lng.Response.Response = future.Response() 13036 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") 13037 return 13038 } 13039 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13040 if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { 13041 lng, err = client.CreateOrUpdateResponder(lng.Response.Response) 13042 if err != nil { 13043 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request") 13044 } 13045 } 13046 return 13047} 13048 13049// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 13050// long-running operation. 13051type LocalNetworkGatewaysDeleteFuture struct { 13052 azure.FutureAPI 13053 // Result returns the result of the asynchronous operation. 13054 // If the operation has not completed it will return an error. 13055 Result func(LocalNetworkGatewaysClient) (autorest.Response, error) 13056} 13057 13058// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13059func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 13060 var azFuture azure.Future 13061 if err := json.Unmarshal(body, &azFuture); err != nil { 13062 return err 13063 } 13064 future.FutureAPI = &azFuture 13065 future.Result = future.result 13066 return nil 13067} 13068 13069// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. 13070func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { 13071 var done bool 13072 done, err = future.DoneWithContext(context.Background(), client) 13073 if err != nil { 13074 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 13075 return 13076 } 13077 if !done { 13078 ar.Response = future.Response() 13079 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") 13080 return 13081 } 13082 ar.Response = future.Response() 13083 return 13084} 13085 13086// LocalNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 13087// long-running operation. 13088type LocalNetworkGatewaysUpdateTagsFuture struct { 13089 azure.FutureAPI 13090 // Result returns the result of the asynchronous operation. 13091 // If the operation has not completed it will return an error. 13092 Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) 13093} 13094 13095// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13096func (future *LocalNetworkGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { 13097 var azFuture azure.Future 13098 if err := json.Unmarshal(body, &azFuture); err != nil { 13099 return err 13100 } 13101 future.FutureAPI = &azFuture 13102 future.Result = future.result 13103 return nil 13104} 13105 13106// result is the default implementation for LocalNetworkGatewaysUpdateTagsFuture.Result. 13107func (future *LocalNetworkGatewaysUpdateTagsFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { 13108 var done bool 13109 done, err = future.DoneWithContext(context.Background(), client) 13110 if err != nil { 13111 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") 13112 return 13113 } 13114 if !done { 13115 lng.Response.Response = future.Response() 13116 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysUpdateTagsFuture") 13117 return 13118 } 13119 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13120 if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { 13121 lng, err = client.UpdateTagsResponder(lng.Response.Response) 13122 if err != nil { 13123 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysUpdateTagsFuture", "Result", lng.Response.Response, "Failure responding to request") 13124 } 13125 } 13126 return 13127} 13128 13129// LogSpecification description of logging specification. 13130type LogSpecification struct { 13131 // Name - The name of the specification. 13132 Name *string `json:"name,omitempty"` 13133 // DisplayName - The display name of the specification. 13134 DisplayName *string `json:"displayName,omitempty"` 13135 // BlobDuration - Duration of the blob. 13136 BlobDuration *string `json:"blobDuration,omitempty"` 13137} 13138 13139// MetricSpecification description of metrics specification. 13140type MetricSpecification struct { 13141 // Name - The name of the metric. 13142 Name *string `json:"name,omitempty"` 13143 // DisplayName - The display name of the metric. 13144 DisplayName *string `json:"displayName,omitempty"` 13145 // DisplayDescription - The description of the metric. 13146 DisplayDescription *string `json:"displayDescription,omitempty"` 13147 // Unit - Units the metric to be displayed in. 13148 Unit *string `json:"unit,omitempty"` 13149 // AggregationType - The aggregation type. 13150 AggregationType *string `json:"aggregationType,omitempty"` 13151 // Availabilities - List of availability. 13152 Availabilities *[]Availability `json:"availabilities,omitempty"` 13153 // EnableRegionalMdmAccount - Whether regional MDM account enabled. 13154 EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` 13155 // FillGapWithZero - Whether gaps would be filled with zeros. 13156 FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` 13157 // MetricFilterPattern - Pattern for the filter of the metric. 13158 MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` 13159 // Dimensions - List of dimensions. 13160 Dimensions *[]Dimension `json:"dimensions,omitempty"` 13161 // IsInternal - Whether the metric is internal. 13162 IsInternal *bool `json:"isInternal,omitempty"` 13163 // SourceMdmAccount - The source MDM account. 13164 SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` 13165 // SourceMdmNamespace - The source MDM namespace. 13166 SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` 13167 // ResourceIDDimensionNameOverride - The resource Id dimension name override. 13168 ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` 13169} 13170 13171// NextHopParameters parameters that define the source and destination endpoint. 13172type NextHopParameters struct { 13173 // TargetResourceID - The resource identifier of the target resource against which the action is to be performed. 13174 TargetResourceID *string `json:"targetResourceId,omitempty"` 13175 // SourceIPAddress - The source IP address. 13176 SourceIPAddress *string `json:"sourceIPAddress,omitempty"` 13177 // DestinationIPAddress - The destination IP address. 13178 DestinationIPAddress *string `json:"destinationIPAddress,omitempty"` 13179 // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). 13180 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` 13181} 13182 13183// NextHopResult the information about next hop from the specified VM. 13184type NextHopResult struct { 13185 autorest.Response `json:"-"` 13186 // NextHopType - Next hop type. Possible values include: 'NextHopTypeInternet', 'NextHopTypeVirtualAppliance', 'NextHopTypeVirtualNetworkGateway', 'NextHopTypeVnetLocal', 'NextHopTypeHyperNetGateway', 'NextHopTypeNone' 13187 NextHopType NextHopType `json:"nextHopType,omitempty"` 13188 // NextHopIPAddress - Next hop IP Address 13189 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` 13190 // RouteTableID - The resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. 13191 RouteTableID *string `json:"routeTableId,omitempty"` 13192} 13193 13194// Operation network REST API operation definition. 13195type Operation struct { 13196 // Name - Operation name: {provider}/{resource}/{operation} 13197 Name *string `json:"name,omitempty"` 13198 // Display - Display metadata associated with the operation. 13199 Display *OperationDisplay `json:"display,omitempty"` 13200 // Origin - Origin of the operation. 13201 Origin *string `json:"origin,omitempty"` 13202 // OperationPropertiesFormat - Operation properties format. 13203 *OperationPropertiesFormat `json:"properties,omitempty"` 13204} 13205 13206// MarshalJSON is the custom marshaler for Operation. 13207func (o Operation) MarshalJSON() ([]byte, error) { 13208 objectMap := make(map[string]interface{}) 13209 if o.Name != nil { 13210 objectMap["name"] = o.Name 13211 } 13212 if o.Display != nil { 13213 objectMap["display"] = o.Display 13214 } 13215 if o.Origin != nil { 13216 objectMap["origin"] = o.Origin 13217 } 13218 if o.OperationPropertiesFormat != nil { 13219 objectMap["properties"] = o.OperationPropertiesFormat 13220 } 13221 return json.Marshal(objectMap) 13222} 13223 13224// UnmarshalJSON is the custom unmarshaler for Operation struct. 13225func (o *Operation) UnmarshalJSON(body []byte) error { 13226 var m map[string]*json.RawMessage 13227 err := json.Unmarshal(body, &m) 13228 if err != nil { 13229 return err 13230 } 13231 for k, v := range m { 13232 switch k { 13233 case "name": 13234 if v != nil { 13235 var name string 13236 err = json.Unmarshal(*v, &name) 13237 if err != nil { 13238 return err 13239 } 13240 o.Name = &name 13241 } 13242 case "display": 13243 if v != nil { 13244 var display OperationDisplay 13245 err = json.Unmarshal(*v, &display) 13246 if err != nil { 13247 return err 13248 } 13249 o.Display = &display 13250 } 13251 case "origin": 13252 if v != nil { 13253 var origin string 13254 err = json.Unmarshal(*v, &origin) 13255 if err != nil { 13256 return err 13257 } 13258 o.Origin = &origin 13259 } 13260 case "properties": 13261 if v != nil { 13262 var operationPropertiesFormat OperationPropertiesFormat 13263 err = json.Unmarshal(*v, &operationPropertiesFormat) 13264 if err != nil { 13265 return err 13266 } 13267 o.OperationPropertiesFormat = &operationPropertiesFormat 13268 } 13269 } 13270 } 13271 13272 return nil 13273} 13274 13275// OperationDisplay display metadata associated with the operation. 13276type OperationDisplay struct { 13277 // Provider - Service provider: Microsoft Network. 13278 Provider *string `json:"provider,omitempty"` 13279 // Resource - Resource on which the operation is performed. 13280 Resource *string `json:"resource,omitempty"` 13281 // Operation - Type of the operation: get, read, delete, etc. 13282 Operation *string `json:"operation,omitempty"` 13283 // Description - Description of the operation. 13284 Description *string `json:"description,omitempty"` 13285} 13286 13287// OperationListResult result of the request to list Network operations. It contains a list of operations 13288// and a URL link to get the next set of results. 13289type OperationListResult struct { 13290 autorest.Response `json:"-"` 13291 // Value - List of Network operations supported by the Network resource provider. 13292 Value *[]Operation `json:"value,omitempty"` 13293 // NextLink - URL to get the next set of operation list results if there are any. 13294 NextLink *string `json:"nextLink,omitempty"` 13295} 13296 13297// OperationListResultIterator provides access to a complete listing of Operation values. 13298type OperationListResultIterator struct { 13299 i int 13300 page OperationListResultPage 13301} 13302 13303// NextWithContext advances to the next value. If there was an error making 13304// the request the iterator does not advance and the error is returned. 13305func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 13306 if tracing.IsEnabled() { 13307 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 13308 defer func() { 13309 sc := -1 13310 if iter.Response().Response.Response != nil { 13311 sc = iter.Response().Response.Response.StatusCode 13312 } 13313 tracing.EndSpan(ctx, sc, err) 13314 }() 13315 } 13316 iter.i++ 13317 if iter.i < len(iter.page.Values()) { 13318 return nil 13319 } 13320 err = iter.page.NextWithContext(ctx) 13321 if err != nil { 13322 iter.i-- 13323 return err 13324 } 13325 iter.i = 0 13326 return nil 13327} 13328 13329// Next advances to the next value. If there was an error making 13330// the request the iterator does not advance and the error is returned. 13331// Deprecated: Use NextWithContext() instead. 13332func (iter *OperationListResultIterator) Next() error { 13333 return iter.NextWithContext(context.Background()) 13334} 13335 13336// NotDone returns true if the enumeration should be started or is not yet complete. 13337func (iter OperationListResultIterator) NotDone() bool { 13338 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 13339} 13340 13341// Response returns the raw server response from the last page request. 13342func (iter OperationListResultIterator) Response() OperationListResult { 13343 return iter.page.Response() 13344} 13345 13346// Value returns the current value or a zero-initialized value if the 13347// iterator has advanced beyond the end of the collection. 13348func (iter OperationListResultIterator) Value() Operation { 13349 if !iter.page.NotDone() { 13350 return Operation{} 13351 } 13352 return iter.page.Values()[iter.i] 13353} 13354 13355// Creates a new instance of the OperationListResultIterator type. 13356func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 13357 return OperationListResultIterator{page: page} 13358} 13359 13360// IsEmpty returns true if the ListResult contains no values. 13361func (olr OperationListResult) IsEmpty() bool { 13362 return olr.Value == nil || len(*olr.Value) == 0 13363} 13364 13365// hasNextLink returns true if the NextLink is not empty. 13366func (olr OperationListResult) hasNextLink() bool { 13367 return olr.NextLink != nil && len(*olr.NextLink) != 0 13368} 13369 13370// operationListResultPreparer prepares a request to retrieve the next set of results. 13371// It returns nil if no more results exist. 13372func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 13373 if !olr.hasNextLink() { 13374 return nil, nil 13375 } 13376 return autorest.Prepare((&http.Request{}).WithContext(ctx), 13377 autorest.AsJSON(), 13378 autorest.AsGet(), 13379 autorest.WithBaseURL(to.String(olr.NextLink))) 13380} 13381 13382// OperationListResultPage contains a page of Operation values. 13383type OperationListResultPage struct { 13384 fn func(context.Context, OperationListResult) (OperationListResult, error) 13385 olr OperationListResult 13386} 13387 13388// NextWithContext advances to the next page of values. If there was an error making 13389// the request the page does not advance and the error is returned. 13390func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 13391 if tracing.IsEnabled() { 13392 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 13393 defer func() { 13394 sc := -1 13395 if page.Response().Response.Response != nil { 13396 sc = page.Response().Response.Response.StatusCode 13397 } 13398 tracing.EndSpan(ctx, sc, err) 13399 }() 13400 } 13401 for { 13402 next, err := page.fn(ctx, page.olr) 13403 if err != nil { 13404 return err 13405 } 13406 page.olr = next 13407 if !next.hasNextLink() || !next.IsEmpty() { 13408 break 13409 } 13410 } 13411 return nil 13412} 13413 13414// Next advances to the next page of values. If there was an error making 13415// the request the page does not advance and the error is returned. 13416// Deprecated: Use NextWithContext() instead. 13417func (page *OperationListResultPage) Next() error { 13418 return page.NextWithContext(context.Background()) 13419} 13420 13421// NotDone returns true if the page enumeration should be started or is not yet complete. 13422func (page OperationListResultPage) NotDone() bool { 13423 return !page.olr.IsEmpty() 13424} 13425 13426// Response returns the raw server response from the last page request. 13427func (page OperationListResultPage) Response() OperationListResult { 13428 return page.olr 13429} 13430 13431// Values returns the slice of values for the current page or nil if there are no values. 13432func (page OperationListResultPage) Values() []Operation { 13433 if page.olr.IsEmpty() { 13434 return nil 13435 } 13436 return *page.olr.Value 13437} 13438 13439// Creates a new instance of the OperationListResultPage type. 13440func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 13441 return OperationListResultPage{ 13442 fn: getNextPage, 13443 olr: cur, 13444 } 13445} 13446 13447// OperationPropertiesFormat description of operation properties format. 13448type OperationPropertiesFormat struct { 13449 // ServiceSpecification - Specification of the service. 13450 ServiceSpecification *OperationPropertiesFormatServiceSpecification `json:"serviceSpecification,omitempty"` 13451} 13452 13453// OperationPropertiesFormatServiceSpecification specification of the service. 13454type OperationPropertiesFormatServiceSpecification struct { 13455 // MetricSpecifications - Operation service specification. 13456 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` 13457 // LogSpecifications - Operation log specification. 13458 LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` 13459} 13460 13461// OutboundNatRule outbound NAT pool of the load balancer. 13462type OutboundNatRule struct { 13463 // OutboundNatRulePropertiesFormat - Properties of load balancer outbound nat rule. 13464 *OutboundNatRulePropertiesFormat `json:"properties,omitempty"` 13465 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 13466 Name *string `json:"name,omitempty"` 13467 // Etag - A unique read-only string that changes whenever the resource is updated. 13468 Etag *string `json:"etag,omitempty"` 13469 // ID - Resource ID. 13470 ID *string `json:"id,omitempty"` 13471} 13472 13473// MarshalJSON is the custom marshaler for OutboundNatRule. 13474func (onr OutboundNatRule) MarshalJSON() ([]byte, error) { 13475 objectMap := make(map[string]interface{}) 13476 if onr.OutboundNatRulePropertiesFormat != nil { 13477 objectMap["properties"] = onr.OutboundNatRulePropertiesFormat 13478 } 13479 if onr.Name != nil { 13480 objectMap["name"] = onr.Name 13481 } 13482 if onr.Etag != nil { 13483 objectMap["etag"] = onr.Etag 13484 } 13485 if onr.ID != nil { 13486 objectMap["id"] = onr.ID 13487 } 13488 return json.Marshal(objectMap) 13489} 13490 13491// UnmarshalJSON is the custom unmarshaler for OutboundNatRule struct. 13492func (onr *OutboundNatRule) UnmarshalJSON(body []byte) error { 13493 var m map[string]*json.RawMessage 13494 err := json.Unmarshal(body, &m) 13495 if err != nil { 13496 return err 13497 } 13498 for k, v := range m { 13499 switch k { 13500 case "properties": 13501 if v != nil { 13502 var outboundNatRulePropertiesFormat OutboundNatRulePropertiesFormat 13503 err = json.Unmarshal(*v, &outboundNatRulePropertiesFormat) 13504 if err != nil { 13505 return err 13506 } 13507 onr.OutboundNatRulePropertiesFormat = &outboundNatRulePropertiesFormat 13508 } 13509 case "name": 13510 if v != nil { 13511 var name string 13512 err = json.Unmarshal(*v, &name) 13513 if err != nil { 13514 return err 13515 } 13516 onr.Name = &name 13517 } 13518 case "etag": 13519 if v != nil { 13520 var etag string 13521 err = json.Unmarshal(*v, &etag) 13522 if err != nil { 13523 return err 13524 } 13525 onr.Etag = &etag 13526 } 13527 case "id": 13528 if v != nil { 13529 var ID string 13530 err = json.Unmarshal(*v, &ID) 13531 if err != nil { 13532 return err 13533 } 13534 onr.ID = &ID 13535 } 13536 } 13537 } 13538 13539 return nil 13540} 13541 13542// OutboundNatRulePropertiesFormat outbound NAT pool of the load balancer. 13543type OutboundNatRulePropertiesFormat struct { 13544 // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. 13545 AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` 13546 // FrontendIPConfigurations - The Frontend IP addresses of the load balancer. 13547 FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` 13548 // BackendAddressPool - A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. 13549 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 13550 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 13551 ProvisioningState *string `json:"provisioningState,omitempty"` 13552} 13553 13554// PacketCapture parameters that define the create packet capture operation. 13555type PacketCapture struct { 13556 *PacketCaptureParameters `json:"properties,omitempty"` 13557} 13558 13559// MarshalJSON is the custom marshaler for PacketCapture. 13560func (pc PacketCapture) MarshalJSON() ([]byte, error) { 13561 objectMap := make(map[string]interface{}) 13562 if pc.PacketCaptureParameters != nil { 13563 objectMap["properties"] = pc.PacketCaptureParameters 13564 } 13565 return json.Marshal(objectMap) 13566} 13567 13568// UnmarshalJSON is the custom unmarshaler for PacketCapture struct. 13569func (pc *PacketCapture) UnmarshalJSON(body []byte) error { 13570 var m map[string]*json.RawMessage 13571 err := json.Unmarshal(body, &m) 13572 if err != nil { 13573 return err 13574 } 13575 for k, v := range m { 13576 switch k { 13577 case "properties": 13578 if v != nil { 13579 var packetCaptureParameters PacketCaptureParameters 13580 err = json.Unmarshal(*v, &packetCaptureParameters) 13581 if err != nil { 13582 return err 13583 } 13584 pc.PacketCaptureParameters = &packetCaptureParameters 13585 } 13586 } 13587 } 13588 13589 return nil 13590} 13591 13592// PacketCaptureFilter filter that is applied to packet capture request. Multiple filters can be applied. 13593type PacketCaptureFilter struct { 13594 // Protocol - Protocol to be filtered on. Possible values include: 'PcProtocolTCP', 'PcProtocolUDP', 'PcProtocolAny' 13595 Protocol PcProtocol `json:"protocol,omitempty"` 13596 // LocalIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 13597 LocalIPAddress *string `json:"localIPAddress,omitempty"` 13598 // RemoteIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 13599 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` 13600 // LocalPort - Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 13601 LocalPort *string `json:"localPort,omitempty"` 13602 // RemotePort - Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 13603 RemotePort *string `json:"remotePort,omitempty"` 13604} 13605 13606// PacketCaptureListResult list of packet capture sessions. 13607type PacketCaptureListResult struct { 13608 autorest.Response `json:"-"` 13609 // Value - Information about packet capture sessions. 13610 Value *[]PacketCaptureResult `json:"value,omitempty"` 13611} 13612 13613// PacketCaptureParameters parameters that define the create packet capture operation. 13614type PacketCaptureParameters struct { 13615 // Target - The ID of the targeted resource, only VM is currently supported. 13616 Target *string `json:"target,omitempty"` 13617 // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. 13618 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` 13619 // TotalBytesPerSession - Maximum size of the capture output. 13620 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` 13621 // TimeLimitInSeconds - Maximum duration of the capture session in seconds. 13622 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` 13623 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` 13624 Filters *[]PacketCaptureFilter `json:"filters,omitempty"` 13625} 13626 13627// PacketCaptureQueryStatusResult status of packet capture session. 13628type PacketCaptureQueryStatusResult struct { 13629 autorest.Response `json:"-"` 13630 // Name - The name of the packet capture resource. 13631 Name *string `json:"name,omitempty"` 13632 // ID - The ID of the packet capture resource. 13633 ID *string `json:"id,omitempty"` 13634 // CaptureStartTime - The start time of the packet capture session. 13635 CaptureStartTime *date.Time `json:"captureStartTime,omitempty"` 13636 // PacketCaptureStatus - The status of the packet capture session. Possible values include: 'PcStatusNotStarted', 'PcStatusRunning', 'PcStatusStopped', 'PcStatusError', 'PcStatusUnknown' 13637 PacketCaptureStatus PcStatus `json:"packetCaptureStatus,omitempty"` 13638 // StopReason - The reason the current packet capture session was stopped. 13639 StopReason *string `json:"stopReason,omitempty"` 13640 // PacketCaptureError - List of errors of packet capture session. 13641 PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"` 13642} 13643 13644// PacketCaptureResult information about packet capture session. 13645type PacketCaptureResult struct { 13646 autorest.Response `json:"-"` 13647 // Name - READ-ONLY; Name of the packet capture session. 13648 Name *string `json:"name,omitempty"` 13649 // ID - READ-ONLY; ID of the packet capture operation. 13650 ID *string `json:"id,omitempty"` 13651 Etag *string `json:"etag,omitempty"` 13652 *PacketCaptureResultProperties `json:"properties,omitempty"` 13653} 13654 13655// MarshalJSON is the custom marshaler for PacketCaptureResult. 13656func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) { 13657 objectMap := make(map[string]interface{}) 13658 if pcr.Etag != nil { 13659 objectMap["etag"] = pcr.Etag 13660 } 13661 if pcr.PacketCaptureResultProperties != nil { 13662 objectMap["properties"] = pcr.PacketCaptureResultProperties 13663 } 13664 return json.Marshal(objectMap) 13665} 13666 13667// UnmarshalJSON is the custom unmarshaler for PacketCaptureResult struct. 13668func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { 13669 var m map[string]*json.RawMessage 13670 err := json.Unmarshal(body, &m) 13671 if err != nil { 13672 return err 13673 } 13674 for k, v := range m { 13675 switch k { 13676 case "name": 13677 if v != nil { 13678 var name string 13679 err = json.Unmarshal(*v, &name) 13680 if err != nil { 13681 return err 13682 } 13683 pcr.Name = &name 13684 } 13685 case "id": 13686 if v != nil { 13687 var ID string 13688 err = json.Unmarshal(*v, &ID) 13689 if err != nil { 13690 return err 13691 } 13692 pcr.ID = &ID 13693 } 13694 case "etag": 13695 if v != nil { 13696 var etag string 13697 err = json.Unmarshal(*v, &etag) 13698 if err != nil { 13699 return err 13700 } 13701 pcr.Etag = &etag 13702 } 13703 case "properties": 13704 if v != nil { 13705 var packetCaptureResultProperties PacketCaptureResultProperties 13706 err = json.Unmarshal(*v, &packetCaptureResultProperties) 13707 if err != nil { 13708 return err 13709 } 13710 pcr.PacketCaptureResultProperties = &packetCaptureResultProperties 13711 } 13712 } 13713 } 13714 13715 return nil 13716} 13717 13718// PacketCaptureResultProperties describes the properties of a packet capture session. 13719type PacketCaptureResultProperties struct { 13720 // ProvisioningState - The provisioning state of the packet capture session. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 13721 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 13722 // Target - The ID of the targeted resource, only VM is currently supported. 13723 Target *string `json:"target,omitempty"` 13724 // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. 13725 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` 13726 // TotalBytesPerSession - Maximum size of the capture output. 13727 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` 13728 // TimeLimitInSeconds - Maximum duration of the capture session in seconds. 13729 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` 13730 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` 13731 Filters *[]PacketCaptureFilter `json:"filters,omitempty"` 13732} 13733 13734// PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 13735// operation. 13736type PacketCapturesCreateFuture struct { 13737 azure.FutureAPI 13738 // Result returns the result of the asynchronous operation. 13739 // If the operation has not completed it will return an error. 13740 Result func(PacketCapturesClient) (PacketCaptureResult, error) 13741} 13742 13743// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13744func (future *PacketCapturesCreateFuture) UnmarshalJSON(body []byte) error { 13745 var azFuture azure.Future 13746 if err := json.Unmarshal(body, &azFuture); err != nil { 13747 return err 13748 } 13749 future.FutureAPI = &azFuture 13750 future.Result = future.result 13751 return nil 13752} 13753 13754// result is the default implementation for PacketCapturesCreateFuture.Result. 13755func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) { 13756 var done bool 13757 done, err = future.DoneWithContext(context.Background(), client) 13758 if err != nil { 13759 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure") 13760 return 13761 } 13762 if !done { 13763 pcr.Response.Response = future.Response() 13764 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture") 13765 return 13766 } 13767 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13768 if pcr.Response.Response, err = future.GetResult(sender); err == nil && pcr.Response.Response.StatusCode != http.StatusNoContent { 13769 pcr, err = client.CreateResponder(pcr.Response.Response) 13770 if err != nil { 13771 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", pcr.Response.Response, "Failure responding to request") 13772 } 13773 } 13774 return 13775} 13776 13777// PacketCapturesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 13778// operation. 13779type PacketCapturesDeleteFuture struct { 13780 azure.FutureAPI 13781 // Result returns the result of the asynchronous operation. 13782 // If the operation has not completed it will return an error. 13783 Result func(PacketCapturesClient) (autorest.Response, error) 13784} 13785 13786// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13787func (future *PacketCapturesDeleteFuture) UnmarshalJSON(body []byte) error { 13788 var azFuture azure.Future 13789 if err := json.Unmarshal(body, &azFuture); err != nil { 13790 return err 13791 } 13792 future.FutureAPI = &azFuture 13793 future.Result = future.result 13794 return nil 13795} 13796 13797// result is the default implementation for PacketCapturesDeleteFuture.Result. 13798func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { 13799 var done bool 13800 done, err = future.DoneWithContext(context.Background(), client) 13801 if err != nil { 13802 err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure") 13803 return 13804 } 13805 if !done { 13806 ar.Response = future.Response() 13807 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture") 13808 return 13809 } 13810 ar.Response = future.Response() 13811 return 13812} 13813 13814// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running 13815// operation. 13816type PacketCapturesGetStatusFuture struct { 13817 azure.FutureAPI 13818 // Result returns the result of the asynchronous operation. 13819 // If the operation has not completed it will return an error. 13820 Result func(PacketCapturesClient) (PacketCaptureQueryStatusResult, error) 13821} 13822 13823// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13824func (future *PacketCapturesGetStatusFuture) UnmarshalJSON(body []byte) error { 13825 var azFuture azure.Future 13826 if err := json.Unmarshal(body, &azFuture); err != nil { 13827 return err 13828 } 13829 future.FutureAPI = &azFuture 13830 future.Result = future.result 13831 return nil 13832} 13833 13834// result is the default implementation for PacketCapturesGetStatusFuture.Result. 13835func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) { 13836 var done bool 13837 done, err = future.DoneWithContext(context.Background(), client) 13838 if err != nil { 13839 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure") 13840 return 13841 } 13842 if !done { 13843 pcqsr.Response.Response = future.Response() 13844 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture") 13845 return 13846 } 13847 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13848 if pcqsr.Response.Response, err = future.GetResult(sender); err == nil && pcqsr.Response.Response.StatusCode != http.StatusNoContent { 13849 pcqsr, err = client.GetStatusResponder(pcqsr.Response.Response) 13850 if err != nil { 13851 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", pcqsr.Response.Response, "Failure responding to request") 13852 } 13853 } 13854 return 13855} 13856 13857// PacketCapturesStopFuture an abstraction for monitoring and retrieving the results of a long-running 13858// operation. 13859type PacketCapturesStopFuture struct { 13860 azure.FutureAPI 13861 // Result returns the result of the asynchronous operation. 13862 // If the operation has not completed it will return an error. 13863 Result func(PacketCapturesClient) (autorest.Response, error) 13864} 13865 13866// UnmarshalJSON is the custom unmarshaller for CreateFuture. 13867func (future *PacketCapturesStopFuture) UnmarshalJSON(body []byte) error { 13868 var azFuture azure.Future 13869 if err := json.Unmarshal(body, &azFuture); err != nil { 13870 return err 13871 } 13872 future.FutureAPI = &azFuture 13873 future.Result = future.result 13874 return nil 13875} 13876 13877// result is the default implementation for PacketCapturesStopFuture.Result. 13878func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { 13879 var done bool 13880 done, err = future.DoneWithContext(context.Background(), client) 13881 if err != nil { 13882 err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure") 13883 return 13884 } 13885 if !done { 13886 ar.Response = future.Response() 13887 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture") 13888 return 13889 } 13890 ar.Response = future.Response() 13891 return 13892} 13893 13894// PacketCaptureStorageLocation describes the storage location for a packet capture session. 13895type PacketCaptureStorageLocation struct { 13896 // StorageID - The ID of the storage account to save the packet capture session. Required if no local file path is provided. 13897 StorageID *string `json:"storageId,omitempty"` 13898 // StoragePath - The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. 13899 StoragePath *string `json:"storagePath,omitempty"` 13900 // FilePath - A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. 13901 FilePath *string `json:"filePath,omitempty"` 13902} 13903 13904// PatchRouteFilter route Filter Resource. 13905type PatchRouteFilter struct { 13906 *RouteFilterPropertiesFormat `json:"properties,omitempty"` 13907 // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. 13908 Name *string `json:"name,omitempty"` 13909 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 13910 Etag *string `json:"etag,omitempty"` 13911 // Type - READ-ONLY; Resource type. 13912 Type *string `json:"type,omitempty"` 13913 // Tags - Resource tags. 13914 Tags map[string]*string `json:"tags"` 13915 // ID - Resource ID. 13916 ID *string `json:"id,omitempty"` 13917} 13918 13919// MarshalJSON is the custom marshaler for PatchRouteFilter. 13920func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) { 13921 objectMap := make(map[string]interface{}) 13922 if prf.RouteFilterPropertiesFormat != nil { 13923 objectMap["properties"] = prf.RouteFilterPropertiesFormat 13924 } 13925 if prf.Tags != nil { 13926 objectMap["tags"] = prf.Tags 13927 } 13928 if prf.ID != nil { 13929 objectMap["id"] = prf.ID 13930 } 13931 return json.Marshal(objectMap) 13932} 13933 13934// UnmarshalJSON is the custom unmarshaler for PatchRouteFilter struct. 13935func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error { 13936 var m map[string]*json.RawMessage 13937 err := json.Unmarshal(body, &m) 13938 if err != nil { 13939 return err 13940 } 13941 for k, v := range m { 13942 switch k { 13943 case "properties": 13944 if v != nil { 13945 var routeFilterPropertiesFormat RouteFilterPropertiesFormat 13946 err = json.Unmarshal(*v, &routeFilterPropertiesFormat) 13947 if err != nil { 13948 return err 13949 } 13950 prf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat 13951 } 13952 case "name": 13953 if v != nil { 13954 var name string 13955 err = json.Unmarshal(*v, &name) 13956 if err != nil { 13957 return err 13958 } 13959 prf.Name = &name 13960 } 13961 case "etag": 13962 if v != nil { 13963 var etag string 13964 err = json.Unmarshal(*v, &etag) 13965 if err != nil { 13966 return err 13967 } 13968 prf.Etag = &etag 13969 } 13970 case "type": 13971 if v != nil { 13972 var typeVar string 13973 err = json.Unmarshal(*v, &typeVar) 13974 if err != nil { 13975 return err 13976 } 13977 prf.Type = &typeVar 13978 } 13979 case "tags": 13980 if v != nil { 13981 var tags map[string]*string 13982 err = json.Unmarshal(*v, &tags) 13983 if err != nil { 13984 return err 13985 } 13986 prf.Tags = tags 13987 } 13988 case "id": 13989 if v != nil { 13990 var ID string 13991 err = json.Unmarshal(*v, &ID) 13992 if err != nil { 13993 return err 13994 } 13995 prf.ID = &ID 13996 } 13997 } 13998 } 13999 14000 return nil 14001} 14002 14003// PatchRouteFilterRule route Filter Rule Resource 14004type PatchRouteFilterRule struct { 14005 *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` 14006 // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. 14007 Name *string `json:"name,omitempty"` 14008 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 14009 Etag *string `json:"etag,omitempty"` 14010 // ID - Resource ID. 14011 ID *string `json:"id,omitempty"` 14012} 14013 14014// MarshalJSON is the custom marshaler for PatchRouteFilterRule. 14015func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) { 14016 objectMap := make(map[string]interface{}) 14017 if prfr.RouteFilterRulePropertiesFormat != nil { 14018 objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat 14019 } 14020 if prfr.ID != nil { 14021 objectMap["id"] = prfr.ID 14022 } 14023 return json.Marshal(objectMap) 14024} 14025 14026// UnmarshalJSON is the custom unmarshaler for PatchRouteFilterRule struct. 14027func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error { 14028 var m map[string]*json.RawMessage 14029 err := json.Unmarshal(body, &m) 14030 if err != nil { 14031 return err 14032 } 14033 for k, v := range m { 14034 switch k { 14035 case "properties": 14036 if v != nil { 14037 var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat 14038 err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) 14039 if err != nil { 14040 return err 14041 } 14042 prfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat 14043 } 14044 case "name": 14045 if v != nil { 14046 var name string 14047 err = json.Unmarshal(*v, &name) 14048 if err != nil { 14049 return err 14050 } 14051 prfr.Name = &name 14052 } 14053 case "etag": 14054 if v != nil { 14055 var etag string 14056 err = json.Unmarshal(*v, &etag) 14057 if err != nil { 14058 return err 14059 } 14060 prfr.Etag = &etag 14061 } 14062 case "id": 14063 if v != nil { 14064 var ID string 14065 err = json.Unmarshal(*v, &ID) 14066 if err != nil { 14067 return err 14068 } 14069 prfr.ID = &ID 14070 } 14071 } 14072 } 14073 14074 return nil 14075} 14076 14077// Policies policies for vpn gateway. 14078type Policies struct { 14079 // AllowBranchToBranchTraffic - True if branch to branch traffic is allowed. 14080 AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` 14081 // AllowVnetToVnetTraffic - True if Vnet to Vnet traffic is allowed. 14082 AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` 14083} 14084 14085// Probe a load balancer probe. 14086type Probe struct { 14087 autorest.Response `json:"-"` 14088 // ProbePropertiesFormat - Properties of load balancer probe. 14089 *ProbePropertiesFormat `json:"properties,omitempty"` 14090 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 14091 Name *string `json:"name,omitempty"` 14092 // Etag - A unique read-only string that changes whenever the resource is updated. 14093 Etag *string `json:"etag,omitempty"` 14094 // ID - Resource ID. 14095 ID *string `json:"id,omitempty"` 14096} 14097 14098// MarshalJSON is the custom marshaler for Probe. 14099func (p Probe) MarshalJSON() ([]byte, error) { 14100 objectMap := make(map[string]interface{}) 14101 if p.ProbePropertiesFormat != nil { 14102 objectMap["properties"] = p.ProbePropertiesFormat 14103 } 14104 if p.Name != nil { 14105 objectMap["name"] = p.Name 14106 } 14107 if p.Etag != nil { 14108 objectMap["etag"] = p.Etag 14109 } 14110 if p.ID != nil { 14111 objectMap["id"] = p.ID 14112 } 14113 return json.Marshal(objectMap) 14114} 14115 14116// UnmarshalJSON is the custom unmarshaler for Probe struct. 14117func (p *Probe) UnmarshalJSON(body []byte) error { 14118 var m map[string]*json.RawMessage 14119 err := json.Unmarshal(body, &m) 14120 if err != nil { 14121 return err 14122 } 14123 for k, v := range m { 14124 switch k { 14125 case "properties": 14126 if v != nil { 14127 var probePropertiesFormat ProbePropertiesFormat 14128 err = json.Unmarshal(*v, &probePropertiesFormat) 14129 if err != nil { 14130 return err 14131 } 14132 p.ProbePropertiesFormat = &probePropertiesFormat 14133 } 14134 case "name": 14135 if v != nil { 14136 var name string 14137 err = json.Unmarshal(*v, &name) 14138 if err != nil { 14139 return err 14140 } 14141 p.Name = &name 14142 } 14143 case "etag": 14144 if v != nil { 14145 var etag string 14146 err = json.Unmarshal(*v, &etag) 14147 if err != nil { 14148 return err 14149 } 14150 p.Etag = &etag 14151 } 14152 case "id": 14153 if v != nil { 14154 var ID string 14155 err = json.Unmarshal(*v, &ID) 14156 if err != nil { 14157 return err 14158 } 14159 p.ID = &ID 14160 } 14161 } 14162 } 14163 14164 return nil 14165} 14166 14167// ProbePropertiesFormat load balancer probe resource. 14168type ProbePropertiesFormat struct { 14169 // LoadBalancingRules - READ-ONLY; The load balancer rules that use this probe. 14170 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 14171 // Protocol - The protocol of the end point. Possible values are: 'Http', 'Tcp', or 'Https'. If 'Tcp' is specified, a received ACK is required for the probe to be successful. If 'Http' or 'Https' is specified, a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP', 'ProbeProtocolHTTPS' 14172 Protocol ProbeProtocol `json:"protocol,omitempty"` 14173 // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. 14174 Port *int32 `json:"port,omitempty"` 14175 // IntervalInSeconds - The interval, in seconds, for how frequently to probe the endpoint for health status. Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5. 14176 IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` 14177 // NumberOfProbes - The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. 14178 NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` 14179 // RequestPath - The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. 14180 RequestPath *string `json:"requestPath,omitempty"` 14181 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 14182 ProvisioningState *string `json:"provisioningState,omitempty"` 14183} 14184 14185// MarshalJSON is the custom marshaler for ProbePropertiesFormat. 14186func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) { 14187 objectMap := make(map[string]interface{}) 14188 if ppf.Protocol != "" { 14189 objectMap["protocol"] = ppf.Protocol 14190 } 14191 if ppf.Port != nil { 14192 objectMap["port"] = ppf.Port 14193 } 14194 if ppf.IntervalInSeconds != nil { 14195 objectMap["intervalInSeconds"] = ppf.IntervalInSeconds 14196 } 14197 if ppf.NumberOfProbes != nil { 14198 objectMap["numberOfProbes"] = ppf.NumberOfProbes 14199 } 14200 if ppf.RequestPath != nil { 14201 objectMap["requestPath"] = ppf.RequestPath 14202 } 14203 if ppf.ProvisioningState != nil { 14204 objectMap["provisioningState"] = ppf.ProvisioningState 14205 } 14206 return json.Marshal(objectMap) 14207} 14208 14209// ProtocolConfiguration configuration of the protocol. 14210type ProtocolConfiguration struct { 14211 HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"` 14212} 14213 14214// PublicIPAddress public IP address resource. 14215type PublicIPAddress struct { 14216 autorest.Response `json:"-"` 14217 // Sku - The public IP address SKU. 14218 Sku *PublicIPAddressSku `json:"sku,omitempty"` 14219 // PublicIPAddressPropertiesFormat - Public IP address properties. 14220 *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` 14221 // Etag - A unique read-only string that changes whenever the resource is updated. 14222 Etag *string `json:"etag,omitempty"` 14223 // Zones - A list of availability zones denoting the IP allocated for the resource needs to come from. 14224 Zones *[]string `json:"zones,omitempty"` 14225 // ID - Resource ID. 14226 ID *string `json:"id,omitempty"` 14227 // Name - READ-ONLY; Resource name. 14228 Name *string `json:"name,omitempty"` 14229 // Type - READ-ONLY; Resource type. 14230 Type *string `json:"type,omitempty"` 14231 // Location - Resource location. 14232 Location *string `json:"location,omitempty"` 14233 // Tags - Resource tags. 14234 Tags map[string]*string `json:"tags"` 14235} 14236 14237// MarshalJSON is the custom marshaler for PublicIPAddress. 14238func (pia PublicIPAddress) MarshalJSON() ([]byte, error) { 14239 objectMap := make(map[string]interface{}) 14240 if pia.Sku != nil { 14241 objectMap["sku"] = pia.Sku 14242 } 14243 if pia.PublicIPAddressPropertiesFormat != nil { 14244 objectMap["properties"] = pia.PublicIPAddressPropertiesFormat 14245 } 14246 if pia.Etag != nil { 14247 objectMap["etag"] = pia.Etag 14248 } 14249 if pia.Zones != nil { 14250 objectMap["zones"] = pia.Zones 14251 } 14252 if pia.ID != nil { 14253 objectMap["id"] = pia.ID 14254 } 14255 if pia.Location != nil { 14256 objectMap["location"] = pia.Location 14257 } 14258 if pia.Tags != nil { 14259 objectMap["tags"] = pia.Tags 14260 } 14261 return json.Marshal(objectMap) 14262} 14263 14264// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. 14265func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error { 14266 var m map[string]*json.RawMessage 14267 err := json.Unmarshal(body, &m) 14268 if err != nil { 14269 return err 14270 } 14271 for k, v := range m { 14272 switch k { 14273 case "sku": 14274 if v != nil { 14275 var sku PublicIPAddressSku 14276 err = json.Unmarshal(*v, &sku) 14277 if err != nil { 14278 return err 14279 } 14280 pia.Sku = &sku 14281 } 14282 case "properties": 14283 if v != nil { 14284 var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat 14285 err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat) 14286 if err != nil { 14287 return err 14288 } 14289 pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat 14290 } 14291 case "etag": 14292 if v != nil { 14293 var etag string 14294 err = json.Unmarshal(*v, &etag) 14295 if err != nil { 14296 return err 14297 } 14298 pia.Etag = &etag 14299 } 14300 case "zones": 14301 if v != nil { 14302 var zones []string 14303 err = json.Unmarshal(*v, &zones) 14304 if err != nil { 14305 return err 14306 } 14307 pia.Zones = &zones 14308 } 14309 case "id": 14310 if v != nil { 14311 var ID string 14312 err = json.Unmarshal(*v, &ID) 14313 if err != nil { 14314 return err 14315 } 14316 pia.ID = &ID 14317 } 14318 case "name": 14319 if v != nil { 14320 var name string 14321 err = json.Unmarshal(*v, &name) 14322 if err != nil { 14323 return err 14324 } 14325 pia.Name = &name 14326 } 14327 case "type": 14328 if v != nil { 14329 var typeVar string 14330 err = json.Unmarshal(*v, &typeVar) 14331 if err != nil { 14332 return err 14333 } 14334 pia.Type = &typeVar 14335 } 14336 case "location": 14337 if v != nil { 14338 var location string 14339 err = json.Unmarshal(*v, &location) 14340 if err != nil { 14341 return err 14342 } 14343 pia.Location = &location 14344 } 14345 case "tags": 14346 if v != nil { 14347 var tags map[string]*string 14348 err = json.Unmarshal(*v, &tags) 14349 if err != nil { 14350 return err 14351 } 14352 pia.Tags = tags 14353 } 14354 } 14355 } 14356 14357 return nil 14358} 14359 14360// PublicIPAddressDNSSettings contains FQDN of the DNS record associated with the public IP address 14361type PublicIPAddressDNSSettings struct { 14362 // DomainNameLabel - Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system. 14363 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 14364 // Fqdn - Gets the FQDN, Fully qualified domain name of the A DNS record associated with the public IP. This is the concatenation of the domainNameLabel and the regionalized DNS zone. 14365 Fqdn *string `json:"fqdn,omitempty"` 14366 // ReverseFqdn - Gets or Sets the Reverse FQDN. A user-visible, fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN. 14367 ReverseFqdn *string `json:"reverseFqdn,omitempty"` 14368} 14369 14370// PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 14371// long-running operation. 14372type PublicIPAddressesCreateOrUpdateFuture struct { 14373 azure.FutureAPI 14374 // Result returns the result of the asynchronous operation. 14375 // If the operation has not completed it will return an error. 14376 Result func(PublicIPAddressesClient) (PublicIPAddress, error) 14377} 14378 14379// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14380func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 14381 var azFuture azure.Future 14382 if err := json.Unmarshal(body, &azFuture); err != nil { 14383 return err 14384 } 14385 future.FutureAPI = &azFuture 14386 future.Result = future.result 14387 return nil 14388} 14389 14390// result is the default implementation for PublicIPAddressesCreateOrUpdateFuture.Result. 14391func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { 14392 var done bool 14393 done, err = future.DoneWithContext(context.Background(), client) 14394 if err != nil { 14395 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 14396 return 14397 } 14398 if !done { 14399 pia.Response.Response = future.Response() 14400 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") 14401 return 14402 } 14403 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14404 if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent { 14405 pia, err = client.CreateOrUpdateResponder(pia.Response.Response) 14406 if err != nil { 14407 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", pia.Response.Response, "Failure responding to request") 14408 } 14409 } 14410 return 14411} 14412 14413// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 14414// operation. 14415type PublicIPAddressesDeleteFuture struct { 14416 azure.FutureAPI 14417 // Result returns the result of the asynchronous operation. 14418 // If the operation has not completed it will return an error. 14419 Result func(PublicIPAddressesClient) (autorest.Response, error) 14420} 14421 14422// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14423func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error { 14424 var azFuture azure.Future 14425 if err := json.Unmarshal(body, &azFuture); err != nil { 14426 return err 14427 } 14428 future.FutureAPI = &azFuture 14429 future.Result = future.result 14430 return nil 14431} 14432 14433// result is the default implementation for PublicIPAddressesDeleteFuture.Result. 14434func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) { 14435 var done bool 14436 done, err = future.DoneWithContext(context.Background(), client) 14437 if err != nil { 14438 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure") 14439 return 14440 } 14441 if !done { 14442 ar.Response = future.Response() 14443 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") 14444 return 14445 } 14446 ar.Response = future.Response() 14447 return 14448} 14449 14450// PublicIPAddressesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 14451// long-running operation. 14452type PublicIPAddressesUpdateTagsFuture struct { 14453 azure.FutureAPI 14454 // Result returns the result of the asynchronous operation. 14455 // If the operation has not completed it will return an error. 14456 Result func(PublicIPAddressesClient) (PublicIPAddress, error) 14457} 14458 14459// UnmarshalJSON is the custom unmarshaller for CreateFuture. 14460func (future *PublicIPAddressesUpdateTagsFuture) UnmarshalJSON(body []byte) error { 14461 var azFuture azure.Future 14462 if err := json.Unmarshal(body, &azFuture); err != nil { 14463 return err 14464 } 14465 future.FutureAPI = &azFuture 14466 future.Result = future.result 14467 return nil 14468} 14469 14470// result is the default implementation for PublicIPAddressesUpdateTagsFuture.Result. 14471func (future *PublicIPAddressesUpdateTagsFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { 14472 var done bool 14473 done, err = future.DoneWithContext(context.Background(), client) 14474 if err != nil { 14475 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesUpdateTagsFuture", "Result", future.Response(), "Polling failure") 14476 return 14477 } 14478 if !done { 14479 pia.Response.Response = future.Response() 14480 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesUpdateTagsFuture") 14481 return 14482 } 14483 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14484 if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent { 14485 pia, err = client.UpdateTagsResponder(pia.Response.Response) 14486 if err != nil { 14487 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesUpdateTagsFuture", "Result", pia.Response.Response, "Failure responding to request") 14488 } 14489 } 14490 return 14491} 14492 14493// PublicIPAddressListResult response for ListPublicIpAddresses API service call. 14494type PublicIPAddressListResult struct { 14495 autorest.Response `json:"-"` 14496 // Value - A list of public IP addresses that exists in a resource group. 14497 Value *[]PublicIPAddress `json:"value,omitempty"` 14498 // NextLink - The URL to get the next set of results. 14499 NextLink *string `json:"nextLink,omitempty"` 14500} 14501 14502// PublicIPAddressListResultIterator provides access to a complete listing of PublicIPAddress values. 14503type PublicIPAddressListResultIterator struct { 14504 i int 14505 page PublicIPAddressListResultPage 14506} 14507 14508// NextWithContext advances to the next value. If there was an error making 14509// the request the iterator does not advance and the error is returned. 14510func (iter *PublicIPAddressListResultIterator) NextWithContext(ctx context.Context) (err error) { 14511 if tracing.IsEnabled() { 14512 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultIterator.NextWithContext") 14513 defer func() { 14514 sc := -1 14515 if iter.Response().Response.Response != nil { 14516 sc = iter.Response().Response.Response.StatusCode 14517 } 14518 tracing.EndSpan(ctx, sc, err) 14519 }() 14520 } 14521 iter.i++ 14522 if iter.i < len(iter.page.Values()) { 14523 return nil 14524 } 14525 err = iter.page.NextWithContext(ctx) 14526 if err != nil { 14527 iter.i-- 14528 return err 14529 } 14530 iter.i = 0 14531 return nil 14532} 14533 14534// Next advances to the next value. If there was an error making 14535// the request the iterator does not advance and the error is returned. 14536// Deprecated: Use NextWithContext() instead. 14537func (iter *PublicIPAddressListResultIterator) Next() error { 14538 return iter.NextWithContext(context.Background()) 14539} 14540 14541// NotDone returns true if the enumeration should be started or is not yet complete. 14542func (iter PublicIPAddressListResultIterator) NotDone() bool { 14543 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 14544} 14545 14546// Response returns the raw server response from the last page request. 14547func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult { 14548 return iter.page.Response() 14549} 14550 14551// Value returns the current value or a zero-initialized value if the 14552// iterator has advanced beyond the end of the collection. 14553func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress { 14554 if !iter.page.NotDone() { 14555 return PublicIPAddress{} 14556 } 14557 return iter.page.Values()[iter.i] 14558} 14559 14560// Creates a new instance of the PublicIPAddressListResultIterator type. 14561func NewPublicIPAddressListResultIterator(page PublicIPAddressListResultPage) PublicIPAddressListResultIterator { 14562 return PublicIPAddressListResultIterator{page: page} 14563} 14564 14565// IsEmpty returns true if the ListResult contains no values. 14566func (pialr PublicIPAddressListResult) IsEmpty() bool { 14567 return pialr.Value == nil || len(*pialr.Value) == 0 14568} 14569 14570// hasNextLink returns true if the NextLink is not empty. 14571func (pialr PublicIPAddressListResult) hasNextLink() bool { 14572 return pialr.NextLink != nil && len(*pialr.NextLink) != 0 14573} 14574 14575// publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. 14576// It returns nil if no more results exist. 14577func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) { 14578 if !pialr.hasNextLink() { 14579 return nil, nil 14580 } 14581 return autorest.Prepare((&http.Request{}).WithContext(ctx), 14582 autorest.AsJSON(), 14583 autorest.AsGet(), 14584 autorest.WithBaseURL(to.String(pialr.NextLink))) 14585} 14586 14587// PublicIPAddressListResultPage contains a page of PublicIPAddress values. 14588type PublicIPAddressListResultPage struct { 14589 fn func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error) 14590 pialr PublicIPAddressListResult 14591} 14592 14593// NextWithContext advances to the next page of values. If there was an error making 14594// the request the page does not advance and the error is returned. 14595func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) (err error) { 14596 if tracing.IsEnabled() { 14597 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultPage.NextWithContext") 14598 defer func() { 14599 sc := -1 14600 if page.Response().Response.Response != nil { 14601 sc = page.Response().Response.Response.StatusCode 14602 } 14603 tracing.EndSpan(ctx, sc, err) 14604 }() 14605 } 14606 for { 14607 next, err := page.fn(ctx, page.pialr) 14608 if err != nil { 14609 return err 14610 } 14611 page.pialr = next 14612 if !next.hasNextLink() || !next.IsEmpty() { 14613 break 14614 } 14615 } 14616 return nil 14617} 14618 14619// Next advances to the next page of values. If there was an error making 14620// the request the page does not advance and the error is returned. 14621// Deprecated: Use NextWithContext() instead. 14622func (page *PublicIPAddressListResultPage) Next() error { 14623 return page.NextWithContext(context.Background()) 14624} 14625 14626// NotDone returns true if the page enumeration should be started or is not yet complete. 14627func (page PublicIPAddressListResultPage) NotDone() bool { 14628 return !page.pialr.IsEmpty() 14629} 14630 14631// Response returns the raw server response from the last page request. 14632func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult { 14633 return page.pialr 14634} 14635 14636// Values returns the slice of values for the current page or nil if there are no values. 14637func (page PublicIPAddressListResultPage) Values() []PublicIPAddress { 14638 if page.pialr.IsEmpty() { 14639 return nil 14640 } 14641 return *page.pialr.Value 14642} 14643 14644// Creates a new instance of the PublicIPAddressListResultPage type. 14645func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage { 14646 return PublicIPAddressListResultPage{ 14647 fn: getNextPage, 14648 pialr: cur, 14649 } 14650} 14651 14652// PublicIPAddressPropertiesFormat public IP address properties. 14653type PublicIPAddressPropertiesFormat struct { 14654 // PublicIPAllocationMethod - The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 14655 PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` 14656 // PublicIPAddressVersion - The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 14657 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 14658 // IPConfiguration - READ-ONLY; The IP configuration associated with the public IP address. 14659 IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` 14660 // DNSSettings - The FQDN of the DNS record associated with the public IP address. 14661 DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"` 14662 // IPTags - The list of tags associated with the public IP address. 14663 IPTags *[]IPTag `json:"ipTags,omitempty"` 14664 // IPAddress - The IP address associated with the public IP address resource. 14665 IPAddress *string `json:"ipAddress,omitempty"` 14666 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 14667 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 14668 // ResourceGUID - The resource GUID property of the public IP resource. 14669 ResourceGUID *string `json:"resourceGuid,omitempty"` 14670 // ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 14671 ProvisioningState *string `json:"provisioningState,omitempty"` 14672} 14673 14674// MarshalJSON is the custom marshaler for PublicIPAddressPropertiesFormat. 14675func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { 14676 objectMap := make(map[string]interface{}) 14677 if piapf.PublicIPAllocationMethod != "" { 14678 objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod 14679 } 14680 if piapf.PublicIPAddressVersion != "" { 14681 objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion 14682 } 14683 if piapf.DNSSettings != nil { 14684 objectMap["dnsSettings"] = piapf.DNSSettings 14685 } 14686 if piapf.IPTags != nil { 14687 objectMap["ipTags"] = piapf.IPTags 14688 } 14689 if piapf.IPAddress != nil { 14690 objectMap["ipAddress"] = piapf.IPAddress 14691 } 14692 if piapf.IdleTimeoutInMinutes != nil { 14693 objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes 14694 } 14695 if piapf.ResourceGUID != nil { 14696 objectMap["resourceGuid"] = piapf.ResourceGUID 14697 } 14698 if piapf.ProvisioningState != nil { 14699 objectMap["provisioningState"] = piapf.ProvisioningState 14700 } 14701 return json.Marshal(objectMap) 14702} 14703 14704// PublicIPAddressSku SKU of a public IP address 14705type PublicIPAddressSku struct { 14706 // Name - Name of a public IP address SKU. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' 14707 Name PublicIPAddressSkuName `json:"name,omitempty"` 14708} 14709 14710// QueryTroubleshootingParameters parameters that define the resource to query the troubleshooting result. 14711type QueryTroubleshootingParameters struct { 14712 // TargetResourceID - The target resource ID to query the troubleshooting result. 14713 TargetResourceID *string `json:"targetResourceId,omitempty"` 14714} 14715 14716// Resource common resource representation. 14717type Resource struct { 14718 // ID - Resource ID. 14719 ID *string `json:"id,omitempty"` 14720 // Name - READ-ONLY; Resource name. 14721 Name *string `json:"name,omitempty"` 14722 // Type - READ-ONLY; Resource type. 14723 Type *string `json:"type,omitempty"` 14724 // Location - Resource location. 14725 Location *string `json:"location,omitempty"` 14726 // Tags - Resource tags. 14727 Tags map[string]*string `json:"tags"` 14728} 14729 14730// MarshalJSON is the custom marshaler for Resource. 14731func (r Resource) MarshalJSON() ([]byte, error) { 14732 objectMap := make(map[string]interface{}) 14733 if r.ID != nil { 14734 objectMap["id"] = r.ID 14735 } 14736 if r.Location != nil { 14737 objectMap["location"] = r.Location 14738 } 14739 if r.Tags != nil { 14740 objectMap["tags"] = r.Tags 14741 } 14742 return json.Marshal(objectMap) 14743} 14744 14745// ResourceNavigationLink resourceNavigationLink resource. 14746type ResourceNavigationLink struct { 14747 // ResourceNavigationLinkFormat - Resource navigation link properties format. 14748 *ResourceNavigationLinkFormat `json:"properties,omitempty"` 14749 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 14750 Name *string `json:"name,omitempty"` 14751 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 14752 Etag *string `json:"etag,omitempty"` 14753 // ID - Resource ID. 14754 ID *string `json:"id,omitempty"` 14755} 14756 14757// MarshalJSON is the custom marshaler for ResourceNavigationLink. 14758func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) { 14759 objectMap := make(map[string]interface{}) 14760 if rnl.ResourceNavigationLinkFormat != nil { 14761 objectMap["properties"] = rnl.ResourceNavigationLinkFormat 14762 } 14763 if rnl.Name != nil { 14764 objectMap["name"] = rnl.Name 14765 } 14766 if rnl.ID != nil { 14767 objectMap["id"] = rnl.ID 14768 } 14769 return json.Marshal(objectMap) 14770} 14771 14772// UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct. 14773func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error { 14774 var m map[string]*json.RawMessage 14775 err := json.Unmarshal(body, &m) 14776 if err != nil { 14777 return err 14778 } 14779 for k, v := range m { 14780 switch k { 14781 case "properties": 14782 if v != nil { 14783 var resourceNavigationLinkFormat ResourceNavigationLinkFormat 14784 err = json.Unmarshal(*v, &resourceNavigationLinkFormat) 14785 if err != nil { 14786 return err 14787 } 14788 rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat 14789 } 14790 case "name": 14791 if v != nil { 14792 var name string 14793 err = json.Unmarshal(*v, &name) 14794 if err != nil { 14795 return err 14796 } 14797 rnl.Name = &name 14798 } 14799 case "etag": 14800 if v != nil { 14801 var etag string 14802 err = json.Unmarshal(*v, &etag) 14803 if err != nil { 14804 return err 14805 } 14806 rnl.Etag = &etag 14807 } 14808 case "id": 14809 if v != nil { 14810 var ID string 14811 err = json.Unmarshal(*v, &ID) 14812 if err != nil { 14813 return err 14814 } 14815 rnl.ID = &ID 14816 } 14817 } 14818 } 14819 14820 return nil 14821} 14822 14823// ResourceNavigationLinkFormat properties of ResourceNavigationLink. 14824type ResourceNavigationLinkFormat struct { 14825 // LinkedResourceType - Resource type of the linked resource. 14826 LinkedResourceType *string `json:"linkedResourceType,omitempty"` 14827 // Link - Link to the external resource 14828 Link *string `json:"link,omitempty"` 14829 // ProvisioningState - READ-ONLY; Provisioning state of the ResourceNavigationLink resource. 14830 ProvisioningState *string `json:"provisioningState,omitempty"` 14831} 14832 14833// MarshalJSON is the custom marshaler for ResourceNavigationLinkFormat. 14834func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { 14835 objectMap := make(map[string]interface{}) 14836 if rnlf.LinkedResourceType != nil { 14837 objectMap["linkedResourceType"] = rnlf.LinkedResourceType 14838 } 14839 if rnlf.Link != nil { 14840 objectMap["link"] = rnlf.Link 14841 } 14842 return json.Marshal(objectMap) 14843} 14844 14845// RetentionPolicyParameters parameters that define the retention policy for flow log. 14846type RetentionPolicyParameters struct { 14847 // Days - Number of days to retain flow log records. 14848 Days *int32 `json:"days,omitempty"` 14849 // Enabled - Flag to enable/disable retention. 14850 Enabled *bool `json:"enabled,omitempty"` 14851} 14852 14853// Route route resource 14854type Route struct { 14855 autorest.Response `json:"-"` 14856 // RoutePropertiesFormat - Properties of the route. 14857 *RoutePropertiesFormat `json:"properties,omitempty"` 14858 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 14859 Name *string `json:"name,omitempty"` 14860 // Etag - A unique read-only string that changes whenever the resource is updated. 14861 Etag *string `json:"etag,omitempty"` 14862 // ID - Resource ID. 14863 ID *string `json:"id,omitempty"` 14864} 14865 14866// MarshalJSON is the custom marshaler for Route. 14867func (r Route) MarshalJSON() ([]byte, error) { 14868 objectMap := make(map[string]interface{}) 14869 if r.RoutePropertiesFormat != nil { 14870 objectMap["properties"] = r.RoutePropertiesFormat 14871 } 14872 if r.Name != nil { 14873 objectMap["name"] = r.Name 14874 } 14875 if r.Etag != nil { 14876 objectMap["etag"] = r.Etag 14877 } 14878 if r.ID != nil { 14879 objectMap["id"] = r.ID 14880 } 14881 return json.Marshal(objectMap) 14882} 14883 14884// UnmarshalJSON is the custom unmarshaler for Route struct. 14885func (r *Route) UnmarshalJSON(body []byte) error { 14886 var m map[string]*json.RawMessage 14887 err := json.Unmarshal(body, &m) 14888 if err != nil { 14889 return err 14890 } 14891 for k, v := range m { 14892 switch k { 14893 case "properties": 14894 if v != nil { 14895 var routePropertiesFormat RoutePropertiesFormat 14896 err = json.Unmarshal(*v, &routePropertiesFormat) 14897 if err != nil { 14898 return err 14899 } 14900 r.RoutePropertiesFormat = &routePropertiesFormat 14901 } 14902 case "name": 14903 if v != nil { 14904 var name string 14905 err = json.Unmarshal(*v, &name) 14906 if err != nil { 14907 return err 14908 } 14909 r.Name = &name 14910 } 14911 case "etag": 14912 if v != nil { 14913 var etag string 14914 err = json.Unmarshal(*v, &etag) 14915 if err != nil { 14916 return err 14917 } 14918 r.Etag = &etag 14919 } 14920 case "id": 14921 if v != nil { 14922 var ID string 14923 err = json.Unmarshal(*v, &ID) 14924 if err != nil { 14925 return err 14926 } 14927 r.ID = &ID 14928 } 14929 } 14930 } 14931 14932 return nil 14933} 14934 14935// RouteFilter route Filter Resource. 14936type RouteFilter struct { 14937 autorest.Response `json:"-"` 14938 *RouteFilterPropertiesFormat `json:"properties,omitempty"` 14939 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 14940 Etag *string `json:"etag,omitempty"` 14941 // ID - Resource ID. 14942 ID *string `json:"id,omitempty"` 14943 // Name - READ-ONLY; Resource name. 14944 Name *string `json:"name,omitempty"` 14945 // Type - READ-ONLY; Resource type. 14946 Type *string `json:"type,omitempty"` 14947 // Location - Resource location. 14948 Location *string `json:"location,omitempty"` 14949 // Tags - Resource tags. 14950 Tags map[string]*string `json:"tags"` 14951} 14952 14953// MarshalJSON is the custom marshaler for RouteFilter. 14954func (rf RouteFilter) MarshalJSON() ([]byte, error) { 14955 objectMap := make(map[string]interface{}) 14956 if rf.RouteFilterPropertiesFormat != nil { 14957 objectMap["properties"] = rf.RouteFilterPropertiesFormat 14958 } 14959 if rf.ID != nil { 14960 objectMap["id"] = rf.ID 14961 } 14962 if rf.Location != nil { 14963 objectMap["location"] = rf.Location 14964 } 14965 if rf.Tags != nil { 14966 objectMap["tags"] = rf.Tags 14967 } 14968 return json.Marshal(objectMap) 14969} 14970 14971// UnmarshalJSON is the custom unmarshaler for RouteFilter struct. 14972func (rf *RouteFilter) UnmarshalJSON(body []byte) error { 14973 var m map[string]*json.RawMessage 14974 err := json.Unmarshal(body, &m) 14975 if err != nil { 14976 return err 14977 } 14978 for k, v := range m { 14979 switch k { 14980 case "properties": 14981 if v != nil { 14982 var routeFilterPropertiesFormat RouteFilterPropertiesFormat 14983 err = json.Unmarshal(*v, &routeFilterPropertiesFormat) 14984 if err != nil { 14985 return err 14986 } 14987 rf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat 14988 } 14989 case "etag": 14990 if v != nil { 14991 var etag string 14992 err = json.Unmarshal(*v, &etag) 14993 if err != nil { 14994 return err 14995 } 14996 rf.Etag = &etag 14997 } 14998 case "id": 14999 if v != nil { 15000 var ID string 15001 err = json.Unmarshal(*v, &ID) 15002 if err != nil { 15003 return err 15004 } 15005 rf.ID = &ID 15006 } 15007 case "name": 15008 if v != nil { 15009 var name string 15010 err = json.Unmarshal(*v, &name) 15011 if err != nil { 15012 return err 15013 } 15014 rf.Name = &name 15015 } 15016 case "type": 15017 if v != nil { 15018 var typeVar string 15019 err = json.Unmarshal(*v, &typeVar) 15020 if err != nil { 15021 return err 15022 } 15023 rf.Type = &typeVar 15024 } 15025 case "location": 15026 if v != nil { 15027 var location string 15028 err = json.Unmarshal(*v, &location) 15029 if err != nil { 15030 return err 15031 } 15032 rf.Location = &location 15033 } 15034 case "tags": 15035 if v != nil { 15036 var tags map[string]*string 15037 err = json.Unmarshal(*v, &tags) 15038 if err != nil { 15039 return err 15040 } 15041 rf.Tags = tags 15042 } 15043 } 15044 } 15045 15046 return nil 15047} 15048 15049// RouteFilterListResult response for the ListRouteFilters API service call. 15050type RouteFilterListResult struct { 15051 autorest.Response `json:"-"` 15052 // Value - Gets a list of route filters in a resource group. 15053 Value *[]RouteFilter `json:"value,omitempty"` 15054 // NextLink - The URL to get the next set of results. 15055 NextLink *string `json:"nextLink,omitempty"` 15056} 15057 15058// RouteFilterListResultIterator provides access to a complete listing of RouteFilter values. 15059type RouteFilterListResultIterator struct { 15060 i int 15061 page RouteFilterListResultPage 15062} 15063 15064// NextWithContext advances to the next value. If there was an error making 15065// the request the iterator does not advance and the error is returned. 15066func (iter *RouteFilterListResultIterator) NextWithContext(ctx context.Context) (err error) { 15067 if tracing.IsEnabled() { 15068 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultIterator.NextWithContext") 15069 defer func() { 15070 sc := -1 15071 if iter.Response().Response.Response != nil { 15072 sc = iter.Response().Response.Response.StatusCode 15073 } 15074 tracing.EndSpan(ctx, sc, err) 15075 }() 15076 } 15077 iter.i++ 15078 if iter.i < len(iter.page.Values()) { 15079 return nil 15080 } 15081 err = iter.page.NextWithContext(ctx) 15082 if err != nil { 15083 iter.i-- 15084 return err 15085 } 15086 iter.i = 0 15087 return nil 15088} 15089 15090// Next advances to the next value. If there was an error making 15091// the request the iterator does not advance and the error is returned. 15092// Deprecated: Use NextWithContext() instead. 15093func (iter *RouteFilterListResultIterator) Next() error { 15094 return iter.NextWithContext(context.Background()) 15095} 15096 15097// NotDone returns true if the enumeration should be started or is not yet complete. 15098func (iter RouteFilterListResultIterator) NotDone() bool { 15099 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15100} 15101 15102// Response returns the raw server response from the last page request. 15103func (iter RouteFilterListResultIterator) Response() RouteFilterListResult { 15104 return iter.page.Response() 15105} 15106 15107// Value returns the current value or a zero-initialized value if the 15108// iterator has advanced beyond the end of the collection. 15109func (iter RouteFilterListResultIterator) Value() RouteFilter { 15110 if !iter.page.NotDone() { 15111 return RouteFilter{} 15112 } 15113 return iter.page.Values()[iter.i] 15114} 15115 15116// Creates a new instance of the RouteFilterListResultIterator type. 15117func NewRouteFilterListResultIterator(page RouteFilterListResultPage) RouteFilterListResultIterator { 15118 return RouteFilterListResultIterator{page: page} 15119} 15120 15121// IsEmpty returns true if the ListResult contains no values. 15122func (rflr RouteFilterListResult) IsEmpty() bool { 15123 return rflr.Value == nil || len(*rflr.Value) == 0 15124} 15125 15126// hasNextLink returns true if the NextLink is not empty. 15127func (rflr RouteFilterListResult) hasNextLink() bool { 15128 return rflr.NextLink != nil && len(*rflr.NextLink) != 0 15129} 15130 15131// routeFilterListResultPreparer prepares a request to retrieve the next set of results. 15132// It returns nil if no more results exist. 15133func (rflr RouteFilterListResult) routeFilterListResultPreparer(ctx context.Context) (*http.Request, error) { 15134 if !rflr.hasNextLink() { 15135 return nil, nil 15136 } 15137 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15138 autorest.AsJSON(), 15139 autorest.AsGet(), 15140 autorest.WithBaseURL(to.String(rflr.NextLink))) 15141} 15142 15143// RouteFilterListResultPage contains a page of RouteFilter values. 15144type RouteFilterListResultPage struct { 15145 fn func(context.Context, RouteFilterListResult) (RouteFilterListResult, error) 15146 rflr RouteFilterListResult 15147} 15148 15149// NextWithContext advances to the next page of values. If there was an error making 15150// the request the page does not advance and the error is returned. 15151func (page *RouteFilterListResultPage) NextWithContext(ctx context.Context) (err error) { 15152 if tracing.IsEnabled() { 15153 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultPage.NextWithContext") 15154 defer func() { 15155 sc := -1 15156 if page.Response().Response.Response != nil { 15157 sc = page.Response().Response.Response.StatusCode 15158 } 15159 tracing.EndSpan(ctx, sc, err) 15160 }() 15161 } 15162 for { 15163 next, err := page.fn(ctx, page.rflr) 15164 if err != nil { 15165 return err 15166 } 15167 page.rflr = next 15168 if !next.hasNextLink() || !next.IsEmpty() { 15169 break 15170 } 15171 } 15172 return nil 15173} 15174 15175// Next advances to the next page of values. If there was an error making 15176// the request the page does not advance and the error is returned. 15177// Deprecated: Use NextWithContext() instead. 15178func (page *RouteFilterListResultPage) Next() error { 15179 return page.NextWithContext(context.Background()) 15180} 15181 15182// NotDone returns true if the page enumeration should be started or is not yet complete. 15183func (page RouteFilterListResultPage) NotDone() bool { 15184 return !page.rflr.IsEmpty() 15185} 15186 15187// Response returns the raw server response from the last page request. 15188func (page RouteFilterListResultPage) Response() RouteFilterListResult { 15189 return page.rflr 15190} 15191 15192// Values returns the slice of values for the current page or nil if there are no values. 15193func (page RouteFilterListResultPage) Values() []RouteFilter { 15194 if page.rflr.IsEmpty() { 15195 return nil 15196 } 15197 return *page.rflr.Value 15198} 15199 15200// Creates a new instance of the RouteFilterListResultPage type. 15201func NewRouteFilterListResultPage(cur RouteFilterListResult, getNextPage func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)) RouteFilterListResultPage { 15202 return RouteFilterListResultPage{ 15203 fn: getNextPage, 15204 rflr: cur, 15205 } 15206} 15207 15208// RouteFilterPropertiesFormat route Filter Resource 15209type RouteFilterPropertiesFormat struct { 15210 // Rules - Collection of RouteFilterRules contained within a route filter. 15211 Rules *[]RouteFilterRule `json:"rules,omitempty"` 15212 // Peerings - A collection of references to express route circuit peerings. 15213 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` 15214 // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. 15215 ProvisioningState *string `json:"provisioningState,omitempty"` 15216} 15217 15218// MarshalJSON is the custom marshaler for RouteFilterPropertiesFormat. 15219func (rfpf RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) { 15220 objectMap := make(map[string]interface{}) 15221 if rfpf.Rules != nil { 15222 objectMap["rules"] = rfpf.Rules 15223 } 15224 if rfpf.Peerings != nil { 15225 objectMap["peerings"] = rfpf.Peerings 15226 } 15227 return json.Marshal(objectMap) 15228} 15229 15230// RouteFilterRule route Filter Rule Resource 15231type RouteFilterRule struct { 15232 autorest.Response `json:"-"` 15233 *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` 15234 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 15235 Name *string `json:"name,omitempty"` 15236 // Location - Resource location. 15237 Location *string `json:"location,omitempty"` 15238 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 15239 Etag *string `json:"etag,omitempty"` 15240 // ID - Resource ID. 15241 ID *string `json:"id,omitempty"` 15242} 15243 15244// MarshalJSON is the custom marshaler for RouteFilterRule. 15245func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) { 15246 objectMap := make(map[string]interface{}) 15247 if rfr.RouteFilterRulePropertiesFormat != nil { 15248 objectMap["properties"] = rfr.RouteFilterRulePropertiesFormat 15249 } 15250 if rfr.Name != nil { 15251 objectMap["name"] = rfr.Name 15252 } 15253 if rfr.Location != nil { 15254 objectMap["location"] = rfr.Location 15255 } 15256 if rfr.ID != nil { 15257 objectMap["id"] = rfr.ID 15258 } 15259 return json.Marshal(objectMap) 15260} 15261 15262// UnmarshalJSON is the custom unmarshaler for RouteFilterRule struct. 15263func (rfr *RouteFilterRule) UnmarshalJSON(body []byte) error { 15264 var m map[string]*json.RawMessage 15265 err := json.Unmarshal(body, &m) 15266 if err != nil { 15267 return err 15268 } 15269 for k, v := range m { 15270 switch k { 15271 case "properties": 15272 if v != nil { 15273 var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat 15274 err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) 15275 if err != nil { 15276 return err 15277 } 15278 rfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat 15279 } 15280 case "name": 15281 if v != nil { 15282 var name string 15283 err = json.Unmarshal(*v, &name) 15284 if err != nil { 15285 return err 15286 } 15287 rfr.Name = &name 15288 } 15289 case "location": 15290 if v != nil { 15291 var location string 15292 err = json.Unmarshal(*v, &location) 15293 if err != nil { 15294 return err 15295 } 15296 rfr.Location = &location 15297 } 15298 case "etag": 15299 if v != nil { 15300 var etag string 15301 err = json.Unmarshal(*v, &etag) 15302 if err != nil { 15303 return err 15304 } 15305 rfr.Etag = &etag 15306 } 15307 case "id": 15308 if v != nil { 15309 var ID string 15310 err = json.Unmarshal(*v, &ID) 15311 if err != nil { 15312 return err 15313 } 15314 rfr.ID = &ID 15315 } 15316 } 15317 } 15318 15319 return nil 15320} 15321 15322// RouteFilterRuleListResult response for the ListRouteFilterRules API service call 15323type RouteFilterRuleListResult struct { 15324 autorest.Response `json:"-"` 15325 // Value - Gets a list of RouteFilterRules in a resource group. 15326 Value *[]RouteFilterRule `json:"value,omitempty"` 15327 // NextLink - The URL to get the next set of results. 15328 NextLink *string `json:"nextLink,omitempty"` 15329} 15330 15331// RouteFilterRuleListResultIterator provides access to a complete listing of RouteFilterRule values. 15332type RouteFilterRuleListResultIterator struct { 15333 i int 15334 page RouteFilterRuleListResultPage 15335} 15336 15337// NextWithContext advances to the next value. If there was an error making 15338// the request the iterator does not advance and the error is returned. 15339func (iter *RouteFilterRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 15340 if tracing.IsEnabled() { 15341 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultIterator.NextWithContext") 15342 defer func() { 15343 sc := -1 15344 if iter.Response().Response.Response != nil { 15345 sc = iter.Response().Response.Response.StatusCode 15346 } 15347 tracing.EndSpan(ctx, sc, err) 15348 }() 15349 } 15350 iter.i++ 15351 if iter.i < len(iter.page.Values()) { 15352 return nil 15353 } 15354 err = iter.page.NextWithContext(ctx) 15355 if err != nil { 15356 iter.i-- 15357 return err 15358 } 15359 iter.i = 0 15360 return nil 15361} 15362 15363// Next advances to the next value. If there was an error making 15364// the request the iterator does not advance and the error is returned. 15365// Deprecated: Use NextWithContext() instead. 15366func (iter *RouteFilterRuleListResultIterator) Next() error { 15367 return iter.NextWithContext(context.Background()) 15368} 15369 15370// NotDone returns true if the enumeration should be started or is not yet complete. 15371func (iter RouteFilterRuleListResultIterator) NotDone() bool { 15372 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15373} 15374 15375// Response returns the raw server response from the last page request. 15376func (iter RouteFilterRuleListResultIterator) Response() RouteFilterRuleListResult { 15377 return iter.page.Response() 15378} 15379 15380// Value returns the current value or a zero-initialized value if the 15381// iterator has advanced beyond the end of the collection. 15382func (iter RouteFilterRuleListResultIterator) Value() RouteFilterRule { 15383 if !iter.page.NotDone() { 15384 return RouteFilterRule{} 15385 } 15386 return iter.page.Values()[iter.i] 15387} 15388 15389// Creates a new instance of the RouteFilterRuleListResultIterator type. 15390func NewRouteFilterRuleListResultIterator(page RouteFilterRuleListResultPage) RouteFilterRuleListResultIterator { 15391 return RouteFilterRuleListResultIterator{page: page} 15392} 15393 15394// IsEmpty returns true if the ListResult contains no values. 15395func (rfrlr RouteFilterRuleListResult) IsEmpty() bool { 15396 return rfrlr.Value == nil || len(*rfrlr.Value) == 0 15397} 15398 15399// hasNextLink returns true if the NextLink is not empty. 15400func (rfrlr RouteFilterRuleListResult) hasNextLink() bool { 15401 return rfrlr.NextLink != nil && len(*rfrlr.NextLink) != 0 15402} 15403 15404// routeFilterRuleListResultPreparer prepares a request to retrieve the next set of results. 15405// It returns nil if no more results exist. 15406func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer(ctx context.Context) (*http.Request, error) { 15407 if !rfrlr.hasNextLink() { 15408 return nil, nil 15409 } 15410 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15411 autorest.AsJSON(), 15412 autorest.AsGet(), 15413 autorest.WithBaseURL(to.String(rfrlr.NextLink))) 15414} 15415 15416// RouteFilterRuleListResultPage contains a page of RouteFilterRule values. 15417type RouteFilterRuleListResultPage struct { 15418 fn func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error) 15419 rfrlr RouteFilterRuleListResult 15420} 15421 15422// NextWithContext advances to the next page of values. If there was an error making 15423// the request the page does not advance and the error is returned. 15424func (page *RouteFilterRuleListResultPage) NextWithContext(ctx context.Context) (err error) { 15425 if tracing.IsEnabled() { 15426 ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultPage.NextWithContext") 15427 defer func() { 15428 sc := -1 15429 if page.Response().Response.Response != nil { 15430 sc = page.Response().Response.Response.StatusCode 15431 } 15432 tracing.EndSpan(ctx, sc, err) 15433 }() 15434 } 15435 for { 15436 next, err := page.fn(ctx, page.rfrlr) 15437 if err != nil { 15438 return err 15439 } 15440 page.rfrlr = next 15441 if !next.hasNextLink() || !next.IsEmpty() { 15442 break 15443 } 15444 } 15445 return nil 15446} 15447 15448// Next advances to the next page of values. If there was an error making 15449// the request the page does not advance and the error is returned. 15450// Deprecated: Use NextWithContext() instead. 15451func (page *RouteFilterRuleListResultPage) Next() error { 15452 return page.NextWithContext(context.Background()) 15453} 15454 15455// NotDone returns true if the page enumeration should be started or is not yet complete. 15456func (page RouteFilterRuleListResultPage) NotDone() bool { 15457 return !page.rfrlr.IsEmpty() 15458} 15459 15460// Response returns the raw server response from the last page request. 15461func (page RouteFilterRuleListResultPage) Response() RouteFilterRuleListResult { 15462 return page.rfrlr 15463} 15464 15465// Values returns the slice of values for the current page or nil if there are no values. 15466func (page RouteFilterRuleListResultPage) Values() []RouteFilterRule { 15467 if page.rfrlr.IsEmpty() { 15468 return nil 15469 } 15470 return *page.rfrlr.Value 15471} 15472 15473// Creates a new instance of the RouteFilterRuleListResultPage type. 15474func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)) RouteFilterRuleListResultPage { 15475 return RouteFilterRuleListResultPage{ 15476 fn: getNextPage, 15477 rfrlr: cur, 15478 } 15479} 15480 15481// RouteFilterRulePropertiesFormat route Filter Rule Resource 15482type RouteFilterRulePropertiesFormat struct { 15483 // Access - The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' 15484 Access Access `json:"access,omitempty"` 15485 // RouteFilterRuleType - The rule type of the rule. Valid value is: 'Community' 15486 RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"` 15487 // Communities - The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020'] 15488 Communities *[]string `json:"communities,omitempty"` 15489 // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. 15490 ProvisioningState *string `json:"provisioningState,omitempty"` 15491} 15492 15493// MarshalJSON is the custom marshaler for RouteFilterRulePropertiesFormat. 15494func (rfrpf RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) { 15495 objectMap := make(map[string]interface{}) 15496 if rfrpf.Access != "" { 15497 objectMap["access"] = rfrpf.Access 15498 } 15499 if rfrpf.RouteFilterRuleType != nil { 15500 objectMap["routeFilterRuleType"] = rfrpf.RouteFilterRuleType 15501 } 15502 if rfrpf.Communities != nil { 15503 objectMap["communities"] = rfrpf.Communities 15504 } 15505 return json.Marshal(objectMap) 15506} 15507 15508// RouteFilterRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 15509// long-running operation. 15510type RouteFilterRulesCreateOrUpdateFuture struct { 15511 azure.FutureAPI 15512 // Result returns the result of the asynchronous operation. 15513 // If the operation has not completed it will return an error. 15514 Result func(RouteFilterRulesClient) (RouteFilterRule, error) 15515} 15516 15517// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15518func (future *RouteFilterRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 15519 var azFuture azure.Future 15520 if err := json.Unmarshal(body, &azFuture); err != nil { 15521 return err 15522 } 15523 future.FutureAPI = &azFuture 15524 future.Result = future.result 15525 return nil 15526} 15527 15528// result is the default implementation for RouteFilterRulesCreateOrUpdateFuture.Result. 15529func (future *RouteFilterRulesCreateOrUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { 15530 var done bool 15531 done, err = future.DoneWithContext(context.Background(), client) 15532 if err != nil { 15533 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 15534 return 15535 } 15536 if !done { 15537 rfr.Response.Response = future.Response() 15538 err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture") 15539 return 15540 } 15541 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15542 if rfr.Response.Response, err = future.GetResult(sender); err == nil && rfr.Response.Response.StatusCode != http.StatusNoContent { 15543 rfr, err = client.CreateOrUpdateResponder(rfr.Response.Response) 15544 if err != nil { 15545 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", rfr.Response.Response, "Failure responding to request") 15546 } 15547 } 15548 return 15549} 15550 15551// RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 15552// operation. 15553type RouteFilterRulesDeleteFuture struct { 15554 azure.FutureAPI 15555 // Result returns the result of the asynchronous operation. 15556 // If the operation has not completed it will return an error. 15557 Result func(RouteFilterRulesClient) (autorest.Response, error) 15558} 15559 15560// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15561func (future *RouteFilterRulesDeleteFuture) UnmarshalJSON(body []byte) error { 15562 var azFuture azure.Future 15563 if err := json.Unmarshal(body, &azFuture); err != nil { 15564 return err 15565 } 15566 future.FutureAPI = &azFuture 15567 future.Result = future.result 15568 return nil 15569} 15570 15571// result is the default implementation for RouteFilterRulesDeleteFuture.Result. 15572func (future *RouteFilterRulesDeleteFuture) result(client RouteFilterRulesClient) (ar autorest.Response, err error) { 15573 var done bool 15574 done, err = future.DoneWithContext(context.Background(), client) 15575 if err != nil { 15576 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure") 15577 return 15578 } 15579 if !done { 15580 ar.Response = future.Response() 15581 err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture") 15582 return 15583 } 15584 ar.Response = future.Response() 15585 return 15586} 15587 15588// RouteFilterRulesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 15589// operation. 15590type RouteFilterRulesUpdateFuture struct { 15591 azure.FutureAPI 15592 // Result returns the result of the asynchronous operation. 15593 // If the operation has not completed it will return an error. 15594 Result func(RouteFilterRulesClient) (RouteFilterRule, error) 15595} 15596 15597// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15598func (future *RouteFilterRulesUpdateFuture) UnmarshalJSON(body []byte) error { 15599 var azFuture azure.Future 15600 if err := json.Unmarshal(body, &azFuture); err != nil { 15601 return err 15602 } 15603 future.FutureAPI = &azFuture 15604 future.Result = future.result 15605 return nil 15606} 15607 15608// result is the default implementation for RouteFilterRulesUpdateFuture.Result. 15609func (future *RouteFilterRulesUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { 15610 var done bool 15611 done, err = future.DoneWithContext(context.Background(), client) 15612 if err != nil { 15613 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", future.Response(), "Polling failure") 15614 return 15615 } 15616 if !done { 15617 rfr.Response.Response = future.Response() 15618 err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesUpdateFuture") 15619 return 15620 } 15621 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15622 if rfr.Response.Response, err = future.GetResult(sender); err == nil && rfr.Response.Response.StatusCode != http.StatusNoContent { 15623 rfr, err = client.UpdateResponder(rfr.Response.Response) 15624 if err != nil { 15625 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", rfr.Response.Response, "Failure responding to request") 15626 } 15627 } 15628 return 15629} 15630 15631// RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 15632// long-running operation. 15633type RouteFiltersCreateOrUpdateFuture struct { 15634 azure.FutureAPI 15635 // Result returns the result of the asynchronous operation. 15636 // If the operation has not completed it will return an error. 15637 Result func(RouteFiltersClient) (RouteFilter, error) 15638} 15639 15640// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15641func (future *RouteFiltersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 15642 var azFuture azure.Future 15643 if err := json.Unmarshal(body, &azFuture); err != nil { 15644 return err 15645 } 15646 future.FutureAPI = &azFuture 15647 future.Result = future.result 15648 return nil 15649} 15650 15651// result is the default implementation for RouteFiltersCreateOrUpdateFuture.Result. 15652func (future *RouteFiltersCreateOrUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) { 15653 var done bool 15654 done, err = future.DoneWithContext(context.Background(), client) 15655 if err != nil { 15656 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 15657 return 15658 } 15659 if !done { 15660 rf.Response.Response = future.Response() 15661 err = azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture") 15662 return 15663 } 15664 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15665 if rf.Response.Response, err = future.GetResult(sender); err == nil && rf.Response.Response.StatusCode != http.StatusNoContent { 15666 rf, err = client.CreateOrUpdateResponder(rf.Response.Response) 15667 if err != nil { 15668 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", rf.Response.Response, "Failure responding to request") 15669 } 15670 } 15671 return 15672} 15673 15674// RouteFiltersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 15675// operation. 15676type RouteFiltersDeleteFuture struct { 15677 azure.FutureAPI 15678 // Result returns the result of the asynchronous operation. 15679 // If the operation has not completed it will return an error. 15680 Result func(RouteFiltersClient) (autorest.Response, error) 15681} 15682 15683// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15684func (future *RouteFiltersDeleteFuture) UnmarshalJSON(body []byte) error { 15685 var azFuture azure.Future 15686 if err := json.Unmarshal(body, &azFuture); err != nil { 15687 return err 15688 } 15689 future.FutureAPI = &azFuture 15690 future.Result = future.result 15691 return nil 15692} 15693 15694// result is the default implementation for RouteFiltersDeleteFuture.Result. 15695func (future *RouteFiltersDeleteFuture) result(client RouteFiltersClient) (ar autorest.Response, err error) { 15696 var done bool 15697 done, err = future.DoneWithContext(context.Background(), client) 15698 if err != nil { 15699 err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure") 15700 return 15701 } 15702 if !done { 15703 ar.Response = future.Response() 15704 err = azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture") 15705 return 15706 } 15707 ar.Response = future.Response() 15708 return 15709} 15710 15711// RouteFiltersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 15712// operation. 15713type RouteFiltersUpdateFuture struct { 15714 azure.FutureAPI 15715 // Result returns the result of the asynchronous operation. 15716 // If the operation has not completed it will return an error. 15717 Result func(RouteFiltersClient) (RouteFilter, error) 15718} 15719 15720// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15721func (future *RouteFiltersUpdateFuture) UnmarshalJSON(body []byte) error { 15722 var azFuture azure.Future 15723 if err := json.Unmarshal(body, &azFuture); err != nil { 15724 return err 15725 } 15726 future.FutureAPI = &azFuture 15727 future.Result = future.result 15728 return nil 15729} 15730 15731// result is the default implementation for RouteFiltersUpdateFuture.Result. 15732func (future *RouteFiltersUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) { 15733 var done bool 15734 done, err = future.DoneWithContext(context.Background(), client) 15735 if err != nil { 15736 err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", future.Response(), "Polling failure") 15737 return 15738 } 15739 if !done { 15740 rf.Response.Response = future.Response() 15741 err = azure.NewAsyncOpIncompleteError("network.RouteFiltersUpdateFuture") 15742 return 15743 } 15744 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15745 if rf.Response.Response, err = future.GetResult(sender); err == nil && rf.Response.Response.StatusCode != http.StatusNoContent { 15746 rf, err = client.UpdateResponder(rf.Response.Response) 15747 if err != nil { 15748 err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", rf.Response.Response, "Failure responding to request") 15749 } 15750 } 15751 return 15752} 15753 15754// RouteListResult response for the ListRoute API service call 15755type RouteListResult struct { 15756 autorest.Response `json:"-"` 15757 // Value - Gets a list of routes in a resource group. 15758 Value *[]Route `json:"value,omitempty"` 15759 // NextLink - The URL to get the next set of results. 15760 NextLink *string `json:"nextLink,omitempty"` 15761} 15762 15763// RouteListResultIterator provides access to a complete listing of Route values. 15764type RouteListResultIterator struct { 15765 i int 15766 page RouteListResultPage 15767} 15768 15769// NextWithContext advances to the next value. If there was an error making 15770// the request the iterator does not advance and the error is returned. 15771func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) { 15772 if tracing.IsEnabled() { 15773 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext") 15774 defer func() { 15775 sc := -1 15776 if iter.Response().Response.Response != nil { 15777 sc = iter.Response().Response.Response.StatusCode 15778 } 15779 tracing.EndSpan(ctx, sc, err) 15780 }() 15781 } 15782 iter.i++ 15783 if iter.i < len(iter.page.Values()) { 15784 return nil 15785 } 15786 err = iter.page.NextWithContext(ctx) 15787 if err != nil { 15788 iter.i-- 15789 return err 15790 } 15791 iter.i = 0 15792 return nil 15793} 15794 15795// Next advances to the next value. If there was an error making 15796// the request the iterator does not advance and the error is returned. 15797// Deprecated: Use NextWithContext() instead. 15798func (iter *RouteListResultIterator) Next() error { 15799 return iter.NextWithContext(context.Background()) 15800} 15801 15802// NotDone returns true if the enumeration should be started or is not yet complete. 15803func (iter RouteListResultIterator) NotDone() bool { 15804 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 15805} 15806 15807// Response returns the raw server response from the last page request. 15808func (iter RouteListResultIterator) Response() RouteListResult { 15809 return iter.page.Response() 15810} 15811 15812// Value returns the current value or a zero-initialized value if the 15813// iterator has advanced beyond the end of the collection. 15814func (iter RouteListResultIterator) Value() Route { 15815 if !iter.page.NotDone() { 15816 return Route{} 15817 } 15818 return iter.page.Values()[iter.i] 15819} 15820 15821// Creates a new instance of the RouteListResultIterator type. 15822func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator { 15823 return RouteListResultIterator{page: page} 15824} 15825 15826// IsEmpty returns true if the ListResult contains no values. 15827func (rlr RouteListResult) IsEmpty() bool { 15828 return rlr.Value == nil || len(*rlr.Value) == 0 15829} 15830 15831// hasNextLink returns true if the NextLink is not empty. 15832func (rlr RouteListResult) hasNextLink() bool { 15833 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 15834} 15835 15836// routeListResultPreparer prepares a request to retrieve the next set of results. 15837// It returns nil if no more results exist. 15838func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { 15839 if !rlr.hasNextLink() { 15840 return nil, nil 15841 } 15842 return autorest.Prepare((&http.Request{}).WithContext(ctx), 15843 autorest.AsJSON(), 15844 autorest.AsGet(), 15845 autorest.WithBaseURL(to.String(rlr.NextLink))) 15846} 15847 15848// RouteListResultPage contains a page of Route values. 15849type RouteListResultPage struct { 15850 fn func(context.Context, RouteListResult) (RouteListResult, error) 15851 rlr RouteListResult 15852} 15853 15854// NextWithContext advances to the next page of values. If there was an error making 15855// the request the page does not advance and the error is returned. 15856func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) { 15857 if tracing.IsEnabled() { 15858 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext") 15859 defer func() { 15860 sc := -1 15861 if page.Response().Response.Response != nil { 15862 sc = page.Response().Response.Response.StatusCode 15863 } 15864 tracing.EndSpan(ctx, sc, err) 15865 }() 15866 } 15867 for { 15868 next, err := page.fn(ctx, page.rlr) 15869 if err != nil { 15870 return err 15871 } 15872 page.rlr = next 15873 if !next.hasNextLink() || !next.IsEmpty() { 15874 break 15875 } 15876 } 15877 return nil 15878} 15879 15880// Next advances to the next page of values. If there was an error making 15881// the request the page does not advance and the error is returned. 15882// Deprecated: Use NextWithContext() instead. 15883func (page *RouteListResultPage) Next() error { 15884 return page.NextWithContext(context.Background()) 15885} 15886 15887// NotDone returns true if the page enumeration should be started or is not yet complete. 15888func (page RouteListResultPage) NotDone() bool { 15889 return !page.rlr.IsEmpty() 15890} 15891 15892// Response returns the raw server response from the last page request. 15893func (page RouteListResultPage) Response() RouteListResult { 15894 return page.rlr 15895} 15896 15897// Values returns the slice of values for the current page or nil if there are no values. 15898func (page RouteListResultPage) Values() []Route { 15899 if page.rlr.IsEmpty() { 15900 return nil 15901 } 15902 return *page.rlr.Value 15903} 15904 15905// Creates a new instance of the RouteListResultPage type. 15906func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { 15907 return RouteListResultPage{ 15908 fn: getNextPage, 15909 rlr: cur, 15910 } 15911} 15912 15913// RoutePropertiesFormat route resource 15914type RoutePropertiesFormat struct { 15915 // AddressPrefix - The destination CIDR to which the route applies. 15916 AddressPrefix *string `json:"addressPrefix,omitempty"` 15917 // NextHopType - The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible values include: 'RouteNextHopTypeVirtualNetworkGateway', 'RouteNextHopTypeVnetLocal', 'RouteNextHopTypeInternet', 'RouteNextHopTypeVirtualAppliance', 'RouteNextHopTypeNone' 15918 NextHopType RouteNextHopType `json:"nextHopType,omitempty"` 15919 // NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. 15920 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` 15921 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 15922 ProvisioningState *string `json:"provisioningState,omitempty"` 15923} 15924 15925// RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 15926// operation. 15927type RoutesCreateOrUpdateFuture struct { 15928 azure.FutureAPI 15929 // Result returns the result of the asynchronous operation. 15930 // If the operation has not completed it will return an error. 15931 Result func(RoutesClient) (Route, error) 15932} 15933 15934// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15935func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 15936 var azFuture azure.Future 15937 if err := json.Unmarshal(body, &azFuture); err != nil { 15938 return err 15939 } 15940 future.FutureAPI = &azFuture 15941 future.Result = future.result 15942 return nil 15943} 15944 15945// result is the default implementation for RoutesCreateOrUpdateFuture.Result. 15946func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) { 15947 var done bool 15948 done, err = future.DoneWithContext(context.Background(), client) 15949 if err != nil { 15950 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 15951 return 15952 } 15953 if !done { 15954 r.Response.Response = future.Response() 15955 err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") 15956 return 15957 } 15958 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15959 if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { 15960 r, err = client.CreateOrUpdateResponder(r.Response.Response) 15961 if err != nil { 15962 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", r.Response.Response, "Failure responding to request") 15963 } 15964 } 15965 return 15966} 15967 15968// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 15969type RoutesDeleteFuture struct { 15970 azure.FutureAPI 15971 // Result returns the result of the asynchronous operation. 15972 // If the operation has not completed it will return an error. 15973 Result func(RoutesClient) (autorest.Response, error) 15974} 15975 15976// UnmarshalJSON is the custom unmarshaller for CreateFuture. 15977func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error { 15978 var azFuture azure.Future 15979 if err := json.Unmarshal(body, &azFuture); err != nil { 15980 return err 15981 } 15982 future.FutureAPI = &azFuture 15983 future.Result = future.result 15984 return nil 15985} 15986 15987// result is the default implementation for RoutesDeleteFuture.Result. 15988func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) { 15989 var done bool 15990 done, err = future.DoneWithContext(context.Background(), client) 15991 if err != nil { 15992 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure") 15993 return 15994 } 15995 if !done { 15996 ar.Response = future.Response() 15997 err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") 15998 return 15999 } 16000 ar.Response = future.Response() 16001 return 16002} 16003 16004// RouteTable route table resource. 16005type RouteTable struct { 16006 autorest.Response `json:"-"` 16007 // RouteTablePropertiesFormat - Properties of the route table. 16008 *RouteTablePropertiesFormat `json:"properties,omitempty"` 16009 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 16010 Etag *string `json:"etag,omitempty"` 16011 // ID - Resource ID. 16012 ID *string `json:"id,omitempty"` 16013 // Name - READ-ONLY; Resource name. 16014 Name *string `json:"name,omitempty"` 16015 // Type - READ-ONLY; Resource type. 16016 Type *string `json:"type,omitempty"` 16017 // Location - Resource location. 16018 Location *string `json:"location,omitempty"` 16019 // Tags - Resource tags. 16020 Tags map[string]*string `json:"tags"` 16021} 16022 16023// MarshalJSON is the custom marshaler for RouteTable. 16024func (rt RouteTable) MarshalJSON() ([]byte, error) { 16025 objectMap := make(map[string]interface{}) 16026 if rt.RouteTablePropertiesFormat != nil { 16027 objectMap["properties"] = rt.RouteTablePropertiesFormat 16028 } 16029 if rt.Etag != nil { 16030 objectMap["etag"] = rt.Etag 16031 } 16032 if rt.ID != nil { 16033 objectMap["id"] = rt.ID 16034 } 16035 if rt.Location != nil { 16036 objectMap["location"] = rt.Location 16037 } 16038 if rt.Tags != nil { 16039 objectMap["tags"] = rt.Tags 16040 } 16041 return json.Marshal(objectMap) 16042} 16043 16044// UnmarshalJSON is the custom unmarshaler for RouteTable struct. 16045func (rt *RouteTable) 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 routeTablePropertiesFormat RouteTablePropertiesFormat 16056 err = json.Unmarshal(*v, &routeTablePropertiesFormat) 16057 if err != nil { 16058 return err 16059 } 16060 rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat 16061 } 16062 case "etag": 16063 if v != nil { 16064 var etag string 16065 err = json.Unmarshal(*v, &etag) 16066 if err != nil { 16067 return err 16068 } 16069 rt.Etag = &etag 16070 } 16071 case "id": 16072 if v != nil { 16073 var ID string 16074 err = json.Unmarshal(*v, &ID) 16075 if err != nil { 16076 return err 16077 } 16078 rt.ID = &ID 16079 } 16080 case "name": 16081 if v != nil { 16082 var name string 16083 err = json.Unmarshal(*v, &name) 16084 if err != nil { 16085 return err 16086 } 16087 rt.Name = &name 16088 } 16089 case "type": 16090 if v != nil { 16091 var typeVar string 16092 err = json.Unmarshal(*v, &typeVar) 16093 if err != nil { 16094 return err 16095 } 16096 rt.Type = &typeVar 16097 } 16098 case "location": 16099 if v != nil { 16100 var location string 16101 err = json.Unmarshal(*v, &location) 16102 if err != nil { 16103 return err 16104 } 16105 rt.Location = &location 16106 } 16107 case "tags": 16108 if v != nil { 16109 var tags map[string]*string 16110 err = json.Unmarshal(*v, &tags) 16111 if err != nil { 16112 return err 16113 } 16114 rt.Tags = tags 16115 } 16116 } 16117 } 16118 16119 return nil 16120} 16121 16122// RouteTableListResult response for the ListRouteTable API service call. 16123type RouteTableListResult struct { 16124 autorest.Response `json:"-"` 16125 // Value - Gets a list of route tables in a resource group. 16126 Value *[]RouteTable `json:"value,omitempty"` 16127 // NextLink - The URL to get the next set of results. 16128 NextLink *string `json:"nextLink,omitempty"` 16129} 16130 16131// RouteTableListResultIterator provides access to a complete listing of RouteTable values. 16132type RouteTableListResultIterator struct { 16133 i int 16134 page RouteTableListResultPage 16135} 16136 16137// NextWithContext advances to the next value. If there was an error making 16138// the request the iterator does not advance and the error is returned. 16139func (iter *RouteTableListResultIterator) NextWithContext(ctx context.Context) (err error) { 16140 if tracing.IsEnabled() { 16141 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultIterator.NextWithContext") 16142 defer func() { 16143 sc := -1 16144 if iter.Response().Response.Response != nil { 16145 sc = iter.Response().Response.Response.StatusCode 16146 } 16147 tracing.EndSpan(ctx, sc, err) 16148 }() 16149 } 16150 iter.i++ 16151 if iter.i < len(iter.page.Values()) { 16152 return nil 16153 } 16154 err = iter.page.NextWithContext(ctx) 16155 if err != nil { 16156 iter.i-- 16157 return err 16158 } 16159 iter.i = 0 16160 return nil 16161} 16162 16163// Next advances to the next value. If there was an error making 16164// the request the iterator does not advance and the error is returned. 16165// Deprecated: Use NextWithContext() instead. 16166func (iter *RouteTableListResultIterator) Next() error { 16167 return iter.NextWithContext(context.Background()) 16168} 16169 16170// NotDone returns true if the enumeration should be started or is not yet complete. 16171func (iter RouteTableListResultIterator) NotDone() bool { 16172 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 16173} 16174 16175// Response returns the raw server response from the last page request. 16176func (iter RouteTableListResultIterator) Response() RouteTableListResult { 16177 return iter.page.Response() 16178} 16179 16180// Value returns the current value or a zero-initialized value if the 16181// iterator has advanced beyond the end of the collection. 16182func (iter RouteTableListResultIterator) Value() RouteTable { 16183 if !iter.page.NotDone() { 16184 return RouteTable{} 16185 } 16186 return iter.page.Values()[iter.i] 16187} 16188 16189// Creates a new instance of the RouteTableListResultIterator type. 16190func NewRouteTableListResultIterator(page RouteTableListResultPage) RouteTableListResultIterator { 16191 return RouteTableListResultIterator{page: page} 16192} 16193 16194// IsEmpty returns true if the ListResult contains no values. 16195func (rtlr RouteTableListResult) IsEmpty() bool { 16196 return rtlr.Value == nil || len(*rtlr.Value) == 0 16197} 16198 16199// hasNextLink returns true if the NextLink is not empty. 16200func (rtlr RouteTableListResult) hasNextLink() bool { 16201 return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0 16202} 16203 16204// routeTableListResultPreparer prepares a request to retrieve the next set of results. 16205// It returns nil if no more results exist. 16206func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) { 16207 if !rtlr.hasNextLink() { 16208 return nil, nil 16209 } 16210 return autorest.Prepare((&http.Request{}).WithContext(ctx), 16211 autorest.AsJSON(), 16212 autorest.AsGet(), 16213 autorest.WithBaseURL(to.String(rtlr.NextLink))) 16214} 16215 16216// RouteTableListResultPage contains a page of RouteTable values. 16217type RouteTableListResultPage struct { 16218 fn func(context.Context, RouteTableListResult) (RouteTableListResult, error) 16219 rtlr RouteTableListResult 16220} 16221 16222// NextWithContext advances to the next page of values. If there was an error making 16223// the request the page does not advance and the error is returned. 16224func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err error) { 16225 if tracing.IsEnabled() { 16226 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultPage.NextWithContext") 16227 defer func() { 16228 sc := -1 16229 if page.Response().Response.Response != nil { 16230 sc = page.Response().Response.Response.StatusCode 16231 } 16232 tracing.EndSpan(ctx, sc, err) 16233 }() 16234 } 16235 for { 16236 next, err := page.fn(ctx, page.rtlr) 16237 if err != nil { 16238 return err 16239 } 16240 page.rtlr = next 16241 if !next.hasNextLink() || !next.IsEmpty() { 16242 break 16243 } 16244 } 16245 return nil 16246} 16247 16248// Next advances to the next page of values. If there was an error making 16249// the request the page does not advance and the error is returned. 16250// Deprecated: Use NextWithContext() instead. 16251func (page *RouteTableListResultPage) Next() error { 16252 return page.NextWithContext(context.Background()) 16253} 16254 16255// NotDone returns true if the page enumeration should be started or is not yet complete. 16256func (page RouteTableListResultPage) NotDone() bool { 16257 return !page.rtlr.IsEmpty() 16258} 16259 16260// Response returns the raw server response from the last page request. 16261func (page RouteTableListResultPage) Response() RouteTableListResult { 16262 return page.rtlr 16263} 16264 16265// Values returns the slice of values for the current page or nil if there are no values. 16266func (page RouteTableListResultPage) Values() []RouteTable { 16267 if page.rtlr.IsEmpty() { 16268 return nil 16269 } 16270 return *page.rtlr.Value 16271} 16272 16273// Creates a new instance of the RouteTableListResultPage type. 16274func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage { 16275 return RouteTableListResultPage{ 16276 fn: getNextPage, 16277 rtlr: cur, 16278 } 16279} 16280 16281// RouteTablePropertiesFormat route Table resource 16282type RouteTablePropertiesFormat struct { 16283 // Routes - Collection of routes contained within a route table. 16284 Routes *[]Route `json:"routes,omitempty"` 16285 // Subnets - READ-ONLY; A collection of references to subnets. 16286 Subnets *[]Subnet `json:"subnets,omitempty"` 16287 // DisableBgpRoutePropagation - Gets or sets whether to disable the routes learned by BGP on that route table. True means disable. 16288 DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` 16289 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 16290 ProvisioningState *string `json:"provisioningState,omitempty"` 16291} 16292 16293// MarshalJSON is the custom marshaler for RouteTablePropertiesFormat. 16294func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { 16295 objectMap := make(map[string]interface{}) 16296 if rtpf.Routes != nil { 16297 objectMap["routes"] = rtpf.Routes 16298 } 16299 if rtpf.DisableBgpRoutePropagation != nil { 16300 objectMap["disableBgpRoutePropagation"] = rtpf.DisableBgpRoutePropagation 16301 } 16302 if rtpf.ProvisioningState != nil { 16303 objectMap["provisioningState"] = rtpf.ProvisioningState 16304 } 16305 return json.Marshal(objectMap) 16306} 16307 16308// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 16309// long-running operation. 16310type RouteTablesCreateOrUpdateFuture struct { 16311 azure.FutureAPI 16312 // Result returns the result of the asynchronous operation. 16313 // If the operation has not completed it will return an error. 16314 Result func(RouteTablesClient) (RouteTable, error) 16315} 16316 16317// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16318func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 16319 var azFuture azure.Future 16320 if err := json.Unmarshal(body, &azFuture); err != nil { 16321 return err 16322 } 16323 future.FutureAPI = &azFuture 16324 future.Result = future.result 16325 return nil 16326} 16327 16328// result is the default implementation for RouteTablesCreateOrUpdateFuture.Result. 16329func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) { 16330 var done bool 16331 done, err = future.DoneWithContext(context.Background(), client) 16332 if err != nil { 16333 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 16334 return 16335 } 16336 if !done { 16337 rt.Response.Response = future.Response() 16338 err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") 16339 return 16340 } 16341 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16342 if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { 16343 rt, err = client.CreateOrUpdateResponder(rt.Response.Response) 16344 if err != nil { 16345 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request") 16346 } 16347 } 16348 return 16349} 16350 16351// RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 16352// operation. 16353type RouteTablesDeleteFuture struct { 16354 azure.FutureAPI 16355 // Result returns the result of the asynchronous operation. 16356 // If the operation has not completed it will return an error. 16357 Result func(RouteTablesClient) (autorest.Response, error) 16358} 16359 16360// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16361func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { 16362 var azFuture azure.Future 16363 if err := json.Unmarshal(body, &azFuture); err != nil { 16364 return err 16365 } 16366 future.FutureAPI = &azFuture 16367 future.Result = future.result 16368 return nil 16369} 16370 16371// result is the default implementation for RouteTablesDeleteFuture.Result. 16372func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) { 16373 var done bool 16374 done, err = future.DoneWithContext(context.Background(), client) 16375 if err != nil { 16376 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") 16377 return 16378 } 16379 if !done { 16380 ar.Response = future.Response() 16381 err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") 16382 return 16383 } 16384 ar.Response = future.Response() 16385 return 16386} 16387 16388// RouteTablesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running 16389// operation. 16390type RouteTablesUpdateTagsFuture struct { 16391 azure.FutureAPI 16392 // Result returns the result of the asynchronous operation. 16393 // If the operation has not completed it will return an error. 16394 Result func(RouteTablesClient) (RouteTable, error) 16395} 16396 16397// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16398func (future *RouteTablesUpdateTagsFuture) UnmarshalJSON(body []byte) error { 16399 var azFuture azure.Future 16400 if err := json.Unmarshal(body, &azFuture); err != nil { 16401 return err 16402 } 16403 future.FutureAPI = &azFuture 16404 future.Result = future.result 16405 return nil 16406} 16407 16408// result is the default implementation for RouteTablesUpdateTagsFuture.Result. 16409func (future *RouteTablesUpdateTagsFuture) result(client RouteTablesClient) (rt RouteTable, err error) { 16410 var done bool 16411 done, err = future.DoneWithContext(context.Background(), client) 16412 if err != nil { 16413 err = autorest.NewErrorWithError(err, "network.RouteTablesUpdateTagsFuture", "Result", future.Response(), "Polling failure") 16414 return 16415 } 16416 if !done { 16417 rt.Response.Response = future.Response() 16418 err = azure.NewAsyncOpIncompleteError("network.RouteTablesUpdateTagsFuture") 16419 return 16420 } 16421 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16422 if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { 16423 rt, err = client.UpdateTagsResponder(rt.Response.Response) 16424 if err != nil { 16425 err = autorest.NewErrorWithError(err, "network.RouteTablesUpdateTagsFuture", "Result", rt.Response.Response, "Failure responding to request") 16426 } 16427 } 16428 return 16429} 16430 16431// SecurityGroup networkSecurityGroup resource. 16432type SecurityGroup struct { 16433 autorest.Response `json:"-"` 16434 // SecurityGroupPropertiesFormat - Properties of the network security group 16435 *SecurityGroupPropertiesFormat `json:"properties,omitempty"` 16436 // Etag - A unique read-only string that changes whenever the resource is updated. 16437 Etag *string `json:"etag,omitempty"` 16438 // ID - Resource ID. 16439 ID *string `json:"id,omitempty"` 16440 // Name - READ-ONLY; Resource name. 16441 Name *string `json:"name,omitempty"` 16442 // Type - READ-ONLY; Resource type. 16443 Type *string `json:"type,omitempty"` 16444 // Location - Resource location. 16445 Location *string `json:"location,omitempty"` 16446 // Tags - Resource tags. 16447 Tags map[string]*string `json:"tags"` 16448} 16449 16450// MarshalJSON is the custom marshaler for SecurityGroup. 16451func (sg SecurityGroup) MarshalJSON() ([]byte, error) { 16452 objectMap := make(map[string]interface{}) 16453 if sg.SecurityGroupPropertiesFormat != nil { 16454 objectMap["properties"] = sg.SecurityGroupPropertiesFormat 16455 } 16456 if sg.Etag != nil { 16457 objectMap["etag"] = sg.Etag 16458 } 16459 if sg.ID != nil { 16460 objectMap["id"] = sg.ID 16461 } 16462 if sg.Location != nil { 16463 objectMap["location"] = sg.Location 16464 } 16465 if sg.Tags != nil { 16466 objectMap["tags"] = sg.Tags 16467 } 16468 return json.Marshal(objectMap) 16469} 16470 16471// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. 16472func (sg *SecurityGroup) UnmarshalJSON(body []byte) error { 16473 var m map[string]*json.RawMessage 16474 err := json.Unmarshal(body, &m) 16475 if err != nil { 16476 return err 16477 } 16478 for k, v := range m { 16479 switch k { 16480 case "properties": 16481 if v != nil { 16482 var securityGroupPropertiesFormat SecurityGroupPropertiesFormat 16483 err = json.Unmarshal(*v, &securityGroupPropertiesFormat) 16484 if err != nil { 16485 return err 16486 } 16487 sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat 16488 } 16489 case "etag": 16490 if v != nil { 16491 var etag string 16492 err = json.Unmarshal(*v, &etag) 16493 if err != nil { 16494 return err 16495 } 16496 sg.Etag = &etag 16497 } 16498 case "id": 16499 if v != nil { 16500 var ID string 16501 err = json.Unmarshal(*v, &ID) 16502 if err != nil { 16503 return err 16504 } 16505 sg.ID = &ID 16506 } 16507 case "name": 16508 if v != nil { 16509 var name string 16510 err = json.Unmarshal(*v, &name) 16511 if err != nil { 16512 return err 16513 } 16514 sg.Name = &name 16515 } 16516 case "type": 16517 if v != nil { 16518 var typeVar string 16519 err = json.Unmarshal(*v, &typeVar) 16520 if err != nil { 16521 return err 16522 } 16523 sg.Type = &typeVar 16524 } 16525 case "location": 16526 if v != nil { 16527 var location string 16528 err = json.Unmarshal(*v, &location) 16529 if err != nil { 16530 return err 16531 } 16532 sg.Location = &location 16533 } 16534 case "tags": 16535 if v != nil { 16536 var tags map[string]*string 16537 err = json.Unmarshal(*v, &tags) 16538 if err != nil { 16539 return err 16540 } 16541 sg.Tags = tags 16542 } 16543 } 16544 } 16545 16546 return nil 16547} 16548 16549// SecurityGroupListResult response for ListNetworkSecurityGroups API service call. 16550type SecurityGroupListResult struct { 16551 autorest.Response `json:"-"` 16552 // Value - A list of NetworkSecurityGroup resources. 16553 Value *[]SecurityGroup `json:"value,omitempty"` 16554 // NextLink - The URL to get the next set of results. 16555 NextLink *string `json:"nextLink,omitempty"` 16556} 16557 16558// SecurityGroupListResultIterator provides access to a complete listing of SecurityGroup values. 16559type SecurityGroupListResultIterator struct { 16560 i int 16561 page SecurityGroupListResultPage 16562} 16563 16564// NextWithContext advances to the next value. If there was an error making 16565// the request the iterator does not advance and the error is returned. 16566func (iter *SecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 16567 if tracing.IsEnabled() { 16568 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultIterator.NextWithContext") 16569 defer func() { 16570 sc := -1 16571 if iter.Response().Response.Response != nil { 16572 sc = iter.Response().Response.Response.StatusCode 16573 } 16574 tracing.EndSpan(ctx, sc, err) 16575 }() 16576 } 16577 iter.i++ 16578 if iter.i < len(iter.page.Values()) { 16579 return nil 16580 } 16581 err = iter.page.NextWithContext(ctx) 16582 if err != nil { 16583 iter.i-- 16584 return err 16585 } 16586 iter.i = 0 16587 return nil 16588} 16589 16590// Next advances to the next value. If there was an error making 16591// the request the iterator does not advance and the error is returned. 16592// Deprecated: Use NextWithContext() instead. 16593func (iter *SecurityGroupListResultIterator) Next() error { 16594 return iter.NextWithContext(context.Background()) 16595} 16596 16597// NotDone returns true if the enumeration should be started or is not yet complete. 16598func (iter SecurityGroupListResultIterator) NotDone() bool { 16599 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 16600} 16601 16602// Response returns the raw server response from the last page request. 16603func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult { 16604 return iter.page.Response() 16605} 16606 16607// Value returns the current value or a zero-initialized value if the 16608// iterator has advanced beyond the end of the collection. 16609func (iter SecurityGroupListResultIterator) Value() SecurityGroup { 16610 if !iter.page.NotDone() { 16611 return SecurityGroup{} 16612 } 16613 return iter.page.Values()[iter.i] 16614} 16615 16616// Creates a new instance of the SecurityGroupListResultIterator type. 16617func NewSecurityGroupListResultIterator(page SecurityGroupListResultPage) SecurityGroupListResultIterator { 16618 return SecurityGroupListResultIterator{page: page} 16619} 16620 16621// IsEmpty returns true if the ListResult contains no values. 16622func (sglr SecurityGroupListResult) IsEmpty() bool { 16623 return sglr.Value == nil || len(*sglr.Value) == 0 16624} 16625 16626// hasNextLink returns true if the NextLink is not empty. 16627func (sglr SecurityGroupListResult) hasNextLink() bool { 16628 return sglr.NextLink != nil && len(*sglr.NextLink) != 0 16629} 16630 16631// securityGroupListResultPreparer prepares a request to retrieve the next set of results. 16632// It returns nil if no more results exist. 16633func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 16634 if !sglr.hasNextLink() { 16635 return nil, nil 16636 } 16637 return autorest.Prepare((&http.Request{}).WithContext(ctx), 16638 autorest.AsJSON(), 16639 autorest.AsGet(), 16640 autorest.WithBaseURL(to.String(sglr.NextLink))) 16641} 16642 16643// SecurityGroupListResultPage contains a page of SecurityGroup values. 16644type SecurityGroupListResultPage struct { 16645 fn func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error) 16646 sglr SecurityGroupListResult 16647} 16648 16649// NextWithContext advances to the next page of values. If there was an error making 16650// the request the page does not advance and the error is returned. 16651func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 16652 if tracing.IsEnabled() { 16653 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultPage.NextWithContext") 16654 defer func() { 16655 sc := -1 16656 if page.Response().Response.Response != nil { 16657 sc = page.Response().Response.Response.StatusCode 16658 } 16659 tracing.EndSpan(ctx, sc, err) 16660 }() 16661 } 16662 for { 16663 next, err := page.fn(ctx, page.sglr) 16664 if err != nil { 16665 return err 16666 } 16667 page.sglr = next 16668 if !next.hasNextLink() || !next.IsEmpty() { 16669 break 16670 } 16671 } 16672 return nil 16673} 16674 16675// Next advances to the next page of values. If there was an error making 16676// the request the page does not advance and the error is returned. 16677// Deprecated: Use NextWithContext() instead. 16678func (page *SecurityGroupListResultPage) Next() error { 16679 return page.NextWithContext(context.Background()) 16680} 16681 16682// NotDone returns true if the page enumeration should be started or is not yet complete. 16683func (page SecurityGroupListResultPage) NotDone() bool { 16684 return !page.sglr.IsEmpty() 16685} 16686 16687// Response returns the raw server response from the last page request. 16688func (page SecurityGroupListResultPage) Response() SecurityGroupListResult { 16689 return page.sglr 16690} 16691 16692// Values returns the slice of values for the current page or nil if there are no values. 16693func (page SecurityGroupListResultPage) Values() []SecurityGroup { 16694 if page.sglr.IsEmpty() { 16695 return nil 16696 } 16697 return *page.sglr.Value 16698} 16699 16700// Creates a new instance of the SecurityGroupListResultPage type. 16701func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage { 16702 return SecurityGroupListResultPage{ 16703 fn: getNextPage, 16704 sglr: cur, 16705 } 16706} 16707 16708// SecurityGroupNetworkInterface network interface and all its associated security rules. 16709type SecurityGroupNetworkInterface struct { 16710 // ID - ID of the network interface. 16711 ID *string `json:"id,omitempty"` 16712 SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` 16713} 16714 16715// SecurityGroupPropertiesFormat network Security Group resource. 16716type SecurityGroupPropertiesFormat struct { 16717 // SecurityRules - A collection of security rules of the network security group. 16718 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 16719 // DefaultSecurityRules - The default security rules of network security group. 16720 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` 16721 // NetworkInterfaces - READ-ONLY; A collection of references to network interfaces. 16722 NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` 16723 // Subnets - READ-ONLY; A collection of references to subnets. 16724 Subnets *[]Subnet `json:"subnets,omitempty"` 16725 // ResourceGUID - The resource GUID property of the network security group resource. 16726 ResourceGUID *string `json:"resourceGuid,omitempty"` 16727 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 16728 ProvisioningState *string `json:"provisioningState,omitempty"` 16729} 16730 16731// MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat. 16732func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { 16733 objectMap := make(map[string]interface{}) 16734 if sgpf.SecurityRules != nil { 16735 objectMap["securityRules"] = sgpf.SecurityRules 16736 } 16737 if sgpf.DefaultSecurityRules != nil { 16738 objectMap["defaultSecurityRules"] = sgpf.DefaultSecurityRules 16739 } 16740 if sgpf.ResourceGUID != nil { 16741 objectMap["resourceGuid"] = sgpf.ResourceGUID 16742 } 16743 if sgpf.ProvisioningState != nil { 16744 objectMap["provisioningState"] = sgpf.ProvisioningState 16745 } 16746 return json.Marshal(objectMap) 16747} 16748 16749// SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 16750// long-running operation. 16751type SecurityGroupsCreateOrUpdateFuture struct { 16752 azure.FutureAPI 16753 // Result returns the result of the asynchronous operation. 16754 // If the operation has not completed it will return an error. 16755 Result func(SecurityGroupsClient) (SecurityGroup, error) 16756} 16757 16758// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16759func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 16760 var azFuture azure.Future 16761 if err := json.Unmarshal(body, &azFuture); err != nil { 16762 return err 16763 } 16764 future.FutureAPI = &azFuture 16765 future.Result = future.result 16766 return nil 16767} 16768 16769// result is the default implementation for SecurityGroupsCreateOrUpdateFuture.Result. 16770func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { 16771 var done bool 16772 done, err = future.DoneWithContext(context.Background(), client) 16773 if err != nil { 16774 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 16775 return 16776 } 16777 if !done { 16778 sg.Response.Response = future.Response() 16779 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") 16780 return 16781 } 16782 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16783 if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { 16784 sg, err = client.CreateOrUpdateResponder(sg.Response.Response) 16785 if err != nil { 16786 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request") 16787 } 16788 } 16789 return 16790} 16791 16792// SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 16793// operation. 16794type SecurityGroupsDeleteFuture struct { 16795 azure.FutureAPI 16796 // Result returns the result of the asynchronous operation. 16797 // If the operation has not completed it will return an error. 16798 Result func(SecurityGroupsClient) (autorest.Response, error) 16799} 16800 16801// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16802func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { 16803 var azFuture azure.Future 16804 if err := json.Unmarshal(body, &azFuture); err != nil { 16805 return err 16806 } 16807 future.FutureAPI = &azFuture 16808 future.Result = future.result 16809 return nil 16810} 16811 16812// result is the default implementation for SecurityGroupsDeleteFuture.Result. 16813func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) { 16814 var done bool 16815 done, err = future.DoneWithContext(context.Background(), client) 16816 if err != nil { 16817 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") 16818 return 16819 } 16820 if !done { 16821 ar.Response = future.Response() 16822 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") 16823 return 16824 } 16825 ar.Response = future.Response() 16826 return 16827} 16828 16829// SecurityGroupsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 16830// long-running operation. 16831type SecurityGroupsUpdateTagsFuture struct { 16832 azure.FutureAPI 16833 // Result returns the result of the asynchronous operation. 16834 // If the operation has not completed it will return an error. 16835 Result func(SecurityGroupsClient) (SecurityGroup, error) 16836} 16837 16838// UnmarshalJSON is the custom unmarshaller for CreateFuture. 16839func (future *SecurityGroupsUpdateTagsFuture) UnmarshalJSON(body []byte) error { 16840 var azFuture azure.Future 16841 if err := json.Unmarshal(body, &azFuture); err != nil { 16842 return err 16843 } 16844 future.FutureAPI = &azFuture 16845 future.Result = future.result 16846 return nil 16847} 16848 16849// result is the default implementation for SecurityGroupsUpdateTagsFuture.Result. 16850func (future *SecurityGroupsUpdateTagsFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { 16851 var done bool 16852 done, err = future.DoneWithContext(context.Background(), client) 16853 if err != nil { 16854 err = autorest.NewErrorWithError(err, "network.SecurityGroupsUpdateTagsFuture", "Result", future.Response(), "Polling failure") 16855 return 16856 } 16857 if !done { 16858 sg.Response.Response = future.Response() 16859 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsUpdateTagsFuture") 16860 return 16861 } 16862 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16863 if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { 16864 sg, err = client.UpdateTagsResponder(sg.Response.Response) 16865 if err != nil { 16866 err = autorest.NewErrorWithError(err, "network.SecurityGroupsUpdateTagsFuture", "Result", sg.Response.Response, "Failure responding to request") 16867 } 16868 } 16869 return 16870} 16871 16872// SecurityGroupViewParameters parameters that define the VM to check security groups for. 16873type SecurityGroupViewParameters struct { 16874 // TargetResourceID - ID of the target VM. 16875 TargetResourceID *string `json:"targetResourceId,omitempty"` 16876} 16877 16878// SecurityGroupViewResult the information about security rules applied to the specified VM. 16879type SecurityGroupViewResult struct { 16880 autorest.Response `json:"-"` 16881 // NetworkInterfaces - List of network interfaces on the specified VM. 16882 NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` 16883} 16884 16885// SecurityRule network security rule. 16886type SecurityRule struct { 16887 autorest.Response `json:"-"` 16888 // SecurityRulePropertiesFormat - Properties of the security rule 16889 *SecurityRulePropertiesFormat `json:"properties,omitempty"` 16890 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 16891 Name *string `json:"name,omitempty"` 16892 // Etag - A unique read-only string that changes whenever the resource is updated. 16893 Etag *string `json:"etag,omitempty"` 16894 // ID - Resource ID. 16895 ID *string `json:"id,omitempty"` 16896} 16897 16898// MarshalJSON is the custom marshaler for SecurityRule. 16899func (sr SecurityRule) MarshalJSON() ([]byte, error) { 16900 objectMap := make(map[string]interface{}) 16901 if sr.SecurityRulePropertiesFormat != nil { 16902 objectMap["properties"] = sr.SecurityRulePropertiesFormat 16903 } 16904 if sr.Name != nil { 16905 objectMap["name"] = sr.Name 16906 } 16907 if sr.Etag != nil { 16908 objectMap["etag"] = sr.Etag 16909 } 16910 if sr.ID != nil { 16911 objectMap["id"] = sr.ID 16912 } 16913 return json.Marshal(objectMap) 16914} 16915 16916// UnmarshalJSON is the custom unmarshaler for SecurityRule struct. 16917func (sr *SecurityRule) UnmarshalJSON(body []byte) error { 16918 var m map[string]*json.RawMessage 16919 err := json.Unmarshal(body, &m) 16920 if err != nil { 16921 return err 16922 } 16923 for k, v := range m { 16924 switch k { 16925 case "properties": 16926 if v != nil { 16927 var securityRulePropertiesFormat SecurityRulePropertiesFormat 16928 err = json.Unmarshal(*v, &securityRulePropertiesFormat) 16929 if err != nil { 16930 return err 16931 } 16932 sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat 16933 } 16934 case "name": 16935 if v != nil { 16936 var name string 16937 err = json.Unmarshal(*v, &name) 16938 if err != nil { 16939 return err 16940 } 16941 sr.Name = &name 16942 } 16943 case "etag": 16944 if v != nil { 16945 var etag string 16946 err = json.Unmarshal(*v, &etag) 16947 if err != nil { 16948 return err 16949 } 16950 sr.Etag = &etag 16951 } 16952 case "id": 16953 if v != nil { 16954 var ID string 16955 err = json.Unmarshal(*v, &ID) 16956 if err != nil { 16957 return err 16958 } 16959 sr.ID = &ID 16960 } 16961 } 16962 } 16963 16964 return nil 16965} 16966 16967// SecurityRuleAssociations all security rules associated with the network interface. 16968type SecurityRuleAssociations struct { 16969 NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` 16970 SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` 16971 // DefaultSecurityRules - Collection of default security rules of the network security group. 16972 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` 16973 // EffectiveSecurityRules - Collection of effective security rules. 16974 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` 16975} 16976 16977// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that 16978// belongs to a network security group. 16979type SecurityRuleListResult struct { 16980 autorest.Response `json:"-"` 16981 // Value - The security rules in a network security group. 16982 Value *[]SecurityRule `json:"value,omitempty"` 16983 // NextLink - The URL to get the next set of results. 16984 NextLink *string `json:"nextLink,omitempty"` 16985} 16986 16987// SecurityRuleListResultIterator provides access to a complete listing of SecurityRule values. 16988type SecurityRuleListResultIterator struct { 16989 i int 16990 page SecurityRuleListResultPage 16991} 16992 16993// NextWithContext advances to the next value. If there was an error making 16994// the request the iterator does not advance and the error is returned. 16995func (iter *SecurityRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 16996 if tracing.IsEnabled() { 16997 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultIterator.NextWithContext") 16998 defer func() { 16999 sc := -1 17000 if iter.Response().Response.Response != nil { 17001 sc = iter.Response().Response.Response.StatusCode 17002 } 17003 tracing.EndSpan(ctx, sc, err) 17004 }() 17005 } 17006 iter.i++ 17007 if iter.i < len(iter.page.Values()) { 17008 return nil 17009 } 17010 err = iter.page.NextWithContext(ctx) 17011 if err != nil { 17012 iter.i-- 17013 return err 17014 } 17015 iter.i = 0 17016 return nil 17017} 17018 17019// Next advances to the next value. If there was an error making 17020// the request the iterator does not advance and the error is returned. 17021// Deprecated: Use NextWithContext() instead. 17022func (iter *SecurityRuleListResultIterator) Next() error { 17023 return iter.NextWithContext(context.Background()) 17024} 17025 17026// NotDone returns true if the enumeration should be started or is not yet complete. 17027func (iter SecurityRuleListResultIterator) NotDone() bool { 17028 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17029} 17030 17031// Response returns the raw server response from the last page request. 17032func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult { 17033 return iter.page.Response() 17034} 17035 17036// Value returns the current value or a zero-initialized value if the 17037// iterator has advanced beyond the end of the collection. 17038func (iter SecurityRuleListResultIterator) Value() SecurityRule { 17039 if !iter.page.NotDone() { 17040 return SecurityRule{} 17041 } 17042 return iter.page.Values()[iter.i] 17043} 17044 17045// Creates a new instance of the SecurityRuleListResultIterator type. 17046func NewSecurityRuleListResultIterator(page SecurityRuleListResultPage) SecurityRuleListResultIterator { 17047 return SecurityRuleListResultIterator{page: page} 17048} 17049 17050// IsEmpty returns true if the ListResult contains no values. 17051func (srlr SecurityRuleListResult) IsEmpty() bool { 17052 return srlr.Value == nil || len(*srlr.Value) == 0 17053} 17054 17055// hasNextLink returns true if the NextLink is not empty. 17056func (srlr SecurityRuleListResult) hasNextLink() bool { 17057 return srlr.NextLink != nil && len(*srlr.NextLink) != 0 17058} 17059 17060// securityRuleListResultPreparer prepares a request to retrieve the next set of results. 17061// It returns nil if no more results exist. 17062func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) { 17063 if !srlr.hasNextLink() { 17064 return nil, nil 17065 } 17066 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17067 autorest.AsJSON(), 17068 autorest.AsGet(), 17069 autorest.WithBaseURL(to.String(srlr.NextLink))) 17070} 17071 17072// SecurityRuleListResultPage contains a page of SecurityRule values. 17073type SecurityRuleListResultPage struct { 17074 fn func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error) 17075 srlr SecurityRuleListResult 17076} 17077 17078// NextWithContext advances to the next page of values. If there was an error making 17079// the request the page does not advance and the error is returned. 17080func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (err error) { 17081 if tracing.IsEnabled() { 17082 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultPage.NextWithContext") 17083 defer func() { 17084 sc := -1 17085 if page.Response().Response.Response != nil { 17086 sc = page.Response().Response.Response.StatusCode 17087 } 17088 tracing.EndSpan(ctx, sc, err) 17089 }() 17090 } 17091 for { 17092 next, err := page.fn(ctx, page.srlr) 17093 if err != nil { 17094 return err 17095 } 17096 page.srlr = next 17097 if !next.hasNextLink() || !next.IsEmpty() { 17098 break 17099 } 17100 } 17101 return nil 17102} 17103 17104// Next advances to the next page of values. If there was an error making 17105// the request the page does not advance and the error is returned. 17106// Deprecated: Use NextWithContext() instead. 17107func (page *SecurityRuleListResultPage) Next() error { 17108 return page.NextWithContext(context.Background()) 17109} 17110 17111// NotDone returns true if the page enumeration should be started or is not yet complete. 17112func (page SecurityRuleListResultPage) NotDone() bool { 17113 return !page.srlr.IsEmpty() 17114} 17115 17116// Response returns the raw server response from the last page request. 17117func (page SecurityRuleListResultPage) Response() SecurityRuleListResult { 17118 return page.srlr 17119} 17120 17121// Values returns the slice of values for the current page or nil if there are no values. 17122func (page SecurityRuleListResultPage) Values() []SecurityRule { 17123 if page.srlr.IsEmpty() { 17124 return nil 17125 } 17126 return *page.srlr.Value 17127} 17128 17129// Creates a new instance of the SecurityRuleListResultPage type. 17130func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage { 17131 return SecurityRuleListResultPage{ 17132 fn: getNextPage, 17133 srlr: cur, 17134 } 17135} 17136 17137// SecurityRulePropertiesFormat security rule resource. 17138type SecurityRulePropertiesFormat struct { 17139 // Description - A description for this rule. Restricted to 140 chars. 17140 Description *string `json:"description,omitempty"` 17141 // Protocol - Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolAsterisk' 17142 Protocol SecurityRuleProtocol `json:"protocol,omitempty"` 17143 // SourcePortRange - The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. 17144 SourcePortRange *string `json:"sourcePortRange,omitempty"` 17145 // DestinationPortRange - The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. 17146 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 17147 // SourceAddressPrefix - The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. 17148 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 17149 // SourceAddressPrefixes - The CIDR or source IP ranges. 17150 SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` 17151 // SourceApplicationSecurityGroups - The application security group specified as source. 17152 SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` 17153 // DestinationAddressPrefix - The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. 17154 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 17155 // DestinationAddressPrefixes - The destination address prefixes. CIDR or destination IP ranges. 17156 DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` 17157 // DestinationApplicationSecurityGroups - The application security group specified as destination. 17158 DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` 17159 // SourcePortRanges - The source port ranges. 17160 SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` 17161 // DestinationPortRanges - The destination port ranges. 17162 DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` 17163 // Access - The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' 17164 Access SecurityRuleAccess `json:"access,omitempty"` 17165 // Priority - The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. 17166 Priority *int32 `json:"priority,omitempty"` 17167 // Direction - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' 17168 Direction SecurityRuleDirection `json:"direction,omitempty"` 17169 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 17170 ProvisioningState *string `json:"provisioningState,omitempty"` 17171} 17172 17173// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 17174// long-running operation. 17175type SecurityRulesCreateOrUpdateFuture struct { 17176 azure.FutureAPI 17177 // Result returns the result of the asynchronous operation. 17178 // If the operation has not completed it will return an error. 17179 Result func(SecurityRulesClient) (SecurityRule, error) 17180} 17181 17182// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17183func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 17184 var azFuture azure.Future 17185 if err := json.Unmarshal(body, &azFuture); err != nil { 17186 return err 17187 } 17188 future.FutureAPI = &azFuture 17189 future.Result = future.result 17190 return nil 17191} 17192 17193// result is the default implementation for SecurityRulesCreateOrUpdateFuture.Result. 17194func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) { 17195 var done bool 17196 done, err = future.DoneWithContext(context.Background(), client) 17197 if err != nil { 17198 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 17199 return 17200 } 17201 if !done { 17202 sr.Response.Response = future.Response() 17203 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") 17204 return 17205 } 17206 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17207 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 17208 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 17209 if err != nil { 17210 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 17211 } 17212 } 17213 return 17214} 17215 17216// SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 17217// operation. 17218type SecurityRulesDeleteFuture struct { 17219 azure.FutureAPI 17220 // Result returns the result of the asynchronous operation. 17221 // If the operation has not completed it will return an error. 17222 Result func(SecurityRulesClient) (autorest.Response, error) 17223} 17224 17225// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17226func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error { 17227 var azFuture azure.Future 17228 if err := json.Unmarshal(body, &azFuture); err != nil { 17229 return err 17230 } 17231 future.FutureAPI = &azFuture 17232 future.Result = future.result 17233 return nil 17234} 17235 17236// result is the default implementation for SecurityRulesDeleteFuture.Result. 17237func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) { 17238 var done bool 17239 done, err = future.DoneWithContext(context.Background(), client) 17240 if err != nil { 17241 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure") 17242 return 17243 } 17244 if !done { 17245 ar.Response = future.Response() 17246 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") 17247 return 17248 } 17249 ar.Response = future.Response() 17250 return 17251} 17252 17253// ServiceEndpointPropertiesFormat the service endpoint properties. 17254type ServiceEndpointPropertiesFormat struct { 17255 // Service - The type of the endpoint service. 17256 Service *string `json:"service,omitempty"` 17257 // Locations - A list of locations. 17258 Locations *[]string `json:"locations,omitempty"` 17259 // ProvisioningState - The provisioning state of the resource. 17260 ProvisioningState *string `json:"provisioningState,omitempty"` 17261} 17262 17263// String ... 17264type String struct { 17265 autorest.Response `json:"-"` 17266 Value *string `json:"value,omitempty"` 17267} 17268 17269// Subnet subnet in a virtual network resource. 17270type Subnet struct { 17271 autorest.Response `json:"-"` 17272 // SubnetPropertiesFormat - Properties of the subnet. 17273 *SubnetPropertiesFormat `json:"properties,omitempty"` 17274 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 17275 Name *string `json:"name,omitempty"` 17276 // Etag - A unique read-only string that changes whenever the resource is updated. 17277 Etag *string `json:"etag,omitempty"` 17278 // ID - Resource ID. 17279 ID *string `json:"id,omitempty"` 17280} 17281 17282// MarshalJSON is the custom marshaler for Subnet. 17283func (s Subnet) MarshalJSON() ([]byte, error) { 17284 objectMap := make(map[string]interface{}) 17285 if s.SubnetPropertiesFormat != nil { 17286 objectMap["properties"] = s.SubnetPropertiesFormat 17287 } 17288 if s.Name != nil { 17289 objectMap["name"] = s.Name 17290 } 17291 if s.Etag != nil { 17292 objectMap["etag"] = s.Etag 17293 } 17294 if s.ID != nil { 17295 objectMap["id"] = s.ID 17296 } 17297 return json.Marshal(objectMap) 17298} 17299 17300// UnmarshalJSON is the custom unmarshaler for Subnet struct. 17301func (s *Subnet) UnmarshalJSON(body []byte) error { 17302 var m map[string]*json.RawMessage 17303 err := json.Unmarshal(body, &m) 17304 if err != nil { 17305 return err 17306 } 17307 for k, v := range m { 17308 switch k { 17309 case "properties": 17310 if v != nil { 17311 var subnetPropertiesFormat SubnetPropertiesFormat 17312 err = json.Unmarshal(*v, &subnetPropertiesFormat) 17313 if err != nil { 17314 return err 17315 } 17316 s.SubnetPropertiesFormat = &subnetPropertiesFormat 17317 } 17318 case "name": 17319 if v != nil { 17320 var name string 17321 err = json.Unmarshal(*v, &name) 17322 if err != nil { 17323 return err 17324 } 17325 s.Name = &name 17326 } 17327 case "etag": 17328 if v != nil { 17329 var etag string 17330 err = json.Unmarshal(*v, &etag) 17331 if err != nil { 17332 return err 17333 } 17334 s.Etag = &etag 17335 } 17336 case "id": 17337 if v != nil { 17338 var ID string 17339 err = json.Unmarshal(*v, &ID) 17340 if err != nil { 17341 return err 17342 } 17343 s.ID = &ID 17344 } 17345 } 17346 } 17347 17348 return nil 17349} 17350 17351// SubnetAssociation network interface and its custom security rules. 17352type SubnetAssociation struct { 17353 // ID - READ-ONLY; Subnet ID. 17354 ID *string `json:"id,omitempty"` 17355 // SecurityRules - Collection of custom security rules. 17356 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 17357} 17358 17359// MarshalJSON is the custom marshaler for SubnetAssociation. 17360func (sa SubnetAssociation) MarshalJSON() ([]byte, error) { 17361 objectMap := make(map[string]interface{}) 17362 if sa.SecurityRules != nil { 17363 objectMap["securityRules"] = sa.SecurityRules 17364 } 17365 return json.Marshal(objectMap) 17366} 17367 17368// SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual 17369// network 17370type SubnetListResult struct { 17371 autorest.Response `json:"-"` 17372 // Value - The subnets in a virtual network. 17373 Value *[]Subnet `json:"value,omitempty"` 17374 // NextLink - The URL to get the next set of results. 17375 NextLink *string `json:"nextLink,omitempty"` 17376} 17377 17378// SubnetListResultIterator provides access to a complete listing of Subnet values. 17379type SubnetListResultIterator struct { 17380 i int 17381 page SubnetListResultPage 17382} 17383 17384// NextWithContext advances to the next value. If there was an error making 17385// the request the iterator does not advance and the error is returned. 17386func (iter *SubnetListResultIterator) NextWithContext(ctx context.Context) (err error) { 17387 if tracing.IsEnabled() { 17388 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultIterator.NextWithContext") 17389 defer func() { 17390 sc := -1 17391 if iter.Response().Response.Response != nil { 17392 sc = iter.Response().Response.Response.StatusCode 17393 } 17394 tracing.EndSpan(ctx, sc, err) 17395 }() 17396 } 17397 iter.i++ 17398 if iter.i < len(iter.page.Values()) { 17399 return nil 17400 } 17401 err = iter.page.NextWithContext(ctx) 17402 if err != nil { 17403 iter.i-- 17404 return err 17405 } 17406 iter.i = 0 17407 return nil 17408} 17409 17410// Next advances to the next value. If there was an error making 17411// the request the iterator does not advance and the error is returned. 17412// Deprecated: Use NextWithContext() instead. 17413func (iter *SubnetListResultIterator) Next() error { 17414 return iter.NextWithContext(context.Background()) 17415} 17416 17417// NotDone returns true if the enumeration should be started or is not yet complete. 17418func (iter SubnetListResultIterator) NotDone() bool { 17419 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17420} 17421 17422// Response returns the raw server response from the last page request. 17423func (iter SubnetListResultIterator) Response() SubnetListResult { 17424 return iter.page.Response() 17425} 17426 17427// Value returns the current value or a zero-initialized value if the 17428// iterator has advanced beyond the end of the collection. 17429func (iter SubnetListResultIterator) Value() Subnet { 17430 if !iter.page.NotDone() { 17431 return Subnet{} 17432 } 17433 return iter.page.Values()[iter.i] 17434} 17435 17436// Creates a new instance of the SubnetListResultIterator type. 17437func NewSubnetListResultIterator(page SubnetListResultPage) SubnetListResultIterator { 17438 return SubnetListResultIterator{page: page} 17439} 17440 17441// IsEmpty returns true if the ListResult contains no values. 17442func (slr SubnetListResult) IsEmpty() bool { 17443 return slr.Value == nil || len(*slr.Value) == 0 17444} 17445 17446// hasNextLink returns true if the NextLink is not empty. 17447func (slr SubnetListResult) hasNextLink() bool { 17448 return slr.NextLink != nil && len(*slr.NextLink) != 0 17449} 17450 17451// subnetListResultPreparer prepares a request to retrieve the next set of results. 17452// It returns nil if no more results exist. 17453func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) { 17454 if !slr.hasNextLink() { 17455 return nil, nil 17456 } 17457 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17458 autorest.AsJSON(), 17459 autorest.AsGet(), 17460 autorest.WithBaseURL(to.String(slr.NextLink))) 17461} 17462 17463// SubnetListResultPage contains a page of Subnet values. 17464type SubnetListResultPage struct { 17465 fn func(context.Context, SubnetListResult) (SubnetListResult, error) 17466 slr SubnetListResult 17467} 17468 17469// NextWithContext advances to the next page of values. If there was an error making 17470// the request the page does not advance and the error is returned. 17471func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err error) { 17472 if tracing.IsEnabled() { 17473 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultPage.NextWithContext") 17474 defer func() { 17475 sc := -1 17476 if page.Response().Response.Response != nil { 17477 sc = page.Response().Response.Response.StatusCode 17478 } 17479 tracing.EndSpan(ctx, sc, err) 17480 }() 17481 } 17482 for { 17483 next, err := page.fn(ctx, page.slr) 17484 if err != nil { 17485 return err 17486 } 17487 page.slr = next 17488 if !next.hasNextLink() || !next.IsEmpty() { 17489 break 17490 } 17491 } 17492 return nil 17493} 17494 17495// Next advances to the next page of values. If there was an error making 17496// the request the page does not advance and the error is returned. 17497// Deprecated: Use NextWithContext() instead. 17498func (page *SubnetListResultPage) Next() error { 17499 return page.NextWithContext(context.Background()) 17500} 17501 17502// NotDone returns true if the page enumeration should be started or is not yet complete. 17503func (page SubnetListResultPage) NotDone() bool { 17504 return !page.slr.IsEmpty() 17505} 17506 17507// Response returns the raw server response from the last page request. 17508func (page SubnetListResultPage) Response() SubnetListResult { 17509 return page.slr 17510} 17511 17512// Values returns the slice of values for the current page or nil if there are no values. 17513func (page SubnetListResultPage) Values() []Subnet { 17514 if page.slr.IsEmpty() { 17515 return nil 17516 } 17517 return *page.slr.Value 17518} 17519 17520// Creates a new instance of the SubnetListResultPage type. 17521func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage { 17522 return SubnetListResultPage{ 17523 fn: getNextPage, 17524 slr: cur, 17525 } 17526} 17527 17528// SubnetPropertiesFormat properties of the subnet. 17529type SubnetPropertiesFormat struct { 17530 // AddressPrefix - The address prefix for the subnet. 17531 AddressPrefix *string `json:"addressPrefix,omitempty"` 17532 // NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource. 17533 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 17534 // RouteTable - The reference of the RouteTable resource. 17535 RouteTable *RouteTable `json:"routeTable,omitempty"` 17536 // ServiceEndpoints - An array of service endpoints. 17537 ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` 17538 // IPConfigurations - READ-ONLY; Gets an array of references to the network interface IP configurations using subnet. 17539 IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` 17540 // ResourceNavigationLinks - Gets an array of references to the external resources using subnet. 17541 ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` 17542 // ProvisioningState - The provisioning state of the resource. 17543 ProvisioningState *string `json:"provisioningState,omitempty"` 17544} 17545 17546// MarshalJSON is the custom marshaler for SubnetPropertiesFormat. 17547func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { 17548 objectMap := make(map[string]interface{}) 17549 if spf.AddressPrefix != nil { 17550 objectMap["addressPrefix"] = spf.AddressPrefix 17551 } 17552 if spf.NetworkSecurityGroup != nil { 17553 objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup 17554 } 17555 if spf.RouteTable != nil { 17556 objectMap["routeTable"] = spf.RouteTable 17557 } 17558 if spf.ServiceEndpoints != nil { 17559 objectMap["serviceEndpoints"] = spf.ServiceEndpoints 17560 } 17561 if spf.ResourceNavigationLinks != nil { 17562 objectMap["resourceNavigationLinks"] = spf.ResourceNavigationLinks 17563 } 17564 if spf.ProvisioningState != nil { 17565 objectMap["provisioningState"] = spf.ProvisioningState 17566 } 17567 return json.Marshal(objectMap) 17568} 17569 17570// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 17571// operation. 17572type SubnetsCreateOrUpdateFuture struct { 17573 azure.FutureAPI 17574 // Result returns the result of the asynchronous operation. 17575 // If the operation has not completed it will return an error. 17576 Result func(SubnetsClient) (Subnet, error) 17577} 17578 17579// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17580func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 17581 var azFuture azure.Future 17582 if err := json.Unmarshal(body, &azFuture); err != nil { 17583 return err 17584 } 17585 future.FutureAPI = &azFuture 17586 future.Result = future.result 17587 return nil 17588} 17589 17590// result is the default implementation for SubnetsCreateOrUpdateFuture.Result. 17591func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) { 17592 var done bool 17593 done, err = future.DoneWithContext(context.Background(), client) 17594 if err != nil { 17595 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 17596 return 17597 } 17598 if !done { 17599 s.Response.Response = future.Response() 17600 err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") 17601 return 17602 } 17603 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17604 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 17605 s, err = client.CreateOrUpdateResponder(s.Response.Response) 17606 if err != nil { 17607 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 17608 } 17609 } 17610 return 17611} 17612 17613// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 17614// operation. 17615type SubnetsDeleteFuture struct { 17616 azure.FutureAPI 17617 // Result returns the result of the asynchronous operation. 17618 // If the operation has not completed it will return an error. 17619 Result func(SubnetsClient) (autorest.Response, error) 17620} 17621 17622// UnmarshalJSON is the custom unmarshaller for CreateFuture. 17623func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error { 17624 var azFuture azure.Future 17625 if err := json.Unmarshal(body, &azFuture); err != nil { 17626 return err 17627 } 17628 future.FutureAPI = &azFuture 17629 future.Result = future.result 17630 return nil 17631} 17632 17633// result is the default implementation for SubnetsDeleteFuture.Result. 17634func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) { 17635 var done bool 17636 done, err = future.DoneWithContext(context.Background(), client) 17637 if err != nil { 17638 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure") 17639 return 17640 } 17641 if !done { 17642 ar.Response = future.Response() 17643 err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") 17644 return 17645 } 17646 ar.Response = future.Response() 17647 return 17648} 17649 17650// SubResource reference to another subresource. 17651type SubResource struct { 17652 // ID - Resource ID. 17653 ID *string `json:"id,omitempty"` 17654} 17655 17656// TagsObject tags object for patch operations. 17657type TagsObject struct { 17658 // Tags - Resource tags. 17659 Tags map[string]*string `json:"tags"` 17660} 17661 17662// MarshalJSON is the custom marshaler for TagsObject. 17663func (toVar TagsObject) MarshalJSON() ([]byte, error) { 17664 objectMap := make(map[string]interface{}) 17665 if toVar.Tags != nil { 17666 objectMap["tags"] = toVar.Tags 17667 } 17668 return json.Marshal(objectMap) 17669} 17670 17671// Topology topology of the specified resource group. 17672type Topology struct { 17673 autorest.Response `json:"-"` 17674 // ID - READ-ONLY; GUID representing the operation id. 17675 ID *string `json:"id,omitempty"` 17676 // CreatedDateTime - READ-ONLY; The datetime when the topology was initially created for the resource group. 17677 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 17678 // LastModified - READ-ONLY; The datetime when the topology was last modified. 17679 LastModified *date.Time `json:"lastModified,omitempty"` 17680 Resources *[]TopologyResource `json:"resources,omitempty"` 17681} 17682 17683// MarshalJSON is the custom marshaler for Topology. 17684func (t Topology) MarshalJSON() ([]byte, error) { 17685 objectMap := make(map[string]interface{}) 17686 if t.Resources != nil { 17687 objectMap["resources"] = t.Resources 17688 } 17689 return json.Marshal(objectMap) 17690} 17691 17692// TopologyAssociation resources that have an association with the parent resource. 17693type TopologyAssociation struct { 17694 // Name - The name of the resource that is associated with the parent resource. 17695 Name *string `json:"name,omitempty"` 17696 // ResourceID - The ID of the resource that is associated with the parent resource. 17697 ResourceID *string `json:"resourceId,omitempty"` 17698 // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains' 17699 AssociationType AssociationType `json:"associationType,omitempty"` 17700} 17701 17702// TopologyParameters parameters that define the representation of topology. 17703type TopologyParameters struct { 17704 // TargetResourceGroupName - The name of the target resource group to perform topology on. 17705 TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` 17706 // TargetVirtualNetwork - The reference of the Virtual Network resource. 17707 TargetVirtualNetwork *SubResource `json:"targetVirtualNetwork,omitempty"` 17708 // TargetSubnet - The reference of the Subnet resource. 17709 TargetSubnet *SubResource `json:"targetSubnet,omitempty"` 17710} 17711 17712// TopologyResource the network resource topology information for the given resource group. 17713type TopologyResource struct { 17714 // Name - Name of the resource. 17715 Name *string `json:"name,omitempty"` 17716 // ID - ID of the resource. 17717 ID *string `json:"id,omitempty"` 17718 // Location - Resource location. 17719 Location *string `json:"location,omitempty"` 17720 // Associations - Holds the associations the resource has with other resources in the resource group. 17721 Associations *[]TopologyAssociation `json:"associations,omitempty"` 17722} 17723 17724// TrafficAnalyticsConfigurationProperties parameters that define the configuration of traffic analytics. 17725type TrafficAnalyticsConfigurationProperties struct { 17726 // Enabled - Flag to enable/disable traffic analytics. 17727 Enabled *bool `json:"enabled,omitempty"` 17728 // WorkspaceID - The resource guid of the attached workspace 17729 WorkspaceID *string `json:"workspaceId,omitempty"` 17730 // WorkspaceRegion - The location of the attached workspace 17731 WorkspaceRegion *string `json:"workspaceRegion,omitempty"` 17732 // WorkspaceResourceID - Resource Id of the attached workspace 17733 WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` 17734} 17735 17736// TrafficAnalyticsProperties parameters that define the configuration of traffic analytics. 17737type TrafficAnalyticsProperties struct { 17738 NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` 17739} 17740 17741// TroubleshootingDetails information gained from troubleshooting of specified resource. 17742type TroubleshootingDetails struct { 17743 // ID - The id of the get troubleshoot operation. 17744 ID *string `json:"id,omitempty"` 17745 // ReasonType - Reason type of failure. 17746 ReasonType *string `json:"reasonType,omitempty"` 17747 // Summary - A summary of troubleshooting. 17748 Summary *string `json:"summary,omitempty"` 17749 // Detail - Details on troubleshooting results. 17750 Detail *string `json:"detail,omitempty"` 17751 // RecommendedActions - List of recommended actions. 17752 RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` 17753} 17754 17755// TroubleshootingParameters parameters that define the resource to troubleshoot. 17756type TroubleshootingParameters struct { 17757 // TargetResourceID - The target resource to troubleshoot. 17758 TargetResourceID *string `json:"targetResourceId,omitempty"` 17759 *TroubleshootingProperties `json:"properties,omitempty"` 17760} 17761 17762// MarshalJSON is the custom marshaler for TroubleshootingParameters. 17763func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) { 17764 objectMap := make(map[string]interface{}) 17765 if tp.TargetResourceID != nil { 17766 objectMap["targetResourceId"] = tp.TargetResourceID 17767 } 17768 if tp.TroubleshootingProperties != nil { 17769 objectMap["properties"] = tp.TroubleshootingProperties 17770 } 17771 return json.Marshal(objectMap) 17772} 17773 17774// UnmarshalJSON is the custom unmarshaler for TroubleshootingParameters struct. 17775func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error { 17776 var m map[string]*json.RawMessage 17777 err := json.Unmarshal(body, &m) 17778 if err != nil { 17779 return err 17780 } 17781 for k, v := range m { 17782 switch k { 17783 case "targetResourceId": 17784 if v != nil { 17785 var targetResourceID string 17786 err = json.Unmarshal(*v, &targetResourceID) 17787 if err != nil { 17788 return err 17789 } 17790 tp.TargetResourceID = &targetResourceID 17791 } 17792 case "properties": 17793 if v != nil { 17794 var troubleshootingProperties TroubleshootingProperties 17795 err = json.Unmarshal(*v, &troubleshootingProperties) 17796 if err != nil { 17797 return err 17798 } 17799 tp.TroubleshootingProperties = &troubleshootingProperties 17800 } 17801 } 17802 } 17803 17804 return nil 17805} 17806 17807// TroubleshootingProperties storage location provided for troubleshoot. 17808type TroubleshootingProperties struct { 17809 // StorageID - The ID for the storage account to save the troubleshoot result. 17810 StorageID *string `json:"storageId,omitempty"` 17811 // StoragePath - The path to the blob to save the troubleshoot result in. 17812 StoragePath *string `json:"storagePath,omitempty"` 17813} 17814 17815// TroubleshootingRecommendedActions recommended actions based on discovered issues. 17816type TroubleshootingRecommendedActions struct { 17817 // ActionID - ID of the recommended action. 17818 ActionID *string `json:"actionId,omitempty"` 17819 // ActionText - Description of recommended actions. 17820 ActionText *string `json:"actionText,omitempty"` 17821 // ActionURI - The uri linking to a documentation for the recommended troubleshooting actions. 17822 ActionURI *string `json:"actionUri,omitempty"` 17823 // ActionURIText - The information from the URI for the recommended troubleshooting actions. 17824 ActionURIText *string `json:"actionUriText,omitempty"` 17825} 17826 17827// TroubleshootingResult troubleshooting information gained from specified resource. 17828type TroubleshootingResult struct { 17829 autorest.Response `json:"-"` 17830 // StartTime - The start time of the troubleshooting. 17831 StartTime *date.Time `json:"startTime,omitempty"` 17832 // EndTime - The end time of the troubleshooting. 17833 EndTime *date.Time `json:"endTime,omitempty"` 17834 // Code - The result code of the troubleshooting. 17835 Code *string `json:"code,omitempty"` 17836 // Results - Information from troubleshooting. 17837 Results *[]TroubleshootingDetails `json:"results,omitempty"` 17838} 17839 17840// TunnelConnectionHealth virtualNetworkGatewayConnection properties 17841type TunnelConnectionHealth struct { 17842 // Tunnel - READ-ONLY; Tunnel name. 17843 Tunnel *string `json:"tunnel,omitempty"` 17844 // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' 17845 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 17846 // IngressBytesTransferred - READ-ONLY; The Ingress Bytes Transferred in this connection 17847 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 17848 // EgressBytesTransferred - READ-ONLY; The Egress Bytes Transferred in this connection 17849 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 17850 // LastConnectionEstablishedUtcTime - READ-ONLY; The time at which connection was established in Utc format. 17851 LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` 17852} 17853 17854// MarshalJSON is the custom marshaler for TunnelConnectionHealth. 17855func (tch TunnelConnectionHealth) MarshalJSON() ([]byte, error) { 17856 objectMap := make(map[string]interface{}) 17857 return json.Marshal(objectMap) 17858} 17859 17860// Usage describes network resource usage. 17861type Usage struct { 17862 // ID - READ-ONLY; Resource identifier. 17863 ID *string `json:"id,omitempty"` 17864 // Unit - An enum describing the unit of measurement. 17865 Unit *string `json:"unit,omitempty"` 17866 // CurrentValue - The current value of the usage. 17867 CurrentValue *int64 `json:"currentValue,omitempty"` 17868 // Limit - The limit of usage. 17869 Limit *int64 `json:"limit,omitempty"` 17870 // Name - The name of the type of usage. 17871 Name *UsageName `json:"name,omitempty"` 17872} 17873 17874// MarshalJSON is the custom marshaler for Usage. 17875func (u Usage) MarshalJSON() ([]byte, error) { 17876 objectMap := make(map[string]interface{}) 17877 if u.Unit != nil { 17878 objectMap["unit"] = u.Unit 17879 } 17880 if u.CurrentValue != nil { 17881 objectMap["currentValue"] = u.CurrentValue 17882 } 17883 if u.Limit != nil { 17884 objectMap["limit"] = u.Limit 17885 } 17886 if u.Name != nil { 17887 objectMap["name"] = u.Name 17888 } 17889 return json.Marshal(objectMap) 17890} 17891 17892// UsageName the usage names. 17893type UsageName struct { 17894 // Value - A string describing the resource name. 17895 Value *string `json:"value,omitempty"` 17896 // LocalizedValue - A localized string describing the resource name. 17897 LocalizedValue *string `json:"localizedValue,omitempty"` 17898} 17899 17900// UsagesListResult the list usages operation response. 17901type UsagesListResult struct { 17902 autorest.Response `json:"-"` 17903 // Value - The list network resource usages. 17904 Value *[]Usage `json:"value,omitempty"` 17905 // NextLink - URL to get the next set of results. 17906 NextLink *string `json:"nextLink,omitempty"` 17907} 17908 17909// UsagesListResultIterator provides access to a complete listing of Usage values. 17910type UsagesListResultIterator struct { 17911 i int 17912 page UsagesListResultPage 17913} 17914 17915// NextWithContext advances to the next value. If there was an error making 17916// the request the iterator does not advance and the error is returned. 17917func (iter *UsagesListResultIterator) NextWithContext(ctx context.Context) (err error) { 17918 if tracing.IsEnabled() { 17919 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultIterator.NextWithContext") 17920 defer func() { 17921 sc := -1 17922 if iter.Response().Response.Response != nil { 17923 sc = iter.Response().Response.Response.StatusCode 17924 } 17925 tracing.EndSpan(ctx, sc, err) 17926 }() 17927 } 17928 iter.i++ 17929 if iter.i < len(iter.page.Values()) { 17930 return nil 17931 } 17932 err = iter.page.NextWithContext(ctx) 17933 if err != nil { 17934 iter.i-- 17935 return err 17936 } 17937 iter.i = 0 17938 return nil 17939} 17940 17941// Next advances to the next value. If there was an error making 17942// the request the iterator does not advance and the error is returned. 17943// Deprecated: Use NextWithContext() instead. 17944func (iter *UsagesListResultIterator) Next() error { 17945 return iter.NextWithContext(context.Background()) 17946} 17947 17948// NotDone returns true if the enumeration should be started or is not yet complete. 17949func (iter UsagesListResultIterator) NotDone() bool { 17950 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 17951} 17952 17953// Response returns the raw server response from the last page request. 17954func (iter UsagesListResultIterator) Response() UsagesListResult { 17955 return iter.page.Response() 17956} 17957 17958// Value returns the current value or a zero-initialized value if the 17959// iterator has advanced beyond the end of the collection. 17960func (iter UsagesListResultIterator) Value() Usage { 17961 if !iter.page.NotDone() { 17962 return Usage{} 17963 } 17964 return iter.page.Values()[iter.i] 17965} 17966 17967// Creates a new instance of the UsagesListResultIterator type. 17968func NewUsagesListResultIterator(page UsagesListResultPage) UsagesListResultIterator { 17969 return UsagesListResultIterator{page: page} 17970} 17971 17972// IsEmpty returns true if the ListResult contains no values. 17973func (ulr UsagesListResult) IsEmpty() bool { 17974 return ulr.Value == nil || len(*ulr.Value) == 0 17975} 17976 17977// hasNextLink returns true if the NextLink is not empty. 17978func (ulr UsagesListResult) hasNextLink() bool { 17979 return ulr.NextLink != nil && len(*ulr.NextLink) != 0 17980} 17981 17982// usagesListResultPreparer prepares a request to retrieve the next set of results. 17983// It returns nil if no more results exist. 17984func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) { 17985 if !ulr.hasNextLink() { 17986 return nil, nil 17987 } 17988 return autorest.Prepare((&http.Request{}).WithContext(ctx), 17989 autorest.AsJSON(), 17990 autorest.AsGet(), 17991 autorest.WithBaseURL(to.String(ulr.NextLink))) 17992} 17993 17994// UsagesListResultPage contains a page of Usage values. 17995type UsagesListResultPage struct { 17996 fn func(context.Context, UsagesListResult) (UsagesListResult, error) 17997 ulr UsagesListResult 17998} 17999 18000// NextWithContext advances to the next page of values. If there was an error making 18001// the request the page does not advance and the error is returned. 18002func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err error) { 18003 if tracing.IsEnabled() { 18004 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultPage.NextWithContext") 18005 defer func() { 18006 sc := -1 18007 if page.Response().Response.Response != nil { 18008 sc = page.Response().Response.Response.StatusCode 18009 } 18010 tracing.EndSpan(ctx, sc, err) 18011 }() 18012 } 18013 for { 18014 next, err := page.fn(ctx, page.ulr) 18015 if err != nil { 18016 return err 18017 } 18018 page.ulr = next 18019 if !next.hasNextLink() || !next.IsEmpty() { 18020 break 18021 } 18022 } 18023 return nil 18024} 18025 18026// Next advances to the next page of values. If there was an error making 18027// the request the page does not advance and the error is returned. 18028// Deprecated: Use NextWithContext() instead. 18029func (page *UsagesListResultPage) Next() error { 18030 return page.NextWithContext(context.Background()) 18031} 18032 18033// NotDone returns true if the page enumeration should be started or is not yet complete. 18034func (page UsagesListResultPage) NotDone() bool { 18035 return !page.ulr.IsEmpty() 18036} 18037 18038// Response returns the raw server response from the last page request. 18039func (page UsagesListResultPage) Response() UsagesListResult { 18040 return page.ulr 18041} 18042 18043// Values returns the slice of values for the current page or nil if there are no values. 18044func (page UsagesListResultPage) Values() []Usage { 18045 if page.ulr.IsEmpty() { 18046 return nil 18047 } 18048 return *page.ulr.Value 18049} 18050 18051// Creates a new instance of the UsagesListResultPage type. 18052func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage { 18053 return UsagesListResultPage{ 18054 fn: getNextPage, 18055 ulr: cur, 18056 } 18057} 18058 18059// VerificationIPFlowParameters parameters that define the IP flow to be verified. 18060type VerificationIPFlowParameters struct { 18061 // TargetResourceID - The ID of the target resource to perform next-hop on. 18062 TargetResourceID *string `json:"targetResourceId,omitempty"` 18063 // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' 18064 Direction Direction `json:"direction,omitempty"` 18065 // Protocol - Protocol to be verified on. Possible values include: 'IPFlowProtocolTCP', 'IPFlowProtocolUDP' 18066 Protocol IPFlowProtocol `json:"protocol,omitempty"` 18067 // LocalPort - The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. 18068 LocalPort *string `json:"localPort,omitempty"` 18069 // RemotePort - The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. 18070 RemotePort *string `json:"remotePort,omitempty"` 18071 // LocalIPAddress - The local IP address. Acceptable values are valid IPv4 addresses. 18072 LocalIPAddress *string `json:"localIPAddress,omitempty"` 18073 // RemoteIPAddress - The remote IP address. Acceptable values are valid IPv4 addresses. 18074 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` 18075 // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). 18076 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` 18077} 18078 18079// VerificationIPFlowResult results of IP flow verification on the target resource. 18080type VerificationIPFlowResult struct { 18081 autorest.Response `json:"-"` 18082 // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' 18083 Access Access `json:"access,omitempty"` 18084 // RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed. 18085 RuleName *string `json:"ruleName,omitempty"` 18086} 18087 18088// VirtualHub virtualHub Resource. 18089type VirtualHub struct { 18090 autorest.Response `json:"-"` 18091 *VirtualHubProperties `json:"properties,omitempty"` 18092 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 18093 Etag *string `json:"etag,omitempty"` 18094 // ID - Resource ID. 18095 ID *string `json:"id,omitempty"` 18096 // Name - READ-ONLY; Resource name. 18097 Name *string `json:"name,omitempty"` 18098 // Type - READ-ONLY; Resource type. 18099 Type *string `json:"type,omitempty"` 18100 // Location - Resource location. 18101 Location *string `json:"location,omitempty"` 18102 // Tags - Resource tags. 18103 Tags map[string]*string `json:"tags"` 18104} 18105 18106// MarshalJSON is the custom marshaler for VirtualHub. 18107func (vh VirtualHub) MarshalJSON() ([]byte, error) { 18108 objectMap := make(map[string]interface{}) 18109 if vh.VirtualHubProperties != nil { 18110 objectMap["properties"] = vh.VirtualHubProperties 18111 } 18112 if vh.ID != nil { 18113 objectMap["id"] = vh.ID 18114 } 18115 if vh.Location != nil { 18116 objectMap["location"] = vh.Location 18117 } 18118 if vh.Tags != nil { 18119 objectMap["tags"] = vh.Tags 18120 } 18121 return json.Marshal(objectMap) 18122} 18123 18124// UnmarshalJSON is the custom unmarshaler for VirtualHub struct. 18125func (vh *VirtualHub) UnmarshalJSON(body []byte) error { 18126 var m map[string]*json.RawMessage 18127 err := json.Unmarshal(body, &m) 18128 if err != nil { 18129 return err 18130 } 18131 for k, v := range m { 18132 switch k { 18133 case "properties": 18134 if v != nil { 18135 var virtualHubProperties VirtualHubProperties 18136 err = json.Unmarshal(*v, &virtualHubProperties) 18137 if err != nil { 18138 return err 18139 } 18140 vh.VirtualHubProperties = &virtualHubProperties 18141 } 18142 case "etag": 18143 if v != nil { 18144 var etag string 18145 err = json.Unmarshal(*v, &etag) 18146 if err != nil { 18147 return err 18148 } 18149 vh.Etag = &etag 18150 } 18151 case "id": 18152 if v != nil { 18153 var ID string 18154 err = json.Unmarshal(*v, &ID) 18155 if err != nil { 18156 return err 18157 } 18158 vh.ID = &ID 18159 } 18160 case "name": 18161 if v != nil { 18162 var name string 18163 err = json.Unmarshal(*v, &name) 18164 if err != nil { 18165 return err 18166 } 18167 vh.Name = &name 18168 } 18169 case "type": 18170 if v != nil { 18171 var typeVar string 18172 err = json.Unmarshal(*v, &typeVar) 18173 if err != nil { 18174 return err 18175 } 18176 vh.Type = &typeVar 18177 } 18178 case "location": 18179 if v != nil { 18180 var location string 18181 err = json.Unmarshal(*v, &location) 18182 if err != nil { 18183 return err 18184 } 18185 vh.Location = &location 18186 } 18187 case "tags": 18188 if v != nil { 18189 var tags map[string]*string 18190 err = json.Unmarshal(*v, &tags) 18191 if err != nil { 18192 return err 18193 } 18194 vh.Tags = tags 18195 } 18196 } 18197 } 18198 18199 return nil 18200} 18201 18202// VirtualHubProperties parameters for VirtualHub 18203type VirtualHubProperties struct { 18204 // VirtualWan - The VirtualWAN to which the VirtualHub belongs 18205 VirtualWan *SubResource `json:"virtualWan,omitempty"` 18206 // HubVirtualNetworkConnections - list of all vnet connections with this VirtualHub. 18207 HubVirtualNetworkConnections *[]HubVirtualNetworkConnection `json:"hubVirtualNetworkConnections,omitempty"` 18208 // AddressPrefix - Address-prefix for this VirtualHub. 18209 AddressPrefix *string `json:"addressPrefix,omitempty"` 18210 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 18211 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 18212} 18213 18214// VirtualHubsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 18215// long-running operation. 18216type VirtualHubsCreateOrUpdateFuture struct { 18217 azure.FutureAPI 18218 // Result returns the result of the asynchronous operation. 18219 // If the operation has not completed it will return an error. 18220 Result func(VirtualHubsClient) (VirtualHub, error) 18221} 18222 18223// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18224func (future *VirtualHubsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 18225 var azFuture azure.Future 18226 if err := json.Unmarshal(body, &azFuture); err != nil { 18227 return err 18228 } 18229 future.FutureAPI = &azFuture 18230 future.Result = future.result 18231 return nil 18232} 18233 18234// result is the default implementation for VirtualHubsCreateOrUpdateFuture.Result. 18235func (future *VirtualHubsCreateOrUpdateFuture) result(client VirtualHubsClient) (vh VirtualHub, err error) { 18236 var done bool 18237 done, err = future.DoneWithContext(context.Background(), client) 18238 if err != nil { 18239 err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 18240 return 18241 } 18242 if !done { 18243 vh.Response.Response = future.Response() 18244 err = azure.NewAsyncOpIncompleteError("network.VirtualHubsCreateOrUpdateFuture") 18245 return 18246 } 18247 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18248 if vh.Response.Response, err = future.GetResult(sender); err == nil && vh.Response.Response.StatusCode != http.StatusNoContent { 18249 vh, err = client.CreateOrUpdateResponder(vh.Response.Response) 18250 if err != nil { 18251 err = autorest.NewErrorWithError(err, "network.VirtualHubsCreateOrUpdateFuture", "Result", vh.Response.Response, "Failure responding to request") 18252 } 18253 } 18254 return 18255} 18256 18257// VirtualHubsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 18258// operation. 18259type VirtualHubsDeleteFuture struct { 18260 azure.FutureAPI 18261 // Result returns the result of the asynchronous operation. 18262 // If the operation has not completed it will return an error. 18263 Result func(VirtualHubsClient) (autorest.Response, error) 18264} 18265 18266// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18267func (future *VirtualHubsDeleteFuture) UnmarshalJSON(body []byte) error { 18268 var azFuture azure.Future 18269 if err := json.Unmarshal(body, &azFuture); err != nil { 18270 return err 18271 } 18272 future.FutureAPI = &azFuture 18273 future.Result = future.result 18274 return nil 18275} 18276 18277// result is the default implementation for VirtualHubsDeleteFuture.Result. 18278func (future *VirtualHubsDeleteFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { 18279 var done bool 18280 done, err = future.DoneWithContext(context.Background(), client) 18281 if err != nil { 18282 err = autorest.NewErrorWithError(err, "network.VirtualHubsDeleteFuture", "Result", future.Response(), "Polling failure") 18283 return 18284 } 18285 if !done { 18286 ar.Response = future.Response() 18287 err = azure.NewAsyncOpIncompleteError("network.VirtualHubsDeleteFuture") 18288 return 18289 } 18290 ar.Response = future.Response() 18291 return 18292} 18293 18294// VirtualHubsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running 18295// operation. 18296type VirtualHubsUpdateTagsFuture struct { 18297 azure.FutureAPI 18298 // Result returns the result of the asynchronous operation. 18299 // If the operation has not completed it will return an error. 18300 Result func(VirtualHubsClient) (VirtualHub, error) 18301} 18302 18303// UnmarshalJSON is the custom unmarshaller for CreateFuture. 18304func (future *VirtualHubsUpdateTagsFuture) UnmarshalJSON(body []byte) error { 18305 var azFuture azure.Future 18306 if err := json.Unmarshal(body, &azFuture); err != nil { 18307 return err 18308 } 18309 future.FutureAPI = &azFuture 18310 future.Result = future.result 18311 return nil 18312} 18313 18314// result is the default implementation for VirtualHubsUpdateTagsFuture.Result. 18315func (future *VirtualHubsUpdateTagsFuture) result(client VirtualHubsClient) (vh VirtualHub, err error) { 18316 var done bool 18317 done, err = future.DoneWithContext(context.Background(), client) 18318 if err != nil { 18319 err = autorest.NewErrorWithError(err, "network.VirtualHubsUpdateTagsFuture", "Result", future.Response(), "Polling failure") 18320 return 18321 } 18322 if !done { 18323 vh.Response.Response = future.Response() 18324 err = azure.NewAsyncOpIncompleteError("network.VirtualHubsUpdateTagsFuture") 18325 return 18326 } 18327 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18328 if vh.Response.Response, err = future.GetResult(sender); err == nil && vh.Response.Response.StatusCode != http.StatusNoContent { 18329 vh, err = client.UpdateTagsResponder(vh.Response.Response) 18330 if err != nil { 18331 err = autorest.NewErrorWithError(err, "network.VirtualHubsUpdateTagsFuture", "Result", vh.Response.Response, "Failure responding to request") 18332 } 18333 } 18334 return 18335} 18336 18337// VirtualNetwork virtual Network resource. 18338type VirtualNetwork struct { 18339 autorest.Response `json:"-"` 18340 // VirtualNetworkPropertiesFormat - Properties of the virtual network. 18341 *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` 18342 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 18343 Etag *string `json:"etag,omitempty"` 18344 // ID - Resource ID. 18345 ID *string `json:"id,omitempty"` 18346 // Name - READ-ONLY; Resource name. 18347 Name *string `json:"name,omitempty"` 18348 // Type - READ-ONLY; Resource type. 18349 Type *string `json:"type,omitempty"` 18350 // Location - Resource location. 18351 Location *string `json:"location,omitempty"` 18352 // Tags - Resource tags. 18353 Tags map[string]*string `json:"tags"` 18354} 18355 18356// MarshalJSON is the custom marshaler for VirtualNetwork. 18357func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { 18358 objectMap := make(map[string]interface{}) 18359 if vn.VirtualNetworkPropertiesFormat != nil { 18360 objectMap["properties"] = vn.VirtualNetworkPropertiesFormat 18361 } 18362 if vn.Etag != nil { 18363 objectMap["etag"] = vn.Etag 18364 } 18365 if vn.ID != nil { 18366 objectMap["id"] = vn.ID 18367 } 18368 if vn.Location != nil { 18369 objectMap["location"] = vn.Location 18370 } 18371 if vn.Tags != nil { 18372 objectMap["tags"] = vn.Tags 18373 } 18374 return json.Marshal(objectMap) 18375} 18376 18377// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. 18378func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { 18379 var m map[string]*json.RawMessage 18380 err := json.Unmarshal(body, &m) 18381 if err != nil { 18382 return err 18383 } 18384 for k, v := range m { 18385 switch k { 18386 case "properties": 18387 if v != nil { 18388 var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat 18389 err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat) 18390 if err != nil { 18391 return err 18392 } 18393 vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat 18394 } 18395 case "etag": 18396 if v != nil { 18397 var etag string 18398 err = json.Unmarshal(*v, &etag) 18399 if err != nil { 18400 return err 18401 } 18402 vn.Etag = &etag 18403 } 18404 case "id": 18405 if v != nil { 18406 var ID string 18407 err = json.Unmarshal(*v, &ID) 18408 if err != nil { 18409 return err 18410 } 18411 vn.ID = &ID 18412 } 18413 case "name": 18414 if v != nil { 18415 var name string 18416 err = json.Unmarshal(*v, &name) 18417 if err != nil { 18418 return err 18419 } 18420 vn.Name = &name 18421 } 18422 case "type": 18423 if v != nil { 18424 var typeVar string 18425 err = json.Unmarshal(*v, &typeVar) 18426 if err != nil { 18427 return err 18428 } 18429 vn.Type = &typeVar 18430 } 18431 case "location": 18432 if v != nil { 18433 var location string 18434 err = json.Unmarshal(*v, &location) 18435 if err != nil { 18436 return err 18437 } 18438 vn.Location = &location 18439 } 18440 case "tags": 18441 if v != nil { 18442 var tags map[string]*string 18443 err = json.Unmarshal(*v, &tags) 18444 if err != nil { 18445 return err 18446 } 18447 vn.Tags = tags 18448 } 18449 } 18450 } 18451 18452 return nil 18453} 18454 18455// VirtualNetworkConnectionGatewayReference a reference to VirtualNetworkGateway or LocalNetworkGateway 18456// resource. 18457type VirtualNetworkConnectionGatewayReference struct { 18458 // ID - The ID of VirtualNetworkGateway or LocalNetworkGateway resource. 18459 ID *string `json:"id,omitempty"` 18460} 18461 18462// VirtualNetworkGateway a common class for general resource information 18463type VirtualNetworkGateway struct { 18464 autorest.Response `json:"-"` 18465 // VirtualNetworkGatewayPropertiesFormat - Properties of the virtual network gateway. 18466 *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 18467 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 18468 Etag *string `json:"etag,omitempty"` 18469 // ID - Resource ID. 18470 ID *string `json:"id,omitempty"` 18471 // Name - READ-ONLY; Resource name. 18472 Name *string `json:"name,omitempty"` 18473 // Type - READ-ONLY; Resource type. 18474 Type *string `json:"type,omitempty"` 18475 // Location - Resource location. 18476 Location *string `json:"location,omitempty"` 18477 // Tags - Resource tags. 18478 Tags map[string]*string `json:"tags"` 18479} 18480 18481// MarshalJSON is the custom marshaler for VirtualNetworkGateway. 18482func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { 18483 objectMap := make(map[string]interface{}) 18484 if vng.VirtualNetworkGatewayPropertiesFormat != nil { 18485 objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat 18486 } 18487 if vng.Etag != nil { 18488 objectMap["etag"] = vng.Etag 18489 } 18490 if vng.ID != nil { 18491 objectMap["id"] = vng.ID 18492 } 18493 if vng.Location != nil { 18494 objectMap["location"] = vng.Location 18495 } 18496 if vng.Tags != nil { 18497 objectMap["tags"] = vng.Tags 18498 } 18499 return json.Marshal(objectMap) 18500} 18501 18502// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. 18503func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { 18504 var m map[string]*json.RawMessage 18505 err := json.Unmarshal(body, &m) 18506 if err != nil { 18507 return err 18508 } 18509 for k, v := range m { 18510 switch k { 18511 case "properties": 18512 if v != nil { 18513 var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat 18514 err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat) 18515 if err != nil { 18516 return err 18517 } 18518 vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat 18519 } 18520 case "etag": 18521 if v != nil { 18522 var etag string 18523 err = json.Unmarshal(*v, &etag) 18524 if err != nil { 18525 return err 18526 } 18527 vng.Etag = &etag 18528 } 18529 case "id": 18530 if v != nil { 18531 var ID string 18532 err = json.Unmarshal(*v, &ID) 18533 if err != nil { 18534 return err 18535 } 18536 vng.ID = &ID 18537 } 18538 case "name": 18539 if v != nil { 18540 var name string 18541 err = json.Unmarshal(*v, &name) 18542 if err != nil { 18543 return err 18544 } 18545 vng.Name = &name 18546 } 18547 case "type": 18548 if v != nil { 18549 var typeVar string 18550 err = json.Unmarshal(*v, &typeVar) 18551 if err != nil { 18552 return err 18553 } 18554 vng.Type = &typeVar 18555 } 18556 case "location": 18557 if v != nil { 18558 var location string 18559 err = json.Unmarshal(*v, &location) 18560 if err != nil { 18561 return err 18562 } 18563 vng.Location = &location 18564 } 18565 case "tags": 18566 if v != nil { 18567 var tags map[string]*string 18568 err = json.Unmarshal(*v, &tags) 18569 if err != nil { 18570 return err 18571 } 18572 vng.Tags = tags 18573 } 18574 } 18575 } 18576 18577 return nil 18578} 18579 18580// VirtualNetworkGatewayConnection a common class for general resource information 18581type VirtualNetworkGatewayConnection struct { 18582 autorest.Response `json:"-"` 18583 // VirtualNetworkGatewayConnectionPropertiesFormat - Properties of the virtual network gateway connection. 18584 *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` 18585 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 18586 Etag *string `json:"etag,omitempty"` 18587 // ID - Resource ID. 18588 ID *string `json:"id,omitempty"` 18589 // Name - READ-ONLY; Resource name. 18590 Name *string `json:"name,omitempty"` 18591 // Type - READ-ONLY; Resource type. 18592 Type *string `json:"type,omitempty"` 18593 // Location - Resource location. 18594 Location *string `json:"location,omitempty"` 18595 // Tags - Resource tags. 18596 Tags map[string]*string `json:"tags"` 18597} 18598 18599// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection. 18600func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { 18601 objectMap := make(map[string]interface{}) 18602 if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil { 18603 objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat 18604 } 18605 if vngc.Etag != nil { 18606 objectMap["etag"] = vngc.Etag 18607 } 18608 if vngc.ID != nil { 18609 objectMap["id"] = vngc.ID 18610 } 18611 if vngc.Location != nil { 18612 objectMap["location"] = vngc.Location 18613 } 18614 if vngc.Tags != nil { 18615 objectMap["tags"] = vngc.Tags 18616 } 18617 return json.Marshal(objectMap) 18618} 18619 18620// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. 18621func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { 18622 var m map[string]*json.RawMessage 18623 err := json.Unmarshal(body, &m) 18624 if err != nil { 18625 return err 18626 } 18627 for k, v := range m { 18628 switch k { 18629 case "properties": 18630 if v != nil { 18631 var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat 18632 err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat) 18633 if err != nil { 18634 return err 18635 } 18636 vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat 18637 } 18638 case "etag": 18639 if v != nil { 18640 var etag string 18641 err = json.Unmarshal(*v, &etag) 18642 if err != nil { 18643 return err 18644 } 18645 vngc.Etag = &etag 18646 } 18647 case "id": 18648 if v != nil { 18649 var ID string 18650 err = json.Unmarshal(*v, &ID) 18651 if err != nil { 18652 return err 18653 } 18654 vngc.ID = &ID 18655 } 18656 case "name": 18657 if v != nil { 18658 var name string 18659 err = json.Unmarshal(*v, &name) 18660 if err != nil { 18661 return err 18662 } 18663 vngc.Name = &name 18664 } 18665 case "type": 18666 if v != nil { 18667 var typeVar string 18668 err = json.Unmarshal(*v, &typeVar) 18669 if err != nil { 18670 return err 18671 } 18672 vngc.Type = &typeVar 18673 } 18674 case "location": 18675 if v != nil { 18676 var location string 18677 err = json.Unmarshal(*v, &location) 18678 if err != nil { 18679 return err 18680 } 18681 vngc.Location = &location 18682 } 18683 case "tags": 18684 if v != nil { 18685 var tags map[string]*string 18686 err = json.Unmarshal(*v, &tags) 18687 if err != nil { 18688 return err 18689 } 18690 vngc.Tags = tags 18691 } 18692 } 18693 } 18694 18695 return nil 18696} 18697 18698// VirtualNetworkGatewayConnectionListEntity a common class for general resource information 18699type VirtualNetworkGatewayConnectionListEntity struct { 18700 // VirtualNetworkGatewayConnectionListEntityPropertiesFormat - Properties of the virtual network gateway connection. 18701 *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` 18702 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 18703 Etag *string `json:"etag,omitempty"` 18704 // ID - Resource ID. 18705 ID *string `json:"id,omitempty"` 18706 // Name - READ-ONLY; Resource name. 18707 Name *string `json:"name,omitempty"` 18708 // Type - READ-ONLY; Resource type. 18709 Type *string `json:"type,omitempty"` 18710 // Location - Resource location. 18711 Location *string `json:"location,omitempty"` 18712 // Tags - Resource tags. 18713 Tags map[string]*string `json:"tags"` 18714} 18715 18716// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntity. 18717func (vngcle VirtualNetworkGatewayConnectionListEntity) MarshalJSON() ([]byte, error) { 18718 objectMap := make(map[string]interface{}) 18719 if vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat != nil { 18720 objectMap["properties"] = vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat 18721 } 18722 if vngcle.Etag != nil { 18723 objectMap["etag"] = vngcle.Etag 18724 } 18725 if vngcle.ID != nil { 18726 objectMap["id"] = vngcle.ID 18727 } 18728 if vngcle.Location != nil { 18729 objectMap["location"] = vngcle.Location 18730 } 18731 if vngcle.Tags != nil { 18732 objectMap["tags"] = vngcle.Tags 18733 } 18734 return json.Marshal(objectMap) 18735} 18736 18737// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnectionListEntity struct. 18738func (vngcle *VirtualNetworkGatewayConnectionListEntity) UnmarshalJSON(body []byte) error { 18739 var m map[string]*json.RawMessage 18740 err := json.Unmarshal(body, &m) 18741 if err != nil { 18742 return err 18743 } 18744 for k, v := range m { 18745 switch k { 18746 case "properties": 18747 if v != nil { 18748 var virtualNetworkGatewayConnectionListEntityPropertiesFormat VirtualNetworkGatewayConnectionListEntityPropertiesFormat 18749 err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionListEntityPropertiesFormat) 18750 if err != nil { 18751 return err 18752 } 18753 vngcle.VirtualNetworkGatewayConnectionListEntityPropertiesFormat = &virtualNetworkGatewayConnectionListEntityPropertiesFormat 18754 } 18755 case "etag": 18756 if v != nil { 18757 var etag string 18758 err = json.Unmarshal(*v, &etag) 18759 if err != nil { 18760 return err 18761 } 18762 vngcle.Etag = &etag 18763 } 18764 case "id": 18765 if v != nil { 18766 var ID string 18767 err = json.Unmarshal(*v, &ID) 18768 if err != nil { 18769 return err 18770 } 18771 vngcle.ID = &ID 18772 } 18773 case "name": 18774 if v != nil { 18775 var name string 18776 err = json.Unmarshal(*v, &name) 18777 if err != nil { 18778 return err 18779 } 18780 vngcle.Name = &name 18781 } 18782 case "type": 18783 if v != nil { 18784 var typeVar string 18785 err = json.Unmarshal(*v, &typeVar) 18786 if err != nil { 18787 return err 18788 } 18789 vngcle.Type = &typeVar 18790 } 18791 case "location": 18792 if v != nil { 18793 var location string 18794 err = json.Unmarshal(*v, &location) 18795 if err != nil { 18796 return err 18797 } 18798 vngcle.Location = &location 18799 } 18800 case "tags": 18801 if v != nil { 18802 var tags map[string]*string 18803 err = json.Unmarshal(*v, &tags) 18804 if err != nil { 18805 return err 18806 } 18807 vngcle.Tags = tags 18808 } 18809 } 18810 } 18811 18812 return nil 18813} 18814 18815// VirtualNetworkGatewayConnectionListEntityPropertiesFormat virtualNetworkGatewayConnection properties 18816type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { 18817 // AuthorizationKey - The authorizationKey. 18818 AuthorizationKey *string `json:"authorizationKey,omitempty"` 18819 // VirtualNetworkGateway1 - The reference to virtual network gateway resource. 18820 VirtualNetworkGateway1 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1,omitempty"` 18821 // VirtualNetworkGateway2 - The reference to virtual network gateway resource. 18822 VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` 18823 // LocalNetworkGateway2 - The reference to local network gateway resource. 18824 LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` 18825 // ConnectionType - Gateway connection type. Possible values are: 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' 18826 ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` 18827 // RoutingWeight - The routing weight. 18828 RoutingWeight *int32 `json:"routingWeight,omitempty"` 18829 // SharedKey - The IPSec shared key. 18830 SharedKey *string `json:"sharedKey,omitempty"` 18831 // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' 18832 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 18833 // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status. 18834 TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` 18835 // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection. 18836 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 18837 // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection. 18838 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 18839 // Peer - The reference to peerings resource. 18840 Peer *SubResource `json:"peer,omitempty"` 18841 // EnableBgp - EnableBgp flag 18842 EnableBgp *bool `json:"enableBgp,omitempty"` 18843 // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. 18844 UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` 18845 // IpsecPolicies - The IPSec Policies to be considered by this connection. 18846 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` 18847 // ResourceGUID - The resource GUID property of the VirtualNetworkGatewayConnection resource. 18848 ResourceGUID *string `json:"resourceGuid,omitempty"` 18849 // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 18850 ProvisioningState *string `json:"provisioningState,omitempty"` 18851} 18852 18853// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntityPropertiesFormat. 18854func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) MarshalJSON() ([]byte, error) { 18855 objectMap := make(map[string]interface{}) 18856 if vngclepf.AuthorizationKey != nil { 18857 objectMap["authorizationKey"] = vngclepf.AuthorizationKey 18858 } 18859 if vngclepf.VirtualNetworkGateway1 != nil { 18860 objectMap["virtualNetworkGateway1"] = vngclepf.VirtualNetworkGateway1 18861 } 18862 if vngclepf.VirtualNetworkGateway2 != nil { 18863 objectMap["virtualNetworkGateway2"] = vngclepf.VirtualNetworkGateway2 18864 } 18865 if vngclepf.LocalNetworkGateway2 != nil { 18866 objectMap["localNetworkGateway2"] = vngclepf.LocalNetworkGateway2 18867 } 18868 if vngclepf.ConnectionType != "" { 18869 objectMap["connectionType"] = vngclepf.ConnectionType 18870 } 18871 if vngclepf.RoutingWeight != nil { 18872 objectMap["routingWeight"] = vngclepf.RoutingWeight 18873 } 18874 if vngclepf.SharedKey != nil { 18875 objectMap["sharedKey"] = vngclepf.SharedKey 18876 } 18877 if vngclepf.Peer != nil { 18878 objectMap["peer"] = vngclepf.Peer 18879 } 18880 if vngclepf.EnableBgp != nil { 18881 objectMap["enableBgp"] = vngclepf.EnableBgp 18882 } 18883 if vngclepf.UsePolicyBasedTrafficSelectors != nil { 18884 objectMap["usePolicyBasedTrafficSelectors"] = vngclepf.UsePolicyBasedTrafficSelectors 18885 } 18886 if vngclepf.IpsecPolicies != nil { 18887 objectMap["ipsecPolicies"] = vngclepf.IpsecPolicies 18888 } 18889 if vngclepf.ResourceGUID != nil { 18890 objectMap["resourceGuid"] = vngclepf.ResourceGUID 18891 } 18892 return json.Marshal(objectMap) 18893} 18894 18895// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API 18896// service call 18897type VirtualNetworkGatewayConnectionListResult struct { 18898 autorest.Response `json:"-"` 18899 // Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. 18900 Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` 18901 // NextLink - READ-ONLY; The URL to get the next set of results. 18902 NextLink *string `json:"nextLink,omitempty"` 18903} 18904 18905// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListResult. 18906func (vngclr VirtualNetworkGatewayConnectionListResult) MarshalJSON() ([]byte, error) { 18907 objectMap := make(map[string]interface{}) 18908 if vngclr.Value != nil { 18909 objectMap["value"] = vngclr.Value 18910 } 18911 return json.Marshal(objectMap) 18912} 18913 18914// VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of 18915// VirtualNetworkGatewayConnection values. 18916type VirtualNetworkGatewayConnectionListResultIterator struct { 18917 i int 18918 page VirtualNetworkGatewayConnectionListResultPage 18919} 18920 18921// NextWithContext advances to the next value. If there was an error making 18922// the request the iterator does not advance and the error is returned. 18923func (iter *VirtualNetworkGatewayConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 18924 if tracing.IsEnabled() { 18925 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultIterator.NextWithContext") 18926 defer func() { 18927 sc := -1 18928 if iter.Response().Response.Response != nil { 18929 sc = iter.Response().Response.Response.StatusCode 18930 } 18931 tracing.EndSpan(ctx, sc, err) 18932 }() 18933 } 18934 iter.i++ 18935 if iter.i < len(iter.page.Values()) { 18936 return nil 18937 } 18938 err = iter.page.NextWithContext(ctx) 18939 if err != nil { 18940 iter.i-- 18941 return err 18942 } 18943 iter.i = 0 18944 return nil 18945} 18946 18947// Next advances to the next value. If there was an error making 18948// the request the iterator does not advance and the error is returned. 18949// Deprecated: Use NextWithContext() instead. 18950func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error { 18951 return iter.NextWithContext(context.Background()) 18952} 18953 18954// NotDone returns true if the enumeration should be started or is not yet complete. 18955func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool { 18956 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 18957} 18958 18959// Response returns the raw server response from the last page request. 18960func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult { 18961 return iter.page.Response() 18962} 18963 18964// Value returns the current value or a zero-initialized value if the 18965// iterator has advanced beyond the end of the collection. 18966func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection { 18967 if !iter.page.NotDone() { 18968 return VirtualNetworkGatewayConnection{} 18969 } 18970 return iter.page.Values()[iter.i] 18971} 18972 18973// Creates a new instance of the VirtualNetworkGatewayConnectionListResultIterator type. 18974func NewVirtualNetworkGatewayConnectionListResultIterator(page VirtualNetworkGatewayConnectionListResultPage) VirtualNetworkGatewayConnectionListResultIterator { 18975 return VirtualNetworkGatewayConnectionListResultIterator{page: page} 18976} 18977 18978// IsEmpty returns true if the ListResult contains no values. 18979func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { 18980 return vngclr.Value == nil || len(*vngclr.Value) == 0 18981} 18982 18983// hasNextLink returns true if the NextLink is not empty. 18984func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool { 18985 return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0 18986} 18987 18988// virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. 18989// It returns nil if no more results exist. 18990func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 18991 if !vngclr.hasNextLink() { 18992 return nil, nil 18993 } 18994 return autorest.Prepare((&http.Request{}).WithContext(ctx), 18995 autorest.AsJSON(), 18996 autorest.AsGet(), 18997 autorest.WithBaseURL(to.String(vngclr.NextLink))) 18998} 18999 19000// VirtualNetworkGatewayConnectionListResultPage contains a page of VirtualNetworkGatewayConnection values. 19001type VirtualNetworkGatewayConnectionListResultPage struct { 19002 fn func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error) 19003 vngclr VirtualNetworkGatewayConnectionListResult 19004} 19005 19006// NextWithContext advances to the next page of values. If there was an error making 19007// the request the page does not advance and the error is returned. 19008func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 19009 if tracing.IsEnabled() { 19010 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultPage.NextWithContext") 19011 defer func() { 19012 sc := -1 19013 if page.Response().Response.Response != nil { 19014 sc = page.Response().Response.Response.StatusCode 19015 } 19016 tracing.EndSpan(ctx, sc, err) 19017 }() 19018 } 19019 for { 19020 next, err := page.fn(ctx, page.vngclr) 19021 if err != nil { 19022 return err 19023 } 19024 page.vngclr = next 19025 if !next.hasNextLink() || !next.IsEmpty() { 19026 break 19027 } 19028 } 19029 return nil 19030} 19031 19032// Next advances to the next page of values. If there was an error making 19033// the request the page does not advance and the error is returned. 19034// Deprecated: Use NextWithContext() instead. 19035func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error { 19036 return page.NextWithContext(context.Background()) 19037} 19038 19039// NotDone returns true if the page enumeration should be started or is not yet complete. 19040func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool { 19041 return !page.vngclr.IsEmpty() 19042} 19043 19044// Response returns the raw server response from the last page request. 19045func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult { 19046 return page.vngclr 19047} 19048 19049// Values returns the slice of values for the current page or nil if there are no values. 19050func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection { 19051 if page.vngclr.IsEmpty() { 19052 return nil 19053 } 19054 return *page.vngclr.Value 19055} 19056 19057// Creates a new instance of the VirtualNetworkGatewayConnectionListResultPage type. 19058func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage { 19059 return VirtualNetworkGatewayConnectionListResultPage{ 19060 fn: getNextPage, 19061 vngclr: cur, 19062 } 19063} 19064 19065// VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties 19066type VirtualNetworkGatewayConnectionPropertiesFormat struct { 19067 // AuthorizationKey - The authorizationKey. 19068 AuthorizationKey *string `json:"authorizationKey,omitempty"` 19069 // VirtualNetworkGateway1 - The reference to virtual network gateway resource. 19070 VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` 19071 // VirtualNetworkGateway2 - The reference to virtual network gateway resource. 19072 VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` 19073 // LocalNetworkGateway2 - The reference to local network gateway resource. 19074 LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` 19075 // ConnectionType - Gateway connection type. Possible values are: 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' 19076 ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` 19077 // RoutingWeight - The routing weight. 19078 RoutingWeight *int32 `json:"routingWeight,omitempty"` 19079 // SharedKey - The IPSec shared key. 19080 SharedKey *string `json:"sharedKey,omitempty"` 19081 // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' 19082 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 19083 // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status. 19084 TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` 19085 // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection. 19086 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 19087 // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection. 19088 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 19089 // Peer - The reference to peerings resource. 19090 Peer *SubResource `json:"peer,omitempty"` 19091 // EnableBgp - EnableBgp flag 19092 EnableBgp *bool `json:"enableBgp,omitempty"` 19093 // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. 19094 UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` 19095 // IpsecPolicies - The IPSec Policies to be considered by this connection. 19096 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` 19097 // ResourceGUID - The resource GUID property of the VirtualNetworkGatewayConnection resource. 19098 ResourceGUID *string `json:"resourceGuid,omitempty"` 19099 // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 19100 ProvisioningState *string `json:"provisioningState,omitempty"` 19101} 19102 19103// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat. 19104func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { 19105 objectMap := make(map[string]interface{}) 19106 if vngcpf.AuthorizationKey != nil { 19107 objectMap["authorizationKey"] = vngcpf.AuthorizationKey 19108 } 19109 if vngcpf.VirtualNetworkGateway1 != nil { 19110 objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1 19111 } 19112 if vngcpf.VirtualNetworkGateway2 != nil { 19113 objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2 19114 } 19115 if vngcpf.LocalNetworkGateway2 != nil { 19116 objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2 19117 } 19118 if vngcpf.ConnectionType != "" { 19119 objectMap["connectionType"] = vngcpf.ConnectionType 19120 } 19121 if vngcpf.RoutingWeight != nil { 19122 objectMap["routingWeight"] = vngcpf.RoutingWeight 19123 } 19124 if vngcpf.SharedKey != nil { 19125 objectMap["sharedKey"] = vngcpf.SharedKey 19126 } 19127 if vngcpf.Peer != nil { 19128 objectMap["peer"] = vngcpf.Peer 19129 } 19130 if vngcpf.EnableBgp != nil { 19131 objectMap["enableBgp"] = vngcpf.EnableBgp 19132 } 19133 if vngcpf.UsePolicyBasedTrafficSelectors != nil { 19134 objectMap["usePolicyBasedTrafficSelectors"] = vngcpf.UsePolicyBasedTrafficSelectors 19135 } 19136 if vngcpf.IpsecPolicies != nil { 19137 objectMap["ipsecPolicies"] = vngcpf.IpsecPolicies 19138 } 19139 if vngcpf.ResourceGUID != nil { 19140 objectMap["resourceGuid"] = vngcpf.ResourceGUID 19141 } 19142 return json.Marshal(objectMap) 19143} 19144 19145// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 19146// results of a long-running operation. 19147type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { 19148 azure.FutureAPI 19149 // Result returns the result of the asynchronous operation. 19150 // If the operation has not completed it will return an error. 19151 Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) 19152} 19153 19154// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19155func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 19156 var azFuture azure.Future 19157 if err := json.Unmarshal(body, &azFuture); err != nil { 19158 return err 19159 } 19160 future.FutureAPI = &azFuture 19161 future.Result = future.result 19162 return nil 19163} 19164 19165// result is the default implementation for VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.Result. 19166func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { 19167 var done bool 19168 done, err = future.DoneWithContext(context.Background(), client) 19169 if err != nil { 19170 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 19171 return 19172 } 19173 if !done { 19174 vngc.Response.Response = future.Response() 19175 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") 19176 return 19177 } 19178 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19179 if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { 19180 vngc, err = client.CreateOrUpdateResponder(vngc.Response.Response) 19181 if err != nil { 19182 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", vngc.Response.Response, "Failure responding to request") 19183 } 19184 } 19185 return 19186} 19187 19188// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of 19189// a long-running operation. 19190type VirtualNetworkGatewayConnectionsDeleteFuture struct { 19191 azure.FutureAPI 19192 // Result returns the result of the asynchronous operation. 19193 // If the operation has not completed it will return an error. 19194 Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) 19195} 19196 19197// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19198func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 19199 var azFuture azure.Future 19200 if err := json.Unmarshal(body, &azFuture); err != nil { 19201 return err 19202 } 19203 future.FutureAPI = &azFuture 19204 future.Result = future.result 19205 return nil 19206} 19207 19208// result is the default implementation for VirtualNetworkGatewayConnectionsDeleteFuture.Result. 19209func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { 19210 var done bool 19211 done, err = future.DoneWithContext(context.Background(), client) 19212 if err != nil { 19213 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 19214 return 19215 } 19216 if !done { 19217 ar.Response = future.Response() 19218 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") 19219 return 19220 } 19221 ar.Response = future.Response() 19222 return 19223} 19224 19225// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the 19226// results of a long-running operation. 19227type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { 19228 azure.FutureAPI 19229 // Result returns the result of the asynchronous operation. 19230 // If the operation has not completed it will return an error. 19231 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error) 19232} 19233 19234// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19235func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error { 19236 var azFuture azure.Future 19237 if err := json.Unmarshal(body, &azFuture); err != nil { 19238 return err 19239 } 19240 future.FutureAPI = &azFuture 19241 future.Result = future.result 19242 return nil 19243} 19244 19245// result is the default implementation for VirtualNetworkGatewayConnectionsResetSharedKeyFuture.Result. 19246func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { 19247 var done bool 19248 done, err = future.DoneWithContext(context.Background(), client) 19249 if err != nil { 19250 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure") 19251 return 19252 } 19253 if !done { 19254 crsk.Response.Response = future.Response() 19255 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") 19256 return 19257 } 19258 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19259 if crsk.Response.Response, err = future.GetResult(sender); err == nil && crsk.Response.Response.StatusCode != http.StatusNoContent { 19260 crsk, err = client.ResetSharedKeyResponder(crsk.Response.Response) 19261 if err != nil { 19262 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", crsk.Response.Response, "Failure responding to request") 19263 } 19264 } 19265 return 19266} 19267 19268// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the 19269// results of a long-running operation. 19270type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { 19271 azure.FutureAPI 19272 // Result returns the result of the asynchronous operation. 19273 // If the operation has not completed it will return an error. 19274 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error) 19275} 19276 19277// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19278func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error { 19279 var azFuture azure.Future 19280 if err := json.Unmarshal(body, &azFuture); err != nil { 19281 return err 19282 } 19283 future.FutureAPI = &azFuture 19284 future.Result = future.result 19285 return nil 19286} 19287 19288// result is the default implementation for VirtualNetworkGatewayConnectionsSetSharedKeyFuture.Result. 19289func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { 19290 var done bool 19291 done, err = future.DoneWithContext(context.Background(), client) 19292 if err != nil { 19293 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure") 19294 return 19295 } 19296 if !done { 19297 csk.Response.Response = future.Response() 19298 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") 19299 return 19300 } 19301 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19302 if csk.Response.Response, err = future.GetResult(sender); err == nil && csk.Response.Response.StatusCode != http.StatusNoContent { 19303 csk, err = client.SetSharedKeyResponder(csk.Response.Response) 19304 if err != nil { 19305 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", csk.Response.Response, "Failure responding to request") 19306 } 19307 } 19308 return 19309} 19310 19311// VirtualNetworkGatewayConnectionsUpdateTagsFuture an abstraction for monitoring and retrieving the 19312// results of a long-running operation. 19313type VirtualNetworkGatewayConnectionsUpdateTagsFuture struct { 19314 azure.FutureAPI 19315 // Result returns the result of the asynchronous operation. 19316 // If the operation has not completed it will return an error. 19317 Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) 19318} 19319 19320// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19321func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) UnmarshalJSON(body []byte) error { 19322 var azFuture azure.Future 19323 if err := json.Unmarshal(body, &azFuture); err != nil { 19324 return err 19325 } 19326 future.FutureAPI = &azFuture 19327 future.Result = future.result 19328 return nil 19329} 19330 19331// result is the default implementation for VirtualNetworkGatewayConnectionsUpdateTagsFuture.Result. 19332func (future *VirtualNetworkGatewayConnectionsUpdateTagsFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { 19333 var done bool 19334 done, err = future.DoneWithContext(context.Background(), client) 19335 if err != nil { 19336 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", future.Response(), "Polling failure") 19337 return 19338 } 19339 if !done { 19340 vngc.Response.Response = future.Response() 19341 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsUpdateTagsFuture") 19342 return 19343 } 19344 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19345 if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { 19346 vngc, err = client.UpdateTagsResponder(vngc.Response.Response) 19347 if err != nil { 19348 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsUpdateTagsFuture", "Result", vngc.Response.Response, "Failure responding to request") 19349 } 19350 } 19351 return 19352} 19353 19354// VirtualNetworkGatewayIPConfiguration IP configuration for virtual network gateway 19355type VirtualNetworkGatewayIPConfiguration struct { 19356 // VirtualNetworkGatewayIPConfigurationPropertiesFormat - Properties of the virtual network gateway ip configuration. 19357 *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 19358 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 19359 Name *string `json:"name,omitempty"` 19360 // Etag - A unique read-only string that changes whenever the resource is updated. 19361 Etag *string `json:"etag,omitempty"` 19362 // ID - Resource ID. 19363 ID *string `json:"id,omitempty"` 19364} 19365 19366// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration. 19367func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 19368 objectMap := make(map[string]interface{}) 19369 if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil { 19370 objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat 19371 } 19372 if vngic.Name != nil { 19373 objectMap["name"] = vngic.Name 19374 } 19375 if vngic.Etag != nil { 19376 objectMap["etag"] = vngic.Etag 19377 } 19378 if vngic.ID != nil { 19379 objectMap["id"] = vngic.ID 19380 } 19381 return json.Marshal(objectMap) 19382} 19383 19384// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. 19385func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 19386 var m map[string]*json.RawMessage 19387 err := json.Unmarshal(body, &m) 19388 if err != nil { 19389 return err 19390 } 19391 for k, v := range m { 19392 switch k { 19393 case "properties": 19394 if v != nil { 19395 var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat 19396 err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat) 19397 if err != nil { 19398 return err 19399 } 19400 vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat 19401 } 19402 case "name": 19403 if v != nil { 19404 var name string 19405 err = json.Unmarshal(*v, &name) 19406 if err != nil { 19407 return err 19408 } 19409 vngic.Name = &name 19410 } 19411 case "etag": 19412 if v != nil { 19413 var etag string 19414 err = json.Unmarshal(*v, &etag) 19415 if err != nil { 19416 return err 19417 } 19418 vngic.Etag = &etag 19419 } 19420 case "id": 19421 if v != nil { 19422 var ID string 19423 err = json.Unmarshal(*v, &ID) 19424 if err != nil { 19425 return err 19426 } 19427 vngic.ID = &ID 19428 } 19429 } 19430 } 19431 19432 return nil 19433} 19434 19435// VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration 19436type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { 19437 // PrivateIPAllocationMethod - The private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 19438 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 19439 // Subnet - The reference of the subnet resource. 19440 Subnet *SubResource `json:"subnet,omitempty"` 19441 // PublicIPAddress - The reference of the public IP resource. 19442 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 19443 // ProvisioningState - READ-ONLY; The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 19444 ProvisioningState *string `json:"provisioningState,omitempty"` 19445} 19446 19447// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfigurationPropertiesFormat. 19448func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { 19449 objectMap := make(map[string]interface{}) 19450 if vngicpf.PrivateIPAllocationMethod != "" { 19451 objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod 19452 } 19453 if vngicpf.Subnet != nil { 19454 objectMap["subnet"] = vngicpf.Subnet 19455 } 19456 if vngicpf.PublicIPAddress != nil { 19457 objectMap["publicIPAddress"] = vngicpf.PublicIPAddress 19458 } 19459 return json.Marshal(objectMap) 19460} 19461 19462// VirtualNetworkGatewayListConnectionsResult response for the VirtualNetworkGatewayListConnections API 19463// service call 19464type VirtualNetworkGatewayListConnectionsResult struct { 19465 autorest.Response `json:"-"` 19466 // Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. 19467 Value *[]VirtualNetworkGatewayConnectionListEntity `json:"value,omitempty"` 19468 // NextLink - READ-ONLY; The URL to get the next set of results. 19469 NextLink *string `json:"nextLink,omitempty"` 19470} 19471 19472// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListConnectionsResult. 19473func (vnglcr VirtualNetworkGatewayListConnectionsResult) MarshalJSON() ([]byte, error) { 19474 objectMap := make(map[string]interface{}) 19475 if vnglcr.Value != nil { 19476 objectMap["value"] = vnglcr.Value 19477 } 19478 return json.Marshal(objectMap) 19479} 19480 19481// VirtualNetworkGatewayListConnectionsResultIterator provides access to a complete listing of 19482// VirtualNetworkGatewayConnectionListEntity values. 19483type VirtualNetworkGatewayListConnectionsResultIterator struct { 19484 i int 19485 page VirtualNetworkGatewayListConnectionsResultPage 19486} 19487 19488// NextWithContext advances to the next value. If there was an error making 19489// the request the iterator does not advance and the error is returned. 19490func (iter *VirtualNetworkGatewayListConnectionsResultIterator) NextWithContext(ctx context.Context) (err error) { 19491 if tracing.IsEnabled() { 19492 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultIterator.NextWithContext") 19493 defer func() { 19494 sc := -1 19495 if iter.Response().Response.Response != nil { 19496 sc = iter.Response().Response.Response.StatusCode 19497 } 19498 tracing.EndSpan(ctx, sc, err) 19499 }() 19500 } 19501 iter.i++ 19502 if iter.i < len(iter.page.Values()) { 19503 return nil 19504 } 19505 err = iter.page.NextWithContext(ctx) 19506 if err != nil { 19507 iter.i-- 19508 return err 19509 } 19510 iter.i = 0 19511 return nil 19512} 19513 19514// Next advances to the next value. If there was an error making 19515// the request the iterator does not advance and the error is returned. 19516// Deprecated: Use NextWithContext() instead. 19517func (iter *VirtualNetworkGatewayListConnectionsResultIterator) Next() error { 19518 return iter.NextWithContext(context.Background()) 19519} 19520 19521// NotDone returns true if the enumeration should be started or is not yet complete. 19522func (iter VirtualNetworkGatewayListConnectionsResultIterator) NotDone() bool { 19523 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 19524} 19525 19526// Response returns the raw server response from the last page request. 19527func (iter VirtualNetworkGatewayListConnectionsResultIterator) Response() VirtualNetworkGatewayListConnectionsResult { 19528 return iter.page.Response() 19529} 19530 19531// Value returns the current value or a zero-initialized value if the 19532// iterator has advanced beyond the end of the collection. 19533func (iter VirtualNetworkGatewayListConnectionsResultIterator) Value() VirtualNetworkGatewayConnectionListEntity { 19534 if !iter.page.NotDone() { 19535 return VirtualNetworkGatewayConnectionListEntity{} 19536 } 19537 return iter.page.Values()[iter.i] 19538} 19539 19540// Creates a new instance of the VirtualNetworkGatewayListConnectionsResultIterator type. 19541func NewVirtualNetworkGatewayListConnectionsResultIterator(page VirtualNetworkGatewayListConnectionsResultPage) VirtualNetworkGatewayListConnectionsResultIterator { 19542 return VirtualNetworkGatewayListConnectionsResultIterator{page: page} 19543} 19544 19545// IsEmpty returns true if the ListResult contains no values. 19546func (vnglcr VirtualNetworkGatewayListConnectionsResult) IsEmpty() bool { 19547 return vnglcr.Value == nil || len(*vnglcr.Value) == 0 19548} 19549 19550// hasNextLink returns true if the NextLink is not empty. 19551func (vnglcr VirtualNetworkGatewayListConnectionsResult) hasNextLink() bool { 19552 return vnglcr.NextLink != nil && len(*vnglcr.NextLink) != 0 19553} 19554 19555// virtualNetworkGatewayListConnectionsResultPreparer prepares a request to retrieve the next set of results. 19556// It returns nil if no more results exist. 19557func (vnglcr VirtualNetworkGatewayListConnectionsResult) virtualNetworkGatewayListConnectionsResultPreparer(ctx context.Context) (*http.Request, error) { 19558 if !vnglcr.hasNextLink() { 19559 return nil, nil 19560 } 19561 return autorest.Prepare((&http.Request{}).WithContext(ctx), 19562 autorest.AsJSON(), 19563 autorest.AsGet(), 19564 autorest.WithBaseURL(to.String(vnglcr.NextLink))) 19565} 19566 19567// VirtualNetworkGatewayListConnectionsResultPage contains a page of 19568// VirtualNetworkGatewayConnectionListEntity values. 19569type VirtualNetworkGatewayListConnectionsResultPage struct { 19570 fn func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error) 19571 vnglcr VirtualNetworkGatewayListConnectionsResult 19572} 19573 19574// NextWithContext advances to the next page of values. If there was an error making 19575// the request the page does not advance and the error is returned. 19576func (page *VirtualNetworkGatewayListConnectionsResultPage) NextWithContext(ctx context.Context) (err error) { 19577 if tracing.IsEnabled() { 19578 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListConnectionsResultPage.NextWithContext") 19579 defer func() { 19580 sc := -1 19581 if page.Response().Response.Response != nil { 19582 sc = page.Response().Response.Response.StatusCode 19583 } 19584 tracing.EndSpan(ctx, sc, err) 19585 }() 19586 } 19587 for { 19588 next, err := page.fn(ctx, page.vnglcr) 19589 if err != nil { 19590 return err 19591 } 19592 page.vnglcr = next 19593 if !next.hasNextLink() || !next.IsEmpty() { 19594 break 19595 } 19596 } 19597 return nil 19598} 19599 19600// Next advances to the next page of values. If there was an error making 19601// the request the page does not advance and the error is returned. 19602// Deprecated: Use NextWithContext() instead. 19603func (page *VirtualNetworkGatewayListConnectionsResultPage) Next() error { 19604 return page.NextWithContext(context.Background()) 19605} 19606 19607// NotDone returns true if the page enumeration should be started or is not yet complete. 19608func (page VirtualNetworkGatewayListConnectionsResultPage) NotDone() bool { 19609 return !page.vnglcr.IsEmpty() 19610} 19611 19612// Response returns the raw server response from the last page request. 19613func (page VirtualNetworkGatewayListConnectionsResultPage) Response() VirtualNetworkGatewayListConnectionsResult { 19614 return page.vnglcr 19615} 19616 19617// Values returns the slice of values for the current page or nil if there are no values. 19618func (page VirtualNetworkGatewayListConnectionsResultPage) Values() []VirtualNetworkGatewayConnectionListEntity { 19619 if page.vnglcr.IsEmpty() { 19620 return nil 19621 } 19622 return *page.vnglcr.Value 19623} 19624 19625// Creates a new instance of the VirtualNetworkGatewayListConnectionsResultPage type. 19626func NewVirtualNetworkGatewayListConnectionsResultPage(cur VirtualNetworkGatewayListConnectionsResult, getNextPage func(context.Context, VirtualNetworkGatewayListConnectionsResult) (VirtualNetworkGatewayListConnectionsResult, error)) VirtualNetworkGatewayListConnectionsResultPage { 19627 return VirtualNetworkGatewayListConnectionsResultPage{ 19628 fn: getNextPage, 19629 vnglcr: cur, 19630 } 19631} 19632 19633// VirtualNetworkGatewayListResult response for the ListVirtualNetworkGateways API service call. 19634type VirtualNetworkGatewayListResult struct { 19635 autorest.Response `json:"-"` 19636 // Value - Gets a list of VirtualNetworkGateway resources that exists in a resource group. 19637 Value *[]VirtualNetworkGateway `json:"value,omitempty"` 19638 // NextLink - READ-ONLY; The URL to get the next set of results. 19639 NextLink *string `json:"nextLink,omitempty"` 19640} 19641 19642// MarshalJSON is the custom marshaler for VirtualNetworkGatewayListResult. 19643func (vnglr VirtualNetworkGatewayListResult) MarshalJSON() ([]byte, error) { 19644 objectMap := make(map[string]interface{}) 19645 if vnglr.Value != nil { 19646 objectMap["value"] = vnglr.Value 19647 } 19648 return json.Marshal(objectMap) 19649} 19650 19651// VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway 19652// values. 19653type VirtualNetworkGatewayListResultIterator struct { 19654 i int 19655 page VirtualNetworkGatewayListResultPage 19656} 19657 19658// NextWithContext advances to the next value. If there was an error making 19659// the request the iterator does not advance and the error is returned. 19660func (iter *VirtualNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 19661 if tracing.IsEnabled() { 19662 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultIterator.NextWithContext") 19663 defer func() { 19664 sc := -1 19665 if iter.Response().Response.Response != nil { 19666 sc = iter.Response().Response.Response.StatusCode 19667 } 19668 tracing.EndSpan(ctx, sc, err) 19669 }() 19670 } 19671 iter.i++ 19672 if iter.i < len(iter.page.Values()) { 19673 return nil 19674 } 19675 err = iter.page.NextWithContext(ctx) 19676 if err != nil { 19677 iter.i-- 19678 return err 19679 } 19680 iter.i = 0 19681 return nil 19682} 19683 19684// Next advances to the next value. If there was an error making 19685// the request the iterator does not advance and the error is returned. 19686// Deprecated: Use NextWithContext() instead. 19687func (iter *VirtualNetworkGatewayListResultIterator) Next() error { 19688 return iter.NextWithContext(context.Background()) 19689} 19690 19691// NotDone returns true if the enumeration should be started or is not yet complete. 19692func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool { 19693 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 19694} 19695 19696// Response returns the raw server response from the last page request. 19697func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult { 19698 return iter.page.Response() 19699} 19700 19701// Value returns the current value or a zero-initialized value if the 19702// iterator has advanced beyond the end of the collection. 19703func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway { 19704 if !iter.page.NotDone() { 19705 return VirtualNetworkGateway{} 19706 } 19707 return iter.page.Values()[iter.i] 19708} 19709 19710// Creates a new instance of the VirtualNetworkGatewayListResultIterator type. 19711func NewVirtualNetworkGatewayListResultIterator(page VirtualNetworkGatewayListResultPage) VirtualNetworkGatewayListResultIterator { 19712 return VirtualNetworkGatewayListResultIterator{page: page} 19713} 19714 19715// IsEmpty returns true if the ListResult contains no values. 19716func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { 19717 return vnglr.Value == nil || len(*vnglr.Value) == 0 19718} 19719 19720// hasNextLink returns true if the NextLink is not empty. 19721func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool { 19722 return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0 19723} 19724 19725// virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 19726// It returns nil if no more results exist. 19727func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 19728 if !vnglr.hasNextLink() { 19729 return nil, nil 19730 } 19731 return autorest.Prepare((&http.Request{}).WithContext(ctx), 19732 autorest.AsJSON(), 19733 autorest.AsGet(), 19734 autorest.WithBaseURL(to.String(vnglr.NextLink))) 19735} 19736 19737// VirtualNetworkGatewayListResultPage contains a page of VirtualNetworkGateway values. 19738type VirtualNetworkGatewayListResultPage struct { 19739 fn func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error) 19740 vnglr VirtualNetworkGatewayListResult 19741} 19742 19743// NextWithContext advances to the next page of values. If there was an error making 19744// the request the page does not advance and the error is returned. 19745func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 19746 if tracing.IsEnabled() { 19747 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultPage.NextWithContext") 19748 defer func() { 19749 sc := -1 19750 if page.Response().Response.Response != nil { 19751 sc = page.Response().Response.Response.StatusCode 19752 } 19753 tracing.EndSpan(ctx, sc, err) 19754 }() 19755 } 19756 for { 19757 next, err := page.fn(ctx, page.vnglr) 19758 if err != nil { 19759 return err 19760 } 19761 page.vnglr = next 19762 if !next.hasNextLink() || !next.IsEmpty() { 19763 break 19764 } 19765 } 19766 return nil 19767} 19768 19769// Next advances to the next page of values. If there was an error making 19770// the request the page does not advance and the error is returned. 19771// Deprecated: Use NextWithContext() instead. 19772func (page *VirtualNetworkGatewayListResultPage) Next() error { 19773 return page.NextWithContext(context.Background()) 19774} 19775 19776// NotDone returns true if the page enumeration should be started or is not yet complete. 19777func (page VirtualNetworkGatewayListResultPage) NotDone() bool { 19778 return !page.vnglr.IsEmpty() 19779} 19780 19781// Response returns the raw server response from the last page request. 19782func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult { 19783 return page.vnglr 19784} 19785 19786// Values returns the slice of values for the current page or nil if there are no values. 19787func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway { 19788 if page.vnglr.IsEmpty() { 19789 return nil 19790 } 19791 return *page.vnglr.Value 19792} 19793 19794// Creates a new instance of the VirtualNetworkGatewayListResultPage type. 19795func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage { 19796 return VirtualNetworkGatewayListResultPage{ 19797 fn: getNextPage, 19798 vnglr: cur, 19799 } 19800} 19801 19802// VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties 19803type VirtualNetworkGatewayPropertiesFormat struct { 19804 // IPConfigurations - IP configurations for virtual network gateway. 19805 IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` 19806 // GatewayType - The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute' 19807 GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` 19808 // VpnType - The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' 19809 VpnType VpnType `json:"vpnType,omitempty"` 19810 // EnableBgp - Whether BGP is enabled for this virtual network gateway or not. 19811 EnableBgp *bool `json:"enableBgp,omitempty"` 19812 // ActiveActive - ActiveActive flag 19813 ActiveActive *bool `json:"activeActive,omitempty"` 19814 // GatewayDefaultSite - The reference of the LocalNetworkGateway resource which represents local network site having default routes. Assign Null value in case of removing existing default site setting. 19815 GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` 19816 // Sku - The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. 19817 Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` 19818 // VpnClientConfiguration - The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. 19819 VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` 19820 // BgpSettings - Virtual network gateway's BGP speaker settings. 19821 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 19822 // ResourceGUID - The resource GUID property of the VirtualNetworkGateway resource. 19823 ResourceGUID *string `json:"resourceGuid,omitempty"` 19824 // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 19825 ProvisioningState *string `json:"provisioningState,omitempty"` 19826} 19827 19828// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. 19829func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { 19830 objectMap := make(map[string]interface{}) 19831 if vngpf.IPConfigurations != nil { 19832 objectMap["ipConfigurations"] = vngpf.IPConfigurations 19833 } 19834 if vngpf.GatewayType != "" { 19835 objectMap["gatewayType"] = vngpf.GatewayType 19836 } 19837 if vngpf.VpnType != "" { 19838 objectMap["vpnType"] = vngpf.VpnType 19839 } 19840 if vngpf.EnableBgp != nil { 19841 objectMap["enableBgp"] = vngpf.EnableBgp 19842 } 19843 if vngpf.ActiveActive != nil { 19844 objectMap["activeActive"] = vngpf.ActiveActive 19845 } 19846 if vngpf.GatewayDefaultSite != nil { 19847 objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite 19848 } 19849 if vngpf.Sku != nil { 19850 objectMap["sku"] = vngpf.Sku 19851 } 19852 if vngpf.VpnClientConfiguration != nil { 19853 objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration 19854 } 19855 if vngpf.BgpSettings != nil { 19856 objectMap["bgpSettings"] = vngpf.BgpSettings 19857 } 19858 if vngpf.ResourceGUID != nil { 19859 objectMap["resourceGuid"] = vngpf.ResourceGUID 19860 } 19861 return json.Marshal(objectMap) 19862} 19863 19864// VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 19865// long-running operation. 19866type VirtualNetworkGatewaysCreateOrUpdateFuture struct { 19867 azure.FutureAPI 19868 // Result returns the result of the asynchronous operation. 19869 // If the operation has not completed it will return an error. 19870 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) 19871} 19872 19873// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19874func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 19875 var azFuture azure.Future 19876 if err := json.Unmarshal(body, &azFuture); err != nil { 19877 return err 19878 } 19879 future.FutureAPI = &azFuture 19880 future.Result = future.result 19881 return nil 19882} 19883 19884// result is the default implementation for VirtualNetworkGatewaysCreateOrUpdateFuture.Result. 19885func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 19886 var done bool 19887 done, err = future.DoneWithContext(context.Background(), client) 19888 if err != nil { 19889 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 19890 return 19891 } 19892 if !done { 19893 vng.Response.Response = future.Response() 19894 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") 19895 return 19896 } 19897 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19898 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { 19899 vng, err = client.CreateOrUpdateResponder(vng.Response.Response) 19900 if err != nil { 19901 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", vng.Response.Response, "Failure responding to request") 19902 } 19903 } 19904 return 19905} 19906 19907// VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 19908// long-running operation. 19909type VirtualNetworkGatewaysDeleteFuture struct { 19910 azure.FutureAPI 19911 // Result returns the result of the asynchronous operation. 19912 // If the operation has not completed it will return an error. 19913 Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) 19914} 19915 19916// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19917func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 19918 var azFuture azure.Future 19919 if err := json.Unmarshal(body, &azFuture); err != nil { 19920 return err 19921 } 19922 future.FutureAPI = &azFuture 19923 future.Result = future.result 19924 return nil 19925} 19926 19927// result is the default implementation for VirtualNetworkGatewaysDeleteFuture.Result. 19928func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { 19929 var done bool 19930 done, err = future.DoneWithContext(context.Background(), client) 19931 if err != nil { 19932 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 19933 return 19934 } 19935 if !done { 19936 ar.Response = future.Response() 19937 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") 19938 return 19939 } 19940 ar.Response = future.Response() 19941 return 19942} 19943 19944// VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the 19945// results of a long-running operation. 19946type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct { 19947 azure.FutureAPI 19948 // Result returns the result of the asynchronous operation. 19949 // If the operation has not completed it will return an error. 19950 Result func(VirtualNetworkGatewaysClient) (String, error) 19951} 19952 19953// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19954func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) UnmarshalJSON(body []byte) error { 19955 var azFuture azure.Future 19956 if err := json.Unmarshal(body, &azFuture); err != nil { 19957 return err 19958 } 19959 future.FutureAPI = &azFuture 19960 future.Result = future.result 19961 return nil 19962} 19963 19964// result is the default implementation for VirtualNetworkGatewaysGeneratevpnclientpackageFuture.Result. 19965func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { 19966 var done bool 19967 done, err = future.DoneWithContext(context.Background(), client) 19968 if err != nil { 19969 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure") 19970 return 19971 } 19972 if !done { 19973 s.Response.Response = future.Response() 19974 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture") 19975 return 19976 } 19977 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19978 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 19979 s, err = client.GeneratevpnclientpackageResponder(s.Response.Response) 19980 if err != nil { 19981 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", s.Response.Response, "Failure responding to request") 19982 } 19983 } 19984 return 19985} 19986 19987// VirtualNetworkGatewaysGenerateVpnProfileFuture an abstraction for monitoring and retrieving the results 19988// of a long-running operation. 19989type VirtualNetworkGatewaysGenerateVpnProfileFuture struct { 19990 azure.FutureAPI 19991 // Result returns the result of the asynchronous operation. 19992 // If the operation has not completed it will return an error. 19993 Result func(VirtualNetworkGatewaysClient) (String, error) 19994} 19995 19996// UnmarshalJSON is the custom unmarshaller for CreateFuture. 19997func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) UnmarshalJSON(body []byte) error { 19998 var azFuture azure.Future 19999 if err := json.Unmarshal(body, &azFuture); err != nil { 20000 return err 20001 } 20002 future.FutureAPI = &azFuture 20003 future.Result = future.result 20004 return nil 20005} 20006 20007// result is the default implementation for VirtualNetworkGatewaysGenerateVpnProfileFuture.Result. 20008func (future *VirtualNetworkGatewaysGenerateVpnProfileFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { 20009 var done bool 20010 done, err = future.DoneWithContext(context.Background(), client) 20011 if err != nil { 20012 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", future.Response(), "Polling failure") 20013 return 20014 } 20015 if !done { 20016 s.Response.Response = future.Response() 20017 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGenerateVpnProfileFuture") 20018 return 20019 } 20020 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20021 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 20022 s, err = client.GenerateVpnProfileResponder(s.Response.Response) 20023 if err != nil { 20024 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGenerateVpnProfileFuture", "Result", s.Response.Response, "Failure responding to request") 20025 } 20026 } 20027 return 20028} 20029 20030// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results 20031// of a long-running operation. 20032type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct { 20033 azure.FutureAPI 20034 // Result returns the result of the asynchronous operation. 20035 // If the operation has not completed it will return an error. 20036 Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) 20037} 20038 20039// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20040func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error { 20041 var azFuture azure.Future 20042 if err := json.Unmarshal(body, &azFuture); err != nil { 20043 return err 20044 } 20045 future.FutureAPI = &azFuture 20046 future.Result = future.result 20047 return nil 20048} 20049 20050// result is the default implementation for VirtualNetworkGatewaysGetAdvertisedRoutesFuture.Result. 20051func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { 20052 var done bool 20053 done, err = future.DoneWithContext(context.Background(), client) 20054 if err != nil { 20055 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure") 20056 return 20057 } 20058 if !done { 20059 grlr.Response.Response = future.Response() 20060 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture") 20061 return 20062 } 20063 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20064 if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { 20065 grlr, err = client.GetAdvertisedRoutesResponder(grlr.Response.Response) 20066 if err != nil { 20067 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") 20068 } 20069 } 20070 return 20071} 20072 20073// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of 20074// a long-running operation. 20075type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct { 20076 azure.FutureAPI 20077 // Result returns the result of the asynchronous operation. 20078 // If the operation has not completed it will return an error. 20079 Result func(VirtualNetworkGatewaysClient) (BgpPeerStatusListResult, error) 20080} 20081 20082// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20083func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) UnmarshalJSON(body []byte) error { 20084 var azFuture azure.Future 20085 if err := json.Unmarshal(body, &azFuture); err != nil { 20086 return err 20087 } 20088 future.FutureAPI = &azFuture 20089 future.Result = future.result 20090 return nil 20091} 20092 20093// result is the default implementation for VirtualNetworkGatewaysGetBgpPeerStatusFuture.Result. 20094func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) { 20095 var done bool 20096 done, err = future.DoneWithContext(context.Background(), client) 20097 if err != nil { 20098 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure") 20099 return 20100 } 20101 if !done { 20102 bpslr.Response.Response = future.Response() 20103 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture") 20104 return 20105 } 20106 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20107 if bpslr.Response.Response, err = future.GetResult(sender); err == nil && bpslr.Response.Response.StatusCode != http.StatusNoContent { 20108 bpslr, err = client.GetBgpPeerStatusResponder(bpslr.Response.Response) 20109 if err != nil { 20110 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", bpslr.Response.Response, "Failure responding to request") 20111 } 20112 } 20113 return 20114} 20115 20116// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of 20117// a long-running operation. 20118type VirtualNetworkGatewaysGetLearnedRoutesFuture struct { 20119 azure.FutureAPI 20120 // Result returns the result of the asynchronous operation. 20121 // If the operation has not completed it will return an error. 20122 Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) 20123} 20124 20125// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20126func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) UnmarshalJSON(body []byte) error { 20127 var azFuture azure.Future 20128 if err := json.Unmarshal(body, &azFuture); err != nil { 20129 return err 20130 } 20131 future.FutureAPI = &azFuture 20132 future.Result = future.result 20133 return nil 20134} 20135 20136// result is the default implementation for VirtualNetworkGatewaysGetLearnedRoutesFuture.Result. 20137func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { 20138 var done bool 20139 done, err = future.DoneWithContext(context.Background(), client) 20140 if err != nil { 20141 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure") 20142 return 20143 } 20144 if !done { 20145 grlr.Response.Response = future.Response() 20146 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture") 20147 return 20148 } 20149 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20150 if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { 20151 grlr, err = client.GetLearnedRoutesResponder(grlr.Response.Response) 20152 if err != nil { 20153 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") 20154 } 20155 } 20156 return 20157} 20158 20159// VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the 20160// results of a long-running operation. 20161type VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture struct { 20162 azure.FutureAPI 20163 // Result returns the result of the asynchronous operation. 20164 // If the operation has not completed it will return an error. 20165 Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) 20166} 20167 20168// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20169func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { 20170 var azFuture azure.Future 20171 if err := json.Unmarshal(body, &azFuture); err != nil { 20172 return err 20173 } 20174 future.FutureAPI = &azFuture 20175 future.Result = future.result 20176 return nil 20177} 20178 20179// result is the default implementation for VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture.Result. 20180func (future *VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { 20181 var done bool 20182 done, err = future.DoneWithContext(context.Background(), client) 20183 if err != nil { 20184 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure") 20185 return 20186 } 20187 if !done { 20188 vcipp.Response.Response = future.Response() 20189 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture") 20190 return 20191 } 20192 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20193 if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent { 20194 vcipp, err = client.GetVpnclientIpsecParametersResponder(vcipp.Response.Response) 20195 if err != nil { 20196 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request") 20197 } 20198 } 20199 return 20200} 20201 20202// VirtualNetworkGatewaysGetVpnProfilePackageURLFuture an abstraction for monitoring and retrieving the 20203// results of a long-running operation. 20204type VirtualNetworkGatewaysGetVpnProfilePackageURLFuture struct { 20205 azure.FutureAPI 20206 // Result returns the result of the asynchronous operation. 20207 // If the operation has not completed it will return an error. 20208 Result func(VirtualNetworkGatewaysClient) (String, error) 20209} 20210 20211// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20212func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) UnmarshalJSON(body []byte) error { 20213 var azFuture azure.Future 20214 if err := json.Unmarshal(body, &azFuture); err != nil { 20215 return err 20216 } 20217 future.FutureAPI = &azFuture 20218 future.Result = future.result 20219 return nil 20220} 20221 20222// result is the default implementation for VirtualNetworkGatewaysGetVpnProfilePackageURLFuture.Result. 20223func (future *VirtualNetworkGatewaysGetVpnProfilePackageURLFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { 20224 var done bool 20225 done, err = future.DoneWithContext(context.Background(), client) 20226 if err != nil { 20227 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", future.Response(), "Polling failure") 20228 return 20229 } 20230 if !done { 20231 s.Response.Response = future.Response() 20232 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture") 20233 return 20234 } 20235 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20236 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 20237 s, err = client.GetVpnProfilePackageURLResponder(s.Response.Response) 20238 if err != nil { 20239 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetVpnProfilePackageURLFuture", "Result", s.Response.Response, "Failure responding to request") 20240 } 20241 } 20242 return 20243} 20244 20245// VirtualNetworkGatewaySku virtualNetworkGatewaySku details 20246type VirtualNetworkGatewaySku struct { 20247 // Name - Gateway SKU name. Possible values include: 'VirtualNetworkGatewaySkuNameBasic', 'VirtualNetworkGatewaySkuNameHighPerformance', 'VirtualNetworkGatewaySkuNameStandard', 'VirtualNetworkGatewaySkuNameUltraPerformance', 'VirtualNetworkGatewaySkuNameVpnGw1', 'VirtualNetworkGatewaySkuNameVpnGw2', 'VirtualNetworkGatewaySkuNameVpnGw3', 'VirtualNetworkGatewaySkuNameVpnGw1AZ', 'VirtualNetworkGatewaySkuNameVpnGw2AZ', 'VirtualNetworkGatewaySkuNameVpnGw3AZ', 'VirtualNetworkGatewaySkuNameErGw1AZ', 'VirtualNetworkGatewaySkuNameErGw2AZ', 'VirtualNetworkGatewaySkuNameErGw3AZ' 20248 Name VirtualNetworkGatewaySkuName `json:"name,omitempty"` 20249 // Tier - Gateway SKU tier. Possible values include: 'VirtualNetworkGatewaySkuTierBasic', 'VirtualNetworkGatewaySkuTierHighPerformance', 'VirtualNetworkGatewaySkuTierStandard', 'VirtualNetworkGatewaySkuTierUltraPerformance', 'VirtualNetworkGatewaySkuTierVpnGw1', 'VirtualNetworkGatewaySkuTierVpnGw2', 'VirtualNetworkGatewaySkuTierVpnGw3', 'VirtualNetworkGatewaySkuTierVpnGw1AZ', 'VirtualNetworkGatewaySkuTierVpnGw2AZ', 'VirtualNetworkGatewaySkuTierVpnGw3AZ', 'VirtualNetworkGatewaySkuTierErGw1AZ', 'VirtualNetworkGatewaySkuTierErGw2AZ', 'VirtualNetworkGatewaySkuTierErGw3AZ' 20250 Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` 20251 // Capacity - The capacity. 20252 Capacity *int32 `json:"capacity,omitempty"` 20253} 20254 20255// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a 20256// long-running operation. 20257type VirtualNetworkGatewaysResetFuture struct { 20258 azure.FutureAPI 20259 // Result returns the result of the asynchronous operation. 20260 // If the operation has not completed it will return an error. 20261 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) 20262} 20263 20264// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20265func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error { 20266 var azFuture azure.Future 20267 if err := json.Unmarshal(body, &azFuture); err != nil { 20268 return err 20269 } 20270 future.FutureAPI = &azFuture 20271 future.Result = future.result 20272 return nil 20273} 20274 20275// result is the default implementation for VirtualNetworkGatewaysResetFuture.Result. 20276func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 20277 var done bool 20278 done, err = future.DoneWithContext(context.Background(), client) 20279 if err != nil { 20280 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure") 20281 return 20282 } 20283 if !done { 20284 vng.Response.Response = future.Response() 20285 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") 20286 return 20287 } 20288 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20289 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { 20290 vng, err = client.ResetResponder(vng.Response.Response) 20291 if err != nil { 20292 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", vng.Response.Response, "Failure responding to request") 20293 } 20294 } 20295 return 20296} 20297 20298// VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture an abstraction for monitoring and retrieving the 20299// results of a long-running operation. 20300type VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture struct { 20301 azure.FutureAPI 20302 // Result returns the result of the asynchronous operation. 20303 // If the operation has not completed it will return an error. 20304 Result func(VirtualNetworkGatewaysClient) (VpnClientIPsecParameters, error) 20305} 20306 20307// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20308func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) UnmarshalJSON(body []byte) error { 20309 var azFuture azure.Future 20310 if err := json.Unmarshal(body, &azFuture); err != nil { 20311 return err 20312 } 20313 future.FutureAPI = &azFuture 20314 future.Result = future.result 20315 return nil 20316} 20317 20318// result is the default implementation for VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture.Result. 20319func (future *VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture) result(client VirtualNetworkGatewaysClient) (vcipp VpnClientIPsecParameters, err error) { 20320 var done bool 20321 done, err = future.DoneWithContext(context.Background(), client) 20322 if err != nil { 20323 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", future.Response(), "Polling failure") 20324 return 20325 } 20326 if !done { 20327 vcipp.Response.Response = future.Response() 20328 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture") 20329 return 20330 } 20331 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20332 if vcipp.Response.Response, err = future.GetResult(sender); err == nil && vcipp.Response.Response.StatusCode != http.StatusNoContent { 20333 vcipp, err = client.SetVpnclientIpsecParametersResponder(vcipp.Response.Response) 20334 if err != nil { 20335 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysSetVpnclientIpsecParametersFuture", "Result", vcipp.Response.Response, "Failure responding to request") 20336 } 20337 } 20338 return 20339} 20340 20341// VirtualNetworkGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 20342// long-running operation. 20343type VirtualNetworkGatewaysUpdateTagsFuture struct { 20344 azure.FutureAPI 20345 // Result returns the result of the asynchronous operation. 20346 // If the operation has not completed it will return an error. 20347 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) 20348} 20349 20350// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20351func (future *VirtualNetworkGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { 20352 var azFuture azure.Future 20353 if err := json.Unmarshal(body, &azFuture); err != nil { 20354 return err 20355 } 20356 future.FutureAPI = &azFuture 20357 future.Result = future.result 20358 return nil 20359} 20360 20361// result is the default implementation for VirtualNetworkGatewaysUpdateTagsFuture.Result. 20362func (future *VirtualNetworkGatewaysUpdateTagsFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 20363 var done bool 20364 done, err = future.DoneWithContext(context.Background(), client) 20365 if err != nil { 20366 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") 20367 return 20368 } 20369 if !done { 20370 vng.Response.Response = future.Response() 20371 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysUpdateTagsFuture") 20372 return 20373 } 20374 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20375 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { 20376 vng, err = client.UpdateTagsResponder(vng.Response.Response) 20377 if err != nil { 20378 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysUpdateTagsFuture", "Result", vng.Response.Response, "Failure responding to request") 20379 } 20380 } 20381 return 20382} 20383 20384// VirtualNetworkListResult response for the ListVirtualNetworks API service call. 20385type VirtualNetworkListResult struct { 20386 autorest.Response `json:"-"` 20387 // Value - Gets a list of VirtualNetwork resources in a resource group. 20388 Value *[]VirtualNetwork `json:"value,omitempty"` 20389 // NextLink - The URL to get the next set of results. 20390 NextLink *string `json:"nextLink,omitempty"` 20391} 20392 20393// VirtualNetworkListResultIterator provides access to a complete listing of VirtualNetwork values. 20394type VirtualNetworkListResultIterator struct { 20395 i int 20396 page VirtualNetworkListResultPage 20397} 20398 20399// NextWithContext advances to the next value. If there was an error making 20400// the request the iterator does not advance and the error is returned. 20401func (iter *VirtualNetworkListResultIterator) NextWithContext(ctx context.Context) (err error) { 20402 if tracing.IsEnabled() { 20403 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultIterator.NextWithContext") 20404 defer func() { 20405 sc := -1 20406 if iter.Response().Response.Response != nil { 20407 sc = iter.Response().Response.Response.StatusCode 20408 } 20409 tracing.EndSpan(ctx, sc, err) 20410 }() 20411 } 20412 iter.i++ 20413 if iter.i < len(iter.page.Values()) { 20414 return nil 20415 } 20416 err = iter.page.NextWithContext(ctx) 20417 if err != nil { 20418 iter.i-- 20419 return err 20420 } 20421 iter.i = 0 20422 return nil 20423} 20424 20425// Next advances to the next value. If there was an error making 20426// the request the iterator does not advance and the error is returned. 20427// Deprecated: Use NextWithContext() instead. 20428func (iter *VirtualNetworkListResultIterator) Next() error { 20429 return iter.NextWithContext(context.Background()) 20430} 20431 20432// NotDone returns true if the enumeration should be started or is not yet complete. 20433func (iter VirtualNetworkListResultIterator) NotDone() bool { 20434 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 20435} 20436 20437// Response returns the raw server response from the last page request. 20438func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult { 20439 return iter.page.Response() 20440} 20441 20442// Value returns the current value or a zero-initialized value if the 20443// iterator has advanced beyond the end of the collection. 20444func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork { 20445 if !iter.page.NotDone() { 20446 return VirtualNetwork{} 20447 } 20448 return iter.page.Values()[iter.i] 20449} 20450 20451// Creates a new instance of the VirtualNetworkListResultIterator type. 20452func NewVirtualNetworkListResultIterator(page VirtualNetworkListResultPage) VirtualNetworkListResultIterator { 20453 return VirtualNetworkListResultIterator{page: page} 20454} 20455 20456// IsEmpty returns true if the ListResult contains no values. 20457func (vnlr VirtualNetworkListResult) IsEmpty() bool { 20458 return vnlr.Value == nil || len(*vnlr.Value) == 0 20459} 20460 20461// hasNextLink returns true if the NextLink is not empty. 20462func (vnlr VirtualNetworkListResult) hasNextLink() bool { 20463 return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0 20464} 20465 20466// virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. 20467// It returns nil if no more results exist. 20468func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) { 20469 if !vnlr.hasNextLink() { 20470 return nil, nil 20471 } 20472 return autorest.Prepare((&http.Request{}).WithContext(ctx), 20473 autorest.AsJSON(), 20474 autorest.AsGet(), 20475 autorest.WithBaseURL(to.String(vnlr.NextLink))) 20476} 20477 20478// VirtualNetworkListResultPage contains a page of VirtualNetwork values. 20479type VirtualNetworkListResultPage struct { 20480 fn func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error) 20481 vnlr VirtualNetworkListResult 20482} 20483 20484// NextWithContext advances to the next page of values. If there was an error making 20485// the request the page does not advance and the error is returned. 20486func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) (err error) { 20487 if tracing.IsEnabled() { 20488 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultPage.NextWithContext") 20489 defer func() { 20490 sc := -1 20491 if page.Response().Response.Response != nil { 20492 sc = page.Response().Response.Response.StatusCode 20493 } 20494 tracing.EndSpan(ctx, sc, err) 20495 }() 20496 } 20497 for { 20498 next, err := page.fn(ctx, page.vnlr) 20499 if err != nil { 20500 return err 20501 } 20502 page.vnlr = next 20503 if !next.hasNextLink() || !next.IsEmpty() { 20504 break 20505 } 20506 } 20507 return nil 20508} 20509 20510// Next advances to the next page of values. If there was an error making 20511// the request the page does not advance and the error is returned. 20512// Deprecated: Use NextWithContext() instead. 20513func (page *VirtualNetworkListResultPage) Next() error { 20514 return page.NextWithContext(context.Background()) 20515} 20516 20517// NotDone returns true if the page enumeration should be started or is not yet complete. 20518func (page VirtualNetworkListResultPage) NotDone() bool { 20519 return !page.vnlr.IsEmpty() 20520} 20521 20522// Response returns the raw server response from the last page request. 20523func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult { 20524 return page.vnlr 20525} 20526 20527// Values returns the slice of values for the current page or nil if there are no values. 20528func (page VirtualNetworkListResultPage) Values() []VirtualNetwork { 20529 if page.vnlr.IsEmpty() { 20530 return nil 20531 } 20532 return *page.vnlr.Value 20533} 20534 20535// Creates a new instance of the VirtualNetworkListResultPage type. 20536func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage { 20537 return VirtualNetworkListResultPage{ 20538 fn: getNextPage, 20539 vnlr: cur, 20540 } 20541} 20542 20543// VirtualNetworkListUsageResult response for the virtual networks GetUsage API service call. 20544type VirtualNetworkListUsageResult struct { 20545 autorest.Response `json:"-"` 20546 // Value - READ-ONLY; VirtualNetwork usage stats. 20547 Value *[]VirtualNetworkUsage `json:"value,omitempty"` 20548 // NextLink - The URL to get the next set of results. 20549 NextLink *string `json:"nextLink,omitempty"` 20550} 20551 20552// MarshalJSON is the custom marshaler for VirtualNetworkListUsageResult. 20553func (vnlur VirtualNetworkListUsageResult) MarshalJSON() ([]byte, error) { 20554 objectMap := make(map[string]interface{}) 20555 if vnlur.NextLink != nil { 20556 objectMap["nextLink"] = vnlur.NextLink 20557 } 20558 return json.Marshal(objectMap) 20559} 20560 20561// VirtualNetworkListUsageResultIterator provides access to a complete listing of VirtualNetworkUsage 20562// values. 20563type VirtualNetworkListUsageResultIterator struct { 20564 i int 20565 page VirtualNetworkListUsageResultPage 20566} 20567 20568// NextWithContext advances to the next value. If there was an error making 20569// the request the iterator does not advance and the error is returned. 20570func (iter *VirtualNetworkListUsageResultIterator) NextWithContext(ctx context.Context) (err error) { 20571 if tracing.IsEnabled() { 20572 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultIterator.NextWithContext") 20573 defer func() { 20574 sc := -1 20575 if iter.Response().Response.Response != nil { 20576 sc = iter.Response().Response.Response.StatusCode 20577 } 20578 tracing.EndSpan(ctx, sc, err) 20579 }() 20580 } 20581 iter.i++ 20582 if iter.i < len(iter.page.Values()) { 20583 return nil 20584 } 20585 err = iter.page.NextWithContext(ctx) 20586 if err != nil { 20587 iter.i-- 20588 return err 20589 } 20590 iter.i = 0 20591 return nil 20592} 20593 20594// Next advances to the next value. If there was an error making 20595// the request the iterator does not advance and the error is returned. 20596// Deprecated: Use NextWithContext() instead. 20597func (iter *VirtualNetworkListUsageResultIterator) Next() error { 20598 return iter.NextWithContext(context.Background()) 20599} 20600 20601// NotDone returns true if the enumeration should be started or is not yet complete. 20602func (iter VirtualNetworkListUsageResultIterator) NotDone() bool { 20603 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 20604} 20605 20606// Response returns the raw server response from the last page request. 20607func (iter VirtualNetworkListUsageResultIterator) Response() VirtualNetworkListUsageResult { 20608 return iter.page.Response() 20609} 20610 20611// Value returns the current value or a zero-initialized value if the 20612// iterator has advanced beyond the end of the collection. 20613func (iter VirtualNetworkListUsageResultIterator) Value() VirtualNetworkUsage { 20614 if !iter.page.NotDone() { 20615 return VirtualNetworkUsage{} 20616 } 20617 return iter.page.Values()[iter.i] 20618} 20619 20620// Creates a new instance of the VirtualNetworkListUsageResultIterator type. 20621func NewVirtualNetworkListUsageResultIterator(page VirtualNetworkListUsageResultPage) VirtualNetworkListUsageResultIterator { 20622 return VirtualNetworkListUsageResultIterator{page: page} 20623} 20624 20625// IsEmpty returns true if the ListResult contains no values. 20626func (vnlur VirtualNetworkListUsageResult) IsEmpty() bool { 20627 return vnlur.Value == nil || len(*vnlur.Value) == 0 20628} 20629 20630// hasNextLink returns true if the NextLink is not empty. 20631func (vnlur VirtualNetworkListUsageResult) hasNextLink() bool { 20632 return vnlur.NextLink != nil && len(*vnlur.NextLink) != 0 20633} 20634 20635// virtualNetworkListUsageResultPreparer prepares a request to retrieve the next set of results. 20636// It returns nil if no more results exist. 20637func (vnlur VirtualNetworkListUsageResult) virtualNetworkListUsageResultPreparer(ctx context.Context) (*http.Request, error) { 20638 if !vnlur.hasNextLink() { 20639 return nil, nil 20640 } 20641 return autorest.Prepare((&http.Request{}).WithContext(ctx), 20642 autorest.AsJSON(), 20643 autorest.AsGet(), 20644 autorest.WithBaseURL(to.String(vnlur.NextLink))) 20645} 20646 20647// VirtualNetworkListUsageResultPage contains a page of VirtualNetworkUsage values. 20648type VirtualNetworkListUsageResultPage struct { 20649 fn func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error) 20650 vnlur VirtualNetworkListUsageResult 20651} 20652 20653// NextWithContext advances to the next page of values. If there was an error making 20654// the request the page does not advance and the error is returned. 20655func (page *VirtualNetworkListUsageResultPage) NextWithContext(ctx context.Context) (err error) { 20656 if tracing.IsEnabled() { 20657 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListUsageResultPage.NextWithContext") 20658 defer func() { 20659 sc := -1 20660 if page.Response().Response.Response != nil { 20661 sc = page.Response().Response.Response.StatusCode 20662 } 20663 tracing.EndSpan(ctx, sc, err) 20664 }() 20665 } 20666 for { 20667 next, err := page.fn(ctx, page.vnlur) 20668 if err != nil { 20669 return err 20670 } 20671 page.vnlur = next 20672 if !next.hasNextLink() || !next.IsEmpty() { 20673 break 20674 } 20675 } 20676 return nil 20677} 20678 20679// Next advances to the next page of values. If there was an error making 20680// the request the page does not advance and the error is returned. 20681// Deprecated: Use NextWithContext() instead. 20682func (page *VirtualNetworkListUsageResultPage) Next() error { 20683 return page.NextWithContext(context.Background()) 20684} 20685 20686// NotDone returns true if the page enumeration should be started or is not yet complete. 20687func (page VirtualNetworkListUsageResultPage) NotDone() bool { 20688 return !page.vnlur.IsEmpty() 20689} 20690 20691// Response returns the raw server response from the last page request. 20692func (page VirtualNetworkListUsageResultPage) Response() VirtualNetworkListUsageResult { 20693 return page.vnlur 20694} 20695 20696// Values returns the slice of values for the current page or nil if there are no values. 20697func (page VirtualNetworkListUsageResultPage) Values() []VirtualNetworkUsage { 20698 if page.vnlur.IsEmpty() { 20699 return nil 20700 } 20701 return *page.vnlur.Value 20702} 20703 20704// Creates a new instance of the VirtualNetworkListUsageResultPage type. 20705func NewVirtualNetworkListUsageResultPage(cur VirtualNetworkListUsageResult, getNextPage func(context.Context, VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error)) VirtualNetworkListUsageResultPage { 20706 return VirtualNetworkListUsageResultPage{ 20707 fn: getNextPage, 20708 vnlur: cur, 20709 } 20710} 20711 20712// VirtualNetworkPeering peerings in a virtual network resource. 20713type VirtualNetworkPeering struct { 20714 autorest.Response `json:"-"` 20715 // VirtualNetworkPeeringPropertiesFormat - Properties of the virtual network peering. 20716 *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` 20717 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 20718 Name *string `json:"name,omitempty"` 20719 // Etag - A unique read-only string that changes whenever the resource is updated. 20720 Etag *string `json:"etag,omitempty"` 20721 // ID - Resource ID. 20722 ID *string `json:"id,omitempty"` 20723} 20724 20725// MarshalJSON is the custom marshaler for VirtualNetworkPeering. 20726func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) { 20727 objectMap := make(map[string]interface{}) 20728 if vnp.VirtualNetworkPeeringPropertiesFormat != nil { 20729 objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat 20730 } 20731 if vnp.Name != nil { 20732 objectMap["name"] = vnp.Name 20733 } 20734 if vnp.Etag != nil { 20735 objectMap["etag"] = vnp.Etag 20736 } 20737 if vnp.ID != nil { 20738 objectMap["id"] = vnp.ID 20739 } 20740 return json.Marshal(objectMap) 20741} 20742 20743// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. 20744func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error { 20745 var m map[string]*json.RawMessage 20746 err := json.Unmarshal(body, &m) 20747 if err != nil { 20748 return err 20749 } 20750 for k, v := range m { 20751 switch k { 20752 case "properties": 20753 if v != nil { 20754 var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat 20755 err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat) 20756 if err != nil { 20757 return err 20758 } 20759 vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat 20760 } 20761 case "name": 20762 if v != nil { 20763 var name string 20764 err = json.Unmarshal(*v, &name) 20765 if err != nil { 20766 return err 20767 } 20768 vnp.Name = &name 20769 } 20770 case "etag": 20771 if v != nil { 20772 var etag string 20773 err = json.Unmarshal(*v, &etag) 20774 if err != nil { 20775 return err 20776 } 20777 vnp.Etag = &etag 20778 } 20779 case "id": 20780 if v != nil { 20781 var ID string 20782 err = json.Unmarshal(*v, &ID) 20783 if err != nil { 20784 return err 20785 } 20786 vnp.ID = &ID 20787 } 20788 } 20789 } 20790 20791 return nil 20792} 20793 20794// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that 20795// belong to a virtual network. 20796type VirtualNetworkPeeringListResult struct { 20797 autorest.Response `json:"-"` 20798 // Value - The peerings in a virtual network. 20799 Value *[]VirtualNetworkPeering `json:"value,omitempty"` 20800 // NextLink - The URL to get the next set of results. 20801 NextLink *string `json:"nextLink,omitempty"` 20802} 20803 20804// VirtualNetworkPeeringListResultIterator provides access to a complete listing of VirtualNetworkPeering 20805// values. 20806type VirtualNetworkPeeringListResultIterator struct { 20807 i int 20808 page VirtualNetworkPeeringListResultPage 20809} 20810 20811// NextWithContext advances to the next value. If there was an error making 20812// the request the iterator does not advance and the error is returned. 20813func (iter *VirtualNetworkPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { 20814 if tracing.IsEnabled() { 20815 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultIterator.NextWithContext") 20816 defer func() { 20817 sc := -1 20818 if iter.Response().Response.Response != nil { 20819 sc = iter.Response().Response.Response.StatusCode 20820 } 20821 tracing.EndSpan(ctx, sc, err) 20822 }() 20823 } 20824 iter.i++ 20825 if iter.i < len(iter.page.Values()) { 20826 return nil 20827 } 20828 err = iter.page.NextWithContext(ctx) 20829 if err != nil { 20830 iter.i-- 20831 return err 20832 } 20833 iter.i = 0 20834 return nil 20835} 20836 20837// Next advances to the next value. If there was an error making 20838// the request the iterator does not advance and the error is returned. 20839// Deprecated: Use NextWithContext() instead. 20840func (iter *VirtualNetworkPeeringListResultIterator) Next() error { 20841 return iter.NextWithContext(context.Background()) 20842} 20843 20844// NotDone returns true if the enumeration should be started or is not yet complete. 20845func (iter VirtualNetworkPeeringListResultIterator) NotDone() bool { 20846 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 20847} 20848 20849// Response returns the raw server response from the last page request. 20850func (iter VirtualNetworkPeeringListResultIterator) Response() VirtualNetworkPeeringListResult { 20851 return iter.page.Response() 20852} 20853 20854// Value returns the current value or a zero-initialized value if the 20855// iterator has advanced beyond the end of the collection. 20856func (iter VirtualNetworkPeeringListResultIterator) Value() VirtualNetworkPeering { 20857 if !iter.page.NotDone() { 20858 return VirtualNetworkPeering{} 20859 } 20860 return iter.page.Values()[iter.i] 20861} 20862 20863// Creates a new instance of the VirtualNetworkPeeringListResultIterator type. 20864func NewVirtualNetworkPeeringListResultIterator(page VirtualNetworkPeeringListResultPage) VirtualNetworkPeeringListResultIterator { 20865 return VirtualNetworkPeeringListResultIterator{page: page} 20866} 20867 20868// IsEmpty returns true if the ListResult contains no values. 20869func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool { 20870 return vnplr.Value == nil || len(*vnplr.Value) == 0 20871} 20872 20873// hasNextLink returns true if the NextLink is not empty. 20874func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool { 20875 return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0 20876} 20877 20878// virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. 20879// It returns nil if no more results exist. 20880func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { 20881 if !vnplr.hasNextLink() { 20882 return nil, nil 20883 } 20884 return autorest.Prepare((&http.Request{}).WithContext(ctx), 20885 autorest.AsJSON(), 20886 autorest.AsGet(), 20887 autorest.WithBaseURL(to.String(vnplr.NextLink))) 20888} 20889 20890// VirtualNetworkPeeringListResultPage contains a page of VirtualNetworkPeering values. 20891type VirtualNetworkPeeringListResultPage struct { 20892 fn func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error) 20893 vnplr VirtualNetworkPeeringListResult 20894} 20895 20896// NextWithContext advances to the next page of values. If there was an error making 20897// the request the page does not advance and the error is returned. 20898func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { 20899 if tracing.IsEnabled() { 20900 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultPage.NextWithContext") 20901 defer func() { 20902 sc := -1 20903 if page.Response().Response.Response != nil { 20904 sc = page.Response().Response.Response.StatusCode 20905 } 20906 tracing.EndSpan(ctx, sc, err) 20907 }() 20908 } 20909 for { 20910 next, err := page.fn(ctx, page.vnplr) 20911 if err != nil { 20912 return err 20913 } 20914 page.vnplr = next 20915 if !next.hasNextLink() || !next.IsEmpty() { 20916 break 20917 } 20918 } 20919 return nil 20920} 20921 20922// Next advances to the next page of values. If there was an error making 20923// the request the page does not advance and the error is returned. 20924// Deprecated: Use NextWithContext() instead. 20925func (page *VirtualNetworkPeeringListResultPage) Next() error { 20926 return page.NextWithContext(context.Background()) 20927} 20928 20929// NotDone returns true if the page enumeration should be started or is not yet complete. 20930func (page VirtualNetworkPeeringListResultPage) NotDone() bool { 20931 return !page.vnplr.IsEmpty() 20932} 20933 20934// Response returns the raw server response from the last page request. 20935func (page VirtualNetworkPeeringListResultPage) Response() VirtualNetworkPeeringListResult { 20936 return page.vnplr 20937} 20938 20939// Values returns the slice of values for the current page or nil if there are no values. 20940func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering { 20941 if page.vnplr.IsEmpty() { 20942 return nil 20943 } 20944 return *page.vnplr.Value 20945} 20946 20947// Creates a new instance of the VirtualNetworkPeeringListResultPage type. 20948func NewVirtualNetworkPeeringListResultPage(cur VirtualNetworkPeeringListResult, getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage { 20949 return VirtualNetworkPeeringListResultPage{ 20950 fn: getNextPage, 20951 vnplr: cur, 20952 } 20953} 20954 20955// VirtualNetworkPeeringPropertiesFormat properties of the virtual network peering. 20956type VirtualNetworkPeeringPropertiesFormat struct { 20957 // AllowVirtualNetworkAccess - Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. 20958 AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` 20959 // AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. 20960 AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` 20961 // AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network. 20962 AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` 20963 // UseRemoteGateways - If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. 20964 UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` 20965 // RemoteVirtualNetwork - The reference of the remote virtual network. The remote virtual network can be in the same or different region (preview). See here to register for the preview and learn more (https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-create-peering). 20966 RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` 20967 // RemoteAddressSpace - The reference of the remote virtual network address space. 20968 RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` 20969 // PeeringState - The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'VirtualNetworkPeeringStateInitiated', 'VirtualNetworkPeeringStateConnected', 'VirtualNetworkPeeringStateDisconnected' 20970 PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` 20971 // ProvisioningState - The provisioning state of the resource. 20972 ProvisioningState *string `json:"provisioningState,omitempty"` 20973} 20974 20975// VirtualNetworkPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 20976// long-running operation. 20977type VirtualNetworkPeeringsCreateOrUpdateFuture struct { 20978 azure.FutureAPI 20979 // Result returns the result of the asynchronous operation. 20980 // If the operation has not completed it will return an error. 20981 Result func(VirtualNetworkPeeringsClient) (VirtualNetworkPeering, error) 20982} 20983 20984// UnmarshalJSON is the custom unmarshaller for CreateFuture. 20985func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 20986 var azFuture azure.Future 20987 if err := json.Unmarshal(body, &azFuture); err != nil { 20988 return err 20989 } 20990 future.FutureAPI = &azFuture 20991 future.Result = future.result 20992 return nil 20993} 20994 20995// result is the default implementation for VirtualNetworkPeeringsCreateOrUpdateFuture.Result. 20996func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) { 20997 var done bool 20998 done, err = future.DoneWithContext(context.Background(), client) 20999 if err != nil { 21000 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21001 return 21002 } 21003 if !done { 21004 vnp.Response.Response = future.Response() 21005 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture") 21006 return 21007 } 21008 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21009 if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent { 21010 vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response) 21011 if err != nil { 21012 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request") 21013 } 21014 } 21015 return 21016} 21017 21018// VirtualNetworkPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a 21019// long-running operation. 21020type VirtualNetworkPeeringsDeleteFuture struct { 21021 azure.FutureAPI 21022 // Result returns the result of the asynchronous operation. 21023 // If the operation has not completed it will return an error. 21024 Result func(VirtualNetworkPeeringsClient) (autorest.Response, error) 21025} 21026 21027// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21028func (future *VirtualNetworkPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { 21029 var azFuture azure.Future 21030 if err := json.Unmarshal(body, &azFuture); err != nil { 21031 return err 21032 } 21033 future.FutureAPI = &azFuture 21034 future.Result = future.result 21035 return nil 21036} 21037 21038// result is the default implementation for VirtualNetworkPeeringsDeleteFuture.Result. 21039func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) { 21040 var done bool 21041 done, err = future.DoneWithContext(context.Background(), client) 21042 if err != nil { 21043 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 21044 return 21045 } 21046 if !done { 21047 ar.Response = future.Response() 21048 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture") 21049 return 21050 } 21051 ar.Response = future.Response() 21052 return 21053} 21054 21055// VirtualNetworkPropertiesFormat properties of the virtual network. 21056type VirtualNetworkPropertiesFormat struct { 21057 // AddressSpace - The AddressSpace that contains an array of IP address ranges that can be used by subnets. 21058 AddressSpace *AddressSpace `json:"addressSpace,omitempty"` 21059 // DhcpOptions - The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. 21060 DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` 21061 // Subnets - A list of subnets in a Virtual Network. 21062 Subnets *[]Subnet `json:"subnets,omitempty"` 21063 // VirtualNetworkPeerings - A list of peerings in a Virtual Network. 21064 VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` 21065 // ResourceGUID - The resourceGuid property of the Virtual Network resource. 21066 ResourceGUID *string `json:"resourceGuid,omitempty"` 21067 // ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 21068 ProvisioningState *string `json:"provisioningState,omitempty"` 21069 // EnableDdosProtection - Indicates if DDoS protection is enabled for all the protected resources in the virtual network. It requires a DDoS protection plan associated with the resource. 21070 EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` 21071 // EnableVMProtection - Indicates if VM protection is enabled for all the subnets in the virtual network. 21072 EnableVMProtection *bool `json:"enableVmProtection,omitempty"` 21073 // DdosProtectionPlan - The DDoS protection plan associated with the virtual network. 21074 DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` 21075} 21076 21077// VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 21078// long-running operation. 21079type VirtualNetworksCreateOrUpdateFuture struct { 21080 azure.FutureAPI 21081 // Result returns the result of the asynchronous operation. 21082 // If the operation has not completed it will return an error. 21083 Result func(VirtualNetworksClient) (VirtualNetwork, error) 21084} 21085 21086// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21087func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 21088 var azFuture azure.Future 21089 if err := json.Unmarshal(body, &azFuture); err != nil { 21090 return err 21091 } 21092 future.FutureAPI = &azFuture 21093 future.Result = future.result 21094 return nil 21095} 21096 21097// result is the default implementation for VirtualNetworksCreateOrUpdateFuture.Result. 21098func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { 21099 var done bool 21100 done, err = future.DoneWithContext(context.Background(), client) 21101 if err != nil { 21102 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21103 return 21104 } 21105 if !done { 21106 vn.Response.Response = future.Response() 21107 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") 21108 return 21109 } 21110 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21111 if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent { 21112 vn, err = client.CreateOrUpdateResponder(vn.Response.Response) 21113 if err != nil { 21114 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request") 21115 } 21116 } 21117 return 21118} 21119 21120// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 21121// operation. 21122type VirtualNetworksDeleteFuture struct { 21123 azure.FutureAPI 21124 // Result returns the result of the asynchronous operation. 21125 // If the operation has not completed it will return an error. 21126 Result func(VirtualNetworksClient) (autorest.Response, error) 21127} 21128 21129// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21130func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error { 21131 var azFuture azure.Future 21132 if err := json.Unmarshal(body, &azFuture); err != nil { 21133 return err 21134 } 21135 future.FutureAPI = &azFuture 21136 future.Result = future.result 21137 return nil 21138} 21139 21140// result is the default implementation for VirtualNetworksDeleteFuture.Result. 21141func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) { 21142 var done bool 21143 done, err = future.DoneWithContext(context.Background(), client) 21144 if err != nil { 21145 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure") 21146 return 21147 } 21148 if !done { 21149 ar.Response = future.Response() 21150 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") 21151 return 21152 } 21153 ar.Response = future.Response() 21154 return 21155} 21156 21157// VirtualNetworksUpdateTagsFuture an abstraction for monitoring and retrieving the results of a 21158// long-running operation. 21159type VirtualNetworksUpdateTagsFuture struct { 21160 azure.FutureAPI 21161 // Result returns the result of the asynchronous operation. 21162 // If the operation has not completed it will return an error. 21163 Result func(VirtualNetworksClient) (VirtualNetwork, error) 21164} 21165 21166// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21167func (future *VirtualNetworksUpdateTagsFuture) UnmarshalJSON(body []byte) error { 21168 var azFuture azure.Future 21169 if err := json.Unmarshal(body, &azFuture); err != nil { 21170 return err 21171 } 21172 future.FutureAPI = &azFuture 21173 future.Result = future.result 21174 return nil 21175} 21176 21177// result is the default implementation for VirtualNetworksUpdateTagsFuture.Result. 21178func (future *VirtualNetworksUpdateTagsFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { 21179 var done bool 21180 done, err = future.DoneWithContext(context.Background(), client) 21181 if err != nil { 21182 err = autorest.NewErrorWithError(err, "network.VirtualNetworksUpdateTagsFuture", "Result", future.Response(), "Polling failure") 21183 return 21184 } 21185 if !done { 21186 vn.Response.Response = future.Response() 21187 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksUpdateTagsFuture") 21188 return 21189 } 21190 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21191 if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent { 21192 vn, err = client.UpdateTagsResponder(vn.Response.Response) 21193 if err != nil { 21194 err = autorest.NewErrorWithError(err, "network.VirtualNetworksUpdateTagsFuture", "Result", vn.Response.Response, "Failure responding to request") 21195 } 21196 } 21197 return 21198} 21199 21200// VirtualNetworkUsage usage details for subnet. 21201type VirtualNetworkUsage struct { 21202 // CurrentValue - READ-ONLY; Indicates number of IPs used from the Subnet. 21203 CurrentValue *float64 `json:"currentValue,omitempty"` 21204 // ID - READ-ONLY; Subnet identifier. 21205 ID *string `json:"id,omitempty"` 21206 // Limit - READ-ONLY; Indicates the size of the subnet. 21207 Limit *float64 `json:"limit,omitempty"` 21208 // Name - READ-ONLY; The name containing common and localized value for usage. 21209 Name *VirtualNetworkUsageName `json:"name,omitempty"` 21210 // Unit - READ-ONLY; Usage units. Returns 'Count' 21211 Unit *string `json:"unit,omitempty"` 21212} 21213 21214// MarshalJSON is the custom marshaler for VirtualNetworkUsage. 21215func (vnu VirtualNetworkUsage) MarshalJSON() ([]byte, error) { 21216 objectMap := make(map[string]interface{}) 21217 return json.Marshal(objectMap) 21218} 21219 21220// VirtualNetworkUsageName usage strings container. 21221type VirtualNetworkUsageName struct { 21222 // LocalizedValue - READ-ONLY; Localized subnet size and usage string. 21223 LocalizedValue *string `json:"localizedValue,omitempty"` 21224 // Value - READ-ONLY; Subnet size and usage string. 21225 Value *string `json:"value,omitempty"` 21226} 21227 21228// MarshalJSON is the custom marshaler for VirtualNetworkUsageName. 21229func (vnun VirtualNetworkUsageName) MarshalJSON() ([]byte, error) { 21230 objectMap := make(map[string]interface{}) 21231 return json.Marshal(objectMap) 21232} 21233 21234// VirtualWAN virtualWAN Resource. 21235type VirtualWAN struct { 21236 autorest.Response `json:"-"` 21237 *VirtualWanProperties `json:"properties,omitempty"` 21238 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 21239 Etag *string `json:"etag,omitempty"` 21240 // ID - Resource ID. 21241 ID *string `json:"id,omitempty"` 21242 // Name - READ-ONLY; Resource name. 21243 Name *string `json:"name,omitempty"` 21244 // Type - READ-ONLY; Resource type. 21245 Type *string `json:"type,omitempty"` 21246 // Location - Resource location. 21247 Location *string `json:"location,omitempty"` 21248 // Tags - Resource tags. 21249 Tags map[string]*string `json:"tags"` 21250} 21251 21252// MarshalJSON is the custom marshaler for VirtualWAN. 21253func (vw VirtualWAN) MarshalJSON() ([]byte, error) { 21254 objectMap := make(map[string]interface{}) 21255 if vw.VirtualWanProperties != nil { 21256 objectMap["properties"] = vw.VirtualWanProperties 21257 } 21258 if vw.ID != nil { 21259 objectMap["id"] = vw.ID 21260 } 21261 if vw.Location != nil { 21262 objectMap["location"] = vw.Location 21263 } 21264 if vw.Tags != nil { 21265 objectMap["tags"] = vw.Tags 21266 } 21267 return json.Marshal(objectMap) 21268} 21269 21270// UnmarshalJSON is the custom unmarshaler for VirtualWAN struct. 21271func (vw *VirtualWAN) UnmarshalJSON(body []byte) error { 21272 var m map[string]*json.RawMessage 21273 err := json.Unmarshal(body, &m) 21274 if err != nil { 21275 return err 21276 } 21277 for k, v := range m { 21278 switch k { 21279 case "properties": 21280 if v != nil { 21281 var virtualWanProperties VirtualWanProperties 21282 err = json.Unmarshal(*v, &virtualWanProperties) 21283 if err != nil { 21284 return err 21285 } 21286 vw.VirtualWanProperties = &virtualWanProperties 21287 } 21288 case "etag": 21289 if v != nil { 21290 var etag string 21291 err = json.Unmarshal(*v, &etag) 21292 if err != nil { 21293 return err 21294 } 21295 vw.Etag = &etag 21296 } 21297 case "id": 21298 if v != nil { 21299 var ID string 21300 err = json.Unmarshal(*v, &ID) 21301 if err != nil { 21302 return err 21303 } 21304 vw.ID = &ID 21305 } 21306 case "name": 21307 if v != nil { 21308 var name string 21309 err = json.Unmarshal(*v, &name) 21310 if err != nil { 21311 return err 21312 } 21313 vw.Name = &name 21314 } 21315 case "type": 21316 if v != nil { 21317 var typeVar string 21318 err = json.Unmarshal(*v, &typeVar) 21319 if err != nil { 21320 return err 21321 } 21322 vw.Type = &typeVar 21323 } 21324 case "location": 21325 if v != nil { 21326 var location string 21327 err = json.Unmarshal(*v, &location) 21328 if err != nil { 21329 return err 21330 } 21331 vw.Location = &location 21332 } 21333 case "tags": 21334 if v != nil { 21335 var tags map[string]*string 21336 err = json.Unmarshal(*v, &tags) 21337 if err != nil { 21338 return err 21339 } 21340 vw.Tags = tags 21341 } 21342 } 21343 } 21344 21345 return nil 21346} 21347 21348// VirtualWanProperties parameters for VirtualWAN 21349type VirtualWanProperties struct { 21350 // DisableVpnEncryption - Vpn encryption to be disabled or not. 21351 DisableVpnEncryption *bool `json:"disableVpnEncryption,omitempty"` 21352 // VirtualHubs - READ-ONLY; List of VirtualHubs in the VirtualWAN. 21353 VirtualHubs *[]SubResource `json:"virtualHubs,omitempty"` 21354 // VpnSites - READ-ONLY 21355 VpnSites *[]SubResource `json:"vpnSites,omitempty"` 21356 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 21357 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 21358} 21359 21360// MarshalJSON is the custom marshaler for VirtualWanProperties. 21361func (vwp VirtualWanProperties) MarshalJSON() ([]byte, error) { 21362 objectMap := make(map[string]interface{}) 21363 if vwp.DisableVpnEncryption != nil { 21364 objectMap["disableVpnEncryption"] = vwp.DisableVpnEncryption 21365 } 21366 if vwp.ProvisioningState != "" { 21367 objectMap["provisioningState"] = vwp.ProvisioningState 21368 } 21369 return json.Marshal(objectMap) 21370} 21371 21372// VirtualWANsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 21373// long-running operation. 21374type VirtualWANsCreateOrUpdateFuture struct { 21375 azure.FutureAPI 21376 // Result returns the result of the asynchronous operation. 21377 // If the operation has not completed it will return an error. 21378 Result func(VirtualWANsClient) (VirtualWAN, error) 21379} 21380 21381// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21382func (future *VirtualWANsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 21383 var azFuture azure.Future 21384 if err := json.Unmarshal(body, &azFuture); err != nil { 21385 return err 21386 } 21387 future.FutureAPI = &azFuture 21388 future.Result = future.result 21389 return nil 21390} 21391 21392// result is the default implementation for VirtualWANsCreateOrUpdateFuture.Result. 21393func (future *VirtualWANsCreateOrUpdateFuture) result(client VirtualWANsClient) (vw VirtualWAN, err error) { 21394 var done bool 21395 done, err = future.DoneWithContext(context.Background(), client) 21396 if err != nil { 21397 err = autorest.NewErrorWithError(err, "network.VirtualWANsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21398 return 21399 } 21400 if !done { 21401 vw.Response.Response = future.Response() 21402 err = azure.NewAsyncOpIncompleteError("network.VirtualWANsCreateOrUpdateFuture") 21403 return 21404 } 21405 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21406 if vw.Response.Response, err = future.GetResult(sender); err == nil && vw.Response.Response.StatusCode != http.StatusNoContent { 21407 vw, err = client.CreateOrUpdateResponder(vw.Response.Response) 21408 if err != nil { 21409 err = autorest.NewErrorWithError(err, "network.VirtualWANsCreateOrUpdateFuture", "Result", vw.Response.Response, "Failure responding to request") 21410 } 21411 } 21412 return 21413} 21414 21415// VirtualWANsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 21416// operation. 21417type VirtualWANsDeleteFuture struct { 21418 azure.FutureAPI 21419 // Result returns the result of the asynchronous operation. 21420 // If the operation has not completed it will return an error. 21421 Result func(VirtualWANsClient) (autorest.Response, error) 21422} 21423 21424// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21425func (future *VirtualWANsDeleteFuture) UnmarshalJSON(body []byte) error { 21426 var azFuture azure.Future 21427 if err := json.Unmarshal(body, &azFuture); err != nil { 21428 return err 21429 } 21430 future.FutureAPI = &azFuture 21431 future.Result = future.result 21432 return nil 21433} 21434 21435// result is the default implementation for VirtualWANsDeleteFuture.Result. 21436func (future *VirtualWANsDeleteFuture) result(client VirtualWANsClient) (ar autorest.Response, err error) { 21437 var done bool 21438 done, err = future.DoneWithContext(context.Background(), client) 21439 if err != nil { 21440 err = autorest.NewErrorWithError(err, "network.VirtualWANsDeleteFuture", "Result", future.Response(), "Polling failure") 21441 return 21442 } 21443 if !done { 21444 ar.Response = future.Response() 21445 err = azure.NewAsyncOpIncompleteError("network.VirtualWANsDeleteFuture") 21446 return 21447 } 21448 ar.Response = future.Response() 21449 return 21450} 21451 21452// VirtualWANsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running 21453// operation. 21454type VirtualWANsUpdateTagsFuture struct { 21455 azure.FutureAPI 21456 // Result returns the result of the asynchronous operation. 21457 // If the operation has not completed it will return an error. 21458 Result func(VirtualWANsClient) (VirtualWAN, error) 21459} 21460 21461// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21462func (future *VirtualWANsUpdateTagsFuture) UnmarshalJSON(body []byte) error { 21463 var azFuture azure.Future 21464 if err := json.Unmarshal(body, &azFuture); err != nil { 21465 return err 21466 } 21467 future.FutureAPI = &azFuture 21468 future.Result = future.result 21469 return nil 21470} 21471 21472// result is the default implementation for VirtualWANsUpdateTagsFuture.Result. 21473func (future *VirtualWANsUpdateTagsFuture) result(client VirtualWANsClient) (vw VirtualWAN, err error) { 21474 var done bool 21475 done, err = future.DoneWithContext(context.Background(), client) 21476 if err != nil { 21477 err = autorest.NewErrorWithError(err, "network.VirtualWANsUpdateTagsFuture", "Result", future.Response(), "Polling failure") 21478 return 21479 } 21480 if !done { 21481 vw.Response.Response = future.Response() 21482 err = azure.NewAsyncOpIncompleteError("network.VirtualWANsUpdateTagsFuture") 21483 return 21484 } 21485 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21486 if vw.Response.Response, err = future.GetResult(sender); err == nil && vw.Response.Response.StatusCode != http.StatusNoContent { 21487 vw, err = client.UpdateTagsResponder(vw.Response.Response) 21488 if err != nil { 21489 err = autorest.NewErrorWithError(err, "network.VirtualWANsUpdateTagsFuture", "Result", vw.Response.Response, "Failure responding to request") 21490 } 21491 } 21492 return 21493} 21494 21495// VpnClientConfiguration vpnClientConfiguration for P2S client. 21496type VpnClientConfiguration struct { 21497 // VpnClientAddressPool - The reference of the address space resource which represents Address space for P2S VpnClient. 21498 VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` 21499 // VpnClientRootCertificates - VpnClientRootCertificate for virtual network gateway. 21500 VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` 21501 // VpnClientRevokedCertificates - VpnClientRevokedCertificate for Virtual network gateway. 21502 VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` 21503 // VpnClientProtocols - VpnClientProtocols for Virtual network gateway. 21504 VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` 21505 // VpnClientIpsecPolicies - VpnClientIpsecPolicies for virtual network gateway P2S client. 21506 VpnClientIpsecPolicies *[]IpsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` 21507 // RadiusServerAddress - The radius server address property of the VirtualNetworkGateway resource for vpn client connection. 21508 RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` 21509 // RadiusServerSecret - The radius secret property of the VirtualNetworkGateway resource for vpn client connection. 21510 RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` 21511} 21512 21513// VpnClientIPsecParameters an IPSec parameters for a virtual network gateway P2S connection. 21514type VpnClientIPsecParameters struct { 21515 autorest.Response `json:"-"` 21516 // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for P2S client. 21517 SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` 21518 // SaDataSizeKilobytes - The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for P2S client.. 21519 SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` 21520 // IpsecEncryption - The IPSec encryption algorithm (IKE phase 1). Possible values include: 'IpsecEncryptionNone', 'IpsecEncryptionDES', 'IpsecEncryptionDES3', 'IpsecEncryptionAES128', 'IpsecEncryptionAES192', 'IpsecEncryptionAES256', 'IpsecEncryptionGCMAES128', 'IpsecEncryptionGCMAES192', 'IpsecEncryptionGCMAES256' 21521 IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` 21522 // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' 21523 IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` 21524 // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' 21525 IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` 21526 // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' 21527 IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` 21528 // DhGroup - The DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' 21529 DhGroup DhGroup `json:"dhGroup,omitempty"` 21530 // PfsGroup - The Pfs Groups used in IKE Phase 2 for new child SA. Possible values include: 'PfsGroupNone', 'PfsGroupPFS1', 'PfsGroupPFS2', 'PfsGroupPFS2048', 'PfsGroupECP256', 'PfsGroupECP384', 'PfsGroupPFS24', 'PfsGroupPFS14', 'PfsGroupPFSMM' 21531 PfsGroup PfsGroup `json:"pfsGroup,omitempty"` 21532} 21533 21534// VpnClientParameters vpn Client Parameters for package generation 21535type VpnClientParameters struct { 21536 // ProcessorArchitecture - VPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' 21537 ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` 21538 // AuthenticationMethod - VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' 21539 AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` 21540 // RadiusServerAuthCertificate - The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. 21541 RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` 21542 // ClientRootCertificates - A list of client root certificates public certificate data encoded as Base-64 strings. Optional parameter for external radius based authentication with EAPTLS. 21543 ClientRootCertificates *[]string `json:"clientRootCertificates,omitempty"` 21544} 21545 21546// VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway. 21547type VpnClientRevokedCertificate struct { 21548 // VpnClientRevokedCertificatePropertiesFormat - Properties of the vpn client revoked certificate. 21549 *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` 21550 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 21551 Name *string `json:"name,omitempty"` 21552 // Etag - A unique read-only string that changes whenever the resource is updated. 21553 Etag *string `json:"etag,omitempty"` 21554 // ID - Resource ID. 21555 ID *string `json:"id,omitempty"` 21556} 21557 21558// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate. 21559func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) { 21560 objectMap := make(map[string]interface{}) 21561 if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil { 21562 objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat 21563 } 21564 if vcrc.Name != nil { 21565 objectMap["name"] = vcrc.Name 21566 } 21567 if vcrc.Etag != nil { 21568 objectMap["etag"] = vcrc.Etag 21569 } 21570 if vcrc.ID != nil { 21571 objectMap["id"] = vcrc.ID 21572 } 21573 return json.Marshal(objectMap) 21574} 21575 21576// UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. 21577func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { 21578 var m map[string]*json.RawMessage 21579 err := json.Unmarshal(body, &m) 21580 if err != nil { 21581 return err 21582 } 21583 for k, v := range m { 21584 switch k { 21585 case "properties": 21586 if v != nil { 21587 var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat 21588 err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat) 21589 if err != nil { 21590 return err 21591 } 21592 vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat 21593 } 21594 case "name": 21595 if v != nil { 21596 var name string 21597 err = json.Unmarshal(*v, &name) 21598 if err != nil { 21599 return err 21600 } 21601 vcrc.Name = &name 21602 } 21603 case "etag": 21604 if v != nil { 21605 var etag string 21606 err = json.Unmarshal(*v, &etag) 21607 if err != nil { 21608 return err 21609 } 21610 vcrc.Etag = &etag 21611 } 21612 case "id": 21613 if v != nil { 21614 var ID string 21615 err = json.Unmarshal(*v, &ID) 21616 if err != nil { 21617 return err 21618 } 21619 vcrc.ID = &ID 21620 } 21621 } 21622 } 21623 21624 return nil 21625} 21626 21627// VpnClientRevokedCertificatePropertiesFormat properties of the revoked VPN client certificate of virtual 21628// network gateway. 21629type VpnClientRevokedCertificatePropertiesFormat struct { 21630 // Thumbprint - The revoked VPN client certificate thumbprint. 21631 Thumbprint *string `json:"thumbprint,omitempty"` 21632 // ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 21633 ProvisioningState *string `json:"provisioningState,omitempty"` 21634} 21635 21636// MarshalJSON is the custom marshaler for VpnClientRevokedCertificatePropertiesFormat. 21637func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { 21638 objectMap := make(map[string]interface{}) 21639 if vcrcpf.Thumbprint != nil { 21640 objectMap["thumbprint"] = vcrcpf.Thumbprint 21641 } 21642 return json.Marshal(objectMap) 21643} 21644 21645// VpnClientRootCertificate VPN client root certificate of virtual network gateway 21646type VpnClientRootCertificate struct { 21647 // VpnClientRootCertificatePropertiesFormat - Properties of the vpn client root certificate. 21648 *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` 21649 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 21650 Name *string `json:"name,omitempty"` 21651 // Etag - A unique read-only string that changes whenever the resource is updated. 21652 Etag *string `json:"etag,omitempty"` 21653 // ID - Resource ID. 21654 ID *string `json:"id,omitempty"` 21655} 21656 21657// MarshalJSON is the custom marshaler for VpnClientRootCertificate. 21658func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) { 21659 objectMap := make(map[string]interface{}) 21660 if vcrc.VpnClientRootCertificatePropertiesFormat != nil { 21661 objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat 21662 } 21663 if vcrc.Name != nil { 21664 objectMap["name"] = vcrc.Name 21665 } 21666 if vcrc.Etag != nil { 21667 objectMap["etag"] = vcrc.Etag 21668 } 21669 if vcrc.ID != nil { 21670 objectMap["id"] = vcrc.ID 21671 } 21672 return json.Marshal(objectMap) 21673} 21674 21675// UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. 21676func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { 21677 var m map[string]*json.RawMessage 21678 err := json.Unmarshal(body, &m) 21679 if err != nil { 21680 return err 21681 } 21682 for k, v := range m { 21683 switch k { 21684 case "properties": 21685 if v != nil { 21686 var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat 21687 err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat) 21688 if err != nil { 21689 return err 21690 } 21691 vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat 21692 } 21693 case "name": 21694 if v != nil { 21695 var name string 21696 err = json.Unmarshal(*v, &name) 21697 if err != nil { 21698 return err 21699 } 21700 vcrc.Name = &name 21701 } 21702 case "etag": 21703 if v != nil { 21704 var etag string 21705 err = json.Unmarshal(*v, &etag) 21706 if err != nil { 21707 return err 21708 } 21709 vcrc.Etag = &etag 21710 } 21711 case "id": 21712 if v != nil { 21713 var ID string 21714 err = json.Unmarshal(*v, &ID) 21715 if err != nil { 21716 return err 21717 } 21718 vcrc.ID = &ID 21719 } 21720 } 21721 } 21722 21723 return nil 21724} 21725 21726// VpnClientRootCertificatePropertiesFormat properties of SSL certificates of application gateway 21727type VpnClientRootCertificatePropertiesFormat struct { 21728 // PublicCertData - The certificate public data. 21729 PublicCertData *string `json:"publicCertData,omitempty"` 21730 // ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 21731 ProvisioningState *string `json:"provisioningState,omitempty"` 21732} 21733 21734// MarshalJSON is the custom marshaler for VpnClientRootCertificatePropertiesFormat. 21735func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { 21736 objectMap := make(map[string]interface{}) 21737 if vcrcpf.PublicCertData != nil { 21738 objectMap["publicCertData"] = vcrcpf.PublicCertData 21739 } 21740 return json.Marshal(objectMap) 21741} 21742 21743// VpnConnection vpnConnection Resource. 21744type VpnConnection struct { 21745 autorest.Response `json:"-"` 21746 *VpnConnectionProperties `json:"properties,omitempty"` 21747 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 21748 Name *string `json:"name,omitempty"` 21749 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 21750 Etag *string `json:"etag,omitempty"` 21751 // ID - Resource ID. 21752 ID *string `json:"id,omitempty"` 21753} 21754 21755// MarshalJSON is the custom marshaler for VpnConnection. 21756func (vc VpnConnection) MarshalJSON() ([]byte, error) { 21757 objectMap := make(map[string]interface{}) 21758 if vc.VpnConnectionProperties != nil { 21759 objectMap["properties"] = vc.VpnConnectionProperties 21760 } 21761 if vc.Name != nil { 21762 objectMap["name"] = vc.Name 21763 } 21764 if vc.ID != nil { 21765 objectMap["id"] = vc.ID 21766 } 21767 return json.Marshal(objectMap) 21768} 21769 21770// UnmarshalJSON is the custom unmarshaler for VpnConnection struct. 21771func (vc *VpnConnection) UnmarshalJSON(body []byte) error { 21772 var m map[string]*json.RawMessage 21773 err := json.Unmarshal(body, &m) 21774 if err != nil { 21775 return err 21776 } 21777 for k, v := range m { 21778 switch k { 21779 case "properties": 21780 if v != nil { 21781 var vpnConnectionProperties VpnConnectionProperties 21782 err = json.Unmarshal(*v, &vpnConnectionProperties) 21783 if err != nil { 21784 return err 21785 } 21786 vc.VpnConnectionProperties = &vpnConnectionProperties 21787 } 21788 case "name": 21789 if v != nil { 21790 var name string 21791 err = json.Unmarshal(*v, &name) 21792 if err != nil { 21793 return err 21794 } 21795 vc.Name = &name 21796 } 21797 case "etag": 21798 if v != nil { 21799 var etag string 21800 err = json.Unmarshal(*v, &etag) 21801 if err != nil { 21802 return err 21803 } 21804 vc.Etag = &etag 21805 } 21806 case "id": 21807 if v != nil { 21808 var ID string 21809 err = json.Unmarshal(*v, &ID) 21810 if err != nil { 21811 return err 21812 } 21813 vc.ID = &ID 21814 } 21815 } 21816 } 21817 21818 return nil 21819} 21820 21821// VpnConnectionProperties parameters for VpnConnection 21822type VpnConnectionProperties struct { 21823 // RemoteVpnSite - Id of the connected vpn site. 21824 RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` 21825 // RoutingWeight - routing weight for vpn connection. 21826 RoutingWeight *int32 `json:"routingWeight,omitempty"` 21827 // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' 21828 ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` 21829 // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. 21830 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 21831 // EgressBytesTransferred - READ-ONLY; Egress bytes transferred. 21832 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 21833 // ConnectionBandwidth - READ-ONLY; Expected bandwidth in MBPS. 21834 ConnectionBandwidth *int32 `json:"connectionBandwidth,omitempty"` 21835 // SharedKey - SharedKey for the vpn connection. 21836 SharedKey *string `json:"sharedKey,omitempty"` 21837 // EnableBgp - EnableBgp flag 21838 EnableBgp *bool `json:"enableBgp,omitempty"` 21839 // IpsecPolicies - The IPSec Policies to be considered by this connection. 21840 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` 21841 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 21842 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 21843} 21844 21845// MarshalJSON is the custom marshaler for VpnConnectionProperties. 21846func (vcp VpnConnectionProperties) MarshalJSON() ([]byte, error) { 21847 objectMap := make(map[string]interface{}) 21848 if vcp.RemoteVpnSite != nil { 21849 objectMap["remoteVpnSite"] = vcp.RemoteVpnSite 21850 } 21851 if vcp.RoutingWeight != nil { 21852 objectMap["routingWeight"] = vcp.RoutingWeight 21853 } 21854 if vcp.ConnectionStatus != "" { 21855 objectMap["connectionStatus"] = vcp.ConnectionStatus 21856 } 21857 if vcp.SharedKey != nil { 21858 objectMap["sharedKey"] = vcp.SharedKey 21859 } 21860 if vcp.EnableBgp != nil { 21861 objectMap["enableBgp"] = vcp.EnableBgp 21862 } 21863 if vcp.IpsecPolicies != nil { 21864 objectMap["ipsecPolicies"] = vcp.IpsecPolicies 21865 } 21866 if vcp.ProvisioningState != "" { 21867 objectMap["provisioningState"] = vcp.ProvisioningState 21868 } 21869 return json.Marshal(objectMap) 21870} 21871 21872// VpnConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 21873// long-running operation. 21874type VpnConnectionsCreateOrUpdateFuture struct { 21875 azure.FutureAPI 21876 // Result returns the result of the asynchronous operation. 21877 // If the operation has not completed it will return an error. 21878 Result func(VpnConnectionsClient) (VpnConnection, error) 21879} 21880 21881// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21882func (future *VpnConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 21883 var azFuture azure.Future 21884 if err := json.Unmarshal(body, &azFuture); err != nil { 21885 return err 21886 } 21887 future.FutureAPI = &azFuture 21888 future.Result = future.result 21889 return nil 21890} 21891 21892// result is the default implementation for VpnConnectionsCreateOrUpdateFuture.Result. 21893func (future *VpnConnectionsCreateOrUpdateFuture) result(client VpnConnectionsClient) (vc VpnConnection, err error) { 21894 var done bool 21895 done, err = future.DoneWithContext(context.Background(), client) 21896 if err != nil { 21897 err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 21898 return 21899 } 21900 if !done { 21901 vc.Response.Response = future.Response() 21902 err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsCreateOrUpdateFuture") 21903 return 21904 } 21905 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 21906 if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent { 21907 vc, err = client.CreateOrUpdateResponder(vc.Response.Response) 21908 if err != nil { 21909 err = autorest.NewErrorWithError(err, "network.VpnConnectionsCreateOrUpdateFuture", "Result", vc.Response.Response, "Failure responding to request") 21910 } 21911 } 21912 return 21913} 21914 21915// VpnConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 21916// operation. 21917type VpnConnectionsDeleteFuture struct { 21918 azure.FutureAPI 21919 // Result returns the result of the asynchronous operation. 21920 // If the operation has not completed it will return an error. 21921 Result func(VpnConnectionsClient) (autorest.Response, error) 21922} 21923 21924// UnmarshalJSON is the custom unmarshaller for CreateFuture. 21925func (future *VpnConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 21926 var azFuture azure.Future 21927 if err := json.Unmarshal(body, &azFuture); err != nil { 21928 return err 21929 } 21930 future.FutureAPI = &azFuture 21931 future.Result = future.result 21932 return nil 21933} 21934 21935// result is the default implementation for VpnConnectionsDeleteFuture.Result. 21936func (future *VpnConnectionsDeleteFuture) result(client VpnConnectionsClient) (ar autorest.Response, err error) { 21937 var done bool 21938 done, err = future.DoneWithContext(context.Background(), client) 21939 if err != nil { 21940 err = autorest.NewErrorWithError(err, "network.VpnConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 21941 return 21942 } 21943 if !done { 21944 ar.Response = future.Response() 21945 err = azure.NewAsyncOpIncompleteError("network.VpnConnectionsDeleteFuture") 21946 return 21947 } 21948 ar.Response = future.Response() 21949 return 21950} 21951 21952// VpnDeviceScriptParameters vpn device configuration script generation parameters 21953type VpnDeviceScriptParameters struct { 21954 // Vendor - The vendor for the vpn device. 21955 Vendor *string `json:"vendor,omitempty"` 21956 // DeviceFamily - The device family for the vpn device. 21957 DeviceFamily *string `json:"deviceFamily,omitempty"` 21958 // FirmwareVersion - The firmware version for the vpn device. 21959 FirmwareVersion *string `json:"firmwareVersion,omitempty"` 21960} 21961 21962// VpnGateway vpnGateway Resource. 21963type VpnGateway struct { 21964 autorest.Response `json:"-"` 21965 *VpnGatewayProperties `json:"properties,omitempty"` 21966 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 21967 Etag *string `json:"etag,omitempty"` 21968 // ID - Resource ID. 21969 ID *string `json:"id,omitempty"` 21970 // Name - READ-ONLY; Resource name. 21971 Name *string `json:"name,omitempty"` 21972 // Type - READ-ONLY; Resource type. 21973 Type *string `json:"type,omitempty"` 21974 // Location - Resource location. 21975 Location *string `json:"location,omitempty"` 21976 // Tags - Resource tags. 21977 Tags map[string]*string `json:"tags"` 21978} 21979 21980// MarshalJSON is the custom marshaler for VpnGateway. 21981func (vg VpnGateway) MarshalJSON() ([]byte, error) { 21982 objectMap := make(map[string]interface{}) 21983 if vg.VpnGatewayProperties != nil { 21984 objectMap["properties"] = vg.VpnGatewayProperties 21985 } 21986 if vg.ID != nil { 21987 objectMap["id"] = vg.ID 21988 } 21989 if vg.Location != nil { 21990 objectMap["location"] = vg.Location 21991 } 21992 if vg.Tags != nil { 21993 objectMap["tags"] = vg.Tags 21994 } 21995 return json.Marshal(objectMap) 21996} 21997 21998// UnmarshalJSON is the custom unmarshaler for VpnGateway struct. 21999func (vg *VpnGateway) UnmarshalJSON(body []byte) error { 22000 var m map[string]*json.RawMessage 22001 err := json.Unmarshal(body, &m) 22002 if err != nil { 22003 return err 22004 } 22005 for k, v := range m { 22006 switch k { 22007 case "properties": 22008 if v != nil { 22009 var vpnGatewayProperties VpnGatewayProperties 22010 err = json.Unmarshal(*v, &vpnGatewayProperties) 22011 if err != nil { 22012 return err 22013 } 22014 vg.VpnGatewayProperties = &vpnGatewayProperties 22015 } 22016 case "etag": 22017 if v != nil { 22018 var etag string 22019 err = json.Unmarshal(*v, &etag) 22020 if err != nil { 22021 return err 22022 } 22023 vg.Etag = &etag 22024 } 22025 case "id": 22026 if v != nil { 22027 var ID string 22028 err = json.Unmarshal(*v, &ID) 22029 if err != nil { 22030 return err 22031 } 22032 vg.ID = &ID 22033 } 22034 case "name": 22035 if v != nil { 22036 var name string 22037 err = json.Unmarshal(*v, &name) 22038 if err != nil { 22039 return err 22040 } 22041 vg.Name = &name 22042 } 22043 case "type": 22044 if v != nil { 22045 var typeVar string 22046 err = json.Unmarshal(*v, &typeVar) 22047 if err != nil { 22048 return err 22049 } 22050 vg.Type = &typeVar 22051 } 22052 case "location": 22053 if v != nil { 22054 var location string 22055 err = json.Unmarshal(*v, &location) 22056 if err != nil { 22057 return err 22058 } 22059 vg.Location = &location 22060 } 22061 case "tags": 22062 if v != nil { 22063 var tags map[string]*string 22064 err = json.Unmarshal(*v, &tags) 22065 if err != nil { 22066 return err 22067 } 22068 vg.Tags = tags 22069 } 22070 } 22071 } 22072 22073 return nil 22074} 22075 22076// VpnGatewayProperties parameters for VpnGateway 22077type VpnGatewayProperties struct { 22078 // VirtualHub - The VirtualHub to which the gateway belongs 22079 VirtualHub *SubResource `json:"virtualHub,omitempty"` 22080 // Connections - list of all vpn connections to the gateway. 22081 Connections *[]VpnConnection `json:"connections,omitempty"` 22082 // BgpSettings - Local network gateway's BGP speaker settings. 22083 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 22084 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 22085 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 22086 // Policies - The policies applied to this vpn gateway. 22087 Policies *Policies `json:"policies,omitempty"` 22088} 22089 22090// VpnGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 22091// long-running operation. 22092type VpnGatewaysCreateOrUpdateFuture struct { 22093 azure.FutureAPI 22094 // Result returns the result of the asynchronous operation. 22095 // If the operation has not completed it will return an error. 22096 Result func(VpnGatewaysClient) (VpnGateway, error) 22097} 22098 22099// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22100func (future *VpnGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 22101 var azFuture azure.Future 22102 if err := json.Unmarshal(body, &azFuture); err != nil { 22103 return err 22104 } 22105 future.FutureAPI = &azFuture 22106 future.Result = future.result 22107 return nil 22108} 22109 22110// result is the default implementation for VpnGatewaysCreateOrUpdateFuture.Result. 22111func (future *VpnGatewaysCreateOrUpdateFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { 22112 var done bool 22113 done, err = future.DoneWithContext(context.Background(), client) 22114 if err != nil { 22115 err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 22116 return 22117 } 22118 if !done { 22119 vg.Response.Response = future.Response() 22120 err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysCreateOrUpdateFuture") 22121 return 22122 } 22123 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22124 if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { 22125 vg, err = client.CreateOrUpdateResponder(vg.Response.Response) 22126 if err != nil { 22127 err = autorest.NewErrorWithError(err, "network.VpnGatewaysCreateOrUpdateFuture", "Result", vg.Response.Response, "Failure responding to request") 22128 } 22129 } 22130 return 22131} 22132 22133// VpnGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 22134// operation. 22135type VpnGatewaysDeleteFuture struct { 22136 azure.FutureAPI 22137 // Result returns the result of the asynchronous operation. 22138 // If the operation has not completed it will return an error. 22139 Result func(VpnGatewaysClient) (autorest.Response, error) 22140} 22141 22142// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22143func (future *VpnGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 22144 var azFuture azure.Future 22145 if err := json.Unmarshal(body, &azFuture); err != nil { 22146 return err 22147 } 22148 future.FutureAPI = &azFuture 22149 future.Result = future.result 22150 return nil 22151} 22152 22153// result is the default implementation for VpnGatewaysDeleteFuture.Result. 22154func (future *VpnGatewaysDeleteFuture) result(client VpnGatewaysClient) (ar autorest.Response, err error) { 22155 var done bool 22156 done, err = future.DoneWithContext(context.Background(), client) 22157 if err != nil { 22158 err = autorest.NewErrorWithError(err, "network.VpnGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 22159 return 22160 } 22161 if !done { 22162 ar.Response = future.Response() 22163 err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysDeleteFuture") 22164 return 22165 } 22166 ar.Response = future.Response() 22167 return 22168} 22169 22170// VpnGatewaysUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running 22171// operation. 22172type VpnGatewaysUpdateTagsFuture struct { 22173 azure.FutureAPI 22174 // Result returns the result of the asynchronous operation. 22175 // If the operation has not completed it will return an error. 22176 Result func(VpnGatewaysClient) (VpnGateway, error) 22177} 22178 22179// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22180func (future *VpnGatewaysUpdateTagsFuture) UnmarshalJSON(body []byte) error { 22181 var azFuture azure.Future 22182 if err := json.Unmarshal(body, &azFuture); err != nil { 22183 return err 22184 } 22185 future.FutureAPI = &azFuture 22186 future.Result = future.result 22187 return nil 22188} 22189 22190// result is the default implementation for VpnGatewaysUpdateTagsFuture.Result. 22191func (future *VpnGatewaysUpdateTagsFuture) result(client VpnGatewaysClient) (vg VpnGateway, err error) { 22192 var done bool 22193 done, err = future.DoneWithContext(context.Background(), client) 22194 if err != nil { 22195 err = autorest.NewErrorWithError(err, "network.VpnGatewaysUpdateTagsFuture", "Result", future.Response(), "Polling failure") 22196 return 22197 } 22198 if !done { 22199 vg.Response.Response = future.Response() 22200 err = azure.NewAsyncOpIncompleteError("network.VpnGatewaysUpdateTagsFuture") 22201 return 22202 } 22203 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22204 if vg.Response.Response, err = future.GetResult(sender); err == nil && vg.Response.Response.StatusCode != http.StatusNoContent { 22205 vg, err = client.UpdateTagsResponder(vg.Response.Response) 22206 if err != nil { 22207 err = autorest.NewErrorWithError(err, "network.VpnGatewaysUpdateTagsFuture", "Result", vg.Response.Response, "Failure responding to request") 22208 } 22209 } 22210 return 22211} 22212 22213// VpnSite vpnSite Resource. 22214type VpnSite struct { 22215 autorest.Response `json:"-"` 22216 *VpnSiteProperties `json:"properties,omitempty"` 22217 // Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated. 22218 Etag *string `json:"etag,omitempty"` 22219 // ID - Resource ID. 22220 ID *string `json:"id,omitempty"` 22221 // Name - READ-ONLY; Resource name. 22222 Name *string `json:"name,omitempty"` 22223 // Type - READ-ONLY; Resource type. 22224 Type *string `json:"type,omitempty"` 22225 // Location - Resource location. 22226 Location *string `json:"location,omitempty"` 22227 // Tags - Resource tags. 22228 Tags map[string]*string `json:"tags"` 22229} 22230 22231// MarshalJSON is the custom marshaler for VpnSite. 22232func (vs VpnSite) MarshalJSON() ([]byte, error) { 22233 objectMap := make(map[string]interface{}) 22234 if vs.VpnSiteProperties != nil { 22235 objectMap["properties"] = vs.VpnSiteProperties 22236 } 22237 if vs.ID != nil { 22238 objectMap["id"] = vs.ID 22239 } 22240 if vs.Location != nil { 22241 objectMap["location"] = vs.Location 22242 } 22243 if vs.Tags != nil { 22244 objectMap["tags"] = vs.Tags 22245 } 22246 return json.Marshal(objectMap) 22247} 22248 22249// UnmarshalJSON is the custom unmarshaler for VpnSite struct. 22250func (vs *VpnSite) UnmarshalJSON(body []byte) error { 22251 var m map[string]*json.RawMessage 22252 err := json.Unmarshal(body, &m) 22253 if err != nil { 22254 return err 22255 } 22256 for k, v := range m { 22257 switch k { 22258 case "properties": 22259 if v != nil { 22260 var vpnSiteProperties VpnSiteProperties 22261 err = json.Unmarshal(*v, &vpnSiteProperties) 22262 if err != nil { 22263 return err 22264 } 22265 vs.VpnSiteProperties = &vpnSiteProperties 22266 } 22267 case "etag": 22268 if v != nil { 22269 var etag string 22270 err = json.Unmarshal(*v, &etag) 22271 if err != nil { 22272 return err 22273 } 22274 vs.Etag = &etag 22275 } 22276 case "id": 22277 if v != nil { 22278 var ID string 22279 err = json.Unmarshal(*v, &ID) 22280 if err != nil { 22281 return err 22282 } 22283 vs.ID = &ID 22284 } 22285 case "name": 22286 if v != nil { 22287 var name string 22288 err = json.Unmarshal(*v, &name) 22289 if err != nil { 22290 return err 22291 } 22292 vs.Name = &name 22293 } 22294 case "type": 22295 if v != nil { 22296 var typeVar string 22297 err = json.Unmarshal(*v, &typeVar) 22298 if err != nil { 22299 return err 22300 } 22301 vs.Type = &typeVar 22302 } 22303 case "location": 22304 if v != nil { 22305 var location string 22306 err = json.Unmarshal(*v, &location) 22307 if err != nil { 22308 return err 22309 } 22310 vs.Location = &location 22311 } 22312 case "tags": 22313 if v != nil { 22314 var tags map[string]*string 22315 err = json.Unmarshal(*v, &tags) 22316 if err != nil { 22317 return err 22318 } 22319 vs.Tags = tags 22320 } 22321 } 22322 } 22323 22324 return nil 22325} 22326 22327// VpnSiteID vpnSite Resource. 22328type VpnSiteID struct { 22329 // VpnSite - READ-ONLY; The resource-uri of the vpn-site for which config is to be fetched. 22330 VpnSite *string `json:"vpnSite,omitempty"` 22331} 22332 22333// MarshalJSON is the custom marshaler for VpnSiteID. 22334func (vsi VpnSiteID) MarshalJSON() ([]byte, error) { 22335 objectMap := make(map[string]interface{}) 22336 return json.Marshal(objectMap) 22337} 22338 22339// VpnSiteProperties parameters for VpnSite 22340type VpnSiteProperties struct { 22341 // VirtualWAN - The VirtualWAN to which the vpnSite belongs 22342 VirtualWAN *SubResource `json:"virtualWAN,omitempty"` 22343 // DeviceProperties - The device properties 22344 DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` 22345 // IPAddress - The ip-address for the vpn-site. 22346 IPAddress *string `json:"ipAddress,omitempty"` 22347 // SiteKey - The key for vpn-site that can be used for connections. 22348 SiteKey *string `json:"siteKey,omitempty"` 22349 // AddressSpace - The AddressSpace that contains an array of IP address ranges. 22350 AddressSpace *AddressSpace `json:"addressSpace,omitempty"` 22351 // BgpProperties - The set of bgp properties. 22352 BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` 22353 // ProvisioningState - The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 22354 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 22355} 22356 22357// VpnSitesConfigurationDownloadFuture an abstraction for monitoring and retrieving the results of a 22358// long-running operation. 22359type VpnSitesConfigurationDownloadFuture struct { 22360 azure.FutureAPI 22361 // Result returns the result of the asynchronous operation. 22362 // If the operation has not completed it will return an error. 22363 Result func(VpnSitesConfigurationClient) (autorest.Response, error) 22364} 22365 22366// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22367func (future *VpnSitesConfigurationDownloadFuture) UnmarshalJSON(body []byte) error { 22368 var azFuture azure.Future 22369 if err := json.Unmarshal(body, &azFuture); err != nil { 22370 return err 22371 } 22372 future.FutureAPI = &azFuture 22373 future.Result = future.result 22374 return nil 22375} 22376 22377// result is the default implementation for VpnSitesConfigurationDownloadFuture.Result. 22378func (future *VpnSitesConfigurationDownloadFuture) result(client VpnSitesConfigurationClient) (ar autorest.Response, err error) { 22379 var done bool 22380 done, err = future.DoneWithContext(context.Background(), client) 22381 if err != nil { 22382 err = autorest.NewErrorWithError(err, "network.VpnSitesConfigurationDownloadFuture", "Result", future.Response(), "Polling failure") 22383 return 22384 } 22385 if !done { 22386 ar.Response = future.Response() 22387 err = azure.NewAsyncOpIncompleteError("network.VpnSitesConfigurationDownloadFuture") 22388 return 22389 } 22390 ar.Response = future.Response() 22391 return 22392} 22393 22394// VpnSitesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 22395// operation. 22396type VpnSitesCreateOrUpdateFuture struct { 22397 azure.FutureAPI 22398 // Result returns the result of the asynchronous operation. 22399 // If the operation has not completed it will return an error. 22400 Result func(VpnSitesClient) (VpnSite, error) 22401} 22402 22403// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22404func (future *VpnSitesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 22405 var azFuture azure.Future 22406 if err := json.Unmarshal(body, &azFuture); err != nil { 22407 return err 22408 } 22409 future.FutureAPI = &azFuture 22410 future.Result = future.result 22411 return nil 22412} 22413 22414// result is the default implementation for VpnSitesCreateOrUpdateFuture.Result. 22415func (future *VpnSitesCreateOrUpdateFuture) result(client VpnSitesClient) (vs VpnSite, err error) { 22416 var done bool 22417 done, err = future.DoneWithContext(context.Background(), client) 22418 if err != nil { 22419 err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 22420 return 22421 } 22422 if !done { 22423 vs.Response.Response = future.Response() 22424 err = azure.NewAsyncOpIncompleteError("network.VpnSitesCreateOrUpdateFuture") 22425 return 22426 } 22427 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22428 if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { 22429 vs, err = client.CreateOrUpdateResponder(vs.Response.Response) 22430 if err != nil { 22431 err = autorest.NewErrorWithError(err, "network.VpnSitesCreateOrUpdateFuture", "Result", vs.Response.Response, "Failure responding to request") 22432 } 22433 } 22434 return 22435} 22436 22437// VpnSitesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 22438// operation. 22439type VpnSitesDeleteFuture struct { 22440 azure.FutureAPI 22441 // Result returns the result of the asynchronous operation. 22442 // If the operation has not completed it will return an error. 22443 Result func(VpnSitesClient) (autorest.Response, error) 22444} 22445 22446// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22447func (future *VpnSitesDeleteFuture) UnmarshalJSON(body []byte) error { 22448 var azFuture azure.Future 22449 if err := json.Unmarshal(body, &azFuture); err != nil { 22450 return err 22451 } 22452 future.FutureAPI = &azFuture 22453 future.Result = future.result 22454 return nil 22455} 22456 22457// result is the default implementation for VpnSitesDeleteFuture.Result. 22458func (future *VpnSitesDeleteFuture) result(client VpnSitesClient) (ar autorest.Response, err error) { 22459 var done bool 22460 done, err = future.DoneWithContext(context.Background(), client) 22461 if err != nil { 22462 err = autorest.NewErrorWithError(err, "network.VpnSitesDeleteFuture", "Result", future.Response(), "Polling failure") 22463 return 22464 } 22465 if !done { 22466 ar.Response = future.Response() 22467 err = azure.NewAsyncOpIncompleteError("network.VpnSitesDeleteFuture") 22468 return 22469 } 22470 ar.Response = future.Response() 22471 return 22472} 22473 22474// VpnSitesUpdateTagsFuture an abstraction for monitoring and retrieving the results of a long-running 22475// operation. 22476type VpnSitesUpdateTagsFuture struct { 22477 azure.FutureAPI 22478 // Result returns the result of the asynchronous operation. 22479 // If the operation has not completed it will return an error. 22480 Result func(VpnSitesClient) (VpnSite, error) 22481} 22482 22483// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22484func (future *VpnSitesUpdateTagsFuture) UnmarshalJSON(body []byte) error { 22485 var azFuture azure.Future 22486 if err := json.Unmarshal(body, &azFuture); err != nil { 22487 return err 22488 } 22489 future.FutureAPI = &azFuture 22490 future.Result = future.result 22491 return nil 22492} 22493 22494// result is the default implementation for VpnSitesUpdateTagsFuture.Result. 22495func (future *VpnSitesUpdateTagsFuture) result(client VpnSitesClient) (vs VpnSite, err error) { 22496 var done bool 22497 done, err = future.DoneWithContext(context.Background(), client) 22498 if err != nil { 22499 err = autorest.NewErrorWithError(err, "network.VpnSitesUpdateTagsFuture", "Result", future.Response(), "Polling failure") 22500 return 22501 } 22502 if !done { 22503 vs.Response.Response = future.Response() 22504 err = azure.NewAsyncOpIncompleteError("network.VpnSitesUpdateTagsFuture") 22505 return 22506 } 22507 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22508 if vs.Response.Response, err = future.GetResult(sender); err == nil && vs.Response.Response.StatusCode != http.StatusNoContent { 22509 vs, err = client.UpdateTagsResponder(vs.Response.Response) 22510 if err != nil { 22511 err = autorest.NewErrorWithError(err, "network.VpnSitesUpdateTagsFuture", "Result", vs.Response.Response, "Failure responding to request") 22512 } 22513 } 22514 return 22515} 22516 22517// Watcher network watcher in a resource group. 22518type Watcher struct { 22519 autorest.Response `json:"-"` 22520 // Etag - A unique read-only string that changes whenever the resource is updated. 22521 Etag *string `json:"etag,omitempty"` 22522 *WatcherPropertiesFormat `json:"properties,omitempty"` 22523 // ID - Resource ID. 22524 ID *string `json:"id,omitempty"` 22525 // Name - READ-ONLY; Resource name. 22526 Name *string `json:"name,omitempty"` 22527 // Type - READ-ONLY; Resource type. 22528 Type *string `json:"type,omitempty"` 22529 // Location - Resource location. 22530 Location *string `json:"location,omitempty"` 22531 // Tags - Resource tags. 22532 Tags map[string]*string `json:"tags"` 22533} 22534 22535// MarshalJSON is the custom marshaler for Watcher. 22536func (w Watcher) MarshalJSON() ([]byte, error) { 22537 objectMap := make(map[string]interface{}) 22538 if w.Etag != nil { 22539 objectMap["etag"] = w.Etag 22540 } 22541 if w.WatcherPropertiesFormat != nil { 22542 objectMap["properties"] = w.WatcherPropertiesFormat 22543 } 22544 if w.ID != nil { 22545 objectMap["id"] = w.ID 22546 } 22547 if w.Location != nil { 22548 objectMap["location"] = w.Location 22549 } 22550 if w.Tags != nil { 22551 objectMap["tags"] = w.Tags 22552 } 22553 return json.Marshal(objectMap) 22554} 22555 22556// UnmarshalJSON is the custom unmarshaler for Watcher struct. 22557func (w *Watcher) UnmarshalJSON(body []byte) error { 22558 var m map[string]*json.RawMessage 22559 err := json.Unmarshal(body, &m) 22560 if err != nil { 22561 return err 22562 } 22563 for k, v := range m { 22564 switch k { 22565 case "etag": 22566 if v != nil { 22567 var etag string 22568 err = json.Unmarshal(*v, &etag) 22569 if err != nil { 22570 return err 22571 } 22572 w.Etag = &etag 22573 } 22574 case "properties": 22575 if v != nil { 22576 var watcherPropertiesFormat WatcherPropertiesFormat 22577 err = json.Unmarshal(*v, &watcherPropertiesFormat) 22578 if err != nil { 22579 return err 22580 } 22581 w.WatcherPropertiesFormat = &watcherPropertiesFormat 22582 } 22583 case "id": 22584 if v != nil { 22585 var ID string 22586 err = json.Unmarshal(*v, &ID) 22587 if err != nil { 22588 return err 22589 } 22590 w.ID = &ID 22591 } 22592 case "name": 22593 if v != nil { 22594 var name string 22595 err = json.Unmarshal(*v, &name) 22596 if err != nil { 22597 return err 22598 } 22599 w.Name = &name 22600 } 22601 case "type": 22602 if v != nil { 22603 var typeVar string 22604 err = json.Unmarshal(*v, &typeVar) 22605 if err != nil { 22606 return err 22607 } 22608 w.Type = &typeVar 22609 } 22610 case "location": 22611 if v != nil { 22612 var location string 22613 err = json.Unmarshal(*v, &location) 22614 if err != nil { 22615 return err 22616 } 22617 w.Location = &location 22618 } 22619 case "tags": 22620 if v != nil { 22621 var tags map[string]*string 22622 err = json.Unmarshal(*v, &tags) 22623 if err != nil { 22624 return err 22625 } 22626 w.Tags = tags 22627 } 22628 } 22629 } 22630 22631 return nil 22632} 22633 22634// WatcherListResult list of network watcher resources. 22635type WatcherListResult struct { 22636 autorest.Response `json:"-"` 22637 Value *[]Watcher `json:"value,omitempty"` 22638} 22639 22640// WatcherPropertiesFormat the network watcher properties. 22641type WatcherPropertiesFormat struct { 22642 // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' 22643 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 22644} 22645 22646// MarshalJSON is the custom marshaler for WatcherPropertiesFormat. 22647func (wpf WatcherPropertiesFormat) MarshalJSON() ([]byte, error) { 22648 objectMap := make(map[string]interface{}) 22649 return json.Marshal(objectMap) 22650} 22651 22652// WatchersCheckConnectivityFuture an abstraction for monitoring and retrieving the results of a 22653// long-running operation. 22654type WatchersCheckConnectivityFuture struct { 22655 azure.FutureAPI 22656 // Result returns the result of the asynchronous operation. 22657 // If the operation has not completed it will return an error. 22658 Result func(WatchersClient) (ConnectivityInformation, error) 22659} 22660 22661// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22662func (future *WatchersCheckConnectivityFuture) UnmarshalJSON(body []byte) error { 22663 var azFuture azure.Future 22664 if err := json.Unmarshal(body, &azFuture); err != nil { 22665 return err 22666 } 22667 future.FutureAPI = &azFuture 22668 future.Result = future.result 22669 return nil 22670} 22671 22672// result is the default implementation for WatchersCheckConnectivityFuture.Result. 22673func (future *WatchersCheckConnectivityFuture) result(client WatchersClient) (ci ConnectivityInformation, err error) { 22674 var done bool 22675 done, err = future.DoneWithContext(context.Background(), client) 22676 if err != nil { 22677 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Polling failure") 22678 return 22679 } 22680 if !done { 22681 ci.Response.Response = future.Response() 22682 err = azure.NewAsyncOpIncompleteError("network.WatchersCheckConnectivityFuture") 22683 return 22684 } 22685 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22686 if ci.Response.Response, err = future.GetResult(sender); err == nil && ci.Response.Response.StatusCode != http.StatusNoContent { 22687 ci, err = client.CheckConnectivityResponder(ci.Response.Response) 22688 if err != nil { 22689 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", ci.Response.Response, "Failure responding to request") 22690 } 22691 } 22692 return 22693} 22694 22695// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 22696// operation. 22697type WatchersDeleteFuture struct { 22698 azure.FutureAPI 22699 // Result returns the result of the asynchronous operation. 22700 // If the operation has not completed it will return an error. 22701 Result func(WatchersClient) (autorest.Response, error) 22702} 22703 22704// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22705func (future *WatchersDeleteFuture) UnmarshalJSON(body []byte) error { 22706 var azFuture azure.Future 22707 if err := json.Unmarshal(body, &azFuture); err != nil { 22708 return err 22709 } 22710 future.FutureAPI = &azFuture 22711 future.Result = future.result 22712 return nil 22713} 22714 22715// result is the default implementation for WatchersDeleteFuture.Result. 22716func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.Response, err error) { 22717 var done bool 22718 done, err = future.DoneWithContext(context.Background(), client) 22719 if err != nil { 22720 err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure") 22721 return 22722 } 22723 if !done { 22724 ar.Response = future.Response() 22725 err = azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture") 22726 return 22727 } 22728 ar.Response = future.Response() 22729 return 22730} 22731 22732// WatchersGetAzureReachabilityReportFuture an abstraction for monitoring and retrieving the results of a 22733// long-running operation. 22734type WatchersGetAzureReachabilityReportFuture struct { 22735 azure.FutureAPI 22736 // Result returns the result of the asynchronous operation. 22737 // If the operation has not completed it will return an error. 22738 Result func(WatchersClient) (AzureReachabilityReport, error) 22739} 22740 22741// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22742func (future *WatchersGetAzureReachabilityReportFuture) UnmarshalJSON(body []byte) error { 22743 var azFuture azure.Future 22744 if err := json.Unmarshal(body, &azFuture); err != nil { 22745 return err 22746 } 22747 future.FutureAPI = &azFuture 22748 future.Result = future.result 22749 return nil 22750} 22751 22752// result is the default implementation for WatchersGetAzureReachabilityReportFuture.Result. 22753func (future *WatchersGetAzureReachabilityReportFuture) result(client WatchersClient) (arr AzureReachabilityReport, err error) { 22754 var done bool 22755 done, err = future.DoneWithContext(context.Background(), client) 22756 if err != nil { 22757 err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", future.Response(), "Polling failure") 22758 return 22759 } 22760 if !done { 22761 arr.Response.Response = future.Response() 22762 err = azure.NewAsyncOpIncompleteError("network.WatchersGetAzureReachabilityReportFuture") 22763 return 22764 } 22765 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22766 if arr.Response.Response, err = future.GetResult(sender); err == nil && arr.Response.Response.StatusCode != http.StatusNoContent { 22767 arr, err = client.GetAzureReachabilityReportResponder(arr.Response.Response) 22768 if err != nil { 22769 err = autorest.NewErrorWithError(err, "network.WatchersGetAzureReachabilityReportFuture", "Result", arr.Response.Response, "Failure responding to request") 22770 } 22771 } 22772 return 22773} 22774 22775// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a 22776// long-running operation. 22777type WatchersGetFlowLogStatusFuture struct { 22778 azure.FutureAPI 22779 // Result returns the result of the asynchronous operation. 22780 // If the operation has not completed it will return an error. 22781 Result func(WatchersClient) (FlowLogInformation, error) 22782} 22783 22784// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22785func (future *WatchersGetFlowLogStatusFuture) UnmarshalJSON(body []byte) error { 22786 var azFuture azure.Future 22787 if err := json.Unmarshal(body, &azFuture); err != nil { 22788 return err 22789 } 22790 future.FutureAPI = &azFuture 22791 future.Result = future.result 22792 return nil 22793} 22794 22795// result is the default implementation for WatchersGetFlowLogStatusFuture.Result. 22796func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { 22797 var done bool 22798 done, err = future.DoneWithContext(context.Background(), client) 22799 if err != nil { 22800 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure") 22801 return 22802 } 22803 if !done { 22804 fli.Response.Response = future.Response() 22805 err = azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture") 22806 return 22807 } 22808 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22809 if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { 22810 fli, err = client.GetFlowLogStatusResponder(fli.Response.Response) 22811 if err != nil { 22812 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", fli.Response.Response, "Failure responding to request") 22813 } 22814 } 22815 return 22816} 22817 22818// WatchersGetNextHopFuture an abstraction for monitoring and retrieving the results of a long-running 22819// operation. 22820type WatchersGetNextHopFuture struct { 22821 azure.FutureAPI 22822 // Result returns the result of the asynchronous operation. 22823 // If the operation has not completed it will return an error. 22824 Result func(WatchersClient) (NextHopResult, error) 22825} 22826 22827// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22828func (future *WatchersGetNextHopFuture) UnmarshalJSON(body []byte) error { 22829 var azFuture azure.Future 22830 if err := json.Unmarshal(body, &azFuture); err != nil { 22831 return err 22832 } 22833 future.FutureAPI = &azFuture 22834 future.Result = future.result 22835 return nil 22836} 22837 22838// result is the default implementation for WatchersGetNextHopFuture.Result. 22839func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextHopResult, err error) { 22840 var done bool 22841 done, err = future.DoneWithContext(context.Background(), client) 22842 if err != nil { 22843 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure") 22844 return 22845 } 22846 if !done { 22847 nhr.Response.Response = future.Response() 22848 err = azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture") 22849 return 22850 } 22851 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22852 if nhr.Response.Response, err = future.GetResult(sender); err == nil && nhr.Response.Response.StatusCode != http.StatusNoContent { 22853 nhr, err = client.GetNextHopResponder(nhr.Response.Response) 22854 if err != nil { 22855 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", nhr.Response.Response, "Failure responding to request") 22856 } 22857 } 22858 return 22859} 22860 22861// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a 22862// long-running operation. 22863type WatchersGetTroubleshootingFuture struct { 22864 azure.FutureAPI 22865 // Result returns the result of the asynchronous operation. 22866 // If the operation has not completed it will return an error. 22867 Result func(WatchersClient) (TroubleshootingResult, error) 22868} 22869 22870// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22871func (future *WatchersGetTroubleshootingFuture) UnmarshalJSON(body []byte) error { 22872 var azFuture azure.Future 22873 if err := json.Unmarshal(body, &azFuture); err != nil { 22874 return err 22875 } 22876 future.FutureAPI = &azFuture 22877 future.Result = future.result 22878 return nil 22879} 22880 22881// result is the default implementation for WatchersGetTroubleshootingFuture.Result. 22882func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { 22883 var done bool 22884 done, err = future.DoneWithContext(context.Background(), client) 22885 if err != nil { 22886 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure") 22887 return 22888 } 22889 if !done { 22890 tr.Response.Response = future.Response() 22891 err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture") 22892 return 22893 } 22894 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22895 if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { 22896 tr, err = client.GetTroubleshootingResponder(tr.Response.Response) 22897 if err != nil { 22898 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", tr.Response.Response, "Failure responding to request") 22899 } 22900 } 22901 return 22902} 22903 22904// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a 22905// long-running operation. 22906type WatchersGetTroubleshootingResultFuture struct { 22907 azure.FutureAPI 22908 // Result returns the result of the asynchronous operation. 22909 // If the operation has not completed it will return an error. 22910 Result func(WatchersClient) (TroubleshootingResult, error) 22911} 22912 22913// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22914func (future *WatchersGetTroubleshootingResultFuture) UnmarshalJSON(body []byte) error { 22915 var azFuture azure.Future 22916 if err := json.Unmarshal(body, &azFuture); err != nil { 22917 return err 22918 } 22919 future.FutureAPI = &azFuture 22920 future.Result = future.result 22921 return nil 22922} 22923 22924// result is the default implementation for WatchersGetTroubleshootingResultFuture.Result. 22925func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { 22926 var done bool 22927 done, err = future.DoneWithContext(context.Background(), client) 22928 if err != nil { 22929 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure") 22930 return 22931 } 22932 if !done { 22933 tr.Response.Response = future.Response() 22934 err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture") 22935 return 22936 } 22937 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22938 if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { 22939 tr, err = client.GetTroubleshootingResultResponder(tr.Response.Response) 22940 if err != nil { 22941 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", tr.Response.Response, "Failure responding to request") 22942 } 22943 } 22944 return 22945} 22946 22947// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a 22948// long-running operation. 22949type WatchersGetVMSecurityRulesFuture struct { 22950 azure.FutureAPI 22951 // Result returns the result of the asynchronous operation. 22952 // If the operation has not completed it will return an error. 22953 Result func(WatchersClient) (SecurityGroupViewResult, error) 22954} 22955 22956// UnmarshalJSON is the custom unmarshaller for CreateFuture. 22957func (future *WatchersGetVMSecurityRulesFuture) UnmarshalJSON(body []byte) error { 22958 var azFuture azure.Future 22959 if err := json.Unmarshal(body, &azFuture); err != nil { 22960 return err 22961 } 22962 future.FutureAPI = &azFuture 22963 future.Result = future.result 22964 return nil 22965} 22966 22967// result is the default implementation for WatchersGetVMSecurityRulesFuture.Result. 22968func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) { 22969 var done bool 22970 done, err = future.DoneWithContext(context.Background(), client) 22971 if err != nil { 22972 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure") 22973 return 22974 } 22975 if !done { 22976 sgvr.Response.Response = future.Response() 22977 err = azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture") 22978 return 22979 } 22980 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 22981 if sgvr.Response.Response, err = future.GetResult(sender); err == nil && sgvr.Response.Response.StatusCode != http.StatusNoContent { 22982 sgvr, err = client.GetVMSecurityRulesResponder(sgvr.Response.Response) 22983 if err != nil { 22984 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", sgvr.Response.Response, "Failure responding to request") 22985 } 22986 } 22987 return 22988} 22989 22990// WatchersListAvailableProvidersFuture an abstraction for monitoring and retrieving the results of a 22991// long-running operation. 22992type WatchersListAvailableProvidersFuture struct { 22993 azure.FutureAPI 22994 // Result returns the result of the asynchronous operation. 22995 // If the operation has not completed it will return an error. 22996 Result func(WatchersClient) (AvailableProvidersList, error) 22997} 22998 22999// UnmarshalJSON is the custom unmarshaller for CreateFuture. 23000func (future *WatchersListAvailableProvidersFuture) UnmarshalJSON(body []byte) error { 23001 var azFuture azure.Future 23002 if err := json.Unmarshal(body, &azFuture); err != nil { 23003 return err 23004 } 23005 future.FutureAPI = &azFuture 23006 future.Result = future.result 23007 return nil 23008} 23009 23010// result is the default implementation for WatchersListAvailableProvidersFuture.Result. 23011func (future *WatchersListAvailableProvidersFuture) result(client WatchersClient) (apl AvailableProvidersList, err error) { 23012 var done bool 23013 done, err = future.DoneWithContext(context.Background(), client) 23014 if err != nil { 23015 err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", future.Response(), "Polling failure") 23016 return 23017 } 23018 if !done { 23019 apl.Response.Response = future.Response() 23020 err = azure.NewAsyncOpIncompleteError("network.WatchersListAvailableProvidersFuture") 23021 return 23022 } 23023 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 23024 if apl.Response.Response, err = future.GetResult(sender); err == nil && apl.Response.Response.StatusCode != http.StatusNoContent { 23025 apl, err = client.ListAvailableProvidersResponder(apl.Response.Response) 23026 if err != nil { 23027 err = autorest.NewErrorWithError(err, "network.WatchersListAvailableProvidersFuture", "Result", apl.Response.Response, "Failure responding to request") 23028 } 23029 } 23030 return 23031} 23032 23033// WatchersSetFlowLogConfigurationFuture an abstraction for monitoring and retrieving the results of a 23034// long-running operation. 23035type WatchersSetFlowLogConfigurationFuture struct { 23036 azure.FutureAPI 23037 // Result returns the result of the asynchronous operation. 23038 // If the operation has not completed it will return an error. 23039 Result func(WatchersClient) (FlowLogInformation, error) 23040} 23041 23042// UnmarshalJSON is the custom unmarshaller for CreateFuture. 23043func (future *WatchersSetFlowLogConfigurationFuture) UnmarshalJSON(body []byte) error { 23044 var azFuture azure.Future 23045 if err := json.Unmarshal(body, &azFuture); err != nil { 23046 return err 23047 } 23048 future.FutureAPI = &azFuture 23049 future.Result = future.result 23050 return nil 23051} 23052 23053// result is the default implementation for WatchersSetFlowLogConfigurationFuture.Result. 23054func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { 23055 var done bool 23056 done, err = future.DoneWithContext(context.Background(), client) 23057 if err != nil { 23058 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure") 23059 return 23060 } 23061 if !done { 23062 fli.Response.Response = future.Response() 23063 err = azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture") 23064 return 23065 } 23066 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 23067 if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { 23068 fli, err = client.SetFlowLogConfigurationResponder(fli.Response.Response) 23069 if err != nil { 23070 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", fli.Response.Response, "Failure responding to request") 23071 } 23072 } 23073 return 23074} 23075 23076// WatchersVerifyIPFlowFuture an abstraction for monitoring and retrieving the results of a long-running 23077// operation. 23078type WatchersVerifyIPFlowFuture struct { 23079 azure.FutureAPI 23080 // Result returns the result of the asynchronous operation. 23081 // If the operation has not completed it will return an error. 23082 Result func(WatchersClient) (VerificationIPFlowResult, error) 23083} 23084 23085// UnmarshalJSON is the custom unmarshaller for CreateFuture. 23086func (future *WatchersVerifyIPFlowFuture) UnmarshalJSON(body []byte) error { 23087 var azFuture azure.Future 23088 if err := json.Unmarshal(body, &azFuture); err != nil { 23089 return err 23090 } 23091 future.FutureAPI = &azFuture 23092 future.Result = future.result 23093 return nil 23094} 23095 23096// result is the default implementation for WatchersVerifyIPFlowFuture.Result. 23097func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr VerificationIPFlowResult, err error) { 23098 var done bool 23099 done, err = future.DoneWithContext(context.Background(), client) 23100 if err != nil { 23101 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure") 23102 return 23103 } 23104 if !done { 23105 vifr.Response.Response = future.Response() 23106 err = azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture") 23107 return 23108 } 23109 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 23110 if vifr.Response.Response, err = future.GetResult(sender); err == nil && vifr.Response.Response.StatusCode != http.StatusNoContent { 23111 vifr, err = client.VerifyIPFlowResponder(vifr.Response.Response) 23112 if err != nil { 23113 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", vifr.Response.Response, "Failure responding to request") 23114 } 23115 } 23116 return 23117} 23118