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/to" 15 "github.com/Azure/go-autorest/tracing" 16 "net/http" 17) 18 19// The package's fully qualified name. 20const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-03-30/network" 21 22// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets 23type AddressSpace struct { 24 // AddressPrefixes - Gets or sets List of address blocks reserved for this virtual network in CIDR notation 25 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` 26} 27 28// ApplicationGateway applicationGateways resource 29type ApplicationGateway struct { 30 autorest.Response `json:"-"` 31 *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` 32 // Etag - Gets a unique read-only string that changes whenever the resource is updated 33 Etag *string `json:"etag,omitempty"` 34 // ID - Resource Id 35 ID *string `json:"id,omitempty"` 36 // Name - READ-ONLY; Resource name 37 Name *string `json:"name,omitempty"` 38 // Type - READ-ONLY; Resource type 39 Type *string `json:"type,omitempty"` 40 // Location - Resource location 41 Location *string `json:"location,omitempty"` 42 // Tags - Resource tags 43 Tags map[string]*string `json:"tags"` 44} 45 46// MarshalJSON is the custom marshaler for ApplicationGateway. 47func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { 48 objectMap := make(map[string]interface{}) 49 if ag.ApplicationGatewayPropertiesFormat != nil { 50 objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat 51 } 52 if ag.Etag != nil { 53 objectMap["etag"] = ag.Etag 54 } 55 if ag.ID != nil { 56 objectMap["id"] = ag.ID 57 } 58 if ag.Location != nil { 59 objectMap["location"] = ag.Location 60 } 61 if ag.Tags != nil { 62 objectMap["tags"] = ag.Tags 63 } 64 return json.Marshal(objectMap) 65} 66 67// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. 68func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { 69 var m map[string]*json.RawMessage 70 err := json.Unmarshal(body, &m) 71 if err != nil { 72 return err 73 } 74 for k, v := range m { 75 switch k { 76 case "properties": 77 if v != nil { 78 var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat 79 err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) 80 if err != nil { 81 return err 82 } 83 ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat 84 } 85 case "etag": 86 if v != nil { 87 var etag string 88 err = json.Unmarshal(*v, &etag) 89 if err != nil { 90 return err 91 } 92 ag.Etag = &etag 93 } 94 case "id": 95 if v != nil { 96 var ID string 97 err = json.Unmarshal(*v, &ID) 98 if err != nil { 99 return err 100 } 101 ag.ID = &ID 102 } 103 case "name": 104 if v != nil { 105 var name string 106 err = json.Unmarshal(*v, &name) 107 if err != nil { 108 return err 109 } 110 ag.Name = &name 111 } 112 case "type": 113 if v != nil { 114 var typeVar string 115 err = json.Unmarshal(*v, &typeVar) 116 if err != nil { 117 return err 118 } 119 ag.Type = &typeVar 120 } 121 case "location": 122 if v != nil { 123 var location string 124 err = json.Unmarshal(*v, &location) 125 if err != nil { 126 return err 127 } 128 ag.Location = &location 129 } 130 case "tags": 131 if v != nil { 132 var tags map[string]*string 133 err = json.Unmarshal(*v, &tags) 134 if err != nil { 135 return err 136 } 137 ag.Tags = tags 138 } 139 } 140 } 141 142 return nil 143} 144 145// ApplicationGatewayBackendAddress backend Address of application gateway 146type ApplicationGatewayBackendAddress struct { 147 // Fqdn - Gets or sets the dns name 148 Fqdn *string `json:"fqdn,omitempty"` 149 // IPAddress - Gets or sets the ip address 150 IPAddress *string `json:"ipAddress,omitempty"` 151} 152 153// ApplicationGatewayBackendAddressPool backend Address Pool of application gateway 154type ApplicationGatewayBackendAddressPool struct { 155 *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 156 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 157 Name *string `json:"name,omitempty"` 158 // Etag - A unique read-only string that changes whenever the resource is updated 159 Etag *string `json:"etag,omitempty"` 160 // ID - Resource Id 161 ID *string `json:"id,omitempty"` 162} 163 164// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. 165func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { 166 objectMap := make(map[string]interface{}) 167 if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { 168 objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat 169 } 170 if agbap.Name != nil { 171 objectMap["name"] = agbap.Name 172 } 173 if agbap.Etag != nil { 174 objectMap["etag"] = agbap.Etag 175 } 176 if agbap.ID != nil { 177 objectMap["id"] = agbap.ID 178 } 179 return json.Marshal(objectMap) 180} 181 182// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. 183func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { 184 var m map[string]*json.RawMessage 185 err := json.Unmarshal(body, &m) 186 if err != nil { 187 return err 188 } 189 for k, v := range m { 190 switch k { 191 case "properties": 192 if v != nil { 193 var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat 194 err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) 195 if err != nil { 196 return err 197 } 198 agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat 199 } 200 case "name": 201 if v != nil { 202 var name string 203 err = json.Unmarshal(*v, &name) 204 if err != nil { 205 return err 206 } 207 agbap.Name = &name 208 } 209 case "etag": 210 if v != nil { 211 var etag string 212 err = json.Unmarshal(*v, &etag) 213 if err != nil { 214 return err 215 } 216 agbap.Etag = &etag 217 } 218 case "id": 219 if v != nil { 220 var ID string 221 err = json.Unmarshal(*v, &ID) 222 if err != nil { 223 return err 224 } 225 agbap.ID = &ID 226 } 227 } 228 } 229 230 return nil 231} 232 233// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of application 234// gateway 235type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { 236 // BackendIPConfigurations - Gets collection of references to IPs defined in NICs 237 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 238 // BackendAddresses - Gets or sets the backend addresses 239 BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` 240 // ProvisioningState - Gets or sets Provisioning state of the backend address pool resource Updating/Deleting/Failed 241 ProvisioningState *string `json:"provisioningState,omitempty"` 242} 243 244// ApplicationGatewayBackendHTTPSettings backend address pool settings of application gateway 245type ApplicationGatewayBackendHTTPSettings struct { 246 *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` 247 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 248 Name *string `json:"name,omitempty"` 249 // Etag - A unique read-only string that changes whenever the resource is updated 250 Etag *string `json:"etag,omitempty"` 251 // ID - Resource Id 252 ID *string `json:"id,omitempty"` 253} 254 255// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. 256func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { 257 objectMap := make(map[string]interface{}) 258 if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { 259 objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat 260 } 261 if agbhs.Name != nil { 262 objectMap["name"] = agbhs.Name 263 } 264 if agbhs.Etag != nil { 265 objectMap["etag"] = agbhs.Etag 266 } 267 if agbhs.ID != nil { 268 objectMap["id"] = agbhs.ID 269 } 270 return json.Marshal(objectMap) 271} 272 273// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. 274func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { 275 var m map[string]*json.RawMessage 276 err := json.Unmarshal(body, &m) 277 if err != nil { 278 return err 279 } 280 for k, v := range m { 281 switch k { 282 case "properties": 283 if v != nil { 284 var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat 285 err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) 286 if err != nil { 287 return err 288 } 289 agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat 290 } 291 case "name": 292 if v != nil { 293 var name string 294 err = json.Unmarshal(*v, &name) 295 if err != nil { 296 return err 297 } 298 agbhs.Name = &name 299 } 300 case "etag": 301 if v != nil { 302 var etag string 303 err = json.Unmarshal(*v, &etag) 304 if err != nil { 305 return err 306 } 307 agbhs.Etag = &etag 308 } 309 case "id": 310 if v != nil { 311 var ID string 312 err = json.Unmarshal(*v, &ID) 313 if err != nil { 314 return err 315 } 316 agbhs.ID = &ID 317 } 318 } 319 } 320 321 return nil 322} 323 324// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of 325// application gateway 326type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { 327 // Port - Gets or sets the port 328 Port *int32 `json:"port,omitempty"` 329 // Protocol - Gets or sets the protocol. Possible values include: 'HTTP', 'HTTPS' 330 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 331 // CookieBasedAffinity - Gets or sets the cookie affinity. Possible values include: 'Enabled', 'Disabled' 332 CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` 333 // RequestTimeout - Gets or sets request timeout 334 RequestTimeout *int32 `json:"requestTimeout,omitempty"` 335 // Probe - Gets or sets probe resource of application gateway 336 Probe *SubResource `json:"probe,omitempty"` 337 // ProvisioningState - Gets or sets Provisioning state of the backend http settings resource Updating/Deleting/Failed 338 ProvisioningState *string `json:"provisioningState,omitempty"` 339} 340 341// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of application gateway 342type ApplicationGatewayFrontendIPConfiguration struct { 343 *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` 344 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 345 Name *string `json:"name,omitempty"` 346 // Etag - A unique read-only string that changes whenever the resource is updated 347 Etag *string `json:"etag,omitempty"` 348 // ID - Resource Id 349 ID *string `json:"id,omitempty"` 350} 351 352// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. 353func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { 354 objectMap := make(map[string]interface{}) 355 if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { 356 objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat 357 } 358 if agfic.Name != nil { 359 objectMap["name"] = agfic.Name 360 } 361 if agfic.Etag != nil { 362 objectMap["etag"] = agfic.Etag 363 } 364 if agfic.ID != nil { 365 objectMap["id"] = agfic.ID 366 } 367 return json.Marshal(objectMap) 368} 369 370// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. 371func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { 372 var m map[string]*json.RawMessage 373 err := json.Unmarshal(body, &m) 374 if err != nil { 375 return err 376 } 377 for k, v := range m { 378 switch k { 379 case "properties": 380 if v != nil { 381 var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat 382 err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) 383 if err != nil { 384 return err 385 } 386 agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat 387 } 388 case "name": 389 if v != nil { 390 var name string 391 err = json.Unmarshal(*v, &name) 392 if err != nil { 393 return err 394 } 395 agfic.Name = &name 396 } 397 case "etag": 398 if v != nil { 399 var etag string 400 err = json.Unmarshal(*v, &etag) 401 if err != nil { 402 return err 403 } 404 agfic.Etag = &etag 405 } 406 case "id": 407 if v != nil { 408 var ID string 409 err = json.Unmarshal(*v, &ID) 410 if err != nil { 411 return err 412 } 413 agfic.ID = &ID 414 } 415 } 416 } 417 418 return nil 419} 420 421// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of 422// application gateway 423type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { 424 // PrivateIPAddress - Gets or sets the privateIPAddress of the Network Interface IP Configuration 425 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 426 // PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic). Possible values include: 'Static', 'Dynamic' 427 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 428 // Subnet - Gets or sets the reference of the subnet resource 429 Subnet *SubResource `json:"subnet,omitempty"` 430 // PublicIPAddress - Gets or sets the reference of the PublicIP resource 431 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 432 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 433 ProvisioningState *string `json:"provisioningState,omitempty"` 434} 435 436// ApplicationGatewayFrontendPort frontend Port of application gateway 437type ApplicationGatewayFrontendPort struct { 438 *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` 439 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 440 Name *string `json:"name,omitempty"` 441 // Etag - A unique read-only string that changes whenever the resource is updated 442 Etag *string `json:"etag,omitempty"` 443 // ID - Resource Id 444 ID *string `json:"id,omitempty"` 445} 446 447// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. 448func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { 449 objectMap := make(map[string]interface{}) 450 if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { 451 objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat 452 } 453 if agfp.Name != nil { 454 objectMap["name"] = agfp.Name 455 } 456 if agfp.Etag != nil { 457 objectMap["etag"] = agfp.Etag 458 } 459 if agfp.ID != nil { 460 objectMap["id"] = agfp.ID 461 } 462 return json.Marshal(objectMap) 463} 464 465// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. 466func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { 467 var m map[string]*json.RawMessage 468 err := json.Unmarshal(body, &m) 469 if err != nil { 470 return err 471 } 472 for k, v := range m { 473 switch k { 474 case "properties": 475 if v != nil { 476 var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat 477 err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) 478 if err != nil { 479 return err 480 } 481 agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat 482 } 483 case "name": 484 if v != nil { 485 var name string 486 err = json.Unmarshal(*v, &name) 487 if err != nil { 488 return err 489 } 490 agfp.Name = &name 491 } 492 case "etag": 493 if v != nil { 494 var etag string 495 err = json.Unmarshal(*v, &etag) 496 if err != nil { 497 return err 498 } 499 agfp.Etag = &etag 500 } 501 case "id": 502 if v != nil { 503 var ID string 504 err = json.Unmarshal(*v, &ID) 505 if err != nil { 506 return err 507 } 508 agfp.ID = &ID 509 } 510 } 511 } 512 513 return nil 514} 515 516// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend Port of application gateway 517type ApplicationGatewayFrontendPortPropertiesFormat struct { 518 // Port - Gets or sets the frontend port 519 Port *int32 `json:"port,omitempty"` 520 // ProvisioningState - Gets or sets Provisioning state of the frontend port resource Updating/Deleting/Failed 521 ProvisioningState *string `json:"provisioningState,omitempty"` 522} 523 524// ApplicationGatewayHTTPListener http listener of application gateway 525type ApplicationGatewayHTTPListener struct { 526 *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` 527 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 528 Name *string `json:"name,omitempty"` 529 // Etag - A unique read-only string that changes whenever the resource is updated 530 Etag *string `json:"etag,omitempty"` 531 // ID - Resource Id 532 ID *string `json:"id,omitempty"` 533} 534 535// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. 536func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { 537 objectMap := make(map[string]interface{}) 538 if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { 539 objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat 540 } 541 if aghl.Name != nil { 542 objectMap["name"] = aghl.Name 543 } 544 if aghl.Etag != nil { 545 objectMap["etag"] = aghl.Etag 546 } 547 if aghl.ID != nil { 548 objectMap["id"] = aghl.ID 549 } 550 return json.Marshal(objectMap) 551} 552 553// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. 554func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { 555 var m map[string]*json.RawMessage 556 err := json.Unmarshal(body, &m) 557 if err != nil { 558 return err 559 } 560 for k, v := range m { 561 switch k { 562 case "properties": 563 if v != nil { 564 var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat 565 err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) 566 if err != nil { 567 return err 568 } 569 aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat 570 } 571 case "name": 572 if v != nil { 573 var name string 574 err = json.Unmarshal(*v, &name) 575 if err != nil { 576 return err 577 } 578 aghl.Name = &name 579 } 580 case "etag": 581 if v != nil { 582 var etag string 583 err = json.Unmarshal(*v, &etag) 584 if err != nil { 585 return err 586 } 587 aghl.Etag = &etag 588 } 589 case "id": 590 if v != nil { 591 var ID string 592 err = json.Unmarshal(*v, &ID) 593 if err != nil { 594 return err 595 } 596 aghl.ID = &ID 597 } 598 } 599 } 600 601 return nil 602} 603 604// ApplicationGatewayHTTPListenerPropertiesFormat properties of Http listener of application gateway 605type ApplicationGatewayHTTPListenerPropertiesFormat struct { 606 // FrontendIPConfiguration - Gets or sets frontend IP configuration resource of application gateway 607 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 608 // FrontendPort - Gets or sets frontend port resource of application gateway 609 FrontendPort *SubResource `json:"frontendPort,omitempty"` 610 // Protocol - Gets or sets the protocol. Possible values include: 'HTTP', 'HTTPS' 611 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 612 // HostName - Gets or sets the host name of http listener 613 HostName *string `json:"hostName,omitempty"` 614 // SslCertificate - Gets or sets ssl certificate resource of application gateway 615 SslCertificate *SubResource `json:"sslCertificate,omitempty"` 616 // RequireServerNameIndication - Gets or sets the requireServerNameIndication of http listener 617 RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` 618 // ProvisioningState - Gets or sets Provisioning state of the http listener resource Updating/Deleting/Failed 619 ProvisioningState *string `json:"provisioningState,omitempty"` 620} 621 622// ApplicationGatewayIPConfiguration IP configuration of application gateway 623type ApplicationGatewayIPConfiguration struct { 624 *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 625 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 626 Name *string `json:"name,omitempty"` 627 // Etag - A unique read-only string that changes whenever the resource is updated 628 Etag *string `json:"etag,omitempty"` 629 // ID - Resource Id 630 ID *string `json:"id,omitempty"` 631} 632 633// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. 634func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 635 objectMap := make(map[string]interface{}) 636 if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { 637 objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat 638 } 639 if agic.Name != nil { 640 objectMap["name"] = agic.Name 641 } 642 if agic.Etag != nil { 643 objectMap["etag"] = agic.Etag 644 } 645 if agic.ID != nil { 646 objectMap["id"] = agic.ID 647 } 648 return json.Marshal(objectMap) 649} 650 651// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. 652func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 653 var m map[string]*json.RawMessage 654 err := json.Unmarshal(body, &m) 655 if err != nil { 656 return err 657 } 658 for k, v := range m { 659 switch k { 660 case "properties": 661 if v != nil { 662 var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat 663 err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat) 664 if err != nil { 665 return err 666 } 667 agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat 668 } 669 case "name": 670 if v != nil { 671 var name string 672 err = json.Unmarshal(*v, &name) 673 if err != nil { 674 return err 675 } 676 agic.Name = &name 677 } 678 case "etag": 679 if v != nil { 680 var etag string 681 err = json.Unmarshal(*v, &etag) 682 if err != nil { 683 return err 684 } 685 agic.Etag = &etag 686 } 687 case "id": 688 if v != nil { 689 var ID string 690 err = json.Unmarshal(*v, &ID) 691 if err != nil { 692 return err 693 } 694 agic.ID = &ID 695 } 696 } 697 } 698 699 return nil 700} 701 702// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of application gateway 703type ApplicationGatewayIPConfigurationPropertiesFormat struct { 704 // Subnet - Gets or sets the reference of the subnet resource.A subnet from where application gateway gets its private address 705 Subnet *SubResource `json:"subnet,omitempty"` 706 // ProvisioningState - Gets or sets Provisioning state of the application gateway subnet resource Updating/Deleting/Failed 707 ProvisioningState *string `json:"provisioningState,omitempty"` 708} 709 710// ApplicationGatewayListResult response for ListLoadBalancers Api service call 711type ApplicationGatewayListResult struct { 712 autorest.Response `json:"-"` 713 // Value - Gets a list of ApplicationGateways in a resource group 714 Value *[]ApplicationGateway `json:"value,omitempty"` 715 // NextLink - Gets the URL to get the next set of results. 716 NextLink *string `json:"nextLink,omitempty"` 717} 718 719// ApplicationGatewayListResultIterator provides access to a complete listing of ApplicationGateway values. 720type ApplicationGatewayListResultIterator struct { 721 i int 722 page ApplicationGatewayListResultPage 723} 724 725// NextWithContext advances to the next value. If there was an error making 726// the request the iterator does not advance and the error is returned. 727func (iter *ApplicationGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 728 if tracing.IsEnabled() { 729 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultIterator.NextWithContext") 730 defer func() { 731 sc := -1 732 if iter.Response().Response.Response != nil { 733 sc = iter.Response().Response.Response.StatusCode 734 } 735 tracing.EndSpan(ctx, sc, err) 736 }() 737 } 738 iter.i++ 739 if iter.i < len(iter.page.Values()) { 740 return nil 741 } 742 err = iter.page.NextWithContext(ctx) 743 if err != nil { 744 iter.i-- 745 return err 746 } 747 iter.i = 0 748 return nil 749} 750 751// Next advances to the next value. If there was an error making 752// the request the iterator does not advance and the error is returned. 753// Deprecated: Use NextWithContext() instead. 754func (iter *ApplicationGatewayListResultIterator) Next() error { 755 return iter.NextWithContext(context.Background()) 756} 757 758// NotDone returns true if the enumeration should be started or is not yet complete. 759func (iter ApplicationGatewayListResultIterator) NotDone() bool { 760 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 761} 762 763// Response returns the raw server response from the last page request. 764func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult { 765 return iter.page.Response() 766} 767 768// Value returns the current value or a zero-initialized value if the 769// iterator has advanced beyond the end of the collection. 770func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway { 771 if !iter.page.NotDone() { 772 return ApplicationGateway{} 773 } 774 return iter.page.Values()[iter.i] 775} 776 777// Creates a new instance of the ApplicationGatewayListResultIterator type. 778func NewApplicationGatewayListResultIterator(page ApplicationGatewayListResultPage) ApplicationGatewayListResultIterator { 779 return ApplicationGatewayListResultIterator{page: page} 780} 781 782// IsEmpty returns true if the ListResult contains no values. 783func (aglr ApplicationGatewayListResult) IsEmpty() bool { 784 return aglr.Value == nil || len(*aglr.Value) == 0 785} 786 787// hasNextLink returns true if the NextLink is not empty. 788func (aglr ApplicationGatewayListResult) hasNextLink() bool { 789 return aglr.NextLink != nil && len(*aglr.NextLink) != 0 790} 791 792// applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. 793// It returns nil if no more results exist. 794func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 795 if !aglr.hasNextLink() { 796 return nil, nil 797 } 798 return autorest.Prepare((&http.Request{}).WithContext(ctx), 799 autorest.AsJSON(), 800 autorest.AsGet(), 801 autorest.WithBaseURL(to.String(aglr.NextLink))) 802} 803 804// ApplicationGatewayListResultPage contains a page of ApplicationGateway values. 805type ApplicationGatewayListResultPage struct { 806 fn func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error) 807 aglr ApplicationGatewayListResult 808} 809 810// NextWithContext advances to the next page of values. If there was an error making 811// the request the page does not advance and the error is returned. 812func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 813 if tracing.IsEnabled() { 814 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultPage.NextWithContext") 815 defer func() { 816 sc := -1 817 if page.Response().Response.Response != nil { 818 sc = page.Response().Response.Response.StatusCode 819 } 820 tracing.EndSpan(ctx, sc, err) 821 }() 822 } 823 for { 824 next, err := page.fn(ctx, page.aglr) 825 if err != nil { 826 return err 827 } 828 page.aglr = next 829 if !next.hasNextLink() || !next.IsEmpty() { 830 break 831 } 832 } 833 return nil 834} 835 836// Next advances to the next page of values. If there was an error making 837// the request the page does not advance and the error is returned. 838// Deprecated: Use NextWithContext() instead. 839func (page *ApplicationGatewayListResultPage) Next() error { 840 return page.NextWithContext(context.Background()) 841} 842 843// NotDone returns true if the page enumeration should be started or is not yet complete. 844func (page ApplicationGatewayListResultPage) NotDone() bool { 845 return !page.aglr.IsEmpty() 846} 847 848// Response returns the raw server response from the last page request. 849func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult { 850 return page.aglr 851} 852 853// Values returns the slice of values for the current page or nil if there are no values. 854func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { 855 if page.aglr.IsEmpty() { 856 return nil 857 } 858 return *page.aglr.Value 859} 860 861// Creates a new instance of the ApplicationGatewayListResultPage type. 862func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage { 863 return ApplicationGatewayListResultPage{ 864 fn: getNextPage, 865 aglr: cur, 866 } 867} 868 869// ApplicationGatewayPathRule path rule of URL path map of application gateway 870type ApplicationGatewayPathRule struct { 871 *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` 872 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 873 Name *string `json:"name,omitempty"` 874 // Etag - A unique read-only string that changes whenever the resource is updated 875 Etag *string `json:"etag,omitempty"` 876 // ID - Resource Id 877 ID *string `json:"id,omitempty"` 878} 879 880// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule. 881func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { 882 objectMap := make(map[string]interface{}) 883 if agpr.ApplicationGatewayPathRulePropertiesFormat != nil { 884 objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat 885 } 886 if agpr.Name != nil { 887 objectMap["name"] = agpr.Name 888 } 889 if agpr.Etag != nil { 890 objectMap["etag"] = agpr.Etag 891 } 892 if agpr.ID != nil { 893 objectMap["id"] = agpr.ID 894 } 895 return json.Marshal(objectMap) 896} 897 898// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. 899func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error { 900 var m map[string]*json.RawMessage 901 err := json.Unmarshal(body, &m) 902 if err != nil { 903 return err 904 } 905 for k, v := range m { 906 switch k { 907 case "properties": 908 if v != nil { 909 var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat 910 err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat) 911 if err != nil { 912 return err 913 } 914 agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat 915 } 916 case "name": 917 if v != nil { 918 var name string 919 err = json.Unmarshal(*v, &name) 920 if err != nil { 921 return err 922 } 923 agpr.Name = &name 924 } 925 case "etag": 926 if v != nil { 927 var etag string 928 err = json.Unmarshal(*v, &etag) 929 if err != nil { 930 return err 931 } 932 agpr.Etag = &etag 933 } 934 case "id": 935 if v != nil { 936 var ID string 937 err = json.Unmarshal(*v, &ID) 938 if err != nil { 939 return err 940 } 941 agpr.ID = &ID 942 } 943 } 944 } 945 946 return nil 947} 948 949// ApplicationGatewayPathRulePropertiesFormat properties of probe of application gateway 950type ApplicationGatewayPathRulePropertiesFormat struct { 951 // Paths - Gets or sets the path rules of URL path map 952 Paths *[]string `json:"paths,omitempty"` 953 // BackendAddressPool - Gets or sets backend address pool resource of URL path map 954 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 955 // BackendHTTPSettings - Gets or sets backend http settings resource of URL path map 956 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 957 // ProvisioningState - Gets or sets path rule of URL path map resource Updating/Deleting/Failed 958 ProvisioningState *string `json:"provisioningState,omitempty"` 959} 960 961// ApplicationGatewayProbe probe of application gateway 962type ApplicationGatewayProbe struct { 963 *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` 964 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 965 Name *string `json:"name,omitempty"` 966 // Etag - A unique read-only string that changes whenever the resource is updated 967 Etag *string `json:"etag,omitempty"` 968 // ID - Resource Id 969 ID *string `json:"id,omitempty"` 970} 971 972// MarshalJSON is the custom marshaler for ApplicationGatewayProbe. 973func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { 974 objectMap := make(map[string]interface{}) 975 if agp.ApplicationGatewayProbePropertiesFormat != nil { 976 objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat 977 } 978 if agp.Name != nil { 979 objectMap["name"] = agp.Name 980 } 981 if agp.Etag != nil { 982 objectMap["etag"] = agp.Etag 983 } 984 if agp.ID != nil { 985 objectMap["id"] = agp.ID 986 } 987 return json.Marshal(objectMap) 988} 989 990// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. 991func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error { 992 var m map[string]*json.RawMessage 993 err := json.Unmarshal(body, &m) 994 if err != nil { 995 return err 996 } 997 for k, v := range m { 998 switch k { 999 case "properties": 1000 if v != nil { 1001 var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat 1002 err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat) 1003 if err != nil { 1004 return err 1005 } 1006 agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat 1007 } 1008 case "name": 1009 if v != nil { 1010 var name string 1011 err = json.Unmarshal(*v, &name) 1012 if err != nil { 1013 return err 1014 } 1015 agp.Name = &name 1016 } 1017 case "etag": 1018 if v != nil { 1019 var etag string 1020 err = json.Unmarshal(*v, &etag) 1021 if err != nil { 1022 return err 1023 } 1024 agp.Etag = &etag 1025 } 1026 case "id": 1027 if v != nil { 1028 var ID string 1029 err = json.Unmarshal(*v, &ID) 1030 if err != nil { 1031 return err 1032 } 1033 agp.ID = &ID 1034 } 1035 } 1036 } 1037 1038 return nil 1039} 1040 1041// ApplicationGatewayProbePropertiesFormat properties of probe of application gateway 1042type ApplicationGatewayProbePropertiesFormat struct { 1043 // Protocol - Gets or sets the protocol. Possible values include: 'HTTP', 'HTTPS' 1044 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 1045 // Host - Gets or sets the host to send probe to 1046 Host *string `json:"host,omitempty"` 1047 // Path - Gets or sets the relative path of probe 1048 Path *string `json:"path,omitempty"` 1049 // Interval - Gets or sets probing interval in seconds 1050 Interval *int32 `json:"interval,omitempty"` 1051 // Timeout - Gets or sets probing timeout in seconds 1052 Timeout *int32 `json:"timeout,omitempty"` 1053 // UnhealthyThreshold - Gets or sets probing unhealthy threshold 1054 UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` 1055 // ProvisioningState - Gets or sets Provisioning state of the backend http settings resource Updating/Deleting/Failed 1056 ProvisioningState *string `json:"provisioningState,omitempty"` 1057} 1058 1059// ApplicationGatewayPropertiesFormat properties of Application Gateway 1060type ApplicationGatewayPropertiesFormat struct { 1061 // Sku - Gets or sets sku of application gateway resource 1062 Sku *ApplicationGatewaySku `json:"sku,omitempty"` 1063 // OperationalState - READ-ONLY; Gets operational state of application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' 1064 OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` 1065 // GatewayIPConfigurations - Gets or sets subnets of application gateway resource 1066 GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` 1067 // SslCertificates - Gets or sets ssl certificates of application gateway resource 1068 SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` 1069 // FrontendIPConfigurations - Gets or sets frontend IP addresses of application gateway resource 1070 FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 1071 // FrontendPorts - Gets or sets frontend ports of application gateway resource 1072 FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` 1073 // Probes - Gets or sets probes of application gateway resource 1074 Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` 1075 // BackendAddressPools - Gets or sets backend address pool of application gateway resource 1076 BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` 1077 // BackendHTTPSettingsCollection - Gets or sets backend http settings of application gateway resource 1078 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` 1079 // HTTPListeners - Gets or sets HTTP listeners of application gateway resource 1080 HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` 1081 // URLPathMaps - Gets or sets URL path map of application gateway resource 1082 URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` 1083 // RequestRoutingRules - Gets or sets request routing rules of application gateway resource 1084 RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` 1085 // ResourceGUID - Gets or sets resource GUID property of the ApplicationGateway resource 1086 ResourceGUID *string `json:"resourceGuid,omitempty"` 1087 // ProvisioningState - Gets or sets Provisioning state of the ApplicationGateway resource Updating/Deleting/Failed 1088 ProvisioningState *string `json:"provisioningState,omitempty"` 1089} 1090 1091// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. 1092func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { 1093 objectMap := make(map[string]interface{}) 1094 if agpf.Sku != nil { 1095 objectMap["sku"] = agpf.Sku 1096 } 1097 if agpf.GatewayIPConfigurations != nil { 1098 objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations 1099 } 1100 if agpf.SslCertificates != nil { 1101 objectMap["sslCertificates"] = agpf.SslCertificates 1102 } 1103 if agpf.FrontendIPConfigurations != nil { 1104 objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations 1105 } 1106 if agpf.FrontendPorts != nil { 1107 objectMap["frontendPorts"] = agpf.FrontendPorts 1108 } 1109 if agpf.Probes != nil { 1110 objectMap["probes"] = agpf.Probes 1111 } 1112 if agpf.BackendAddressPools != nil { 1113 objectMap["backendAddressPools"] = agpf.BackendAddressPools 1114 } 1115 if agpf.BackendHTTPSettingsCollection != nil { 1116 objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection 1117 } 1118 if agpf.HTTPListeners != nil { 1119 objectMap["httpListeners"] = agpf.HTTPListeners 1120 } 1121 if agpf.URLPathMaps != nil { 1122 objectMap["urlPathMaps"] = agpf.URLPathMaps 1123 } 1124 if agpf.RequestRoutingRules != nil { 1125 objectMap["requestRoutingRules"] = agpf.RequestRoutingRules 1126 } 1127 if agpf.ResourceGUID != nil { 1128 objectMap["resourceGuid"] = agpf.ResourceGUID 1129 } 1130 if agpf.ProvisioningState != nil { 1131 objectMap["provisioningState"] = agpf.ProvisioningState 1132 } 1133 return json.Marshal(objectMap) 1134} 1135 1136// ApplicationGatewayRequestRoutingRule request routing rule of application gateway 1137type ApplicationGatewayRequestRoutingRule struct { 1138 *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` 1139 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 1140 Name *string `json:"name,omitempty"` 1141 // Etag - A unique read-only string that changes whenever the resource is updated 1142 Etag *string `json:"etag,omitempty"` 1143 // ID - Resource Id 1144 ID *string `json:"id,omitempty"` 1145} 1146 1147// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule. 1148func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { 1149 objectMap := make(map[string]interface{}) 1150 if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil { 1151 objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat 1152 } 1153 if agrrr.Name != nil { 1154 objectMap["name"] = agrrr.Name 1155 } 1156 if agrrr.Etag != nil { 1157 objectMap["etag"] = agrrr.Etag 1158 } 1159 if agrrr.ID != nil { 1160 objectMap["id"] = agrrr.ID 1161 } 1162 return json.Marshal(objectMap) 1163} 1164 1165// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. 1166func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error { 1167 var m map[string]*json.RawMessage 1168 err := json.Unmarshal(body, &m) 1169 if err != nil { 1170 return err 1171 } 1172 for k, v := range m { 1173 switch k { 1174 case "properties": 1175 if v != nil { 1176 var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat 1177 err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat) 1178 if err != nil { 1179 return err 1180 } 1181 agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat 1182 } 1183 case "name": 1184 if v != nil { 1185 var name string 1186 err = json.Unmarshal(*v, &name) 1187 if err != nil { 1188 return err 1189 } 1190 agrrr.Name = &name 1191 } 1192 case "etag": 1193 if v != nil { 1194 var etag string 1195 err = json.Unmarshal(*v, &etag) 1196 if err != nil { 1197 return err 1198 } 1199 agrrr.Etag = &etag 1200 } 1201 case "id": 1202 if v != nil { 1203 var ID string 1204 err = json.Unmarshal(*v, &ID) 1205 if err != nil { 1206 return err 1207 } 1208 agrrr.ID = &ID 1209 } 1210 } 1211 } 1212 1213 return nil 1214} 1215 1216// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of Request routing rule of application 1217// gateway 1218type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { 1219 // RuleType - Gets or sets the rule type. Possible values include: 'Basic', 'PathBasedRouting' 1220 RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` 1221 // BackendAddressPool - Gets or sets backend address pool resource of application gateway 1222 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 1223 // BackendHTTPSettings - Gets or sets frontend port resource of application gateway 1224 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 1225 // HTTPListener - Gets or sets http listener resource of application gateway 1226 HTTPListener *SubResource `json:"httpListener,omitempty"` 1227 // URLPathMap - Gets or sets url path map resource of application gateway 1228 URLPathMap *SubResource `json:"urlPathMap,omitempty"` 1229 // ProvisioningState - Gets or sets Provisioning state of the request routing rule resource Updating/Deleting/Failed 1230 ProvisioningState *string `json:"provisioningState,omitempty"` 1231} 1232 1233// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1234// long-running operation. 1235type ApplicationGatewaysCreateOrUpdateFuture struct { 1236 azure.FutureAPI 1237 // Result returns the result of the asynchronous operation. 1238 // If the operation has not completed it will return an error. 1239 Result func(ApplicationGatewaysClient) (ApplicationGateway, error) 1240} 1241 1242// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1243func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1244 var azFuture azure.Future 1245 if err := json.Unmarshal(body, &azFuture); err != nil { 1246 return err 1247 } 1248 future.FutureAPI = &azFuture 1249 future.Result = future.result 1250 return nil 1251} 1252 1253// result is the default implementation for ApplicationGatewaysCreateOrUpdateFuture.Result. 1254func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { 1255 var done bool 1256 done, err = future.DoneWithContext(context.Background(), client) 1257 if err != nil { 1258 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1259 return 1260 } 1261 if !done { 1262 ag.Response.Response = future.Response() 1263 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") 1264 return 1265 } 1266 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1267 if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent { 1268 ag, err = client.CreateOrUpdateResponder(ag.Response.Response) 1269 if err != nil { 1270 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", ag.Response.Response, "Failure responding to request") 1271 } 1272 } 1273 return 1274} 1275 1276// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 1277// long-running operation. 1278type ApplicationGatewaysDeleteFuture struct { 1279 azure.FutureAPI 1280 // Result returns the result of the asynchronous operation. 1281 // If the operation has not completed it will return an error. 1282 Result func(ApplicationGatewaysClient) (autorest.Response, error) 1283} 1284 1285// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1286func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 1287 var azFuture azure.Future 1288 if err := json.Unmarshal(body, &azFuture); err != nil { 1289 return err 1290 } 1291 future.FutureAPI = &azFuture 1292 future.Result = future.result 1293 return nil 1294} 1295 1296// result is the default implementation for ApplicationGatewaysDeleteFuture.Result. 1297func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 1298 var done bool 1299 done, err = future.DoneWithContext(context.Background(), client) 1300 if err != nil { 1301 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 1302 return 1303 } 1304 if !done { 1305 ar.Response = future.Response() 1306 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") 1307 return 1308 } 1309 ar.Response = future.Response() 1310 return 1311} 1312 1313// ApplicationGatewaySku SKU of application gateway 1314type ApplicationGatewaySku struct { 1315 // Name - Gets or sets name of application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge' 1316 Name ApplicationGatewaySkuName `json:"name,omitempty"` 1317 // Tier - Gets or sets tier of application gateway. Possible values include: 'Standard' 1318 Tier ApplicationGatewayTier `json:"tier,omitempty"` 1319 // Capacity - Gets or sets capacity (instance count) of application gateway 1320 Capacity *int32 `json:"capacity,omitempty"` 1321} 1322 1323// ApplicationGatewaySslCertificate SSL certificates of application gateway 1324type ApplicationGatewaySslCertificate struct { 1325 *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` 1326 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 1327 Name *string `json:"name,omitempty"` 1328 // Etag - A unique read-only string that changes whenever the resource is updated 1329 Etag *string `json:"etag,omitempty"` 1330 // ID - Resource Id 1331 ID *string `json:"id,omitempty"` 1332} 1333 1334// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate. 1335func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) { 1336 objectMap := make(map[string]interface{}) 1337 if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil { 1338 objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat 1339 } 1340 if agsc.Name != nil { 1341 objectMap["name"] = agsc.Name 1342 } 1343 if agsc.Etag != nil { 1344 objectMap["etag"] = agsc.Etag 1345 } 1346 if agsc.ID != nil { 1347 objectMap["id"] = agsc.ID 1348 } 1349 return json.Marshal(objectMap) 1350} 1351 1352// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. 1353func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { 1354 var m map[string]*json.RawMessage 1355 err := json.Unmarshal(body, &m) 1356 if err != nil { 1357 return err 1358 } 1359 for k, v := range m { 1360 switch k { 1361 case "properties": 1362 if v != nil { 1363 var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat 1364 err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat) 1365 if err != nil { 1366 return err 1367 } 1368 agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat 1369 } 1370 case "name": 1371 if v != nil { 1372 var name string 1373 err = json.Unmarshal(*v, &name) 1374 if err != nil { 1375 return err 1376 } 1377 agsc.Name = &name 1378 } 1379 case "etag": 1380 if v != nil { 1381 var etag string 1382 err = json.Unmarshal(*v, &etag) 1383 if err != nil { 1384 return err 1385 } 1386 agsc.Etag = &etag 1387 } 1388 case "id": 1389 if v != nil { 1390 var ID string 1391 err = json.Unmarshal(*v, &ID) 1392 if err != nil { 1393 return err 1394 } 1395 agsc.ID = &ID 1396 } 1397 } 1398 } 1399 1400 return nil 1401} 1402 1403// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of application gateway 1404type ApplicationGatewaySslCertificatePropertiesFormat struct { 1405 // Data - Gets or sets the certificate data 1406 Data *string `json:"data,omitempty"` 1407 // Password - Gets or sets the certificate password 1408 Password *string `json:"password,omitempty"` 1409 // PublicCertData - Gets or sets the certificate public data 1410 PublicCertData *string `json:"publicCertData,omitempty"` 1411 // ProvisioningState - Gets or sets Provisioning state of the ssl certificate resource Updating/Deleting/Failed 1412 ProvisioningState *string `json:"provisioningState,omitempty"` 1413} 1414 1415// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a 1416// long-running operation. 1417type ApplicationGatewaysStartFuture struct { 1418 azure.FutureAPI 1419 // Result returns the result of the asynchronous operation. 1420 // If the operation has not completed it will return an error. 1421 Result func(ApplicationGatewaysClient) (autorest.Response, error) 1422} 1423 1424// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1425func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error { 1426 var azFuture azure.Future 1427 if err := json.Unmarshal(body, &azFuture); err != nil { 1428 return err 1429 } 1430 future.FutureAPI = &azFuture 1431 future.Result = future.result 1432 return nil 1433} 1434 1435// result is the default implementation for ApplicationGatewaysStartFuture.Result. 1436func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 1437 var done bool 1438 done, err = future.DoneWithContext(context.Background(), client) 1439 if err != nil { 1440 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure") 1441 return 1442 } 1443 if !done { 1444 ar.Response = future.Response() 1445 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") 1446 return 1447 } 1448 ar.Response = future.Response() 1449 return 1450} 1451 1452// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running 1453// operation. 1454type ApplicationGatewaysStopFuture struct { 1455 azure.FutureAPI 1456 // Result returns the result of the asynchronous operation. 1457 // If the operation has not completed it will return an error. 1458 Result func(ApplicationGatewaysClient) (autorest.Response, error) 1459} 1460 1461// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1462func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error { 1463 var azFuture azure.Future 1464 if err := json.Unmarshal(body, &azFuture); err != nil { 1465 return err 1466 } 1467 future.FutureAPI = &azFuture 1468 future.Result = future.result 1469 return nil 1470} 1471 1472// result is the default implementation for ApplicationGatewaysStopFuture.Result. 1473func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 1474 var done bool 1475 done, err = future.DoneWithContext(context.Background(), client) 1476 if err != nil { 1477 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure") 1478 return 1479 } 1480 if !done { 1481 ar.Response = future.Response() 1482 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") 1483 return 1484 } 1485 ar.Response = future.Response() 1486 return 1487} 1488 1489// ApplicationGatewayURLPathMap urlPathMap of application gateway 1490type ApplicationGatewayURLPathMap struct { 1491 *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` 1492 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 1493 Name *string `json:"name,omitempty"` 1494 // Etag - A unique read-only string that changes whenever the resource is updated 1495 Etag *string `json:"etag,omitempty"` 1496 // ID - Resource Id 1497 ID *string `json:"id,omitempty"` 1498} 1499 1500// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap. 1501func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { 1502 objectMap := make(map[string]interface{}) 1503 if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil { 1504 objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat 1505 } 1506 if agupm.Name != nil { 1507 objectMap["name"] = agupm.Name 1508 } 1509 if agupm.Etag != nil { 1510 objectMap["etag"] = agupm.Etag 1511 } 1512 if agupm.ID != nil { 1513 objectMap["id"] = agupm.ID 1514 } 1515 return json.Marshal(objectMap) 1516} 1517 1518// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. 1519func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error { 1520 var m map[string]*json.RawMessage 1521 err := json.Unmarshal(body, &m) 1522 if err != nil { 1523 return err 1524 } 1525 for k, v := range m { 1526 switch k { 1527 case "properties": 1528 if v != nil { 1529 var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat 1530 err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat) 1531 if err != nil { 1532 return err 1533 } 1534 agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat 1535 } 1536 case "name": 1537 if v != nil { 1538 var name string 1539 err = json.Unmarshal(*v, &name) 1540 if err != nil { 1541 return err 1542 } 1543 agupm.Name = &name 1544 } 1545 case "etag": 1546 if v != nil { 1547 var etag string 1548 err = json.Unmarshal(*v, &etag) 1549 if err != nil { 1550 return err 1551 } 1552 agupm.Etag = &etag 1553 } 1554 case "id": 1555 if v != nil { 1556 var ID string 1557 err = json.Unmarshal(*v, &ID) 1558 if err != nil { 1559 return err 1560 } 1561 agupm.ID = &ID 1562 } 1563 } 1564 } 1565 1566 return nil 1567} 1568 1569// ApplicationGatewayURLPathMapPropertiesFormat properties of probe of application gateway 1570type ApplicationGatewayURLPathMapPropertiesFormat struct { 1571 // DefaultBackendAddressPool - Gets or sets default backend address pool resource of URL path map 1572 DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` 1573 // DefaultBackendHTTPSettings - Gets or sets default backend http settings resource of URL path map 1574 DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` 1575 // PathRules - Gets or sets path rule of URL path map resource 1576 PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` 1577 // ProvisioningState - Gets or sets Provisioning state of the backend http settings resource Updating/Deleting/Failed 1578 ProvisioningState *string `json:"provisioningState,omitempty"` 1579} 1580 1581// AuthorizationListResult response for ListAuthorizations Api service callRetrieves all authorizations 1582// that belongs to an ExpressRouteCircuit 1583type AuthorizationListResult struct { 1584 autorest.Response `json:"-"` 1585 // Value - Gets the authorizations in an ExpressRoute Circuit 1586 Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` 1587 // NextLink - Gets the URL to get the next set of results. 1588 NextLink *string `json:"nextLink,omitempty"` 1589} 1590 1591// AuthorizationListResultIterator provides access to a complete listing of 1592// ExpressRouteCircuitAuthorization values. 1593type AuthorizationListResultIterator struct { 1594 i int 1595 page AuthorizationListResultPage 1596} 1597 1598// NextWithContext advances to the next value. If there was an error making 1599// the request the iterator does not advance and the error is returned. 1600func (iter *AuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) { 1601 if tracing.IsEnabled() { 1602 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultIterator.NextWithContext") 1603 defer func() { 1604 sc := -1 1605 if iter.Response().Response.Response != nil { 1606 sc = iter.Response().Response.Response.StatusCode 1607 } 1608 tracing.EndSpan(ctx, sc, err) 1609 }() 1610 } 1611 iter.i++ 1612 if iter.i < len(iter.page.Values()) { 1613 return nil 1614 } 1615 err = iter.page.NextWithContext(ctx) 1616 if err != nil { 1617 iter.i-- 1618 return err 1619 } 1620 iter.i = 0 1621 return nil 1622} 1623 1624// Next advances to the next value. If there was an error making 1625// the request the iterator does not advance and the error is returned. 1626// Deprecated: Use NextWithContext() instead. 1627func (iter *AuthorizationListResultIterator) Next() error { 1628 return iter.NextWithContext(context.Background()) 1629} 1630 1631// NotDone returns true if the enumeration should be started or is not yet complete. 1632func (iter AuthorizationListResultIterator) NotDone() bool { 1633 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1634} 1635 1636// Response returns the raw server response from the last page request. 1637func (iter AuthorizationListResultIterator) Response() AuthorizationListResult { 1638 return iter.page.Response() 1639} 1640 1641// Value returns the current value or a zero-initialized value if the 1642// iterator has advanced beyond the end of the collection. 1643func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization { 1644 if !iter.page.NotDone() { 1645 return ExpressRouteCircuitAuthorization{} 1646 } 1647 return iter.page.Values()[iter.i] 1648} 1649 1650// Creates a new instance of the AuthorizationListResultIterator type. 1651func NewAuthorizationListResultIterator(page AuthorizationListResultPage) AuthorizationListResultIterator { 1652 return AuthorizationListResultIterator{page: page} 1653} 1654 1655// IsEmpty returns true if the ListResult contains no values. 1656func (alr AuthorizationListResult) IsEmpty() bool { 1657 return alr.Value == nil || len(*alr.Value) == 0 1658} 1659 1660// hasNextLink returns true if the NextLink is not empty. 1661func (alr AuthorizationListResult) hasNextLink() bool { 1662 return alr.NextLink != nil && len(*alr.NextLink) != 0 1663} 1664 1665// authorizationListResultPreparer prepares a request to retrieve the next set of results. 1666// It returns nil if no more results exist. 1667func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) { 1668 if !alr.hasNextLink() { 1669 return nil, nil 1670 } 1671 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1672 autorest.AsJSON(), 1673 autorest.AsGet(), 1674 autorest.WithBaseURL(to.String(alr.NextLink))) 1675} 1676 1677// AuthorizationListResultPage contains a page of ExpressRouteCircuitAuthorization values. 1678type AuthorizationListResultPage struct { 1679 fn func(context.Context, AuthorizationListResult) (AuthorizationListResult, error) 1680 alr AuthorizationListResult 1681} 1682 1683// NextWithContext advances to the next page of values. If there was an error making 1684// the request the page does not advance and the error is returned. 1685func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) { 1686 if tracing.IsEnabled() { 1687 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultPage.NextWithContext") 1688 defer func() { 1689 sc := -1 1690 if page.Response().Response.Response != nil { 1691 sc = page.Response().Response.Response.StatusCode 1692 } 1693 tracing.EndSpan(ctx, sc, err) 1694 }() 1695 } 1696 for { 1697 next, err := page.fn(ctx, page.alr) 1698 if err != nil { 1699 return err 1700 } 1701 page.alr = next 1702 if !next.hasNextLink() || !next.IsEmpty() { 1703 break 1704 } 1705 } 1706 return nil 1707} 1708 1709// Next advances to the next page of values. If there was an error making 1710// the request the page does not advance and the error is returned. 1711// Deprecated: Use NextWithContext() instead. 1712func (page *AuthorizationListResultPage) Next() error { 1713 return page.NextWithContext(context.Background()) 1714} 1715 1716// NotDone returns true if the page enumeration should be started or is not yet complete. 1717func (page AuthorizationListResultPage) NotDone() bool { 1718 return !page.alr.IsEmpty() 1719} 1720 1721// Response returns the raw server response from the last page request. 1722func (page AuthorizationListResultPage) Response() AuthorizationListResult { 1723 return page.alr 1724} 1725 1726// Values returns the slice of values for the current page or nil if there are no values. 1727func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization { 1728 if page.alr.IsEmpty() { 1729 return nil 1730 } 1731 return *page.alr.Value 1732} 1733 1734// Creates a new instance of the AuthorizationListResultPage type. 1735func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage { 1736 return AuthorizationListResultPage{ 1737 fn: getNextPage, 1738 alr: cur, 1739 } 1740} 1741 1742// AuthorizationPropertiesFormat ... 1743type AuthorizationPropertiesFormat struct { 1744 // AuthorizationKey - Gets or sets the authorization key 1745 AuthorizationKey *string `json:"authorizationKey,omitempty"` 1746 // AuthorizationUseStatus - Gets or sets AuthorizationUseStatus. Possible values include: 'Available', 'InUse' 1747 AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` 1748 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 1749 ProvisioningState *string `json:"provisioningState,omitempty"` 1750} 1751 1752// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, 1753// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct 1754// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous 1755// operation succeeded, the response body includes the HTTP status code for the successful request. If the 1756// asynchronous operation failed, the response body includes the HTTP status code for the failed request 1757// and error information regarding the failure. 1758type AzureAsyncOperationResult struct { 1759 // Status - Status of the AzureAsyncOperation. Possible values include: 'InProgress', 'Succeeded', 'Failed' 1760 Status OperationStatus `json:"status,omitempty"` 1761 Error *Error `json:"error,omitempty"` 1762} 1763 1764// BackendAddressPool pool of backend IP addresses 1765type BackendAddressPool struct { 1766 *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 1767 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 1768 Name *string `json:"name,omitempty"` 1769 // Etag - A unique read-only string that changes whenever the resource is updated 1770 Etag *string `json:"etag,omitempty"` 1771 // ID - Resource Id 1772 ID *string `json:"id,omitempty"` 1773} 1774 1775// MarshalJSON is the custom marshaler for BackendAddressPool. 1776func (bap BackendAddressPool) MarshalJSON() ([]byte, error) { 1777 objectMap := make(map[string]interface{}) 1778 if bap.BackendAddressPoolPropertiesFormat != nil { 1779 objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat 1780 } 1781 if bap.Name != nil { 1782 objectMap["name"] = bap.Name 1783 } 1784 if bap.Etag != nil { 1785 objectMap["etag"] = bap.Etag 1786 } 1787 if bap.ID != nil { 1788 objectMap["id"] = bap.ID 1789 } 1790 return json.Marshal(objectMap) 1791} 1792 1793// UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. 1794func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { 1795 var m map[string]*json.RawMessage 1796 err := json.Unmarshal(body, &m) 1797 if err != nil { 1798 return err 1799 } 1800 for k, v := range m { 1801 switch k { 1802 case "properties": 1803 if v != nil { 1804 var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat 1805 err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat) 1806 if err != nil { 1807 return err 1808 } 1809 bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat 1810 } 1811 case "name": 1812 if v != nil { 1813 var name string 1814 err = json.Unmarshal(*v, &name) 1815 if err != nil { 1816 return err 1817 } 1818 bap.Name = &name 1819 } 1820 case "etag": 1821 if v != nil { 1822 var etag string 1823 err = json.Unmarshal(*v, &etag) 1824 if err != nil { 1825 return err 1826 } 1827 bap.Etag = &etag 1828 } 1829 case "id": 1830 if v != nil { 1831 var ID string 1832 err = json.Unmarshal(*v, &ID) 1833 if err != nil { 1834 return err 1835 } 1836 bap.ID = &ID 1837 } 1838 } 1839 } 1840 1841 return nil 1842} 1843 1844// BackendAddressPoolPropertiesFormat properties of BackendAddressPool 1845type BackendAddressPoolPropertiesFormat struct { 1846 // BackendIPConfigurations - Gets collection of references to IPs defined in NICs 1847 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 1848 // LoadBalancingRules - Gets Load Balancing rules that use this Backend Address Pool 1849 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 1850 // OutboundNatRule - Gets outbound rules that use this Backend Address Pool 1851 OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"` 1852 // ProvisioningState - Provisioning state of the PublicIP resource Updating/Deleting/Failed 1853 ProvisioningState *string `json:"provisioningState,omitempty"` 1854} 1855 1856// BgpSettings ... 1857type BgpSettings struct { 1858 // Asn - Gets or sets this BGP speaker's ASN 1859 Asn *int64 `json:"asn,omitempty"` 1860 // BgpPeeringAddress - Gets or sets the BGP peering address and BGP identifier of this BGP speaker 1861 BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` 1862 // PeerWeight - Gets or sets the weight added to routes learned from this BGP speaker 1863 PeerWeight *int32 `json:"peerWeight,omitempty"` 1864} 1865 1866// ConnectionResetSharedKey ... 1867type ConnectionResetSharedKey struct { 1868 autorest.Response `json:"-"` 1869 // KeyLength - The virtual network connection reset shared key length 1870 KeyLength *int64 `json:"keyLength,omitempty"` 1871} 1872 1873// ConnectionSharedKey response for GetConnectionSharedKey Api service call 1874type ConnectionSharedKey struct { 1875 autorest.Response `json:"-"` 1876 // Value - The virtual network connection shared key value 1877 Value *string `json:"value,omitempty"` 1878} 1879 1880// ConnectionSharedKeyResult response for CheckConnectionSharedKey Api service call 1881type ConnectionSharedKeyResult struct { 1882 autorest.Response `json:"-"` 1883 // Value - The virtual network connection shared key value 1884 Value *string `json:"value,omitempty"` 1885} 1886 1887// DhcpOptions dHCPOptions contains an array of DNS servers available to VMs deployed in the virtual 1888// networkStandard DHCP option for a subnet overrides VNET DHCP options. 1889type DhcpOptions struct { 1890 // DNSServers - Gets or sets list of DNS servers IP addresses 1891 DNSServers *[]string `json:"dnsServers,omitempty"` 1892} 1893 1894// DNSNameAvailabilityResult response for CheckDnsNameAvailability Api service call 1895type DNSNameAvailabilityResult struct { 1896 autorest.Response `json:"-"` 1897 // Available - Domain availability (True/False) 1898 Available *bool `json:"available,omitempty"` 1899} 1900 1901// Error ... 1902type Error struct { 1903 Code *string `json:"code,omitempty"` 1904 Message *string `json:"message,omitempty"` 1905 Target *string `json:"target,omitempty"` 1906 Details *[]ErrorDetails `json:"details,omitempty"` 1907 InnerError *string `json:"innerError,omitempty"` 1908} 1909 1910// ErrorDetails ... 1911type ErrorDetails struct { 1912 Code *string `json:"code,omitempty"` 1913 Target *string `json:"target,omitempty"` 1914 Message *string `json:"message,omitempty"` 1915} 1916 1917// ExpressRouteCircuit expressRouteCircuit resource 1918type ExpressRouteCircuit struct { 1919 autorest.Response `json:"-"` 1920 // Sku - Gets or sets sku 1921 Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` 1922 *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` 1923 // Etag - Gets a unique read-only string that changes whenever the resource is updated 1924 Etag *string `json:"etag,omitempty"` 1925 // ID - Resource Id 1926 ID *string `json:"id,omitempty"` 1927 // Name - READ-ONLY; Resource name 1928 Name *string `json:"name,omitempty"` 1929 // Type - READ-ONLY; Resource type 1930 Type *string `json:"type,omitempty"` 1931 // Location - Resource location 1932 Location *string `json:"location,omitempty"` 1933 // Tags - Resource tags 1934 Tags map[string]*string `json:"tags"` 1935} 1936 1937// MarshalJSON is the custom marshaler for ExpressRouteCircuit. 1938func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) { 1939 objectMap := make(map[string]interface{}) 1940 if erc.Sku != nil { 1941 objectMap["sku"] = erc.Sku 1942 } 1943 if erc.ExpressRouteCircuitPropertiesFormat != nil { 1944 objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat 1945 } 1946 if erc.Etag != nil { 1947 objectMap["etag"] = erc.Etag 1948 } 1949 if erc.ID != nil { 1950 objectMap["id"] = erc.ID 1951 } 1952 if erc.Location != nil { 1953 objectMap["location"] = erc.Location 1954 } 1955 if erc.Tags != nil { 1956 objectMap["tags"] = erc.Tags 1957 } 1958 return json.Marshal(objectMap) 1959} 1960 1961// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. 1962func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error { 1963 var m map[string]*json.RawMessage 1964 err := json.Unmarshal(body, &m) 1965 if err != nil { 1966 return err 1967 } 1968 for k, v := range m { 1969 switch k { 1970 case "sku": 1971 if v != nil { 1972 var sku ExpressRouteCircuitSku 1973 err = json.Unmarshal(*v, &sku) 1974 if err != nil { 1975 return err 1976 } 1977 erc.Sku = &sku 1978 } 1979 case "properties": 1980 if v != nil { 1981 var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat 1982 err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat) 1983 if err != nil { 1984 return err 1985 } 1986 erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat 1987 } 1988 case "etag": 1989 if v != nil { 1990 var etag string 1991 err = json.Unmarshal(*v, &etag) 1992 if err != nil { 1993 return err 1994 } 1995 erc.Etag = &etag 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 erc.ID = &ID 2005 } 2006 case "name": 2007 if v != nil { 2008 var name string 2009 err = json.Unmarshal(*v, &name) 2010 if err != nil { 2011 return err 2012 } 2013 erc.Name = &name 2014 } 2015 case "type": 2016 if v != nil { 2017 var typeVar string 2018 err = json.Unmarshal(*v, &typeVar) 2019 if err != nil { 2020 return err 2021 } 2022 erc.Type = &typeVar 2023 } 2024 case "location": 2025 if v != nil { 2026 var location string 2027 err = json.Unmarshal(*v, &location) 2028 if err != nil { 2029 return err 2030 } 2031 erc.Location = &location 2032 } 2033 case "tags": 2034 if v != nil { 2035 var tags map[string]*string 2036 err = json.Unmarshal(*v, &tags) 2037 if err != nil { 2038 return err 2039 } 2040 erc.Tags = tags 2041 } 2042 } 2043 } 2044 2045 return nil 2046} 2047 2048// ExpressRouteCircuitArpTable the arp table associated with the ExpressRouteCircuit 2049type ExpressRouteCircuitArpTable struct { 2050 // Age - Age. 2051 Age *int32 `json:"age,omitempty"` 2052 // Interface - Interface. 2053 Interface *string `json:"interface,omitempty"` 2054 // IPAddress - Gets ipAddress. 2055 IPAddress *string `json:"ipAddress,omitempty"` 2056 // MacAddress - Gets macAddress. 2057 MacAddress *string `json:"macAddress,omitempty"` 2058} 2059 2060// ExpressRouteCircuitAuthorization authorization in a ExpressRouteCircuit resource 2061type ExpressRouteCircuitAuthorization struct { 2062 autorest.Response `json:"-"` 2063 *AuthorizationPropertiesFormat `json:"properties,omitempty"` 2064 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 2065 Name *string `json:"name,omitempty"` 2066 // Etag - A unique read-only string that changes whenever the resource is updated 2067 Etag *string `json:"etag,omitempty"` 2068 // ID - Resource Id 2069 ID *string `json:"id,omitempty"` 2070} 2071 2072// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization. 2073func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { 2074 objectMap := make(map[string]interface{}) 2075 if erca.AuthorizationPropertiesFormat != nil { 2076 objectMap["properties"] = erca.AuthorizationPropertiesFormat 2077 } 2078 if erca.Name != nil { 2079 objectMap["name"] = erca.Name 2080 } 2081 if erca.Etag != nil { 2082 objectMap["etag"] = erca.Etag 2083 } 2084 if erca.ID != nil { 2085 objectMap["id"] = erca.ID 2086 } 2087 return json.Marshal(objectMap) 2088} 2089 2090// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. 2091func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { 2092 var m map[string]*json.RawMessage 2093 err := json.Unmarshal(body, &m) 2094 if err != nil { 2095 return err 2096 } 2097 for k, v := range m { 2098 switch k { 2099 case "properties": 2100 if v != nil { 2101 var authorizationPropertiesFormat AuthorizationPropertiesFormat 2102 err = json.Unmarshal(*v, &authorizationPropertiesFormat) 2103 if err != nil { 2104 return err 2105 } 2106 erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat 2107 } 2108 case "name": 2109 if v != nil { 2110 var name string 2111 err = json.Unmarshal(*v, &name) 2112 if err != nil { 2113 return err 2114 } 2115 erca.Name = &name 2116 } 2117 case "etag": 2118 if v != nil { 2119 var etag string 2120 err = json.Unmarshal(*v, &etag) 2121 if err != nil { 2122 return err 2123 } 2124 erca.Etag = &etag 2125 } 2126 case "id": 2127 if v != nil { 2128 var ID string 2129 err = json.Unmarshal(*v, &ID) 2130 if err != nil { 2131 return err 2132 } 2133 erca.ID = &ID 2134 } 2135 } 2136 } 2137 2138 return nil 2139} 2140 2141// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 2142// results of a long-running operation. 2143type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { 2144 azure.FutureAPI 2145 // Result returns the result of the asynchronous operation. 2146 // If the operation has not completed it will return an error. 2147 Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error) 2148} 2149 2150// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2151func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2152 var azFuture azure.Future 2153 if err := json.Unmarshal(body, &azFuture); err != nil { 2154 return err 2155 } 2156 future.FutureAPI = &azFuture 2157 future.Result = future.result 2158 return nil 2159} 2160 2161// result is the default implementation for ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.Result. 2162func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { 2163 var done bool 2164 done, err = future.DoneWithContext(context.Background(), client) 2165 if err != nil { 2166 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2167 return 2168 } 2169 if !done { 2170 erca.Response.Response = future.Response() 2171 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") 2172 return 2173 } 2174 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2175 if erca.Response.Response, err = future.GetResult(sender); err == nil && erca.Response.Response.StatusCode != http.StatusNoContent { 2176 erca, err = client.CreateOrUpdateResponder(erca.Response.Response) 2177 if err != nil { 2178 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", erca.Response.Response, "Failure responding to request") 2179 } 2180 } 2181 return 2182} 2183 2184// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results 2185// of a long-running operation. 2186type ExpressRouteCircuitAuthorizationsDeleteFuture struct { 2187 azure.FutureAPI 2188 // Result returns the result of the asynchronous operation. 2189 // If the operation has not completed it will return an error. 2190 Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error) 2191} 2192 2193// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2194func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { 2195 var azFuture azure.Future 2196 if err := json.Unmarshal(body, &azFuture); err != nil { 2197 return err 2198 } 2199 future.FutureAPI = &azFuture 2200 future.Result = future.result 2201 return nil 2202} 2203 2204// result is the default implementation for ExpressRouteCircuitAuthorizationsDeleteFuture.Result. 2205func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { 2206 var done bool 2207 done, err = future.DoneWithContext(context.Background(), client) 2208 if err != nil { 2209 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") 2210 return 2211 } 2212 if !done { 2213 ar.Response = future.Response() 2214 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") 2215 return 2216 } 2217 ar.Response = future.Response() 2218 return 2219} 2220 2221// ExpressRouteCircuitListResult response for ListExpressRouteCircuit Api service call 2222type ExpressRouteCircuitListResult struct { 2223 autorest.Response `json:"-"` 2224 // Value - Gets a list of ExpressRouteCircuits in a resource group 2225 Value *[]ExpressRouteCircuit `json:"value,omitempty"` 2226 // NextLink - Gets the URL to get the next set of results. 2227 NextLink *string `json:"nextLink,omitempty"` 2228} 2229 2230// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit 2231// values. 2232type ExpressRouteCircuitListResultIterator struct { 2233 i int 2234 page ExpressRouteCircuitListResultPage 2235} 2236 2237// NextWithContext advances to the next value. If there was an error making 2238// the request the iterator does not advance and the error is returned. 2239func (iter *ExpressRouteCircuitListResultIterator) NextWithContext(ctx context.Context) (err error) { 2240 if tracing.IsEnabled() { 2241 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultIterator.NextWithContext") 2242 defer func() { 2243 sc := -1 2244 if iter.Response().Response.Response != nil { 2245 sc = iter.Response().Response.Response.StatusCode 2246 } 2247 tracing.EndSpan(ctx, sc, err) 2248 }() 2249 } 2250 iter.i++ 2251 if iter.i < len(iter.page.Values()) { 2252 return nil 2253 } 2254 err = iter.page.NextWithContext(ctx) 2255 if err != nil { 2256 iter.i-- 2257 return err 2258 } 2259 iter.i = 0 2260 return nil 2261} 2262 2263// Next advances to the next value. If there was an error making 2264// the request the iterator does not advance and the error is returned. 2265// Deprecated: Use NextWithContext() instead. 2266func (iter *ExpressRouteCircuitListResultIterator) Next() error { 2267 return iter.NextWithContext(context.Background()) 2268} 2269 2270// NotDone returns true if the enumeration should be started or is not yet complete. 2271func (iter ExpressRouteCircuitListResultIterator) NotDone() bool { 2272 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2273} 2274 2275// Response returns the raw server response from the last page request. 2276func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult { 2277 return iter.page.Response() 2278} 2279 2280// Value returns the current value or a zero-initialized value if the 2281// iterator has advanced beyond the end of the collection. 2282func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit { 2283 if !iter.page.NotDone() { 2284 return ExpressRouteCircuit{} 2285 } 2286 return iter.page.Values()[iter.i] 2287} 2288 2289// Creates a new instance of the ExpressRouteCircuitListResultIterator type. 2290func NewExpressRouteCircuitListResultIterator(page ExpressRouteCircuitListResultPage) ExpressRouteCircuitListResultIterator { 2291 return ExpressRouteCircuitListResultIterator{page: page} 2292} 2293 2294// IsEmpty returns true if the ListResult contains no values. 2295func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { 2296 return erclr.Value == nil || len(*erclr.Value) == 0 2297} 2298 2299// hasNextLink returns true if the NextLink is not empty. 2300func (erclr ExpressRouteCircuitListResult) hasNextLink() bool { 2301 return erclr.NextLink != nil && len(*erclr.NextLink) != 0 2302} 2303 2304// expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. 2305// It returns nil if no more results exist. 2306func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) { 2307 if !erclr.hasNextLink() { 2308 return nil, nil 2309 } 2310 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2311 autorest.AsJSON(), 2312 autorest.AsGet(), 2313 autorest.WithBaseURL(to.String(erclr.NextLink))) 2314} 2315 2316// ExpressRouteCircuitListResultPage contains a page of ExpressRouteCircuit values. 2317type ExpressRouteCircuitListResultPage struct { 2318 fn func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error) 2319 erclr ExpressRouteCircuitListResult 2320} 2321 2322// NextWithContext advances to the next page of values. If there was an error making 2323// the request the page does not advance and the error is returned. 2324func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Context) (err error) { 2325 if tracing.IsEnabled() { 2326 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultPage.NextWithContext") 2327 defer func() { 2328 sc := -1 2329 if page.Response().Response.Response != nil { 2330 sc = page.Response().Response.Response.StatusCode 2331 } 2332 tracing.EndSpan(ctx, sc, err) 2333 }() 2334 } 2335 for { 2336 next, err := page.fn(ctx, page.erclr) 2337 if err != nil { 2338 return err 2339 } 2340 page.erclr = next 2341 if !next.hasNextLink() || !next.IsEmpty() { 2342 break 2343 } 2344 } 2345 return nil 2346} 2347 2348// Next advances to the next page of values. If there was an error making 2349// the request the page does not advance and the error is returned. 2350// Deprecated: Use NextWithContext() instead. 2351func (page *ExpressRouteCircuitListResultPage) Next() error { 2352 return page.NextWithContext(context.Background()) 2353} 2354 2355// NotDone returns true if the page enumeration should be started or is not yet complete. 2356func (page ExpressRouteCircuitListResultPage) NotDone() bool { 2357 return !page.erclr.IsEmpty() 2358} 2359 2360// Response returns the raw server response from the last page request. 2361func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult { 2362 return page.erclr 2363} 2364 2365// Values returns the slice of values for the current page or nil if there are no values. 2366func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { 2367 if page.erclr.IsEmpty() { 2368 return nil 2369 } 2370 return *page.erclr.Value 2371} 2372 2373// Creates a new instance of the ExpressRouteCircuitListResultPage type. 2374func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage { 2375 return ExpressRouteCircuitListResultPage{ 2376 fn: getNextPage, 2377 erclr: cur, 2378 } 2379} 2380 2381// ExpressRouteCircuitPeering peering in a ExpressRouteCircuit resource 2382type ExpressRouteCircuitPeering struct { 2383 autorest.Response `json:"-"` 2384 *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` 2385 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 2386 Name *string `json:"name,omitempty"` 2387 // Etag - A unique read-only string that changes whenever the resource is updated 2388 Etag *string `json:"etag,omitempty"` 2389 // ID - Resource Id 2390 ID *string `json:"id,omitempty"` 2391} 2392 2393// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering. 2394func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { 2395 objectMap := make(map[string]interface{}) 2396 if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil { 2397 objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat 2398 } 2399 if ercp.Name != nil { 2400 objectMap["name"] = ercp.Name 2401 } 2402 if ercp.Etag != nil { 2403 objectMap["etag"] = ercp.Etag 2404 } 2405 if ercp.ID != nil { 2406 objectMap["id"] = ercp.ID 2407 } 2408 return json.Marshal(objectMap) 2409} 2410 2411// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. 2412func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error { 2413 var m map[string]*json.RawMessage 2414 err := json.Unmarshal(body, &m) 2415 if err != nil { 2416 return err 2417 } 2418 for k, v := range m { 2419 switch k { 2420 case "properties": 2421 if v != nil { 2422 var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat 2423 err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat) 2424 if err != nil { 2425 return err 2426 } 2427 ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat 2428 } 2429 case "name": 2430 if v != nil { 2431 var name string 2432 err = json.Unmarshal(*v, &name) 2433 if err != nil { 2434 return err 2435 } 2436 ercp.Name = &name 2437 } 2438 case "etag": 2439 if v != nil { 2440 var etag string 2441 err = json.Unmarshal(*v, &etag) 2442 if err != nil { 2443 return err 2444 } 2445 ercp.Etag = &etag 2446 } 2447 case "id": 2448 if v != nil { 2449 var ID string 2450 err = json.Unmarshal(*v, &ID) 2451 if err != nil { 2452 return err 2453 } 2454 ercp.ID = &ID 2455 } 2456 } 2457 } 2458 2459 return nil 2460} 2461 2462// ExpressRouteCircuitPeeringConfig specifies the peering config 2463type ExpressRouteCircuitPeeringConfig struct { 2464 // AdvertisedPublicPrefixes - Gets or sets the reference of AdvertisedPublicPrefixes 2465 AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` 2466 // AdvertisedPublicPrefixesState - Gets or sets AdvertisedPublicPrefixState of the Peering resource. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' 2467 AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` 2468 // CustomerASN - Gets or Sets CustomerAsn of the peering. 2469 CustomerASN *int32 `json:"customerASN,omitempty"` 2470 // RoutingRegistryName - Gets or Sets RoutingRegistryName of the config. 2471 RoutingRegistryName *string `json:"routingRegistryName,omitempty"` 2472} 2473 2474// ExpressRouteCircuitPeeringListResult response for ListPeering Api service callRetrieves all Peerings 2475// that belongs to an ExpressRouteCircuit 2476type ExpressRouteCircuitPeeringListResult struct { 2477 autorest.Response `json:"-"` 2478 // Value - Gets the peerings in an express route circuit 2479 Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` 2480 // NextLink - Gets the URL to get the next set of results. 2481 NextLink *string `json:"nextLink,omitempty"` 2482} 2483 2484// ExpressRouteCircuitPeeringListResultIterator provides access to a complete listing of 2485// ExpressRouteCircuitPeering values. 2486type ExpressRouteCircuitPeeringListResultIterator struct { 2487 i int 2488 page ExpressRouteCircuitPeeringListResultPage 2489} 2490 2491// NextWithContext advances to the next value. If there was an error making 2492// the request the iterator does not advance and the error is returned. 2493func (iter *ExpressRouteCircuitPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { 2494 if tracing.IsEnabled() { 2495 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultIterator.NextWithContext") 2496 defer func() { 2497 sc := -1 2498 if iter.Response().Response.Response != nil { 2499 sc = iter.Response().Response.Response.StatusCode 2500 } 2501 tracing.EndSpan(ctx, sc, err) 2502 }() 2503 } 2504 iter.i++ 2505 if iter.i < len(iter.page.Values()) { 2506 return nil 2507 } 2508 err = iter.page.NextWithContext(ctx) 2509 if err != nil { 2510 iter.i-- 2511 return err 2512 } 2513 iter.i = 0 2514 return nil 2515} 2516 2517// Next advances to the next value. If there was an error making 2518// the request the iterator does not advance and the error is returned. 2519// Deprecated: Use NextWithContext() instead. 2520func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error { 2521 return iter.NextWithContext(context.Background()) 2522} 2523 2524// NotDone returns true if the enumeration should be started or is not yet complete. 2525func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool { 2526 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2527} 2528 2529// Response returns the raw server response from the last page request. 2530func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult { 2531 return iter.page.Response() 2532} 2533 2534// Value returns the current value or a zero-initialized value if the 2535// iterator has advanced beyond the end of the collection. 2536func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering { 2537 if !iter.page.NotDone() { 2538 return ExpressRouteCircuitPeering{} 2539 } 2540 return iter.page.Values()[iter.i] 2541} 2542 2543// Creates a new instance of the ExpressRouteCircuitPeeringListResultIterator type. 2544func NewExpressRouteCircuitPeeringListResultIterator(page ExpressRouteCircuitPeeringListResultPage) ExpressRouteCircuitPeeringListResultIterator { 2545 return ExpressRouteCircuitPeeringListResultIterator{page: page} 2546} 2547 2548// IsEmpty returns true if the ListResult contains no values. 2549func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { 2550 return ercplr.Value == nil || len(*ercplr.Value) == 0 2551} 2552 2553// hasNextLink returns true if the NextLink is not empty. 2554func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool { 2555 return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0 2556} 2557 2558// expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. 2559// It returns nil if no more results exist. 2560func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { 2561 if !ercplr.hasNextLink() { 2562 return nil, nil 2563 } 2564 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2565 autorest.AsJSON(), 2566 autorest.AsGet(), 2567 autorest.WithBaseURL(to.String(ercplr.NextLink))) 2568} 2569 2570// ExpressRouteCircuitPeeringListResultPage contains a page of ExpressRouteCircuitPeering values. 2571type ExpressRouteCircuitPeeringListResultPage struct { 2572 fn func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error) 2573 ercplr ExpressRouteCircuitPeeringListResult 2574} 2575 2576// NextWithContext advances to the next page of values. If there was an error making 2577// the request the page does not advance and the error is returned. 2578func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { 2579 if tracing.IsEnabled() { 2580 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultPage.NextWithContext") 2581 defer func() { 2582 sc := -1 2583 if page.Response().Response.Response != nil { 2584 sc = page.Response().Response.Response.StatusCode 2585 } 2586 tracing.EndSpan(ctx, sc, err) 2587 }() 2588 } 2589 for { 2590 next, err := page.fn(ctx, page.ercplr) 2591 if err != nil { 2592 return err 2593 } 2594 page.ercplr = next 2595 if !next.hasNextLink() || !next.IsEmpty() { 2596 break 2597 } 2598 } 2599 return nil 2600} 2601 2602// Next advances to the next page of values. If there was an error making 2603// the request the page does not advance and the error is returned. 2604// Deprecated: Use NextWithContext() instead. 2605func (page *ExpressRouteCircuitPeeringListResultPage) Next() error { 2606 return page.NextWithContext(context.Background()) 2607} 2608 2609// NotDone returns true if the page enumeration should be started or is not yet complete. 2610func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool { 2611 return !page.ercplr.IsEmpty() 2612} 2613 2614// Response returns the raw server response from the last page request. 2615func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult { 2616 return page.ercplr 2617} 2618 2619// Values returns the slice of values for the current page or nil if there are no values. 2620func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering { 2621 if page.ercplr.IsEmpty() { 2622 return nil 2623 } 2624 return *page.ercplr.Value 2625} 2626 2627// Creates a new instance of the ExpressRouteCircuitPeeringListResultPage type. 2628func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage { 2629 return ExpressRouteCircuitPeeringListResultPage{ 2630 fn: getNextPage, 2631 ercplr: cur, 2632 } 2633} 2634 2635// ExpressRouteCircuitPeeringPropertiesFormat ... 2636type ExpressRouteCircuitPeeringPropertiesFormat struct { 2637 // PeeringType - Gets or sets PeeringType. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' 2638 PeeringType ExpressRouteCircuitPeeringType `json:"peeringType,omitempty"` 2639 // State - Gets or sets state of Peering. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled' 2640 State ExpressRouteCircuitPeeringState `json:"state,omitempty"` 2641 // AzureASN - Gets or sets the azure ASN 2642 AzureASN *int32 `json:"azureASN,omitempty"` 2643 // PeerASN - Gets or sets the peer ASN 2644 PeerASN *int32 `json:"peerASN,omitempty"` 2645 // PrimaryPeerAddressPrefix - Gets or sets the primary address prefix 2646 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` 2647 // SecondaryPeerAddressPrefix - Gets or sets the secondary address prefix 2648 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` 2649 // PrimaryAzurePort - Gets or sets the primary port 2650 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` 2651 // SecondaryAzurePort - Gets or sets the secondary port 2652 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` 2653 // SharedKey - Gets or sets the shared key 2654 SharedKey *string `json:"sharedKey,omitempty"` 2655 // VlanID - Gets or sets the vlan id 2656 VlanID *int32 `json:"vlanId,omitempty"` 2657 // MicrosoftPeeringConfig - Gets or sets the Microsoft peering config 2658 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` 2659 // Stats - Gets or peering stats 2660 Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` 2661 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 2662 ProvisioningState *string `json:"provisioningState,omitempty"` 2663} 2664 2665// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 2666// of a long-running operation. 2667type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { 2668 azure.FutureAPI 2669 // Result returns the result of the asynchronous operation. 2670 // If the operation has not completed it will return an error. 2671 Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error) 2672} 2673 2674// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2675func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2676 var azFuture azure.Future 2677 if err := json.Unmarshal(body, &azFuture); err != nil { 2678 return err 2679 } 2680 future.FutureAPI = &azFuture 2681 future.Result = future.result 2682 return nil 2683} 2684 2685// result is the default implementation for ExpressRouteCircuitPeeringsCreateOrUpdateFuture.Result. 2686func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { 2687 var done bool 2688 done, err = future.DoneWithContext(context.Background(), client) 2689 if err != nil { 2690 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2691 return 2692 } 2693 if !done { 2694 ercp.Response.Response = future.Response() 2695 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") 2696 return 2697 } 2698 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2699 if ercp.Response.Response, err = future.GetResult(sender); err == nil && ercp.Response.Response.StatusCode != http.StatusNoContent { 2700 ercp, err = client.CreateOrUpdateResponder(ercp.Response.Response) 2701 if err != nil { 2702 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", ercp.Response.Response, "Failure responding to request") 2703 } 2704 } 2705 return 2706} 2707 2708// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a 2709// long-running operation. 2710type ExpressRouteCircuitPeeringsDeleteFuture struct { 2711 azure.FutureAPI 2712 // Result returns the result of the asynchronous operation. 2713 // If the operation has not completed it will return an error. 2714 Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error) 2715} 2716 2717// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2718func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { 2719 var azFuture azure.Future 2720 if err := json.Unmarshal(body, &azFuture); err != nil { 2721 return err 2722 } 2723 future.FutureAPI = &azFuture 2724 future.Result = future.result 2725 return nil 2726} 2727 2728// result is the default implementation for ExpressRouteCircuitPeeringsDeleteFuture.Result. 2729func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { 2730 var done bool 2731 done, err = future.DoneWithContext(context.Background(), client) 2732 if err != nil { 2733 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 2734 return 2735 } 2736 if !done { 2737 ar.Response = future.Response() 2738 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") 2739 return 2740 } 2741 ar.Response = future.Response() 2742 return 2743} 2744 2745// ExpressRouteCircuitPropertiesFormat properties of ExpressRouteCircuit 2746type ExpressRouteCircuitPropertiesFormat struct { 2747 // AllowClassicOperations - allow classic operations 2748 AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` 2749 // CircuitProvisioningState - Gets or sets CircuitProvisioningState state of the resource 2750 CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` 2751 // ServiceProviderProvisioningState - Gets or sets ServiceProviderProvisioningState state of the resource. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' 2752 ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` 2753 // Authorizations - Gets or sets list of authorizations 2754 Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` 2755 // Peerings - Gets or sets list of peerings 2756 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` 2757 // ServiceKey - Gets or sets ServiceKey 2758 ServiceKey *string `json:"serviceKey,omitempty"` 2759 // ServiceProviderNotes - Gets or sets ServiceProviderNotes 2760 ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` 2761 // ServiceProviderProperties - Gets or sets ServiceProviderProperties 2762 ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` 2763 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 2764 ProvisioningState *string `json:"provisioningState,omitempty"` 2765} 2766 2767// ExpressRouteCircuitRoutesTable the routes table associated with the ExpressRouteCircuit 2768type ExpressRouteCircuitRoutesTable struct { 2769 // NetworkProperty - network. 2770 NetworkProperty *string `json:"network,omitempty"` 2771 // NextHop - nextHop 2772 NextHop *string `json:"nextHop,omitempty"` 2773 // LocPrf - locPrf. 2774 LocPrf *string `json:"locPrf,omitempty"` 2775 // Weight - weight. 2776 Weight *int32 `json:"weight,omitempty"` 2777 // Path - path . 2778 Path *string `json:"path,omitempty"` 2779} 2780 2781// ExpressRouteCircuitRoutesTableSummary the routes table associated with the ExpressRouteCircuit 2782type ExpressRouteCircuitRoutesTableSummary struct { 2783 // Neighbor - Neighbor. 2784 Neighbor *string `json:"neighbor,omitempty"` 2785 // V - BGP version number spoken to the neighbor. 2786 V *int32 `json:"v,omitempty"` 2787 // As - Autonomous system number. 2788 As *int32 `json:"as,omitempty"` 2789 // 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. 2790 UpDown *string `json:"upDown,omitempty"` 2791 // StatePfxRcd - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. 2792 StatePfxRcd *string `json:"statePfxRcd,omitempty"` 2793} 2794 2795// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route 2796// Circuits Api 2797type ExpressRouteCircuitsArpTableListResult struct { 2798 autorest.Response `json:"-"` 2799 // Value - Gets List of ArpTable 2800 Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` 2801 // NextLink - Gets the URL to get the next set of results. 2802 NextLink *string `json:"nextLink,omitempty"` 2803} 2804 2805// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2806// long-running operation. 2807type ExpressRouteCircuitsCreateOrUpdateFuture struct { 2808 azure.FutureAPI 2809 // Result returns the result of the asynchronous operation. 2810 // If the operation has not completed it will return an error. 2811 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) 2812} 2813 2814// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2815func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2816 var azFuture azure.Future 2817 if err := json.Unmarshal(body, &azFuture); err != nil { 2818 return err 2819 } 2820 future.FutureAPI = &azFuture 2821 future.Result = future.result 2822 return nil 2823} 2824 2825// result is the default implementation for ExpressRouteCircuitsCreateOrUpdateFuture.Result. 2826func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { 2827 var done bool 2828 done, err = future.DoneWithContext(context.Background(), client) 2829 if err != nil { 2830 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2831 return 2832 } 2833 if !done { 2834 erc.Response.Response = future.Response() 2835 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") 2836 return 2837 } 2838 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2839 if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { 2840 erc, err = client.CreateOrUpdateResponder(erc.Response.Response) 2841 if err != nil { 2842 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request") 2843 } 2844 } 2845 return 2846} 2847 2848// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a 2849// long-running operation. 2850type ExpressRouteCircuitsDeleteFuture struct { 2851 azure.FutureAPI 2852 // Result returns the result of the asynchronous operation. 2853 // If the operation has not completed it will return an error. 2854 Result func(ExpressRouteCircuitsClient) (autorest.Response, error) 2855} 2856 2857// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2858func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error { 2859 var azFuture azure.Future 2860 if err := json.Unmarshal(body, &azFuture); err != nil { 2861 return err 2862 } 2863 future.FutureAPI = &azFuture 2864 future.Result = future.result 2865 return nil 2866} 2867 2868// result is the default implementation for ExpressRouteCircuitsDeleteFuture.Result. 2869func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { 2870 var done bool 2871 done, err = future.DoneWithContext(context.Background(), client) 2872 if err != nil { 2873 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure") 2874 return 2875 } 2876 if !done { 2877 ar.Response = future.Response() 2878 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") 2879 return 2880 } 2881 ar.Response = future.Response() 2882 return 2883} 2884 2885// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an 2886// ExpressRouteCircuit 2887type ExpressRouteCircuitServiceProviderProperties struct { 2888 // ServiceProviderName - Gets or sets serviceProviderName. 2889 ServiceProviderName *string `json:"serviceProviderName,omitempty"` 2890 // PeeringLocation - Gets or sets peering location. 2891 PeeringLocation *string `json:"peeringLocation,omitempty"` 2892 // BandwidthInMbps - Gets or sets BandwidthInMbps. 2893 BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` 2894} 2895 2896// ExpressRouteCircuitSku contains sku in an ExpressRouteCircuit 2897type ExpressRouteCircuitSku struct { 2898 // Name - Gets or sets name of the sku. 2899 Name *string `json:"name,omitempty"` 2900 // Tier - Gets or sets tier of the sku. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium' 2901 Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` 2902 // Family - Gets or sets family of the sku. Possible values include: 'UnlimitedData', 'MeteredData' 2903 Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` 2904} 2905 2906// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a 2907// long-running operation. 2908type ExpressRouteCircuitsListArpTableFuture struct { 2909 azure.FutureAPI 2910 // Result returns the result of the asynchronous operation. 2911 // If the operation has not completed it will return an error. 2912 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error) 2913} 2914 2915// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2916func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error { 2917 var azFuture azure.Future 2918 if err := json.Unmarshal(body, &azFuture); err != nil { 2919 return err 2920 } 2921 future.FutureAPI = &azFuture 2922 future.Result = future.result 2923 return nil 2924} 2925 2926// result is the default implementation for ExpressRouteCircuitsListArpTableFuture.Result. 2927func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { 2928 var done bool 2929 done, err = future.DoneWithContext(context.Background(), client) 2930 if err != nil { 2931 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure") 2932 return 2933 } 2934 if !done { 2935 ercatlr.Response.Response = future.Response() 2936 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") 2937 return 2938 } 2939 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2940 if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { 2941 ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) 2942 if err != nil { 2943 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") 2944 } 2945 } 2946 return 2947} 2948 2949// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a 2950// long-running operation. 2951type ExpressRouteCircuitsListRoutesTableFuture struct { 2952 azure.FutureAPI 2953 // Result returns the result of the asynchronous operation. 2954 // If the operation has not completed it will return an error. 2955 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error) 2956} 2957 2958// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2959func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error { 2960 var azFuture azure.Future 2961 if err := json.Unmarshal(body, &azFuture); err != nil { 2962 return err 2963 } 2964 future.FutureAPI = &azFuture 2965 future.Result = future.result 2966 return nil 2967} 2968 2969// result is the default implementation for ExpressRouteCircuitsListRoutesTableFuture.Result. 2970func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { 2971 var done bool 2972 done, err = future.DoneWithContext(context.Background(), client) 2973 if err != nil { 2974 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure") 2975 return 2976 } 2977 if !done { 2978 ercrtlr.Response.Response = future.Response() 2979 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") 2980 return 2981 } 2982 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2983 if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { 2984 ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) 2985 if err != nil { 2986 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") 2987 } 2988 } 2989 return 2990} 2991 2992// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the 2993// results of a long-running operation. 2994type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { 2995 azure.FutureAPI 2996 // Result returns the result of the asynchronous operation. 2997 // If the operation has not completed it will return an error. 2998 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error) 2999} 3000 3001// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3002func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { 3003 var azFuture azure.Future 3004 if err := json.Unmarshal(body, &azFuture); err != nil { 3005 return err 3006 } 3007 future.FutureAPI = &azFuture 3008 future.Result = future.result 3009 return nil 3010} 3011 3012// result is the default implementation for ExpressRouteCircuitsListRoutesTableSummaryFuture.Result. 3013func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { 3014 var done bool 3015 done, err = future.DoneWithContext(context.Background(), client) 3016 if err != nil { 3017 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") 3018 return 3019 } 3020 if !done { 3021 ercrtslr.Response.Response = future.Response() 3022 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") 3023 return 3024 } 3025 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3026 if ercrtslr.Response.Response, err = future.GetResult(sender); err == nil && ercrtslr.Response.Response.StatusCode != http.StatusNoContent { 3027 ercrtslr, err = client.ListRoutesTableSummaryResponder(ercrtslr.Response.Response) 3028 if err != nil { 3029 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", ercrtslr.Response.Response, "Failure responding to request") 3030 } 3031 } 3032 return 3033} 3034 3035// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route 3036// Circuits Api 3037type ExpressRouteCircuitsRoutesTableListResult struct { 3038 autorest.Response `json:"-"` 3039 // Value - Gets List of RoutesTable 3040 Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` 3041 // NextLink - Gets the URL to get the next set of results. 3042 NextLink *string `json:"nextLink,omitempty"` 3043} 3044 3045// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the 3046// Express Route Circuits Api 3047type ExpressRouteCircuitsRoutesTableSummaryListResult struct { 3048 autorest.Response `json:"-"` 3049 // Value - Gets List of RoutesTable 3050 Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` 3051 // NextLink - Gets the URL to get the next set of results. 3052 NextLink *string `json:"nextLink,omitempty"` 3053} 3054 3055// ExpressRouteCircuitStats contains Stats associated with the peering 3056type ExpressRouteCircuitStats struct { 3057 autorest.Response `json:"-"` 3058 // PrimarybytesIn - Gets BytesIn of the peering. 3059 PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` 3060 // PrimarybytesOut - Gets BytesOut of the peering. 3061 PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` 3062 // SecondarybytesIn - Gets BytesIn of the peering. 3063 SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` 3064 // SecondarybytesOut - Gets BytesOut of the peering. 3065 SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` 3066} 3067 3068// ExpressRouteServiceProvider expressRouteResourceProvider object 3069type ExpressRouteServiceProvider struct { 3070 *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` 3071 // ID - Resource Id 3072 ID *string `json:"id,omitempty"` 3073 // Name - READ-ONLY; Resource name 3074 Name *string `json:"name,omitempty"` 3075 // Type - READ-ONLY; Resource type 3076 Type *string `json:"type,omitempty"` 3077 // Location - Resource location 3078 Location *string `json:"location,omitempty"` 3079 // Tags - Resource tags 3080 Tags map[string]*string `json:"tags"` 3081} 3082 3083// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider. 3084func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { 3085 objectMap := make(map[string]interface{}) 3086 if ersp.ExpressRouteServiceProviderPropertiesFormat != nil { 3087 objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat 3088 } 3089 if ersp.ID != nil { 3090 objectMap["id"] = ersp.ID 3091 } 3092 if ersp.Location != nil { 3093 objectMap["location"] = ersp.Location 3094 } 3095 if ersp.Tags != nil { 3096 objectMap["tags"] = ersp.Tags 3097 } 3098 return json.Marshal(objectMap) 3099} 3100 3101// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. 3102func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error { 3103 var m map[string]*json.RawMessage 3104 err := json.Unmarshal(body, &m) 3105 if err != nil { 3106 return err 3107 } 3108 for k, v := range m { 3109 switch k { 3110 case "properties": 3111 if v != nil { 3112 var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat 3113 err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat) 3114 if err != nil { 3115 return err 3116 } 3117 ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat 3118 } 3119 case "id": 3120 if v != nil { 3121 var ID string 3122 err = json.Unmarshal(*v, &ID) 3123 if err != nil { 3124 return err 3125 } 3126 ersp.ID = &ID 3127 } 3128 case "name": 3129 if v != nil { 3130 var name string 3131 err = json.Unmarshal(*v, &name) 3132 if err != nil { 3133 return err 3134 } 3135 ersp.Name = &name 3136 } 3137 case "type": 3138 if v != nil { 3139 var typeVar string 3140 err = json.Unmarshal(*v, &typeVar) 3141 if err != nil { 3142 return err 3143 } 3144 ersp.Type = &typeVar 3145 } 3146 case "location": 3147 if v != nil { 3148 var location string 3149 err = json.Unmarshal(*v, &location) 3150 if err != nil { 3151 return err 3152 } 3153 ersp.Location = &location 3154 } 3155 case "tags": 3156 if v != nil { 3157 var tags map[string]*string 3158 err = json.Unmarshal(*v, &tags) 3159 if err != nil { 3160 return err 3161 } 3162 ersp.Tags = tags 3163 } 3164 } 3165 } 3166 3167 return nil 3168} 3169 3170// ExpressRouteServiceProviderBandwidthsOffered contains Bandwidths offered in ExpressRouteServiceProviders 3171type ExpressRouteServiceProviderBandwidthsOffered struct { 3172 // OfferName - Gets the OfferName 3173 OfferName *string `json:"offerName,omitempty"` 3174 // ValueInMbps - Gets the ValueInMbps. 3175 ValueInMbps *int32 `json:"valueInMbps,omitempty"` 3176} 3177 3178// ExpressRouteServiceProviderListResult response for ListExpressRouteServiceProvider Api service call 3179type ExpressRouteServiceProviderListResult struct { 3180 autorest.Response `json:"-"` 3181 // Value - Gets List of ExpressRouteResourceProvider 3182 Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` 3183 // NextLink - Gets the URL to get the next set of results. 3184 NextLink *string `json:"nextLink,omitempty"` 3185} 3186 3187// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of 3188// ExpressRouteServiceProvider values. 3189type ExpressRouteServiceProviderListResultIterator struct { 3190 i int 3191 page ExpressRouteServiceProviderListResultPage 3192} 3193 3194// NextWithContext advances to the next value. If there was an error making 3195// the request the iterator does not advance and the error is returned. 3196func (iter *ExpressRouteServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { 3197 if tracing.IsEnabled() { 3198 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultIterator.NextWithContext") 3199 defer func() { 3200 sc := -1 3201 if iter.Response().Response.Response != nil { 3202 sc = iter.Response().Response.Response.StatusCode 3203 } 3204 tracing.EndSpan(ctx, sc, err) 3205 }() 3206 } 3207 iter.i++ 3208 if iter.i < len(iter.page.Values()) { 3209 return nil 3210 } 3211 err = iter.page.NextWithContext(ctx) 3212 if err != nil { 3213 iter.i-- 3214 return err 3215 } 3216 iter.i = 0 3217 return nil 3218} 3219 3220// Next advances to the next value. If there was an error making 3221// the request the iterator does not advance and the error is returned. 3222// Deprecated: Use NextWithContext() instead. 3223func (iter *ExpressRouteServiceProviderListResultIterator) Next() error { 3224 return iter.NextWithContext(context.Background()) 3225} 3226 3227// NotDone returns true if the enumeration should be started or is not yet complete. 3228func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool { 3229 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3230} 3231 3232// Response returns the raw server response from the last page request. 3233func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult { 3234 return iter.page.Response() 3235} 3236 3237// Value returns the current value or a zero-initialized value if the 3238// iterator has advanced beyond the end of the collection. 3239func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider { 3240 if !iter.page.NotDone() { 3241 return ExpressRouteServiceProvider{} 3242 } 3243 return iter.page.Values()[iter.i] 3244} 3245 3246// Creates a new instance of the ExpressRouteServiceProviderListResultIterator type. 3247func NewExpressRouteServiceProviderListResultIterator(page ExpressRouteServiceProviderListResultPage) ExpressRouteServiceProviderListResultIterator { 3248 return ExpressRouteServiceProviderListResultIterator{page: page} 3249} 3250 3251// IsEmpty returns true if the ListResult contains no values. 3252func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { 3253 return ersplr.Value == nil || len(*ersplr.Value) == 0 3254} 3255 3256// hasNextLink returns true if the NextLink is not empty. 3257func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool { 3258 return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0 3259} 3260 3261// expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. 3262// It returns nil if no more results exist. 3263func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { 3264 if !ersplr.hasNextLink() { 3265 return nil, nil 3266 } 3267 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3268 autorest.AsJSON(), 3269 autorest.AsGet(), 3270 autorest.WithBaseURL(to.String(ersplr.NextLink))) 3271} 3272 3273// ExpressRouteServiceProviderListResultPage contains a page of ExpressRouteServiceProvider values. 3274type ExpressRouteServiceProviderListResultPage struct { 3275 fn func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error) 3276 ersplr ExpressRouteServiceProviderListResult 3277} 3278 3279// NextWithContext advances to the next page of values. If there was an error making 3280// the request the page does not advance and the error is returned. 3281func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) { 3282 if tracing.IsEnabled() { 3283 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultPage.NextWithContext") 3284 defer func() { 3285 sc := -1 3286 if page.Response().Response.Response != nil { 3287 sc = page.Response().Response.Response.StatusCode 3288 } 3289 tracing.EndSpan(ctx, sc, err) 3290 }() 3291 } 3292 for { 3293 next, err := page.fn(ctx, page.ersplr) 3294 if err != nil { 3295 return err 3296 } 3297 page.ersplr = next 3298 if !next.hasNextLink() || !next.IsEmpty() { 3299 break 3300 } 3301 } 3302 return nil 3303} 3304 3305// Next advances to the next page of values. If there was an error making 3306// the request the page does not advance and the error is returned. 3307// Deprecated: Use NextWithContext() instead. 3308func (page *ExpressRouteServiceProviderListResultPage) Next() error { 3309 return page.NextWithContext(context.Background()) 3310} 3311 3312// NotDone returns true if the page enumeration should be started or is not yet complete. 3313func (page ExpressRouteServiceProviderListResultPage) NotDone() bool { 3314 return !page.ersplr.IsEmpty() 3315} 3316 3317// Response returns the raw server response from the last page request. 3318func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult { 3319 return page.ersplr 3320} 3321 3322// Values returns the slice of values for the current page or nil if there are no values. 3323func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider { 3324 if page.ersplr.IsEmpty() { 3325 return nil 3326 } 3327 return *page.ersplr.Value 3328} 3329 3330// Creates a new instance of the ExpressRouteServiceProviderListResultPage type. 3331func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage { 3332 return ExpressRouteServiceProviderListResultPage{ 3333 fn: getNextPage, 3334 ersplr: cur, 3335 } 3336} 3337 3338// ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider 3339type ExpressRouteServiceProviderPropertiesFormat struct { 3340 // PeeringLocations - Gets or list of peering locations 3341 PeeringLocations *[]string `json:"peeringLocations,omitempty"` 3342 // BandwidthsOffered - Gets or bandwidths offered 3343 BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` 3344 // ProvisioningState - Gets or sets Provisioning state of the resource 3345 ProvisioningState *string `json:"provisioningState,omitempty"` 3346} 3347 3348// FrontendIPConfiguration frontend IP address of the load balancer 3349type FrontendIPConfiguration struct { 3350 *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` 3351 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 3352 Name *string `json:"name,omitempty"` 3353 // Etag - A unique read-only string that changes whenever the resource is updated 3354 Etag *string `json:"etag,omitempty"` 3355 // ID - Resource Id 3356 ID *string `json:"id,omitempty"` 3357} 3358 3359// MarshalJSON is the custom marshaler for FrontendIPConfiguration. 3360func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) { 3361 objectMap := make(map[string]interface{}) 3362 if fic.FrontendIPConfigurationPropertiesFormat != nil { 3363 objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat 3364 } 3365 if fic.Name != nil { 3366 objectMap["name"] = fic.Name 3367 } 3368 if fic.Etag != nil { 3369 objectMap["etag"] = fic.Etag 3370 } 3371 if fic.ID != nil { 3372 objectMap["id"] = fic.ID 3373 } 3374 return json.Marshal(objectMap) 3375} 3376 3377// UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. 3378func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error { 3379 var m map[string]*json.RawMessage 3380 err := json.Unmarshal(body, &m) 3381 if err != nil { 3382 return err 3383 } 3384 for k, v := range m { 3385 switch k { 3386 case "properties": 3387 if v != nil { 3388 var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat 3389 err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat) 3390 if err != nil { 3391 return err 3392 } 3393 fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat 3394 } 3395 case "name": 3396 if v != nil { 3397 var name string 3398 err = json.Unmarshal(*v, &name) 3399 if err != nil { 3400 return err 3401 } 3402 fic.Name = &name 3403 } 3404 case "etag": 3405 if v != nil { 3406 var etag string 3407 err = json.Unmarshal(*v, &etag) 3408 if err != nil { 3409 return err 3410 } 3411 fic.Etag = &etag 3412 } 3413 case "id": 3414 if v != nil { 3415 var ID string 3416 err = json.Unmarshal(*v, &ID) 3417 if err != nil { 3418 return err 3419 } 3420 fic.ID = &ID 3421 } 3422 } 3423 } 3424 3425 return nil 3426} 3427 3428// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer 3429type FrontendIPConfigurationPropertiesFormat struct { 3430 // InboundNatRules - Read only.Inbound rules URIs that use this frontend IP 3431 InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` 3432 // InboundNatPools - Read only.Inbound pools URIs that use this frontend IP 3433 InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` 3434 // OutboundNatRules - Read only.Outbound rules URIs that use this frontend IP 3435 OutboundNatRules *[]SubResource `json:"outboundNatRules,omitempty"` 3436 // LoadBalancingRules - Gets Load Balancing rules URIs that use this frontend IP 3437 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 3438 // PrivateIPAddress - Gets or sets the privateIPAddress of the IP Configuration 3439 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 3440 // PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic). Possible values include: 'Static', 'Dynamic' 3441 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 3442 // Subnet - Gets or sets the reference of the subnet resource 3443 Subnet *Subnet `json:"subnet,omitempty"` 3444 // PublicIPAddress - Gets or sets the reference of the PublicIP resource 3445 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 3446 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 3447 ProvisioningState *string `json:"provisioningState,omitempty"` 3448} 3449 3450// InboundNatPool inbound NAT pool of the loadbalancer 3451type InboundNatPool struct { 3452 *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` 3453 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 3454 Name *string `json:"name,omitempty"` 3455 // Etag - A unique read-only string that changes whenever the resource is updated 3456 Etag *string `json:"etag,omitempty"` 3457 // ID - Resource Id 3458 ID *string `json:"id,omitempty"` 3459} 3460 3461// MarshalJSON is the custom marshaler for InboundNatPool. 3462func (inp InboundNatPool) MarshalJSON() ([]byte, error) { 3463 objectMap := make(map[string]interface{}) 3464 if inp.InboundNatPoolPropertiesFormat != nil { 3465 objectMap["properties"] = inp.InboundNatPoolPropertiesFormat 3466 } 3467 if inp.Name != nil { 3468 objectMap["name"] = inp.Name 3469 } 3470 if inp.Etag != nil { 3471 objectMap["etag"] = inp.Etag 3472 } 3473 if inp.ID != nil { 3474 objectMap["id"] = inp.ID 3475 } 3476 return json.Marshal(objectMap) 3477} 3478 3479// UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. 3480func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { 3481 var m map[string]*json.RawMessage 3482 err := json.Unmarshal(body, &m) 3483 if err != nil { 3484 return err 3485 } 3486 for k, v := range m { 3487 switch k { 3488 case "properties": 3489 if v != nil { 3490 var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat 3491 err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat) 3492 if err != nil { 3493 return err 3494 } 3495 inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat 3496 } 3497 case "name": 3498 if v != nil { 3499 var name string 3500 err = json.Unmarshal(*v, &name) 3501 if err != nil { 3502 return err 3503 } 3504 inp.Name = &name 3505 } 3506 case "etag": 3507 if v != nil { 3508 var etag string 3509 err = json.Unmarshal(*v, &etag) 3510 if err != nil { 3511 return err 3512 } 3513 inp.Etag = &etag 3514 } 3515 case "id": 3516 if v != nil { 3517 var ID string 3518 err = json.Unmarshal(*v, &ID) 3519 if err != nil { 3520 return err 3521 } 3522 inp.ID = &ID 3523 } 3524 } 3525 } 3526 3527 return nil 3528} 3529 3530// InboundNatPoolPropertiesFormat properties of Inbound NAT pool 3531type InboundNatPoolPropertiesFormat struct { 3532 // FrontendIPConfiguration - Gets or sets a reference to frontend IP Addresses 3533 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 3534 // Protocol - Gets or sets the transport protocol for the external endpoint. Possible values are Udp or Tcp. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 3535 Protocol TransportProtocol `json:"protocol,omitempty"` 3536 // FrontendPortRangeStart - Gets or sets the starting port range for the NAT pool. You can specify any port number you choose, but the port numbers specified for each role in the service must be unique. Possible values range between 1 and 65535, inclusive 3537 FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` 3538 // FrontendPortRangeEnd - Gets or sets the ending port range for the NAT pool. You can specify any port number you choose, but the port numbers specified for each role in the service must be unique. Possible values range between 1 and 65535, inclusive 3539 FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` 3540 // BackendPort - Gets or sets a port used for internal connections on the endpoint. The localPort attribute maps the eternal port of the endpoint to an internal port on a role. This is useful in scenarios where a role must communicate to an internal component on a port that is different from the one that is exposed externally. If not specified, the value of localPort is the same as the port attribute. Set the value of localPort to '*' to automatically assign an unallocated port that is discoverable using the runtime API 3541 BackendPort *int32 `json:"backendPort,omitempty"` 3542 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 3543 ProvisioningState *string `json:"provisioningState,omitempty"` 3544} 3545 3546// InboundNatRule inbound NAT rule of the loadbalancer 3547type InboundNatRule struct { 3548 *InboundNatRulePropertiesFormat `json:"properties,omitempty"` 3549 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 3550 Name *string `json:"name,omitempty"` 3551 // Etag - A unique read-only string that changes whenever the resource is updated 3552 Etag *string `json:"etag,omitempty"` 3553 // ID - Resource Id 3554 ID *string `json:"id,omitempty"` 3555} 3556 3557// MarshalJSON is the custom marshaler for InboundNatRule. 3558func (inr InboundNatRule) MarshalJSON() ([]byte, error) { 3559 objectMap := make(map[string]interface{}) 3560 if inr.InboundNatRulePropertiesFormat != nil { 3561 objectMap["properties"] = inr.InboundNatRulePropertiesFormat 3562 } 3563 if inr.Name != nil { 3564 objectMap["name"] = inr.Name 3565 } 3566 if inr.Etag != nil { 3567 objectMap["etag"] = inr.Etag 3568 } 3569 if inr.ID != nil { 3570 objectMap["id"] = inr.ID 3571 } 3572 return json.Marshal(objectMap) 3573} 3574 3575// UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. 3576func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { 3577 var m map[string]*json.RawMessage 3578 err := json.Unmarshal(body, &m) 3579 if err != nil { 3580 return err 3581 } 3582 for k, v := range m { 3583 switch k { 3584 case "properties": 3585 if v != nil { 3586 var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat 3587 err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat) 3588 if err != nil { 3589 return err 3590 } 3591 inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat 3592 } 3593 case "name": 3594 if v != nil { 3595 var name string 3596 err = json.Unmarshal(*v, &name) 3597 if err != nil { 3598 return err 3599 } 3600 inr.Name = &name 3601 } 3602 case "etag": 3603 if v != nil { 3604 var etag string 3605 err = json.Unmarshal(*v, &etag) 3606 if err != nil { 3607 return err 3608 } 3609 inr.Etag = &etag 3610 } 3611 case "id": 3612 if v != nil { 3613 var ID string 3614 err = json.Unmarshal(*v, &ID) 3615 if err != nil { 3616 return err 3617 } 3618 inr.ID = &ID 3619 } 3620 } 3621 } 3622 3623 return nil 3624} 3625 3626// InboundNatRulePropertiesFormat properties of Inbound NAT rule 3627type InboundNatRulePropertiesFormat struct { 3628 // FrontendIPConfiguration - Gets or sets a reference to frontend IP Addresses 3629 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 3630 // BackendIPConfiguration - Gets or sets a reference to a private ip address defined on a NetworkInterface of a VM. Traffic sent to frontendPort of each of the frontendIPConfigurations is forwarded to the backed IP 3631 BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` 3632 // Protocol - Gets or sets the transport protocol for the external endpoint. Possible values are Udp or Tcp. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 3633 Protocol TransportProtocol `json:"protocol,omitempty"` 3634 // FrontendPort - Gets or sets the port for the external endpoint. You can specify any port number you choose, but the port numbers specified for each role in the service must be unique. Possible values range between 1 and 65535, inclusive 3635 FrontendPort *int32 `json:"frontendPort,omitempty"` 3636 // BackendPort - Gets or sets a port used for internal connections on the endpoint. The localPort attribute maps the eternal port of the endpoint to an internal port on a role. This is useful in scenarios where a role must communicate to an internal component on a port that is different from the one that is exposed externally. If not specified, the value of localPort is the same as the port attribute. Set the value of localPort to '*' to automatically assign an unallocated port that is discoverable using the runtime API 3637 BackendPort *int32 `json:"backendPort,omitempty"` 3638 // IdleTimeoutInMinutes - Gets or sets 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 3639 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 3640 // 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 Always ON availability Groups in SQL server. This setting can't be changed after you create the endpoint 3641 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 3642 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 3643 ProvisioningState *string `json:"provisioningState,omitempty"` 3644} 3645 3646// Interface a NetworkInterface in a resource group 3647type Interface struct { 3648 autorest.Response `json:"-"` 3649 *InterfacePropertiesFormat `json:"properties,omitempty"` 3650 // Etag - Gets a unique read-only string that changes whenever the resource is updated 3651 Etag *string `json:"etag,omitempty"` 3652 // ID - Resource Id 3653 ID *string `json:"id,omitempty"` 3654 // Name - READ-ONLY; Resource name 3655 Name *string `json:"name,omitempty"` 3656 // Type - READ-ONLY; Resource type 3657 Type *string `json:"type,omitempty"` 3658 // Location - Resource location 3659 Location *string `json:"location,omitempty"` 3660 // Tags - Resource tags 3661 Tags map[string]*string `json:"tags"` 3662} 3663 3664// MarshalJSON is the custom marshaler for Interface. 3665func (i Interface) MarshalJSON() ([]byte, error) { 3666 objectMap := make(map[string]interface{}) 3667 if i.InterfacePropertiesFormat != nil { 3668 objectMap["properties"] = i.InterfacePropertiesFormat 3669 } 3670 if i.Etag != nil { 3671 objectMap["etag"] = i.Etag 3672 } 3673 if i.ID != nil { 3674 objectMap["id"] = i.ID 3675 } 3676 if i.Location != nil { 3677 objectMap["location"] = i.Location 3678 } 3679 if i.Tags != nil { 3680 objectMap["tags"] = i.Tags 3681 } 3682 return json.Marshal(objectMap) 3683} 3684 3685// UnmarshalJSON is the custom unmarshaler for Interface struct. 3686func (i *Interface) UnmarshalJSON(body []byte) error { 3687 var m map[string]*json.RawMessage 3688 err := json.Unmarshal(body, &m) 3689 if err != nil { 3690 return err 3691 } 3692 for k, v := range m { 3693 switch k { 3694 case "properties": 3695 if v != nil { 3696 var interfacePropertiesFormat InterfacePropertiesFormat 3697 err = json.Unmarshal(*v, &interfacePropertiesFormat) 3698 if err != nil { 3699 return err 3700 } 3701 i.InterfacePropertiesFormat = &interfacePropertiesFormat 3702 } 3703 case "etag": 3704 if v != nil { 3705 var etag string 3706 err = json.Unmarshal(*v, &etag) 3707 if err != nil { 3708 return err 3709 } 3710 i.Etag = &etag 3711 } 3712 case "id": 3713 if v != nil { 3714 var ID string 3715 err = json.Unmarshal(*v, &ID) 3716 if err != nil { 3717 return err 3718 } 3719 i.ID = &ID 3720 } 3721 case "name": 3722 if v != nil { 3723 var name string 3724 err = json.Unmarshal(*v, &name) 3725 if err != nil { 3726 return err 3727 } 3728 i.Name = &name 3729 } 3730 case "type": 3731 if v != nil { 3732 var typeVar string 3733 err = json.Unmarshal(*v, &typeVar) 3734 if err != nil { 3735 return err 3736 } 3737 i.Type = &typeVar 3738 } 3739 case "location": 3740 if v != nil { 3741 var location string 3742 err = json.Unmarshal(*v, &location) 3743 if err != nil { 3744 return err 3745 } 3746 i.Location = &location 3747 } 3748 case "tags": 3749 if v != nil { 3750 var tags map[string]*string 3751 err = json.Unmarshal(*v, &tags) 3752 if err != nil { 3753 return err 3754 } 3755 i.Tags = tags 3756 } 3757 } 3758 } 3759 3760 return nil 3761} 3762 3763// InterfaceDNSSettings dns Settings of a network interface 3764type InterfaceDNSSettings struct { 3765 // DNSServers - Gets or sets list of DNS servers IP addresses 3766 DNSServers *[]string `json:"dnsServers,omitempty"` 3767 // AppliedDNSServers - Gets or sets list of Applied DNS servers IP addresses 3768 AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` 3769 // InternalDNSNameLabel - Gets or sets the Internal DNS name 3770 InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"` 3771 // InternalFqdn - Gets or sets the internal FQDN. 3772 InternalFqdn *string `json:"internalFqdn,omitempty"` 3773 // InternalDomainNameSuffix - Gets or sets internal domain name suffix of the NIC. 3774 InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` 3775} 3776 3777// InterfaceIPConfiguration iPConfiguration in a NetworkInterface 3778type InterfaceIPConfiguration struct { 3779 *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` 3780 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 3781 Name *string `json:"name,omitempty"` 3782 // Etag - A unique read-only string that changes whenever the resource is updated 3783 Etag *string `json:"etag,omitempty"` 3784 // ID - Resource Id 3785 ID *string `json:"id,omitempty"` 3786} 3787 3788// MarshalJSON is the custom marshaler for InterfaceIPConfiguration. 3789func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { 3790 objectMap := make(map[string]interface{}) 3791 if iic.InterfaceIPConfigurationPropertiesFormat != nil { 3792 objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat 3793 } 3794 if iic.Name != nil { 3795 objectMap["name"] = iic.Name 3796 } 3797 if iic.Etag != nil { 3798 objectMap["etag"] = iic.Etag 3799 } 3800 if iic.ID != nil { 3801 objectMap["id"] = iic.ID 3802 } 3803 return json.Marshal(objectMap) 3804} 3805 3806// UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. 3807func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error { 3808 var m map[string]*json.RawMessage 3809 err := json.Unmarshal(body, &m) 3810 if err != nil { 3811 return err 3812 } 3813 for k, v := range m { 3814 switch k { 3815 case "properties": 3816 if v != nil { 3817 var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat 3818 err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat) 3819 if err != nil { 3820 return err 3821 } 3822 iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat 3823 } 3824 case "name": 3825 if v != nil { 3826 var name string 3827 err = json.Unmarshal(*v, &name) 3828 if err != nil { 3829 return err 3830 } 3831 iic.Name = &name 3832 } 3833 case "etag": 3834 if v != nil { 3835 var etag string 3836 err = json.Unmarshal(*v, &etag) 3837 if err != nil { 3838 return err 3839 } 3840 iic.Etag = &etag 3841 } 3842 case "id": 3843 if v != nil { 3844 var ID string 3845 err = json.Unmarshal(*v, &ID) 3846 if err != nil { 3847 return err 3848 } 3849 iic.ID = &ID 3850 } 3851 } 3852 } 3853 3854 return nil 3855} 3856 3857// InterfaceIPConfigurationPropertiesFormat properties of IPConfiguration 3858type InterfaceIPConfigurationPropertiesFormat struct { 3859 // ApplicationGatewayBackendAddressPools - Gets or sets the reference of ApplicationGatewayBackendAddressPool resource 3860 ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` 3861 // LoadBalancerBackendAddressPools - Gets or sets the reference of LoadBalancerBackendAddressPool resource 3862 LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` 3863 // LoadBalancerInboundNatRules - Gets or sets list of references of LoadBalancerInboundNatRules 3864 LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` 3865 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 3866 // PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic). Possible values include: 'Static', 'Dynamic' 3867 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 3868 // PrivateIPAddressVersion - Gets or sets PrivateIP address version (IPv4/IPv6). Possible values include: 'IPv4', 'IPv6' 3869 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 3870 Subnet *Subnet `json:"subnet,omitempty"` 3871 // Primary - Gets whether this is a primary customer address on the NIC 3872 Primary *bool `json:"primary,omitempty"` 3873 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 3874 ProvisioningState *string `json:"provisioningState,omitempty"` 3875} 3876 3877// InterfaceListResult response for ListNetworkInterface Api service call 3878type InterfaceListResult struct { 3879 autorest.Response `json:"-"` 3880 // Value - Gets or sets list of NetworkInterfaces in a resource group 3881 Value *[]Interface `json:"value,omitempty"` 3882 // NextLink - Gets the URL to get the next set of results. 3883 NextLink *string `json:"nextLink,omitempty"` 3884} 3885 3886// InterfaceListResultIterator provides access to a complete listing of Interface values. 3887type InterfaceListResultIterator struct { 3888 i int 3889 page InterfaceListResultPage 3890} 3891 3892// NextWithContext advances to the next value. If there was an error making 3893// the request the iterator does not advance and the error is returned. 3894func (iter *InterfaceListResultIterator) NextWithContext(ctx context.Context) (err error) { 3895 if tracing.IsEnabled() { 3896 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultIterator.NextWithContext") 3897 defer func() { 3898 sc := -1 3899 if iter.Response().Response.Response != nil { 3900 sc = iter.Response().Response.Response.StatusCode 3901 } 3902 tracing.EndSpan(ctx, sc, err) 3903 }() 3904 } 3905 iter.i++ 3906 if iter.i < len(iter.page.Values()) { 3907 return nil 3908 } 3909 err = iter.page.NextWithContext(ctx) 3910 if err != nil { 3911 iter.i-- 3912 return err 3913 } 3914 iter.i = 0 3915 return nil 3916} 3917 3918// Next advances to the next value. If there was an error making 3919// the request the iterator does not advance and the error is returned. 3920// Deprecated: Use NextWithContext() instead. 3921func (iter *InterfaceListResultIterator) Next() error { 3922 return iter.NextWithContext(context.Background()) 3923} 3924 3925// NotDone returns true if the enumeration should be started or is not yet complete. 3926func (iter InterfaceListResultIterator) NotDone() bool { 3927 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3928} 3929 3930// Response returns the raw server response from the last page request. 3931func (iter InterfaceListResultIterator) Response() InterfaceListResult { 3932 return iter.page.Response() 3933} 3934 3935// Value returns the current value or a zero-initialized value if the 3936// iterator has advanced beyond the end of the collection. 3937func (iter InterfaceListResultIterator) Value() Interface { 3938 if !iter.page.NotDone() { 3939 return Interface{} 3940 } 3941 return iter.page.Values()[iter.i] 3942} 3943 3944// Creates a new instance of the InterfaceListResultIterator type. 3945func NewInterfaceListResultIterator(page InterfaceListResultPage) InterfaceListResultIterator { 3946 return InterfaceListResultIterator{page: page} 3947} 3948 3949// IsEmpty returns true if the ListResult contains no values. 3950func (ilr InterfaceListResult) IsEmpty() bool { 3951 return ilr.Value == nil || len(*ilr.Value) == 0 3952} 3953 3954// hasNextLink returns true if the NextLink is not empty. 3955func (ilr InterfaceListResult) hasNextLink() bool { 3956 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 3957} 3958 3959// interfaceListResultPreparer prepares a request to retrieve the next set of results. 3960// It returns nil if no more results exist. 3961func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) { 3962 if !ilr.hasNextLink() { 3963 return nil, nil 3964 } 3965 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3966 autorest.AsJSON(), 3967 autorest.AsGet(), 3968 autorest.WithBaseURL(to.String(ilr.NextLink))) 3969} 3970 3971// InterfaceListResultPage contains a page of Interface values. 3972type InterfaceListResultPage struct { 3973 fn func(context.Context, InterfaceListResult) (InterfaceListResult, error) 3974 ilr InterfaceListResult 3975} 3976 3977// NextWithContext advances to the next page of values. If there was an error making 3978// the request the page does not advance and the error is returned. 3979func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err error) { 3980 if tracing.IsEnabled() { 3981 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultPage.NextWithContext") 3982 defer func() { 3983 sc := -1 3984 if page.Response().Response.Response != nil { 3985 sc = page.Response().Response.Response.StatusCode 3986 } 3987 tracing.EndSpan(ctx, sc, err) 3988 }() 3989 } 3990 for { 3991 next, err := page.fn(ctx, page.ilr) 3992 if err != nil { 3993 return err 3994 } 3995 page.ilr = next 3996 if !next.hasNextLink() || !next.IsEmpty() { 3997 break 3998 } 3999 } 4000 return nil 4001} 4002 4003// Next advances to the next page of values. If there was an error making 4004// the request the page does not advance and the error is returned. 4005// Deprecated: Use NextWithContext() instead. 4006func (page *InterfaceListResultPage) Next() error { 4007 return page.NextWithContext(context.Background()) 4008} 4009 4010// NotDone returns true if the page enumeration should be started or is not yet complete. 4011func (page InterfaceListResultPage) NotDone() bool { 4012 return !page.ilr.IsEmpty() 4013} 4014 4015// Response returns the raw server response from the last page request. 4016func (page InterfaceListResultPage) Response() InterfaceListResult { 4017 return page.ilr 4018} 4019 4020// Values returns the slice of values for the current page or nil if there are no values. 4021func (page InterfaceListResultPage) Values() []Interface { 4022 if page.ilr.IsEmpty() { 4023 return nil 4024 } 4025 return *page.ilr.Value 4026} 4027 4028// Creates a new instance of the InterfaceListResultPage type. 4029func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage { 4030 return InterfaceListResultPage{ 4031 fn: getNextPage, 4032 ilr: cur, 4033 } 4034} 4035 4036// InterfacePropertiesFormat networkInterface properties. 4037type InterfacePropertiesFormat struct { 4038 // VirtualMachine - Gets or sets the reference of a VirtualMachine 4039 VirtualMachine *SubResource `json:"virtualMachine,omitempty"` 4040 // NetworkSecurityGroup - Gets or sets the reference of the NetworkSecurityGroup resource 4041 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 4042 // IPConfigurations - Gets or sets list of IPConfigurations of the NetworkInterface 4043 IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 4044 // DNSSettings - Gets or sets DNS Settings in NetworkInterface 4045 DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` 4046 // MacAddress - Gets the MAC Address of the network interface 4047 MacAddress *string `json:"macAddress,omitempty"` 4048 // Primary - Gets whether this is a primary NIC on a virtual machine 4049 Primary *bool `json:"primary,omitempty"` 4050 // EnableIPForwarding - Gets or sets whether IPForwarding is enabled on the NIC 4051 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 4052 // ResourceGUID - Gets or sets resource GUID property of the network interface resource 4053 ResourceGUID *string `json:"resourceGuid,omitempty"` 4054 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 4055 ProvisioningState *string `json:"provisioningState,omitempty"` 4056} 4057 4058// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4059// long-running operation. 4060type InterfacesCreateOrUpdateFuture struct { 4061 azure.FutureAPI 4062 // Result returns the result of the asynchronous operation. 4063 // If the operation has not completed it will return an error. 4064 Result func(InterfacesClient) (Interface, error) 4065} 4066 4067// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4068func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4069 var azFuture azure.Future 4070 if err := json.Unmarshal(body, &azFuture); err != nil { 4071 return err 4072 } 4073 future.FutureAPI = &azFuture 4074 future.Result = future.result 4075 return nil 4076} 4077 4078// result is the default implementation for InterfacesCreateOrUpdateFuture.Result. 4079func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) { 4080 var done bool 4081 done, err = future.DoneWithContext(context.Background(), client) 4082 if err != nil { 4083 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4084 return 4085 } 4086 if !done { 4087 i.Response.Response = future.Response() 4088 err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") 4089 return 4090 } 4091 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4092 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 4093 i, err = client.CreateOrUpdateResponder(i.Response.Response) 4094 if err != nil { 4095 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 4096 } 4097 } 4098 return 4099} 4100 4101// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4102// operation. 4103type InterfacesDeleteFuture struct { 4104 azure.FutureAPI 4105 // Result returns the result of the asynchronous operation. 4106 // If the operation has not completed it will return an error. 4107 Result func(InterfacesClient) (autorest.Response, error) 4108} 4109 4110// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4111func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error { 4112 var azFuture azure.Future 4113 if err := json.Unmarshal(body, &azFuture); err != nil { 4114 return err 4115 } 4116 future.FutureAPI = &azFuture 4117 future.Result = future.result 4118 return nil 4119} 4120 4121// result is the default implementation for InterfacesDeleteFuture.Result. 4122func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) { 4123 var done bool 4124 done, err = future.DoneWithContext(context.Background(), client) 4125 if err != nil { 4126 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure") 4127 return 4128 } 4129 if !done { 4130 ar.Response = future.Response() 4131 err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") 4132 return 4133 } 4134 ar.Response = future.Response() 4135 return 4136} 4137 4138// IPConfiguration iPConfiguration 4139type IPConfiguration struct { 4140 *IPConfigurationPropertiesFormat `json:"properties,omitempty"` 4141 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 4142 Name *string `json:"name,omitempty"` 4143 // Etag - A unique read-only string that changes whenever the resource is updated 4144 Etag *string `json:"etag,omitempty"` 4145 // ID - Resource Id 4146 ID *string `json:"id,omitempty"` 4147} 4148 4149// MarshalJSON is the custom marshaler for IPConfiguration. 4150func (ic IPConfiguration) MarshalJSON() ([]byte, error) { 4151 objectMap := make(map[string]interface{}) 4152 if ic.IPConfigurationPropertiesFormat != nil { 4153 objectMap["properties"] = ic.IPConfigurationPropertiesFormat 4154 } 4155 if ic.Name != nil { 4156 objectMap["name"] = ic.Name 4157 } 4158 if ic.Etag != nil { 4159 objectMap["etag"] = ic.Etag 4160 } 4161 if ic.ID != nil { 4162 objectMap["id"] = ic.ID 4163 } 4164 return json.Marshal(objectMap) 4165} 4166 4167// UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. 4168func (ic *IPConfiguration) UnmarshalJSON(body []byte) error { 4169 var m map[string]*json.RawMessage 4170 err := json.Unmarshal(body, &m) 4171 if err != nil { 4172 return err 4173 } 4174 for k, v := range m { 4175 switch k { 4176 case "properties": 4177 if v != nil { 4178 var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat 4179 err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat) 4180 if err != nil { 4181 return err 4182 } 4183 ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat 4184 } 4185 case "name": 4186 if v != nil { 4187 var name string 4188 err = json.Unmarshal(*v, &name) 4189 if err != nil { 4190 return err 4191 } 4192 ic.Name = &name 4193 } 4194 case "etag": 4195 if v != nil { 4196 var etag string 4197 err = json.Unmarshal(*v, &etag) 4198 if err != nil { 4199 return err 4200 } 4201 ic.Etag = &etag 4202 } 4203 case "id": 4204 if v != nil { 4205 var ID string 4206 err = json.Unmarshal(*v, &ID) 4207 if err != nil { 4208 return err 4209 } 4210 ic.ID = &ID 4211 } 4212 } 4213 } 4214 4215 return nil 4216} 4217 4218// IPConfigurationPropertiesFormat properties of IPConfiguration 4219type IPConfigurationPropertiesFormat struct { 4220 // PrivateIPAddress - Gets or sets the privateIPAddress of the IP Configuration 4221 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 4222 // PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic). Possible values include: 'Static', 'Dynamic' 4223 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 4224 // Subnet - Gets or sets the reference of the subnet resource 4225 Subnet *Subnet `json:"subnet,omitempty"` 4226 // PublicIPAddress - Gets or sets the reference of the PublicIP resource 4227 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 4228 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 4229 ProvisioningState *string `json:"provisioningState,omitempty"` 4230} 4231 4232// LoadBalancer loadBalancer resource 4233type LoadBalancer struct { 4234 autorest.Response `json:"-"` 4235 *LoadBalancerPropertiesFormat `json:"properties,omitempty"` 4236 // Etag - Gets a unique read-only string that changes whenever the resource is updated 4237 Etag *string `json:"etag,omitempty"` 4238 // ID - Resource Id 4239 ID *string `json:"id,omitempty"` 4240 // Name - READ-ONLY; Resource name 4241 Name *string `json:"name,omitempty"` 4242 // Type - READ-ONLY; Resource type 4243 Type *string `json:"type,omitempty"` 4244 // Location - Resource location 4245 Location *string `json:"location,omitempty"` 4246 // Tags - Resource tags 4247 Tags map[string]*string `json:"tags"` 4248} 4249 4250// MarshalJSON is the custom marshaler for LoadBalancer. 4251func (lb LoadBalancer) MarshalJSON() ([]byte, error) { 4252 objectMap := make(map[string]interface{}) 4253 if lb.LoadBalancerPropertiesFormat != nil { 4254 objectMap["properties"] = lb.LoadBalancerPropertiesFormat 4255 } 4256 if lb.Etag != nil { 4257 objectMap["etag"] = lb.Etag 4258 } 4259 if lb.ID != nil { 4260 objectMap["id"] = lb.ID 4261 } 4262 if lb.Location != nil { 4263 objectMap["location"] = lb.Location 4264 } 4265 if lb.Tags != nil { 4266 objectMap["tags"] = lb.Tags 4267 } 4268 return json.Marshal(objectMap) 4269} 4270 4271// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. 4272func (lb *LoadBalancer) UnmarshalJSON(body []byte) error { 4273 var m map[string]*json.RawMessage 4274 err := json.Unmarshal(body, &m) 4275 if err != nil { 4276 return err 4277 } 4278 for k, v := range m { 4279 switch k { 4280 case "properties": 4281 if v != nil { 4282 var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat 4283 err = json.Unmarshal(*v, &loadBalancerPropertiesFormat) 4284 if err != nil { 4285 return err 4286 } 4287 lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat 4288 } 4289 case "etag": 4290 if v != nil { 4291 var etag string 4292 err = json.Unmarshal(*v, &etag) 4293 if err != nil { 4294 return err 4295 } 4296 lb.Etag = &etag 4297 } 4298 case "id": 4299 if v != nil { 4300 var ID string 4301 err = json.Unmarshal(*v, &ID) 4302 if err != nil { 4303 return err 4304 } 4305 lb.ID = &ID 4306 } 4307 case "name": 4308 if v != nil { 4309 var name string 4310 err = json.Unmarshal(*v, &name) 4311 if err != nil { 4312 return err 4313 } 4314 lb.Name = &name 4315 } 4316 case "type": 4317 if v != nil { 4318 var typeVar string 4319 err = json.Unmarshal(*v, &typeVar) 4320 if err != nil { 4321 return err 4322 } 4323 lb.Type = &typeVar 4324 } 4325 case "location": 4326 if v != nil { 4327 var location string 4328 err = json.Unmarshal(*v, &location) 4329 if err != nil { 4330 return err 4331 } 4332 lb.Location = &location 4333 } 4334 case "tags": 4335 if v != nil { 4336 var tags map[string]*string 4337 err = json.Unmarshal(*v, &tags) 4338 if err != nil { 4339 return err 4340 } 4341 lb.Tags = tags 4342 } 4343 } 4344 } 4345 4346 return nil 4347} 4348 4349// LoadBalancerListResult response for ListLoadBalancers Api service call 4350type LoadBalancerListResult struct { 4351 autorest.Response `json:"-"` 4352 // Value - Gets a list of LoadBalancers in a resource group 4353 Value *[]LoadBalancer `json:"value,omitempty"` 4354 // NextLink - Gets the URL to get the next set of results. 4355 NextLink *string `json:"nextLink,omitempty"` 4356} 4357 4358// LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. 4359type LoadBalancerListResultIterator struct { 4360 i int 4361 page LoadBalancerListResultPage 4362} 4363 4364// NextWithContext advances to the next value. If there was an error making 4365// the request the iterator does not advance and the error is returned. 4366func (iter *LoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { 4367 if tracing.IsEnabled() { 4368 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultIterator.NextWithContext") 4369 defer func() { 4370 sc := -1 4371 if iter.Response().Response.Response != nil { 4372 sc = iter.Response().Response.Response.StatusCode 4373 } 4374 tracing.EndSpan(ctx, sc, err) 4375 }() 4376 } 4377 iter.i++ 4378 if iter.i < len(iter.page.Values()) { 4379 return nil 4380 } 4381 err = iter.page.NextWithContext(ctx) 4382 if err != nil { 4383 iter.i-- 4384 return err 4385 } 4386 iter.i = 0 4387 return nil 4388} 4389 4390// Next advances to the next value. If there was an error making 4391// the request the iterator does not advance and the error is returned. 4392// Deprecated: Use NextWithContext() instead. 4393func (iter *LoadBalancerListResultIterator) Next() error { 4394 return iter.NextWithContext(context.Background()) 4395} 4396 4397// NotDone returns true if the enumeration should be started or is not yet complete. 4398func (iter LoadBalancerListResultIterator) NotDone() bool { 4399 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4400} 4401 4402// Response returns the raw server response from the last page request. 4403func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult { 4404 return iter.page.Response() 4405} 4406 4407// Value returns the current value or a zero-initialized value if the 4408// iterator has advanced beyond the end of the collection. 4409func (iter LoadBalancerListResultIterator) Value() LoadBalancer { 4410 if !iter.page.NotDone() { 4411 return LoadBalancer{} 4412 } 4413 return iter.page.Values()[iter.i] 4414} 4415 4416// Creates a new instance of the LoadBalancerListResultIterator type. 4417func NewLoadBalancerListResultIterator(page LoadBalancerListResultPage) LoadBalancerListResultIterator { 4418 return LoadBalancerListResultIterator{page: page} 4419} 4420 4421// IsEmpty returns true if the ListResult contains no values. 4422func (lblr LoadBalancerListResult) IsEmpty() bool { 4423 return lblr.Value == nil || len(*lblr.Value) == 0 4424} 4425 4426// hasNextLink returns true if the NextLink is not empty. 4427func (lblr LoadBalancerListResult) hasNextLink() bool { 4428 return lblr.NextLink != nil && len(*lblr.NextLink) != 0 4429} 4430 4431// loadBalancerListResultPreparer prepares a request to retrieve the next set of results. 4432// It returns nil if no more results exist. 4433func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { 4434 if !lblr.hasNextLink() { 4435 return nil, nil 4436 } 4437 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4438 autorest.AsJSON(), 4439 autorest.AsGet(), 4440 autorest.WithBaseURL(to.String(lblr.NextLink))) 4441} 4442 4443// LoadBalancerListResultPage contains a page of LoadBalancer values. 4444type LoadBalancerListResultPage struct { 4445 fn func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error) 4446 lblr LoadBalancerListResult 4447} 4448 4449// NextWithContext advances to the next page of values. If there was an error making 4450// the request the page does not advance and the error is returned. 4451func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { 4452 if tracing.IsEnabled() { 4453 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultPage.NextWithContext") 4454 defer func() { 4455 sc := -1 4456 if page.Response().Response.Response != nil { 4457 sc = page.Response().Response.Response.StatusCode 4458 } 4459 tracing.EndSpan(ctx, sc, err) 4460 }() 4461 } 4462 for { 4463 next, err := page.fn(ctx, page.lblr) 4464 if err != nil { 4465 return err 4466 } 4467 page.lblr = next 4468 if !next.hasNextLink() || !next.IsEmpty() { 4469 break 4470 } 4471 } 4472 return nil 4473} 4474 4475// Next advances to the next page of values. If there was an error making 4476// the request the page does not advance and the error is returned. 4477// Deprecated: Use NextWithContext() instead. 4478func (page *LoadBalancerListResultPage) Next() error { 4479 return page.NextWithContext(context.Background()) 4480} 4481 4482// NotDone returns true if the page enumeration should be started or is not yet complete. 4483func (page LoadBalancerListResultPage) NotDone() bool { 4484 return !page.lblr.IsEmpty() 4485} 4486 4487// Response returns the raw server response from the last page request. 4488func (page LoadBalancerListResultPage) Response() LoadBalancerListResult { 4489 return page.lblr 4490} 4491 4492// Values returns the slice of values for the current page or nil if there are no values. 4493func (page LoadBalancerListResultPage) Values() []LoadBalancer { 4494 if page.lblr.IsEmpty() { 4495 return nil 4496 } 4497 return *page.lblr.Value 4498} 4499 4500// Creates a new instance of the LoadBalancerListResultPage type. 4501func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage { 4502 return LoadBalancerListResultPage{ 4503 fn: getNextPage, 4504 lblr: cur, 4505 } 4506} 4507 4508// LoadBalancerPropertiesFormat properties of Load Balancer 4509type LoadBalancerPropertiesFormat struct { 4510 // FrontendIPConfigurations - Gets or sets frontend IP addresses of the load balancer 4511 FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 4512 // BackendAddressPools - Gets or sets Pools of backend IP addresses 4513 BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` 4514 // LoadBalancingRules - Gets or sets load balancing rules 4515 LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` 4516 // Probes - Gets or sets list of Load balancer probes 4517 Probes *[]Probe `json:"probes,omitempty"` 4518 // InboundNatRules - Gets or sets list of inbound rules 4519 InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` 4520 // InboundNatPools - Gets or sets inbound NAT pools 4521 InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` 4522 // OutboundNatRules - Gets or sets outbound NAT rules 4523 OutboundNatRules *[]OutboundNatRule `json:"outboundNatRules,omitempty"` 4524 // ResourceGUID - Gets or sets resource GUID property of the Load balancer resource 4525 ResourceGUID *string `json:"resourceGuid,omitempty"` 4526 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 4527 ProvisioningState *string `json:"provisioningState,omitempty"` 4528} 4529 4530// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4531// long-running operation. 4532type LoadBalancersCreateOrUpdateFuture struct { 4533 azure.FutureAPI 4534 // Result returns the result of the asynchronous operation. 4535 // If the operation has not completed it will return an error. 4536 Result func(LoadBalancersClient) (LoadBalancer, error) 4537} 4538 4539// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4540func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4541 var azFuture azure.Future 4542 if err := json.Unmarshal(body, &azFuture); err != nil { 4543 return err 4544 } 4545 future.FutureAPI = &azFuture 4546 future.Result = future.result 4547 return nil 4548} 4549 4550// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. 4551func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { 4552 var done bool 4553 done, err = future.DoneWithContext(context.Background(), client) 4554 if err != nil { 4555 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4556 return 4557 } 4558 if !done { 4559 lb.Response.Response = future.Response() 4560 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") 4561 return 4562 } 4563 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4564 if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { 4565 lb, err = client.CreateOrUpdateResponder(lb.Response.Response) 4566 if err != nil { 4567 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request") 4568 } 4569 } 4570 return 4571} 4572 4573// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4574// operation. 4575type LoadBalancersDeleteFuture struct { 4576 azure.FutureAPI 4577 // Result returns the result of the asynchronous operation. 4578 // If the operation has not completed it will return an error. 4579 Result func(LoadBalancersClient) (autorest.Response, error) 4580} 4581 4582// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4583func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { 4584 var azFuture azure.Future 4585 if err := json.Unmarshal(body, &azFuture); err != nil { 4586 return err 4587 } 4588 future.FutureAPI = &azFuture 4589 future.Result = future.result 4590 return nil 4591} 4592 4593// result is the default implementation for LoadBalancersDeleteFuture.Result. 4594func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { 4595 var done bool 4596 done, err = future.DoneWithContext(context.Background(), client) 4597 if err != nil { 4598 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") 4599 return 4600 } 4601 if !done { 4602 ar.Response = future.Response() 4603 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") 4604 return 4605 } 4606 ar.Response = future.Response() 4607 return 4608} 4609 4610// LoadBalancingRule rules of the load balancer 4611type LoadBalancingRule struct { 4612 *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` 4613 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 4614 Name *string `json:"name,omitempty"` 4615 // Etag - A unique read-only string that changes whenever the resource is updated 4616 Etag *string `json:"etag,omitempty"` 4617 // ID - Resource Id 4618 ID *string `json:"id,omitempty"` 4619} 4620 4621// MarshalJSON is the custom marshaler for LoadBalancingRule. 4622func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { 4623 objectMap := make(map[string]interface{}) 4624 if lbr.LoadBalancingRulePropertiesFormat != nil { 4625 objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat 4626 } 4627 if lbr.Name != nil { 4628 objectMap["name"] = lbr.Name 4629 } 4630 if lbr.Etag != nil { 4631 objectMap["etag"] = lbr.Etag 4632 } 4633 if lbr.ID != nil { 4634 objectMap["id"] = lbr.ID 4635 } 4636 return json.Marshal(objectMap) 4637} 4638 4639// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. 4640func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { 4641 var m map[string]*json.RawMessage 4642 err := json.Unmarshal(body, &m) 4643 if err != nil { 4644 return err 4645 } 4646 for k, v := range m { 4647 switch k { 4648 case "properties": 4649 if v != nil { 4650 var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat 4651 err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) 4652 if err != nil { 4653 return err 4654 } 4655 lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat 4656 } 4657 case "name": 4658 if v != nil { 4659 var name string 4660 err = json.Unmarshal(*v, &name) 4661 if err != nil { 4662 return err 4663 } 4664 lbr.Name = &name 4665 } 4666 case "etag": 4667 if v != nil { 4668 var etag string 4669 err = json.Unmarshal(*v, &etag) 4670 if err != nil { 4671 return err 4672 } 4673 lbr.Etag = &etag 4674 } 4675 case "id": 4676 if v != nil { 4677 var ID string 4678 err = json.Unmarshal(*v, &ID) 4679 if err != nil { 4680 return err 4681 } 4682 lbr.ID = &ID 4683 } 4684 } 4685 } 4686 4687 return nil 4688} 4689 4690// LoadBalancingRulePropertiesFormat properties of the load balancer 4691type LoadBalancingRulePropertiesFormat struct { 4692 // FrontendIPConfiguration - Gets or sets a reference to frontend IP Addresses 4693 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 4694 // BackendAddressPool - Gets or sets a reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs 4695 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 4696 // Probe - Gets or sets the reference of the load balancer probe used by the Load Balancing rule. 4697 Probe *SubResource `json:"probe,omitempty"` 4698 // Protocol - Gets or sets the transport protocol for the external endpoint. Possible values are Udp or Tcp. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 4699 Protocol TransportProtocol `json:"protocol,omitempty"` 4700 // LoadDistribution - Gets or sets the load distribution policy for this rule. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' 4701 LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` 4702 // FrontendPort - Gets or sets the port for the external endpoint. You can specify any port number you choose, but the port numbers specified for each role in the service must be unique. Possible values range between 1 and 65535, inclusive 4703 FrontendPort *int32 `json:"frontendPort,omitempty"` 4704 // BackendPort - Gets or sets a port used for internal connections on the endpoint. The localPort attribute maps the eternal port of the endpoint to an internal port on a role. This is useful in scenarios where a role must communicate to an internal component on a port that is different from the one that is exposed externally. If not specified, the value of localPort is the same as the port attribute. Set the value of localPort to '*' to automatically assign an unallocated port that is discoverable using the runtime API 4705 BackendPort *int32 `json:"backendPort,omitempty"` 4706 // IdleTimeoutInMinutes - Gets or sets 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 4707 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 4708 // 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 Always ON availability Groups in SQL server. This setting can't be changed after you create the endpoint 4709 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 4710 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 4711 ProvisioningState *string `json:"provisioningState,omitempty"` 4712} 4713 4714// LocalNetworkGateway a common class for general resource information 4715type LocalNetworkGateway struct { 4716 autorest.Response `json:"-"` 4717 *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 4718 // Etag - Gets a unique read-only string that changes whenever the resource is updated 4719 Etag *string `json:"etag,omitempty"` 4720 // ID - Resource Id 4721 ID *string `json:"id,omitempty"` 4722 // Name - READ-ONLY; Resource name 4723 Name *string `json:"name,omitempty"` 4724 // Type - READ-ONLY; Resource type 4725 Type *string `json:"type,omitempty"` 4726 // Location - Resource location 4727 Location *string `json:"location,omitempty"` 4728 // Tags - Resource tags 4729 Tags map[string]*string `json:"tags"` 4730} 4731 4732// MarshalJSON is the custom marshaler for LocalNetworkGateway. 4733func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { 4734 objectMap := make(map[string]interface{}) 4735 if lng.LocalNetworkGatewayPropertiesFormat != nil { 4736 objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat 4737 } 4738 if lng.Etag != nil { 4739 objectMap["etag"] = lng.Etag 4740 } 4741 if lng.ID != nil { 4742 objectMap["id"] = lng.ID 4743 } 4744 if lng.Location != nil { 4745 objectMap["location"] = lng.Location 4746 } 4747 if lng.Tags != nil { 4748 objectMap["tags"] = lng.Tags 4749 } 4750 return json.Marshal(objectMap) 4751} 4752 4753// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. 4754func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { 4755 var m map[string]*json.RawMessage 4756 err := json.Unmarshal(body, &m) 4757 if err != nil { 4758 return err 4759 } 4760 for k, v := range m { 4761 switch k { 4762 case "properties": 4763 if v != nil { 4764 var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat 4765 err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) 4766 if err != nil { 4767 return err 4768 } 4769 lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat 4770 } 4771 case "etag": 4772 if v != nil { 4773 var etag string 4774 err = json.Unmarshal(*v, &etag) 4775 if err != nil { 4776 return err 4777 } 4778 lng.Etag = &etag 4779 } 4780 case "id": 4781 if v != nil { 4782 var ID string 4783 err = json.Unmarshal(*v, &ID) 4784 if err != nil { 4785 return err 4786 } 4787 lng.ID = &ID 4788 } 4789 case "name": 4790 if v != nil { 4791 var name string 4792 err = json.Unmarshal(*v, &name) 4793 if err != nil { 4794 return err 4795 } 4796 lng.Name = &name 4797 } 4798 case "type": 4799 if v != nil { 4800 var typeVar string 4801 err = json.Unmarshal(*v, &typeVar) 4802 if err != nil { 4803 return err 4804 } 4805 lng.Type = &typeVar 4806 } 4807 case "location": 4808 if v != nil { 4809 var location string 4810 err = json.Unmarshal(*v, &location) 4811 if err != nil { 4812 return err 4813 } 4814 lng.Location = &location 4815 } 4816 case "tags": 4817 if v != nil { 4818 var tags map[string]*string 4819 err = json.Unmarshal(*v, &tags) 4820 if err != nil { 4821 return err 4822 } 4823 lng.Tags = tags 4824 } 4825 } 4826 } 4827 4828 return nil 4829} 4830 4831// LocalNetworkGatewayListResult response for ListLocalNetworkGateways Api service call 4832type LocalNetworkGatewayListResult struct { 4833 autorest.Response `json:"-"` 4834 // Value - Gets List of LocalNetworkGateways that exists in a resource group 4835 Value *[]LocalNetworkGateway `json:"value,omitempty"` 4836 // NextLink - Gets the URL to get the next set of results. 4837 NextLink *string `json:"nextLink,omitempty"` 4838} 4839 4840// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway 4841// values. 4842type LocalNetworkGatewayListResultIterator struct { 4843 i int 4844 page LocalNetworkGatewayListResultPage 4845} 4846 4847// NextWithContext advances to the next value. If there was an error making 4848// the request the iterator does not advance and the error is returned. 4849func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 4850 if tracing.IsEnabled() { 4851 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext") 4852 defer func() { 4853 sc := -1 4854 if iter.Response().Response.Response != nil { 4855 sc = iter.Response().Response.Response.StatusCode 4856 } 4857 tracing.EndSpan(ctx, sc, err) 4858 }() 4859 } 4860 iter.i++ 4861 if iter.i < len(iter.page.Values()) { 4862 return nil 4863 } 4864 err = iter.page.NextWithContext(ctx) 4865 if err != nil { 4866 iter.i-- 4867 return err 4868 } 4869 iter.i = 0 4870 return nil 4871} 4872 4873// Next advances to the next value. If there was an error making 4874// the request the iterator does not advance and the error is returned. 4875// Deprecated: Use NextWithContext() instead. 4876func (iter *LocalNetworkGatewayListResultIterator) Next() error { 4877 return iter.NextWithContext(context.Background()) 4878} 4879 4880// NotDone returns true if the enumeration should be started or is not yet complete. 4881func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { 4882 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4883} 4884 4885// Response returns the raw server response from the last page request. 4886func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { 4887 return iter.page.Response() 4888} 4889 4890// Value returns the current value or a zero-initialized value if the 4891// iterator has advanced beyond the end of the collection. 4892func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { 4893 if !iter.page.NotDone() { 4894 return LocalNetworkGateway{} 4895 } 4896 return iter.page.Values()[iter.i] 4897} 4898 4899// Creates a new instance of the LocalNetworkGatewayListResultIterator type. 4900func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator { 4901 return LocalNetworkGatewayListResultIterator{page: page} 4902} 4903 4904// IsEmpty returns true if the ListResult contains no values. 4905func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { 4906 return lnglr.Value == nil || len(*lnglr.Value) == 0 4907} 4908 4909// hasNextLink returns true if the NextLink is not empty. 4910func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { 4911 return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 4912} 4913 4914// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 4915// It returns nil if no more results exist. 4916func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 4917 if !lnglr.hasNextLink() { 4918 return nil, nil 4919 } 4920 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4921 autorest.AsJSON(), 4922 autorest.AsGet(), 4923 autorest.WithBaseURL(to.String(lnglr.NextLink))) 4924} 4925 4926// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. 4927type LocalNetworkGatewayListResultPage struct { 4928 fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) 4929 lnglr LocalNetworkGatewayListResult 4930} 4931 4932// NextWithContext advances to the next page of values. If there was an error making 4933// the request the page does not advance and the error is returned. 4934func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 4935 if tracing.IsEnabled() { 4936 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext") 4937 defer func() { 4938 sc := -1 4939 if page.Response().Response.Response != nil { 4940 sc = page.Response().Response.Response.StatusCode 4941 } 4942 tracing.EndSpan(ctx, sc, err) 4943 }() 4944 } 4945 for { 4946 next, err := page.fn(ctx, page.lnglr) 4947 if err != nil { 4948 return err 4949 } 4950 page.lnglr = next 4951 if !next.hasNextLink() || !next.IsEmpty() { 4952 break 4953 } 4954 } 4955 return nil 4956} 4957 4958// Next advances to the next page of values. If there was an error making 4959// the request the page does not advance and the error is returned. 4960// Deprecated: Use NextWithContext() instead. 4961func (page *LocalNetworkGatewayListResultPage) Next() error { 4962 return page.NextWithContext(context.Background()) 4963} 4964 4965// NotDone returns true if the page enumeration should be started or is not yet complete. 4966func (page LocalNetworkGatewayListResultPage) NotDone() bool { 4967 return !page.lnglr.IsEmpty() 4968} 4969 4970// Response returns the raw server response from the last page request. 4971func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { 4972 return page.lnglr 4973} 4974 4975// Values returns the slice of values for the current page or nil if there are no values. 4976func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { 4977 if page.lnglr.IsEmpty() { 4978 return nil 4979 } 4980 return *page.lnglr.Value 4981} 4982 4983// Creates a new instance of the LocalNetworkGatewayListResultPage type. 4984func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { 4985 return LocalNetworkGatewayListResultPage{ 4986 fn: getNextPage, 4987 lnglr: cur, 4988 } 4989} 4990 4991// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties 4992type LocalNetworkGatewayPropertiesFormat struct { 4993 // LocalNetworkAddressSpace - Local network site Address space 4994 LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` 4995 // GatewayIPAddress - IP address of local network gateway. 4996 GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` 4997 // BgpSettings - Local network gateway's BGP speaker settings 4998 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 4999 // ResourceGUID - Gets or sets resource GUID property of the LocalNetworkGateway resource 5000 ResourceGUID *string `json:"resourceGuid,omitempty"` 5001 // ProvisioningState - Gets or sets Provisioning state of the LocalNetworkGateway resource Updating/Deleting/Failed 5002 ProvisioningState *string `json:"provisioningState,omitempty"` 5003} 5004 5005// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5006// long-running operation. 5007type LocalNetworkGatewaysCreateOrUpdateFuture struct { 5008 azure.FutureAPI 5009 // Result returns the result of the asynchronous operation. 5010 // If the operation has not completed it will return an error. 5011 Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) 5012} 5013 5014// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5015func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5016 var azFuture azure.Future 5017 if err := json.Unmarshal(body, &azFuture); err != nil { 5018 return err 5019 } 5020 future.FutureAPI = &azFuture 5021 future.Result = future.result 5022 return nil 5023} 5024 5025// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. 5026func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { 5027 var done bool 5028 done, err = future.DoneWithContext(context.Background(), client) 5029 if err != nil { 5030 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5031 return 5032 } 5033 if !done { 5034 lng.Response.Response = future.Response() 5035 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") 5036 return 5037 } 5038 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5039 if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { 5040 lng, err = client.CreateOrUpdateResponder(lng.Response.Response) 5041 if err != nil { 5042 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request") 5043 } 5044 } 5045 return 5046} 5047 5048// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 5049// long-running operation. 5050type LocalNetworkGatewaysDeleteFuture struct { 5051 azure.FutureAPI 5052 // Result returns the result of the asynchronous operation. 5053 // If the operation has not completed it will return an error. 5054 Result func(LocalNetworkGatewaysClient) (autorest.Response, error) 5055} 5056 5057// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5058func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 5059 var azFuture azure.Future 5060 if err := json.Unmarshal(body, &azFuture); err != nil { 5061 return err 5062 } 5063 future.FutureAPI = &azFuture 5064 future.Result = future.result 5065 return nil 5066} 5067 5068// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. 5069func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { 5070 var done bool 5071 done, err = future.DoneWithContext(context.Background(), client) 5072 if err != nil { 5073 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 5074 return 5075 } 5076 if !done { 5077 ar.Response = future.Response() 5078 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") 5079 return 5080 } 5081 ar.Response = future.Response() 5082 return 5083} 5084 5085// OutboundNatRule outbound NAT pool of the loadbalancer 5086type OutboundNatRule struct { 5087 *OutboundNatRulePropertiesFormat `json:"properties,omitempty"` 5088 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 5089 Name *string `json:"name,omitempty"` 5090 // Etag - A unique read-only string that changes whenever the resource is updated 5091 Etag *string `json:"etag,omitempty"` 5092 // ID - Resource Id 5093 ID *string `json:"id,omitempty"` 5094} 5095 5096// MarshalJSON is the custom marshaler for OutboundNatRule. 5097func (onr OutboundNatRule) MarshalJSON() ([]byte, error) { 5098 objectMap := make(map[string]interface{}) 5099 if onr.OutboundNatRulePropertiesFormat != nil { 5100 objectMap["properties"] = onr.OutboundNatRulePropertiesFormat 5101 } 5102 if onr.Name != nil { 5103 objectMap["name"] = onr.Name 5104 } 5105 if onr.Etag != nil { 5106 objectMap["etag"] = onr.Etag 5107 } 5108 if onr.ID != nil { 5109 objectMap["id"] = onr.ID 5110 } 5111 return json.Marshal(objectMap) 5112} 5113 5114// UnmarshalJSON is the custom unmarshaler for OutboundNatRule struct. 5115func (onr *OutboundNatRule) 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 "properties": 5124 if v != nil { 5125 var outboundNatRulePropertiesFormat OutboundNatRulePropertiesFormat 5126 err = json.Unmarshal(*v, &outboundNatRulePropertiesFormat) 5127 if err != nil { 5128 return err 5129 } 5130 onr.OutboundNatRulePropertiesFormat = &outboundNatRulePropertiesFormat 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 onr.Name = &name 5140 } 5141 case "etag": 5142 if v != nil { 5143 var etag string 5144 err = json.Unmarshal(*v, &etag) 5145 if err != nil { 5146 return err 5147 } 5148 onr.Etag = &etag 5149 } 5150 case "id": 5151 if v != nil { 5152 var ID string 5153 err = json.Unmarshal(*v, &ID) 5154 if err != nil { 5155 return err 5156 } 5157 onr.ID = &ID 5158 } 5159 } 5160 } 5161 5162 return nil 5163} 5164 5165// OutboundNatRulePropertiesFormat outbound NAT pool of the loadbalancer 5166type OutboundNatRulePropertiesFormat struct { 5167 // AllocatedOutboundPorts - Gets or sets the number of outbound ports to be used for SNAT 5168 AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` 5169 // FrontendIPConfigurations - Gets or sets Frontend IP addresses of the load balancer 5170 FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` 5171 // BackendAddressPool - Gets or sets a reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs 5172 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 5173 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 5174 ProvisioningState *string `json:"provisioningState,omitempty"` 5175} 5176 5177// Probe load balancer Probe 5178type Probe struct { 5179 *ProbePropertiesFormat `json:"properties,omitempty"` 5180 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 5181 Name *string `json:"name,omitempty"` 5182 // Etag - A unique read-only string that changes whenever the resource is updated 5183 Etag *string `json:"etag,omitempty"` 5184 // ID - Resource Id 5185 ID *string `json:"id,omitempty"` 5186} 5187 5188// MarshalJSON is the custom marshaler for Probe. 5189func (p Probe) MarshalJSON() ([]byte, error) { 5190 objectMap := make(map[string]interface{}) 5191 if p.ProbePropertiesFormat != nil { 5192 objectMap["properties"] = p.ProbePropertiesFormat 5193 } 5194 if p.Name != nil { 5195 objectMap["name"] = p.Name 5196 } 5197 if p.Etag != nil { 5198 objectMap["etag"] = p.Etag 5199 } 5200 if p.ID != nil { 5201 objectMap["id"] = p.ID 5202 } 5203 return json.Marshal(objectMap) 5204} 5205 5206// UnmarshalJSON is the custom unmarshaler for Probe struct. 5207func (p *Probe) UnmarshalJSON(body []byte) error { 5208 var m map[string]*json.RawMessage 5209 err := json.Unmarshal(body, &m) 5210 if err != nil { 5211 return err 5212 } 5213 for k, v := range m { 5214 switch k { 5215 case "properties": 5216 if v != nil { 5217 var probePropertiesFormat ProbePropertiesFormat 5218 err = json.Unmarshal(*v, &probePropertiesFormat) 5219 if err != nil { 5220 return err 5221 } 5222 p.ProbePropertiesFormat = &probePropertiesFormat 5223 } 5224 case "name": 5225 if v != nil { 5226 var name string 5227 err = json.Unmarshal(*v, &name) 5228 if err != nil { 5229 return err 5230 } 5231 p.Name = &name 5232 } 5233 case "etag": 5234 if v != nil { 5235 var etag string 5236 err = json.Unmarshal(*v, &etag) 5237 if err != nil { 5238 return err 5239 } 5240 p.Etag = &etag 5241 } 5242 case "id": 5243 if v != nil { 5244 var ID string 5245 err = json.Unmarshal(*v, &ID) 5246 if err != nil { 5247 return err 5248 } 5249 p.ID = &ID 5250 } 5251 } 5252 } 5253 5254 return nil 5255} 5256 5257// ProbePropertiesFormat ... 5258type ProbePropertiesFormat struct { 5259 // LoadBalancingRules - Gets Load balancer rules that use this probe 5260 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 5261 // Protocol - Gets or sets the protocol of the end point. Possible values are http pr Tcp. If Tcp is specified, a received ACK is required for the probe to be successful. If http is specified,a 200 OK response from the specifies URI is required for the probe to be successful. Possible values include: 'ProbeProtocolHTTP', 'ProbeProtocolTCP' 5262 Protocol ProbeProtocol `json:"protocol,omitempty"` 5263 // Port - Gets or sets Port for communicating the probe. Possible values range from 1 to 65535, inclusive. 5264 Port *int32 `json:"port,omitempty"` 5265 // IntervalInSeconds - Gets or sets 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 5266 IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` 5267 // NumberOfProbes - Gets or sets 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. 5268 NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` 5269 // RequestPath - Gets or sets 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 5270 RequestPath *string `json:"requestPath,omitempty"` 5271 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 5272 ProvisioningState *string `json:"provisioningState,omitempty"` 5273} 5274 5275// PublicIPAddress publicIPAddress resource 5276type PublicIPAddress struct { 5277 autorest.Response `json:"-"` 5278 *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` 5279 // Etag - Gets a unique read-only string that changes whenever the resource is updated 5280 Etag *string `json:"etag,omitempty"` 5281 // ID - Resource Id 5282 ID *string `json:"id,omitempty"` 5283 // Name - READ-ONLY; Resource name 5284 Name *string `json:"name,omitempty"` 5285 // Type - READ-ONLY; Resource type 5286 Type *string `json:"type,omitempty"` 5287 // Location - Resource location 5288 Location *string `json:"location,omitempty"` 5289 // Tags - Resource tags 5290 Tags map[string]*string `json:"tags"` 5291} 5292 5293// MarshalJSON is the custom marshaler for PublicIPAddress. 5294func (pia PublicIPAddress) MarshalJSON() ([]byte, error) { 5295 objectMap := make(map[string]interface{}) 5296 if pia.PublicIPAddressPropertiesFormat != nil { 5297 objectMap["properties"] = pia.PublicIPAddressPropertiesFormat 5298 } 5299 if pia.Etag != nil { 5300 objectMap["etag"] = pia.Etag 5301 } 5302 if pia.ID != nil { 5303 objectMap["id"] = pia.ID 5304 } 5305 if pia.Location != nil { 5306 objectMap["location"] = pia.Location 5307 } 5308 if pia.Tags != nil { 5309 objectMap["tags"] = pia.Tags 5310 } 5311 return json.Marshal(objectMap) 5312} 5313 5314// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. 5315func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error { 5316 var m map[string]*json.RawMessage 5317 err := json.Unmarshal(body, &m) 5318 if err != nil { 5319 return err 5320 } 5321 for k, v := range m { 5322 switch k { 5323 case "properties": 5324 if v != nil { 5325 var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat 5326 err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat) 5327 if err != nil { 5328 return err 5329 } 5330 pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat 5331 } 5332 case "etag": 5333 if v != nil { 5334 var etag string 5335 err = json.Unmarshal(*v, &etag) 5336 if err != nil { 5337 return err 5338 } 5339 pia.Etag = &etag 5340 } 5341 case "id": 5342 if v != nil { 5343 var ID string 5344 err = json.Unmarshal(*v, &ID) 5345 if err != nil { 5346 return err 5347 } 5348 pia.ID = &ID 5349 } 5350 case "name": 5351 if v != nil { 5352 var name string 5353 err = json.Unmarshal(*v, &name) 5354 if err != nil { 5355 return err 5356 } 5357 pia.Name = &name 5358 } 5359 case "type": 5360 if v != nil { 5361 var typeVar string 5362 err = json.Unmarshal(*v, &typeVar) 5363 if err != nil { 5364 return err 5365 } 5366 pia.Type = &typeVar 5367 } 5368 case "location": 5369 if v != nil { 5370 var location string 5371 err = json.Unmarshal(*v, &location) 5372 if err != nil { 5373 return err 5374 } 5375 pia.Location = &location 5376 } 5377 case "tags": 5378 if v != nil { 5379 var tags map[string]*string 5380 err = json.Unmarshal(*v, &tags) 5381 if err != nil { 5382 return err 5383 } 5384 pia.Tags = tags 5385 } 5386 } 5387 } 5388 5389 return nil 5390} 5391 5392// PublicIPAddressDNSSettings contains FQDN of the DNS record associated with the public IP address 5393type PublicIPAddressDNSSettings struct { 5394 // 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. 5395 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 5396 // 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. 5397 Fqdn *string `json:"fqdn,omitempty"` 5398 // 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. 5399 ReverseFqdn *string `json:"reverseFqdn,omitempty"` 5400} 5401 5402// PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5403// long-running operation. 5404type PublicIPAddressesCreateOrUpdateFuture struct { 5405 azure.FutureAPI 5406 // Result returns the result of the asynchronous operation. 5407 // If the operation has not completed it will return an error. 5408 Result func(PublicIPAddressesClient) (PublicIPAddress, error) 5409} 5410 5411// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5412func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5413 var azFuture azure.Future 5414 if err := json.Unmarshal(body, &azFuture); err != nil { 5415 return err 5416 } 5417 future.FutureAPI = &azFuture 5418 future.Result = future.result 5419 return nil 5420} 5421 5422// result is the default implementation for PublicIPAddressesCreateOrUpdateFuture.Result. 5423func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { 5424 var done bool 5425 done, err = future.DoneWithContext(context.Background(), client) 5426 if err != nil { 5427 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5428 return 5429 } 5430 if !done { 5431 pia.Response.Response = future.Response() 5432 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") 5433 return 5434 } 5435 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5436 if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent { 5437 pia, err = client.CreateOrUpdateResponder(pia.Response.Response) 5438 if err != nil { 5439 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", pia.Response.Response, "Failure responding to request") 5440 } 5441 } 5442 return 5443} 5444 5445// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5446// operation. 5447type PublicIPAddressesDeleteFuture struct { 5448 azure.FutureAPI 5449 // Result returns the result of the asynchronous operation. 5450 // If the operation has not completed it will return an error. 5451 Result func(PublicIPAddressesClient) (autorest.Response, error) 5452} 5453 5454// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5455func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error { 5456 var azFuture azure.Future 5457 if err := json.Unmarshal(body, &azFuture); err != nil { 5458 return err 5459 } 5460 future.FutureAPI = &azFuture 5461 future.Result = future.result 5462 return nil 5463} 5464 5465// result is the default implementation for PublicIPAddressesDeleteFuture.Result. 5466func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) { 5467 var done bool 5468 done, err = future.DoneWithContext(context.Background(), client) 5469 if err != nil { 5470 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure") 5471 return 5472 } 5473 if !done { 5474 ar.Response = future.Response() 5475 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") 5476 return 5477 } 5478 ar.Response = future.Response() 5479 return 5480} 5481 5482// PublicIPAddressListResult response for ListPublicIpAddresses Api service call 5483type PublicIPAddressListResult struct { 5484 autorest.Response `json:"-"` 5485 // Value - Gets List of publicIP addresses that exists in a resource group 5486 Value *[]PublicIPAddress `json:"value,omitempty"` 5487 // NextLink - Gets the URL to get the next set of results. 5488 NextLink *string `json:"nextLink,omitempty"` 5489} 5490 5491// PublicIPAddressListResultIterator provides access to a complete listing of PublicIPAddress values. 5492type PublicIPAddressListResultIterator struct { 5493 i int 5494 page PublicIPAddressListResultPage 5495} 5496 5497// NextWithContext advances to the next value. If there was an error making 5498// the request the iterator does not advance and the error is returned. 5499func (iter *PublicIPAddressListResultIterator) NextWithContext(ctx context.Context) (err error) { 5500 if tracing.IsEnabled() { 5501 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultIterator.NextWithContext") 5502 defer func() { 5503 sc := -1 5504 if iter.Response().Response.Response != nil { 5505 sc = iter.Response().Response.Response.StatusCode 5506 } 5507 tracing.EndSpan(ctx, sc, err) 5508 }() 5509 } 5510 iter.i++ 5511 if iter.i < len(iter.page.Values()) { 5512 return nil 5513 } 5514 err = iter.page.NextWithContext(ctx) 5515 if err != nil { 5516 iter.i-- 5517 return err 5518 } 5519 iter.i = 0 5520 return nil 5521} 5522 5523// Next advances to the next value. If there was an error making 5524// the request the iterator does not advance and the error is returned. 5525// Deprecated: Use NextWithContext() instead. 5526func (iter *PublicIPAddressListResultIterator) Next() error { 5527 return iter.NextWithContext(context.Background()) 5528} 5529 5530// NotDone returns true if the enumeration should be started or is not yet complete. 5531func (iter PublicIPAddressListResultIterator) NotDone() bool { 5532 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5533} 5534 5535// Response returns the raw server response from the last page request. 5536func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult { 5537 return iter.page.Response() 5538} 5539 5540// Value returns the current value or a zero-initialized value if the 5541// iterator has advanced beyond the end of the collection. 5542func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress { 5543 if !iter.page.NotDone() { 5544 return PublicIPAddress{} 5545 } 5546 return iter.page.Values()[iter.i] 5547} 5548 5549// Creates a new instance of the PublicIPAddressListResultIterator type. 5550func NewPublicIPAddressListResultIterator(page PublicIPAddressListResultPage) PublicIPAddressListResultIterator { 5551 return PublicIPAddressListResultIterator{page: page} 5552} 5553 5554// IsEmpty returns true if the ListResult contains no values. 5555func (pialr PublicIPAddressListResult) IsEmpty() bool { 5556 return pialr.Value == nil || len(*pialr.Value) == 0 5557} 5558 5559// hasNextLink returns true if the NextLink is not empty. 5560func (pialr PublicIPAddressListResult) hasNextLink() bool { 5561 return pialr.NextLink != nil && len(*pialr.NextLink) != 0 5562} 5563 5564// publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. 5565// It returns nil if no more results exist. 5566func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) { 5567 if !pialr.hasNextLink() { 5568 return nil, nil 5569 } 5570 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5571 autorest.AsJSON(), 5572 autorest.AsGet(), 5573 autorest.WithBaseURL(to.String(pialr.NextLink))) 5574} 5575 5576// PublicIPAddressListResultPage contains a page of PublicIPAddress values. 5577type PublicIPAddressListResultPage struct { 5578 fn func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error) 5579 pialr PublicIPAddressListResult 5580} 5581 5582// NextWithContext advances to the next page of values. If there was an error making 5583// the request the page does not advance and the error is returned. 5584func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) (err error) { 5585 if tracing.IsEnabled() { 5586 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultPage.NextWithContext") 5587 defer func() { 5588 sc := -1 5589 if page.Response().Response.Response != nil { 5590 sc = page.Response().Response.Response.StatusCode 5591 } 5592 tracing.EndSpan(ctx, sc, err) 5593 }() 5594 } 5595 for { 5596 next, err := page.fn(ctx, page.pialr) 5597 if err != nil { 5598 return err 5599 } 5600 page.pialr = next 5601 if !next.hasNextLink() || !next.IsEmpty() { 5602 break 5603 } 5604 } 5605 return nil 5606} 5607 5608// Next advances to the next page of values. If there was an error making 5609// the request the page does not advance and the error is returned. 5610// Deprecated: Use NextWithContext() instead. 5611func (page *PublicIPAddressListResultPage) Next() error { 5612 return page.NextWithContext(context.Background()) 5613} 5614 5615// NotDone returns true if the page enumeration should be started or is not yet complete. 5616func (page PublicIPAddressListResultPage) NotDone() bool { 5617 return !page.pialr.IsEmpty() 5618} 5619 5620// Response returns the raw server response from the last page request. 5621func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult { 5622 return page.pialr 5623} 5624 5625// Values returns the slice of values for the current page or nil if there are no values. 5626func (page PublicIPAddressListResultPage) Values() []PublicIPAddress { 5627 if page.pialr.IsEmpty() { 5628 return nil 5629 } 5630 return *page.pialr.Value 5631} 5632 5633// Creates a new instance of the PublicIPAddressListResultPage type. 5634func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage { 5635 return PublicIPAddressListResultPage{ 5636 fn: getNextPage, 5637 pialr: cur, 5638 } 5639} 5640 5641// PublicIPAddressPropertiesFormat publicIpAddress properties 5642type PublicIPAddressPropertiesFormat struct { 5643 // PublicIPAllocationMethod - Gets or sets PublicIP allocation method (Static/Dynamic). Possible values include: 'Static', 'Dynamic' 5644 PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` 5645 // PublicIPAddressVersion - Gets or sets PublicIP address version (IPv4/IPv6). Possible values include: 'IPv4', 'IPv6' 5646 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 5647 IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` 5648 // DNSSettings - Gets or sets FQDN of the DNS record associated with the public IP address 5649 DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"` 5650 IPAddress *string `json:"ipAddress,omitempty"` 5651 // IdleTimeoutInMinutes - Gets or sets the idle timeout of the public IP address 5652 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 5653 // ResourceGUID - Gets or sets resource GUID property of the PublicIP resource 5654 ResourceGUID *string `json:"resourceGuid,omitempty"` 5655 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 5656 ProvisioningState *string `json:"provisioningState,omitempty"` 5657} 5658 5659// Resource ... 5660type Resource struct { 5661 // ID - Resource Id 5662 ID *string `json:"id,omitempty"` 5663 // Name - READ-ONLY; Resource name 5664 Name *string `json:"name,omitempty"` 5665 // Type - READ-ONLY; Resource type 5666 Type *string `json:"type,omitempty"` 5667 // Location - Resource location 5668 Location *string `json:"location,omitempty"` 5669 // Tags - Resource tags 5670 Tags map[string]*string `json:"tags"` 5671} 5672 5673// MarshalJSON is the custom marshaler for Resource. 5674func (r Resource) MarshalJSON() ([]byte, error) { 5675 objectMap := make(map[string]interface{}) 5676 if r.ID != nil { 5677 objectMap["id"] = r.ID 5678 } 5679 if r.Location != nil { 5680 objectMap["location"] = r.Location 5681 } 5682 if r.Tags != nil { 5683 objectMap["tags"] = r.Tags 5684 } 5685 return json.Marshal(objectMap) 5686} 5687 5688// Route route resource 5689type Route struct { 5690 autorest.Response `json:"-"` 5691 *RoutePropertiesFormat `json:"properties,omitempty"` 5692 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 5693 Name *string `json:"name,omitempty"` 5694 // Etag - A unique read-only string that changes whenever the resource is updated 5695 Etag *string `json:"etag,omitempty"` 5696 // ID - Resource Id 5697 ID *string `json:"id,omitempty"` 5698} 5699 5700// MarshalJSON is the custom marshaler for Route. 5701func (r Route) MarshalJSON() ([]byte, error) { 5702 objectMap := make(map[string]interface{}) 5703 if r.RoutePropertiesFormat != nil { 5704 objectMap["properties"] = r.RoutePropertiesFormat 5705 } 5706 if r.Name != nil { 5707 objectMap["name"] = r.Name 5708 } 5709 if r.Etag != nil { 5710 objectMap["etag"] = r.Etag 5711 } 5712 if r.ID != nil { 5713 objectMap["id"] = r.ID 5714 } 5715 return json.Marshal(objectMap) 5716} 5717 5718// UnmarshalJSON is the custom unmarshaler for Route struct. 5719func (r *Route) UnmarshalJSON(body []byte) error { 5720 var m map[string]*json.RawMessage 5721 err := json.Unmarshal(body, &m) 5722 if err != nil { 5723 return err 5724 } 5725 for k, v := range m { 5726 switch k { 5727 case "properties": 5728 if v != nil { 5729 var routePropertiesFormat RoutePropertiesFormat 5730 err = json.Unmarshal(*v, &routePropertiesFormat) 5731 if err != nil { 5732 return err 5733 } 5734 r.RoutePropertiesFormat = &routePropertiesFormat 5735 } 5736 case "name": 5737 if v != nil { 5738 var name string 5739 err = json.Unmarshal(*v, &name) 5740 if err != nil { 5741 return err 5742 } 5743 r.Name = &name 5744 } 5745 case "etag": 5746 if v != nil { 5747 var etag string 5748 err = json.Unmarshal(*v, &etag) 5749 if err != nil { 5750 return err 5751 } 5752 r.Etag = &etag 5753 } 5754 case "id": 5755 if v != nil { 5756 var ID string 5757 err = json.Unmarshal(*v, &ID) 5758 if err != nil { 5759 return err 5760 } 5761 r.ID = &ID 5762 } 5763 } 5764 } 5765 5766 return nil 5767} 5768 5769// RouteListResult response for ListRoute Api service call 5770type RouteListResult struct { 5771 autorest.Response `json:"-"` 5772 // Value - Gets List of Routes in a resource group 5773 Value *[]Route `json:"value,omitempty"` 5774 // NextLink - Gets the URL to get the next set of results. 5775 NextLink *string `json:"nextLink,omitempty"` 5776} 5777 5778// RouteListResultIterator provides access to a complete listing of Route values. 5779type RouteListResultIterator struct { 5780 i int 5781 page RouteListResultPage 5782} 5783 5784// NextWithContext advances to the next value. If there was an error making 5785// the request the iterator does not advance and the error is returned. 5786func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) { 5787 if tracing.IsEnabled() { 5788 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext") 5789 defer func() { 5790 sc := -1 5791 if iter.Response().Response.Response != nil { 5792 sc = iter.Response().Response.Response.StatusCode 5793 } 5794 tracing.EndSpan(ctx, sc, err) 5795 }() 5796 } 5797 iter.i++ 5798 if iter.i < len(iter.page.Values()) { 5799 return nil 5800 } 5801 err = iter.page.NextWithContext(ctx) 5802 if err != nil { 5803 iter.i-- 5804 return err 5805 } 5806 iter.i = 0 5807 return nil 5808} 5809 5810// Next advances to the next value. If there was an error making 5811// the request the iterator does not advance and the error is returned. 5812// Deprecated: Use NextWithContext() instead. 5813func (iter *RouteListResultIterator) Next() error { 5814 return iter.NextWithContext(context.Background()) 5815} 5816 5817// NotDone returns true if the enumeration should be started or is not yet complete. 5818func (iter RouteListResultIterator) NotDone() bool { 5819 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5820} 5821 5822// Response returns the raw server response from the last page request. 5823func (iter RouteListResultIterator) Response() RouteListResult { 5824 return iter.page.Response() 5825} 5826 5827// Value returns the current value or a zero-initialized value if the 5828// iterator has advanced beyond the end of the collection. 5829func (iter RouteListResultIterator) Value() Route { 5830 if !iter.page.NotDone() { 5831 return Route{} 5832 } 5833 return iter.page.Values()[iter.i] 5834} 5835 5836// Creates a new instance of the RouteListResultIterator type. 5837func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator { 5838 return RouteListResultIterator{page: page} 5839} 5840 5841// IsEmpty returns true if the ListResult contains no values. 5842func (rlr RouteListResult) IsEmpty() bool { 5843 return rlr.Value == nil || len(*rlr.Value) == 0 5844} 5845 5846// hasNextLink returns true if the NextLink is not empty. 5847func (rlr RouteListResult) hasNextLink() bool { 5848 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 5849} 5850 5851// routeListResultPreparer prepares a request to retrieve the next set of results. 5852// It returns nil if no more results exist. 5853func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { 5854 if !rlr.hasNextLink() { 5855 return nil, nil 5856 } 5857 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5858 autorest.AsJSON(), 5859 autorest.AsGet(), 5860 autorest.WithBaseURL(to.String(rlr.NextLink))) 5861} 5862 5863// RouteListResultPage contains a page of Route values. 5864type RouteListResultPage struct { 5865 fn func(context.Context, RouteListResult) (RouteListResult, error) 5866 rlr RouteListResult 5867} 5868 5869// NextWithContext advances to the next page of values. If there was an error making 5870// the request the page does not advance and the error is returned. 5871func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) { 5872 if tracing.IsEnabled() { 5873 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext") 5874 defer func() { 5875 sc := -1 5876 if page.Response().Response.Response != nil { 5877 sc = page.Response().Response.Response.StatusCode 5878 } 5879 tracing.EndSpan(ctx, sc, err) 5880 }() 5881 } 5882 for { 5883 next, err := page.fn(ctx, page.rlr) 5884 if err != nil { 5885 return err 5886 } 5887 page.rlr = next 5888 if !next.hasNextLink() || !next.IsEmpty() { 5889 break 5890 } 5891 } 5892 return nil 5893} 5894 5895// Next advances to the next page of values. If there was an error making 5896// the request the page does not advance and the error is returned. 5897// Deprecated: Use NextWithContext() instead. 5898func (page *RouteListResultPage) Next() error { 5899 return page.NextWithContext(context.Background()) 5900} 5901 5902// NotDone returns true if the page enumeration should be started or is not yet complete. 5903func (page RouteListResultPage) NotDone() bool { 5904 return !page.rlr.IsEmpty() 5905} 5906 5907// Response returns the raw server response from the last page request. 5908func (page RouteListResultPage) Response() RouteListResult { 5909 return page.rlr 5910} 5911 5912// Values returns the slice of values for the current page or nil if there are no values. 5913func (page RouteListResultPage) Values() []Route { 5914 if page.rlr.IsEmpty() { 5915 return nil 5916 } 5917 return *page.rlr.Value 5918} 5919 5920// Creates a new instance of the RouteListResultPage type. 5921func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { 5922 return RouteListResultPage{ 5923 fn: getNextPage, 5924 rlr: cur, 5925 } 5926} 5927 5928// RoutePropertiesFormat route resource 5929type RoutePropertiesFormat struct { 5930 // AddressPrefix - Gets or sets the destination CIDR to which the route applies. 5931 AddressPrefix *string `json:"addressPrefix,omitempty"` 5932 // NextHopType - Gets or sets the type of Azure hop the packet should be sent to. Possible values include: 'RouteNextHopTypeVirtualNetworkGateway', 'RouteNextHopTypeVnetLocal', 'RouteNextHopTypeInternet', 'RouteNextHopTypeVirtualAppliance', 'RouteNextHopTypeNone' 5933 NextHopType RouteNextHopType `json:"nextHopType,omitempty"` 5934 // NextHopIPAddress - Gets or sets the IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. 5935 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` 5936 // ProvisioningState - Gets or sets Provisioning state of the resource Updating/Deleting/Failed 5937 ProvisioningState *string `json:"provisioningState,omitempty"` 5938} 5939 5940// RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5941// operation. 5942type RoutesCreateOrUpdateFuture struct { 5943 azure.FutureAPI 5944 // Result returns the result of the asynchronous operation. 5945 // If the operation has not completed it will return an error. 5946 Result func(RoutesClient) (Route, error) 5947} 5948 5949// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5950func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5951 var azFuture azure.Future 5952 if err := json.Unmarshal(body, &azFuture); err != nil { 5953 return err 5954 } 5955 future.FutureAPI = &azFuture 5956 future.Result = future.result 5957 return nil 5958} 5959 5960// result is the default implementation for RoutesCreateOrUpdateFuture.Result. 5961func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) { 5962 var done bool 5963 done, err = future.DoneWithContext(context.Background(), client) 5964 if err != nil { 5965 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5966 return 5967 } 5968 if !done { 5969 r.Response.Response = future.Response() 5970 err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") 5971 return 5972 } 5973 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5974 if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { 5975 r, err = client.CreateOrUpdateResponder(r.Response.Response) 5976 if err != nil { 5977 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", r.Response.Response, "Failure responding to request") 5978 } 5979 } 5980 return 5981} 5982 5983// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5984type RoutesDeleteFuture struct { 5985 azure.FutureAPI 5986 // Result returns the result of the asynchronous operation. 5987 // If the operation has not completed it will return an error. 5988 Result func(RoutesClient) (autorest.Response, error) 5989} 5990 5991// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5992func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error { 5993 var azFuture azure.Future 5994 if err := json.Unmarshal(body, &azFuture); err != nil { 5995 return err 5996 } 5997 future.FutureAPI = &azFuture 5998 future.Result = future.result 5999 return nil 6000} 6001 6002// result is the default implementation for RoutesDeleteFuture.Result. 6003func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) { 6004 var done bool 6005 done, err = future.DoneWithContext(context.Background(), client) 6006 if err != nil { 6007 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure") 6008 return 6009 } 6010 if !done { 6011 ar.Response = future.Response() 6012 err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") 6013 return 6014 } 6015 ar.Response = future.Response() 6016 return 6017} 6018 6019// RouteTable routeTable resource 6020type RouteTable struct { 6021 autorest.Response `json:"-"` 6022 *RouteTablePropertiesFormat `json:"properties,omitempty"` 6023 // Etag - Gets a unique read-only string that changes whenever the resource is updated 6024 Etag *string `json:"etag,omitempty"` 6025 // ID - Resource Id 6026 ID *string `json:"id,omitempty"` 6027 // Name - READ-ONLY; Resource name 6028 Name *string `json:"name,omitempty"` 6029 // Type - READ-ONLY; Resource type 6030 Type *string `json:"type,omitempty"` 6031 // Location - Resource location 6032 Location *string `json:"location,omitempty"` 6033 // Tags - Resource tags 6034 Tags map[string]*string `json:"tags"` 6035} 6036 6037// MarshalJSON is the custom marshaler for RouteTable. 6038func (rt RouteTable) MarshalJSON() ([]byte, error) { 6039 objectMap := make(map[string]interface{}) 6040 if rt.RouteTablePropertiesFormat != nil { 6041 objectMap["properties"] = rt.RouteTablePropertiesFormat 6042 } 6043 if rt.Etag != nil { 6044 objectMap["etag"] = rt.Etag 6045 } 6046 if rt.ID != nil { 6047 objectMap["id"] = rt.ID 6048 } 6049 if rt.Location != nil { 6050 objectMap["location"] = rt.Location 6051 } 6052 if rt.Tags != nil { 6053 objectMap["tags"] = rt.Tags 6054 } 6055 return json.Marshal(objectMap) 6056} 6057 6058// UnmarshalJSON is the custom unmarshaler for RouteTable struct. 6059func (rt *RouteTable) UnmarshalJSON(body []byte) error { 6060 var m map[string]*json.RawMessage 6061 err := json.Unmarshal(body, &m) 6062 if err != nil { 6063 return err 6064 } 6065 for k, v := range m { 6066 switch k { 6067 case "properties": 6068 if v != nil { 6069 var routeTablePropertiesFormat RouteTablePropertiesFormat 6070 err = json.Unmarshal(*v, &routeTablePropertiesFormat) 6071 if err != nil { 6072 return err 6073 } 6074 rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat 6075 } 6076 case "etag": 6077 if v != nil { 6078 var etag string 6079 err = json.Unmarshal(*v, &etag) 6080 if err != nil { 6081 return err 6082 } 6083 rt.Etag = &etag 6084 } 6085 case "id": 6086 if v != nil { 6087 var ID string 6088 err = json.Unmarshal(*v, &ID) 6089 if err != nil { 6090 return err 6091 } 6092 rt.ID = &ID 6093 } 6094 case "name": 6095 if v != nil { 6096 var name string 6097 err = json.Unmarshal(*v, &name) 6098 if err != nil { 6099 return err 6100 } 6101 rt.Name = &name 6102 } 6103 case "type": 6104 if v != nil { 6105 var typeVar string 6106 err = json.Unmarshal(*v, &typeVar) 6107 if err != nil { 6108 return err 6109 } 6110 rt.Type = &typeVar 6111 } 6112 case "location": 6113 if v != nil { 6114 var location string 6115 err = json.Unmarshal(*v, &location) 6116 if err != nil { 6117 return err 6118 } 6119 rt.Location = &location 6120 } 6121 case "tags": 6122 if v != nil { 6123 var tags map[string]*string 6124 err = json.Unmarshal(*v, &tags) 6125 if err != nil { 6126 return err 6127 } 6128 rt.Tags = tags 6129 } 6130 } 6131 } 6132 6133 return nil 6134} 6135 6136// RouteTableListResult response for ListRouteTable Api service call 6137type RouteTableListResult struct { 6138 autorest.Response `json:"-"` 6139 // Value - Gets List of RouteTables in a resource group 6140 Value *[]RouteTable `json:"value,omitempty"` 6141 // NextLink - Gets the URL to get the next set of results. 6142 NextLink *string `json:"nextLink,omitempty"` 6143} 6144 6145// RouteTableListResultIterator provides access to a complete listing of RouteTable values. 6146type RouteTableListResultIterator struct { 6147 i int 6148 page RouteTableListResultPage 6149} 6150 6151// NextWithContext advances to the next value. If there was an error making 6152// the request the iterator does not advance and the error is returned. 6153func (iter *RouteTableListResultIterator) NextWithContext(ctx context.Context) (err error) { 6154 if tracing.IsEnabled() { 6155 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultIterator.NextWithContext") 6156 defer func() { 6157 sc := -1 6158 if iter.Response().Response.Response != nil { 6159 sc = iter.Response().Response.Response.StatusCode 6160 } 6161 tracing.EndSpan(ctx, sc, err) 6162 }() 6163 } 6164 iter.i++ 6165 if iter.i < len(iter.page.Values()) { 6166 return nil 6167 } 6168 err = iter.page.NextWithContext(ctx) 6169 if err != nil { 6170 iter.i-- 6171 return err 6172 } 6173 iter.i = 0 6174 return nil 6175} 6176 6177// Next advances to the next value. If there was an error making 6178// the request the iterator does not advance and the error is returned. 6179// Deprecated: Use NextWithContext() instead. 6180func (iter *RouteTableListResultIterator) Next() error { 6181 return iter.NextWithContext(context.Background()) 6182} 6183 6184// NotDone returns true if the enumeration should be started or is not yet complete. 6185func (iter RouteTableListResultIterator) NotDone() bool { 6186 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6187} 6188 6189// Response returns the raw server response from the last page request. 6190func (iter RouteTableListResultIterator) Response() RouteTableListResult { 6191 return iter.page.Response() 6192} 6193 6194// Value returns the current value or a zero-initialized value if the 6195// iterator has advanced beyond the end of the collection. 6196func (iter RouteTableListResultIterator) Value() RouteTable { 6197 if !iter.page.NotDone() { 6198 return RouteTable{} 6199 } 6200 return iter.page.Values()[iter.i] 6201} 6202 6203// Creates a new instance of the RouteTableListResultIterator type. 6204func NewRouteTableListResultIterator(page RouteTableListResultPage) RouteTableListResultIterator { 6205 return RouteTableListResultIterator{page: page} 6206} 6207 6208// IsEmpty returns true if the ListResult contains no values. 6209func (rtlr RouteTableListResult) IsEmpty() bool { 6210 return rtlr.Value == nil || len(*rtlr.Value) == 0 6211} 6212 6213// hasNextLink returns true if the NextLink is not empty. 6214func (rtlr RouteTableListResult) hasNextLink() bool { 6215 return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0 6216} 6217 6218// routeTableListResultPreparer prepares a request to retrieve the next set of results. 6219// It returns nil if no more results exist. 6220func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) { 6221 if !rtlr.hasNextLink() { 6222 return nil, nil 6223 } 6224 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6225 autorest.AsJSON(), 6226 autorest.AsGet(), 6227 autorest.WithBaseURL(to.String(rtlr.NextLink))) 6228} 6229 6230// RouteTableListResultPage contains a page of RouteTable values. 6231type RouteTableListResultPage struct { 6232 fn func(context.Context, RouteTableListResult) (RouteTableListResult, error) 6233 rtlr RouteTableListResult 6234} 6235 6236// NextWithContext advances to the next page of values. If there was an error making 6237// the request the page does not advance and the error is returned. 6238func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err error) { 6239 if tracing.IsEnabled() { 6240 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultPage.NextWithContext") 6241 defer func() { 6242 sc := -1 6243 if page.Response().Response.Response != nil { 6244 sc = page.Response().Response.Response.StatusCode 6245 } 6246 tracing.EndSpan(ctx, sc, err) 6247 }() 6248 } 6249 for { 6250 next, err := page.fn(ctx, page.rtlr) 6251 if err != nil { 6252 return err 6253 } 6254 page.rtlr = next 6255 if !next.hasNextLink() || !next.IsEmpty() { 6256 break 6257 } 6258 } 6259 return nil 6260} 6261 6262// Next advances to the next page of values. If there was an error making 6263// the request the page does not advance and the error is returned. 6264// Deprecated: Use NextWithContext() instead. 6265func (page *RouteTableListResultPage) Next() error { 6266 return page.NextWithContext(context.Background()) 6267} 6268 6269// NotDone returns true if the page enumeration should be started or is not yet complete. 6270func (page RouteTableListResultPage) NotDone() bool { 6271 return !page.rtlr.IsEmpty() 6272} 6273 6274// Response returns the raw server response from the last page request. 6275func (page RouteTableListResultPage) Response() RouteTableListResult { 6276 return page.rtlr 6277} 6278 6279// Values returns the slice of values for the current page or nil if there are no values. 6280func (page RouteTableListResultPage) Values() []RouteTable { 6281 if page.rtlr.IsEmpty() { 6282 return nil 6283 } 6284 return *page.rtlr.Value 6285} 6286 6287// Creates a new instance of the RouteTableListResultPage type. 6288func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage { 6289 return RouteTableListResultPage{ 6290 fn: getNextPage, 6291 rtlr: cur, 6292 } 6293} 6294 6295// RouteTablePropertiesFormat route Table resource 6296type RouteTablePropertiesFormat struct { 6297 // Routes - Gets or sets Routes in a Route Table 6298 Routes *[]Route `json:"routes,omitempty"` 6299 // Subnets - Gets collection of references to subnets 6300 Subnets *[]Subnet `json:"subnets,omitempty"` 6301 // ProvisioningState - Gets or sets Provisioning state of the resource Updating/Deleting/Failed 6302 ProvisioningState *string `json:"provisioningState,omitempty"` 6303} 6304 6305// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6306// long-running operation. 6307type RouteTablesCreateOrUpdateFuture struct { 6308 azure.FutureAPI 6309 // Result returns the result of the asynchronous operation. 6310 // If the operation has not completed it will return an error. 6311 Result func(RouteTablesClient) (RouteTable, error) 6312} 6313 6314// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6315func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6316 var azFuture azure.Future 6317 if err := json.Unmarshal(body, &azFuture); err != nil { 6318 return err 6319 } 6320 future.FutureAPI = &azFuture 6321 future.Result = future.result 6322 return nil 6323} 6324 6325// result is the default implementation for RouteTablesCreateOrUpdateFuture.Result. 6326func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) { 6327 var done bool 6328 done, err = future.DoneWithContext(context.Background(), client) 6329 if err != nil { 6330 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6331 return 6332 } 6333 if !done { 6334 rt.Response.Response = future.Response() 6335 err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") 6336 return 6337 } 6338 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6339 if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { 6340 rt, err = client.CreateOrUpdateResponder(rt.Response.Response) 6341 if err != nil { 6342 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request") 6343 } 6344 } 6345 return 6346} 6347 6348// RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6349// operation. 6350type RouteTablesDeleteFuture struct { 6351 azure.FutureAPI 6352 // Result returns the result of the asynchronous operation. 6353 // If the operation has not completed it will return an error. 6354 Result func(RouteTablesClient) (autorest.Response, error) 6355} 6356 6357// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6358func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { 6359 var azFuture azure.Future 6360 if err := json.Unmarshal(body, &azFuture); err != nil { 6361 return err 6362 } 6363 future.FutureAPI = &azFuture 6364 future.Result = future.result 6365 return nil 6366} 6367 6368// result is the default implementation for RouteTablesDeleteFuture.Result. 6369func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) { 6370 var done bool 6371 done, err = future.DoneWithContext(context.Background(), client) 6372 if err != nil { 6373 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") 6374 return 6375 } 6376 if !done { 6377 ar.Response = future.Response() 6378 err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") 6379 return 6380 } 6381 ar.Response = future.Response() 6382 return 6383} 6384 6385// SecurityGroup networkSecurityGroup resource 6386type SecurityGroup struct { 6387 autorest.Response `json:"-"` 6388 *SecurityGroupPropertiesFormat `json:"properties,omitempty"` 6389 // Etag - Gets a unique read-only string that changes whenever the resource is updated 6390 Etag *string `json:"etag,omitempty"` 6391 // ID - Resource Id 6392 ID *string `json:"id,omitempty"` 6393 // Name - READ-ONLY; Resource name 6394 Name *string `json:"name,omitempty"` 6395 // Type - READ-ONLY; Resource type 6396 Type *string `json:"type,omitempty"` 6397 // Location - Resource location 6398 Location *string `json:"location,omitempty"` 6399 // Tags - Resource tags 6400 Tags map[string]*string `json:"tags"` 6401} 6402 6403// MarshalJSON is the custom marshaler for SecurityGroup. 6404func (sg SecurityGroup) MarshalJSON() ([]byte, error) { 6405 objectMap := make(map[string]interface{}) 6406 if sg.SecurityGroupPropertiesFormat != nil { 6407 objectMap["properties"] = sg.SecurityGroupPropertiesFormat 6408 } 6409 if sg.Etag != nil { 6410 objectMap["etag"] = sg.Etag 6411 } 6412 if sg.ID != nil { 6413 objectMap["id"] = sg.ID 6414 } 6415 if sg.Location != nil { 6416 objectMap["location"] = sg.Location 6417 } 6418 if sg.Tags != nil { 6419 objectMap["tags"] = sg.Tags 6420 } 6421 return json.Marshal(objectMap) 6422} 6423 6424// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. 6425func (sg *SecurityGroup) UnmarshalJSON(body []byte) error { 6426 var m map[string]*json.RawMessage 6427 err := json.Unmarshal(body, &m) 6428 if err != nil { 6429 return err 6430 } 6431 for k, v := range m { 6432 switch k { 6433 case "properties": 6434 if v != nil { 6435 var securityGroupPropertiesFormat SecurityGroupPropertiesFormat 6436 err = json.Unmarshal(*v, &securityGroupPropertiesFormat) 6437 if err != nil { 6438 return err 6439 } 6440 sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat 6441 } 6442 case "etag": 6443 if v != nil { 6444 var etag string 6445 err = json.Unmarshal(*v, &etag) 6446 if err != nil { 6447 return err 6448 } 6449 sg.Etag = &etag 6450 } 6451 case "id": 6452 if v != nil { 6453 var ID string 6454 err = json.Unmarshal(*v, &ID) 6455 if err != nil { 6456 return err 6457 } 6458 sg.ID = &ID 6459 } 6460 case "name": 6461 if v != nil { 6462 var name string 6463 err = json.Unmarshal(*v, &name) 6464 if err != nil { 6465 return err 6466 } 6467 sg.Name = &name 6468 } 6469 case "type": 6470 if v != nil { 6471 var typeVar string 6472 err = json.Unmarshal(*v, &typeVar) 6473 if err != nil { 6474 return err 6475 } 6476 sg.Type = &typeVar 6477 } 6478 case "location": 6479 if v != nil { 6480 var location string 6481 err = json.Unmarshal(*v, &location) 6482 if err != nil { 6483 return err 6484 } 6485 sg.Location = &location 6486 } 6487 case "tags": 6488 if v != nil { 6489 var tags map[string]*string 6490 err = json.Unmarshal(*v, &tags) 6491 if err != nil { 6492 return err 6493 } 6494 sg.Tags = tags 6495 } 6496 } 6497 } 6498 6499 return nil 6500} 6501 6502// SecurityGroupListResult response for ListNetworkSecurityGroups Api service call 6503type SecurityGroupListResult struct { 6504 autorest.Response `json:"-"` 6505 // Value - Gets List of NetworkSecurityGroups in a resource group 6506 Value *[]SecurityGroup `json:"value,omitempty"` 6507 // NextLink - Gets the URL to get the next set of results. 6508 NextLink *string `json:"nextLink,omitempty"` 6509} 6510 6511// SecurityGroupListResultIterator provides access to a complete listing of SecurityGroup values. 6512type SecurityGroupListResultIterator struct { 6513 i int 6514 page SecurityGroupListResultPage 6515} 6516 6517// NextWithContext advances to the next value. If there was an error making 6518// the request the iterator does not advance and the error is returned. 6519func (iter *SecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 6520 if tracing.IsEnabled() { 6521 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultIterator.NextWithContext") 6522 defer func() { 6523 sc := -1 6524 if iter.Response().Response.Response != nil { 6525 sc = iter.Response().Response.Response.StatusCode 6526 } 6527 tracing.EndSpan(ctx, sc, err) 6528 }() 6529 } 6530 iter.i++ 6531 if iter.i < len(iter.page.Values()) { 6532 return nil 6533 } 6534 err = iter.page.NextWithContext(ctx) 6535 if err != nil { 6536 iter.i-- 6537 return err 6538 } 6539 iter.i = 0 6540 return nil 6541} 6542 6543// Next advances to the next value. If there was an error making 6544// the request the iterator does not advance and the error is returned. 6545// Deprecated: Use NextWithContext() instead. 6546func (iter *SecurityGroupListResultIterator) Next() error { 6547 return iter.NextWithContext(context.Background()) 6548} 6549 6550// NotDone returns true if the enumeration should be started or is not yet complete. 6551func (iter SecurityGroupListResultIterator) NotDone() bool { 6552 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6553} 6554 6555// Response returns the raw server response from the last page request. 6556func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult { 6557 return iter.page.Response() 6558} 6559 6560// Value returns the current value or a zero-initialized value if the 6561// iterator has advanced beyond the end of the collection. 6562func (iter SecurityGroupListResultIterator) Value() SecurityGroup { 6563 if !iter.page.NotDone() { 6564 return SecurityGroup{} 6565 } 6566 return iter.page.Values()[iter.i] 6567} 6568 6569// Creates a new instance of the SecurityGroupListResultIterator type. 6570func NewSecurityGroupListResultIterator(page SecurityGroupListResultPage) SecurityGroupListResultIterator { 6571 return SecurityGroupListResultIterator{page: page} 6572} 6573 6574// IsEmpty returns true if the ListResult contains no values. 6575func (sglr SecurityGroupListResult) IsEmpty() bool { 6576 return sglr.Value == nil || len(*sglr.Value) == 0 6577} 6578 6579// hasNextLink returns true if the NextLink is not empty. 6580func (sglr SecurityGroupListResult) hasNextLink() bool { 6581 return sglr.NextLink != nil && len(*sglr.NextLink) != 0 6582} 6583 6584// securityGroupListResultPreparer prepares a request to retrieve the next set of results. 6585// It returns nil if no more results exist. 6586func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 6587 if !sglr.hasNextLink() { 6588 return nil, nil 6589 } 6590 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6591 autorest.AsJSON(), 6592 autorest.AsGet(), 6593 autorest.WithBaseURL(to.String(sglr.NextLink))) 6594} 6595 6596// SecurityGroupListResultPage contains a page of SecurityGroup values. 6597type SecurityGroupListResultPage struct { 6598 fn func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error) 6599 sglr SecurityGroupListResult 6600} 6601 6602// NextWithContext advances to the next page of values. If there was an error making 6603// the request the page does not advance and the error is returned. 6604func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 6605 if tracing.IsEnabled() { 6606 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultPage.NextWithContext") 6607 defer func() { 6608 sc := -1 6609 if page.Response().Response.Response != nil { 6610 sc = page.Response().Response.Response.StatusCode 6611 } 6612 tracing.EndSpan(ctx, sc, err) 6613 }() 6614 } 6615 for { 6616 next, err := page.fn(ctx, page.sglr) 6617 if err != nil { 6618 return err 6619 } 6620 page.sglr = next 6621 if !next.hasNextLink() || !next.IsEmpty() { 6622 break 6623 } 6624 } 6625 return nil 6626} 6627 6628// Next advances to the next page of values. If there was an error making 6629// the request the page does not advance and the error is returned. 6630// Deprecated: Use NextWithContext() instead. 6631func (page *SecurityGroupListResultPage) Next() error { 6632 return page.NextWithContext(context.Background()) 6633} 6634 6635// NotDone returns true if the page enumeration should be started or is not yet complete. 6636func (page SecurityGroupListResultPage) NotDone() bool { 6637 return !page.sglr.IsEmpty() 6638} 6639 6640// Response returns the raw server response from the last page request. 6641func (page SecurityGroupListResultPage) Response() SecurityGroupListResult { 6642 return page.sglr 6643} 6644 6645// Values returns the slice of values for the current page or nil if there are no values. 6646func (page SecurityGroupListResultPage) Values() []SecurityGroup { 6647 if page.sglr.IsEmpty() { 6648 return nil 6649 } 6650 return *page.sglr.Value 6651} 6652 6653// Creates a new instance of the SecurityGroupListResultPage type. 6654func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage { 6655 return SecurityGroupListResultPage{ 6656 fn: getNextPage, 6657 sglr: cur, 6658 } 6659} 6660 6661// SecurityGroupPropertiesFormat network Security Group resource 6662type SecurityGroupPropertiesFormat struct { 6663 // SecurityRules - Gets or sets Security rules of network security group 6664 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 6665 // DefaultSecurityRules - Gets or sets Default security rules of network security group 6666 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` 6667 // NetworkInterfaces - Gets collection of references to Network Interfaces 6668 NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` 6669 // Subnets - Gets collection of references to subnets 6670 Subnets *[]Subnet `json:"subnets,omitempty"` 6671 // ResourceGUID - Gets or sets resource GUID property of the network security group resource 6672 ResourceGUID *string `json:"resourceGuid,omitempty"` 6673 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 6674 ProvisioningState *string `json:"provisioningState,omitempty"` 6675} 6676 6677// SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6678// long-running operation. 6679type SecurityGroupsCreateOrUpdateFuture struct { 6680 azure.FutureAPI 6681 // Result returns the result of the asynchronous operation. 6682 // If the operation has not completed it will return an error. 6683 Result func(SecurityGroupsClient) (SecurityGroup, error) 6684} 6685 6686// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6687func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6688 var azFuture azure.Future 6689 if err := json.Unmarshal(body, &azFuture); err != nil { 6690 return err 6691 } 6692 future.FutureAPI = &azFuture 6693 future.Result = future.result 6694 return nil 6695} 6696 6697// result is the default implementation for SecurityGroupsCreateOrUpdateFuture.Result. 6698func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { 6699 var done bool 6700 done, err = future.DoneWithContext(context.Background(), client) 6701 if err != nil { 6702 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6703 return 6704 } 6705 if !done { 6706 sg.Response.Response = future.Response() 6707 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") 6708 return 6709 } 6710 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6711 if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { 6712 sg, err = client.CreateOrUpdateResponder(sg.Response.Response) 6713 if err != nil { 6714 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request") 6715 } 6716 } 6717 return 6718} 6719 6720// SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6721// operation. 6722type SecurityGroupsDeleteFuture struct { 6723 azure.FutureAPI 6724 // Result returns the result of the asynchronous operation. 6725 // If the operation has not completed it will return an error. 6726 Result func(SecurityGroupsClient) (autorest.Response, error) 6727} 6728 6729// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6730func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { 6731 var azFuture azure.Future 6732 if err := json.Unmarshal(body, &azFuture); err != nil { 6733 return err 6734 } 6735 future.FutureAPI = &azFuture 6736 future.Result = future.result 6737 return nil 6738} 6739 6740// result is the default implementation for SecurityGroupsDeleteFuture.Result. 6741func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) { 6742 var done bool 6743 done, err = future.DoneWithContext(context.Background(), client) 6744 if err != nil { 6745 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") 6746 return 6747 } 6748 if !done { 6749 ar.Response = future.Response() 6750 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") 6751 return 6752 } 6753 ar.Response = future.Response() 6754 return 6755} 6756 6757// SecurityRule network security rule 6758type SecurityRule struct { 6759 autorest.Response `json:"-"` 6760 *SecurityRulePropertiesFormat `json:"properties,omitempty"` 6761 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 6762 Name *string `json:"name,omitempty"` 6763 // Etag - A unique read-only string that changes whenever the resource is updated 6764 Etag *string `json:"etag,omitempty"` 6765 // ID - Resource Id 6766 ID *string `json:"id,omitempty"` 6767} 6768 6769// MarshalJSON is the custom marshaler for SecurityRule. 6770func (sr SecurityRule) MarshalJSON() ([]byte, error) { 6771 objectMap := make(map[string]interface{}) 6772 if sr.SecurityRulePropertiesFormat != nil { 6773 objectMap["properties"] = sr.SecurityRulePropertiesFormat 6774 } 6775 if sr.Name != nil { 6776 objectMap["name"] = sr.Name 6777 } 6778 if sr.Etag != nil { 6779 objectMap["etag"] = sr.Etag 6780 } 6781 if sr.ID != nil { 6782 objectMap["id"] = sr.ID 6783 } 6784 return json.Marshal(objectMap) 6785} 6786 6787// UnmarshalJSON is the custom unmarshaler for SecurityRule struct. 6788func (sr *SecurityRule) UnmarshalJSON(body []byte) error { 6789 var m map[string]*json.RawMessage 6790 err := json.Unmarshal(body, &m) 6791 if err != nil { 6792 return err 6793 } 6794 for k, v := range m { 6795 switch k { 6796 case "properties": 6797 if v != nil { 6798 var securityRulePropertiesFormat SecurityRulePropertiesFormat 6799 err = json.Unmarshal(*v, &securityRulePropertiesFormat) 6800 if err != nil { 6801 return err 6802 } 6803 sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat 6804 } 6805 case "name": 6806 if v != nil { 6807 var name string 6808 err = json.Unmarshal(*v, &name) 6809 if err != nil { 6810 return err 6811 } 6812 sr.Name = &name 6813 } 6814 case "etag": 6815 if v != nil { 6816 var etag string 6817 err = json.Unmarshal(*v, &etag) 6818 if err != nil { 6819 return err 6820 } 6821 sr.Etag = &etag 6822 } 6823 case "id": 6824 if v != nil { 6825 var ID string 6826 err = json.Unmarshal(*v, &ID) 6827 if err != nil { 6828 return err 6829 } 6830 sr.ID = &ID 6831 } 6832 } 6833 } 6834 6835 return nil 6836} 6837 6838// SecurityRuleListResult response for ListSecurityRule Api service callRetrieves all security rules that 6839// belongs to a network security group 6840type SecurityRuleListResult struct { 6841 autorest.Response `json:"-"` 6842 // Value - Gets security rules in a network security group 6843 Value *[]SecurityRule `json:"value,omitempty"` 6844 // NextLink - Gets the URL to get the next set of results. 6845 NextLink *string `json:"nextLink,omitempty"` 6846} 6847 6848// SecurityRuleListResultIterator provides access to a complete listing of SecurityRule values. 6849type SecurityRuleListResultIterator struct { 6850 i int 6851 page SecurityRuleListResultPage 6852} 6853 6854// NextWithContext advances to the next value. If there was an error making 6855// the request the iterator does not advance and the error is returned. 6856func (iter *SecurityRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 6857 if tracing.IsEnabled() { 6858 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultIterator.NextWithContext") 6859 defer func() { 6860 sc := -1 6861 if iter.Response().Response.Response != nil { 6862 sc = iter.Response().Response.Response.StatusCode 6863 } 6864 tracing.EndSpan(ctx, sc, err) 6865 }() 6866 } 6867 iter.i++ 6868 if iter.i < len(iter.page.Values()) { 6869 return nil 6870 } 6871 err = iter.page.NextWithContext(ctx) 6872 if err != nil { 6873 iter.i-- 6874 return err 6875 } 6876 iter.i = 0 6877 return nil 6878} 6879 6880// Next advances to the next value. If there was an error making 6881// the request the iterator does not advance and the error is returned. 6882// Deprecated: Use NextWithContext() instead. 6883func (iter *SecurityRuleListResultIterator) Next() error { 6884 return iter.NextWithContext(context.Background()) 6885} 6886 6887// NotDone returns true if the enumeration should be started or is not yet complete. 6888func (iter SecurityRuleListResultIterator) NotDone() bool { 6889 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6890} 6891 6892// Response returns the raw server response from the last page request. 6893func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult { 6894 return iter.page.Response() 6895} 6896 6897// Value returns the current value or a zero-initialized value if the 6898// iterator has advanced beyond the end of the collection. 6899func (iter SecurityRuleListResultIterator) Value() SecurityRule { 6900 if !iter.page.NotDone() { 6901 return SecurityRule{} 6902 } 6903 return iter.page.Values()[iter.i] 6904} 6905 6906// Creates a new instance of the SecurityRuleListResultIterator type. 6907func NewSecurityRuleListResultIterator(page SecurityRuleListResultPage) SecurityRuleListResultIterator { 6908 return SecurityRuleListResultIterator{page: page} 6909} 6910 6911// IsEmpty returns true if the ListResult contains no values. 6912func (srlr SecurityRuleListResult) IsEmpty() bool { 6913 return srlr.Value == nil || len(*srlr.Value) == 0 6914} 6915 6916// hasNextLink returns true if the NextLink is not empty. 6917func (srlr SecurityRuleListResult) hasNextLink() bool { 6918 return srlr.NextLink != nil && len(*srlr.NextLink) != 0 6919} 6920 6921// securityRuleListResultPreparer prepares a request to retrieve the next set of results. 6922// It returns nil if no more results exist. 6923func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) { 6924 if !srlr.hasNextLink() { 6925 return nil, nil 6926 } 6927 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6928 autorest.AsJSON(), 6929 autorest.AsGet(), 6930 autorest.WithBaseURL(to.String(srlr.NextLink))) 6931} 6932 6933// SecurityRuleListResultPage contains a page of SecurityRule values. 6934type SecurityRuleListResultPage struct { 6935 fn func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error) 6936 srlr SecurityRuleListResult 6937} 6938 6939// NextWithContext advances to the next page of values. If there was an error making 6940// the request the page does not advance and the error is returned. 6941func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (err error) { 6942 if tracing.IsEnabled() { 6943 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultPage.NextWithContext") 6944 defer func() { 6945 sc := -1 6946 if page.Response().Response.Response != nil { 6947 sc = page.Response().Response.Response.StatusCode 6948 } 6949 tracing.EndSpan(ctx, sc, err) 6950 }() 6951 } 6952 for { 6953 next, err := page.fn(ctx, page.srlr) 6954 if err != nil { 6955 return err 6956 } 6957 page.srlr = next 6958 if !next.hasNextLink() || !next.IsEmpty() { 6959 break 6960 } 6961 } 6962 return nil 6963} 6964 6965// Next advances to the next page of values. If there was an error making 6966// the request the page does not advance and the error is returned. 6967// Deprecated: Use NextWithContext() instead. 6968func (page *SecurityRuleListResultPage) Next() error { 6969 return page.NextWithContext(context.Background()) 6970} 6971 6972// NotDone returns true if the page enumeration should be started or is not yet complete. 6973func (page SecurityRuleListResultPage) NotDone() bool { 6974 return !page.srlr.IsEmpty() 6975} 6976 6977// Response returns the raw server response from the last page request. 6978func (page SecurityRuleListResultPage) Response() SecurityRuleListResult { 6979 return page.srlr 6980} 6981 6982// Values returns the slice of values for the current page or nil if there are no values. 6983func (page SecurityRuleListResultPage) Values() []SecurityRule { 6984 if page.srlr.IsEmpty() { 6985 return nil 6986 } 6987 return *page.srlr.Value 6988} 6989 6990// Creates a new instance of the SecurityRuleListResultPage type. 6991func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage { 6992 return SecurityRuleListResultPage{ 6993 fn: getNextPage, 6994 srlr: cur, 6995 } 6996} 6997 6998// SecurityRulePropertiesFormat ... 6999type SecurityRulePropertiesFormat struct { 7000 // Description - Gets or sets a description for this rule. Restricted to 140 chars. 7001 Description *string `json:"description,omitempty"` 7002 // Protocol - Gets or sets Network protocol this rule applies to. Can be Tcp, Udp or All(*). Possible values include: 'TCP', 'UDP', 'Asterisk' 7003 Protocol SecurityRuleProtocol `json:"protocol,omitempty"` 7004 // SourcePortRange - Gets or sets Source Port or Range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. 7005 SourcePortRange *string `json:"sourcePortRange,omitempty"` 7006 // DestinationPortRange - Gets or sets Destination Port or Range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. 7007 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 7008 // SourceAddressPrefix - Gets or sets source address prefix. 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. 7009 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 7010 // DestinationAddressPrefix - Gets or sets destination address prefix. 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. 7011 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 7012 // Access - Gets or sets network traffic is allowed or denied. Possible values are 'Allow' and 'Deny'. Possible values include: 'Allow', 'Deny' 7013 Access SecurityRuleAccess `json:"access,omitempty"` 7014 // Priority - Gets or sets 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. 7015 Priority *int32 `json:"priority,omitempty"` 7016 // Direction - Gets or sets the direction of the rule.InBound or Outbound. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values include: 'Inbound', 'Outbound' 7017 Direction SecurityRuleDirection `json:"direction,omitempty"` 7018 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 7019 ProvisioningState *string `json:"provisioningState,omitempty"` 7020} 7021 7022// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7023// long-running operation. 7024type SecurityRulesCreateOrUpdateFuture struct { 7025 azure.FutureAPI 7026 // Result returns the result of the asynchronous operation. 7027 // If the operation has not completed it will return an error. 7028 Result func(SecurityRulesClient) (SecurityRule, error) 7029} 7030 7031// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7032func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7033 var azFuture azure.Future 7034 if err := json.Unmarshal(body, &azFuture); err != nil { 7035 return err 7036 } 7037 future.FutureAPI = &azFuture 7038 future.Result = future.result 7039 return nil 7040} 7041 7042// result is the default implementation for SecurityRulesCreateOrUpdateFuture.Result. 7043func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) { 7044 var done bool 7045 done, err = future.DoneWithContext(context.Background(), client) 7046 if err != nil { 7047 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7048 return 7049 } 7050 if !done { 7051 sr.Response.Response = future.Response() 7052 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") 7053 return 7054 } 7055 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7056 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 7057 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 7058 if err != nil { 7059 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 7060 } 7061 } 7062 return 7063} 7064 7065// SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7066// operation. 7067type SecurityRulesDeleteFuture struct { 7068 azure.FutureAPI 7069 // Result returns the result of the asynchronous operation. 7070 // If the operation has not completed it will return an error. 7071 Result func(SecurityRulesClient) (autorest.Response, error) 7072} 7073 7074// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7075func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error { 7076 var azFuture azure.Future 7077 if err := json.Unmarshal(body, &azFuture); err != nil { 7078 return err 7079 } 7080 future.FutureAPI = &azFuture 7081 future.Result = future.result 7082 return nil 7083} 7084 7085// result is the default implementation for SecurityRulesDeleteFuture.Result. 7086func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) { 7087 var done bool 7088 done, err = future.DoneWithContext(context.Background(), client) 7089 if err != nil { 7090 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure") 7091 return 7092 } 7093 if !done { 7094 ar.Response = future.Response() 7095 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") 7096 return 7097 } 7098 ar.Response = future.Response() 7099 return 7100} 7101 7102// String ... 7103type String struct { 7104 autorest.Response `json:"-"` 7105 Value *string `json:"value,omitempty"` 7106} 7107 7108// Subnet subnet in a VirtualNetwork resource 7109type Subnet struct { 7110 autorest.Response `json:"-"` 7111 *SubnetPropertiesFormat `json:"properties,omitempty"` 7112 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 7113 Name *string `json:"name,omitempty"` 7114 // Etag - A unique read-only string that changes whenever the resource is updated 7115 Etag *string `json:"etag,omitempty"` 7116 // ID - Resource Id 7117 ID *string `json:"id,omitempty"` 7118} 7119 7120// MarshalJSON is the custom marshaler for Subnet. 7121func (s Subnet) MarshalJSON() ([]byte, error) { 7122 objectMap := make(map[string]interface{}) 7123 if s.SubnetPropertiesFormat != nil { 7124 objectMap["properties"] = s.SubnetPropertiesFormat 7125 } 7126 if s.Name != nil { 7127 objectMap["name"] = s.Name 7128 } 7129 if s.Etag != nil { 7130 objectMap["etag"] = s.Etag 7131 } 7132 if s.ID != nil { 7133 objectMap["id"] = s.ID 7134 } 7135 return json.Marshal(objectMap) 7136} 7137 7138// UnmarshalJSON is the custom unmarshaler for Subnet struct. 7139func (s *Subnet) UnmarshalJSON(body []byte) error { 7140 var m map[string]*json.RawMessage 7141 err := json.Unmarshal(body, &m) 7142 if err != nil { 7143 return err 7144 } 7145 for k, v := range m { 7146 switch k { 7147 case "properties": 7148 if v != nil { 7149 var subnetPropertiesFormat SubnetPropertiesFormat 7150 err = json.Unmarshal(*v, &subnetPropertiesFormat) 7151 if err != nil { 7152 return err 7153 } 7154 s.SubnetPropertiesFormat = &subnetPropertiesFormat 7155 } 7156 case "name": 7157 if v != nil { 7158 var name string 7159 err = json.Unmarshal(*v, &name) 7160 if err != nil { 7161 return err 7162 } 7163 s.Name = &name 7164 } 7165 case "etag": 7166 if v != nil { 7167 var etag string 7168 err = json.Unmarshal(*v, &etag) 7169 if err != nil { 7170 return err 7171 } 7172 s.Etag = &etag 7173 } 7174 case "id": 7175 if v != nil { 7176 var ID string 7177 err = json.Unmarshal(*v, &ID) 7178 if err != nil { 7179 return err 7180 } 7181 s.ID = &ID 7182 } 7183 } 7184 } 7185 7186 return nil 7187} 7188 7189// SubnetListResult response for ListSubnets Api service callRetrieves all subnet that belongs to a virtual 7190// network 7191type SubnetListResult struct { 7192 autorest.Response `json:"-"` 7193 // Value - Gets the subnets in a virtual network 7194 Value *[]Subnet `json:"value,omitempty"` 7195 // NextLink - Gets the URL to get the next set of results. 7196 NextLink *string `json:"nextLink,omitempty"` 7197} 7198 7199// SubnetListResultIterator provides access to a complete listing of Subnet values. 7200type SubnetListResultIterator struct { 7201 i int 7202 page SubnetListResultPage 7203} 7204 7205// NextWithContext advances to the next value. If there was an error making 7206// the request the iterator does not advance and the error is returned. 7207func (iter *SubnetListResultIterator) NextWithContext(ctx context.Context) (err error) { 7208 if tracing.IsEnabled() { 7209 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultIterator.NextWithContext") 7210 defer func() { 7211 sc := -1 7212 if iter.Response().Response.Response != nil { 7213 sc = iter.Response().Response.Response.StatusCode 7214 } 7215 tracing.EndSpan(ctx, sc, err) 7216 }() 7217 } 7218 iter.i++ 7219 if iter.i < len(iter.page.Values()) { 7220 return nil 7221 } 7222 err = iter.page.NextWithContext(ctx) 7223 if err != nil { 7224 iter.i-- 7225 return err 7226 } 7227 iter.i = 0 7228 return nil 7229} 7230 7231// Next advances to the next value. If there was an error making 7232// the request the iterator does not advance and the error is returned. 7233// Deprecated: Use NextWithContext() instead. 7234func (iter *SubnetListResultIterator) Next() error { 7235 return iter.NextWithContext(context.Background()) 7236} 7237 7238// NotDone returns true if the enumeration should be started or is not yet complete. 7239func (iter SubnetListResultIterator) NotDone() bool { 7240 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7241} 7242 7243// Response returns the raw server response from the last page request. 7244func (iter SubnetListResultIterator) Response() SubnetListResult { 7245 return iter.page.Response() 7246} 7247 7248// Value returns the current value or a zero-initialized value if the 7249// iterator has advanced beyond the end of the collection. 7250func (iter SubnetListResultIterator) Value() Subnet { 7251 if !iter.page.NotDone() { 7252 return Subnet{} 7253 } 7254 return iter.page.Values()[iter.i] 7255} 7256 7257// Creates a new instance of the SubnetListResultIterator type. 7258func NewSubnetListResultIterator(page SubnetListResultPage) SubnetListResultIterator { 7259 return SubnetListResultIterator{page: page} 7260} 7261 7262// IsEmpty returns true if the ListResult contains no values. 7263func (slr SubnetListResult) IsEmpty() bool { 7264 return slr.Value == nil || len(*slr.Value) == 0 7265} 7266 7267// hasNextLink returns true if the NextLink is not empty. 7268func (slr SubnetListResult) hasNextLink() bool { 7269 return slr.NextLink != nil && len(*slr.NextLink) != 0 7270} 7271 7272// subnetListResultPreparer prepares a request to retrieve the next set of results. 7273// It returns nil if no more results exist. 7274func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) { 7275 if !slr.hasNextLink() { 7276 return nil, nil 7277 } 7278 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7279 autorest.AsJSON(), 7280 autorest.AsGet(), 7281 autorest.WithBaseURL(to.String(slr.NextLink))) 7282} 7283 7284// SubnetListResultPage contains a page of Subnet values. 7285type SubnetListResultPage struct { 7286 fn func(context.Context, SubnetListResult) (SubnetListResult, error) 7287 slr SubnetListResult 7288} 7289 7290// NextWithContext advances to the next page of values. If there was an error making 7291// the request the page does not advance and the error is returned. 7292func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err error) { 7293 if tracing.IsEnabled() { 7294 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultPage.NextWithContext") 7295 defer func() { 7296 sc := -1 7297 if page.Response().Response.Response != nil { 7298 sc = page.Response().Response.Response.StatusCode 7299 } 7300 tracing.EndSpan(ctx, sc, err) 7301 }() 7302 } 7303 for { 7304 next, err := page.fn(ctx, page.slr) 7305 if err != nil { 7306 return err 7307 } 7308 page.slr = next 7309 if !next.hasNextLink() || !next.IsEmpty() { 7310 break 7311 } 7312 } 7313 return nil 7314} 7315 7316// Next advances to the next page of values. If there was an error making 7317// the request the page does not advance and the error is returned. 7318// Deprecated: Use NextWithContext() instead. 7319func (page *SubnetListResultPage) Next() error { 7320 return page.NextWithContext(context.Background()) 7321} 7322 7323// NotDone returns true if the page enumeration should be started or is not yet complete. 7324func (page SubnetListResultPage) NotDone() bool { 7325 return !page.slr.IsEmpty() 7326} 7327 7328// Response returns the raw server response from the last page request. 7329func (page SubnetListResultPage) Response() SubnetListResult { 7330 return page.slr 7331} 7332 7333// Values returns the slice of values for the current page or nil if there are no values. 7334func (page SubnetListResultPage) Values() []Subnet { 7335 if page.slr.IsEmpty() { 7336 return nil 7337 } 7338 return *page.slr.Value 7339} 7340 7341// Creates a new instance of the SubnetListResultPage type. 7342func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage { 7343 return SubnetListResultPage{ 7344 fn: getNextPage, 7345 slr: cur, 7346 } 7347} 7348 7349// SubnetPropertiesFormat ... 7350type SubnetPropertiesFormat struct { 7351 // AddressPrefix - Gets or sets Address prefix for the subnet. 7352 AddressPrefix *string `json:"addressPrefix,omitempty"` 7353 // NetworkSecurityGroup - Gets or sets the reference of the NetworkSecurityGroup resource 7354 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 7355 // RouteTable - Gets or sets the reference of the RouteTable resource 7356 RouteTable *RouteTable `json:"routeTable,omitempty"` 7357 // IPConfigurations - Gets array of references to the network interface IP configurations using subnet 7358 IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` 7359 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 7360 ProvisioningState *string `json:"provisioningState,omitempty"` 7361} 7362 7363// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7364// operation. 7365type SubnetsCreateOrUpdateFuture struct { 7366 azure.FutureAPI 7367 // Result returns the result of the asynchronous operation. 7368 // If the operation has not completed it will return an error. 7369 Result func(SubnetsClient) (Subnet, error) 7370} 7371 7372// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7373func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7374 var azFuture azure.Future 7375 if err := json.Unmarshal(body, &azFuture); err != nil { 7376 return err 7377 } 7378 future.FutureAPI = &azFuture 7379 future.Result = future.result 7380 return nil 7381} 7382 7383// result is the default implementation for SubnetsCreateOrUpdateFuture.Result. 7384func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) { 7385 var done bool 7386 done, err = future.DoneWithContext(context.Background(), client) 7387 if err != nil { 7388 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7389 return 7390 } 7391 if !done { 7392 s.Response.Response = future.Response() 7393 err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") 7394 return 7395 } 7396 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7397 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 7398 s, err = client.CreateOrUpdateResponder(s.Response.Response) 7399 if err != nil { 7400 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 7401 } 7402 } 7403 return 7404} 7405 7406// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7407// operation. 7408type SubnetsDeleteFuture struct { 7409 azure.FutureAPI 7410 // Result returns the result of the asynchronous operation. 7411 // If the operation has not completed it will return an error. 7412 Result func(SubnetsClient) (autorest.Response, error) 7413} 7414 7415// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7416func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error { 7417 var azFuture azure.Future 7418 if err := json.Unmarshal(body, &azFuture); err != nil { 7419 return err 7420 } 7421 future.FutureAPI = &azFuture 7422 future.Result = future.result 7423 return nil 7424} 7425 7426// result is the default implementation for SubnetsDeleteFuture.Result. 7427func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) { 7428 var done bool 7429 done, err = future.DoneWithContext(context.Background(), client) 7430 if err != nil { 7431 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure") 7432 return 7433 } 7434 if !done { 7435 ar.Response = future.Response() 7436 err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") 7437 return 7438 } 7439 ar.Response = future.Response() 7440 return 7441} 7442 7443// SubResource ... 7444type SubResource struct { 7445 // ID - Resource Id 7446 ID *string `json:"id,omitempty"` 7447} 7448 7449// Usage describes Network Resource Usage. 7450type Usage struct { 7451 // Unit - Gets or sets an enum describing the unit of measurement. 7452 Unit *string `json:"unit,omitempty"` 7453 // CurrentValue - Gets or sets the current value of the usage. 7454 CurrentValue *int64 `json:"currentValue,omitempty"` 7455 // Limit - Gets or sets the limit of usage. 7456 Limit *int64 `json:"limit,omitempty"` 7457 // Name - Gets or sets the name of the type of usage. 7458 Name *UsageName `json:"name,omitempty"` 7459} 7460 7461// UsageName the Usage Names. 7462type UsageName struct { 7463 // Value - Gets or sets a string describing the resource name. 7464 Value *string `json:"value,omitempty"` 7465 // LocalizedValue - Gets or sets a localized string describing the resource name. 7466 LocalizedValue *string `json:"localizedValue,omitempty"` 7467} 7468 7469// UsagesListResult the List Usages operation response. 7470type UsagesListResult struct { 7471 autorest.Response `json:"-"` 7472 // Value - Gets or sets the list Network Resource Usages. 7473 Value *[]Usage `json:"value,omitempty"` 7474} 7475 7476// VirtualNetwork virtual Network resource 7477type VirtualNetwork struct { 7478 autorest.Response `json:"-"` 7479 *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` 7480 // Etag - Gets a unique read-only string that changes whenever the resource is updated 7481 Etag *string `json:"etag,omitempty"` 7482 // ID - Resource Id 7483 ID *string `json:"id,omitempty"` 7484 // Name - READ-ONLY; Resource name 7485 Name *string `json:"name,omitempty"` 7486 // Type - READ-ONLY; Resource type 7487 Type *string `json:"type,omitempty"` 7488 // Location - Resource location 7489 Location *string `json:"location,omitempty"` 7490 // Tags - Resource tags 7491 Tags map[string]*string `json:"tags"` 7492} 7493 7494// MarshalJSON is the custom marshaler for VirtualNetwork. 7495func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { 7496 objectMap := make(map[string]interface{}) 7497 if vn.VirtualNetworkPropertiesFormat != nil { 7498 objectMap["properties"] = vn.VirtualNetworkPropertiesFormat 7499 } 7500 if vn.Etag != nil { 7501 objectMap["etag"] = vn.Etag 7502 } 7503 if vn.ID != nil { 7504 objectMap["id"] = vn.ID 7505 } 7506 if vn.Location != nil { 7507 objectMap["location"] = vn.Location 7508 } 7509 if vn.Tags != nil { 7510 objectMap["tags"] = vn.Tags 7511 } 7512 return json.Marshal(objectMap) 7513} 7514 7515// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. 7516func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { 7517 var m map[string]*json.RawMessage 7518 err := json.Unmarshal(body, &m) 7519 if err != nil { 7520 return err 7521 } 7522 for k, v := range m { 7523 switch k { 7524 case "properties": 7525 if v != nil { 7526 var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat 7527 err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat) 7528 if err != nil { 7529 return err 7530 } 7531 vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat 7532 } 7533 case "etag": 7534 if v != nil { 7535 var etag string 7536 err = json.Unmarshal(*v, &etag) 7537 if err != nil { 7538 return err 7539 } 7540 vn.Etag = &etag 7541 } 7542 case "id": 7543 if v != nil { 7544 var ID string 7545 err = json.Unmarshal(*v, &ID) 7546 if err != nil { 7547 return err 7548 } 7549 vn.ID = &ID 7550 } 7551 case "name": 7552 if v != nil { 7553 var name string 7554 err = json.Unmarshal(*v, &name) 7555 if err != nil { 7556 return err 7557 } 7558 vn.Name = &name 7559 } 7560 case "type": 7561 if v != nil { 7562 var typeVar string 7563 err = json.Unmarshal(*v, &typeVar) 7564 if err != nil { 7565 return err 7566 } 7567 vn.Type = &typeVar 7568 } 7569 case "location": 7570 if v != nil { 7571 var location string 7572 err = json.Unmarshal(*v, &location) 7573 if err != nil { 7574 return err 7575 } 7576 vn.Location = &location 7577 } 7578 case "tags": 7579 if v != nil { 7580 var tags map[string]*string 7581 err = json.Unmarshal(*v, &tags) 7582 if err != nil { 7583 return err 7584 } 7585 vn.Tags = tags 7586 } 7587 } 7588 } 7589 7590 return nil 7591} 7592 7593// VirtualNetworkGateway a common class for general resource information 7594type VirtualNetworkGateway struct { 7595 autorest.Response `json:"-"` 7596 *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 7597 // Etag - Gets a unique read-only string that changes whenever the resource is updated 7598 Etag *string `json:"etag,omitempty"` 7599 // ID - Resource Id 7600 ID *string `json:"id,omitempty"` 7601 // Name - READ-ONLY; Resource name 7602 Name *string `json:"name,omitempty"` 7603 // Type - READ-ONLY; Resource type 7604 Type *string `json:"type,omitempty"` 7605 // Location - Resource location 7606 Location *string `json:"location,omitempty"` 7607 // Tags - Resource tags 7608 Tags map[string]*string `json:"tags"` 7609} 7610 7611// MarshalJSON is the custom marshaler for VirtualNetworkGateway. 7612func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { 7613 objectMap := make(map[string]interface{}) 7614 if vng.VirtualNetworkGatewayPropertiesFormat != nil { 7615 objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat 7616 } 7617 if vng.Etag != nil { 7618 objectMap["etag"] = vng.Etag 7619 } 7620 if vng.ID != nil { 7621 objectMap["id"] = vng.ID 7622 } 7623 if vng.Location != nil { 7624 objectMap["location"] = vng.Location 7625 } 7626 if vng.Tags != nil { 7627 objectMap["tags"] = vng.Tags 7628 } 7629 return json.Marshal(objectMap) 7630} 7631 7632// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. 7633func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { 7634 var m map[string]*json.RawMessage 7635 err := json.Unmarshal(body, &m) 7636 if err != nil { 7637 return err 7638 } 7639 for k, v := range m { 7640 switch k { 7641 case "properties": 7642 if v != nil { 7643 var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat 7644 err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat) 7645 if err != nil { 7646 return err 7647 } 7648 vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat 7649 } 7650 case "etag": 7651 if v != nil { 7652 var etag string 7653 err = json.Unmarshal(*v, &etag) 7654 if err != nil { 7655 return err 7656 } 7657 vng.Etag = &etag 7658 } 7659 case "id": 7660 if v != nil { 7661 var ID string 7662 err = json.Unmarshal(*v, &ID) 7663 if err != nil { 7664 return err 7665 } 7666 vng.ID = &ID 7667 } 7668 case "name": 7669 if v != nil { 7670 var name string 7671 err = json.Unmarshal(*v, &name) 7672 if err != nil { 7673 return err 7674 } 7675 vng.Name = &name 7676 } 7677 case "type": 7678 if v != nil { 7679 var typeVar string 7680 err = json.Unmarshal(*v, &typeVar) 7681 if err != nil { 7682 return err 7683 } 7684 vng.Type = &typeVar 7685 } 7686 case "location": 7687 if v != nil { 7688 var location string 7689 err = json.Unmarshal(*v, &location) 7690 if err != nil { 7691 return err 7692 } 7693 vng.Location = &location 7694 } 7695 case "tags": 7696 if v != nil { 7697 var tags map[string]*string 7698 err = json.Unmarshal(*v, &tags) 7699 if err != nil { 7700 return err 7701 } 7702 vng.Tags = tags 7703 } 7704 } 7705 } 7706 7707 return nil 7708} 7709 7710// VirtualNetworkGatewayConnection a common class for general resource information 7711type VirtualNetworkGatewayConnection struct { 7712 autorest.Response `json:"-"` 7713 *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` 7714 // Etag - Gets a unique read-only string that changes whenever the resource is updated 7715 Etag *string `json:"etag,omitempty"` 7716 // ID - Resource Id 7717 ID *string `json:"id,omitempty"` 7718 // Name - READ-ONLY; Resource name 7719 Name *string `json:"name,omitempty"` 7720 // Type - READ-ONLY; Resource type 7721 Type *string `json:"type,omitempty"` 7722 // Location - Resource location 7723 Location *string `json:"location,omitempty"` 7724 // Tags - Resource tags 7725 Tags map[string]*string `json:"tags"` 7726} 7727 7728// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection. 7729func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { 7730 objectMap := make(map[string]interface{}) 7731 if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil { 7732 objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat 7733 } 7734 if vngc.Etag != nil { 7735 objectMap["etag"] = vngc.Etag 7736 } 7737 if vngc.ID != nil { 7738 objectMap["id"] = vngc.ID 7739 } 7740 if vngc.Location != nil { 7741 objectMap["location"] = vngc.Location 7742 } 7743 if vngc.Tags != nil { 7744 objectMap["tags"] = vngc.Tags 7745 } 7746 return json.Marshal(objectMap) 7747} 7748 7749// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. 7750func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { 7751 var m map[string]*json.RawMessage 7752 err := json.Unmarshal(body, &m) 7753 if err != nil { 7754 return err 7755 } 7756 for k, v := range m { 7757 switch k { 7758 case "properties": 7759 if v != nil { 7760 var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat 7761 err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat) 7762 if err != nil { 7763 return err 7764 } 7765 vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat 7766 } 7767 case "etag": 7768 if v != nil { 7769 var etag string 7770 err = json.Unmarshal(*v, &etag) 7771 if err != nil { 7772 return err 7773 } 7774 vngc.Etag = &etag 7775 } 7776 case "id": 7777 if v != nil { 7778 var ID string 7779 err = json.Unmarshal(*v, &ID) 7780 if err != nil { 7781 return err 7782 } 7783 vngc.ID = &ID 7784 } 7785 case "name": 7786 if v != nil { 7787 var name string 7788 err = json.Unmarshal(*v, &name) 7789 if err != nil { 7790 return err 7791 } 7792 vngc.Name = &name 7793 } 7794 case "type": 7795 if v != nil { 7796 var typeVar string 7797 err = json.Unmarshal(*v, &typeVar) 7798 if err != nil { 7799 return err 7800 } 7801 vngc.Type = &typeVar 7802 } 7803 case "location": 7804 if v != nil { 7805 var location string 7806 err = json.Unmarshal(*v, &location) 7807 if err != nil { 7808 return err 7809 } 7810 vngc.Location = &location 7811 } 7812 case "tags": 7813 if v != nil { 7814 var tags map[string]*string 7815 err = json.Unmarshal(*v, &tags) 7816 if err != nil { 7817 return err 7818 } 7819 vngc.Tags = tags 7820 } 7821 } 7822 } 7823 7824 return nil 7825} 7826 7827// VirtualNetworkGatewayConnectionListResult response for ListVirtualNetworkGatewayConnections Api service 7828// call 7829type VirtualNetworkGatewayConnectionListResult struct { 7830 autorest.Response `json:"-"` 7831 // Value - Gets List of VirtualNetworkGatewayConnections that exists in a resource group 7832 Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` 7833 // NextLink - Gets the URL to get the next set of results. 7834 NextLink *string `json:"nextLink,omitempty"` 7835} 7836 7837// VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of 7838// VirtualNetworkGatewayConnection values. 7839type VirtualNetworkGatewayConnectionListResultIterator struct { 7840 i int 7841 page VirtualNetworkGatewayConnectionListResultPage 7842} 7843 7844// NextWithContext advances to the next value. If there was an error making 7845// the request the iterator does not advance and the error is returned. 7846func (iter *VirtualNetworkGatewayConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 7847 if tracing.IsEnabled() { 7848 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultIterator.NextWithContext") 7849 defer func() { 7850 sc := -1 7851 if iter.Response().Response.Response != nil { 7852 sc = iter.Response().Response.Response.StatusCode 7853 } 7854 tracing.EndSpan(ctx, sc, err) 7855 }() 7856 } 7857 iter.i++ 7858 if iter.i < len(iter.page.Values()) { 7859 return nil 7860 } 7861 err = iter.page.NextWithContext(ctx) 7862 if err != nil { 7863 iter.i-- 7864 return err 7865 } 7866 iter.i = 0 7867 return nil 7868} 7869 7870// Next advances to the next value. If there was an error making 7871// the request the iterator does not advance and the error is returned. 7872// Deprecated: Use NextWithContext() instead. 7873func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error { 7874 return iter.NextWithContext(context.Background()) 7875} 7876 7877// NotDone returns true if the enumeration should be started or is not yet complete. 7878func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool { 7879 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7880} 7881 7882// Response returns the raw server response from the last page request. 7883func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult { 7884 return iter.page.Response() 7885} 7886 7887// Value returns the current value or a zero-initialized value if the 7888// iterator has advanced beyond the end of the collection. 7889func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection { 7890 if !iter.page.NotDone() { 7891 return VirtualNetworkGatewayConnection{} 7892 } 7893 return iter.page.Values()[iter.i] 7894} 7895 7896// Creates a new instance of the VirtualNetworkGatewayConnectionListResultIterator type. 7897func NewVirtualNetworkGatewayConnectionListResultIterator(page VirtualNetworkGatewayConnectionListResultPage) VirtualNetworkGatewayConnectionListResultIterator { 7898 return VirtualNetworkGatewayConnectionListResultIterator{page: page} 7899} 7900 7901// IsEmpty returns true if the ListResult contains no values. 7902func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { 7903 return vngclr.Value == nil || len(*vngclr.Value) == 0 7904} 7905 7906// hasNextLink returns true if the NextLink is not empty. 7907func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool { 7908 return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0 7909} 7910 7911// virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. 7912// It returns nil if no more results exist. 7913func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 7914 if !vngclr.hasNextLink() { 7915 return nil, nil 7916 } 7917 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7918 autorest.AsJSON(), 7919 autorest.AsGet(), 7920 autorest.WithBaseURL(to.String(vngclr.NextLink))) 7921} 7922 7923// VirtualNetworkGatewayConnectionListResultPage contains a page of VirtualNetworkGatewayConnection values. 7924type VirtualNetworkGatewayConnectionListResultPage struct { 7925 fn func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error) 7926 vngclr VirtualNetworkGatewayConnectionListResult 7927} 7928 7929// NextWithContext advances to the next page of values. If there was an error making 7930// the request the page does not advance and the error is returned. 7931func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 7932 if tracing.IsEnabled() { 7933 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultPage.NextWithContext") 7934 defer func() { 7935 sc := -1 7936 if page.Response().Response.Response != nil { 7937 sc = page.Response().Response.Response.StatusCode 7938 } 7939 tracing.EndSpan(ctx, sc, err) 7940 }() 7941 } 7942 for { 7943 next, err := page.fn(ctx, page.vngclr) 7944 if err != nil { 7945 return err 7946 } 7947 page.vngclr = next 7948 if !next.hasNextLink() || !next.IsEmpty() { 7949 break 7950 } 7951 } 7952 return nil 7953} 7954 7955// Next advances to the next page of values. If there was an error making 7956// the request the page does not advance and the error is returned. 7957// Deprecated: Use NextWithContext() instead. 7958func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error { 7959 return page.NextWithContext(context.Background()) 7960} 7961 7962// NotDone returns true if the page enumeration should be started or is not yet complete. 7963func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool { 7964 return !page.vngclr.IsEmpty() 7965} 7966 7967// Response returns the raw server response from the last page request. 7968func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult { 7969 return page.vngclr 7970} 7971 7972// Values returns the slice of values for the current page or nil if there are no values. 7973func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection { 7974 if page.vngclr.IsEmpty() { 7975 return nil 7976 } 7977 return *page.vngclr.Value 7978} 7979 7980// Creates a new instance of the VirtualNetworkGatewayConnectionListResultPage type. 7981func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage { 7982 return VirtualNetworkGatewayConnectionListResultPage{ 7983 fn: getNextPage, 7984 vngclr: cur, 7985 } 7986} 7987 7988// VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties 7989type VirtualNetworkGatewayConnectionPropertiesFormat struct { 7990 // AuthorizationKey - The authorizationKey. 7991 AuthorizationKey *string `json:"authorizationKey,omitempty"` 7992 VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` 7993 VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` 7994 LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` 7995 // ConnectionType - Gateway connection type IPsec/Dedicated/VpnClient/Vnet2Vnet. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' 7996 ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` 7997 // RoutingWeight - The Routing weight. 7998 RoutingWeight *int32 `json:"routingWeight,omitempty"` 7999 // SharedKey - The IPsec share key. 8000 SharedKey *string `json:"sharedKey,omitempty"` 8001 // ConnectionStatus - Virtual network Gateway connection status. Possible values include: 'Unknown', 'Connecting', 'Connected', 'NotConnected' 8002 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 8003 // EgressBytesTransferred - The Egress Bytes Transferred in this connection 8004 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 8005 // IngressBytesTransferred - The Ingress Bytes Transferred in this connection 8006 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 8007 // Peer - The reference to peerings resource. 8008 Peer *SubResource `json:"peer,omitempty"` 8009 // EnableBgp - EnableBgp Flag 8010 EnableBgp *bool `json:"enableBgp,omitempty"` 8011 // ResourceGUID - Gets or sets resource GUID property of the VirtualNetworkGatewayConnection resource 8012 ResourceGUID *string `json:"resourceGuid,omitempty"` 8013 // ProvisioningState - Gets or sets Provisioning state of the VirtualNetworkGatewayConnection resource Updating/Deleting/Failed 8014 ProvisioningState *string `json:"provisioningState,omitempty"` 8015} 8016 8017// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 8018// results of a long-running operation. 8019type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { 8020 azure.FutureAPI 8021 // Result returns the result of the asynchronous operation. 8022 // If the operation has not completed it will return an error. 8023 Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) 8024} 8025 8026// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8027func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8028 var azFuture azure.Future 8029 if err := json.Unmarshal(body, &azFuture); err != nil { 8030 return err 8031 } 8032 future.FutureAPI = &azFuture 8033 future.Result = future.result 8034 return nil 8035} 8036 8037// result is the default implementation for VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.Result. 8038func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { 8039 var done bool 8040 done, err = future.DoneWithContext(context.Background(), client) 8041 if err != nil { 8042 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8043 return 8044 } 8045 if !done { 8046 vngc.Response.Response = future.Response() 8047 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") 8048 return 8049 } 8050 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8051 if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { 8052 vngc, err = client.CreateOrUpdateResponder(vngc.Response.Response) 8053 if err != nil { 8054 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", vngc.Response.Response, "Failure responding to request") 8055 } 8056 } 8057 return 8058} 8059 8060// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of 8061// a long-running operation. 8062type VirtualNetworkGatewayConnectionsDeleteFuture struct { 8063 azure.FutureAPI 8064 // Result returns the result of the asynchronous operation. 8065 // If the operation has not completed it will return an error. 8066 Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) 8067} 8068 8069// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8070func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 8071 var azFuture azure.Future 8072 if err := json.Unmarshal(body, &azFuture); err != nil { 8073 return err 8074 } 8075 future.FutureAPI = &azFuture 8076 future.Result = future.result 8077 return nil 8078} 8079 8080// result is the default implementation for VirtualNetworkGatewayConnectionsDeleteFuture.Result. 8081func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { 8082 var done bool 8083 done, err = future.DoneWithContext(context.Background(), client) 8084 if err != nil { 8085 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 8086 return 8087 } 8088 if !done { 8089 ar.Response = future.Response() 8090 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") 8091 return 8092 } 8093 ar.Response = future.Response() 8094 return 8095} 8096 8097// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the 8098// results of a long-running operation. 8099type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { 8100 azure.FutureAPI 8101 // Result returns the result of the asynchronous operation. 8102 // If the operation has not completed it will return an error. 8103 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error) 8104} 8105 8106// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8107func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error { 8108 var azFuture azure.Future 8109 if err := json.Unmarshal(body, &azFuture); err != nil { 8110 return err 8111 } 8112 future.FutureAPI = &azFuture 8113 future.Result = future.result 8114 return nil 8115} 8116 8117// result is the default implementation for VirtualNetworkGatewayConnectionsResetSharedKeyFuture.Result. 8118func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { 8119 var done bool 8120 done, err = future.DoneWithContext(context.Background(), client) 8121 if err != nil { 8122 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure") 8123 return 8124 } 8125 if !done { 8126 crsk.Response.Response = future.Response() 8127 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") 8128 return 8129 } 8130 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8131 if crsk.Response.Response, err = future.GetResult(sender); err == nil && crsk.Response.Response.StatusCode != http.StatusNoContent { 8132 crsk, err = client.ResetSharedKeyResponder(crsk.Response.Response) 8133 if err != nil { 8134 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", crsk.Response.Response, "Failure responding to request") 8135 } 8136 } 8137 return 8138} 8139 8140// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the 8141// results of a long-running operation. 8142type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { 8143 azure.FutureAPI 8144 // Result returns the result of the asynchronous operation. 8145 // If the operation has not completed it will return an error. 8146 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error) 8147} 8148 8149// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8150func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error { 8151 var azFuture azure.Future 8152 if err := json.Unmarshal(body, &azFuture); err != nil { 8153 return err 8154 } 8155 future.FutureAPI = &azFuture 8156 future.Result = future.result 8157 return nil 8158} 8159 8160// result is the default implementation for VirtualNetworkGatewayConnectionsSetSharedKeyFuture.Result. 8161func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { 8162 var done bool 8163 done, err = future.DoneWithContext(context.Background(), client) 8164 if err != nil { 8165 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure") 8166 return 8167 } 8168 if !done { 8169 csk.Response.Response = future.Response() 8170 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") 8171 return 8172 } 8173 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8174 if csk.Response.Response, err = future.GetResult(sender); err == nil && csk.Response.Response.StatusCode != http.StatusNoContent { 8175 csk, err = client.SetSharedKeyResponder(csk.Response.Response) 8176 if err != nil { 8177 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", csk.Response.Response, "Failure responding to request") 8178 } 8179 } 8180 return 8181} 8182 8183// VirtualNetworkGatewayIPConfiguration ipConfiguration for Virtual network gateway 8184type VirtualNetworkGatewayIPConfiguration struct { 8185 *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 8186 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 8187 Name *string `json:"name,omitempty"` 8188 // Etag - A unique read-only string that changes whenever the resource is updated 8189 Etag *string `json:"etag,omitempty"` 8190 // ID - Resource Id 8191 ID *string `json:"id,omitempty"` 8192} 8193 8194// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration. 8195func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 8196 objectMap := make(map[string]interface{}) 8197 if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil { 8198 objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat 8199 } 8200 if vngic.Name != nil { 8201 objectMap["name"] = vngic.Name 8202 } 8203 if vngic.Etag != nil { 8204 objectMap["etag"] = vngic.Etag 8205 } 8206 if vngic.ID != nil { 8207 objectMap["id"] = vngic.ID 8208 } 8209 return json.Marshal(objectMap) 8210} 8211 8212// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. 8213func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 8214 var m map[string]*json.RawMessage 8215 err := json.Unmarshal(body, &m) 8216 if err != nil { 8217 return err 8218 } 8219 for k, v := range m { 8220 switch k { 8221 case "properties": 8222 if v != nil { 8223 var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat 8224 err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat) 8225 if err != nil { 8226 return err 8227 } 8228 vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat 8229 } 8230 case "name": 8231 if v != nil { 8232 var name string 8233 err = json.Unmarshal(*v, &name) 8234 if err != nil { 8235 return err 8236 } 8237 vngic.Name = &name 8238 } 8239 case "etag": 8240 if v != nil { 8241 var etag string 8242 err = json.Unmarshal(*v, &etag) 8243 if err != nil { 8244 return err 8245 } 8246 vngic.Etag = &etag 8247 } 8248 case "id": 8249 if v != nil { 8250 var ID string 8251 err = json.Unmarshal(*v, &ID) 8252 if err != nil { 8253 return err 8254 } 8255 vngic.ID = &ID 8256 } 8257 } 8258 } 8259 8260 return nil 8261} 8262 8263// VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration 8264type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { 8265 // PrivateIPAddress - Gets or sets the privateIPAddress of the IP Configuration 8266 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 8267 // PrivateIPAllocationMethod - Gets or sets PrivateIP allocation method (Static/Dynamic). Possible values include: 'Static', 'Dynamic' 8268 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 8269 // Subnet - Gets or sets the reference of the subnet resource 8270 Subnet *SubResource `json:"subnet,omitempty"` 8271 // PublicIPAddress - Gets or sets the reference of the PublicIP resource 8272 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 8273 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 8274 ProvisioningState *string `json:"provisioningState,omitempty"` 8275} 8276 8277// VirtualNetworkGatewayListResult response for ListVirtualNetworkGateways Api service call 8278type VirtualNetworkGatewayListResult struct { 8279 autorest.Response `json:"-"` 8280 // Value - Gets List of VirtualNetworkGateways that exists in a resource group 8281 Value *[]VirtualNetworkGateway `json:"value,omitempty"` 8282 // NextLink - Gets the URL to get the next set of results. 8283 NextLink *string `json:"nextLink,omitempty"` 8284} 8285 8286// VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway 8287// values. 8288type VirtualNetworkGatewayListResultIterator struct { 8289 i int 8290 page VirtualNetworkGatewayListResultPage 8291} 8292 8293// NextWithContext advances to the next value. If there was an error making 8294// the request the iterator does not advance and the error is returned. 8295func (iter *VirtualNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 8296 if tracing.IsEnabled() { 8297 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultIterator.NextWithContext") 8298 defer func() { 8299 sc := -1 8300 if iter.Response().Response.Response != nil { 8301 sc = iter.Response().Response.Response.StatusCode 8302 } 8303 tracing.EndSpan(ctx, sc, err) 8304 }() 8305 } 8306 iter.i++ 8307 if iter.i < len(iter.page.Values()) { 8308 return nil 8309 } 8310 err = iter.page.NextWithContext(ctx) 8311 if err != nil { 8312 iter.i-- 8313 return err 8314 } 8315 iter.i = 0 8316 return nil 8317} 8318 8319// Next advances to the next value. If there was an error making 8320// the request the iterator does not advance and the error is returned. 8321// Deprecated: Use NextWithContext() instead. 8322func (iter *VirtualNetworkGatewayListResultIterator) Next() error { 8323 return iter.NextWithContext(context.Background()) 8324} 8325 8326// NotDone returns true if the enumeration should be started or is not yet complete. 8327func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool { 8328 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8329} 8330 8331// Response returns the raw server response from the last page request. 8332func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult { 8333 return iter.page.Response() 8334} 8335 8336// Value returns the current value or a zero-initialized value if the 8337// iterator has advanced beyond the end of the collection. 8338func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway { 8339 if !iter.page.NotDone() { 8340 return VirtualNetworkGateway{} 8341 } 8342 return iter.page.Values()[iter.i] 8343} 8344 8345// Creates a new instance of the VirtualNetworkGatewayListResultIterator type. 8346func NewVirtualNetworkGatewayListResultIterator(page VirtualNetworkGatewayListResultPage) VirtualNetworkGatewayListResultIterator { 8347 return VirtualNetworkGatewayListResultIterator{page: page} 8348} 8349 8350// IsEmpty returns true if the ListResult contains no values. 8351func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { 8352 return vnglr.Value == nil || len(*vnglr.Value) == 0 8353} 8354 8355// hasNextLink returns true if the NextLink is not empty. 8356func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool { 8357 return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0 8358} 8359 8360// virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 8361// It returns nil if no more results exist. 8362func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 8363 if !vnglr.hasNextLink() { 8364 return nil, nil 8365 } 8366 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8367 autorest.AsJSON(), 8368 autorest.AsGet(), 8369 autorest.WithBaseURL(to.String(vnglr.NextLink))) 8370} 8371 8372// VirtualNetworkGatewayListResultPage contains a page of VirtualNetworkGateway values. 8373type VirtualNetworkGatewayListResultPage struct { 8374 fn func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error) 8375 vnglr VirtualNetworkGatewayListResult 8376} 8377 8378// NextWithContext advances to the next page of values. If there was an error making 8379// the request the page does not advance and the error is returned. 8380func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 8381 if tracing.IsEnabled() { 8382 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultPage.NextWithContext") 8383 defer func() { 8384 sc := -1 8385 if page.Response().Response.Response != nil { 8386 sc = page.Response().Response.Response.StatusCode 8387 } 8388 tracing.EndSpan(ctx, sc, err) 8389 }() 8390 } 8391 for { 8392 next, err := page.fn(ctx, page.vnglr) 8393 if err != nil { 8394 return err 8395 } 8396 page.vnglr = next 8397 if !next.hasNextLink() || !next.IsEmpty() { 8398 break 8399 } 8400 } 8401 return nil 8402} 8403 8404// Next advances to the next page of values. If there was an error making 8405// the request the page does not advance and the error is returned. 8406// Deprecated: Use NextWithContext() instead. 8407func (page *VirtualNetworkGatewayListResultPage) Next() error { 8408 return page.NextWithContext(context.Background()) 8409} 8410 8411// NotDone returns true if the page enumeration should be started or is not yet complete. 8412func (page VirtualNetworkGatewayListResultPage) NotDone() bool { 8413 return !page.vnglr.IsEmpty() 8414} 8415 8416// Response returns the raw server response from the last page request. 8417func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult { 8418 return page.vnglr 8419} 8420 8421// Values returns the slice of values for the current page or nil if there are no values. 8422func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway { 8423 if page.vnglr.IsEmpty() { 8424 return nil 8425 } 8426 return *page.vnglr.Value 8427} 8428 8429// Creates a new instance of the VirtualNetworkGatewayListResultPage type. 8430func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage { 8431 return VirtualNetworkGatewayListResultPage{ 8432 fn: getNextPage, 8433 vnglr: cur, 8434 } 8435} 8436 8437// VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties 8438type VirtualNetworkGatewayPropertiesFormat struct { 8439 // IPConfigurations - IpConfigurations for Virtual network gateway. 8440 IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` 8441 // GatewayType - The type of this virtual network gateway. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute' 8442 GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` 8443 // VpnType - The type of this virtual network gateway. Possible values include: 'PolicyBased', 'RouteBased' 8444 VpnType VpnType `json:"vpnType,omitempty"` 8445 // EnableBgp - EnableBgp Flag 8446 EnableBgp *bool `json:"enableBgp,omitempty"` 8447 // GatewayDefaultSite - Gets or sets 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. 8448 GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` 8449 // Sku - Gets or sets the reference of the VirtualNetworkGatewaySku resource which represents the sku selected for Virtual network gateway. 8450 Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` 8451 // VpnClientConfiguration - Gets or sets the reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. 8452 VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` 8453 // BgpSettings - Virtual network gateway's BGP speaker settings 8454 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 8455 // ResourceGUID - Gets or sets resource GUID property of the VirtualNetworkGateway resource 8456 ResourceGUID *string `json:"resourceGuid,omitempty"` 8457 // ProvisioningState - Gets or sets Provisioning state of the VirtualNetworkGateway resource Updating/Deleting/Failed 8458 ProvisioningState *string `json:"provisioningState,omitempty"` 8459} 8460 8461// VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 8462// long-running operation. 8463type VirtualNetworkGatewaysCreateOrUpdateFuture struct { 8464 azure.FutureAPI 8465 // Result returns the result of the asynchronous operation. 8466 // If the operation has not completed it will return an error. 8467 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) 8468} 8469 8470// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8471func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8472 var azFuture azure.Future 8473 if err := json.Unmarshal(body, &azFuture); err != nil { 8474 return err 8475 } 8476 future.FutureAPI = &azFuture 8477 future.Result = future.result 8478 return nil 8479} 8480 8481// result is the default implementation for VirtualNetworkGatewaysCreateOrUpdateFuture.Result. 8482func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 8483 var done bool 8484 done, err = future.DoneWithContext(context.Background(), client) 8485 if err != nil { 8486 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8487 return 8488 } 8489 if !done { 8490 vng.Response.Response = future.Response() 8491 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") 8492 return 8493 } 8494 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8495 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { 8496 vng, err = client.CreateOrUpdateResponder(vng.Response.Response) 8497 if err != nil { 8498 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", vng.Response.Response, "Failure responding to request") 8499 } 8500 } 8501 return 8502} 8503 8504// VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 8505// long-running operation. 8506type VirtualNetworkGatewaysDeleteFuture struct { 8507 azure.FutureAPI 8508 // Result returns the result of the asynchronous operation. 8509 // If the operation has not completed it will return an error. 8510 Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) 8511} 8512 8513// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8514func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 8515 var azFuture azure.Future 8516 if err := json.Unmarshal(body, &azFuture); err != nil { 8517 return err 8518 } 8519 future.FutureAPI = &azFuture 8520 future.Result = future.result 8521 return nil 8522} 8523 8524// result is the default implementation for VirtualNetworkGatewaysDeleteFuture.Result. 8525func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { 8526 var done bool 8527 done, err = future.DoneWithContext(context.Background(), client) 8528 if err != nil { 8529 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 8530 return 8531 } 8532 if !done { 8533 ar.Response = future.Response() 8534 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") 8535 return 8536 } 8537 ar.Response = future.Response() 8538 return 8539} 8540 8541// VirtualNetworkGatewaySku virtualNetworkGatewaySku details 8542type VirtualNetworkGatewaySku struct { 8543 // Name - Gateway sku name -Basic/HighPerformance/Standard. Possible values include: 'VirtualNetworkGatewaySkuNameBasic', 'VirtualNetworkGatewaySkuNameHighPerformance', 'VirtualNetworkGatewaySkuNameStandard' 8544 Name VirtualNetworkGatewaySkuName `json:"name,omitempty"` 8545 // Tier - Gateway sku tier -Basic/HighPerformance/Standard. Possible values include: 'VirtualNetworkGatewaySkuTierBasic', 'VirtualNetworkGatewaySkuTierHighPerformance', 'VirtualNetworkGatewaySkuTierStandard' 8546 Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` 8547 // Capacity - The capacity 8548 Capacity *int32 `json:"capacity,omitempty"` 8549} 8550 8551// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a 8552// long-running operation. 8553type VirtualNetworkGatewaysResetFuture struct { 8554 azure.FutureAPI 8555 // Result returns the result of the asynchronous operation. 8556 // If the operation has not completed it will return an error. 8557 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) 8558} 8559 8560// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8561func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error { 8562 var azFuture azure.Future 8563 if err := json.Unmarshal(body, &azFuture); err != nil { 8564 return err 8565 } 8566 future.FutureAPI = &azFuture 8567 future.Result = future.result 8568 return nil 8569} 8570 8571// result is the default implementation for VirtualNetworkGatewaysResetFuture.Result. 8572func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 8573 var done bool 8574 done, err = future.DoneWithContext(context.Background(), client) 8575 if err != nil { 8576 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure") 8577 return 8578 } 8579 if !done { 8580 vng.Response.Response = future.Response() 8581 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") 8582 return 8583 } 8584 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8585 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { 8586 vng, err = client.ResetResponder(vng.Response.Response) 8587 if err != nil { 8588 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", vng.Response.Response, "Failure responding to request") 8589 } 8590 } 8591 return 8592} 8593 8594// VirtualNetworkListResult response for ListVirtualNetworks Api service call 8595type VirtualNetworkListResult struct { 8596 autorest.Response `json:"-"` 8597 // Value - Gets list of VirtualNetworks in a resource group 8598 Value *[]VirtualNetwork `json:"value,omitempty"` 8599 // NextLink - Gets the URL to get the next set of results. 8600 NextLink *string `json:"nextLink,omitempty"` 8601} 8602 8603// VirtualNetworkListResultIterator provides access to a complete listing of VirtualNetwork values. 8604type VirtualNetworkListResultIterator struct { 8605 i int 8606 page VirtualNetworkListResultPage 8607} 8608 8609// NextWithContext advances to the next value. If there was an error making 8610// the request the iterator does not advance and the error is returned. 8611func (iter *VirtualNetworkListResultIterator) NextWithContext(ctx context.Context) (err error) { 8612 if tracing.IsEnabled() { 8613 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultIterator.NextWithContext") 8614 defer func() { 8615 sc := -1 8616 if iter.Response().Response.Response != nil { 8617 sc = iter.Response().Response.Response.StatusCode 8618 } 8619 tracing.EndSpan(ctx, sc, err) 8620 }() 8621 } 8622 iter.i++ 8623 if iter.i < len(iter.page.Values()) { 8624 return nil 8625 } 8626 err = iter.page.NextWithContext(ctx) 8627 if err != nil { 8628 iter.i-- 8629 return err 8630 } 8631 iter.i = 0 8632 return nil 8633} 8634 8635// Next advances to the next value. If there was an error making 8636// the request the iterator does not advance and the error is returned. 8637// Deprecated: Use NextWithContext() instead. 8638func (iter *VirtualNetworkListResultIterator) Next() error { 8639 return iter.NextWithContext(context.Background()) 8640} 8641 8642// NotDone returns true if the enumeration should be started or is not yet complete. 8643func (iter VirtualNetworkListResultIterator) NotDone() bool { 8644 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8645} 8646 8647// Response returns the raw server response from the last page request. 8648func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult { 8649 return iter.page.Response() 8650} 8651 8652// Value returns the current value or a zero-initialized value if the 8653// iterator has advanced beyond the end of the collection. 8654func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork { 8655 if !iter.page.NotDone() { 8656 return VirtualNetwork{} 8657 } 8658 return iter.page.Values()[iter.i] 8659} 8660 8661// Creates a new instance of the VirtualNetworkListResultIterator type. 8662func NewVirtualNetworkListResultIterator(page VirtualNetworkListResultPage) VirtualNetworkListResultIterator { 8663 return VirtualNetworkListResultIterator{page: page} 8664} 8665 8666// IsEmpty returns true if the ListResult contains no values. 8667func (vnlr VirtualNetworkListResult) IsEmpty() bool { 8668 return vnlr.Value == nil || len(*vnlr.Value) == 0 8669} 8670 8671// hasNextLink returns true if the NextLink is not empty. 8672func (vnlr VirtualNetworkListResult) hasNextLink() bool { 8673 return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0 8674} 8675 8676// virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. 8677// It returns nil if no more results exist. 8678func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) { 8679 if !vnlr.hasNextLink() { 8680 return nil, nil 8681 } 8682 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8683 autorest.AsJSON(), 8684 autorest.AsGet(), 8685 autorest.WithBaseURL(to.String(vnlr.NextLink))) 8686} 8687 8688// VirtualNetworkListResultPage contains a page of VirtualNetwork values. 8689type VirtualNetworkListResultPage struct { 8690 fn func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error) 8691 vnlr VirtualNetworkListResult 8692} 8693 8694// NextWithContext advances to the next page of values. If there was an error making 8695// the request the page does not advance and the error is returned. 8696func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) (err error) { 8697 if tracing.IsEnabled() { 8698 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultPage.NextWithContext") 8699 defer func() { 8700 sc := -1 8701 if page.Response().Response.Response != nil { 8702 sc = page.Response().Response.Response.StatusCode 8703 } 8704 tracing.EndSpan(ctx, sc, err) 8705 }() 8706 } 8707 for { 8708 next, err := page.fn(ctx, page.vnlr) 8709 if err != nil { 8710 return err 8711 } 8712 page.vnlr = next 8713 if !next.hasNextLink() || !next.IsEmpty() { 8714 break 8715 } 8716 } 8717 return nil 8718} 8719 8720// Next advances to the next page of values. If there was an error making 8721// the request the page does not advance and the error is returned. 8722// Deprecated: Use NextWithContext() instead. 8723func (page *VirtualNetworkListResultPage) Next() error { 8724 return page.NextWithContext(context.Background()) 8725} 8726 8727// NotDone returns true if the page enumeration should be started or is not yet complete. 8728func (page VirtualNetworkListResultPage) NotDone() bool { 8729 return !page.vnlr.IsEmpty() 8730} 8731 8732// Response returns the raw server response from the last page request. 8733func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult { 8734 return page.vnlr 8735} 8736 8737// Values returns the slice of values for the current page or nil if there are no values. 8738func (page VirtualNetworkListResultPage) Values() []VirtualNetwork { 8739 if page.vnlr.IsEmpty() { 8740 return nil 8741 } 8742 return *page.vnlr.Value 8743} 8744 8745// Creates a new instance of the VirtualNetworkListResultPage type. 8746func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage { 8747 return VirtualNetworkListResultPage{ 8748 fn: getNextPage, 8749 vnlr: cur, 8750 } 8751} 8752 8753// VirtualNetworkPropertiesFormat ... 8754type VirtualNetworkPropertiesFormat struct { 8755 // AddressSpace - Gets or sets AddressSpace that contains an array of IP address ranges that can be used by subnets 8756 AddressSpace *AddressSpace `json:"addressSpace,omitempty"` 8757 // DhcpOptions - Gets or sets DHCPOptions that contains an array of DNS servers available to VMs deployed in the virtual network 8758 DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` 8759 // Subnets - Gets or sets List of subnets in a VirtualNetwork 8760 Subnets *[]Subnet `json:"subnets,omitempty"` 8761 // ResourceGUID - Gets or sets resource GUID property of the VirtualNetwork resource 8762 ResourceGUID *string `json:"resourceGuid,omitempty"` 8763 // ProvisioningState - Gets or sets Provisioning state of the PublicIP resource Updating/Deleting/Failed 8764 ProvisioningState *string `json:"provisioningState,omitempty"` 8765} 8766 8767// VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 8768// long-running operation. 8769type VirtualNetworksCreateOrUpdateFuture struct { 8770 azure.FutureAPI 8771 // Result returns the result of the asynchronous operation. 8772 // If the operation has not completed it will return an error. 8773 Result func(VirtualNetworksClient) (VirtualNetwork, error) 8774} 8775 8776// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8777func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8778 var azFuture azure.Future 8779 if err := json.Unmarshal(body, &azFuture); err != nil { 8780 return err 8781 } 8782 future.FutureAPI = &azFuture 8783 future.Result = future.result 8784 return nil 8785} 8786 8787// result is the default implementation for VirtualNetworksCreateOrUpdateFuture.Result. 8788func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { 8789 var done bool 8790 done, err = future.DoneWithContext(context.Background(), client) 8791 if err != nil { 8792 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8793 return 8794 } 8795 if !done { 8796 vn.Response.Response = future.Response() 8797 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") 8798 return 8799 } 8800 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8801 if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent { 8802 vn, err = client.CreateOrUpdateResponder(vn.Response.Response) 8803 if err != nil { 8804 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request") 8805 } 8806 } 8807 return 8808} 8809 8810// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8811// operation. 8812type VirtualNetworksDeleteFuture struct { 8813 azure.FutureAPI 8814 // Result returns the result of the asynchronous operation. 8815 // If the operation has not completed it will return an error. 8816 Result func(VirtualNetworksClient) (autorest.Response, error) 8817} 8818 8819// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8820func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error { 8821 var azFuture azure.Future 8822 if err := json.Unmarshal(body, &azFuture); err != nil { 8823 return err 8824 } 8825 future.FutureAPI = &azFuture 8826 future.Result = future.result 8827 return nil 8828} 8829 8830// result is the default implementation for VirtualNetworksDeleteFuture.Result. 8831func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) { 8832 var done bool 8833 done, err = future.DoneWithContext(context.Background(), client) 8834 if err != nil { 8835 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure") 8836 return 8837 } 8838 if !done { 8839 ar.Response = future.Response() 8840 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") 8841 return 8842 } 8843 ar.Response = future.Response() 8844 return 8845} 8846 8847// VpnClientConfiguration vpnClientConfiguration for P2S client 8848type VpnClientConfiguration struct { 8849 // VpnClientAddressPool - Gets or sets the reference of the Address space resource which represents Address space for P2S VpnClient. 8850 VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` 8851 // VpnClientRootCertificates - VpnClientRootCertificate for Virtual network gateway. 8852 VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` 8853 // VpnClientRevokedCertificates - VpnClientRevokedCertificate for Virtual network gateway. 8854 VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` 8855} 8856 8857// VpnClientParameters vpnClientParameters 8858type VpnClientParameters struct { 8859 // ProcessorArchitecture - VPN client Processor Architecture -Amd64/X86. Possible values include: 'Amd64', 'X86' 8860 ProcessorArchitecture ProcessorArchitecture `json:"ProcessorArchitecture,omitempty"` 8861} 8862 8863// VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway 8864type VpnClientRevokedCertificate struct { 8865 *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` 8866 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 8867 Name *string `json:"name,omitempty"` 8868 // Etag - A unique read-only string that changes whenever the resource is updated 8869 Etag *string `json:"etag,omitempty"` 8870 // ID - Resource Id 8871 ID *string `json:"id,omitempty"` 8872} 8873 8874// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate. 8875func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) { 8876 objectMap := make(map[string]interface{}) 8877 if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil { 8878 objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat 8879 } 8880 if vcrc.Name != nil { 8881 objectMap["name"] = vcrc.Name 8882 } 8883 if vcrc.Etag != nil { 8884 objectMap["etag"] = vcrc.Etag 8885 } 8886 if vcrc.ID != nil { 8887 objectMap["id"] = vcrc.ID 8888 } 8889 return json.Marshal(objectMap) 8890} 8891 8892// UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. 8893func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { 8894 var m map[string]*json.RawMessage 8895 err := json.Unmarshal(body, &m) 8896 if err != nil { 8897 return err 8898 } 8899 for k, v := range m { 8900 switch k { 8901 case "properties": 8902 if v != nil { 8903 var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat 8904 err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat) 8905 if err != nil { 8906 return err 8907 } 8908 vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat 8909 } 8910 case "name": 8911 if v != nil { 8912 var name string 8913 err = json.Unmarshal(*v, &name) 8914 if err != nil { 8915 return err 8916 } 8917 vcrc.Name = &name 8918 } 8919 case "etag": 8920 if v != nil { 8921 var etag string 8922 err = json.Unmarshal(*v, &etag) 8923 if err != nil { 8924 return err 8925 } 8926 vcrc.Etag = &etag 8927 } 8928 case "id": 8929 if v != nil { 8930 var ID string 8931 err = json.Unmarshal(*v, &ID) 8932 if err != nil { 8933 return err 8934 } 8935 vcrc.ID = &ID 8936 } 8937 } 8938 } 8939 8940 return nil 8941} 8942 8943// VpnClientRevokedCertificatePropertiesFormat properties of the revoked VPN client certificate of virtual 8944// network gateway 8945type VpnClientRevokedCertificatePropertiesFormat struct { 8946 // Thumbprint - Gets or sets the revoked Vpn client certificate thumbprint 8947 Thumbprint *string `json:"thumbprint,omitempty"` 8948 // ProvisioningState - Gets or sets Provisioning state of the VPN client revoked certificate resource Updating/Deleting/Failed 8949 ProvisioningState *string `json:"provisioningState,omitempty"` 8950} 8951 8952// VpnClientRootCertificate VPN client root certificate of virtual network gateway 8953type VpnClientRootCertificate struct { 8954 *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` 8955 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource 8956 Name *string `json:"name,omitempty"` 8957 // Etag - A unique read-only string that changes whenever the resource is updated 8958 Etag *string `json:"etag,omitempty"` 8959 // ID - Resource Id 8960 ID *string `json:"id,omitempty"` 8961} 8962 8963// MarshalJSON is the custom marshaler for VpnClientRootCertificate. 8964func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) { 8965 objectMap := make(map[string]interface{}) 8966 if vcrc.VpnClientRootCertificatePropertiesFormat != nil { 8967 objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat 8968 } 8969 if vcrc.Name != nil { 8970 objectMap["name"] = vcrc.Name 8971 } 8972 if vcrc.Etag != nil { 8973 objectMap["etag"] = vcrc.Etag 8974 } 8975 if vcrc.ID != nil { 8976 objectMap["id"] = vcrc.ID 8977 } 8978 return json.Marshal(objectMap) 8979} 8980 8981// UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. 8982func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { 8983 var m map[string]*json.RawMessage 8984 err := json.Unmarshal(body, &m) 8985 if err != nil { 8986 return err 8987 } 8988 for k, v := range m { 8989 switch k { 8990 case "properties": 8991 if v != nil { 8992 var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat 8993 err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat) 8994 if err != nil { 8995 return err 8996 } 8997 vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat 8998 } 8999 case "name": 9000 if v != nil { 9001 var name string 9002 err = json.Unmarshal(*v, &name) 9003 if err != nil { 9004 return err 9005 } 9006 vcrc.Name = &name 9007 } 9008 case "etag": 9009 if v != nil { 9010 var etag string 9011 err = json.Unmarshal(*v, &etag) 9012 if err != nil { 9013 return err 9014 } 9015 vcrc.Etag = &etag 9016 } 9017 case "id": 9018 if v != nil { 9019 var ID string 9020 err = json.Unmarshal(*v, &ID) 9021 if err != nil { 9022 return err 9023 } 9024 vcrc.ID = &ID 9025 } 9026 } 9027 } 9028 9029 return nil 9030} 9031 9032// VpnClientRootCertificatePropertiesFormat properties of SSL certificates of application gateway 9033type VpnClientRootCertificatePropertiesFormat struct { 9034 // PublicCertData - Gets or sets the certificate public data 9035 PublicCertData *string `json:"publicCertData,omitempty"` 9036 // ProvisioningState - Gets or sets Provisioning state of the VPN client root certificate resource Updating/Deleting/Failed 9037 ProvisioningState *string `json:"provisioningState,omitempty"` 9038} 9039