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