1package network 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-09-01/network" 22 23// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the 24// virtual network. 25type AddressSpace struct { 26 // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. 27 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` 28} 29 30// ApplicationGateway application gateway resource 31type ApplicationGateway struct { 32 autorest.Response `json:"-"` 33 *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` 34 // Etag - A unique read-only string that changes whenever the resource is updated. 35 Etag *string `json:"etag,omitempty"` 36 // ID - Resource ID. 37 ID *string `json:"id,omitempty"` 38 // Name - READ-ONLY; Resource name. 39 Name *string `json:"name,omitempty"` 40 // Type - READ-ONLY; Resource type. 41 Type *string `json:"type,omitempty"` 42 // Location - Resource location. 43 Location *string `json:"location,omitempty"` 44 // Tags - Resource tags. 45 Tags map[string]*string `json:"tags"` 46} 47 48// MarshalJSON is the custom marshaler for ApplicationGateway. 49func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { 50 objectMap := make(map[string]interface{}) 51 if ag.ApplicationGatewayPropertiesFormat != nil { 52 objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat 53 } 54 if ag.Etag != nil { 55 objectMap["etag"] = ag.Etag 56 } 57 if ag.ID != nil { 58 objectMap["id"] = ag.ID 59 } 60 if ag.Location != nil { 61 objectMap["location"] = ag.Location 62 } 63 if ag.Tags != nil { 64 objectMap["tags"] = ag.Tags 65 } 66 return json.Marshal(objectMap) 67} 68 69// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. 70func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { 71 var m map[string]*json.RawMessage 72 err := json.Unmarshal(body, &m) 73 if err != nil { 74 return err 75 } 76 for k, v := range m { 77 switch k { 78 case "properties": 79 if v != nil { 80 var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat 81 err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) 82 if err != nil { 83 return err 84 } 85 ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat 86 } 87 case "etag": 88 if v != nil { 89 var etag string 90 err = json.Unmarshal(*v, &etag) 91 if err != nil { 92 return err 93 } 94 ag.Etag = &etag 95 } 96 case "id": 97 if v != nil { 98 var ID string 99 err = json.Unmarshal(*v, &ID) 100 if err != nil { 101 return err 102 } 103 ag.ID = &ID 104 } 105 case "name": 106 if v != nil { 107 var name string 108 err = json.Unmarshal(*v, &name) 109 if err != nil { 110 return err 111 } 112 ag.Name = &name 113 } 114 case "type": 115 if v != nil { 116 var typeVar string 117 err = json.Unmarshal(*v, &typeVar) 118 if err != nil { 119 return err 120 } 121 ag.Type = &typeVar 122 } 123 case "location": 124 if v != nil { 125 var location string 126 err = json.Unmarshal(*v, &location) 127 if err != nil { 128 return err 129 } 130 ag.Location = &location 131 } 132 case "tags": 133 if v != nil { 134 var tags map[string]*string 135 err = json.Unmarshal(*v, &tags) 136 if err != nil { 137 return err 138 } 139 ag.Tags = tags 140 } 141 } 142 } 143 144 return nil 145} 146 147// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. 148type ApplicationGatewayAuthenticationCertificate struct { 149 *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` 150 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 151 Name *string `json:"name,omitempty"` 152 // Etag - A unique read-only string that changes whenever the resource is updated. 153 Etag *string `json:"etag,omitempty"` 154 // ID - Resource ID. 155 ID *string `json:"id,omitempty"` 156} 157 158// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. 159func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { 160 objectMap := make(map[string]interface{}) 161 if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { 162 objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat 163 } 164 if agac.Name != nil { 165 objectMap["name"] = agac.Name 166 } 167 if agac.Etag != nil { 168 objectMap["etag"] = agac.Etag 169 } 170 if agac.ID != nil { 171 objectMap["id"] = agac.ID 172 } 173 return json.Marshal(objectMap) 174} 175 176// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. 177func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error { 178 var m map[string]*json.RawMessage 179 err := json.Unmarshal(body, &m) 180 if err != nil { 181 return err 182 } 183 for k, v := range m { 184 switch k { 185 case "properties": 186 if v != nil { 187 var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat 188 err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) 189 if err != nil { 190 return err 191 } 192 agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat 193 } 194 case "name": 195 if v != nil { 196 var name string 197 err = json.Unmarshal(*v, &name) 198 if err != nil { 199 return err 200 } 201 agac.Name = &name 202 } 203 case "etag": 204 if v != nil { 205 var etag string 206 err = json.Unmarshal(*v, &etag) 207 if err != nil { 208 return err 209 } 210 agac.Etag = &etag 211 } 212 case "id": 213 if v != nil { 214 var ID string 215 err = json.Unmarshal(*v, &ID) 216 if err != nil { 217 return err 218 } 219 agac.ID = &ID 220 } 221 } 222 } 223 224 return nil 225} 226 227// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an 228// application gateway. 229type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { 230 // Data - Certificate public data. 231 Data *string `json:"data,omitempty"` 232 // ProvisioningState - Provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 233 ProvisioningState *string `json:"provisioningState,omitempty"` 234} 235 236// ApplicationGatewayBackendAddress backend address of an application gateway. 237type ApplicationGatewayBackendAddress struct { 238 // Fqdn - Fully qualified domain name (FQDN). 239 Fqdn *string `json:"fqdn,omitempty"` 240 // IPAddress - IP address 241 IPAddress *string `json:"ipAddress,omitempty"` 242} 243 244// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. 245type ApplicationGatewayBackendAddressPool struct { 246 *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 247 // Name - Resource that is unique within a resource group. This name can be used to access the resource. 248 Name *string `json:"name,omitempty"` 249 // Etag - A unique read-only string that changes whenever the resource is updated. 250 Etag *string `json:"etag,omitempty"` 251 // ID - Resource ID. 252 ID *string `json:"id,omitempty"` 253} 254 255// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. 256func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { 257 objectMap := make(map[string]interface{}) 258 if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { 259 objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat 260 } 261 if agbap.Name != nil { 262 objectMap["name"] = agbap.Name 263 } 264 if agbap.Etag != nil { 265 objectMap["etag"] = agbap.Etag 266 } 267 if agbap.ID != nil { 268 objectMap["id"] = agbap.ID 269 } 270 return json.Marshal(objectMap) 271} 272 273// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. 274func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { 275 var m map[string]*json.RawMessage 276 err := json.Unmarshal(body, &m) 277 if err != nil { 278 return err 279 } 280 for k, v := range m { 281 switch k { 282 case "properties": 283 if v != nil { 284 var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat 285 err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) 286 if err != nil { 287 return err 288 } 289 agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat 290 } 291 case "name": 292 if v != nil { 293 var name string 294 err = json.Unmarshal(*v, &name) 295 if err != nil { 296 return err 297 } 298 agbap.Name = &name 299 } 300 case "etag": 301 if v != nil { 302 var etag string 303 err = json.Unmarshal(*v, &etag) 304 if err != nil { 305 return err 306 } 307 agbap.Etag = &etag 308 } 309 case "id": 310 if v != nil { 311 var ID string 312 err = json.Unmarshal(*v, &ID) 313 if err != nil { 314 return err 315 } 316 agbap.ID = &ID 317 } 318 } 319 } 320 321 return nil 322} 323 324// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an 325// application gateway. 326type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { 327 // BackendIPConfigurations - Collection of references to IPs defined in network interfaces. 328 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 329 // BackendAddresses - Backend addresses 330 BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` 331 // ProvisioningState - Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 332 ProvisioningState *string `json:"provisioningState,omitempty"` 333} 334 335// ApplicationGatewayBackendHealth list of ApplicationGatewayBackendHealthPool resources. 336type ApplicationGatewayBackendHealth struct { 337 autorest.Response `json:"-"` 338 BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` 339} 340 341// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings. 342type ApplicationGatewayBackendHealthHTTPSettings struct { 343 // BackendHTTPSettings - Reference of an ApplicationGatewayBackendHttpSettings resource. 344 BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` 345 // Servers - List of ApplicationGatewayBackendHealthServer resources. 346 Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` 347} 348 349// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool. 350type ApplicationGatewayBackendHealthPool struct { 351 // BackendAddressPool - Reference of an ApplicationGatewayBackendAddressPool resource. 352 BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` 353 // BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources. 354 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` 355} 356 357// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings. 358type ApplicationGatewayBackendHealthServer struct { 359 // Address - IP address or FQDN of backend server. 360 Address *string `json:"address,omitempty"` 361 // IPConfiguration - Reference of IP configuration of backend server. 362 IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` 363 // Health - Health of backend server. Possible values are: 'Unknown', 'Up', 'Down', and 'Partial'. Possible values include: 'Unknown', 'Up', 'Down', 'Partial' 364 Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` 365} 366 367// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. 368type ApplicationGatewayBackendHTTPSettings struct { 369 *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` 370 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 371 Name *string `json:"name,omitempty"` 372 // Etag - A unique read-only string that changes whenever the resource is updated. 373 Etag *string `json:"etag,omitempty"` 374 // ID - Resource ID. 375 ID *string `json:"id,omitempty"` 376} 377 378// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. 379func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { 380 objectMap := make(map[string]interface{}) 381 if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { 382 objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat 383 } 384 if agbhs.Name != nil { 385 objectMap["name"] = agbhs.Name 386 } 387 if agbhs.Etag != nil { 388 objectMap["etag"] = agbhs.Etag 389 } 390 if agbhs.ID != nil { 391 objectMap["id"] = agbhs.ID 392 } 393 return json.Marshal(objectMap) 394} 395 396// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. 397func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { 398 var m map[string]*json.RawMessage 399 err := json.Unmarshal(body, &m) 400 if err != nil { 401 return err 402 } 403 for k, v := range m { 404 switch k { 405 case "properties": 406 if v != nil { 407 var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat 408 err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) 409 if err != nil { 410 return err 411 } 412 agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat 413 } 414 case "name": 415 if v != nil { 416 var name string 417 err = json.Unmarshal(*v, &name) 418 if err != nil { 419 return err 420 } 421 agbhs.Name = &name 422 } 423 case "etag": 424 if v != nil { 425 var etag string 426 err = json.Unmarshal(*v, &etag) 427 if err != nil { 428 return err 429 } 430 agbhs.Etag = &etag 431 } 432 case "id": 433 if v != nil { 434 var ID string 435 err = json.Unmarshal(*v, &ID) 436 if err != nil { 437 return err 438 } 439 agbhs.ID = &ID 440 } 441 } 442 } 443 444 return nil 445} 446 447// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an 448// application gateway. 449type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { 450 // Port - Port 451 Port *int32 `json:"port,omitempty"` 452 // Protocol - Protocol. Possible values are: 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS' 453 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 454 // CookieBasedAffinity - Cookie based affinity. Possible values are: 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled' 455 CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` 456 // 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. 457 RequestTimeout *int32 `json:"requestTimeout,omitempty"` 458 // Probe - Probe resource of an application gateway. 459 Probe *SubResource `json:"probe,omitempty"` 460 // AuthenticationCertificates - Array of references to application gateway authentication certificates. 461 AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` 462 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 463 ProvisioningState *string `json:"provisioningState,omitempty"` 464} 465 466// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. 467type ApplicationGatewayFrontendIPConfiguration struct { 468 *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` 469 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 470 Name *string `json:"name,omitempty"` 471 // Etag - A unique read-only string that changes whenever the resource is updated. 472 Etag *string `json:"etag,omitempty"` 473 // ID - Resource ID. 474 ID *string `json:"id,omitempty"` 475} 476 477// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. 478func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { 479 objectMap := make(map[string]interface{}) 480 if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { 481 objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat 482 } 483 if agfic.Name != nil { 484 objectMap["name"] = agfic.Name 485 } 486 if agfic.Etag != nil { 487 objectMap["etag"] = agfic.Etag 488 } 489 if agfic.ID != nil { 490 objectMap["id"] = agfic.ID 491 } 492 return json.Marshal(objectMap) 493} 494 495// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. 496func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { 497 var m map[string]*json.RawMessage 498 err := json.Unmarshal(body, &m) 499 if err != nil { 500 return err 501 } 502 for k, v := range m { 503 switch k { 504 case "properties": 505 if v != nil { 506 var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat 507 err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) 508 if err != nil { 509 return err 510 } 511 agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat 512 } 513 case "name": 514 if v != nil { 515 var name string 516 err = json.Unmarshal(*v, &name) 517 if err != nil { 518 return err 519 } 520 agfic.Name = &name 521 } 522 case "etag": 523 if v != nil { 524 var etag string 525 err = json.Unmarshal(*v, &etag) 526 if err != nil { 527 return err 528 } 529 agfic.Etag = &etag 530 } 531 case "id": 532 if v != nil { 533 var ID string 534 err = json.Unmarshal(*v, &ID) 535 if err != nil { 536 return err 537 } 538 agfic.ID = &ID 539 } 540 } 541 } 542 543 return nil 544} 545 546// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an 547// application gateway. 548type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { 549 // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. 550 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 551 // PrivateIPAllocationMethod - PrivateIP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 552 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 553 // Subnet - Reference of the subnet resource. 554 Subnet *SubResource `json:"subnet,omitempty"` 555 // PublicIPAddress - Reference of the PublicIP resource. 556 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 557 // ProvisioningState - Provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 558 ProvisioningState *string `json:"provisioningState,omitempty"` 559} 560 561// ApplicationGatewayFrontendPort frontend port of an application gateway. 562type ApplicationGatewayFrontendPort struct { 563 *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` 564 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 565 Name *string `json:"name,omitempty"` 566 // Etag - A unique read-only string that changes whenever the resource is updated. 567 Etag *string `json:"etag,omitempty"` 568 // ID - Resource ID. 569 ID *string `json:"id,omitempty"` 570} 571 572// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. 573func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { 574 objectMap := make(map[string]interface{}) 575 if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { 576 objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat 577 } 578 if agfp.Name != nil { 579 objectMap["name"] = agfp.Name 580 } 581 if agfp.Etag != nil { 582 objectMap["etag"] = agfp.Etag 583 } 584 if agfp.ID != nil { 585 objectMap["id"] = agfp.ID 586 } 587 return json.Marshal(objectMap) 588} 589 590// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. 591func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { 592 var m map[string]*json.RawMessage 593 err := json.Unmarshal(body, &m) 594 if err != nil { 595 return err 596 } 597 for k, v := range m { 598 switch k { 599 case "properties": 600 if v != nil { 601 var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat 602 err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) 603 if err != nil { 604 return err 605 } 606 agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat 607 } 608 case "name": 609 if v != nil { 610 var name string 611 err = json.Unmarshal(*v, &name) 612 if err != nil { 613 return err 614 } 615 agfp.Name = &name 616 } 617 case "etag": 618 if v != nil { 619 var etag string 620 err = json.Unmarshal(*v, &etag) 621 if err != nil { 622 return err 623 } 624 agfp.Etag = &etag 625 } 626 case "id": 627 if v != nil { 628 var ID string 629 err = json.Unmarshal(*v, &ID) 630 if err != nil { 631 return err 632 } 633 agfp.ID = &ID 634 } 635 } 636 } 637 638 return nil 639} 640 641// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway. 642type ApplicationGatewayFrontendPortPropertiesFormat struct { 643 // Port - Frontend port 644 Port *int32 `json:"port,omitempty"` 645 // ProvisioningState - Provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 646 ProvisioningState *string `json:"provisioningState,omitempty"` 647} 648 649// ApplicationGatewayHTTPListener http listener of an application gateway. 650type ApplicationGatewayHTTPListener struct { 651 *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` 652 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 653 Name *string `json:"name,omitempty"` 654 // Etag - A unique read-only string that changes whenever the resource is updated. 655 Etag *string `json:"etag,omitempty"` 656 // ID - Resource ID. 657 ID *string `json:"id,omitempty"` 658} 659 660// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. 661func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { 662 objectMap := make(map[string]interface{}) 663 if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { 664 objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat 665 } 666 if aghl.Name != nil { 667 objectMap["name"] = aghl.Name 668 } 669 if aghl.Etag != nil { 670 objectMap["etag"] = aghl.Etag 671 } 672 if aghl.ID != nil { 673 objectMap["id"] = aghl.ID 674 } 675 return json.Marshal(objectMap) 676} 677 678// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. 679func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { 680 var m map[string]*json.RawMessage 681 err := json.Unmarshal(body, &m) 682 if err != nil { 683 return err 684 } 685 for k, v := range m { 686 switch k { 687 case "properties": 688 if v != nil { 689 var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat 690 err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) 691 if err != nil { 692 return err 693 } 694 aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat 695 } 696 case "name": 697 if v != nil { 698 var name string 699 err = json.Unmarshal(*v, &name) 700 if err != nil { 701 return err 702 } 703 aghl.Name = &name 704 } 705 case "etag": 706 if v != nil { 707 var etag string 708 err = json.Unmarshal(*v, &etag) 709 if err != nil { 710 return err 711 } 712 aghl.Etag = &etag 713 } 714 case "id": 715 if v != nil { 716 var ID string 717 err = json.Unmarshal(*v, &ID) 718 if err != nil { 719 return err 720 } 721 aghl.ID = &ID 722 } 723 } 724 } 725 726 return nil 727} 728 729// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway. 730type ApplicationGatewayHTTPListenerPropertiesFormat struct { 731 // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. 732 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 733 // FrontendPort - Frontend port resource of an application gateway. 734 FrontendPort *SubResource `json:"frontendPort,omitempty"` 735 // Protocol - Protocol. Possible values are: 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS' 736 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 737 // HostName - Host name of HTTP listener. 738 HostName *string `json:"hostName,omitempty"` 739 // SslCertificate - SSL certificate resource of an application gateway. 740 SslCertificate *SubResource `json:"sslCertificate,omitempty"` 741 // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. 742 RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` 743 // ProvisioningState - Provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 744 ProvisioningState *string `json:"provisioningState,omitempty"` 745} 746 747// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 748// private IP configuration is allowed. 749type ApplicationGatewayIPConfiguration struct { 750 *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 751 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 752 Name *string `json:"name,omitempty"` 753 // Etag - A unique read-only string that changes whenever the resource is updated. 754 Etag *string `json:"etag,omitempty"` 755 // ID - Resource ID. 756 ID *string `json:"id,omitempty"` 757} 758 759// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. 760func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 761 objectMap := make(map[string]interface{}) 762 if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { 763 objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat 764 } 765 if agic.Name != nil { 766 objectMap["name"] = agic.Name 767 } 768 if agic.Etag != nil { 769 objectMap["etag"] = agic.Etag 770 } 771 if agic.ID != nil { 772 objectMap["id"] = agic.ID 773 } 774 return json.Marshal(objectMap) 775} 776 777// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. 778func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 779 var m map[string]*json.RawMessage 780 err := json.Unmarshal(body, &m) 781 if err != nil { 782 return err 783 } 784 for k, v := range m { 785 switch k { 786 case "properties": 787 if v != nil { 788 var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat 789 err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat) 790 if err != nil { 791 return err 792 } 793 agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat 794 } 795 case "name": 796 if v != nil { 797 var name string 798 err = json.Unmarshal(*v, &name) 799 if err != nil { 800 return err 801 } 802 agic.Name = &name 803 } 804 case "etag": 805 if v != nil { 806 var etag string 807 err = json.Unmarshal(*v, &etag) 808 if err != nil { 809 return err 810 } 811 agic.Etag = &etag 812 } 813 case "id": 814 if v != nil { 815 var ID string 816 err = json.Unmarshal(*v, &ID) 817 if err != nil { 818 return err 819 } 820 agic.ID = &ID 821 } 822 } 823 } 824 825 return nil 826} 827 828// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application 829// gateway. 830type ApplicationGatewayIPConfigurationPropertiesFormat struct { 831 // Subnet - Reference of the subnet resource. A subnet from where application gateway gets its private address. 832 Subnet *SubResource `json:"subnet,omitempty"` 833 // ProvisioningState - Provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 834 ProvisioningState *string `json:"provisioningState,omitempty"` 835} 836 837// ApplicationGatewayListResult response for ListApplicationGateways API service call. 838type ApplicationGatewayListResult struct { 839 autorest.Response `json:"-"` 840 // Value - List of an application gateways in a resource group. 841 Value *[]ApplicationGateway `json:"value,omitempty"` 842 // NextLink - URL to get the next set of results. 843 NextLink *string `json:"nextLink,omitempty"` 844} 845 846// ApplicationGatewayListResultIterator provides access to a complete listing of ApplicationGateway values. 847type ApplicationGatewayListResultIterator struct { 848 i int 849 page ApplicationGatewayListResultPage 850} 851 852// NextWithContext advances to the next value. If there was an error making 853// the request the iterator does not advance and the error is returned. 854func (iter *ApplicationGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 855 if tracing.IsEnabled() { 856 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultIterator.NextWithContext") 857 defer func() { 858 sc := -1 859 if iter.Response().Response.Response != nil { 860 sc = iter.Response().Response.Response.StatusCode 861 } 862 tracing.EndSpan(ctx, sc, err) 863 }() 864 } 865 iter.i++ 866 if iter.i < len(iter.page.Values()) { 867 return nil 868 } 869 err = iter.page.NextWithContext(ctx) 870 if err != nil { 871 iter.i-- 872 return err 873 } 874 iter.i = 0 875 return nil 876} 877 878// Next advances to the next value. If there was an error making 879// the request the iterator does not advance and the error is returned. 880// Deprecated: Use NextWithContext() instead. 881func (iter *ApplicationGatewayListResultIterator) Next() error { 882 return iter.NextWithContext(context.Background()) 883} 884 885// NotDone returns true if the enumeration should be started or is not yet complete. 886func (iter ApplicationGatewayListResultIterator) NotDone() bool { 887 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 888} 889 890// Response returns the raw server response from the last page request. 891func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult { 892 return iter.page.Response() 893} 894 895// Value returns the current value or a zero-initialized value if the 896// iterator has advanced beyond the end of the collection. 897func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway { 898 if !iter.page.NotDone() { 899 return ApplicationGateway{} 900 } 901 return iter.page.Values()[iter.i] 902} 903 904// Creates a new instance of the ApplicationGatewayListResultIterator type. 905func NewApplicationGatewayListResultIterator(page ApplicationGatewayListResultPage) ApplicationGatewayListResultIterator { 906 return ApplicationGatewayListResultIterator{page: page} 907} 908 909// IsEmpty returns true if the ListResult contains no values. 910func (aglr ApplicationGatewayListResult) IsEmpty() bool { 911 return aglr.Value == nil || len(*aglr.Value) == 0 912} 913 914// hasNextLink returns true if the NextLink is not empty. 915func (aglr ApplicationGatewayListResult) hasNextLink() bool { 916 return aglr.NextLink != nil && len(*aglr.NextLink) != 0 917} 918 919// applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. 920// It returns nil if no more results exist. 921func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 922 if !aglr.hasNextLink() { 923 return nil, nil 924 } 925 return autorest.Prepare((&http.Request{}).WithContext(ctx), 926 autorest.AsJSON(), 927 autorest.AsGet(), 928 autorest.WithBaseURL(to.String(aglr.NextLink))) 929} 930 931// ApplicationGatewayListResultPage contains a page of ApplicationGateway values. 932type ApplicationGatewayListResultPage struct { 933 fn func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error) 934 aglr ApplicationGatewayListResult 935} 936 937// NextWithContext advances to the next page of values. If there was an error making 938// the request the page does not advance and the error is returned. 939func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 940 if tracing.IsEnabled() { 941 ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultPage.NextWithContext") 942 defer func() { 943 sc := -1 944 if page.Response().Response.Response != nil { 945 sc = page.Response().Response.Response.StatusCode 946 } 947 tracing.EndSpan(ctx, sc, err) 948 }() 949 } 950 for { 951 next, err := page.fn(ctx, page.aglr) 952 if err != nil { 953 return err 954 } 955 page.aglr = next 956 if !next.hasNextLink() || !next.IsEmpty() { 957 break 958 } 959 } 960 return nil 961} 962 963// Next advances to the next page of values. If there was an error making 964// the request the page does not advance and the error is returned. 965// Deprecated: Use NextWithContext() instead. 966func (page *ApplicationGatewayListResultPage) Next() error { 967 return page.NextWithContext(context.Background()) 968} 969 970// NotDone returns true if the page enumeration should be started or is not yet complete. 971func (page ApplicationGatewayListResultPage) NotDone() bool { 972 return !page.aglr.IsEmpty() 973} 974 975// Response returns the raw server response from the last page request. 976func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult { 977 return page.aglr 978} 979 980// Values returns the slice of values for the current page or nil if there are no values. 981func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { 982 if page.aglr.IsEmpty() { 983 return nil 984 } 985 return *page.aglr.Value 986} 987 988// Creates a new instance of the ApplicationGatewayListResultPage type. 989func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage { 990 return ApplicationGatewayListResultPage{ 991 fn: getNextPage, 992 aglr: cur, 993 } 994} 995 996// ApplicationGatewayPathRule path rule of URL path map of an application gateway. 997type ApplicationGatewayPathRule struct { 998 *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` 999 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1000 Name *string `json:"name,omitempty"` 1001 // Etag - A unique read-only string that changes whenever the resource is updated. 1002 Etag *string `json:"etag,omitempty"` 1003 // ID - Resource ID. 1004 ID *string `json:"id,omitempty"` 1005} 1006 1007// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule. 1008func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { 1009 objectMap := make(map[string]interface{}) 1010 if agpr.ApplicationGatewayPathRulePropertiesFormat != nil { 1011 objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat 1012 } 1013 if agpr.Name != nil { 1014 objectMap["name"] = agpr.Name 1015 } 1016 if agpr.Etag != nil { 1017 objectMap["etag"] = agpr.Etag 1018 } 1019 if agpr.ID != nil { 1020 objectMap["id"] = agpr.ID 1021 } 1022 return json.Marshal(objectMap) 1023} 1024 1025// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. 1026func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error { 1027 var m map[string]*json.RawMessage 1028 err := json.Unmarshal(body, &m) 1029 if err != nil { 1030 return err 1031 } 1032 for k, v := range m { 1033 switch k { 1034 case "properties": 1035 if v != nil { 1036 var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat 1037 err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat) 1038 if err != nil { 1039 return err 1040 } 1041 agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat 1042 } 1043 case "name": 1044 if v != nil { 1045 var name string 1046 err = json.Unmarshal(*v, &name) 1047 if err != nil { 1048 return err 1049 } 1050 agpr.Name = &name 1051 } 1052 case "etag": 1053 if v != nil { 1054 var etag string 1055 err = json.Unmarshal(*v, &etag) 1056 if err != nil { 1057 return err 1058 } 1059 agpr.Etag = &etag 1060 } 1061 case "id": 1062 if v != nil { 1063 var ID string 1064 err = json.Unmarshal(*v, &ID) 1065 if err != nil { 1066 return err 1067 } 1068 agpr.ID = &ID 1069 } 1070 } 1071 } 1072 1073 return nil 1074} 1075 1076// ApplicationGatewayPathRulePropertiesFormat properties of probe of an application gateway. 1077type ApplicationGatewayPathRulePropertiesFormat struct { 1078 // Paths - Path rules of URL path map. 1079 Paths *[]string `json:"paths,omitempty"` 1080 // BackendAddressPool - Backend address pool resource of URL path map. 1081 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 1082 // BackendHTTPSettings - Backend http settings resource of URL path map. 1083 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 1084 // ProvisioningState - Path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1085 ProvisioningState *string `json:"provisioningState,omitempty"` 1086} 1087 1088// ApplicationGatewayProbe probe of the application gateway. 1089type ApplicationGatewayProbe struct { 1090 *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` 1091 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1092 Name *string `json:"name,omitempty"` 1093 // Etag - A unique read-only string that changes whenever the resource is updated. 1094 Etag *string `json:"etag,omitempty"` 1095 // ID - Resource ID. 1096 ID *string `json:"id,omitempty"` 1097} 1098 1099// MarshalJSON is the custom marshaler for ApplicationGatewayProbe. 1100func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { 1101 objectMap := make(map[string]interface{}) 1102 if agp.ApplicationGatewayProbePropertiesFormat != nil { 1103 objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat 1104 } 1105 if agp.Name != nil { 1106 objectMap["name"] = agp.Name 1107 } 1108 if agp.Etag != nil { 1109 objectMap["etag"] = agp.Etag 1110 } 1111 if agp.ID != nil { 1112 objectMap["id"] = agp.ID 1113 } 1114 return json.Marshal(objectMap) 1115} 1116 1117// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. 1118func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error { 1119 var m map[string]*json.RawMessage 1120 err := json.Unmarshal(body, &m) 1121 if err != nil { 1122 return err 1123 } 1124 for k, v := range m { 1125 switch k { 1126 case "properties": 1127 if v != nil { 1128 var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat 1129 err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat) 1130 if err != nil { 1131 return err 1132 } 1133 agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat 1134 } 1135 case "name": 1136 if v != nil { 1137 var name string 1138 err = json.Unmarshal(*v, &name) 1139 if err != nil { 1140 return err 1141 } 1142 agp.Name = &name 1143 } 1144 case "etag": 1145 if v != nil { 1146 var etag string 1147 err = json.Unmarshal(*v, &etag) 1148 if err != nil { 1149 return err 1150 } 1151 agp.Etag = &etag 1152 } 1153 case "id": 1154 if v != nil { 1155 var ID string 1156 err = json.Unmarshal(*v, &ID) 1157 if err != nil { 1158 return err 1159 } 1160 agp.ID = &ID 1161 } 1162 } 1163 } 1164 1165 return nil 1166} 1167 1168// ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. 1169type ApplicationGatewayProbePropertiesFormat struct { 1170 // Protocol - Protocol. Possible values are: 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS' 1171 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 1172 // Host - Host name to send the probe to. 1173 Host *string `json:"host,omitempty"` 1174 // Path - Relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path> 1175 Path *string `json:"path,omitempty"` 1176 // Interval - The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. 1177 Interval *int32 `json:"interval,omitempty"` 1178 // 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. 1179 Timeout *int32 `json:"timeout,omitempty"` 1180 // 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. 1181 UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` 1182 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1183 ProvisioningState *string `json:"provisioningState,omitempty"` 1184} 1185 1186// ApplicationGatewayPropertiesFormat properties of the application gateway. 1187type ApplicationGatewayPropertiesFormat struct { 1188 // Sku - SKU of the application gateway resource. 1189 Sku *ApplicationGatewaySku `json:"sku,omitempty"` 1190 // SslPolicy - SSL policy of the application gateway resource. 1191 SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` 1192 // 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' 1193 OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` 1194 // GatewayIPConfigurations - Subnets of application the gateway resource. 1195 GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` 1196 // AuthenticationCertificates - Authentication certificates of the application gateway resource. 1197 AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` 1198 // SslCertificates - SSL certificates of the application gateway resource. 1199 SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` 1200 // FrontendIPConfigurations - Frontend IP addresses of the application gateway resource. 1201 FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 1202 // FrontendPorts - Frontend ports of the application gateway resource. 1203 FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` 1204 // Probes - Probes of the application gateway resource. 1205 Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` 1206 // BackendAddressPools - Backend address pool of the application gateway resource. 1207 BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` 1208 // BackendHTTPSettingsCollection - Backend http settings of the application gateway resource. 1209 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` 1210 // HTTPListeners - Http listeners of the application gateway resource. 1211 HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` 1212 // URLPathMaps - URL path map of the application gateway resource. 1213 URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` 1214 // RequestRoutingRules - Request routing rules of the application gateway resource. 1215 RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` 1216 // WebApplicationFirewallConfiguration - Web application firewall configuration. 1217 WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` 1218 // ResourceGUID - Resource GUID property of the application gateway resource. 1219 ResourceGUID *string `json:"resourceGuid,omitempty"` 1220 // ProvisioningState - Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1221 ProvisioningState *string `json:"provisioningState,omitempty"` 1222} 1223 1224// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat. 1225func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { 1226 objectMap := make(map[string]interface{}) 1227 if agpf.Sku != nil { 1228 objectMap["sku"] = agpf.Sku 1229 } 1230 if agpf.SslPolicy != nil { 1231 objectMap["sslPolicy"] = agpf.SslPolicy 1232 } 1233 if agpf.GatewayIPConfigurations != nil { 1234 objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations 1235 } 1236 if agpf.AuthenticationCertificates != nil { 1237 objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates 1238 } 1239 if agpf.SslCertificates != nil { 1240 objectMap["sslCertificates"] = agpf.SslCertificates 1241 } 1242 if agpf.FrontendIPConfigurations != nil { 1243 objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations 1244 } 1245 if agpf.FrontendPorts != nil { 1246 objectMap["frontendPorts"] = agpf.FrontendPorts 1247 } 1248 if agpf.Probes != nil { 1249 objectMap["probes"] = agpf.Probes 1250 } 1251 if agpf.BackendAddressPools != nil { 1252 objectMap["backendAddressPools"] = agpf.BackendAddressPools 1253 } 1254 if agpf.BackendHTTPSettingsCollection != nil { 1255 objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection 1256 } 1257 if agpf.HTTPListeners != nil { 1258 objectMap["httpListeners"] = agpf.HTTPListeners 1259 } 1260 if agpf.URLPathMaps != nil { 1261 objectMap["urlPathMaps"] = agpf.URLPathMaps 1262 } 1263 if agpf.RequestRoutingRules != nil { 1264 objectMap["requestRoutingRules"] = agpf.RequestRoutingRules 1265 } 1266 if agpf.WebApplicationFirewallConfiguration != nil { 1267 objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration 1268 } 1269 if agpf.ResourceGUID != nil { 1270 objectMap["resourceGuid"] = agpf.ResourceGUID 1271 } 1272 if agpf.ProvisioningState != nil { 1273 objectMap["provisioningState"] = agpf.ProvisioningState 1274 } 1275 return json.Marshal(objectMap) 1276} 1277 1278// ApplicationGatewayRequestRoutingRule request routing rule of an application gateway. 1279type ApplicationGatewayRequestRoutingRule struct { 1280 *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` 1281 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1282 Name *string `json:"name,omitempty"` 1283 // Etag - A unique read-only string that changes whenever the resource is updated. 1284 Etag *string `json:"etag,omitempty"` 1285 // ID - Resource ID. 1286 ID *string `json:"id,omitempty"` 1287} 1288 1289// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule. 1290func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { 1291 objectMap := make(map[string]interface{}) 1292 if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil { 1293 objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat 1294 } 1295 if agrrr.Name != nil { 1296 objectMap["name"] = agrrr.Name 1297 } 1298 if agrrr.Etag != nil { 1299 objectMap["etag"] = agrrr.Etag 1300 } 1301 if agrrr.ID != nil { 1302 objectMap["id"] = agrrr.ID 1303 } 1304 return json.Marshal(objectMap) 1305} 1306 1307// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. 1308func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error { 1309 var m map[string]*json.RawMessage 1310 err := json.Unmarshal(body, &m) 1311 if err != nil { 1312 return err 1313 } 1314 for k, v := range m { 1315 switch k { 1316 case "properties": 1317 if v != nil { 1318 var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat 1319 err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat) 1320 if err != nil { 1321 return err 1322 } 1323 agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat 1324 } 1325 case "name": 1326 if v != nil { 1327 var name string 1328 err = json.Unmarshal(*v, &name) 1329 if err != nil { 1330 return err 1331 } 1332 agrrr.Name = &name 1333 } 1334 case "etag": 1335 if v != nil { 1336 var etag string 1337 err = json.Unmarshal(*v, &etag) 1338 if err != nil { 1339 return err 1340 } 1341 agrrr.Etag = &etag 1342 } 1343 case "id": 1344 if v != nil { 1345 var ID string 1346 err = json.Unmarshal(*v, &ID) 1347 if err != nil { 1348 return err 1349 } 1350 agrrr.ID = &ID 1351 } 1352 } 1353 } 1354 1355 return nil 1356} 1357 1358// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the 1359// application gateway. 1360type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { 1361 // RuleType - Rule type. Possible values are: 'Basic' and 'PathBasedRouting'. Possible values include: 'Basic', 'PathBasedRouting' 1362 RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` 1363 // BackendAddressPool - Backend address pool resource of the application gateway. 1364 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 1365 // BackendHTTPSettings - Frontend port resource of the application gateway. 1366 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 1367 // HTTPListener - Http listener resource of the application gateway. 1368 HTTPListener *SubResource `json:"httpListener,omitempty"` 1369 // URLPathMap - URL path map resource of the application gateway. 1370 URLPathMap *SubResource `json:"urlPathMap,omitempty"` 1371 // ProvisioningState - Provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1372 ProvisioningState *string `json:"provisioningState,omitempty"` 1373} 1374 1375// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a 1376// long-running operation. 1377type ApplicationGatewaysBackendHealthFuture struct { 1378 azure.FutureAPI 1379 // Result returns the result of the asynchronous operation. 1380 // If the operation has not completed it will return an error. 1381 Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealth, error) 1382} 1383 1384// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1385func (future *ApplicationGatewaysBackendHealthFuture) UnmarshalJSON(body []byte) error { 1386 var azFuture azure.Future 1387 if err := json.Unmarshal(body, &azFuture); err != nil { 1388 return err 1389 } 1390 future.FutureAPI = &azFuture 1391 future.Result = future.result 1392 return nil 1393} 1394 1395// result is the default implementation for ApplicationGatewaysBackendHealthFuture.Result. 1396func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) { 1397 var done bool 1398 done, err = future.DoneWithContext(context.Background(), client) 1399 if err != nil { 1400 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure") 1401 return 1402 } 1403 if !done { 1404 agbh.Response.Response = future.Response() 1405 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture") 1406 return 1407 } 1408 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1409 if agbh.Response.Response, err = future.GetResult(sender); err == nil && agbh.Response.Response.StatusCode != http.StatusNoContent { 1410 agbh, err = client.BackendHealthResponder(agbh.Response.Response) 1411 if err != nil { 1412 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", agbh.Response.Response, "Failure responding to request") 1413 } 1414 } 1415 return 1416} 1417 1418// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1419// long-running operation. 1420type ApplicationGatewaysCreateOrUpdateFuture struct { 1421 azure.FutureAPI 1422 // Result returns the result of the asynchronous operation. 1423 // If the operation has not completed it will return an error. 1424 Result func(ApplicationGatewaysClient) (ApplicationGateway, error) 1425} 1426 1427// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1428func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1429 var azFuture azure.Future 1430 if err := json.Unmarshal(body, &azFuture); err != nil { 1431 return err 1432 } 1433 future.FutureAPI = &azFuture 1434 future.Result = future.result 1435 return nil 1436} 1437 1438// result is the default implementation for ApplicationGatewaysCreateOrUpdateFuture.Result. 1439func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { 1440 var done bool 1441 done, err = future.DoneWithContext(context.Background(), client) 1442 if err != nil { 1443 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1444 return 1445 } 1446 if !done { 1447 ag.Response.Response = future.Response() 1448 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") 1449 return 1450 } 1451 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1452 if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent { 1453 ag, err = client.CreateOrUpdateResponder(ag.Response.Response) 1454 if err != nil { 1455 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", ag.Response.Response, "Failure responding to request") 1456 } 1457 } 1458 return 1459} 1460 1461// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 1462// long-running operation. 1463type ApplicationGatewaysDeleteFuture struct { 1464 azure.FutureAPI 1465 // Result returns the result of the asynchronous operation. 1466 // If the operation has not completed it will return an error. 1467 Result func(ApplicationGatewaysClient) (autorest.Response, error) 1468} 1469 1470// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1471func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 1472 var azFuture azure.Future 1473 if err := json.Unmarshal(body, &azFuture); err != nil { 1474 return err 1475 } 1476 future.FutureAPI = &azFuture 1477 future.Result = future.result 1478 return nil 1479} 1480 1481// result is the default implementation for ApplicationGatewaysDeleteFuture.Result. 1482func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 1483 var done bool 1484 done, err = future.DoneWithContext(context.Background(), client) 1485 if err != nil { 1486 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 1487 return 1488 } 1489 if !done { 1490 ar.Response = future.Response() 1491 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") 1492 return 1493 } 1494 ar.Response = future.Response() 1495 return 1496} 1497 1498// ApplicationGatewaySku SKU of an application gateway 1499type ApplicationGatewaySku struct { 1500 // 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', 'WAFMedium', 'WAFLarge' 1501 Name ApplicationGatewaySkuName `json:"name,omitempty"` 1502 // Tier - Tier of an application gateway. Possible values are: 'Standard' and 'WAF'. Possible values include: 'Standard', 'WAF' 1503 Tier ApplicationGatewayTier `json:"tier,omitempty"` 1504 // Capacity - Capacity (instance count) of an application gateway. 1505 Capacity *int32 `json:"capacity,omitempty"` 1506} 1507 1508// ApplicationGatewaySslCertificate SSL certificates of an application gateway. 1509type ApplicationGatewaySslCertificate struct { 1510 *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` 1511 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1512 Name *string `json:"name,omitempty"` 1513 // Etag - A unique read-only string that changes whenever the resource is updated. 1514 Etag *string `json:"etag,omitempty"` 1515 // ID - Resource ID. 1516 ID *string `json:"id,omitempty"` 1517} 1518 1519// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate. 1520func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) { 1521 objectMap := make(map[string]interface{}) 1522 if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil { 1523 objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat 1524 } 1525 if agsc.Name != nil { 1526 objectMap["name"] = agsc.Name 1527 } 1528 if agsc.Etag != nil { 1529 objectMap["etag"] = agsc.Etag 1530 } 1531 if agsc.ID != nil { 1532 objectMap["id"] = agsc.ID 1533 } 1534 return json.Marshal(objectMap) 1535} 1536 1537// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. 1538func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { 1539 var m map[string]*json.RawMessage 1540 err := json.Unmarshal(body, &m) 1541 if err != nil { 1542 return err 1543 } 1544 for k, v := range m { 1545 switch k { 1546 case "properties": 1547 if v != nil { 1548 var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat 1549 err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat) 1550 if err != nil { 1551 return err 1552 } 1553 agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat 1554 } 1555 case "name": 1556 if v != nil { 1557 var name string 1558 err = json.Unmarshal(*v, &name) 1559 if err != nil { 1560 return err 1561 } 1562 agsc.Name = &name 1563 } 1564 case "etag": 1565 if v != nil { 1566 var etag string 1567 err = json.Unmarshal(*v, &etag) 1568 if err != nil { 1569 return err 1570 } 1571 agsc.Etag = &etag 1572 } 1573 case "id": 1574 if v != nil { 1575 var ID string 1576 err = json.Unmarshal(*v, &ID) 1577 if err != nil { 1578 return err 1579 } 1580 agsc.ID = &ID 1581 } 1582 } 1583 } 1584 1585 return nil 1586} 1587 1588// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application 1589// gateway. 1590type ApplicationGatewaySslCertificatePropertiesFormat struct { 1591 // Data - Base-64 encoded pfx certificate. Only applicable in PUT Request. 1592 Data *string `json:"data,omitempty"` 1593 // Password - Password for the pfx file specified in data. Only applicable in PUT request. 1594 Password *string `json:"password,omitempty"` 1595 // PublicCertData - Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. 1596 PublicCertData *string `json:"publicCertData,omitempty"` 1597 // ProvisioningState - Provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. 1598 ProvisioningState *string `json:"provisioningState,omitempty"` 1599} 1600 1601// ApplicationGatewaySslPolicy application gateway SSL policy. 1602type ApplicationGatewaySslPolicy struct { 1603 // DisabledSslProtocols - SSL protocols to be disabled on application gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'. 1604 DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` 1605} 1606 1607// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a 1608// long-running operation. 1609type ApplicationGatewaysStartFuture struct { 1610 azure.FutureAPI 1611 // Result returns the result of the asynchronous operation. 1612 // If the operation has not completed it will return an error. 1613 Result func(ApplicationGatewaysClient) (autorest.Response, error) 1614} 1615 1616// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1617func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error { 1618 var azFuture azure.Future 1619 if err := json.Unmarshal(body, &azFuture); err != nil { 1620 return err 1621 } 1622 future.FutureAPI = &azFuture 1623 future.Result = future.result 1624 return nil 1625} 1626 1627// result is the default implementation for ApplicationGatewaysStartFuture.Result. 1628func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 1629 var done bool 1630 done, err = future.DoneWithContext(context.Background(), client) 1631 if err != nil { 1632 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure") 1633 return 1634 } 1635 if !done { 1636 ar.Response = future.Response() 1637 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") 1638 return 1639 } 1640 ar.Response = future.Response() 1641 return 1642} 1643 1644// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running 1645// operation. 1646type ApplicationGatewaysStopFuture struct { 1647 azure.FutureAPI 1648 // Result returns the result of the asynchronous operation. 1649 // If the operation has not completed it will return an error. 1650 Result func(ApplicationGatewaysClient) (autorest.Response, error) 1651} 1652 1653// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1654func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error { 1655 var azFuture azure.Future 1656 if err := json.Unmarshal(body, &azFuture); err != nil { 1657 return err 1658 } 1659 future.FutureAPI = &azFuture 1660 future.Result = future.result 1661 return nil 1662} 1663 1664// result is the default implementation for ApplicationGatewaysStopFuture.Result. 1665func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 1666 var done bool 1667 done, err = future.DoneWithContext(context.Background(), client) 1668 if err != nil { 1669 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure") 1670 return 1671 } 1672 if !done { 1673 ar.Response = future.Response() 1674 err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") 1675 return 1676 } 1677 ar.Response = future.Response() 1678 return 1679} 1680 1681// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for 1682// PathBasedRouting. 1683type ApplicationGatewayURLPathMap struct { 1684 *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` 1685 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1686 Name *string `json:"name,omitempty"` 1687 // Etag - A unique read-only string that changes whenever the resource is updated. 1688 Etag *string `json:"etag,omitempty"` 1689 // ID - Resource ID. 1690 ID *string `json:"id,omitempty"` 1691} 1692 1693// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap. 1694func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { 1695 objectMap := make(map[string]interface{}) 1696 if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil { 1697 objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat 1698 } 1699 if agupm.Name != nil { 1700 objectMap["name"] = agupm.Name 1701 } 1702 if agupm.Etag != nil { 1703 objectMap["etag"] = agupm.Etag 1704 } 1705 if agupm.ID != nil { 1706 objectMap["id"] = agupm.ID 1707 } 1708 return json.Marshal(objectMap) 1709} 1710 1711// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. 1712func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error { 1713 var m map[string]*json.RawMessage 1714 err := json.Unmarshal(body, &m) 1715 if err != nil { 1716 return err 1717 } 1718 for k, v := range m { 1719 switch k { 1720 case "properties": 1721 if v != nil { 1722 var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat 1723 err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat) 1724 if err != nil { 1725 return err 1726 } 1727 agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat 1728 } 1729 case "name": 1730 if v != nil { 1731 var name string 1732 err = json.Unmarshal(*v, &name) 1733 if err != nil { 1734 return err 1735 } 1736 agupm.Name = &name 1737 } 1738 case "etag": 1739 if v != nil { 1740 var etag string 1741 err = json.Unmarshal(*v, &etag) 1742 if err != nil { 1743 return err 1744 } 1745 agupm.Etag = &etag 1746 } 1747 case "id": 1748 if v != nil { 1749 var ID string 1750 err = json.Unmarshal(*v, &ID) 1751 if err != nil { 1752 return err 1753 } 1754 agupm.ID = &ID 1755 } 1756 } 1757 } 1758 1759 return nil 1760} 1761 1762// ApplicationGatewayURLPathMapPropertiesFormat properties of UrlPathMap of the application gateway. 1763type ApplicationGatewayURLPathMapPropertiesFormat struct { 1764 // DefaultBackendAddressPool - Default backend address pool resource of URL path map. 1765 DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` 1766 // DefaultBackendHTTPSettings - Default backend http settings resource of URL path map. 1767 DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` 1768 // PathRules - Path rule of URL path map resource. 1769 PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` 1770 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1771 ProvisioningState *string `json:"provisioningState,omitempty"` 1772} 1773 1774// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall 1775// configuration. 1776type ApplicationGatewayWebApplicationFirewallConfiguration struct { 1777 // Enabled - Whether the web application firewall is enabled. 1778 Enabled *bool `json:"enabled,omitempty"` 1779 // FirewallMode - Web application firewall mode. Possible values are: 'Detection' and 'Prevention'. Possible values include: 'Detection', 'Prevention' 1780 FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` 1781} 1782 1783// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations 1784// that belongs to an ExpressRouteCircuit. 1785type AuthorizationListResult struct { 1786 autorest.Response `json:"-"` 1787 // Value - The authorizations in an ExpressRoute Circuit. 1788 Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` 1789 // NextLink - The URL to get the next set of results. 1790 NextLink *string `json:"nextLink,omitempty"` 1791} 1792 1793// AuthorizationListResultIterator provides access to a complete listing of 1794// ExpressRouteCircuitAuthorization values. 1795type AuthorizationListResultIterator struct { 1796 i int 1797 page AuthorizationListResultPage 1798} 1799 1800// NextWithContext advances to the next value. If there was an error making 1801// the request the iterator does not advance and the error is returned. 1802func (iter *AuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) { 1803 if tracing.IsEnabled() { 1804 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultIterator.NextWithContext") 1805 defer func() { 1806 sc := -1 1807 if iter.Response().Response.Response != nil { 1808 sc = iter.Response().Response.Response.StatusCode 1809 } 1810 tracing.EndSpan(ctx, sc, err) 1811 }() 1812 } 1813 iter.i++ 1814 if iter.i < len(iter.page.Values()) { 1815 return nil 1816 } 1817 err = iter.page.NextWithContext(ctx) 1818 if err != nil { 1819 iter.i-- 1820 return err 1821 } 1822 iter.i = 0 1823 return nil 1824} 1825 1826// Next advances to the next value. If there was an error making 1827// the request the iterator does not advance and the error is returned. 1828// Deprecated: Use NextWithContext() instead. 1829func (iter *AuthorizationListResultIterator) Next() error { 1830 return iter.NextWithContext(context.Background()) 1831} 1832 1833// NotDone returns true if the enumeration should be started or is not yet complete. 1834func (iter AuthorizationListResultIterator) NotDone() bool { 1835 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1836} 1837 1838// Response returns the raw server response from the last page request. 1839func (iter AuthorizationListResultIterator) Response() AuthorizationListResult { 1840 return iter.page.Response() 1841} 1842 1843// Value returns the current value or a zero-initialized value if the 1844// iterator has advanced beyond the end of the collection. 1845func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization { 1846 if !iter.page.NotDone() { 1847 return ExpressRouteCircuitAuthorization{} 1848 } 1849 return iter.page.Values()[iter.i] 1850} 1851 1852// Creates a new instance of the AuthorizationListResultIterator type. 1853func NewAuthorizationListResultIterator(page AuthorizationListResultPage) AuthorizationListResultIterator { 1854 return AuthorizationListResultIterator{page: page} 1855} 1856 1857// IsEmpty returns true if the ListResult contains no values. 1858func (alr AuthorizationListResult) IsEmpty() bool { 1859 return alr.Value == nil || len(*alr.Value) == 0 1860} 1861 1862// hasNextLink returns true if the NextLink is not empty. 1863func (alr AuthorizationListResult) hasNextLink() bool { 1864 return alr.NextLink != nil && len(*alr.NextLink) != 0 1865} 1866 1867// authorizationListResultPreparer prepares a request to retrieve the next set of results. 1868// It returns nil if no more results exist. 1869func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) { 1870 if !alr.hasNextLink() { 1871 return nil, nil 1872 } 1873 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1874 autorest.AsJSON(), 1875 autorest.AsGet(), 1876 autorest.WithBaseURL(to.String(alr.NextLink))) 1877} 1878 1879// AuthorizationListResultPage contains a page of ExpressRouteCircuitAuthorization values. 1880type AuthorizationListResultPage struct { 1881 fn func(context.Context, AuthorizationListResult) (AuthorizationListResult, error) 1882 alr AuthorizationListResult 1883} 1884 1885// NextWithContext advances to the next page of values. If there was an error making 1886// the request the page does not advance and the error is returned. 1887func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) { 1888 if tracing.IsEnabled() { 1889 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultPage.NextWithContext") 1890 defer func() { 1891 sc := -1 1892 if page.Response().Response.Response != nil { 1893 sc = page.Response().Response.Response.StatusCode 1894 } 1895 tracing.EndSpan(ctx, sc, err) 1896 }() 1897 } 1898 for { 1899 next, err := page.fn(ctx, page.alr) 1900 if err != nil { 1901 return err 1902 } 1903 page.alr = next 1904 if !next.hasNextLink() || !next.IsEmpty() { 1905 break 1906 } 1907 } 1908 return nil 1909} 1910 1911// Next advances to the next page of values. If there was an error making 1912// the request the page does not advance and the error is returned. 1913// Deprecated: Use NextWithContext() instead. 1914func (page *AuthorizationListResultPage) Next() error { 1915 return page.NextWithContext(context.Background()) 1916} 1917 1918// NotDone returns true if the page enumeration should be started or is not yet complete. 1919func (page AuthorizationListResultPage) NotDone() bool { 1920 return !page.alr.IsEmpty() 1921} 1922 1923// Response returns the raw server response from the last page request. 1924func (page AuthorizationListResultPage) Response() AuthorizationListResult { 1925 return page.alr 1926} 1927 1928// Values returns the slice of values for the current page or nil if there are no values. 1929func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization { 1930 if page.alr.IsEmpty() { 1931 return nil 1932 } 1933 return *page.alr.Value 1934} 1935 1936// Creates a new instance of the AuthorizationListResultPage type. 1937func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage { 1938 return AuthorizationListResultPage{ 1939 fn: getNextPage, 1940 alr: cur, 1941 } 1942} 1943 1944// AuthorizationPropertiesFormat ... 1945type AuthorizationPropertiesFormat struct { 1946 // AuthorizationKey - The authorization key. 1947 AuthorizationKey *string `json:"authorizationKey,omitempty"` 1948 // AuthorizationUseStatus - AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' 1949 AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` 1950 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1951 ProvisioningState *string `json:"provisioningState,omitempty"` 1952} 1953 1954// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, 1955// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct 1956// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous 1957// operation succeeded, the response body includes the HTTP status code for the successful request. If the 1958// asynchronous operation failed, the response body includes the HTTP status code for the failed request 1959// and error information regarding the failure. 1960type AzureAsyncOperationResult struct { 1961 // Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed' 1962 Status OperationStatus `json:"status,omitempty"` 1963 Error *Error `json:"error,omitempty"` 1964} 1965 1966// BackendAddressPool pool of backend IP addresses. 1967type BackendAddressPool struct { 1968 *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 1969 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 1970 Name *string `json:"name,omitempty"` 1971 // Etag - A unique read-only string that changes whenever the resource is updated. 1972 Etag *string `json:"etag,omitempty"` 1973 // ID - Resource ID. 1974 ID *string `json:"id,omitempty"` 1975} 1976 1977// MarshalJSON is the custom marshaler for BackendAddressPool. 1978func (bap BackendAddressPool) MarshalJSON() ([]byte, error) { 1979 objectMap := make(map[string]interface{}) 1980 if bap.BackendAddressPoolPropertiesFormat != nil { 1981 objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat 1982 } 1983 if bap.Name != nil { 1984 objectMap["name"] = bap.Name 1985 } 1986 if bap.Etag != nil { 1987 objectMap["etag"] = bap.Etag 1988 } 1989 if bap.ID != nil { 1990 objectMap["id"] = bap.ID 1991 } 1992 return json.Marshal(objectMap) 1993} 1994 1995// UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. 1996func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { 1997 var m map[string]*json.RawMessage 1998 err := json.Unmarshal(body, &m) 1999 if err != nil { 2000 return err 2001 } 2002 for k, v := range m { 2003 switch k { 2004 case "properties": 2005 if v != nil { 2006 var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat 2007 err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat) 2008 if err != nil { 2009 return err 2010 } 2011 bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat 2012 } 2013 case "name": 2014 if v != nil { 2015 var name string 2016 err = json.Unmarshal(*v, &name) 2017 if err != nil { 2018 return err 2019 } 2020 bap.Name = &name 2021 } 2022 case "etag": 2023 if v != nil { 2024 var etag string 2025 err = json.Unmarshal(*v, &etag) 2026 if err != nil { 2027 return err 2028 } 2029 bap.Etag = &etag 2030 } 2031 case "id": 2032 if v != nil { 2033 var ID string 2034 err = json.Unmarshal(*v, &ID) 2035 if err != nil { 2036 return err 2037 } 2038 bap.ID = &ID 2039 } 2040 } 2041 } 2042 2043 return nil 2044} 2045 2046// BackendAddressPoolPropertiesFormat properties of the backend address pool. 2047type BackendAddressPoolPropertiesFormat struct { 2048 // BackendIPConfigurations - READ-ONLY; Gets collection of references to IP addresses defined in network interfaces. 2049 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 2050 // LoadBalancingRules - READ-ONLY; Gets load balancing rules that use this backend address pool. 2051 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 2052 // OutboundNatRule - READ-ONLY; Gets outbound rules that use this backend address pool. 2053 OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"` 2054 // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2055 ProvisioningState *string `json:"provisioningState,omitempty"` 2056} 2057 2058// MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. 2059func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { 2060 objectMap := make(map[string]interface{}) 2061 if bappf.ProvisioningState != nil { 2062 objectMap["provisioningState"] = bappf.ProvisioningState 2063 } 2064 return json.Marshal(objectMap) 2065} 2066 2067// BgpPeerStatus ... 2068type BgpPeerStatus struct { 2069 // LocalAddress - READ-ONLY; The virtual network gateway's local address 2070 LocalAddress *string `json:"localAddress,omitempty"` 2071 // Neighbor - READ-ONLY; The remote BGP peer 2072 Neighbor *string `json:"neighbor,omitempty"` 2073 // Asn - READ-ONLY; The autonomous system number of the remote BGP peer 2074 Asn *int32 `json:"asn,omitempty"` 2075 // State - READ-ONLY; The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected' 2076 State BgpPeerState `json:"state,omitempty"` 2077 // ConnectedDuration - READ-ONLY; For how long the peering has been up 2078 ConnectedDuration *string `json:"connectedDuration,omitempty"` 2079 // RoutesReceived - READ-ONLY; The number of routes learned from this peer 2080 RoutesReceived *int64 `json:"routesReceived,omitempty"` 2081 // MessagesSent - READ-ONLY; The number of BGP messages sent 2082 MessagesSent *int64 `json:"messagesSent,omitempty"` 2083 // MessagesReceived - READ-ONLY; The number of BGP messages received 2084 MessagesReceived *int64 `json:"messagesReceived,omitempty"` 2085} 2086 2087// MarshalJSON is the custom marshaler for BgpPeerStatus. 2088func (bps BgpPeerStatus) MarshalJSON() ([]byte, error) { 2089 objectMap := make(map[string]interface{}) 2090 return json.Marshal(objectMap) 2091} 2092 2093// BgpPeerStatusListResult response for list BGP peer status API service call 2094type BgpPeerStatusListResult struct { 2095 autorest.Response `json:"-"` 2096 // Value - List of BGP peers 2097 Value *[]BgpPeerStatus `json:"value,omitempty"` 2098} 2099 2100// BgpSettings ... 2101type BgpSettings struct { 2102 // Asn - The BGP speaker's ASN. 2103 Asn *int64 `json:"asn,omitempty"` 2104 // BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker. 2105 BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` 2106 // PeerWeight - The weight added to routes learned from this BGP speaker. 2107 PeerWeight *int32 `json:"peerWeight,omitempty"` 2108} 2109 2110// ConnectionResetSharedKey ... 2111type ConnectionResetSharedKey struct { 2112 autorest.Response `json:"-"` 2113 // KeyLength - The virtual network connection reset shared key length, should between 1 and 128. 2114 KeyLength *int32 `json:"keyLength,omitempty"` 2115} 2116 2117// ConnectionSharedKey response for GetConnectionSharedKey API service call 2118type ConnectionSharedKey struct { 2119 autorest.Response `json:"-"` 2120 // Value - The virtual network connection shared key value. 2121 Value *string `json:"value,omitempty"` 2122} 2123 2124// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual 2125// network. Standard DHCP option for a subnet overrides VNET DHCP options. 2126type DhcpOptions struct { 2127 // DNSServers - The list of DNS servers IP addresses. 2128 DNSServers *[]string `json:"dnsServers,omitempty"` 2129} 2130 2131// DNSNameAvailabilityResult response for the CheckDnsNameAvailability API service call. 2132type DNSNameAvailabilityResult struct { 2133 autorest.Response `json:"-"` 2134 // Available - Domain availability (True/False). 2135 Available *bool `json:"available,omitempty"` 2136} 2137 2138// EffectiveNetworkSecurityGroup effective network security group. 2139type EffectiveNetworkSecurityGroup struct { 2140 // NetworkSecurityGroup - The ID of network security group that is applied. 2141 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 2142 Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` 2143 // EffectiveSecurityRules - A collection of effective security rules. 2144 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` 2145} 2146 2147// EffectiveNetworkSecurityGroupAssociation the effective network security group association. 2148type EffectiveNetworkSecurityGroupAssociation struct { 2149 // Subnet - The ID of the subnet if assigned. 2150 Subnet *SubResource `json:"subnet,omitempty"` 2151 // NetworkInterface - The ID of the network interface if assigned. 2152 NetworkInterface *SubResource `json:"networkInterface,omitempty"` 2153} 2154 2155// EffectiveNetworkSecurityGroupListResult response for list effective network security groups API service 2156// call. 2157type EffectiveNetworkSecurityGroupListResult struct { 2158 autorest.Response `json:"-"` 2159 // Value - A list of effective network security groups. 2160 Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"` 2161 // NextLink - The URL to get the next set of results. 2162 NextLink *string `json:"nextLink,omitempty"` 2163} 2164 2165// EffectiveNetworkSecurityRule effective network security rules. 2166type EffectiveNetworkSecurityRule struct { 2167 // Name - The name of the security rule specified by the user (if created by the user). 2168 Name *string `json:"name,omitempty"` 2169 // Protocol - The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and '*'. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolAsterisk' 2170 Protocol SecurityRuleProtocol `json:"protocol,omitempty"` 2171 // SourcePortRange - The source port or range. 2172 SourcePortRange *string `json:"sourcePortRange,omitempty"` 2173 // DestinationPortRange - The destination port or range. 2174 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 2175 // SourceAddressPrefix - The source address prefix. 2176 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 2177 // DestinationAddressPrefix - The destination address prefix. 2178 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 2179 // ExpandedSourceAddressPrefix - The expanded source address prefix. 2180 ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` 2181 // ExpandedDestinationAddressPrefix - Expanded destination address prefix. 2182 ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` 2183 // Access - Whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' 2184 Access SecurityRuleAccess `json:"access,omitempty"` 2185 // Priority - The priority of the rule. 2186 Priority *int32 `json:"priority,omitempty"` 2187 // Direction - The direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' 2188 Direction SecurityRuleDirection `json:"direction,omitempty"` 2189} 2190 2191// EffectiveRoute effective Route 2192type EffectiveRoute struct { 2193 // Name - The name of the user defined route. This is optional. 2194 Name *string `json:"name,omitempty"` 2195 // Source - Who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault' 2196 Source EffectiveRouteSource `json:"source,omitempty"` 2197 // State - The value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid' 2198 State EffectiveRouteState `json:"state,omitempty"` 2199 // AddressPrefix - The address prefixes of the effective routes in CIDR notation. 2200 AddressPrefix *[]string `json:"addressPrefix,omitempty"` 2201 // NextHopIPAddress - The IP address of the next hop of the effective route. 2202 NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"` 2203 // 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' 2204 NextHopType RouteNextHopType `json:"nextHopType,omitempty"` 2205} 2206 2207// EffectiveRouteListResult response for list effective route API service call. 2208type EffectiveRouteListResult struct { 2209 autorest.Response `json:"-"` 2210 // Value - A list of effective routes. 2211 Value *[]EffectiveRoute `json:"value,omitempty"` 2212 // NextLink - The URL to get the next set of results. 2213 NextLink *string `json:"nextLink,omitempty"` 2214} 2215 2216// Error ... 2217type Error struct { 2218 Code *string `json:"code,omitempty"` 2219 Message *string `json:"message,omitempty"` 2220 Target *string `json:"target,omitempty"` 2221 Details *[]ErrorDetails `json:"details,omitempty"` 2222 InnerError *string `json:"innerError,omitempty"` 2223} 2224 2225// ErrorDetails ... 2226type ErrorDetails struct { 2227 Code *string `json:"code,omitempty"` 2228 Target *string `json:"target,omitempty"` 2229 Message *string `json:"message,omitempty"` 2230} 2231 2232// ExpressRouteCircuit expressRouteCircuit resource 2233type ExpressRouteCircuit struct { 2234 autorest.Response `json:"-"` 2235 // Sku - The SKU. 2236 Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` 2237 *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` 2238 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 2239 Etag *string `json:"etag,omitempty"` 2240 // ID - Resource ID. 2241 ID *string `json:"id,omitempty"` 2242 // Name - READ-ONLY; Resource name. 2243 Name *string `json:"name,omitempty"` 2244 // Type - READ-ONLY; Resource type. 2245 Type *string `json:"type,omitempty"` 2246 // Location - Resource location. 2247 Location *string `json:"location,omitempty"` 2248 // Tags - Resource tags. 2249 Tags map[string]*string `json:"tags"` 2250} 2251 2252// MarshalJSON is the custom marshaler for ExpressRouteCircuit. 2253func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) { 2254 objectMap := make(map[string]interface{}) 2255 if erc.Sku != nil { 2256 objectMap["sku"] = erc.Sku 2257 } 2258 if erc.ExpressRouteCircuitPropertiesFormat != nil { 2259 objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat 2260 } 2261 if erc.Etag != nil { 2262 objectMap["etag"] = erc.Etag 2263 } 2264 if erc.ID != nil { 2265 objectMap["id"] = erc.ID 2266 } 2267 if erc.Location != nil { 2268 objectMap["location"] = erc.Location 2269 } 2270 if erc.Tags != nil { 2271 objectMap["tags"] = erc.Tags 2272 } 2273 return json.Marshal(objectMap) 2274} 2275 2276// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. 2277func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error { 2278 var m map[string]*json.RawMessage 2279 err := json.Unmarshal(body, &m) 2280 if err != nil { 2281 return err 2282 } 2283 for k, v := range m { 2284 switch k { 2285 case "sku": 2286 if v != nil { 2287 var sku ExpressRouteCircuitSku 2288 err = json.Unmarshal(*v, &sku) 2289 if err != nil { 2290 return err 2291 } 2292 erc.Sku = &sku 2293 } 2294 case "properties": 2295 if v != nil { 2296 var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat 2297 err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat) 2298 if err != nil { 2299 return err 2300 } 2301 erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat 2302 } 2303 case "etag": 2304 if v != nil { 2305 var etag string 2306 err = json.Unmarshal(*v, &etag) 2307 if err != nil { 2308 return err 2309 } 2310 erc.Etag = &etag 2311 } 2312 case "id": 2313 if v != nil { 2314 var ID string 2315 err = json.Unmarshal(*v, &ID) 2316 if err != nil { 2317 return err 2318 } 2319 erc.ID = &ID 2320 } 2321 case "name": 2322 if v != nil { 2323 var name string 2324 err = json.Unmarshal(*v, &name) 2325 if err != nil { 2326 return err 2327 } 2328 erc.Name = &name 2329 } 2330 case "type": 2331 if v != nil { 2332 var typeVar string 2333 err = json.Unmarshal(*v, &typeVar) 2334 if err != nil { 2335 return err 2336 } 2337 erc.Type = &typeVar 2338 } 2339 case "location": 2340 if v != nil { 2341 var location string 2342 err = json.Unmarshal(*v, &location) 2343 if err != nil { 2344 return err 2345 } 2346 erc.Location = &location 2347 } 2348 case "tags": 2349 if v != nil { 2350 var tags map[string]*string 2351 err = json.Unmarshal(*v, &tags) 2352 if err != nil { 2353 return err 2354 } 2355 erc.Tags = tags 2356 } 2357 } 2358 } 2359 2360 return nil 2361} 2362 2363// ExpressRouteCircuitArpTable the ARP table associated with the ExpressRouteCircuit. 2364type ExpressRouteCircuitArpTable struct { 2365 // Age - Age 2366 Age *int32 `json:"age,omitempty"` 2367 // Interface - Interface 2368 Interface *string `json:"interface,omitempty"` 2369 // IPAddress - The IP address. 2370 IPAddress *string `json:"ipAddress,omitempty"` 2371 // MacAddress - The MAC address. 2372 MacAddress *string `json:"macAddress,omitempty"` 2373} 2374 2375// ExpressRouteCircuitAuthorization authorization in an ExpressRouteCircuit resource. 2376type ExpressRouteCircuitAuthorization struct { 2377 autorest.Response `json:"-"` 2378 *AuthorizationPropertiesFormat `json:"properties,omitempty"` 2379 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 2380 Name *string `json:"name,omitempty"` 2381 // Etag - A unique read-only string that changes whenever the resource is updated. 2382 Etag *string `json:"etag,omitempty"` 2383 // ID - Resource ID. 2384 ID *string `json:"id,omitempty"` 2385} 2386 2387// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization. 2388func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { 2389 objectMap := make(map[string]interface{}) 2390 if erca.AuthorizationPropertiesFormat != nil { 2391 objectMap["properties"] = erca.AuthorizationPropertiesFormat 2392 } 2393 if erca.Name != nil { 2394 objectMap["name"] = erca.Name 2395 } 2396 if erca.Etag != nil { 2397 objectMap["etag"] = erca.Etag 2398 } 2399 if erca.ID != nil { 2400 objectMap["id"] = erca.ID 2401 } 2402 return json.Marshal(objectMap) 2403} 2404 2405// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. 2406func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { 2407 var m map[string]*json.RawMessage 2408 err := json.Unmarshal(body, &m) 2409 if err != nil { 2410 return err 2411 } 2412 for k, v := range m { 2413 switch k { 2414 case "properties": 2415 if v != nil { 2416 var authorizationPropertiesFormat AuthorizationPropertiesFormat 2417 err = json.Unmarshal(*v, &authorizationPropertiesFormat) 2418 if err != nil { 2419 return err 2420 } 2421 erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat 2422 } 2423 case "name": 2424 if v != nil { 2425 var name string 2426 err = json.Unmarshal(*v, &name) 2427 if err != nil { 2428 return err 2429 } 2430 erca.Name = &name 2431 } 2432 case "etag": 2433 if v != nil { 2434 var etag string 2435 err = json.Unmarshal(*v, &etag) 2436 if err != nil { 2437 return err 2438 } 2439 erca.Etag = &etag 2440 } 2441 case "id": 2442 if v != nil { 2443 var ID string 2444 err = json.Unmarshal(*v, &ID) 2445 if err != nil { 2446 return err 2447 } 2448 erca.ID = &ID 2449 } 2450 } 2451 } 2452 2453 return nil 2454} 2455 2456// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 2457// results of a long-running operation. 2458type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { 2459 azure.FutureAPI 2460 // Result returns the result of the asynchronous operation. 2461 // If the operation has not completed it will return an error. 2462 Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error) 2463} 2464 2465// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2466func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2467 var azFuture azure.Future 2468 if err := json.Unmarshal(body, &azFuture); err != nil { 2469 return err 2470 } 2471 future.FutureAPI = &azFuture 2472 future.Result = future.result 2473 return nil 2474} 2475 2476// result is the default implementation for ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.Result. 2477func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { 2478 var done bool 2479 done, err = future.DoneWithContext(context.Background(), client) 2480 if err != nil { 2481 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2482 return 2483 } 2484 if !done { 2485 erca.Response.Response = future.Response() 2486 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") 2487 return 2488 } 2489 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2490 if erca.Response.Response, err = future.GetResult(sender); err == nil && erca.Response.Response.StatusCode != http.StatusNoContent { 2491 erca, err = client.CreateOrUpdateResponder(erca.Response.Response) 2492 if err != nil { 2493 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", erca.Response.Response, "Failure responding to request") 2494 } 2495 } 2496 return 2497} 2498 2499// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results 2500// of a long-running operation. 2501type ExpressRouteCircuitAuthorizationsDeleteFuture struct { 2502 azure.FutureAPI 2503 // Result returns the result of the asynchronous operation. 2504 // If the operation has not completed it will return an error. 2505 Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error) 2506} 2507 2508// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2509func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error { 2510 var azFuture azure.Future 2511 if err := json.Unmarshal(body, &azFuture); err != nil { 2512 return err 2513 } 2514 future.FutureAPI = &azFuture 2515 future.Result = future.result 2516 return nil 2517} 2518 2519// result is the default implementation for ExpressRouteCircuitAuthorizationsDeleteFuture.Result. 2520func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { 2521 var done bool 2522 done, err = future.DoneWithContext(context.Background(), client) 2523 if err != nil { 2524 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") 2525 return 2526 } 2527 if !done { 2528 ar.Response = future.Response() 2529 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") 2530 return 2531 } 2532 ar.Response = future.Response() 2533 return 2534} 2535 2536// ExpressRouteCircuitListResult response for ListExpressRouteCircuit API service call. 2537type ExpressRouteCircuitListResult struct { 2538 autorest.Response `json:"-"` 2539 // Value - A list of ExpressRouteCircuits in a resource group. 2540 Value *[]ExpressRouteCircuit `json:"value,omitempty"` 2541 // NextLink - The URL to get the next set of results. 2542 NextLink *string `json:"nextLink,omitempty"` 2543} 2544 2545// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit 2546// values. 2547type ExpressRouteCircuitListResultIterator struct { 2548 i int 2549 page ExpressRouteCircuitListResultPage 2550} 2551 2552// NextWithContext advances to the next value. If there was an error making 2553// the request the iterator does not advance and the error is returned. 2554func (iter *ExpressRouteCircuitListResultIterator) NextWithContext(ctx context.Context) (err error) { 2555 if tracing.IsEnabled() { 2556 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultIterator.NextWithContext") 2557 defer func() { 2558 sc := -1 2559 if iter.Response().Response.Response != nil { 2560 sc = iter.Response().Response.Response.StatusCode 2561 } 2562 tracing.EndSpan(ctx, sc, err) 2563 }() 2564 } 2565 iter.i++ 2566 if iter.i < len(iter.page.Values()) { 2567 return nil 2568 } 2569 err = iter.page.NextWithContext(ctx) 2570 if err != nil { 2571 iter.i-- 2572 return err 2573 } 2574 iter.i = 0 2575 return nil 2576} 2577 2578// Next advances to the next value. If there was an error making 2579// the request the iterator does not advance and the error is returned. 2580// Deprecated: Use NextWithContext() instead. 2581func (iter *ExpressRouteCircuitListResultIterator) Next() error { 2582 return iter.NextWithContext(context.Background()) 2583} 2584 2585// NotDone returns true if the enumeration should be started or is not yet complete. 2586func (iter ExpressRouteCircuitListResultIterator) NotDone() bool { 2587 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2588} 2589 2590// Response returns the raw server response from the last page request. 2591func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult { 2592 return iter.page.Response() 2593} 2594 2595// Value returns the current value or a zero-initialized value if the 2596// iterator has advanced beyond the end of the collection. 2597func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit { 2598 if !iter.page.NotDone() { 2599 return ExpressRouteCircuit{} 2600 } 2601 return iter.page.Values()[iter.i] 2602} 2603 2604// Creates a new instance of the ExpressRouteCircuitListResultIterator type. 2605func NewExpressRouteCircuitListResultIterator(page ExpressRouteCircuitListResultPage) ExpressRouteCircuitListResultIterator { 2606 return ExpressRouteCircuitListResultIterator{page: page} 2607} 2608 2609// IsEmpty returns true if the ListResult contains no values. 2610func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { 2611 return erclr.Value == nil || len(*erclr.Value) == 0 2612} 2613 2614// hasNextLink returns true if the NextLink is not empty. 2615func (erclr ExpressRouteCircuitListResult) hasNextLink() bool { 2616 return erclr.NextLink != nil && len(*erclr.NextLink) != 0 2617} 2618 2619// expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. 2620// It returns nil if no more results exist. 2621func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) { 2622 if !erclr.hasNextLink() { 2623 return nil, nil 2624 } 2625 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2626 autorest.AsJSON(), 2627 autorest.AsGet(), 2628 autorest.WithBaseURL(to.String(erclr.NextLink))) 2629} 2630 2631// ExpressRouteCircuitListResultPage contains a page of ExpressRouteCircuit values. 2632type ExpressRouteCircuitListResultPage struct { 2633 fn func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error) 2634 erclr ExpressRouteCircuitListResult 2635} 2636 2637// NextWithContext advances to the next page of values. If there was an error making 2638// the request the page does not advance and the error is returned. 2639func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Context) (err error) { 2640 if tracing.IsEnabled() { 2641 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultPage.NextWithContext") 2642 defer func() { 2643 sc := -1 2644 if page.Response().Response.Response != nil { 2645 sc = page.Response().Response.Response.StatusCode 2646 } 2647 tracing.EndSpan(ctx, sc, err) 2648 }() 2649 } 2650 for { 2651 next, err := page.fn(ctx, page.erclr) 2652 if err != nil { 2653 return err 2654 } 2655 page.erclr = next 2656 if !next.hasNextLink() || !next.IsEmpty() { 2657 break 2658 } 2659 } 2660 return nil 2661} 2662 2663// Next advances to the next page of values. If there was an error making 2664// the request the page does not advance and the error is returned. 2665// Deprecated: Use NextWithContext() instead. 2666func (page *ExpressRouteCircuitListResultPage) Next() error { 2667 return page.NextWithContext(context.Background()) 2668} 2669 2670// NotDone returns true if the page enumeration should be started or is not yet complete. 2671func (page ExpressRouteCircuitListResultPage) NotDone() bool { 2672 return !page.erclr.IsEmpty() 2673} 2674 2675// Response returns the raw server response from the last page request. 2676func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult { 2677 return page.erclr 2678} 2679 2680// Values returns the slice of values for the current page or nil if there are no values. 2681func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { 2682 if page.erclr.IsEmpty() { 2683 return nil 2684 } 2685 return *page.erclr.Value 2686} 2687 2688// Creates a new instance of the ExpressRouteCircuitListResultPage type. 2689func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage { 2690 return ExpressRouteCircuitListResultPage{ 2691 fn: getNextPage, 2692 erclr: cur, 2693 } 2694} 2695 2696// ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource. 2697type ExpressRouteCircuitPeering struct { 2698 autorest.Response `json:"-"` 2699 *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` 2700 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 2701 Name *string `json:"name,omitempty"` 2702 // Etag - A unique read-only string that changes whenever the resource is updated. 2703 Etag *string `json:"etag,omitempty"` 2704 // ID - Resource ID. 2705 ID *string `json:"id,omitempty"` 2706} 2707 2708// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering. 2709func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { 2710 objectMap := make(map[string]interface{}) 2711 if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil { 2712 objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat 2713 } 2714 if ercp.Name != nil { 2715 objectMap["name"] = ercp.Name 2716 } 2717 if ercp.Etag != nil { 2718 objectMap["etag"] = ercp.Etag 2719 } 2720 if ercp.ID != nil { 2721 objectMap["id"] = ercp.ID 2722 } 2723 return json.Marshal(objectMap) 2724} 2725 2726// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. 2727func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error { 2728 var m map[string]*json.RawMessage 2729 err := json.Unmarshal(body, &m) 2730 if err != nil { 2731 return err 2732 } 2733 for k, v := range m { 2734 switch k { 2735 case "properties": 2736 if v != nil { 2737 var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat 2738 err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat) 2739 if err != nil { 2740 return err 2741 } 2742 ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat 2743 } 2744 case "name": 2745 if v != nil { 2746 var name string 2747 err = json.Unmarshal(*v, &name) 2748 if err != nil { 2749 return err 2750 } 2751 ercp.Name = &name 2752 } 2753 case "etag": 2754 if v != nil { 2755 var etag string 2756 err = json.Unmarshal(*v, &etag) 2757 if err != nil { 2758 return err 2759 } 2760 ercp.Etag = &etag 2761 } 2762 case "id": 2763 if v != nil { 2764 var ID string 2765 err = json.Unmarshal(*v, &ID) 2766 if err != nil { 2767 return err 2768 } 2769 ercp.ID = &ID 2770 } 2771 } 2772 } 2773 2774 return nil 2775} 2776 2777// ExpressRouteCircuitPeeringConfig specifies the peering configuration. 2778type ExpressRouteCircuitPeeringConfig struct { 2779 // AdvertisedPublicPrefixes - The reference of AdvertisedPublicPrefixes. 2780 AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` 2781 // AdvertisedPublicPrefixesState - AdvertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' 2782 AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` 2783 // CustomerASN - The CustomerASN of the peering. 2784 CustomerASN *int32 `json:"customerASN,omitempty"` 2785 // RoutingRegistryName - The RoutingRegistryName of the configuration. 2786 RoutingRegistryName *string `json:"routingRegistryName,omitempty"` 2787} 2788 2789// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings 2790// that belong to an ExpressRouteCircuit. 2791type ExpressRouteCircuitPeeringListResult struct { 2792 autorest.Response `json:"-"` 2793 // Value - The peerings in an express route circuit. 2794 Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` 2795 // NextLink - The URL to get the next set of results. 2796 NextLink *string `json:"nextLink,omitempty"` 2797} 2798 2799// ExpressRouteCircuitPeeringListResultIterator provides access to a complete listing of 2800// ExpressRouteCircuitPeering values. 2801type ExpressRouteCircuitPeeringListResultIterator struct { 2802 i int 2803 page ExpressRouteCircuitPeeringListResultPage 2804} 2805 2806// NextWithContext advances to the next value. If there was an error making 2807// the request the iterator does not advance and the error is returned. 2808func (iter *ExpressRouteCircuitPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { 2809 if tracing.IsEnabled() { 2810 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultIterator.NextWithContext") 2811 defer func() { 2812 sc := -1 2813 if iter.Response().Response.Response != nil { 2814 sc = iter.Response().Response.Response.StatusCode 2815 } 2816 tracing.EndSpan(ctx, sc, err) 2817 }() 2818 } 2819 iter.i++ 2820 if iter.i < len(iter.page.Values()) { 2821 return nil 2822 } 2823 err = iter.page.NextWithContext(ctx) 2824 if err != nil { 2825 iter.i-- 2826 return err 2827 } 2828 iter.i = 0 2829 return nil 2830} 2831 2832// Next advances to the next value. If there was an error making 2833// the request the iterator does not advance and the error is returned. 2834// Deprecated: Use NextWithContext() instead. 2835func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error { 2836 return iter.NextWithContext(context.Background()) 2837} 2838 2839// NotDone returns true if the enumeration should be started or is not yet complete. 2840func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool { 2841 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2842} 2843 2844// Response returns the raw server response from the last page request. 2845func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult { 2846 return iter.page.Response() 2847} 2848 2849// Value returns the current value or a zero-initialized value if the 2850// iterator has advanced beyond the end of the collection. 2851func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering { 2852 if !iter.page.NotDone() { 2853 return ExpressRouteCircuitPeering{} 2854 } 2855 return iter.page.Values()[iter.i] 2856} 2857 2858// Creates a new instance of the ExpressRouteCircuitPeeringListResultIterator type. 2859func NewExpressRouteCircuitPeeringListResultIterator(page ExpressRouteCircuitPeeringListResultPage) ExpressRouteCircuitPeeringListResultIterator { 2860 return ExpressRouteCircuitPeeringListResultIterator{page: page} 2861} 2862 2863// IsEmpty returns true if the ListResult contains no values. 2864func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { 2865 return ercplr.Value == nil || len(*ercplr.Value) == 0 2866} 2867 2868// hasNextLink returns true if the NextLink is not empty. 2869func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool { 2870 return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0 2871} 2872 2873// expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. 2874// It returns nil if no more results exist. 2875func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { 2876 if !ercplr.hasNextLink() { 2877 return nil, nil 2878 } 2879 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2880 autorest.AsJSON(), 2881 autorest.AsGet(), 2882 autorest.WithBaseURL(to.String(ercplr.NextLink))) 2883} 2884 2885// ExpressRouteCircuitPeeringListResultPage contains a page of ExpressRouteCircuitPeering values. 2886type ExpressRouteCircuitPeeringListResultPage struct { 2887 fn func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error) 2888 ercplr ExpressRouteCircuitPeeringListResult 2889} 2890 2891// NextWithContext advances to the next page of values. If there was an error making 2892// the request the page does not advance and the error is returned. 2893func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { 2894 if tracing.IsEnabled() { 2895 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultPage.NextWithContext") 2896 defer func() { 2897 sc := -1 2898 if page.Response().Response.Response != nil { 2899 sc = page.Response().Response.Response.StatusCode 2900 } 2901 tracing.EndSpan(ctx, sc, err) 2902 }() 2903 } 2904 for { 2905 next, err := page.fn(ctx, page.ercplr) 2906 if err != nil { 2907 return err 2908 } 2909 page.ercplr = next 2910 if !next.hasNextLink() || !next.IsEmpty() { 2911 break 2912 } 2913 } 2914 return nil 2915} 2916 2917// Next advances to the next page of values. If there was an error making 2918// the request the page does not advance and the error is returned. 2919// Deprecated: Use NextWithContext() instead. 2920func (page *ExpressRouteCircuitPeeringListResultPage) Next() error { 2921 return page.NextWithContext(context.Background()) 2922} 2923 2924// NotDone returns true if the page enumeration should be started or is not yet complete. 2925func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool { 2926 return !page.ercplr.IsEmpty() 2927} 2928 2929// Response returns the raw server response from the last page request. 2930func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult { 2931 return page.ercplr 2932} 2933 2934// Values returns the slice of values for the current page or nil if there are no values. 2935func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering { 2936 if page.ercplr.IsEmpty() { 2937 return nil 2938 } 2939 return *page.ercplr.Value 2940} 2941 2942// Creates a new instance of the ExpressRouteCircuitPeeringListResultPage type. 2943func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage { 2944 return ExpressRouteCircuitPeeringListResultPage{ 2945 fn: getNextPage, 2946 ercplr: cur, 2947 } 2948} 2949 2950// ExpressRouteCircuitPeeringPropertiesFormat ... 2951type ExpressRouteCircuitPeeringPropertiesFormat struct { 2952 // PeeringType - The PeeringType. Possible values are: 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' 2953 PeeringType ExpressRouteCircuitPeeringType `json:"peeringType,omitempty"` 2954 // State - The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled' 2955 State ExpressRouteCircuitPeeringState `json:"state,omitempty"` 2956 // AzureASN - The Azure ASN. 2957 AzureASN *int32 `json:"azureASN,omitempty"` 2958 // PeerASN - The peer ASN. 2959 PeerASN *int32 `json:"peerASN,omitempty"` 2960 // PrimaryPeerAddressPrefix - The primary address prefix. 2961 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` 2962 // SecondaryPeerAddressPrefix - The secondary address prefix. 2963 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` 2964 // PrimaryAzurePort - The primary port. 2965 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` 2966 // SecondaryAzurePort - The secondary port. 2967 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` 2968 // SharedKey - The shared key. 2969 SharedKey *string `json:"sharedKey,omitempty"` 2970 // VlanID - The VLAN ID. 2971 VlanID *int32 `json:"vlanId,omitempty"` 2972 // MicrosoftPeeringConfig - The Microsoft peering configuration. 2973 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` 2974 // Stats - Gets peering stats. 2975 Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` 2976 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2977 ProvisioningState *string `json:"provisioningState,omitempty"` 2978 // GatewayManagerEtag - The GatewayManager Etag. 2979 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` 2980 // LastModifiedBy - Gets whether the provider or the customer last modified the peering. 2981 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 2982} 2983 2984// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 2985// of a long-running operation. 2986type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { 2987 azure.FutureAPI 2988 // Result returns the result of the asynchronous operation. 2989 // If the operation has not completed it will return an error. 2990 Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error) 2991} 2992 2993// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2994func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 2995 var azFuture azure.Future 2996 if err := json.Unmarshal(body, &azFuture); err != nil { 2997 return err 2998 } 2999 future.FutureAPI = &azFuture 3000 future.Result = future.result 3001 return nil 3002} 3003 3004// result is the default implementation for ExpressRouteCircuitPeeringsCreateOrUpdateFuture.Result. 3005func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { 3006 var done bool 3007 done, err = future.DoneWithContext(context.Background(), client) 3008 if err != nil { 3009 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3010 return 3011 } 3012 if !done { 3013 ercp.Response.Response = future.Response() 3014 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") 3015 return 3016 } 3017 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3018 if ercp.Response.Response, err = future.GetResult(sender); err == nil && ercp.Response.Response.StatusCode != http.StatusNoContent { 3019 ercp, err = client.CreateOrUpdateResponder(ercp.Response.Response) 3020 if err != nil { 3021 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", ercp.Response.Response, "Failure responding to request") 3022 } 3023 } 3024 return 3025} 3026 3027// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a 3028// long-running operation. 3029type ExpressRouteCircuitPeeringsDeleteFuture struct { 3030 azure.FutureAPI 3031 // Result returns the result of the asynchronous operation. 3032 // If the operation has not completed it will return an error. 3033 Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error) 3034} 3035 3036// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3037func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { 3038 var azFuture azure.Future 3039 if err := json.Unmarshal(body, &azFuture); err != nil { 3040 return err 3041 } 3042 future.FutureAPI = &azFuture 3043 future.Result = future.result 3044 return nil 3045} 3046 3047// result is the default implementation for ExpressRouteCircuitPeeringsDeleteFuture.Result. 3048func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { 3049 var done bool 3050 done, err = future.DoneWithContext(context.Background(), client) 3051 if err != nil { 3052 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 3053 return 3054 } 3055 if !done { 3056 ar.Response = future.Response() 3057 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") 3058 return 3059 } 3060 ar.Response = future.Response() 3061 return 3062} 3063 3064// ExpressRouteCircuitPropertiesFormat properties of ExpressRouteCircuit. 3065type ExpressRouteCircuitPropertiesFormat struct { 3066 // AllowClassicOperations - Allow classic operations 3067 AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` 3068 // CircuitProvisioningState - The CircuitProvisioningState state of the resource. 3069 CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` 3070 // ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' 3071 ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` 3072 // Authorizations - The list of authorizations. 3073 Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` 3074 // Peerings - The list of peerings. 3075 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` 3076 // ServiceKey - The ServiceKey. 3077 ServiceKey *string `json:"serviceKey,omitempty"` 3078 // ServiceProviderNotes - The ServiceProviderNotes. 3079 ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` 3080 // ServiceProviderProperties - The ServiceProviderProperties. 3081 ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` 3082 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 3083 ProvisioningState *string `json:"provisioningState,omitempty"` 3084 // GatewayManagerEtag - The GatewayManager Etag. 3085 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` 3086} 3087 3088// ExpressRouteCircuitRoutesTable the routes table associated with the ExpressRouteCircuit 3089type ExpressRouteCircuitRoutesTable struct { 3090 // NetworkProperty - network 3091 NetworkProperty *string `json:"network,omitempty"` 3092 // NextHop - nextHop 3093 NextHop *string `json:"nextHop,omitempty"` 3094 // LocPrf - locPrf 3095 LocPrf *string `json:"locPrf,omitempty"` 3096 // Weight - weight. 3097 Weight *int32 `json:"weight,omitempty"` 3098 // Path - path 3099 Path *string `json:"path,omitempty"` 3100} 3101 3102// ExpressRouteCircuitRoutesTableSummary the routes table associated with the ExpressRouteCircuit. 3103type ExpressRouteCircuitRoutesTableSummary struct { 3104 // Neighbor - Neighbor 3105 Neighbor *string `json:"neighbor,omitempty"` 3106 // V - BGP version number spoken to the neighbor. 3107 V *int32 `json:"v,omitempty"` 3108 // As - Autonomous system number. 3109 As *int32 `json:"as,omitempty"` 3110 // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. 3111 UpDown *string `json:"upDown,omitempty"` 3112 // StatePfxRcd - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. 3113 StatePfxRcd *string `json:"statePfxRcd,omitempty"` 3114} 3115 3116// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route 3117// Circuits API. 3118type ExpressRouteCircuitsArpTableListResult struct { 3119 autorest.Response `json:"-"` 3120 // Value - Gets list of the ARP table. 3121 Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` 3122 // NextLink - The URL to get the next set of results. 3123 NextLink *string `json:"nextLink,omitempty"` 3124} 3125 3126// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3127// long-running operation. 3128type ExpressRouteCircuitsCreateOrUpdateFuture struct { 3129 azure.FutureAPI 3130 // Result returns the result of the asynchronous operation. 3131 // If the operation has not completed it will return an error. 3132 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error) 3133} 3134 3135// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3136func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3137 var azFuture azure.Future 3138 if err := json.Unmarshal(body, &azFuture); err != nil { 3139 return err 3140 } 3141 future.FutureAPI = &azFuture 3142 future.Result = future.result 3143 return nil 3144} 3145 3146// result is the default implementation for ExpressRouteCircuitsCreateOrUpdateFuture.Result. 3147func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { 3148 var done bool 3149 done, err = future.DoneWithContext(context.Background(), client) 3150 if err != nil { 3151 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3152 return 3153 } 3154 if !done { 3155 erc.Response.Response = future.Response() 3156 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") 3157 return 3158 } 3159 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3160 if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent { 3161 erc, err = client.CreateOrUpdateResponder(erc.Response.Response) 3162 if err != nil { 3163 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request") 3164 } 3165 } 3166 return 3167} 3168 3169// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a 3170// long-running operation. 3171type ExpressRouteCircuitsDeleteFuture struct { 3172 azure.FutureAPI 3173 // Result returns the result of the asynchronous operation. 3174 // If the operation has not completed it will return an error. 3175 Result func(ExpressRouteCircuitsClient) (autorest.Response, error) 3176} 3177 3178// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3179func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error { 3180 var azFuture azure.Future 3181 if err := json.Unmarshal(body, &azFuture); err != nil { 3182 return err 3183 } 3184 future.FutureAPI = &azFuture 3185 future.Result = future.result 3186 return nil 3187} 3188 3189// result is the default implementation for ExpressRouteCircuitsDeleteFuture.Result. 3190func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { 3191 var done bool 3192 done, err = future.DoneWithContext(context.Background(), client) 3193 if err != nil { 3194 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure") 3195 return 3196 } 3197 if !done { 3198 ar.Response = future.Response() 3199 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") 3200 return 3201 } 3202 ar.Response = future.Response() 3203 return 3204} 3205 3206// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an 3207// ExpressRouteCircuit. 3208type ExpressRouteCircuitServiceProviderProperties struct { 3209 // ServiceProviderName - The serviceProviderName. 3210 ServiceProviderName *string `json:"serviceProviderName,omitempty"` 3211 // PeeringLocation - The peering location. 3212 PeeringLocation *string `json:"peeringLocation,omitempty"` 3213 // BandwidthInMbps - The BandwidthInMbps. 3214 BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` 3215} 3216 3217// ExpressRouteCircuitSku contains SKU in an ExpressRouteCircuit. 3218type ExpressRouteCircuitSku struct { 3219 // Name - The name of the SKU. 3220 Name *string `json:"name,omitempty"` 3221 // Tier - The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium' 3222 Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` 3223 // Family - The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' 3224 Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` 3225} 3226 3227// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a 3228// long-running operation. 3229type ExpressRouteCircuitsListArpTableFuture struct { 3230 azure.FutureAPI 3231 // Result returns the result of the asynchronous operation. 3232 // If the operation has not completed it will return an error. 3233 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error) 3234} 3235 3236// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3237func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error { 3238 var azFuture azure.Future 3239 if err := json.Unmarshal(body, &azFuture); err != nil { 3240 return err 3241 } 3242 future.FutureAPI = &azFuture 3243 future.Result = future.result 3244 return nil 3245} 3246 3247// result is the default implementation for ExpressRouteCircuitsListArpTableFuture.Result. 3248func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { 3249 var done bool 3250 done, err = future.DoneWithContext(context.Background(), client) 3251 if err != nil { 3252 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure") 3253 return 3254 } 3255 if !done { 3256 ercatlr.Response.Response = future.Response() 3257 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") 3258 return 3259 } 3260 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3261 if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent { 3262 ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response) 3263 if err != nil { 3264 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request") 3265 } 3266 } 3267 return 3268} 3269 3270// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a 3271// long-running operation. 3272type ExpressRouteCircuitsListRoutesTableFuture struct { 3273 azure.FutureAPI 3274 // Result returns the result of the asynchronous operation. 3275 // If the operation has not completed it will return an error. 3276 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error) 3277} 3278 3279// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3280func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error { 3281 var azFuture azure.Future 3282 if err := json.Unmarshal(body, &azFuture); err != nil { 3283 return err 3284 } 3285 future.FutureAPI = &azFuture 3286 future.Result = future.result 3287 return nil 3288} 3289 3290// result is the default implementation for ExpressRouteCircuitsListRoutesTableFuture.Result. 3291func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { 3292 var done bool 3293 done, err = future.DoneWithContext(context.Background(), client) 3294 if err != nil { 3295 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure") 3296 return 3297 } 3298 if !done { 3299 ercrtlr.Response.Response = future.Response() 3300 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") 3301 return 3302 } 3303 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3304 if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent { 3305 ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response) 3306 if err != nil { 3307 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request") 3308 } 3309 } 3310 return 3311} 3312 3313// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the 3314// results of a long-running operation. 3315type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { 3316 azure.FutureAPI 3317 // Result returns the result of the asynchronous operation. 3318 // If the operation has not completed it will return an error. 3319 Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error) 3320} 3321 3322// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3323func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error { 3324 var azFuture azure.Future 3325 if err := json.Unmarshal(body, &azFuture); err != nil { 3326 return err 3327 } 3328 future.FutureAPI = &azFuture 3329 future.Result = future.result 3330 return nil 3331} 3332 3333// result is the default implementation for ExpressRouteCircuitsListRoutesTableSummaryFuture.Result. 3334func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { 3335 var done bool 3336 done, err = future.DoneWithContext(context.Background(), client) 3337 if err != nil { 3338 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") 3339 return 3340 } 3341 if !done { 3342 ercrtslr.Response.Response = future.Response() 3343 err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") 3344 return 3345 } 3346 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3347 if ercrtslr.Response.Response, err = future.GetResult(sender); err == nil && ercrtslr.Response.Response.StatusCode != http.StatusNoContent { 3348 ercrtslr, err = client.ListRoutesTableSummaryResponder(ercrtslr.Response.Response) 3349 if err != nil { 3350 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", ercrtslr.Response.Response, "Failure responding to request") 3351 } 3352 } 3353 return 3354} 3355 3356// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route 3357// Circuits API. 3358type ExpressRouteCircuitsRoutesTableListResult struct { 3359 autorest.Response `json:"-"` 3360 // Value - The list of routes table. 3361 Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` 3362 // NextLink - The URL to get the next set of results. 3363 NextLink *string `json:"nextLink,omitempty"` 3364} 3365 3366// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the 3367// Express Route Circuits API. 3368type ExpressRouteCircuitsRoutesTableSummaryListResult struct { 3369 autorest.Response `json:"-"` 3370 // Value - A list of the routes table. 3371 Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` 3372 // NextLink - The URL to get the next set of results. 3373 NextLink *string `json:"nextLink,omitempty"` 3374} 3375 3376// ExpressRouteCircuitStats contains stats associated with the peering. 3377type ExpressRouteCircuitStats struct { 3378 autorest.Response `json:"-"` 3379 // PrimarybytesIn - Gets BytesIn of the peering. 3380 PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` 3381 // PrimarybytesOut - Gets BytesOut of the peering. 3382 PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` 3383 // SecondarybytesIn - Gets BytesIn of the peering. 3384 SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` 3385 // SecondarybytesOut - Gets BytesOut of the peering. 3386 SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` 3387} 3388 3389// ExpressRouteServiceProvider a ExpressRouteResourceProvider object. 3390type ExpressRouteServiceProvider struct { 3391 *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` 3392 // ID - Resource ID. 3393 ID *string `json:"id,omitempty"` 3394 // Name - READ-ONLY; Resource name. 3395 Name *string `json:"name,omitempty"` 3396 // Type - READ-ONLY; Resource type. 3397 Type *string `json:"type,omitempty"` 3398 // Location - Resource location. 3399 Location *string `json:"location,omitempty"` 3400 // Tags - Resource tags. 3401 Tags map[string]*string `json:"tags"` 3402} 3403 3404// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider. 3405func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { 3406 objectMap := make(map[string]interface{}) 3407 if ersp.ExpressRouteServiceProviderPropertiesFormat != nil { 3408 objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat 3409 } 3410 if ersp.ID != nil { 3411 objectMap["id"] = ersp.ID 3412 } 3413 if ersp.Location != nil { 3414 objectMap["location"] = ersp.Location 3415 } 3416 if ersp.Tags != nil { 3417 objectMap["tags"] = ersp.Tags 3418 } 3419 return json.Marshal(objectMap) 3420} 3421 3422// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. 3423func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error { 3424 var m map[string]*json.RawMessage 3425 err := json.Unmarshal(body, &m) 3426 if err != nil { 3427 return err 3428 } 3429 for k, v := range m { 3430 switch k { 3431 case "properties": 3432 if v != nil { 3433 var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat 3434 err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat) 3435 if err != nil { 3436 return err 3437 } 3438 ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat 3439 } 3440 case "id": 3441 if v != nil { 3442 var ID string 3443 err = json.Unmarshal(*v, &ID) 3444 if err != nil { 3445 return err 3446 } 3447 ersp.ID = &ID 3448 } 3449 case "name": 3450 if v != nil { 3451 var name string 3452 err = json.Unmarshal(*v, &name) 3453 if err != nil { 3454 return err 3455 } 3456 ersp.Name = &name 3457 } 3458 case "type": 3459 if v != nil { 3460 var typeVar string 3461 err = json.Unmarshal(*v, &typeVar) 3462 if err != nil { 3463 return err 3464 } 3465 ersp.Type = &typeVar 3466 } 3467 case "location": 3468 if v != nil { 3469 var location string 3470 err = json.Unmarshal(*v, &location) 3471 if err != nil { 3472 return err 3473 } 3474 ersp.Location = &location 3475 } 3476 case "tags": 3477 if v != nil { 3478 var tags map[string]*string 3479 err = json.Unmarshal(*v, &tags) 3480 if err != nil { 3481 return err 3482 } 3483 ersp.Tags = tags 3484 } 3485 } 3486 } 3487 3488 return nil 3489} 3490 3491// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider 3492// resources. 3493type ExpressRouteServiceProviderBandwidthsOffered struct { 3494 // OfferName - The OfferName. 3495 OfferName *string `json:"offerName,omitempty"` 3496 // ValueInMbps - The ValueInMbps. 3497 ValueInMbps *int32 `json:"valueInMbps,omitempty"` 3498} 3499 3500// ExpressRouteServiceProviderListResult response for the ListExpressRouteServiceProvider API service call. 3501type ExpressRouteServiceProviderListResult struct { 3502 autorest.Response `json:"-"` 3503 // Value - A list of ExpressRouteResourceProvider resources. 3504 Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` 3505 // NextLink - The URL to get the next set of results. 3506 NextLink *string `json:"nextLink,omitempty"` 3507} 3508 3509// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of 3510// ExpressRouteServiceProvider values. 3511type ExpressRouteServiceProviderListResultIterator struct { 3512 i int 3513 page ExpressRouteServiceProviderListResultPage 3514} 3515 3516// NextWithContext advances to the next value. If there was an error making 3517// the request the iterator does not advance and the error is returned. 3518func (iter *ExpressRouteServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { 3519 if tracing.IsEnabled() { 3520 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultIterator.NextWithContext") 3521 defer func() { 3522 sc := -1 3523 if iter.Response().Response.Response != nil { 3524 sc = iter.Response().Response.Response.StatusCode 3525 } 3526 tracing.EndSpan(ctx, sc, err) 3527 }() 3528 } 3529 iter.i++ 3530 if iter.i < len(iter.page.Values()) { 3531 return nil 3532 } 3533 err = iter.page.NextWithContext(ctx) 3534 if err != nil { 3535 iter.i-- 3536 return err 3537 } 3538 iter.i = 0 3539 return nil 3540} 3541 3542// Next advances to the next value. If there was an error making 3543// the request the iterator does not advance and the error is returned. 3544// Deprecated: Use NextWithContext() instead. 3545func (iter *ExpressRouteServiceProviderListResultIterator) Next() error { 3546 return iter.NextWithContext(context.Background()) 3547} 3548 3549// NotDone returns true if the enumeration should be started or is not yet complete. 3550func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool { 3551 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3552} 3553 3554// Response returns the raw server response from the last page request. 3555func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult { 3556 return iter.page.Response() 3557} 3558 3559// Value returns the current value or a zero-initialized value if the 3560// iterator has advanced beyond the end of the collection. 3561func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider { 3562 if !iter.page.NotDone() { 3563 return ExpressRouteServiceProvider{} 3564 } 3565 return iter.page.Values()[iter.i] 3566} 3567 3568// Creates a new instance of the ExpressRouteServiceProviderListResultIterator type. 3569func NewExpressRouteServiceProviderListResultIterator(page ExpressRouteServiceProviderListResultPage) ExpressRouteServiceProviderListResultIterator { 3570 return ExpressRouteServiceProviderListResultIterator{page: page} 3571} 3572 3573// IsEmpty returns true if the ListResult contains no values. 3574func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { 3575 return ersplr.Value == nil || len(*ersplr.Value) == 0 3576} 3577 3578// hasNextLink returns true if the NextLink is not empty. 3579func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool { 3580 return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0 3581} 3582 3583// expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. 3584// It returns nil if no more results exist. 3585func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { 3586 if !ersplr.hasNextLink() { 3587 return nil, nil 3588 } 3589 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3590 autorest.AsJSON(), 3591 autorest.AsGet(), 3592 autorest.WithBaseURL(to.String(ersplr.NextLink))) 3593} 3594 3595// ExpressRouteServiceProviderListResultPage contains a page of ExpressRouteServiceProvider values. 3596type ExpressRouteServiceProviderListResultPage struct { 3597 fn func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error) 3598 ersplr ExpressRouteServiceProviderListResult 3599} 3600 3601// NextWithContext advances to the next page of values. If there was an error making 3602// the request the page does not advance and the error is returned. 3603func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) { 3604 if tracing.IsEnabled() { 3605 ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultPage.NextWithContext") 3606 defer func() { 3607 sc := -1 3608 if page.Response().Response.Response != nil { 3609 sc = page.Response().Response.Response.StatusCode 3610 } 3611 tracing.EndSpan(ctx, sc, err) 3612 }() 3613 } 3614 for { 3615 next, err := page.fn(ctx, page.ersplr) 3616 if err != nil { 3617 return err 3618 } 3619 page.ersplr = next 3620 if !next.hasNextLink() || !next.IsEmpty() { 3621 break 3622 } 3623 } 3624 return nil 3625} 3626 3627// Next advances to the next page of values. If there was an error making 3628// the request the page does not advance and the error is returned. 3629// Deprecated: Use NextWithContext() instead. 3630func (page *ExpressRouteServiceProviderListResultPage) Next() error { 3631 return page.NextWithContext(context.Background()) 3632} 3633 3634// NotDone returns true if the page enumeration should be started or is not yet complete. 3635func (page ExpressRouteServiceProviderListResultPage) NotDone() bool { 3636 return !page.ersplr.IsEmpty() 3637} 3638 3639// Response returns the raw server response from the last page request. 3640func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult { 3641 return page.ersplr 3642} 3643 3644// Values returns the slice of values for the current page or nil if there are no values. 3645func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider { 3646 if page.ersplr.IsEmpty() { 3647 return nil 3648 } 3649 return *page.ersplr.Value 3650} 3651 3652// Creates a new instance of the ExpressRouteServiceProviderListResultPage type. 3653func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage { 3654 return ExpressRouteServiceProviderListResultPage{ 3655 fn: getNextPage, 3656 ersplr: cur, 3657 } 3658} 3659 3660// ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider. 3661type ExpressRouteServiceProviderPropertiesFormat struct { 3662 // PeeringLocations - Get a list of peering locations. 3663 PeeringLocations *[]string `json:"peeringLocations,omitempty"` 3664 // BandwidthsOffered - Gets bandwidths offered. 3665 BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` 3666 // ProvisioningState - Gets the provisioning state of the resource. 3667 ProvisioningState *string `json:"provisioningState,omitempty"` 3668} 3669 3670// FlowLogInformation information on the configuration of flow log. 3671type FlowLogInformation struct { 3672 autorest.Response `json:"-"` 3673 // TargetResourceID - The ID of the resource to configure for flow logging. 3674 TargetResourceID *string `json:"targetResourceId,omitempty"` 3675 *FlowLogProperties `json:"properties,omitempty"` 3676} 3677 3678// MarshalJSON is the custom marshaler for FlowLogInformation. 3679func (fli FlowLogInformation) MarshalJSON() ([]byte, error) { 3680 objectMap := make(map[string]interface{}) 3681 if fli.TargetResourceID != nil { 3682 objectMap["targetResourceId"] = fli.TargetResourceID 3683 } 3684 if fli.FlowLogProperties != nil { 3685 objectMap["properties"] = fli.FlowLogProperties 3686 } 3687 return json.Marshal(objectMap) 3688} 3689 3690// UnmarshalJSON is the custom unmarshaler for FlowLogInformation struct. 3691func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { 3692 var m map[string]*json.RawMessage 3693 err := json.Unmarshal(body, &m) 3694 if err != nil { 3695 return err 3696 } 3697 for k, v := range m { 3698 switch k { 3699 case "targetResourceId": 3700 if v != nil { 3701 var targetResourceID string 3702 err = json.Unmarshal(*v, &targetResourceID) 3703 if err != nil { 3704 return err 3705 } 3706 fli.TargetResourceID = &targetResourceID 3707 } 3708 case "properties": 3709 if v != nil { 3710 var flowLogProperties FlowLogProperties 3711 err = json.Unmarshal(*v, &flowLogProperties) 3712 if err != nil { 3713 return err 3714 } 3715 fli.FlowLogProperties = &flowLogProperties 3716 } 3717 } 3718 } 3719 3720 return nil 3721} 3722 3723// FlowLogProperties parameters that define the configuration of flow log. 3724type FlowLogProperties struct { 3725 // StorageID - ID of the storage account which is used to store the flow log. 3726 StorageID *string `json:"storageId,omitempty"` 3727 // Enabled - Flag to enable/disable flow logging. 3728 Enabled *bool `json:"enabled,omitempty"` 3729 RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` 3730} 3731 3732// FlowLogStatusParameters parameters that define a resource to query flow log status. 3733type FlowLogStatusParameters struct { 3734 // TargetResourceID - The target resource where getting the flow logging status. 3735 TargetResourceID *string `json:"targetResourceId,omitempty"` 3736} 3737 3738// FrontendIPConfiguration frontend IP address of the load balancer. 3739type FrontendIPConfiguration struct { 3740 *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` 3741 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 3742 Name *string `json:"name,omitempty"` 3743 // Etag - A unique read-only string that changes whenever the resource is updated. 3744 Etag *string `json:"etag,omitempty"` 3745 // ID - Resource ID. 3746 ID *string `json:"id,omitempty"` 3747} 3748 3749// MarshalJSON is the custom marshaler for FrontendIPConfiguration. 3750func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) { 3751 objectMap := make(map[string]interface{}) 3752 if fic.FrontendIPConfigurationPropertiesFormat != nil { 3753 objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat 3754 } 3755 if fic.Name != nil { 3756 objectMap["name"] = fic.Name 3757 } 3758 if fic.Etag != nil { 3759 objectMap["etag"] = fic.Etag 3760 } 3761 if fic.ID != nil { 3762 objectMap["id"] = fic.ID 3763 } 3764 return json.Marshal(objectMap) 3765} 3766 3767// UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. 3768func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error { 3769 var m map[string]*json.RawMessage 3770 err := json.Unmarshal(body, &m) 3771 if err != nil { 3772 return err 3773 } 3774 for k, v := range m { 3775 switch k { 3776 case "properties": 3777 if v != nil { 3778 var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat 3779 err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat) 3780 if err != nil { 3781 return err 3782 } 3783 fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat 3784 } 3785 case "name": 3786 if v != nil { 3787 var name string 3788 err = json.Unmarshal(*v, &name) 3789 if err != nil { 3790 return err 3791 } 3792 fic.Name = &name 3793 } 3794 case "etag": 3795 if v != nil { 3796 var etag string 3797 err = json.Unmarshal(*v, &etag) 3798 if err != nil { 3799 return err 3800 } 3801 fic.Etag = &etag 3802 } 3803 case "id": 3804 if v != nil { 3805 var ID string 3806 err = json.Unmarshal(*v, &ID) 3807 if err != nil { 3808 return err 3809 } 3810 fic.ID = &ID 3811 } 3812 } 3813 } 3814 3815 return nil 3816} 3817 3818// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer. 3819type FrontendIPConfigurationPropertiesFormat struct { 3820 // InboundNatRules - READ-ONLY; Read only. Inbound rules URIs that use this frontend IP. 3821 InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` 3822 // InboundNatPools - READ-ONLY; Read only. Inbound pools URIs that use this frontend IP. 3823 InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` 3824 // OutboundNatRules - READ-ONLY; Read only. Outbound rules URIs that use this frontend IP. 3825 OutboundNatRules *[]SubResource `json:"outboundNatRules,omitempty"` 3826 // LoadBalancingRules - READ-ONLY; Gets load balancing rules URIs that use this frontend IP. 3827 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 3828 // PrivateIPAddress - The private IP address of the IP configuration. 3829 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 3830 // PrivateIPAllocationMethod - The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 3831 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 3832 // Subnet - The reference of the subnet resource. 3833 Subnet *Subnet `json:"subnet,omitempty"` 3834 // PublicIPAddress - The reference of the Public IP resource. 3835 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 3836 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 3837 ProvisioningState *string `json:"provisioningState,omitempty"` 3838} 3839 3840// MarshalJSON is the custom marshaler for FrontendIPConfigurationPropertiesFormat. 3841func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { 3842 objectMap := make(map[string]interface{}) 3843 if ficpf.PrivateIPAddress != nil { 3844 objectMap["privateIPAddress"] = ficpf.PrivateIPAddress 3845 } 3846 if ficpf.PrivateIPAllocationMethod != "" { 3847 objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod 3848 } 3849 if ficpf.Subnet != nil { 3850 objectMap["subnet"] = ficpf.Subnet 3851 } 3852 if ficpf.PublicIPAddress != nil { 3853 objectMap["publicIPAddress"] = ficpf.PublicIPAddress 3854 } 3855 if ficpf.ProvisioningState != nil { 3856 objectMap["provisioningState"] = ficpf.ProvisioningState 3857 } 3858 return json.Marshal(objectMap) 3859} 3860 3861// GatewayRoute ... 3862type GatewayRoute struct { 3863 // LocalAddress - READ-ONLY; The gateway's local address 3864 LocalAddress *string `json:"localAddress,omitempty"` 3865 // NetworkProperty - READ-ONLY; The route's network prefix 3866 NetworkProperty *string `json:"network,omitempty"` 3867 // NextHop - READ-ONLY; The route's next hop 3868 NextHop *string `json:"nextHop,omitempty"` 3869 // SourcePeer - READ-ONLY; The peer this route was learned from 3870 SourcePeer *string `json:"sourcePeer,omitempty"` 3871 // Origin - READ-ONLY; The source this route was learned from 3872 Origin *string `json:"origin,omitempty"` 3873 // AsPath - READ-ONLY; The route's AS path sequence 3874 AsPath *string `json:"asPath,omitempty"` 3875 // Weight - READ-ONLY; The route's weight 3876 Weight *int32 `json:"weight,omitempty"` 3877} 3878 3879// MarshalJSON is the custom marshaler for GatewayRoute. 3880func (gr GatewayRoute) MarshalJSON() ([]byte, error) { 3881 objectMap := make(map[string]interface{}) 3882 return json.Marshal(objectMap) 3883} 3884 3885// GatewayRouteListResult list of virtual network gateway routes 3886type GatewayRouteListResult struct { 3887 autorest.Response `json:"-"` 3888 // Value - List of gateway routes 3889 Value *[]GatewayRoute `json:"value,omitempty"` 3890} 3891 3892// InboundNatPool inbound NAT pool of the load balancer. 3893type InboundNatPool struct { 3894 *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` 3895 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 3896 Name *string `json:"name,omitempty"` 3897 // Etag - A unique read-only string that changes whenever the resource is updated. 3898 Etag *string `json:"etag,omitempty"` 3899 // ID - Resource ID. 3900 ID *string `json:"id,omitempty"` 3901} 3902 3903// MarshalJSON is the custom marshaler for InboundNatPool. 3904func (inp InboundNatPool) MarshalJSON() ([]byte, error) { 3905 objectMap := make(map[string]interface{}) 3906 if inp.InboundNatPoolPropertiesFormat != nil { 3907 objectMap["properties"] = inp.InboundNatPoolPropertiesFormat 3908 } 3909 if inp.Name != nil { 3910 objectMap["name"] = inp.Name 3911 } 3912 if inp.Etag != nil { 3913 objectMap["etag"] = inp.Etag 3914 } 3915 if inp.ID != nil { 3916 objectMap["id"] = inp.ID 3917 } 3918 return json.Marshal(objectMap) 3919} 3920 3921// UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. 3922func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { 3923 var m map[string]*json.RawMessage 3924 err := json.Unmarshal(body, &m) 3925 if err != nil { 3926 return err 3927 } 3928 for k, v := range m { 3929 switch k { 3930 case "properties": 3931 if v != nil { 3932 var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat 3933 err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat) 3934 if err != nil { 3935 return err 3936 } 3937 inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat 3938 } 3939 case "name": 3940 if v != nil { 3941 var name string 3942 err = json.Unmarshal(*v, &name) 3943 if err != nil { 3944 return err 3945 } 3946 inp.Name = &name 3947 } 3948 case "etag": 3949 if v != nil { 3950 var etag string 3951 err = json.Unmarshal(*v, &etag) 3952 if err != nil { 3953 return err 3954 } 3955 inp.Etag = &etag 3956 } 3957 case "id": 3958 if v != nil { 3959 var ID string 3960 err = json.Unmarshal(*v, &ID) 3961 if err != nil { 3962 return err 3963 } 3964 inp.ID = &ID 3965 } 3966 } 3967 } 3968 3969 return nil 3970} 3971 3972// InboundNatPoolPropertiesFormat properties of Inbound NAT pool. 3973type InboundNatPoolPropertiesFormat struct { 3974 // FrontendIPConfiguration - A reference to frontend IP addresses. 3975 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 3976 // Protocol - The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 3977 Protocol TransportProtocol `json:"protocol,omitempty"` 3978 // 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. 3979 FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` 3980 // 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. 3981 FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` 3982 // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. 3983 BackendPort *int32 `json:"backendPort,omitempty"` 3984 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 3985 ProvisioningState *string `json:"provisioningState,omitempty"` 3986} 3987 3988// InboundNatRule inbound NAT rule of the load balancer. 3989type InboundNatRule struct { 3990 *InboundNatRulePropertiesFormat `json:"properties,omitempty"` 3991 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 3992 Name *string `json:"name,omitempty"` 3993 // Etag - A unique read-only string that changes whenever the resource is updated. 3994 Etag *string `json:"etag,omitempty"` 3995 // ID - Resource ID. 3996 ID *string `json:"id,omitempty"` 3997} 3998 3999// MarshalJSON is the custom marshaler for InboundNatRule. 4000func (inr InboundNatRule) MarshalJSON() ([]byte, error) { 4001 objectMap := make(map[string]interface{}) 4002 if inr.InboundNatRulePropertiesFormat != nil { 4003 objectMap["properties"] = inr.InboundNatRulePropertiesFormat 4004 } 4005 if inr.Name != nil { 4006 objectMap["name"] = inr.Name 4007 } 4008 if inr.Etag != nil { 4009 objectMap["etag"] = inr.Etag 4010 } 4011 if inr.ID != nil { 4012 objectMap["id"] = inr.ID 4013 } 4014 return json.Marshal(objectMap) 4015} 4016 4017// UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. 4018func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { 4019 var m map[string]*json.RawMessage 4020 err := json.Unmarshal(body, &m) 4021 if err != nil { 4022 return err 4023 } 4024 for k, v := range m { 4025 switch k { 4026 case "properties": 4027 if v != nil { 4028 var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat 4029 err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat) 4030 if err != nil { 4031 return err 4032 } 4033 inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat 4034 } 4035 case "name": 4036 if v != nil { 4037 var name string 4038 err = json.Unmarshal(*v, &name) 4039 if err != nil { 4040 return err 4041 } 4042 inr.Name = &name 4043 } 4044 case "etag": 4045 if v != nil { 4046 var etag string 4047 err = json.Unmarshal(*v, &etag) 4048 if err != nil { 4049 return err 4050 } 4051 inr.Etag = &etag 4052 } 4053 case "id": 4054 if v != nil { 4055 var ID string 4056 err = json.Unmarshal(*v, &ID) 4057 if err != nil { 4058 return err 4059 } 4060 inr.ID = &ID 4061 } 4062 } 4063 } 4064 4065 return nil 4066} 4067 4068// InboundNatRulePropertiesFormat properties of the inbound NAT rule. 4069type InboundNatRulePropertiesFormat struct { 4070 // FrontendIPConfiguration - A reference to frontend IP addresses. 4071 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 4072 // BackendIPConfiguration - READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP. 4073 BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` 4074 // Protocol - The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 4075 Protocol TransportProtocol `json:"protocol,omitempty"` 4076 // 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. 4077 FrontendPort *int32 `json:"frontendPort,omitempty"` 4078 // BackendPort - The port used for the internal endpoint. Acceptable values range from 1 to 65535. 4079 BackendPort *int32 `json:"backendPort,omitempty"` 4080 // 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. 4081 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 4082 // 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. 4083 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 4084 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 4085 ProvisioningState *string `json:"provisioningState,omitempty"` 4086} 4087 4088// MarshalJSON is the custom marshaler for InboundNatRulePropertiesFormat. 4089func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) { 4090 objectMap := make(map[string]interface{}) 4091 if inrpf.FrontendIPConfiguration != nil { 4092 objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration 4093 } 4094 if inrpf.Protocol != "" { 4095 objectMap["protocol"] = inrpf.Protocol 4096 } 4097 if inrpf.FrontendPort != nil { 4098 objectMap["frontendPort"] = inrpf.FrontendPort 4099 } 4100 if inrpf.BackendPort != nil { 4101 objectMap["backendPort"] = inrpf.BackendPort 4102 } 4103 if inrpf.IdleTimeoutInMinutes != nil { 4104 objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes 4105 } 4106 if inrpf.EnableFloatingIP != nil { 4107 objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP 4108 } 4109 if inrpf.ProvisioningState != nil { 4110 objectMap["provisioningState"] = inrpf.ProvisioningState 4111 } 4112 return json.Marshal(objectMap) 4113} 4114 4115// Interface a network interface in a resource group. 4116type Interface struct { 4117 autorest.Response `json:"-"` 4118 *InterfacePropertiesFormat `json:"properties,omitempty"` 4119 // Etag - A unique read-only string that changes whenever the resource is updated. 4120 Etag *string `json:"etag,omitempty"` 4121 // ID - Resource ID. 4122 ID *string `json:"id,omitempty"` 4123 // Name - READ-ONLY; Resource name. 4124 Name *string `json:"name,omitempty"` 4125 // Type - READ-ONLY; Resource type. 4126 Type *string `json:"type,omitempty"` 4127 // Location - Resource location. 4128 Location *string `json:"location,omitempty"` 4129 // Tags - Resource tags. 4130 Tags map[string]*string `json:"tags"` 4131} 4132 4133// MarshalJSON is the custom marshaler for Interface. 4134func (i Interface) MarshalJSON() ([]byte, error) { 4135 objectMap := make(map[string]interface{}) 4136 if i.InterfacePropertiesFormat != nil { 4137 objectMap["properties"] = i.InterfacePropertiesFormat 4138 } 4139 if i.Etag != nil { 4140 objectMap["etag"] = i.Etag 4141 } 4142 if i.ID != nil { 4143 objectMap["id"] = i.ID 4144 } 4145 if i.Location != nil { 4146 objectMap["location"] = i.Location 4147 } 4148 if i.Tags != nil { 4149 objectMap["tags"] = i.Tags 4150 } 4151 return json.Marshal(objectMap) 4152} 4153 4154// UnmarshalJSON is the custom unmarshaler for Interface struct. 4155func (i *Interface) UnmarshalJSON(body []byte) error { 4156 var m map[string]*json.RawMessage 4157 err := json.Unmarshal(body, &m) 4158 if err != nil { 4159 return err 4160 } 4161 for k, v := range m { 4162 switch k { 4163 case "properties": 4164 if v != nil { 4165 var interfacePropertiesFormat InterfacePropertiesFormat 4166 err = json.Unmarshal(*v, &interfacePropertiesFormat) 4167 if err != nil { 4168 return err 4169 } 4170 i.InterfacePropertiesFormat = &interfacePropertiesFormat 4171 } 4172 case "etag": 4173 if v != nil { 4174 var etag string 4175 err = json.Unmarshal(*v, &etag) 4176 if err != nil { 4177 return err 4178 } 4179 i.Etag = &etag 4180 } 4181 case "id": 4182 if v != nil { 4183 var ID string 4184 err = json.Unmarshal(*v, &ID) 4185 if err != nil { 4186 return err 4187 } 4188 i.ID = &ID 4189 } 4190 case "name": 4191 if v != nil { 4192 var name string 4193 err = json.Unmarshal(*v, &name) 4194 if err != nil { 4195 return err 4196 } 4197 i.Name = &name 4198 } 4199 case "type": 4200 if v != nil { 4201 var typeVar string 4202 err = json.Unmarshal(*v, &typeVar) 4203 if err != nil { 4204 return err 4205 } 4206 i.Type = &typeVar 4207 } 4208 case "location": 4209 if v != nil { 4210 var location string 4211 err = json.Unmarshal(*v, &location) 4212 if err != nil { 4213 return err 4214 } 4215 i.Location = &location 4216 } 4217 case "tags": 4218 if v != nil { 4219 var tags map[string]*string 4220 err = json.Unmarshal(*v, &tags) 4221 if err != nil { 4222 return err 4223 } 4224 i.Tags = tags 4225 } 4226 } 4227 } 4228 4229 return nil 4230} 4231 4232// InterfaceAssociation network interface and its custom security rules. 4233type InterfaceAssociation struct { 4234 // ID - READ-ONLY; Network interface ID. 4235 ID *string `json:"id,omitempty"` 4236 // SecurityRules - Collection of custom security rules. 4237 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 4238} 4239 4240// MarshalJSON is the custom marshaler for InterfaceAssociation. 4241func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) { 4242 objectMap := make(map[string]interface{}) 4243 if ia.SecurityRules != nil { 4244 objectMap["securityRules"] = ia.SecurityRules 4245 } 4246 return json.Marshal(objectMap) 4247} 4248 4249// InterfaceDNSSettings DNS settings of a network interface. 4250type InterfaceDNSSettings struct { 4251 // 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. 4252 DNSServers *[]string `json:"dnsServers,omitempty"` 4253 // 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. 4254 AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` 4255 // InternalDNSNameLabel - Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. 4256 InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"` 4257 // InternalFqdn - Fully qualified DNS name supporting internal communications between VMs in the same virtual network. 4258 InternalFqdn *string `json:"internalFqdn,omitempty"` 4259 // InternalDomainNameSuffix - Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. 4260 InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` 4261} 4262 4263// InterfaceIPConfiguration iPConfiguration in a network interface. 4264type InterfaceIPConfiguration struct { 4265 *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` 4266 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 4267 Name *string `json:"name,omitempty"` 4268 // Etag - A unique read-only string that changes whenever the resource is updated. 4269 Etag *string `json:"etag,omitempty"` 4270 // ID - Resource ID. 4271 ID *string `json:"id,omitempty"` 4272} 4273 4274// MarshalJSON is the custom marshaler for InterfaceIPConfiguration. 4275func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { 4276 objectMap := make(map[string]interface{}) 4277 if iic.InterfaceIPConfigurationPropertiesFormat != nil { 4278 objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat 4279 } 4280 if iic.Name != nil { 4281 objectMap["name"] = iic.Name 4282 } 4283 if iic.Etag != nil { 4284 objectMap["etag"] = iic.Etag 4285 } 4286 if iic.ID != nil { 4287 objectMap["id"] = iic.ID 4288 } 4289 return json.Marshal(objectMap) 4290} 4291 4292// UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. 4293func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error { 4294 var m map[string]*json.RawMessage 4295 err := json.Unmarshal(body, &m) 4296 if err != nil { 4297 return err 4298 } 4299 for k, v := range m { 4300 switch k { 4301 case "properties": 4302 if v != nil { 4303 var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat 4304 err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat) 4305 if err != nil { 4306 return err 4307 } 4308 iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat 4309 } 4310 case "name": 4311 if v != nil { 4312 var name string 4313 err = json.Unmarshal(*v, &name) 4314 if err != nil { 4315 return err 4316 } 4317 iic.Name = &name 4318 } 4319 case "etag": 4320 if v != nil { 4321 var etag string 4322 err = json.Unmarshal(*v, &etag) 4323 if err != nil { 4324 return err 4325 } 4326 iic.Etag = &etag 4327 } 4328 case "id": 4329 if v != nil { 4330 var ID string 4331 err = json.Unmarshal(*v, &ID) 4332 if err != nil { 4333 return err 4334 } 4335 iic.ID = &ID 4336 } 4337 } 4338 } 4339 4340 return nil 4341} 4342 4343// InterfaceIPConfigurationPropertiesFormat properties of IP configuration. 4344type InterfaceIPConfigurationPropertiesFormat struct { 4345 // ApplicationGatewayBackendAddressPools - The reference of ApplicationGatewayBackendAddressPool resource. 4346 ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` 4347 // LoadBalancerBackendAddressPools - The reference of LoadBalancerBackendAddressPool resource. 4348 LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` 4349 // LoadBalancerInboundNatRules - A list of references of LoadBalancerInboundNatRules. 4350 LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` 4351 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 4352 // PrivateIPAllocationMethod - Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 4353 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 4354 // PrivateIPAddressVersion - Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 4355 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 4356 Subnet *Subnet `json:"subnet,omitempty"` 4357 // Primary - Gets whether this is a primary customer address on the network interface. 4358 Primary *bool `json:"primary,omitempty"` 4359 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 4360 ProvisioningState *string `json:"provisioningState,omitempty"` 4361} 4362 4363// InterfaceListResult response for the ListNetworkInterface API service call. 4364type InterfaceListResult struct { 4365 autorest.Response `json:"-"` 4366 // Value - A list of network interfaces in a resource group. 4367 Value *[]Interface `json:"value,omitempty"` 4368 // NextLink - The URL to get the next set of results. 4369 NextLink *string `json:"nextLink,omitempty"` 4370} 4371 4372// InterfaceListResultIterator provides access to a complete listing of Interface values. 4373type InterfaceListResultIterator struct { 4374 i int 4375 page InterfaceListResultPage 4376} 4377 4378// NextWithContext advances to the next value. If there was an error making 4379// the request the iterator does not advance and the error is returned. 4380func (iter *InterfaceListResultIterator) NextWithContext(ctx context.Context) (err error) { 4381 if tracing.IsEnabled() { 4382 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultIterator.NextWithContext") 4383 defer func() { 4384 sc := -1 4385 if iter.Response().Response.Response != nil { 4386 sc = iter.Response().Response.Response.StatusCode 4387 } 4388 tracing.EndSpan(ctx, sc, err) 4389 }() 4390 } 4391 iter.i++ 4392 if iter.i < len(iter.page.Values()) { 4393 return nil 4394 } 4395 err = iter.page.NextWithContext(ctx) 4396 if err != nil { 4397 iter.i-- 4398 return err 4399 } 4400 iter.i = 0 4401 return nil 4402} 4403 4404// Next advances to the next value. If there was an error making 4405// the request the iterator does not advance and the error is returned. 4406// Deprecated: Use NextWithContext() instead. 4407func (iter *InterfaceListResultIterator) Next() error { 4408 return iter.NextWithContext(context.Background()) 4409} 4410 4411// NotDone returns true if the enumeration should be started or is not yet complete. 4412func (iter InterfaceListResultIterator) NotDone() bool { 4413 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4414} 4415 4416// Response returns the raw server response from the last page request. 4417func (iter InterfaceListResultIterator) Response() InterfaceListResult { 4418 return iter.page.Response() 4419} 4420 4421// Value returns the current value or a zero-initialized value if the 4422// iterator has advanced beyond the end of the collection. 4423func (iter InterfaceListResultIterator) Value() Interface { 4424 if !iter.page.NotDone() { 4425 return Interface{} 4426 } 4427 return iter.page.Values()[iter.i] 4428} 4429 4430// Creates a new instance of the InterfaceListResultIterator type. 4431func NewInterfaceListResultIterator(page InterfaceListResultPage) InterfaceListResultIterator { 4432 return InterfaceListResultIterator{page: page} 4433} 4434 4435// IsEmpty returns true if the ListResult contains no values. 4436func (ilr InterfaceListResult) IsEmpty() bool { 4437 return ilr.Value == nil || len(*ilr.Value) == 0 4438} 4439 4440// hasNextLink returns true if the NextLink is not empty. 4441func (ilr InterfaceListResult) hasNextLink() bool { 4442 return ilr.NextLink != nil && len(*ilr.NextLink) != 0 4443} 4444 4445// interfaceListResultPreparer prepares a request to retrieve the next set of results. 4446// It returns nil if no more results exist. 4447func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) { 4448 if !ilr.hasNextLink() { 4449 return nil, nil 4450 } 4451 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4452 autorest.AsJSON(), 4453 autorest.AsGet(), 4454 autorest.WithBaseURL(to.String(ilr.NextLink))) 4455} 4456 4457// InterfaceListResultPage contains a page of Interface values. 4458type InterfaceListResultPage struct { 4459 fn func(context.Context, InterfaceListResult) (InterfaceListResult, error) 4460 ilr InterfaceListResult 4461} 4462 4463// NextWithContext advances to the next page of values. If there was an error making 4464// the request the page does not advance and the error is returned. 4465func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err error) { 4466 if tracing.IsEnabled() { 4467 ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultPage.NextWithContext") 4468 defer func() { 4469 sc := -1 4470 if page.Response().Response.Response != nil { 4471 sc = page.Response().Response.Response.StatusCode 4472 } 4473 tracing.EndSpan(ctx, sc, err) 4474 }() 4475 } 4476 for { 4477 next, err := page.fn(ctx, page.ilr) 4478 if err != nil { 4479 return err 4480 } 4481 page.ilr = next 4482 if !next.hasNextLink() || !next.IsEmpty() { 4483 break 4484 } 4485 } 4486 return nil 4487} 4488 4489// Next advances to the next page of values. If there was an error making 4490// the request the page does not advance and the error is returned. 4491// Deprecated: Use NextWithContext() instead. 4492func (page *InterfaceListResultPage) Next() error { 4493 return page.NextWithContext(context.Background()) 4494} 4495 4496// NotDone returns true if the page enumeration should be started or is not yet complete. 4497func (page InterfaceListResultPage) NotDone() bool { 4498 return !page.ilr.IsEmpty() 4499} 4500 4501// Response returns the raw server response from the last page request. 4502func (page InterfaceListResultPage) Response() InterfaceListResult { 4503 return page.ilr 4504} 4505 4506// Values returns the slice of values for the current page or nil if there are no values. 4507func (page InterfaceListResultPage) Values() []Interface { 4508 if page.ilr.IsEmpty() { 4509 return nil 4510 } 4511 return *page.ilr.Value 4512} 4513 4514// Creates a new instance of the InterfaceListResultPage type. 4515func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage { 4516 return InterfaceListResultPage{ 4517 fn: getNextPage, 4518 ilr: cur, 4519 } 4520} 4521 4522// InterfacePropertiesFormat networkInterface properties. 4523type InterfacePropertiesFormat struct { 4524 // VirtualMachine - The reference of a virtual machine. 4525 VirtualMachine *SubResource `json:"virtualMachine,omitempty"` 4526 // NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource. 4527 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 4528 // IPConfigurations - A list of IPConfigurations of the network interface. 4529 IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 4530 // DNSSettings - The DNS settings in network interface. 4531 DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` 4532 // MacAddress - The MAC address of the network interface. 4533 MacAddress *string `json:"macAddress,omitempty"` 4534 // Primary - Gets whether this is a primary network interface on a virtual machine. 4535 Primary *bool `json:"primary,omitempty"` 4536 // EnableAcceleratedNetworking - If the network interface is accelerated networking enabled. 4537 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 4538 // EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface. 4539 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 4540 // ResourceGUID - The resource GUID property of the network interface resource. 4541 ResourceGUID *string `json:"resourceGuid,omitempty"` 4542 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 4543 ProvisioningState *string `json:"provisioningState,omitempty"` 4544} 4545 4546// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4547// long-running operation. 4548type InterfacesCreateOrUpdateFuture struct { 4549 azure.FutureAPI 4550 // Result returns the result of the asynchronous operation. 4551 // If the operation has not completed it will return an error. 4552 Result func(InterfacesClient) (Interface, error) 4553} 4554 4555// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4556func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4557 var azFuture azure.Future 4558 if err := json.Unmarshal(body, &azFuture); err != nil { 4559 return err 4560 } 4561 future.FutureAPI = &azFuture 4562 future.Result = future.result 4563 return nil 4564} 4565 4566// result is the default implementation for InterfacesCreateOrUpdateFuture.Result. 4567func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) { 4568 var done bool 4569 done, err = future.DoneWithContext(context.Background(), client) 4570 if err != nil { 4571 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4572 return 4573 } 4574 if !done { 4575 i.Response.Response = future.Response() 4576 err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") 4577 return 4578 } 4579 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4580 if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { 4581 i, err = client.CreateOrUpdateResponder(i.Response.Response) 4582 if err != nil { 4583 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") 4584 } 4585 } 4586 return 4587} 4588 4589// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4590// operation. 4591type InterfacesDeleteFuture struct { 4592 azure.FutureAPI 4593 // Result returns the result of the asynchronous operation. 4594 // If the operation has not completed it will return an error. 4595 Result func(InterfacesClient) (autorest.Response, error) 4596} 4597 4598// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4599func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error { 4600 var azFuture azure.Future 4601 if err := json.Unmarshal(body, &azFuture); err != nil { 4602 return err 4603 } 4604 future.FutureAPI = &azFuture 4605 future.Result = future.result 4606 return nil 4607} 4608 4609// result is the default implementation for InterfacesDeleteFuture.Result. 4610func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) { 4611 var done bool 4612 done, err = future.DoneWithContext(context.Background(), client) 4613 if err != nil { 4614 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure") 4615 return 4616 } 4617 if !done { 4618 ar.Response = future.Response() 4619 err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") 4620 return 4621 } 4622 ar.Response = future.Response() 4623 return 4624} 4625 4626// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a 4627// long-running operation. 4628type InterfacesGetEffectiveRouteTableFuture struct { 4629 azure.FutureAPI 4630 // Result returns the result of the asynchronous operation. 4631 // If the operation has not completed it will return an error. 4632 Result func(InterfacesClient) (EffectiveRouteListResult, error) 4633} 4634 4635// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4636func (future *InterfacesGetEffectiveRouteTableFuture) UnmarshalJSON(body []byte) error { 4637 var azFuture azure.Future 4638 if err := json.Unmarshal(body, &azFuture); err != nil { 4639 return err 4640 } 4641 future.FutureAPI = &azFuture 4642 future.Result = future.result 4643 return nil 4644} 4645 4646// result is the default implementation for InterfacesGetEffectiveRouteTableFuture.Result. 4647func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) { 4648 var done bool 4649 done, err = future.DoneWithContext(context.Background(), client) 4650 if err != nil { 4651 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure") 4652 return 4653 } 4654 if !done { 4655 erlr.Response.Response = future.Response() 4656 err = azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture") 4657 return 4658 } 4659 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4660 if erlr.Response.Response, err = future.GetResult(sender); err == nil && erlr.Response.Response.StatusCode != http.StatusNoContent { 4661 erlr, err = client.GetEffectiveRouteTableResponder(erlr.Response.Response) 4662 if err != nil { 4663 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", erlr.Response.Response, "Failure responding to request") 4664 } 4665 } 4666 return 4667} 4668 4669// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the 4670// results of a long-running operation. 4671type InterfacesListEffectiveNetworkSecurityGroupsFuture struct { 4672 azure.FutureAPI 4673 // Result returns the result of the asynchronous operation. 4674 // If the operation has not completed it will return an error. 4675 Result func(InterfacesClient) (EffectiveNetworkSecurityGroupListResult, error) 4676} 4677 4678// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4679func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) UnmarshalJSON(body []byte) error { 4680 var azFuture azure.Future 4681 if err := json.Unmarshal(body, &azFuture); err != nil { 4682 return err 4683 } 4684 future.FutureAPI = &azFuture 4685 future.Result = future.result 4686 return nil 4687} 4688 4689// result is the default implementation for InterfacesListEffectiveNetworkSecurityGroupsFuture.Result. 4690func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) { 4691 var done bool 4692 done, err = future.DoneWithContext(context.Background(), client) 4693 if err != nil { 4694 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure") 4695 return 4696 } 4697 if !done { 4698 ensglr.Response.Response = future.Response() 4699 err = azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture") 4700 return 4701 } 4702 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4703 if ensglr.Response.Response, err = future.GetResult(sender); err == nil && ensglr.Response.Response.StatusCode != http.StatusNoContent { 4704 ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(ensglr.Response.Response) 4705 if err != nil { 4706 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", ensglr.Response.Response, "Failure responding to request") 4707 } 4708 } 4709 return 4710} 4711 4712// IPAddressAvailabilityResult response for CheckIPAddressAvailability API service call 4713type IPAddressAvailabilityResult struct { 4714 autorest.Response `json:"-"` 4715 // Available - Private IP address availability. 4716 Available *bool `json:"available,omitempty"` 4717 // AvailableIPAddresses - Contains other available private IP addresses if the asked for address is taken. 4718 AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` 4719} 4720 4721// IPConfiguration iPConfiguration 4722type IPConfiguration struct { 4723 *IPConfigurationPropertiesFormat `json:"properties,omitempty"` 4724 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 4725 Name *string `json:"name,omitempty"` 4726 // Etag - A unique read-only string that changes whenever the resource is updated. 4727 Etag *string `json:"etag,omitempty"` 4728 // ID - Resource ID. 4729 ID *string `json:"id,omitempty"` 4730} 4731 4732// MarshalJSON is the custom marshaler for IPConfiguration. 4733func (ic IPConfiguration) MarshalJSON() ([]byte, error) { 4734 objectMap := make(map[string]interface{}) 4735 if ic.IPConfigurationPropertiesFormat != nil { 4736 objectMap["properties"] = ic.IPConfigurationPropertiesFormat 4737 } 4738 if ic.Name != nil { 4739 objectMap["name"] = ic.Name 4740 } 4741 if ic.Etag != nil { 4742 objectMap["etag"] = ic.Etag 4743 } 4744 if ic.ID != nil { 4745 objectMap["id"] = ic.ID 4746 } 4747 return json.Marshal(objectMap) 4748} 4749 4750// UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. 4751func (ic *IPConfiguration) UnmarshalJSON(body []byte) error { 4752 var m map[string]*json.RawMessage 4753 err := json.Unmarshal(body, &m) 4754 if err != nil { 4755 return err 4756 } 4757 for k, v := range m { 4758 switch k { 4759 case "properties": 4760 if v != nil { 4761 var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat 4762 err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat) 4763 if err != nil { 4764 return err 4765 } 4766 ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat 4767 } 4768 case "name": 4769 if v != nil { 4770 var name string 4771 err = json.Unmarshal(*v, &name) 4772 if err != nil { 4773 return err 4774 } 4775 ic.Name = &name 4776 } 4777 case "etag": 4778 if v != nil { 4779 var etag string 4780 err = json.Unmarshal(*v, &etag) 4781 if err != nil { 4782 return err 4783 } 4784 ic.Etag = &etag 4785 } 4786 case "id": 4787 if v != nil { 4788 var ID string 4789 err = json.Unmarshal(*v, &ID) 4790 if err != nil { 4791 return err 4792 } 4793 ic.ID = &ID 4794 } 4795 } 4796 } 4797 4798 return nil 4799} 4800 4801// IPConfigurationPropertiesFormat properties of IP configuration. 4802type IPConfigurationPropertiesFormat struct { 4803 // PrivateIPAddress - The private IP address of the IP configuration. 4804 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 4805 // PrivateIPAllocationMethod - The private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 4806 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 4807 // Subnet - The reference of the subnet resource. 4808 Subnet *Subnet `json:"subnet,omitempty"` 4809 // PublicIPAddress - The reference of the public IP resource. 4810 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 4811 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 4812 ProvisioningState *string `json:"provisioningState,omitempty"` 4813} 4814 4815// LoadBalancer loadBalancer resource 4816type LoadBalancer struct { 4817 autorest.Response `json:"-"` 4818 *LoadBalancerPropertiesFormat `json:"properties,omitempty"` 4819 // Etag - A unique read-only string that changes whenever the resource is updated. 4820 Etag *string `json:"etag,omitempty"` 4821 // ID - Resource ID. 4822 ID *string `json:"id,omitempty"` 4823 // Name - READ-ONLY; Resource name. 4824 Name *string `json:"name,omitempty"` 4825 // Type - READ-ONLY; Resource type. 4826 Type *string `json:"type,omitempty"` 4827 // Location - Resource location. 4828 Location *string `json:"location,omitempty"` 4829 // Tags - Resource tags. 4830 Tags map[string]*string `json:"tags"` 4831} 4832 4833// MarshalJSON is the custom marshaler for LoadBalancer. 4834func (lb LoadBalancer) MarshalJSON() ([]byte, error) { 4835 objectMap := make(map[string]interface{}) 4836 if lb.LoadBalancerPropertiesFormat != nil { 4837 objectMap["properties"] = lb.LoadBalancerPropertiesFormat 4838 } 4839 if lb.Etag != nil { 4840 objectMap["etag"] = lb.Etag 4841 } 4842 if lb.ID != nil { 4843 objectMap["id"] = lb.ID 4844 } 4845 if lb.Location != nil { 4846 objectMap["location"] = lb.Location 4847 } 4848 if lb.Tags != nil { 4849 objectMap["tags"] = lb.Tags 4850 } 4851 return json.Marshal(objectMap) 4852} 4853 4854// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. 4855func (lb *LoadBalancer) UnmarshalJSON(body []byte) error { 4856 var m map[string]*json.RawMessage 4857 err := json.Unmarshal(body, &m) 4858 if err != nil { 4859 return err 4860 } 4861 for k, v := range m { 4862 switch k { 4863 case "properties": 4864 if v != nil { 4865 var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat 4866 err = json.Unmarshal(*v, &loadBalancerPropertiesFormat) 4867 if err != nil { 4868 return err 4869 } 4870 lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat 4871 } 4872 case "etag": 4873 if v != nil { 4874 var etag string 4875 err = json.Unmarshal(*v, &etag) 4876 if err != nil { 4877 return err 4878 } 4879 lb.Etag = &etag 4880 } 4881 case "id": 4882 if v != nil { 4883 var ID string 4884 err = json.Unmarshal(*v, &ID) 4885 if err != nil { 4886 return err 4887 } 4888 lb.ID = &ID 4889 } 4890 case "name": 4891 if v != nil { 4892 var name string 4893 err = json.Unmarshal(*v, &name) 4894 if err != nil { 4895 return err 4896 } 4897 lb.Name = &name 4898 } 4899 case "type": 4900 if v != nil { 4901 var typeVar string 4902 err = json.Unmarshal(*v, &typeVar) 4903 if err != nil { 4904 return err 4905 } 4906 lb.Type = &typeVar 4907 } 4908 case "location": 4909 if v != nil { 4910 var location string 4911 err = json.Unmarshal(*v, &location) 4912 if err != nil { 4913 return err 4914 } 4915 lb.Location = &location 4916 } 4917 case "tags": 4918 if v != nil { 4919 var tags map[string]*string 4920 err = json.Unmarshal(*v, &tags) 4921 if err != nil { 4922 return err 4923 } 4924 lb.Tags = tags 4925 } 4926 } 4927 } 4928 4929 return nil 4930} 4931 4932// LoadBalancerListResult response for ListLoadBalancers API service call. 4933type LoadBalancerListResult struct { 4934 autorest.Response `json:"-"` 4935 // Value - A list of load balancers in a resource group. 4936 Value *[]LoadBalancer `json:"value,omitempty"` 4937 // NextLink - The URL to get the next set of results. 4938 NextLink *string `json:"nextLink,omitempty"` 4939} 4940 4941// LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. 4942type LoadBalancerListResultIterator struct { 4943 i int 4944 page LoadBalancerListResultPage 4945} 4946 4947// NextWithContext advances to the next value. If there was an error making 4948// the request the iterator does not advance and the error is returned. 4949func (iter *LoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) { 4950 if tracing.IsEnabled() { 4951 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultIterator.NextWithContext") 4952 defer func() { 4953 sc := -1 4954 if iter.Response().Response.Response != nil { 4955 sc = iter.Response().Response.Response.StatusCode 4956 } 4957 tracing.EndSpan(ctx, sc, err) 4958 }() 4959 } 4960 iter.i++ 4961 if iter.i < len(iter.page.Values()) { 4962 return nil 4963 } 4964 err = iter.page.NextWithContext(ctx) 4965 if err != nil { 4966 iter.i-- 4967 return err 4968 } 4969 iter.i = 0 4970 return nil 4971} 4972 4973// Next advances to the next value. If there was an error making 4974// the request the iterator does not advance and the error is returned. 4975// Deprecated: Use NextWithContext() instead. 4976func (iter *LoadBalancerListResultIterator) Next() error { 4977 return iter.NextWithContext(context.Background()) 4978} 4979 4980// NotDone returns true if the enumeration should be started or is not yet complete. 4981func (iter LoadBalancerListResultIterator) NotDone() bool { 4982 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4983} 4984 4985// Response returns the raw server response from the last page request. 4986func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult { 4987 return iter.page.Response() 4988} 4989 4990// Value returns the current value or a zero-initialized value if the 4991// iterator has advanced beyond the end of the collection. 4992func (iter LoadBalancerListResultIterator) Value() LoadBalancer { 4993 if !iter.page.NotDone() { 4994 return LoadBalancer{} 4995 } 4996 return iter.page.Values()[iter.i] 4997} 4998 4999// Creates a new instance of the LoadBalancerListResultIterator type. 5000func NewLoadBalancerListResultIterator(page LoadBalancerListResultPage) LoadBalancerListResultIterator { 5001 return LoadBalancerListResultIterator{page: page} 5002} 5003 5004// IsEmpty returns true if the ListResult contains no values. 5005func (lblr LoadBalancerListResult) IsEmpty() bool { 5006 return lblr.Value == nil || len(*lblr.Value) == 0 5007} 5008 5009// hasNextLink returns true if the NextLink is not empty. 5010func (lblr LoadBalancerListResult) hasNextLink() bool { 5011 return lblr.NextLink != nil && len(*lblr.NextLink) != 0 5012} 5013 5014// loadBalancerListResultPreparer prepares a request to retrieve the next set of results. 5015// It returns nil if no more results exist. 5016func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) { 5017 if !lblr.hasNextLink() { 5018 return nil, nil 5019 } 5020 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5021 autorest.AsJSON(), 5022 autorest.AsGet(), 5023 autorest.WithBaseURL(to.String(lblr.NextLink))) 5024} 5025 5026// LoadBalancerListResultPage contains a page of LoadBalancer values. 5027type LoadBalancerListResultPage struct { 5028 fn func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error) 5029 lblr LoadBalancerListResult 5030} 5031 5032// NextWithContext advances to the next page of values. If there was an error making 5033// the request the page does not advance and the error is returned. 5034func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) { 5035 if tracing.IsEnabled() { 5036 ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultPage.NextWithContext") 5037 defer func() { 5038 sc := -1 5039 if page.Response().Response.Response != nil { 5040 sc = page.Response().Response.Response.StatusCode 5041 } 5042 tracing.EndSpan(ctx, sc, err) 5043 }() 5044 } 5045 for { 5046 next, err := page.fn(ctx, page.lblr) 5047 if err != nil { 5048 return err 5049 } 5050 page.lblr = next 5051 if !next.hasNextLink() || !next.IsEmpty() { 5052 break 5053 } 5054 } 5055 return nil 5056} 5057 5058// Next advances to the next page of values. If there was an error making 5059// the request the page does not advance and the error is returned. 5060// Deprecated: Use NextWithContext() instead. 5061func (page *LoadBalancerListResultPage) Next() error { 5062 return page.NextWithContext(context.Background()) 5063} 5064 5065// NotDone returns true if the page enumeration should be started or is not yet complete. 5066func (page LoadBalancerListResultPage) NotDone() bool { 5067 return !page.lblr.IsEmpty() 5068} 5069 5070// Response returns the raw server response from the last page request. 5071func (page LoadBalancerListResultPage) Response() LoadBalancerListResult { 5072 return page.lblr 5073} 5074 5075// Values returns the slice of values for the current page or nil if there are no values. 5076func (page LoadBalancerListResultPage) Values() []LoadBalancer { 5077 if page.lblr.IsEmpty() { 5078 return nil 5079 } 5080 return *page.lblr.Value 5081} 5082 5083// Creates a new instance of the LoadBalancerListResultPage type. 5084func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage { 5085 return LoadBalancerListResultPage{ 5086 fn: getNextPage, 5087 lblr: cur, 5088 } 5089} 5090 5091// LoadBalancerPropertiesFormat properties of the load balancer. 5092type LoadBalancerPropertiesFormat struct { 5093 // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer 5094 FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 5095 // BackendAddressPools - Collection of backend address pools used by a load balancer 5096 BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` 5097 // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning 5098 LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` 5099 // Probes - Collection of probe objects used in the load balancer 5100 Probes *[]Probe `json:"probes,omitempty"` 5101 // 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. 5102 InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` 5103 // 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. 5104 InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` 5105 // OutboundNatRules - The outbound NAT rules. 5106 OutboundNatRules *[]OutboundNatRule `json:"outboundNatRules,omitempty"` 5107 // ResourceGUID - The resource GUID property of the load balancer resource. 5108 ResourceGUID *string `json:"resourceGuid,omitempty"` 5109 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5110 ProvisioningState *string `json:"provisioningState,omitempty"` 5111} 5112 5113// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5114// long-running operation. 5115type LoadBalancersCreateOrUpdateFuture struct { 5116 azure.FutureAPI 5117 // Result returns the result of the asynchronous operation. 5118 // If the operation has not completed it will return an error. 5119 Result func(LoadBalancersClient) (LoadBalancer, error) 5120} 5121 5122// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5123func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5124 var azFuture azure.Future 5125 if err := json.Unmarshal(body, &azFuture); err != nil { 5126 return err 5127 } 5128 future.FutureAPI = &azFuture 5129 future.Result = future.result 5130 return nil 5131} 5132 5133// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. 5134func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { 5135 var done bool 5136 done, err = future.DoneWithContext(context.Background(), client) 5137 if err != nil { 5138 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5139 return 5140 } 5141 if !done { 5142 lb.Response.Response = future.Response() 5143 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") 5144 return 5145 } 5146 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5147 if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { 5148 lb, err = client.CreateOrUpdateResponder(lb.Response.Response) 5149 if err != nil { 5150 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request") 5151 } 5152 } 5153 return 5154} 5155 5156// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 5157// operation. 5158type LoadBalancersDeleteFuture struct { 5159 azure.FutureAPI 5160 // Result returns the result of the asynchronous operation. 5161 // If the operation has not completed it will return an error. 5162 Result func(LoadBalancersClient) (autorest.Response, error) 5163} 5164 5165// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5166func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { 5167 var azFuture azure.Future 5168 if err := json.Unmarshal(body, &azFuture); err != nil { 5169 return err 5170 } 5171 future.FutureAPI = &azFuture 5172 future.Result = future.result 5173 return nil 5174} 5175 5176// result is the default implementation for LoadBalancersDeleteFuture.Result. 5177func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { 5178 var done bool 5179 done, err = future.DoneWithContext(context.Background(), client) 5180 if err != nil { 5181 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") 5182 return 5183 } 5184 if !done { 5185 ar.Response = future.Response() 5186 err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") 5187 return 5188 } 5189 ar.Response = future.Response() 5190 return 5191} 5192 5193// LoadBalancingRule a load balancing rule for a load balancer. 5194type LoadBalancingRule struct { 5195 *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` 5196 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 5197 Name *string `json:"name,omitempty"` 5198 // Etag - A unique read-only string that changes whenever the resource is updated. 5199 Etag *string `json:"etag,omitempty"` 5200 // ID - Resource ID. 5201 ID *string `json:"id,omitempty"` 5202} 5203 5204// MarshalJSON is the custom marshaler for LoadBalancingRule. 5205func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { 5206 objectMap := make(map[string]interface{}) 5207 if lbr.LoadBalancingRulePropertiesFormat != nil { 5208 objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat 5209 } 5210 if lbr.Name != nil { 5211 objectMap["name"] = lbr.Name 5212 } 5213 if lbr.Etag != nil { 5214 objectMap["etag"] = lbr.Etag 5215 } 5216 if lbr.ID != nil { 5217 objectMap["id"] = lbr.ID 5218 } 5219 return json.Marshal(objectMap) 5220} 5221 5222// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. 5223func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { 5224 var m map[string]*json.RawMessage 5225 err := json.Unmarshal(body, &m) 5226 if err != nil { 5227 return err 5228 } 5229 for k, v := range m { 5230 switch k { 5231 case "properties": 5232 if v != nil { 5233 var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat 5234 err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) 5235 if err != nil { 5236 return err 5237 } 5238 lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat 5239 } 5240 case "name": 5241 if v != nil { 5242 var name string 5243 err = json.Unmarshal(*v, &name) 5244 if err != nil { 5245 return err 5246 } 5247 lbr.Name = &name 5248 } 5249 case "etag": 5250 if v != nil { 5251 var etag string 5252 err = json.Unmarshal(*v, &etag) 5253 if err != nil { 5254 return err 5255 } 5256 lbr.Etag = &etag 5257 } 5258 case "id": 5259 if v != nil { 5260 var ID string 5261 err = json.Unmarshal(*v, &ID) 5262 if err != nil { 5263 return err 5264 } 5265 lbr.ID = &ID 5266 } 5267 } 5268 } 5269 5270 return nil 5271} 5272 5273// LoadBalancingRulePropertiesFormat properties of the load balancer. 5274type LoadBalancingRulePropertiesFormat struct { 5275 // FrontendIPConfiguration - A reference to frontend IP addresses. 5276 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 5277 // BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. 5278 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 5279 // Probe - The reference of the load balancer probe used by the load balancing rule. 5280 Probe *SubResource `json:"probe,omitempty"` 5281 // Protocol - The transport protocol for the external endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 5282 Protocol TransportProtocol `json:"protocol,omitempty"` 5283 // LoadDistribution - The load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' 5284 LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` 5285 // 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. 5286 FrontendPort *int32 `json:"frontendPort,omitempty"` 5287 // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. 5288 BackendPort *int32 `json:"backendPort,omitempty"` 5289 // 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. 5290 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 5291 // 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. 5292 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 5293 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5294 ProvisioningState *string `json:"provisioningState,omitempty"` 5295} 5296 5297// LocalNetworkGateway a common class for general resource information 5298type LocalNetworkGateway struct { 5299 autorest.Response `json:"-"` 5300 *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 5301 // Etag - A unique read-only string that changes whenever the resource is updated. 5302 Etag *string `json:"etag,omitempty"` 5303 // ID - Resource ID. 5304 ID *string `json:"id,omitempty"` 5305 // Name - READ-ONLY; Resource name. 5306 Name *string `json:"name,omitempty"` 5307 // Type - READ-ONLY; Resource type. 5308 Type *string `json:"type,omitempty"` 5309 // Location - Resource location. 5310 Location *string `json:"location,omitempty"` 5311 // Tags - Resource tags. 5312 Tags map[string]*string `json:"tags"` 5313} 5314 5315// MarshalJSON is the custom marshaler for LocalNetworkGateway. 5316func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { 5317 objectMap := make(map[string]interface{}) 5318 if lng.LocalNetworkGatewayPropertiesFormat != nil { 5319 objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat 5320 } 5321 if lng.Etag != nil { 5322 objectMap["etag"] = lng.Etag 5323 } 5324 if lng.ID != nil { 5325 objectMap["id"] = lng.ID 5326 } 5327 if lng.Location != nil { 5328 objectMap["location"] = lng.Location 5329 } 5330 if lng.Tags != nil { 5331 objectMap["tags"] = lng.Tags 5332 } 5333 return json.Marshal(objectMap) 5334} 5335 5336// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. 5337func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { 5338 var m map[string]*json.RawMessage 5339 err := json.Unmarshal(body, &m) 5340 if err != nil { 5341 return err 5342 } 5343 for k, v := range m { 5344 switch k { 5345 case "properties": 5346 if v != nil { 5347 var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat 5348 err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) 5349 if err != nil { 5350 return err 5351 } 5352 lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat 5353 } 5354 case "etag": 5355 if v != nil { 5356 var etag string 5357 err = json.Unmarshal(*v, &etag) 5358 if err != nil { 5359 return err 5360 } 5361 lng.Etag = &etag 5362 } 5363 case "id": 5364 if v != nil { 5365 var ID string 5366 err = json.Unmarshal(*v, &ID) 5367 if err != nil { 5368 return err 5369 } 5370 lng.ID = &ID 5371 } 5372 case "name": 5373 if v != nil { 5374 var name string 5375 err = json.Unmarshal(*v, &name) 5376 if err != nil { 5377 return err 5378 } 5379 lng.Name = &name 5380 } 5381 case "type": 5382 if v != nil { 5383 var typeVar string 5384 err = json.Unmarshal(*v, &typeVar) 5385 if err != nil { 5386 return err 5387 } 5388 lng.Type = &typeVar 5389 } 5390 case "location": 5391 if v != nil { 5392 var location string 5393 err = json.Unmarshal(*v, &location) 5394 if err != nil { 5395 return err 5396 } 5397 lng.Location = &location 5398 } 5399 case "tags": 5400 if v != nil { 5401 var tags map[string]*string 5402 err = json.Unmarshal(*v, &tags) 5403 if err != nil { 5404 return err 5405 } 5406 lng.Tags = tags 5407 } 5408 } 5409 } 5410 5411 return nil 5412} 5413 5414// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call. 5415type LocalNetworkGatewayListResult struct { 5416 autorest.Response `json:"-"` 5417 // Value - A list of local network gateways that exists in a resource group. 5418 Value *[]LocalNetworkGateway `json:"value,omitempty"` 5419 // NextLink - The URL to get the next set of results. 5420 NextLink *string `json:"nextLink,omitempty"` 5421} 5422 5423// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway 5424// values. 5425type LocalNetworkGatewayListResultIterator struct { 5426 i int 5427 page LocalNetworkGatewayListResultPage 5428} 5429 5430// NextWithContext advances to the next value. If there was an error making 5431// the request the iterator does not advance and the error is returned. 5432func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 5433 if tracing.IsEnabled() { 5434 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext") 5435 defer func() { 5436 sc := -1 5437 if iter.Response().Response.Response != nil { 5438 sc = iter.Response().Response.Response.StatusCode 5439 } 5440 tracing.EndSpan(ctx, sc, err) 5441 }() 5442 } 5443 iter.i++ 5444 if iter.i < len(iter.page.Values()) { 5445 return nil 5446 } 5447 err = iter.page.NextWithContext(ctx) 5448 if err != nil { 5449 iter.i-- 5450 return err 5451 } 5452 iter.i = 0 5453 return nil 5454} 5455 5456// Next advances to the next value. If there was an error making 5457// the request the iterator does not advance and the error is returned. 5458// Deprecated: Use NextWithContext() instead. 5459func (iter *LocalNetworkGatewayListResultIterator) Next() error { 5460 return iter.NextWithContext(context.Background()) 5461} 5462 5463// NotDone returns true if the enumeration should be started or is not yet complete. 5464func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { 5465 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5466} 5467 5468// Response returns the raw server response from the last page request. 5469func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { 5470 return iter.page.Response() 5471} 5472 5473// Value returns the current value or a zero-initialized value if the 5474// iterator has advanced beyond the end of the collection. 5475func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { 5476 if !iter.page.NotDone() { 5477 return LocalNetworkGateway{} 5478 } 5479 return iter.page.Values()[iter.i] 5480} 5481 5482// Creates a new instance of the LocalNetworkGatewayListResultIterator type. 5483func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator { 5484 return LocalNetworkGatewayListResultIterator{page: page} 5485} 5486 5487// IsEmpty returns true if the ListResult contains no values. 5488func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { 5489 return lnglr.Value == nil || len(*lnglr.Value) == 0 5490} 5491 5492// hasNextLink returns true if the NextLink is not empty. 5493func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { 5494 return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 5495} 5496 5497// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 5498// It returns nil if no more results exist. 5499func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 5500 if !lnglr.hasNextLink() { 5501 return nil, nil 5502 } 5503 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5504 autorest.AsJSON(), 5505 autorest.AsGet(), 5506 autorest.WithBaseURL(to.String(lnglr.NextLink))) 5507} 5508 5509// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. 5510type LocalNetworkGatewayListResultPage struct { 5511 fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) 5512 lnglr LocalNetworkGatewayListResult 5513} 5514 5515// NextWithContext advances to the next page of values. If there was an error making 5516// the request the page does not advance and the error is returned. 5517func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 5518 if tracing.IsEnabled() { 5519 ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext") 5520 defer func() { 5521 sc := -1 5522 if page.Response().Response.Response != nil { 5523 sc = page.Response().Response.Response.StatusCode 5524 } 5525 tracing.EndSpan(ctx, sc, err) 5526 }() 5527 } 5528 for { 5529 next, err := page.fn(ctx, page.lnglr) 5530 if err != nil { 5531 return err 5532 } 5533 page.lnglr = next 5534 if !next.hasNextLink() || !next.IsEmpty() { 5535 break 5536 } 5537 } 5538 return nil 5539} 5540 5541// Next advances to the next page of values. If there was an error making 5542// the request the page does not advance and the error is returned. 5543// Deprecated: Use NextWithContext() instead. 5544func (page *LocalNetworkGatewayListResultPage) Next() error { 5545 return page.NextWithContext(context.Background()) 5546} 5547 5548// NotDone returns true if the page enumeration should be started or is not yet complete. 5549func (page LocalNetworkGatewayListResultPage) NotDone() bool { 5550 return !page.lnglr.IsEmpty() 5551} 5552 5553// Response returns the raw server response from the last page request. 5554func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { 5555 return page.lnglr 5556} 5557 5558// Values returns the slice of values for the current page or nil if there are no values. 5559func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { 5560 if page.lnglr.IsEmpty() { 5561 return nil 5562 } 5563 return *page.lnglr.Value 5564} 5565 5566// Creates a new instance of the LocalNetworkGatewayListResultPage type. 5567func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { 5568 return LocalNetworkGatewayListResultPage{ 5569 fn: getNextPage, 5570 lnglr: cur, 5571 } 5572} 5573 5574// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties 5575type LocalNetworkGatewayPropertiesFormat struct { 5576 // LocalNetworkAddressSpace - Local network site address space. 5577 LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` 5578 // GatewayIPAddress - IP address of local network gateway. 5579 GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` 5580 // BgpSettings - Local network gateway's BGP speaker settings. 5581 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 5582 // ResourceGUID - The resource GUID property of the LocalNetworkGateway resource. 5583 ResourceGUID *string `json:"resourceGuid,omitempty"` 5584 // ProvisioningState - READ-ONLY; The provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5585 ProvisioningState *string `json:"provisioningState,omitempty"` 5586} 5587 5588// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. 5589func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { 5590 objectMap := make(map[string]interface{}) 5591 if lngpf.LocalNetworkAddressSpace != nil { 5592 objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace 5593 } 5594 if lngpf.GatewayIPAddress != nil { 5595 objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress 5596 } 5597 if lngpf.BgpSettings != nil { 5598 objectMap["bgpSettings"] = lngpf.BgpSettings 5599 } 5600 if lngpf.ResourceGUID != nil { 5601 objectMap["resourceGuid"] = lngpf.ResourceGUID 5602 } 5603 return json.Marshal(objectMap) 5604} 5605 5606// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 5607// long-running operation. 5608type LocalNetworkGatewaysCreateOrUpdateFuture struct { 5609 azure.FutureAPI 5610 // Result returns the result of the asynchronous operation. 5611 // If the operation has not completed it will return an error. 5612 Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) 5613} 5614 5615// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5616func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 5617 var azFuture azure.Future 5618 if err := json.Unmarshal(body, &azFuture); err != nil { 5619 return err 5620 } 5621 future.FutureAPI = &azFuture 5622 future.Result = future.result 5623 return nil 5624} 5625 5626// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. 5627func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { 5628 var done bool 5629 done, err = future.DoneWithContext(context.Background(), client) 5630 if err != nil { 5631 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5632 return 5633 } 5634 if !done { 5635 lng.Response.Response = future.Response() 5636 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") 5637 return 5638 } 5639 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5640 if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { 5641 lng, err = client.CreateOrUpdateResponder(lng.Response.Response) 5642 if err != nil { 5643 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request") 5644 } 5645 } 5646 return 5647} 5648 5649// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 5650// long-running operation. 5651type LocalNetworkGatewaysDeleteFuture struct { 5652 azure.FutureAPI 5653 // Result returns the result of the asynchronous operation. 5654 // If the operation has not completed it will return an error. 5655 Result func(LocalNetworkGatewaysClient) (autorest.Response, error) 5656} 5657 5658// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5659func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 5660 var azFuture azure.Future 5661 if err := json.Unmarshal(body, &azFuture); err != nil { 5662 return err 5663 } 5664 future.FutureAPI = &azFuture 5665 future.Result = future.result 5666 return nil 5667} 5668 5669// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. 5670func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { 5671 var done bool 5672 done, err = future.DoneWithContext(context.Background(), client) 5673 if err != nil { 5674 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 5675 return 5676 } 5677 if !done { 5678 ar.Response = future.Response() 5679 err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") 5680 return 5681 } 5682 ar.Response = future.Response() 5683 return 5684} 5685 5686// NextHopParameters parameters that define the source and destination endpoint. 5687type NextHopParameters struct { 5688 // TargetResourceID - The resource identifier of the target resource against which the action is to be performed. 5689 TargetResourceID *string `json:"targetResourceId,omitempty"` 5690 // SourceIPAddress - The source IP address. 5691 SourceIPAddress *string `json:"sourceIPAddress,omitempty"` 5692 // DestinationIPAddress - The destination IP address. 5693 DestinationIPAddress *string `json:"destinationIPAddress,omitempty"` 5694 // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). 5695 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` 5696} 5697 5698// NextHopResult the information about next hop from the specified VM. 5699type NextHopResult struct { 5700 autorest.Response `json:"-"` 5701 // NextHopType - Next hop type. Possible values include: 'NextHopTypeInternet', 'NextHopTypeVirtualAppliance', 'NextHopTypeVirtualNetworkGateway', 'NextHopTypeVnetLocal', 'NextHopTypeHyperNetGateway', 'NextHopTypeNone' 5702 NextHopType NextHopType `json:"nextHopType,omitempty"` 5703 // NextHopIPAddress - Next hop IP Address 5704 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` 5705 // RouteTableID - The resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. 5706 RouteTableID *string `json:"routeTableId,omitempty"` 5707} 5708 5709// OutboundNatRule outbound NAT pool of the load balancer. 5710type OutboundNatRule struct { 5711 *OutboundNatRulePropertiesFormat `json:"properties,omitempty"` 5712 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 5713 Name *string `json:"name,omitempty"` 5714 // Etag - A unique read-only string that changes whenever the resource is updated. 5715 Etag *string `json:"etag,omitempty"` 5716 // ID - Resource ID. 5717 ID *string `json:"id,omitempty"` 5718} 5719 5720// MarshalJSON is the custom marshaler for OutboundNatRule. 5721func (onr OutboundNatRule) MarshalJSON() ([]byte, error) { 5722 objectMap := make(map[string]interface{}) 5723 if onr.OutboundNatRulePropertiesFormat != nil { 5724 objectMap["properties"] = onr.OutboundNatRulePropertiesFormat 5725 } 5726 if onr.Name != nil { 5727 objectMap["name"] = onr.Name 5728 } 5729 if onr.Etag != nil { 5730 objectMap["etag"] = onr.Etag 5731 } 5732 if onr.ID != nil { 5733 objectMap["id"] = onr.ID 5734 } 5735 return json.Marshal(objectMap) 5736} 5737 5738// UnmarshalJSON is the custom unmarshaler for OutboundNatRule struct. 5739func (onr *OutboundNatRule) UnmarshalJSON(body []byte) error { 5740 var m map[string]*json.RawMessage 5741 err := json.Unmarshal(body, &m) 5742 if err != nil { 5743 return err 5744 } 5745 for k, v := range m { 5746 switch k { 5747 case "properties": 5748 if v != nil { 5749 var outboundNatRulePropertiesFormat OutboundNatRulePropertiesFormat 5750 err = json.Unmarshal(*v, &outboundNatRulePropertiesFormat) 5751 if err != nil { 5752 return err 5753 } 5754 onr.OutboundNatRulePropertiesFormat = &outboundNatRulePropertiesFormat 5755 } 5756 case "name": 5757 if v != nil { 5758 var name string 5759 err = json.Unmarshal(*v, &name) 5760 if err != nil { 5761 return err 5762 } 5763 onr.Name = &name 5764 } 5765 case "etag": 5766 if v != nil { 5767 var etag string 5768 err = json.Unmarshal(*v, &etag) 5769 if err != nil { 5770 return err 5771 } 5772 onr.Etag = &etag 5773 } 5774 case "id": 5775 if v != nil { 5776 var ID string 5777 err = json.Unmarshal(*v, &ID) 5778 if err != nil { 5779 return err 5780 } 5781 onr.ID = &ID 5782 } 5783 } 5784 } 5785 5786 return nil 5787} 5788 5789// OutboundNatRulePropertiesFormat outbound NAT pool of the load balancer. 5790type OutboundNatRulePropertiesFormat struct { 5791 // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. 5792 AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` 5793 // FrontendIPConfigurations - The Frontend IP addresses of the load balancer. 5794 FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` 5795 // BackendAddressPool - A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. 5796 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 5797 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5798 ProvisioningState *string `json:"provisioningState,omitempty"` 5799} 5800 5801// PacketCapture parameters that define the create packet capture operation. 5802type PacketCapture struct { 5803 *PacketCaptureParameters `json:"properties,omitempty"` 5804} 5805 5806// MarshalJSON is the custom marshaler for PacketCapture. 5807func (pc PacketCapture) MarshalJSON() ([]byte, error) { 5808 objectMap := make(map[string]interface{}) 5809 if pc.PacketCaptureParameters != nil { 5810 objectMap["properties"] = pc.PacketCaptureParameters 5811 } 5812 return json.Marshal(objectMap) 5813} 5814 5815// UnmarshalJSON is the custom unmarshaler for PacketCapture struct. 5816func (pc *PacketCapture) UnmarshalJSON(body []byte) error { 5817 var m map[string]*json.RawMessage 5818 err := json.Unmarshal(body, &m) 5819 if err != nil { 5820 return err 5821 } 5822 for k, v := range m { 5823 switch k { 5824 case "properties": 5825 if v != nil { 5826 var packetCaptureParameters PacketCaptureParameters 5827 err = json.Unmarshal(*v, &packetCaptureParameters) 5828 if err != nil { 5829 return err 5830 } 5831 pc.PacketCaptureParameters = &packetCaptureParameters 5832 } 5833 } 5834 } 5835 5836 return nil 5837} 5838 5839// PacketCaptureFilter filter that is applied to packet capture request. Multiple filters can be applied. 5840type PacketCaptureFilter struct { 5841 // Protocol - Protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any' 5842 Protocol PcProtocol `json:"protocol,omitempty"` 5843 // LocalIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 5844 LocalIPAddress *string `json:"localIPAddress,omitempty"` 5845 // RemoteIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 5846 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` 5847 // LocalPort - Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 5848 LocalPort *string `json:"localPort,omitempty"` 5849 // RemotePort - Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 5850 RemotePort *string `json:"remotePort,omitempty"` 5851} 5852 5853// PacketCaptureListResult list of packet capture sessions. 5854type PacketCaptureListResult struct { 5855 autorest.Response `json:"-"` 5856 // Value - Information about packet capture sessions. 5857 Value *[]PacketCaptureResult `json:"value,omitempty"` 5858} 5859 5860// PacketCaptureParameters parameters that define the create packet capture operation. 5861type PacketCaptureParameters struct { 5862 // Target - The ID of the targeted resource, only VM is currently supported. 5863 Target *string `json:"target,omitempty"` 5864 // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. 5865 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` 5866 // TotalBytesPerSession - Maximum size of the capture output. 5867 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` 5868 // TimeLimitInSeconds - Maximum duration of the capture session in seconds. 5869 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` 5870 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` 5871 Filters *[]PacketCaptureFilter `json:"filters,omitempty"` 5872} 5873 5874// PacketCaptureQueryStatusResult status of packet capture session. 5875type PacketCaptureQueryStatusResult struct { 5876 autorest.Response `json:"-"` 5877 // Name - The name of the packet capture resource. 5878 Name *string `json:"name,omitempty"` 5879 // ID - The ID of the packet capture resource. 5880 ID *string `json:"id,omitempty"` 5881 // CaptureStartTime - The start time of the packet capture session. 5882 CaptureStartTime *date.Time `json:"captureStartTime,omitempty"` 5883 // PacketCaptureStatus - The status of the packet capture session. Possible values include: 'PcStatusNotStarted', 'PcStatusRunning', 'PcStatusStopped', 'PcStatusError', 'PcStatusUnknown' 5884 PacketCaptureStatus PcStatus `json:"packetCaptureStatus,omitempty"` 5885 // StopReason - The reason the current packet capture session was stopped. 5886 StopReason *string `json:"stopReason,omitempty"` 5887 // PacketCaptureError - List of errors of packet capture session. 5888 PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"` 5889} 5890 5891// PacketCaptureResult information about packet capture session. 5892type PacketCaptureResult struct { 5893 autorest.Response `json:"-"` 5894 // Name - READ-ONLY; Name of the packet capture session. 5895 Name *string `json:"name,omitempty"` 5896 // ID - READ-ONLY; ID of the packet capture operation. 5897 ID *string `json:"id,omitempty"` 5898 Etag *string `json:"etag,omitempty"` 5899 *PacketCaptureResultProperties `json:"properties,omitempty"` 5900} 5901 5902// MarshalJSON is the custom marshaler for PacketCaptureResult. 5903func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) { 5904 objectMap := make(map[string]interface{}) 5905 if pcr.Etag != nil { 5906 objectMap["etag"] = pcr.Etag 5907 } 5908 if pcr.PacketCaptureResultProperties != nil { 5909 objectMap["properties"] = pcr.PacketCaptureResultProperties 5910 } 5911 return json.Marshal(objectMap) 5912} 5913 5914// UnmarshalJSON is the custom unmarshaler for PacketCaptureResult struct. 5915func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { 5916 var m map[string]*json.RawMessage 5917 err := json.Unmarshal(body, &m) 5918 if err != nil { 5919 return err 5920 } 5921 for k, v := range m { 5922 switch k { 5923 case "name": 5924 if v != nil { 5925 var name string 5926 err = json.Unmarshal(*v, &name) 5927 if err != nil { 5928 return err 5929 } 5930 pcr.Name = &name 5931 } 5932 case "id": 5933 if v != nil { 5934 var ID string 5935 err = json.Unmarshal(*v, &ID) 5936 if err != nil { 5937 return err 5938 } 5939 pcr.ID = &ID 5940 } 5941 case "etag": 5942 if v != nil { 5943 var etag string 5944 err = json.Unmarshal(*v, &etag) 5945 if err != nil { 5946 return err 5947 } 5948 pcr.Etag = &etag 5949 } 5950 case "properties": 5951 if v != nil { 5952 var packetCaptureResultProperties PacketCaptureResultProperties 5953 err = json.Unmarshal(*v, &packetCaptureResultProperties) 5954 if err != nil { 5955 return err 5956 } 5957 pcr.PacketCaptureResultProperties = &packetCaptureResultProperties 5958 } 5959 } 5960 } 5961 5962 return nil 5963} 5964 5965// PacketCaptureResultProperties describes the properties of a packet capture session. 5966type PacketCaptureResultProperties struct { 5967 // ProvisioningState - The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' 5968 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 5969 // Target - The ID of the targeted resource, only VM is currently supported. 5970 Target *string `json:"target,omitempty"` 5971 // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. 5972 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` 5973 // TotalBytesPerSession - Maximum size of the capture output. 5974 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` 5975 // TimeLimitInSeconds - Maximum duration of the capture session in seconds. 5976 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` 5977 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` 5978 Filters *[]PacketCaptureFilter `json:"filters,omitempty"` 5979} 5980 5981// PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 5982// operation. 5983type PacketCapturesCreateFuture struct { 5984 azure.FutureAPI 5985 // Result returns the result of the asynchronous operation. 5986 // If the operation has not completed it will return an error. 5987 Result func(PacketCapturesClient) (PacketCaptureResult, error) 5988} 5989 5990// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5991func (future *PacketCapturesCreateFuture) UnmarshalJSON(body []byte) error { 5992 var azFuture azure.Future 5993 if err := json.Unmarshal(body, &azFuture); err != nil { 5994 return err 5995 } 5996 future.FutureAPI = &azFuture 5997 future.Result = future.result 5998 return nil 5999} 6000 6001// result is the default implementation for PacketCapturesCreateFuture.Result. 6002func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) { 6003 var done bool 6004 done, err = future.DoneWithContext(context.Background(), client) 6005 if err != nil { 6006 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure") 6007 return 6008 } 6009 if !done { 6010 pcr.Response.Response = future.Response() 6011 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture") 6012 return 6013 } 6014 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6015 if pcr.Response.Response, err = future.GetResult(sender); err == nil && pcr.Response.Response.StatusCode != http.StatusNoContent { 6016 pcr, err = client.CreateResponder(pcr.Response.Response) 6017 if err != nil { 6018 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", pcr.Response.Response, "Failure responding to request") 6019 } 6020 } 6021 return 6022} 6023 6024// PacketCapturesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6025// operation. 6026type PacketCapturesDeleteFuture struct { 6027 azure.FutureAPI 6028 // Result returns the result of the asynchronous operation. 6029 // If the operation has not completed it will return an error. 6030 Result func(PacketCapturesClient) (autorest.Response, error) 6031} 6032 6033// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6034func (future *PacketCapturesDeleteFuture) UnmarshalJSON(body []byte) error { 6035 var azFuture azure.Future 6036 if err := json.Unmarshal(body, &azFuture); err != nil { 6037 return err 6038 } 6039 future.FutureAPI = &azFuture 6040 future.Result = future.result 6041 return nil 6042} 6043 6044// result is the default implementation for PacketCapturesDeleteFuture.Result. 6045func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { 6046 var done bool 6047 done, err = future.DoneWithContext(context.Background(), client) 6048 if err != nil { 6049 err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure") 6050 return 6051 } 6052 if !done { 6053 ar.Response = future.Response() 6054 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture") 6055 return 6056 } 6057 ar.Response = future.Response() 6058 return 6059} 6060 6061// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running 6062// operation. 6063type PacketCapturesGetStatusFuture struct { 6064 azure.FutureAPI 6065 // Result returns the result of the asynchronous operation. 6066 // If the operation has not completed it will return an error. 6067 Result func(PacketCapturesClient) (PacketCaptureQueryStatusResult, error) 6068} 6069 6070// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6071func (future *PacketCapturesGetStatusFuture) UnmarshalJSON(body []byte) error { 6072 var azFuture azure.Future 6073 if err := json.Unmarshal(body, &azFuture); err != nil { 6074 return err 6075 } 6076 future.FutureAPI = &azFuture 6077 future.Result = future.result 6078 return nil 6079} 6080 6081// result is the default implementation for PacketCapturesGetStatusFuture.Result. 6082func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) { 6083 var done bool 6084 done, err = future.DoneWithContext(context.Background(), client) 6085 if err != nil { 6086 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure") 6087 return 6088 } 6089 if !done { 6090 pcqsr.Response.Response = future.Response() 6091 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture") 6092 return 6093 } 6094 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6095 if pcqsr.Response.Response, err = future.GetResult(sender); err == nil && pcqsr.Response.Response.StatusCode != http.StatusNoContent { 6096 pcqsr, err = client.GetStatusResponder(pcqsr.Response.Response) 6097 if err != nil { 6098 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", pcqsr.Response.Response, "Failure responding to request") 6099 } 6100 } 6101 return 6102} 6103 6104// PacketCapturesStopFuture an abstraction for monitoring and retrieving the results of a long-running 6105// operation. 6106type PacketCapturesStopFuture struct { 6107 azure.FutureAPI 6108 // Result returns the result of the asynchronous operation. 6109 // If the operation has not completed it will return an error. 6110 Result func(PacketCapturesClient) (autorest.Response, error) 6111} 6112 6113// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6114func (future *PacketCapturesStopFuture) UnmarshalJSON(body []byte) error { 6115 var azFuture azure.Future 6116 if err := json.Unmarshal(body, &azFuture); err != nil { 6117 return err 6118 } 6119 future.FutureAPI = &azFuture 6120 future.Result = future.result 6121 return nil 6122} 6123 6124// result is the default implementation for PacketCapturesStopFuture.Result. 6125func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) { 6126 var done bool 6127 done, err = future.DoneWithContext(context.Background(), client) 6128 if err != nil { 6129 err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure") 6130 return 6131 } 6132 if !done { 6133 ar.Response = future.Response() 6134 err = azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture") 6135 return 6136 } 6137 ar.Response = future.Response() 6138 return 6139} 6140 6141// PacketCaptureStorageLocation describes the storage location for a packet capture session. 6142type PacketCaptureStorageLocation struct { 6143 // StorageID - The ID of the storage account to save the packet capture session. Required if no local file path is provided. 6144 StorageID *string `json:"storageId,omitempty"` 6145 // StoragePath - The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. 6146 StoragePath *string `json:"storagePath,omitempty"` 6147 // FilePath - A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. 6148 FilePath *string `json:"filePath,omitempty"` 6149} 6150 6151// Probe a load balancer probe. 6152type Probe struct { 6153 *ProbePropertiesFormat `json:"properties,omitempty"` 6154 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 6155 Name *string `json:"name,omitempty"` 6156 // Etag - A unique read-only string that changes whenever the resource is updated. 6157 Etag *string `json:"etag,omitempty"` 6158 // ID - Resource ID. 6159 ID *string `json:"id,omitempty"` 6160} 6161 6162// MarshalJSON is the custom marshaler for Probe. 6163func (p Probe) MarshalJSON() ([]byte, error) { 6164 objectMap := make(map[string]interface{}) 6165 if p.ProbePropertiesFormat != nil { 6166 objectMap["properties"] = p.ProbePropertiesFormat 6167 } 6168 if p.Name != nil { 6169 objectMap["name"] = p.Name 6170 } 6171 if p.Etag != nil { 6172 objectMap["etag"] = p.Etag 6173 } 6174 if p.ID != nil { 6175 objectMap["id"] = p.ID 6176 } 6177 return json.Marshal(objectMap) 6178} 6179 6180// UnmarshalJSON is the custom unmarshaler for Probe struct. 6181func (p *Probe) UnmarshalJSON(body []byte) error { 6182 var m map[string]*json.RawMessage 6183 err := json.Unmarshal(body, &m) 6184 if err != nil { 6185 return err 6186 } 6187 for k, v := range m { 6188 switch k { 6189 case "properties": 6190 if v != nil { 6191 var probePropertiesFormat ProbePropertiesFormat 6192 err = json.Unmarshal(*v, &probePropertiesFormat) 6193 if err != nil { 6194 return err 6195 } 6196 p.ProbePropertiesFormat = &probePropertiesFormat 6197 } 6198 case "name": 6199 if v != nil { 6200 var name string 6201 err = json.Unmarshal(*v, &name) 6202 if err != nil { 6203 return err 6204 } 6205 p.Name = &name 6206 } 6207 case "etag": 6208 if v != nil { 6209 var etag string 6210 err = json.Unmarshal(*v, &etag) 6211 if err != nil { 6212 return err 6213 } 6214 p.Etag = &etag 6215 } 6216 case "id": 6217 if v != nil { 6218 var ID string 6219 err = json.Unmarshal(*v, &ID) 6220 if err != nil { 6221 return err 6222 } 6223 p.ID = &ID 6224 } 6225 } 6226 } 6227 6228 return nil 6229} 6230 6231// ProbePropertiesFormat ... 6232type ProbePropertiesFormat struct { 6233 // LoadBalancingRules - READ-ONLY; The load balancer rules that use this probe. 6234 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 6235 // 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' 6236 Protocol ProbeProtocol `json:"protocol,omitempty"` 6237 // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. 6238 Port *int32 `json:"port,omitempty"` 6239 // 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. 6240 IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` 6241 // 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. 6242 NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` 6243 // 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. 6244 RequestPath *string `json:"requestPath,omitempty"` 6245 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6246 ProvisioningState *string `json:"provisioningState,omitempty"` 6247} 6248 6249// MarshalJSON is the custom marshaler for ProbePropertiesFormat. 6250func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) { 6251 objectMap := make(map[string]interface{}) 6252 if ppf.Protocol != "" { 6253 objectMap["protocol"] = ppf.Protocol 6254 } 6255 if ppf.Port != nil { 6256 objectMap["port"] = ppf.Port 6257 } 6258 if ppf.IntervalInSeconds != nil { 6259 objectMap["intervalInSeconds"] = ppf.IntervalInSeconds 6260 } 6261 if ppf.NumberOfProbes != nil { 6262 objectMap["numberOfProbes"] = ppf.NumberOfProbes 6263 } 6264 if ppf.RequestPath != nil { 6265 objectMap["requestPath"] = ppf.RequestPath 6266 } 6267 if ppf.ProvisioningState != nil { 6268 objectMap["provisioningState"] = ppf.ProvisioningState 6269 } 6270 return json.Marshal(objectMap) 6271} 6272 6273// PublicIPAddress public IP address resource. 6274type PublicIPAddress struct { 6275 autorest.Response `json:"-"` 6276 *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` 6277 // Etag - A unique read-only string that changes whenever the resource is updated. 6278 Etag *string `json:"etag,omitempty"` 6279 // ID - Resource ID. 6280 ID *string `json:"id,omitempty"` 6281 // Name - READ-ONLY; Resource name. 6282 Name *string `json:"name,omitempty"` 6283 // Type - READ-ONLY; Resource type. 6284 Type *string `json:"type,omitempty"` 6285 // Location - Resource location. 6286 Location *string `json:"location,omitempty"` 6287 // Tags - Resource tags. 6288 Tags map[string]*string `json:"tags"` 6289} 6290 6291// MarshalJSON is the custom marshaler for PublicIPAddress. 6292func (pia PublicIPAddress) MarshalJSON() ([]byte, error) { 6293 objectMap := make(map[string]interface{}) 6294 if pia.PublicIPAddressPropertiesFormat != nil { 6295 objectMap["properties"] = pia.PublicIPAddressPropertiesFormat 6296 } 6297 if pia.Etag != nil { 6298 objectMap["etag"] = pia.Etag 6299 } 6300 if pia.ID != nil { 6301 objectMap["id"] = pia.ID 6302 } 6303 if pia.Location != nil { 6304 objectMap["location"] = pia.Location 6305 } 6306 if pia.Tags != nil { 6307 objectMap["tags"] = pia.Tags 6308 } 6309 return json.Marshal(objectMap) 6310} 6311 6312// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. 6313func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error { 6314 var m map[string]*json.RawMessage 6315 err := json.Unmarshal(body, &m) 6316 if err != nil { 6317 return err 6318 } 6319 for k, v := range m { 6320 switch k { 6321 case "properties": 6322 if v != nil { 6323 var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat 6324 err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat) 6325 if err != nil { 6326 return err 6327 } 6328 pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat 6329 } 6330 case "etag": 6331 if v != nil { 6332 var etag string 6333 err = json.Unmarshal(*v, &etag) 6334 if err != nil { 6335 return err 6336 } 6337 pia.Etag = &etag 6338 } 6339 case "id": 6340 if v != nil { 6341 var ID string 6342 err = json.Unmarshal(*v, &ID) 6343 if err != nil { 6344 return err 6345 } 6346 pia.ID = &ID 6347 } 6348 case "name": 6349 if v != nil { 6350 var name string 6351 err = json.Unmarshal(*v, &name) 6352 if err != nil { 6353 return err 6354 } 6355 pia.Name = &name 6356 } 6357 case "type": 6358 if v != nil { 6359 var typeVar string 6360 err = json.Unmarshal(*v, &typeVar) 6361 if err != nil { 6362 return err 6363 } 6364 pia.Type = &typeVar 6365 } 6366 case "location": 6367 if v != nil { 6368 var location string 6369 err = json.Unmarshal(*v, &location) 6370 if err != nil { 6371 return err 6372 } 6373 pia.Location = &location 6374 } 6375 case "tags": 6376 if v != nil { 6377 var tags map[string]*string 6378 err = json.Unmarshal(*v, &tags) 6379 if err != nil { 6380 return err 6381 } 6382 pia.Tags = tags 6383 } 6384 } 6385 } 6386 6387 return nil 6388} 6389 6390// PublicIPAddressDNSSettings contains FQDN of the DNS record associated with the public IP address 6391type PublicIPAddressDNSSettings struct { 6392 // 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. 6393 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 6394 // 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. 6395 Fqdn *string `json:"fqdn,omitempty"` 6396 // 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. 6397 ReverseFqdn *string `json:"reverseFqdn,omitempty"` 6398} 6399 6400// PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6401// long-running operation. 6402type PublicIPAddressesCreateOrUpdateFuture struct { 6403 azure.FutureAPI 6404 // Result returns the result of the asynchronous operation. 6405 // If the operation has not completed it will return an error. 6406 Result func(PublicIPAddressesClient) (PublicIPAddress, error) 6407} 6408 6409// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6410func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6411 var azFuture azure.Future 6412 if err := json.Unmarshal(body, &azFuture); err != nil { 6413 return err 6414 } 6415 future.FutureAPI = &azFuture 6416 future.Result = future.result 6417 return nil 6418} 6419 6420// result is the default implementation for PublicIPAddressesCreateOrUpdateFuture.Result. 6421func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { 6422 var done bool 6423 done, err = future.DoneWithContext(context.Background(), client) 6424 if err != nil { 6425 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6426 return 6427 } 6428 if !done { 6429 pia.Response.Response = future.Response() 6430 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") 6431 return 6432 } 6433 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6434 if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent { 6435 pia, err = client.CreateOrUpdateResponder(pia.Response.Response) 6436 if err != nil { 6437 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", pia.Response.Response, "Failure responding to request") 6438 } 6439 } 6440 return 6441} 6442 6443// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6444// operation. 6445type PublicIPAddressesDeleteFuture struct { 6446 azure.FutureAPI 6447 // Result returns the result of the asynchronous operation. 6448 // If the operation has not completed it will return an error. 6449 Result func(PublicIPAddressesClient) (autorest.Response, error) 6450} 6451 6452// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6453func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error { 6454 var azFuture azure.Future 6455 if err := json.Unmarshal(body, &azFuture); err != nil { 6456 return err 6457 } 6458 future.FutureAPI = &azFuture 6459 future.Result = future.result 6460 return nil 6461} 6462 6463// result is the default implementation for PublicIPAddressesDeleteFuture.Result. 6464func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) { 6465 var done bool 6466 done, err = future.DoneWithContext(context.Background(), client) 6467 if err != nil { 6468 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure") 6469 return 6470 } 6471 if !done { 6472 ar.Response = future.Response() 6473 err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") 6474 return 6475 } 6476 ar.Response = future.Response() 6477 return 6478} 6479 6480// PublicIPAddressListResult response for ListPublicIpAddresses API service call. 6481type PublicIPAddressListResult struct { 6482 autorest.Response `json:"-"` 6483 // Value - A list of public IP addresses that exists in a resource group. 6484 Value *[]PublicIPAddress `json:"value,omitempty"` 6485 // NextLink - The URL to get the next set of results. 6486 NextLink *string `json:"nextLink,omitempty"` 6487} 6488 6489// PublicIPAddressListResultIterator provides access to a complete listing of PublicIPAddress values. 6490type PublicIPAddressListResultIterator struct { 6491 i int 6492 page PublicIPAddressListResultPage 6493} 6494 6495// NextWithContext advances to the next value. If there was an error making 6496// the request the iterator does not advance and the error is returned. 6497func (iter *PublicIPAddressListResultIterator) NextWithContext(ctx context.Context) (err error) { 6498 if tracing.IsEnabled() { 6499 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultIterator.NextWithContext") 6500 defer func() { 6501 sc := -1 6502 if iter.Response().Response.Response != nil { 6503 sc = iter.Response().Response.Response.StatusCode 6504 } 6505 tracing.EndSpan(ctx, sc, err) 6506 }() 6507 } 6508 iter.i++ 6509 if iter.i < len(iter.page.Values()) { 6510 return nil 6511 } 6512 err = iter.page.NextWithContext(ctx) 6513 if err != nil { 6514 iter.i-- 6515 return err 6516 } 6517 iter.i = 0 6518 return nil 6519} 6520 6521// Next advances to the next value. If there was an error making 6522// the request the iterator does not advance and the error is returned. 6523// Deprecated: Use NextWithContext() instead. 6524func (iter *PublicIPAddressListResultIterator) Next() error { 6525 return iter.NextWithContext(context.Background()) 6526} 6527 6528// NotDone returns true if the enumeration should be started or is not yet complete. 6529func (iter PublicIPAddressListResultIterator) NotDone() bool { 6530 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6531} 6532 6533// Response returns the raw server response from the last page request. 6534func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult { 6535 return iter.page.Response() 6536} 6537 6538// Value returns the current value or a zero-initialized value if the 6539// iterator has advanced beyond the end of the collection. 6540func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress { 6541 if !iter.page.NotDone() { 6542 return PublicIPAddress{} 6543 } 6544 return iter.page.Values()[iter.i] 6545} 6546 6547// Creates a new instance of the PublicIPAddressListResultIterator type. 6548func NewPublicIPAddressListResultIterator(page PublicIPAddressListResultPage) PublicIPAddressListResultIterator { 6549 return PublicIPAddressListResultIterator{page: page} 6550} 6551 6552// IsEmpty returns true if the ListResult contains no values. 6553func (pialr PublicIPAddressListResult) IsEmpty() bool { 6554 return pialr.Value == nil || len(*pialr.Value) == 0 6555} 6556 6557// hasNextLink returns true if the NextLink is not empty. 6558func (pialr PublicIPAddressListResult) hasNextLink() bool { 6559 return pialr.NextLink != nil && len(*pialr.NextLink) != 0 6560} 6561 6562// publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. 6563// It returns nil if no more results exist. 6564func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) { 6565 if !pialr.hasNextLink() { 6566 return nil, nil 6567 } 6568 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6569 autorest.AsJSON(), 6570 autorest.AsGet(), 6571 autorest.WithBaseURL(to.String(pialr.NextLink))) 6572} 6573 6574// PublicIPAddressListResultPage contains a page of PublicIPAddress values. 6575type PublicIPAddressListResultPage struct { 6576 fn func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error) 6577 pialr PublicIPAddressListResult 6578} 6579 6580// NextWithContext advances to the next page of values. If there was an error making 6581// the request the page does not advance and the error is returned. 6582func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) (err error) { 6583 if tracing.IsEnabled() { 6584 ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultPage.NextWithContext") 6585 defer func() { 6586 sc := -1 6587 if page.Response().Response.Response != nil { 6588 sc = page.Response().Response.Response.StatusCode 6589 } 6590 tracing.EndSpan(ctx, sc, err) 6591 }() 6592 } 6593 for { 6594 next, err := page.fn(ctx, page.pialr) 6595 if err != nil { 6596 return err 6597 } 6598 page.pialr = next 6599 if !next.hasNextLink() || !next.IsEmpty() { 6600 break 6601 } 6602 } 6603 return nil 6604} 6605 6606// Next advances to the next page of values. If there was an error making 6607// the request the page does not advance and the error is returned. 6608// Deprecated: Use NextWithContext() instead. 6609func (page *PublicIPAddressListResultPage) Next() error { 6610 return page.NextWithContext(context.Background()) 6611} 6612 6613// NotDone returns true if the page enumeration should be started or is not yet complete. 6614func (page PublicIPAddressListResultPage) NotDone() bool { 6615 return !page.pialr.IsEmpty() 6616} 6617 6618// Response returns the raw server response from the last page request. 6619func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult { 6620 return page.pialr 6621} 6622 6623// Values returns the slice of values for the current page or nil if there are no values. 6624func (page PublicIPAddressListResultPage) Values() []PublicIPAddress { 6625 if page.pialr.IsEmpty() { 6626 return nil 6627 } 6628 return *page.pialr.Value 6629} 6630 6631// Creates a new instance of the PublicIPAddressListResultPage type. 6632func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage { 6633 return PublicIPAddressListResultPage{ 6634 fn: getNextPage, 6635 pialr: cur, 6636 } 6637} 6638 6639// PublicIPAddressPropertiesFormat public IP address properties. 6640type PublicIPAddressPropertiesFormat struct { 6641 // PublicIPAllocationMethod - The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 6642 PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` 6643 // PublicIPAddressVersion - The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 6644 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 6645 // IPConfiguration - READ-ONLY 6646 IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` 6647 // DNSSettings - The FQDN of the DNS record associated with the public IP address. 6648 DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"` 6649 IPAddress *string `json:"ipAddress,omitempty"` 6650 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 6651 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 6652 // ResourceGUID - The resource GUID property of the public IP resource. 6653 ResourceGUID *string `json:"resourceGuid,omitempty"` 6654 // ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6655 ProvisioningState *string `json:"provisioningState,omitempty"` 6656} 6657 6658// MarshalJSON is the custom marshaler for PublicIPAddressPropertiesFormat. 6659func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) { 6660 objectMap := make(map[string]interface{}) 6661 if piapf.PublicIPAllocationMethod != "" { 6662 objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod 6663 } 6664 if piapf.PublicIPAddressVersion != "" { 6665 objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion 6666 } 6667 if piapf.DNSSettings != nil { 6668 objectMap["dnsSettings"] = piapf.DNSSettings 6669 } 6670 if piapf.IPAddress != nil { 6671 objectMap["ipAddress"] = piapf.IPAddress 6672 } 6673 if piapf.IdleTimeoutInMinutes != nil { 6674 objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes 6675 } 6676 if piapf.ResourceGUID != nil { 6677 objectMap["resourceGuid"] = piapf.ResourceGUID 6678 } 6679 if piapf.ProvisioningState != nil { 6680 objectMap["provisioningState"] = piapf.ProvisioningState 6681 } 6682 return json.Marshal(objectMap) 6683} 6684 6685// QueryTroubleshootingParameters parameters that define the resource to query the troubleshooting result. 6686type QueryTroubleshootingParameters struct { 6687 // TargetResourceID - The target resource ID to query the troubleshooting result. 6688 TargetResourceID *string `json:"targetResourceId,omitempty"` 6689} 6690 6691// Resource ... 6692type Resource struct { 6693 // ID - Resource ID. 6694 ID *string `json:"id,omitempty"` 6695 // Name - READ-ONLY; Resource name. 6696 Name *string `json:"name,omitempty"` 6697 // Type - READ-ONLY; Resource type. 6698 Type *string `json:"type,omitempty"` 6699 // Location - Resource location. 6700 Location *string `json:"location,omitempty"` 6701 // Tags - Resource tags. 6702 Tags map[string]*string `json:"tags"` 6703} 6704 6705// MarshalJSON is the custom marshaler for Resource. 6706func (r Resource) MarshalJSON() ([]byte, error) { 6707 objectMap := make(map[string]interface{}) 6708 if r.ID != nil { 6709 objectMap["id"] = r.ID 6710 } 6711 if r.Location != nil { 6712 objectMap["location"] = r.Location 6713 } 6714 if r.Tags != nil { 6715 objectMap["tags"] = r.Tags 6716 } 6717 return json.Marshal(objectMap) 6718} 6719 6720// ResourceNavigationLink resourceNavigationLink resource. 6721type ResourceNavigationLink struct { 6722 *ResourceNavigationLinkFormat `json:"properties,omitempty"` 6723 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 6724 Name *string `json:"name,omitempty"` 6725 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 6726 Etag *string `json:"etag,omitempty"` 6727 // ID - Resource ID. 6728 ID *string `json:"id,omitempty"` 6729} 6730 6731// MarshalJSON is the custom marshaler for ResourceNavigationLink. 6732func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) { 6733 objectMap := make(map[string]interface{}) 6734 if rnl.ResourceNavigationLinkFormat != nil { 6735 objectMap["properties"] = rnl.ResourceNavigationLinkFormat 6736 } 6737 if rnl.Name != nil { 6738 objectMap["name"] = rnl.Name 6739 } 6740 if rnl.ID != nil { 6741 objectMap["id"] = rnl.ID 6742 } 6743 return json.Marshal(objectMap) 6744} 6745 6746// UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct. 6747func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error { 6748 var m map[string]*json.RawMessage 6749 err := json.Unmarshal(body, &m) 6750 if err != nil { 6751 return err 6752 } 6753 for k, v := range m { 6754 switch k { 6755 case "properties": 6756 if v != nil { 6757 var resourceNavigationLinkFormat ResourceNavigationLinkFormat 6758 err = json.Unmarshal(*v, &resourceNavigationLinkFormat) 6759 if err != nil { 6760 return err 6761 } 6762 rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat 6763 } 6764 case "name": 6765 if v != nil { 6766 var name string 6767 err = json.Unmarshal(*v, &name) 6768 if err != nil { 6769 return err 6770 } 6771 rnl.Name = &name 6772 } 6773 case "etag": 6774 if v != nil { 6775 var etag string 6776 err = json.Unmarshal(*v, &etag) 6777 if err != nil { 6778 return err 6779 } 6780 rnl.Etag = &etag 6781 } 6782 case "id": 6783 if v != nil { 6784 var ID string 6785 err = json.Unmarshal(*v, &ID) 6786 if err != nil { 6787 return err 6788 } 6789 rnl.ID = &ID 6790 } 6791 } 6792 } 6793 6794 return nil 6795} 6796 6797// ResourceNavigationLinkFormat properties of ResourceNavigationLink. 6798type ResourceNavigationLinkFormat struct { 6799 // LinkedResourceType - Resource type of the linked resource. 6800 LinkedResourceType *string `json:"linkedResourceType,omitempty"` 6801 // Link - Link to the external resource 6802 Link *string `json:"link,omitempty"` 6803 // ProvisioningState - READ-ONLY; Provisioning state of the ResourceNavigationLink resource. 6804 ProvisioningState *string `json:"provisioningState,omitempty"` 6805} 6806 6807// MarshalJSON is the custom marshaler for ResourceNavigationLinkFormat. 6808func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) { 6809 objectMap := make(map[string]interface{}) 6810 if rnlf.LinkedResourceType != nil { 6811 objectMap["linkedResourceType"] = rnlf.LinkedResourceType 6812 } 6813 if rnlf.Link != nil { 6814 objectMap["link"] = rnlf.Link 6815 } 6816 return json.Marshal(objectMap) 6817} 6818 6819// RetentionPolicyParameters parameters that define the retention policy for flow log. 6820type RetentionPolicyParameters struct { 6821 // Days - Number of days to retain flow log records. 6822 Days *int32 `json:"days,omitempty"` 6823 // Enabled - Flag to enable/disable retention. 6824 Enabled *bool `json:"enabled,omitempty"` 6825} 6826 6827// Route route resource 6828type Route struct { 6829 autorest.Response `json:"-"` 6830 *RoutePropertiesFormat `json:"properties,omitempty"` 6831 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 6832 Name *string `json:"name,omitempty"` 6833 // Etag - A unique read-only string that changes whenever the resource is updated. 6834 Etag *string `json:"etag,omitempty"` 6835 // ID - Resource ID. 6836 ID *string `json:"id,omitempty"` 6837} 6838 6839// MarshalJSON is the custom marshaler for Route. 6840func (r Route) MarshalJSON() ([]byte, error) { 6841 objectMap := make(map[string]interface{}) 6842 if r.RoutePropertiesFormat != nil { 6843 objectMap["properties"] = r.RoutePropertiesFormat 6844 } 6845 if r.Name != nil { 6846 objectMap["name"] = r.Name 6847 } 6848 if r.Etag != nil { 6849 objectMap["etag"] = r.Etag 6850 } 6851 if r.ID != nil { 6852 objectMap["id"] = r.ID 6853 } 6854 return json.Marshal(objectMap) 6855} 6856 6857// UnmarshalJSON is the custom unmarshaler for Route struct. 6858func (r *Route) UnmarshalJSON(body []byte) error { 6859 var m map[string]*json.RawMessage 6860 err := json.Unmarshal(body, &m) 6861 if err != nil { 6862 return err 6863 } 6864 for k, v := range m { 6865 switch k { 6866 case "properties": 6867 if v != nil { 6868 var routePropertiesFormat RoutePropertiesFormat 6869 err = json.Unmarshal(*v, &routePropertiesFormat) 6870 if err != nil { 6871 return err 6872 } 6873 r.RoutePropertiesFormat = &routePropertiesFormat 6874 } 6875 case "name": 6876 if v != nil { 6877 var name string 6878 err = json.Unmarshal(*v, &name) 6879 if err != nil { 6880 return err 6881 } 6882 r.Name = &name 6883 } 6884 case "etag": 6885 if v != nil { 6886 var etag string 6887 err = json.Unmarshal(*v, &etag) 6888 if err != nil { 6889 return err 6890 } 6891 r.Etag = &etag 6892 } 6893 case "id": 6894 if v != nil { 6895 var ID string 6896 err = json.Unmarshal(*v, &ID) 6897 if err != nil { 6898 return err 6899 } 6900 r.ID = &ID 6901 } 6902 } 6903 } 6904 6905 return nil 6906} 6907 6908// RouteListResult response for the ListRoute API service call 6909type RouteListResult struct { 6910 autorest.Response `json:"-"` 6911 // Value - Gets a list of routes in a resource group. 6912 Value *[]Route `json:"value,omitempty"` 6913 // NextLink - The URL to get the next set of results. 6914 NextLink *string `json:"nextLink,omitempty"` 6915} 6916 6917// RouteListResultIterator provides access to a complete listing of Route values. 6918type RouteListResultIterator struct { 6919 i int 6920 page RouteListResultPage 6921} 6922 6923// NextWithContext advances to the next value. If there was an error making 6924// the request the iterator does not advance and the error is returned. 6925func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) { 6926 if tracing.IsEnabled() { 6927 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext") 6928 defer func() { 6929 sc := -1 6930 if iter.Response().Response.Response != nil { 6931 sc = iter.Response().Response.Response.StatusCode 6932 } 6933 tracing.EndSpan(ctx, sc, err) 6934 }() 6935 } 6936 iter.i++ 6937 if iter.i < len(iter.page.Values()) { 6938 return nil 6939 } 6940 err = iter.page.NextWithContext(ctx) 6941 if err != nil { 6942 iter.i-- 6943 return err 6944 } 6945 iter.i = 0 6946 return nil 6947} 6948 6949// Next advances to the next value. If there was an error making 6950// the request the iterator does not advance and the error is returned. 6951// Deprecated: Use NextWithContext() instead. 6952func (iter *RouteListResultIterator) Next() error { 6953 return iter.NextWithContext(context.Background()) 6954} 6955 6956// NotDone returns true if the enumeration should be started or is not yet complete. 6957func (iter RouteListResultIterator) NotDone() bool { 6958 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6959} 6960 6961// Response returns the raw server response from the last page request. 6962func (iter RouteListResultIterator) Response() RouteListResult { 6963 return iter.page.Response() 6964} 6965 6966// Value returns the current value or a zero-initialized value if the 6967// iterator has advanced beyond the end of the collection. 6968func (iter RouteListResultIterator) Value() Route { 6969 if !iter.page.NotDone() { 6970 return Route{} 6971 } 6972 return iter.page.Values()[iter.i] 6973} 6974 6975// Creates a new instance of the RouteListResultIterator type. 6976func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator { 6977 return RouteListResultIterator{page: page} 6978} 6979 6980// IsEmpty returns true if the ListResult contains no values. 6981func (rlr RouteListResult) IsEmpty() bool { 6982 return rlr.Value == nil || len(*rlr.Value) == 0 6983} 6984 6985// hasNextLink returns true if the NextLink is not empty. 6986func (rlr RouteListResult) hasNextLink() bool { 6987 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 6988} 6989 6990// routeListResultPreparer prepares a request to retrieve the next set of results. 6991// It returns nil if no more results exist. 6992func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) { 6993 if !rlr.hasNextLink() { 6994 return nil, nil 6995 } 6996 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6997 autorest.AsJSON(), 6998 autorest.AsGet(), 6999 autorest.WithBaseURL(to.String(rlr.NextLink))) 7000} 7001 7002// RouteListResultPage contains a page of Route values. 7003type RouteListResultPage struct { 7004 fn func(context.Context, RouteListResult) (RouteListResult, error) 7005 rlr RouteListResult 7006} 7007 7008// NextWithContext advances to the next page of values. If there was an error making 7009// the request the page does not advance and the error is returned. 7010func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) { 7011 if tracing.IsEnabled() { 7012 ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext") 7013 defer func() { 7014 sc := -1 7015 if page.Response().Response.Response != nil { 7016 sc = page.Response().Response.Response.StatusCode 7017 } 7018 tracing.EndSpan(ctx, sc, err) 7019 }() 7020 } 7021 for { 7022 next, err := page.fn(ctx, page.rlr) 7023 if err != nil { 7024 return err 7025 } 7026 page.rlr = next 7027 if !next.hasNextLink() || !next.IsEmpty() { 7028 break 7029 } 7030 } 7031 return nil 7032} 7033 7034// Next advances to the next page of values. If there was an error making 7035// the request the page does not advance and the error is returned. 7036// Deprecated: Use NextWithContext() instead. 7037func (page *RouteListResultPage) Next() error { 7038 return page.NextWithContext(context.Background()) 7039} 7040 7041// NotDone returns true if the page enumeration should be started or is not yet complete. 7042func (page RouteListResultPage) NotDone() bool { 7043 return !page.rlr.IsEmpty() 7044} 7045 7046// Response returns the raw server response from the last page request. 7047func (page RouteListResultPage) Response() RouteListResult { 7048 return page.rlr 7049} 7050 7051// Values returns the slice of values for the current page or nil if there are no values. 7052func (page RouteListResultPage) Values() []Route { 7053 if page.rlr.IsEmpty() { 7054 return nil 7055 } 7056 return *page.rlr.Value 7057} 7058 7059// Creates a new instance of the RouteListResultPage type. 7060func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage { 7061 return RouteListResultPage{ 7062 fn: getNextPage, 7063 rlr: cur, 7064 } 7065} 7066 7067// RoutePropertiesFormat route resource 7068type RoutePropertiesFormat struct { 7069 // AddressPrefix - The destination CIDR to which the route applies. 7070 AddressPrefix *string `json:"addressPrefix,omitempty"` 7071 // 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' 7072 NextHopType RouteNextHopType `json:"nextHopType,omitempty"` 7073 // NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. 7074 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` 7075 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 7076 ProvisioningState *string `json:"provisioningState,omitempty"` 7077} 7078 7079// RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7080// operation. 7081type RoutesCreateOrUpdateFuture struct { 7082 azure.FutureAPI 7083 // Result returns the result of the asynchronous operation. 7084 // If the operation has not completed it will return an error. 7085 Result func(RoutesClient) (Route, error) 7086} 7087 7088// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7089func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7090 var azFuture azure.Future 7091 if err := json.Unmarshal(body, &azFuture); err != nil { 7092 return err 7093 } 7094 future.FutureAPI = &azFuture 7095 future.Result = future.result 7096 return nil 7097} 7098 7099// result is the default implementation for RoutesCreateOrUpdateFuture.Result. 7100func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) { 7101 var done bool 7102 done, err = future.DoneWithContext(context.Background(), client) 7103 if err != nil { 7104 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7105 return 7106 } 7107 if !done { 7108 r.Response.Response = future.Response() 7109 err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") 7110 return 7111 } 7112 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7113 if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { 7114 r, err = client.CreateOrUpdateResponder(r.Response.Response) 7115 if err != nil { 7116 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", r.Response.Response, "Failure responding to request") 7117 } 7118 } 7119 return 7120} 7121 7122// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 7123type RoutesDeleteFuture struct { 7124 azure.FutureAPI 7125 // Result returns the result of the asynchronous operation. 7126 // If the operation has not completed it will return an error. 7127 Result func(RoutesClient) (autorest.Response, error) 7128} 7129 7130// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7131func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error { 7132 var azFuture azure.Future 7133 if err := json.Unmarshal(body, &azFuture); err != nil { 7134 return err 7135 } 7136 future.FutureAPI = &azFuture 7137 future.Result = future.result 7138 return nil 7139} 7140 7141// result is the default implementation for RoutesDeleteFuture.Result. 7142func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) { 7143 var done bool 7144 done, err = future.DoneWithContext(context.Background(), client) 7145 if err != nil { 7146 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure") 7147 return 7148 } 7149 if !done { 7150 ar.Response = future.Response() 7151 err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") 7152 return 7153 } 7154 ar.Response = future.Response() 7155 return 7156} 7157 7158// RouteTable route table resource. 7159type RouteTable struct { 7160 autorest.Response `json:"-"` 7161 *RouteTablePropertiesFormat `json:"properties,omitempty"` 7162 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 7163 Etag *string `json:"etag,omitempty"` 7164 // ID - Resource ID. 7165 ID *string `json:"id,omitempty"` 7166 // Name - READ-ONLY; Resource name. 7167 Name *string `json:"name,omitempty"` 7168 // Type - READ-ONLY; Resource type. 7169 Type *string `json:"type,omitempty"` 7170 // Location - Resource location. 7171 Location *string `json:"location,omitempty"` 7172 // Tags - Resource tags. 7173 Tags map[string]*string `json:"tags"` 7174} 7175 7176// MarshalJSON is the custom marshaler for RouteTable. 7177func (rt RouteTable) MarshalJSON() ([]byte, error) { 7178 objectMap := make(map[string]interface{}) 7179 if rt.RouteTablePropertiesFormat != nil { 7180 objectMap["properties"] = rt.RouteTablePropertiesFormat 7181 } 7182 if rt.Etag != nil { 7183 objectMap["etag"] = rt.Etag 7184 } 7185 if rt.ID != nil { 7186 objectMap["id"] = rt.ID 7187 } 7188 if rt.Location != nil { 7189 objectMap["location"] = rt.Location 7190 } 7191 if rt.Tags != nil { 7192 objectMap["tags"] = rt.Tags 7193 } 7194 return json.Marshal(objectMap) 7195} 7196 7197// UnmarshalJSON is the custom unmarshaler for RouteTable struct. 7198func (rt *RouteTable) UnmarshalJSON(body []byte) error { 7199 var m map[string]*json.RawMessage 7200 err := json.Unmarshal(body, &m) 7201 if err != nil { 7202 return err 7203 } 7204 for k, v := range m { 7205 switch k { 7206 case "properties": 7207 if v != nil { 7208 var routeTablePropertiesFormat RouteTablePropertiesFormat 7209 err = json.Unmarshal(*v, &routeTablePropertiesFormat) 7210 if err != nil { 7211 return err 7212 } 7213 rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat 7214 } 7215 case "etag": 7216 if v != nil { 7217 var etag string 7218 err = json.Unmarshal(*v, &etag) 7219 if err != nil { 7220 return err 7221 } 7222 rt.Etag = &etag 7223 } 7224 case "id": 7225 if v != nil { 7226 var ID string 7227 err = json.Unmarshal(*v, &ID) 7228 if err != nil { 7229 return err 7230 } 7231 rt.ID = &ID 7232 } 7233 case "name": 7234 if v != nil { 7235 var name string 7236 err = json.Unmarshal(*v, &name) 7237 if err != nil { 7238 return err 7239 } 7240 rt.Name = &name 7241 } 7242 case "type": 7243 if v != nil { 7244 var typeVar string 7245 err = json.Unmarshal(*v, &typeVar) 7246 if err != nil { 7247 return err 7248 } 7249 rt.Type = &typeVar 7250 } 7251 case "location": 7252 if v != nil { 7253 var location string 7254 err = json.Unmarshal(*v, &location) 7255 if err != nil { 7256 return err 7257 } 7258 rt.Location = &location 7259 } 7260 case "tags": 7261 if v != nil { 7262 var tags map[string]*string 7263 err = json.Unmarshal(*v, &tags) 7264 if err != nil { 7265 return err 7266 } 7267 rt.Tags = tags 7268 } 7269 } 7270 } 7271 7272 return nil 7273} 7274 7275// RouteTableListResult response for the ListRouteTable API service call. 7276type RouteTableListResult struct { 7277 autorest.Response `json:"-"` 7278 // Value - Gets a list of route tables in a resource group. 7279 Value *[]RouteTable `json:"value,omitempty"` 7280 // NextLink - The URL to get the next set of results. 7281 NextLink *string `json:"nextLink,omitempty"` 7282} 7283 7284// RouteTableListResultIterator provides access to a complete listing of RouteTable values. 7285type RouteTableListResultIterator struct { 7286 i int 7287 page RouteTableListResultPage 7288} 7289 7290// NextWithContext advances to the next value. If there was an error making 7291// the request the iterator does not advance and the error is returned. 7292func (iter *RouteTableListResultIterator) NextWithContext(ctx context.Context) (err error) { 7293 if tracing.IsEnabled() { 7294 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultIterator.NextWithContext") 7295 defer func() { 7296 sc := -1 7297 if iter.Response().Response.Response != nil { 7298 sc = iter.Response().Response.Response.StatusCode 7299 } 7300 tracing.EndSpan(ctx, sc, err) 7301 }() 7302 } 7303 iter.i++ 7304 if iter.i < len(iter.page.Values()) { 7305 return nil 7306 } 7307 err = iter.page.NextWithContext(ctx) 7308 if err != nil { 7309 iter.i-- 7310 return err 7311 } 7312 iter.i = 0 7313 return nil 7314} 7315 7316// Next advances to the next value. If there was an error making 7317// the request the iterator does not advance and the error is returned. 7318// Deprecated: Use NextWithContext() instead. 7319func (iter *RouteTableListResultIterator) Next() error { 7320 return iter.NextWithContext(context.Background()) 7321} 7322 7323// NotDone returns true if the enumeration should be started or is not yet complete. 7324func (iter RouteTableListResultIterator) NotDone() bool { 7325 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7326} 7327 7328// Response returns the raw server response from the last page request. 7329func (iter RouteTableListResultIterator) Response() RouteTableListResult { 7330 return iter.page.Response() 7331} 7332 7333// Value returns the current value or a zero-initialized value if the 7334// iterator has advanced beyond the end of the collection. 7335func (iter RouteTableListResultIterator) Value() RouteTable { 7336 if !iter.page.NotDone() { 7337 return RouteTable{} 7338 } 7339 return iter.page.Values()[iter.i] 7340} 7341 7342// Creates a new instance of the RouteTableListResultIterator type. 7343func NewRouteTableListResultIterator(page RouteTableListResultPage) RouteTableListResultIterator { 7344 return RouteTableListResultIterator{page: page} 7345} 7346 7347// IsEmpty returns true if the ListResult contains no values. 7348func (rtlr RouteTableListResult) IsEmpty() bool { 7349 return rtlr.Value == nil || len(*rtlr.Value) == 0 7350} 7351 7352// hasNextLink returns true if the NextLink is not empty. 7353func (rtlr RouteTableListResult) hasNextLink() bool { 7354 return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0 7355} 7356 7357// routeTableListResultPreparer prepares a request to retrieve the next set of results. 7358// It returns nil if no more results exist. 7359func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) { 7360 if !rtlr.hasNextLink() { 7361 return nil, nil 7362 } 7363 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7364 autorest.AsJSON(), 7365 autorest.AsGet(), 7366 autorest.WithBaseURL(to.String(rtlr.NextLink))) 7367} 7368 7369// RouteTableListResultPage contains a page of RouteTable values. 7370type RouteTableListResultPage struct { 7371 fn func(context.Context, RouteTableListResult) (RouteTableListResult, error) 7372 rtlr RouteTableListResult 7373} 7374 7375// NextWithContext advances to the next page of values. If there was an error making 7376// the request the page does not advance and the error is returned. 7377func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err error) { 7378 if tracing.IsEnabled() { 7379 ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultPage.NextWithContext") 7380 defer func() { 7381 sc := -1 7382 if page.Response().Response.Response != nil { 7383 sc = page.Response().Response.Response.StatusCode 7384 } 7385 tracing.EndSpan(ctx, sc, err) 7386 }() 7387 } 7388 for { 7389 next, err := page.fn(ctx, page.rtlr) 7390 if err != nil { 7391 return err 7392 } 7393 page.rtlr = next 7394 if !next.hasNextLink() || !next.IsEmpty() { 7395 break 7396 } 7397 } 7398 return nil 7399} 7400 7401// Next advances to the next page of values. If there was an error making 7402// the request the page does not advance and the error is returned. 7403// Deprecated: Use NextWithContext() instead. 7404func (page *RouteTableListResultPage) Next() error { 7405 return page.NextWithContext(context.Background()) 7406} 7407 7408// NotDone returns true if the page enumeration should be started or is not yet complete. 7409func (page RouteTableListResultPage) NotDone() bool { 7410 return !page.rtlr.IsEmpty() 7411} 7412 7413// Response returns the raw server response from the last page request. 7414func (page RouteTableListResultPage) Response() RouteTableListResult { 7415 return page.rtlr 7416} 7417 7418// Values returns the slice of values for the current page or nil if there are no values. 7419func (page RouteTableListResultPage) Values() []RouteTable { 7420 if page.rtlr.IsEmpty() { 7421 return nil 7422 } 7423 return *page.rtlr.Value 7424} 7425 7426// Creates a new instance of the RouteTableListResultPage type. 7427func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage { 7428 return RouteTableListResultPage{ 7429 fn: getNextPage, 7430 rtlr: cur, 7431 } 7432} 7433 7434// RouteTablePropertiesFormat route Table resource 7435type RouteTablePropertiesFormat struct { 7436 // Routes - Collection of routes contained within a route table. 7437 Routes *[]Route `json:"routes,omitempty"` 7438 // Subnets - READ-ONLY; A collection of references to subnets. 7439 Subnets *[]Subnet `json:"subnets,omitempty"` 7440 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 7441 ProvisioningState *string `json:"provisioningState,omitempty"` 7442} 7443 7444// MarshalJSON is the custom marshaler for RouteTablePropertiesFormat. 7445func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) { 7446 objectMap := make(map[string]interface{}) 7447 if rtpf.Routes != nil { 7448 objectMap["routes"] = rtpf.Routes 7449 } 7450 if rtpf.ProvisioningState != nil { 7451 objectMap["provisioningState"] = rtpf.ProvisioningState 7452 } 7453 return json.Marshal(objectMap) 7454} 7455 7456// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7457// long-running operation. 7458type RouteTablesCreateOrUpdateFuture struct { 7459 azure.FutureAPI 7460 // Result returns the result of the asynchronous operation. 7461 // If the operation has not completed it will return an error. 7462 Result func(RouteTablesClient) (RouteTable, error) 7463} 7464 7465// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7466func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7467 var azFuture azure.Future 7468 if err := json.Unmarshal(body, &azFuture); err != nil { 7469 return err 7470 } 7471 future.FutureAPI = &azFuture 7472 future.Result = future.result 7473 return nil 7474} 7475 7476// result is the default implementation for RouteTablesCreateOrUpdateFuture.Result. 7477func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) { 7478 var done bool 7479 done, err = future.DoneWithContext(context.Background(), client) 7480 if err != nil { 7481 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7482 return 7483 } 7484 if !done { 7485 rt.Response.Response = future.Response() 7486 err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") 7487 return 7488 } 7489 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7490 if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { 7491 rt, err = client.CreateOrUpdateResponder(rt.Response.Response) 7492 if err != nil { 7493 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request") 7494 } 7495 } 7496 return 7497} 7498 7499// RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7500// operation. 7501type RouteTablesDeleteFuture struct { 7502 azure.FutureAPI 7503 // Result returns the result of the asynchronous operation. 7504 // If the operation has not completed it will return an error. 7505 Result func(RouteTablesClient) (autorest.Response, error) 7506} 7507 7508// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7509func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error { 7510 var azFuture azure.Future 7511 if err := json.Unmarshal(body, &azFuture); err != nil { 7512 return err 7513 } 7514 future.FutureAPI = &azFuture 7515 future.Result = future.result 7516 return nil 7517} 7518 7519// result is the default implementation for RouteTablesDeleteFuture.Result. 7520func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) { 7521 var done bool 7522 done, err = future.DoneWithContext(context.Background(), client) 7523 if err != nil { 7524 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") 7525 return 7526 } 7527 if !done { 7528 ar.Response = future.Response() 7529 err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") 7530 return 7531 } 7532 ar.Response = future.Response() 7533 return 7534} 7535 7536// SecurityGroup networkSecurityGroup resource. 7537type SecurityGroup struct { 7538 autorest.Response `json:"-"` 7539 *SecurityGroupPropertiesFormat `json:"properties,omitempty"` 7540 // Etag - A unique read-only string that changes whenever the resource is updated. 7541 Etag *string `json:"etag,omitempty"` 7542 // ID - Resource ID. 7543 ID *string `json:"id,omitempty"` 7544 // Name - READ-ONLY; Resource name. 7545 Name *string `json:"name,omitempty"` 7546 // Type - READ-ONLY; Resource type. 7547 Type *string `json:"type,omitempty"` 7548 // Location - Resource location. 7549 Location *string `json:"location,omitempty"` 7550 // Tags - Resource tags. 7551 Tags map[string]*string `json:"tags"` 7552} 7553 7554// MarshalJSON is the custom marshaler for SecurityGroup. 7555func (sg SecurityGroup) MarshalJSON() ([]byte, error) { 7556 objectMap := make(map[string]interface{}) 7557 if sg.SecurityGroupPropertiesFormat != nil { 7558 objectMap["properties"] = sg.SecurityGroupPropertiesFormat 7559 } 7560 if sg.Etag != nil { 7561 objectMap["etag"] = sg.Etag 7562 } 7563 if sg.ID != nil { 7564 objectMap["id"] = sg.ID 7565 } 7566 if sg.Location != nil { 7567 objectMap["location"] = sg.Location 7568 } 7569 if sg.Tags != nil { 7570 objectMap["tags"] = sg.Tags 7571 } 7572 return json.Marshal(objectMap) 7573} 7574 7575// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. 7576func (sg *SecurityGroup) UnmarshalJSON(body []byte) error { 7577 var m map[string]*json.RawMessage 7578 err := json.Unmarshal(body, &m) 7579 if err != nil { 7580 return err 7581 } 7582 for k, v := range m { 7583 switch k { 7584 case "properties": 7585 if v != nil { 7586 var securityGroupPropertiesFormat SecurityGroupPropertiesFormat 7587 err = json.Unmarshal(*v, &securityGroupPropertiesFormat) 7588 if err != nil { 7589 return err 7590 } 7591 sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat 7592 } 7593 case "etag": 7594 if v != nil { 7595 var etag string 7596 err = json.Unmarshal(*v, &etag) 7597 if err != nil { 7598 return err 7599 } 7600 sg.Etag = &etag 7601 } 7602 case "id": 7603 if v != nil { 7604 var ID string 7605 err = json.Unmarshal(*v, &ID) 7606 if err != nil { 7607 return err 7608 } 7609 sg.ID = &ID 7610 } 7611 case "name": 7612 if v != nil { 7613 var name string 7614 err = json.Unmarshal(*v, &name) 7615 if err != nil { 7616 return err 7617 } 7618 sg.Name = &name 7619 } 7620 case "type": 7621 if v != nil { 7622 var typeVar string 7623 err = json.Unmarshal(*v, &typeVar) 7624 if err != nil { 7625 return err 7626 } 7627 sg.Type = &typeVar 7628 } 7629 case "location": 7630 if v != nil { 7631 var location string 7632 err = json.Unmarshal(*v, &location) 7633 if err != nil { 7634 return err 7635 } 7636 sg.Location = &location 7637 } 7638 case "tags": 7639 if v != nil { 7640 var tags map[string]*string 7641 err = json.Unmarshal(*v, &tags) 7642 if err != nil { 7643 return err 7644 } 7645 sg.Tags = tags 7646 } 7647 } 7648 } 7649 7650 return nil 7651} 7652 7653// SecurityGroupListResult response for ListNetworkSecurityGroups API service call. 7654type SecurityGroupListResult struct { 7655 autorest.Response `json:"-"` 7656 // Value - A list of NetworkSecurityGroup resources. 7657 Value *[]SecurityGroup `json:"value,omitempty"` 7658 // NextLink - The URL to get the next set of results. 7659 NextLink *string `json:"nextLink,omitempty"` 7660} 7661 7662// SecurityGroupListResultIterator provides access to a complete listing of SecurityGroup values. 7663type SecurityGroupListResultIterator struct { 7664 i int 7665 page SecurityGroupListResultPage 7666} 7667 7668// NextWithContext advances to the next value. If there was an error making 7669// the request the iterator does not advance and the error is returned. 7670func (iter *SecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { 7671 if tracing.IsEnabled() { 7672 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultIterator.NextWithContext") 7673 defer func() { 7674 sc := -1 7675 if iter.Response().Response.Response != nil { 7676 sc = iter.Response().Response.Response.StatusCode 7677 } 7678 tracing.EndSpan(ctx, sc, err) 7679 }() 7680 } 7681 iter.i++ 7682 if iter.i < len(iter.page.Values()) { 7683 return nil 7684 } 7685 err = iter.page.NextWithContext(ctx) 7686 if err != nil { 7687 iter.i-- 7688 return err 7689 } 7690 iter.i = 0 7691 return nil 7692} 7693 7694// Next advances to the next value. If there was an error making 7695// the request the iterator does not advance and the error is returned. 7696// Deprecated: Use NextWithContext() instead. 7697func (iter *SecurityGroupListResultIterator) Next() error { 7698 return iter.NextWithContext(context.Background()) 7699} 7700 7701// NotDone returns true if the enumeration should be started or is not yet complete. 7702func (iter SecurityGroupListResultIterator) NotDone() bool { 7703 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7704} 7705 7706// Response returns the raw server response from the last page request. 7707func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult { 7708 return iter.page.Response() 7709} 7710 7711// Value returns the current value or a zero-initialized value if the 7712// iterator has advanced beyond the end of the collection. 7713func (iter SecurityGroupListResultIterator) Value() SecurityGroup { 7714 if !iter.page.NotDone() { 7715 return SecurityGroup{} 7716 } 7717 return iter.page.Values()[iter.i] 7718} 7719 7720// Creates a new instance of the SecurityGroupListResultIterator type. 7721func NewSecurityGroupListResultIterator(page SecurityGroupListResultPage) SecurityGroupListResultIterator { 7722 return SecurityGroupListResultIterator{page: page} 7723} 7724 7725// IsEmpty returns true if the ListResult contains no values. 7726func (sglr SecurityGroupListResult) IsEmpty() bool { 7727 return sglr.Value == nil || len(*sglr.Value) == 0 7728} 7729 7730// hasNextLink returns true if the NextLink is not empty. 7731func (sglr SecurityGroupListResult) hasNextLink() bool { 7732 return sglr.NextLink != nil && len(*sglr.NextLink) != 0 7733} 7734 7735// securityGroupListResultPreparer prepares a request to retrieve the next set of results. 7736// It returns nil if no more results exist. 7737func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) { 7738 if !sglr.hasNextLink() { 7739 return nil, nil 7740 } 7741 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7742 autorest.AsJSON(), 7743 autorest.AsGet(), 7744 autorest.WithBaseURL(to.String(sglr.NextLink))) 7745} 7746 7747// SecurityGroupListResultPage contains a page of SecurityGroup values. 7748type SecurityGroupListResultPage struct { 7749 fn func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error) 7750 sglr SecurityGroupListResult 7751} 7752 7753// NextWithContext advances to the next page of values. If there was an error making 7754// the request the page does not advance and the error is returned. 7755func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) { 7756 if tracing.IsEnabled() { 7757 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultPage.NextWithContext") 7758 defer func() { 7759 sc := -1 7760 if page.Response().Response.Response != nil { 7761 sc = page.Response().Response.Response.StatusCode 7762 } 7763 tracing.EndSpan(ctx, sc, err) 7764 }() 7765 } 7766 for { 7767 next, err := page.fn(ctx, page.sglr) 7768 if err != nil { 7769 return err 7770 } 7771 page.sglr = next 7772 if !next.hasNextLink() || !next.IsEmpty() { 7773 break 7774 } 7775 } 7776 return nil 7777} 7778 7779// Next advances to the next page of values. If there was an error making 7780// the request the page does not advance and the error is returned. 7781// Deprecated: Use NextWithContext() instead. 7782func (page *SecurityGroupListResultPage) Next() error { 7783 return page.NextWithContext(context.Background()) 7784} 7785 7786// NotDone returns true if the page enumeration should be started or is not yet complete. 7787func (page SecurityGroupListResultPage) NotDone() bool { 7788 return !page.sglr.IsEmpty() 7789} 7790 7791// Response returns the raw server response from the last page request. 7792func (page SecurityGroupListResultPage) Response() SecurityGroupListResult { 7793 return page.sglr 7794} 7795 7796// Values returns the slice of values for the current page or nil if there are no values. 7797func (page SecurityGroupListResultPage) Values() []SecurityGroup { 7798 if page.sglr.IsEmpty() { 7799 return nil 7800 } 7801 return *page.sglr.Value 7802} 7803 7804// Creates a new instance of the SecurityGroupListResultPage type. 7805func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage { 7806 return SecurityGroupListResultPage{ 7807 fn: getNextPage, 7808 sglr: cur, 7809 } 7810} 7811 7812// SecurityGroupNetworkInterface network interface and all its associated security rules. 7813type SecurityGroupNetworkInterface struct { 7814 // ID - ID of the network interface. 7815 ID *string `json:"id,omitempty"` 7816 SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` 7817} 7818 7819// SecurityGroupPropertiesFormat network Security Group resource. 7820type SecurityGroupPropertiesFormat struct { 7821 // SecurityRules - A collection of security rules of the network security group. 7822 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 7823 // DefaultSecurityRules - The default security rules of network security group. 7824 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` 7825 // NetworkInterfaces - READ-ONLY; A collection of references to network interfaces. 7826 NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` 7827 // Subnets - READ-ONLY; A collection of references to subnets. 7828 Subnets *[]Subnet `json:"subnets,omitempty"` 7829 // ResourceGUID - The resource GUID property of the network security group resource. 7830 ResourceGUID *string `json:"resourceGuid,omitempty"` 7831 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 7832 ProvisioningState *string `json:"provisioningState,omitempty"` 7833} 7834 7835// MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat. 7836func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { 7837 objectMap := make(map[string]interface{}) 7838 if sgpf.SecurityRules != nil { 7839 objectMap["securityRules"] = sgpf.SecurityRules 7840 } 7841 if sgpf.DefaultSecurityRules != nil { 7842 objectMap["defaultSecurityRules"] = sgpf.DefaultSecurityRules 7843 } 7844 if sgpf.ResourceGUID != nil { 7845 objectMap["resourceGuid"] = sgpf.ResourceGUID 7846 } 7847 if sgpf.ProvisioningState != nil { 7848 objectMap["provisioningState"] = sgpf.ProvisioningState 7849 } 7850 return json.Marshal(objectMap) 7851} 7852 7853// SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 7854// long-running operation. 7855type SecurityGroupsCreateOrUpdateFuture struct { 7856 azure.FutureAPI 7857 // Result returns the result of the asynchronous operation. 7858 // If the operation has not completed it will return an error. 7859 Result func(SecurityGroupsClient) (SecurityGroup, error) 7860} 7861 7862// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7863func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7864 var azFuture azure.Future 7865 if err := json.Unmarshal(body, &azFuture); err != nil { 7866 return err 7867 } 7868 future.FutureAPI = &azFuture 7869 future.Result = future.result 7870 return nil 7871} 7872 7873// result is the default implementation for SecurityGroupsCreateOrUpdateFuture.Result. 7874func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) { 7875 var done bool 7876 done, err = future.DoneWithContext(context.Background(), client) 7877 if err != nil { 7878 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7879 return 7880 } 7881 if !done { 7882 sg.Response.Response = future.Response() 7883 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") 7884 return 7885 } 7886 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7887 if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent { 7888 sg, err = client.CreateOrUpdateResponder(sg.Response.Response) 7889 if err != nil { 7890 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request") 7891 } 7892 } 7893 return 7894} 7895 7896// SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7897// operation. 7898type SecurityGroupsDeleteFuture struct { 7899 azure.FutureAPI 7900 // Result returns the result of the asynchronous operation. 7901 // If the operation has not completed it will return an error. 7902 Result func(SecurityGroupsClient) (autorest.Response, error) 7903} 7904 7905// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7906func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error { 7907 var azFuture azure.Future 7908 if err := json.Unmarshal(body, &azFuture); err != nil { 7909 return err 7910 } 7911 future.FutureAPI = &azFuture 7912 future.Result = future.result 7913 return nil 7914} 7915 7916// result is the default implementation for SecurityGroupsDeleteFuture.Result. 7917func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) { 7918 var done bool 7919 done, err = future.DoneWithContext(context.Background(), client) 7920 if err != nil { 7921 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") 7922 return 7923 } 7924 if !done { 7925 ar.Response = future.Response() 7926 err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") 7927 return 7928 } 7929 ar.Response = future.Response() 7930 return 7931} 7932 7933// SecurityGroupViewParameters parameters that define the VM to check security groups for. 7934type SecurityGroupViewParameters struct { 7935 // TargetResourceID - ID of the target VM. 7936 TargetResourceID *string `json:"targetResourceId,omitempty"` 7937} 7938 7939// SecurityGroupViewResult the information about security rules applied to the specified VM. 7940type SecurityGroupViewResult struct { 7941 autorest.Response `json:"-"` 7942 // NetworkInterfaces - List of network interfaces on the specified VM. 7943 NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` 7944} 7945 7946// SecurityRule network security rule. 7947type SecurityRule struct { 7948 autorest.Response `json:"-"` 7949 *SecurityRulePropertiesFormat `json:"properties,omitempty"` 7950 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 7951 Name *string `json:"name,omitempty"` 7952 // Etag - A unique read-only string that changes whenever the resource is updated. 7953 Etag *string `json:"etag,omitempty"` 7954 // ID - Resource ID. 7955 ID *string `json:"id,omitempty"` 7956} 7957 7958// MarshalJSON is the custom marshaler for SecurityRule. 7959func (sr SecurityRule) MarshalJSON() ([]byte, error) { 7960 objectMap := make(map[string]interface{}) 7961 if sr.SecurityRulePropertiesFormat != nil { 7962 objectMap["properties"] = sr.SecurityRulePropertiesFormat 7963 } 7964 if sr.Name != nil { 7965 objectMap["name"] = sr.Name 7966 } 7967 if sr.Etag != nil { 7968 objectMap["etag"] = sr.Etag 7969 } 7970 if sr.ID != nil { 7971 objectMap["id"] = sr.ID 7972 } 7973 return json.Marshal(objectMap) 7974} 7975 7976// UnmarshalJSON is the custom unmarshaler for SecurityRule struct. 7977func (sr *SecurityRule) 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 securityRulePropertiesFormat SecurityRulePropertiesFormat 7988 err = json.Unmarshal(*v, &securityRulePropertiesFormat) 7989 if err != nil { 7990 return err 7991 } 7992 sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat 7993 } 7994 case "name": 7995 if v != nil { 7996 var name string 7997 err = json.Unmarshal(*v, &name) 7998 if err != nil { 7999 return err 8000 } 8001 sr.Name = &name 8002 } 8003 case "etag": 8004 if v != nil { 8005 var etag string 8006 err = json.Unmarshal(*v, &etag) 8007 if err != nil { 8008 return err 8009 } 8010 sr.Etag = &etag 8011 } 8012 case "id": 8013 if v != nil { 8014 var ID string 8015 err = json.Unmarshal(*v, &ID) 8016 if err != nil { 8017 return err 8018 } 8019 sr.ID = &ID 8020 } 8021 } 8022 } 8023 8024 return nil 8025} 8026 8027// SecurityRuleAssociations all security rules associated with the network interface. 8028type SecurityRuleAssociations struct { 8029 NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` 8030 SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` 8031 // DefaultSecurityRules - Collection of default security rules of the network security group. 8032 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` 8033 // EffectiveSecurityRules - Collection of effective security rules. 8034 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` 8035} 8036 8037// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that 8038// belongs to a network security group. 8039type SecurityRuleListResult struct { 8040 autorest.Response `json:"-"` 8041 // Value - The security rules in a network security group. 8042 Value *[]SecurityRule `json:"value,omitempty"` 8043 // NextLink - The URL to get the next set of results. 8044 NextLink *string `json:"nextLink,omitempty"` 8045} 8046 8047// SecurityRuleListResultIterator provides access to a complete listing of SecurityRule values. 8048type SecurityRuleListResultIterator struct { 8049 i int 8050 page SecurityRuleListResultPage 8051} 8052 8053// NextWithContext advances to the next value. If there was an error making 8054// the request the iterator does not advance and the error is returned. 8055func (iter *SecurityRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 8056 if tracing.IsEnabled() { 8057 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultIterator.NextWithContext") 8058 defer func() { 8059 sc := -1 8060 if iter.Response().Response.Response != nil { 8061 sc = iter.Response().Response.Response.StatusCode 8062 } 8063 tracing.EndSpan(ctx, sc, err) 8064 }() 8065 } 8066 iter.i++ 8067 if iter.i < len(iter.page.Values()) { 8068 return nil 8069 } 8070 err = iter.page.NextWithContext(ctx) 8071 if err != nil { 8072 iter.i-- 8073 return err 8074 } 8075 iter.i = 0 8076 return nil 8077} 8078 8079// Next advances to the next value. If there was an error making 8080// the request the iterator does not advance and the error is returned. 8081// Deprecated: Use NextWithContext() instead. 8082func (iter *SecurityRuleListResultIterator) Next() error { 8083 return iter.NextWithContext(context.Background()) 8084} 8085 8086// NotDone returns true if the enumeration should be started or is not yet complete. 8087func (iter SecurityRuleListResultIterator) NotDone() bool { 8088 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8089} 8090 8091// Response returns the raw server response from the last page request. 8092func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult { 8093 return iter.page.Response() 8094} 8095 8096// Value returns the current value or a zero-initialized value if the 8097// iterator has advanced beyond the end of the collection. 8098func (iter SecurityRuleListResultIterator) Value() SecurityRule { 8099 if !iter.page.NotDone() { 8100 return SecurityRule{} 8101 } 8102 return iter.page.Values()[iter.i] 8103} 8104 8105// Creates a new instance of the SecurityRuleListResultIterator type. 8106func NewSecurityRuleListResultIterator(page SecurityRuleListResultPage) SecurityRuleListResultIterator { 8107 return SecurityRuleListResultIterator{page: page} 8108} 8109 8110// IsEmpty returns true if the ListResult contains no values. 8111func (srlr SecurityRuleListResult) IsEmpty() bool { 8112 return srlr.Value == nil || len(*srlr.Value) == 0 8113} 8114 8115// hasNextLink returns true if the NextLink is not empty. 8116func (srlr SecurityRuleListResult) hasNextLink() bool { 8117 return srlr.NextLink != nil && len(*srlr.NextLink) != 0 8118} 8119 8120// securityRuleListResultPreparer prepares a request to retrieve the next set of results. 8121// It returns nil if no more results exist. 8122func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) { 8123 if !srlr.hasNextLink() { 8124 return nil, nil 8125 } 8126 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8127 autorest.AsJSON(), 8128 autorest.AsGet(), 8129 autorest.WithBaseURL(to.String(srlr.NextLink))) 8130} 8131 8132// SecurityRuleListResultPage contains a page of SecurityRule values. 8133type SecurityRuleListResultPage struct { 8134 fn func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error) 8135 srlr SecurityRuleListResult 8136} 8137 8138// NextWithContext advances to the next page of values. If there was an error making 8139// the request the page does not advance and the error is returned. 8140func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (err error) { 8141 if tracing.IsEnabled() { 8142 ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultPage.NextWithContext") 8143 defer func() { 8144 sc := -1 8145 if page.Response().Response.Response != nil { 8146 sc = page.Response().Response.Response.StatusCode 8147 } 8148 tracing.EndSpan(ctx, sc, err) 8149 }() 8150 } 8151 for { 8152 next, err := page.fn(ctx, page.srlr) 8153 if err != nil { 8154 return err 8155 } 8156 page.srlr = next 8157 if !next.hasNextLink() || !next.IsEmpty() { 8158 break 8159 } 8160 } 8161 return nil 8162} 8163 8164// Next advances to the next page of values. If there was an error making 8165// the request the page does not advance and the error is returned. 8166// Deprecated: Use NextWithContext() instead. 8167func (page *SecurityRuleListResultPage) Next() error { 8168 return page.NextWithContext(context.Background()) 8169} 8170 8171// NotDone returns true if the page enumeration should be started or is not yet complete. 8172func (page SecurityRuleListResultPage) NotDone() bool { 8173 return !page.srlr.IsEmpty() 8174} 8175 8176// Response returns the raw server response from the last page request. 8177func (page SecurityRuleListResultPage) Response() SecurityRuleListResult { 8178 return page.srlr 8179} 8180 8181// Values returns the slice of values for the current page or nil if there are no values. 8182func (page SecurityRuleListResultPage) Values() []SecurityRule { 8183 if page.srlr.IsEmpty() { 8184 return nil 8185 } 8186 return *page.srlr.Value 8187} 8188 8189// Creates a new instance of the SecurityRuleListResultPage type. 8190func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage { 8191 return SecurityRuleListResultPage{ 8192 fn: getNextPage, 8193 srlr: cur, 8194 } 8195} 8196 8197// SecurityRulePropertiesFormat ... 8198type SecurityRulePropertiesFormat struct { 8199 // Description - A description for this rule. Restricted to 140 chars. 8200 Description *string `json:"description,omitempty"` 8201 // Protocol - Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolAsterisk' 8202 Protocol SecurityRuleProtocol `json:"protocol,omitempty"` 8203 // SourcePortRange - The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. 8204 SourcePortRange *string `json:"sourcePortRange,omitempty"` 8205 // DestinationPortRange - The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports. 8206 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 8207 // 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. 8208 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 8209 // 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. 8210 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 8211 // Access - The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' 8212 Access SecurityRuleAccess `json:"access,omitempty"` 8213 // 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. 8214 Priority *int32 `json:"priority,omitempty"` 8215 // Direction - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' 8216 Direction SecurityRuleDirection `json:"direction,omitempty"` 8217 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 8218 ProvisioningState *string `json:"provisioningState,omitempty"` 8219} 8220 8221// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 8222// long-running operation. 8223type SecurityRulesCreateOrUpdateFuture struct { 8224 azure.FutureAPI 8225 // Result returns the result of the asynchronous operation. 8226 // If the operation has not completed it will return an error. 8227 Result func(SecurityRulesClient) (SecurityRule, error) 8228} 8229 8230// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8231func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8232 var azFuture azure.Future 8233 if err := json.Unmarshal(body, &azFuture); err != nil { 8234 return err 8235 } 8236 future.FutureAPI = &azFuture 8237 future.Result = future.result 8238 return nil 8239} 8240 8241// result is the default implementation for SecurityRulesCreateOrUpdateFuture.Result. 8242func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) { 8243 var done bool 8244 done, err = future.DoneWithContext(context.Background(), client) 8245 if err != nil { 8246 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8247 return 8248 } 8249 if !done { 8250 sr.Response.Response = future.Response() 8251 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") 8252 return 8253 } 8254 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8255 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 8256 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 8257 if err != nil { 8258 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 8259 } 8260 } 8261 return 8262} 8263 8264// SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8265// operation. 8266type SecurityRulesDeleteFuture struct { 8267 azure.FutureAPI 8268 // Result returns the result of the asynchronous operation. 8269 // If the operation has not completed it will return an error. 8270 Result func(SecurityRulesClient) (autorest.Response, error) 8271} 8272 8273// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8274func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error { 8275 var azFuture azure.Future 8276 if err := json.Unmarshal(body, &azFuture); err != nil { 8277 return err 8278 } 8279 future.FutureAPI = &azFuture 8280 future.Result = future.result 8281 return nil 8282} 8283 8284// result is the default implementation for SecurityRulesDeleteFuture.Result. 8285func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) { 8286 var done bool 8287 done, err = future.DoneWithContext(context.Background(), client) 8288 if err != nil { 8289 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure") 8290 return 8291 } 8292 if !done { 8293 ar.Response = future.Response() 8294 err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") 8295 return 8296 } 8297 ar.Response = future.Response() 8298 return 8299} 8300 8301// String ... 8302type String struct { 8303 autorest.Response `json:"-"` 8304 Value *string `json:"value,omitempty"` 8305} 8306 8307// Subnet subnet in a virtual network resource. 8308type Subnet struct { 8309 autorest.Response `json:"-"` 8310 *SubnetPropertiesFormat `json:"properties,omitempty"` 8311 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 8312 Name *string `json:"name,omitempty"` 8313 // Etag - A unique read-only string that changes whenever the resource is updated. 8314 Etag *string `json:"etag,omitempty"` 8315 // ID - Resource ID. 8316 ID *string `json:"id,omitempty"` 8317} 8318 8319// MarshalJSON is the custom marshaler for Subnet. 8320func (s Subnet) MarshalJSON() ([]byte, error) { 8321 objectMap := make(map[string]interface{}) 8322 if s.SubnetPropertiesFormat != nil { 8323 objectMap["properties"] = s.SubnetPropertiesFormat 8324 } 8325 if s.Name != nil { 8326 objectMap["name"] = s.Name 8327 } 8328 if s.Etag != nil { 8329 objectMap["etag"] = s.Etag 8330 } 8331 if s.ID != nil { 8332 objectMap["id"] = s.ID 8333 } 8334 return json.Marshal(objectMap) 8335} 8336 8337// UnmarshalJSON is the custom unmarshaler for Subnet struct. 8338func (s *Subnet) UnmarshalJSON(body []byte) error { 8339 var m map[string]*json.RawMessage 8340 err := json.Unmarshal(body, &m) 8341 if err != nil { 8342 return err 8343 } 8344 for k, v := range m { 8345 switch k { 8346 case "properties": 8347 if v != nil { 8348 var subnetPropertiesFormat SubnetPropertiesFormat 8349 err = json.Unmarshal(*v, &subnetPropertiesFormat) 8350 if err != nil { 8351 return err 8352 } 8353 s.SubnetPropertiesFormat = &subnetPropertiesFormat 8354 } 8355 case "name": 8356 if v != nil { 8357 var name string 8358 err = json.Unmarshal(*v, &name) 8359 if err != nil { 8360 return err 8361 } 8362 s.Name = &name 8363 } 8364 case "etag": 8365 if v != nil { 8366 var etag string 8367 err = json.Unmarshal(*v, &etag) 8368 if err != nil { 8369 return err 8370 } 8371 s.Etag = &etag 8372 } 8373 case "id": 8374 if v != nil { 8375 var ID string 8376 err = json.Unmarshal(*v, &ID) 8377 if err != nil { 8378 return err 8379 } 8380 s.ID = &ID 8381 } 8382 } 8383 } 8384 8385 return nil 8386} 8387 8388// SubnetAssociation network interface and its custom security rules. 8389type SubnetAssociation struct { 8390 // ID - READ-ONLY; Subnet ID. 8391 ID *string `json:"id,omitempty"` 8392 // SecurityRules - Collection of custom security rules. 8393 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 8394} 8395 8396// MarshalJSON is the custom marshaler for SubnetAssociation. 8397func (sa SubnetAssociation) MarshalJSON() ([]byte, error) { 8398 objectMap := make(map[string]interface{}) 8399 if sa.SecurityRules != nil { 8400 objectMap["securityRules"] = sa.SecurityRules 8401 } 8402 return json.Marshal(objectMap) 8403} 8404 8405// SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual 8406// network 8407type SubnetListResult struct { 8408 autorest.Response `json:"-"` 8409 // Value - The subnets in a virtual network. 8410 Value *[]Subnet `json:"value,omitempty"` 8411 // NextLink - The URL to get the next set of results. 8412 NextLink *string `json:"nextLink,omitempty"` 8413} 8414 8415// SubnetListResultIterator provides access to a complete listing of Subnet values. 8416type SubnetListResultIterator struct { 8417 i int 8418 page SubnetListResultPage 8419} 8420 8421// NextWithContext advances to the next value. If there was an error making 8422// the request the iterator does not advance and the error is returned. 8423func (iter *SubnetListResultIterator) NextWithContext(ctx context.Context) (err error) { 8424 if tracing.IsEnabled() { 8425 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultIterator.NextWithContext") 8426 defer func() { 8427 sc := -1 8428 if iter.Response().Response.Response != nil { 8429 sc = iter.Response().Response.Response.StatusCode 8430 } 8431 tracing.EndSpan(ctx, sc, err) 8432 }() 8433 } 8434 iter.i++ 8435 if iter.i < len(iter.page.Values()) { 8436 return nil 8437 } 8438 err = iter.page.NextWithContext(ctx) 8439 if err != nil { 8440 iter.i-- 8441 return err 8442 } 8443 iter.i = 0 8444 return nil 8445} 8446 8447// Next advances to the next value. If there was an error making 8448// the request the iterator does not advance and the error is returned. 8449// Deprecated: Use NextWithContext() instead. 8450func (iter *SubnetListResultIterator) Next() error { 8451 return iter.NextWithContext(context.Background()) 8452} 8453 8454// NotDone returns true if the enumeration should be started or is not yet complete. 8455func (iter SubnetListResultIterator) NotDone() bool { 8456 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8457} 8458 8459// Response returns the raw server response from the last page request. 8460func (iter SubnetListResultIterator) Response() SubnetListResult { 8461 return iter.page.Response() 8462} 8463 8464// Value returns the current value or a zero-initialized value if the 8465// iterator has advanced beyond the end of the collection. 8466func (iter SubnetListResultIterator) Value() Subnet { 8467 if !iter.page.NotDone() { 8468 return Subnet{} 8469 } 8470 return iter.page.Values()[iter.i] 8471} 8472 8473// Creates a new instance of the SubnetListResultIterator type. 8474func NewSubnetListResultIterator(page SubnetListResultPage) SubnetListResultIterator { 8475 return SubnetListResultIterator{page: page} 8476} 8477 8478// IsEmpty returns true if the ListResult contains no values. 8479func (slr SubnetListResult) IsEmpty() bool { 8480 return slr.Value == nil || len(*slr.Value) == 0 8481} 8482 8483// hasNextLink returns true if the NextLink is not empty. 8484func (slr SubnetListResult) hasNextLink() bool { 8485 return slr.NextLink != nil && len(*slr.NextLink) != 0 8486} 8487 8488// subnetListResultPreparer prepares a request to retrieve the next set of results. 8489// It returns nil if no more results exist. 8490func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) { 8491 if !slr.hasNextLink() { 8492 return nil, nil 8493 } 8494 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8495 autorest.AsJSON(), 8496 autorest.AsGet(), 8497 autorest.WithBaseURL(to.String(slr.NextLink))) 8498} 8499 8500// SubnetListResultPage contains a page of Subnet values. 8501type SubnetListResultPage struct { 8502 fn func(context.Context, SubnetListResult) (SubnetListResult, error) 8503 slr SubnetListResult 8504} 8505 8506// NextWithContext advances to the next page of values. If there was an error making 8507// the request the page does not advance and the error is returned. 8508func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err error) { 8509 if tracing.IsEnabled() { 8510 ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultPage.NextWithContext") 8511 defer func() { 8512 sc := -1 8513 if page.Response().Response.Response != nil { 8514 sc = page.Response().Response.Response.StatusCode 8515 } 8516 tracing.EndSpan(ctx, sc, err) 8517 }() 8518 } 8519 for { 8520 next, err := page.fn(ctx, page.slr) 8521 if err != nil { 8522 return err 8523 } 8524 page.slr = next 8525 if !next.hasNextLink() || !next.IsEmpty() { 8526 break 8527 } 8528 } 8529 return nil 8530} 8531 8532// Next advances to the next page of values. If there was an error making 8533// the request the page does not advance and the error is returned. 8534// Deprecated: Use NextWithContext() instead. 8535func (page *SubnetListResultPage) Next() error { 8536 return page.NextWithContext(context.Background()) 8537} 8538 8539// NotDone returns true if the page enumeration should be started or is not yet complete. 8540func (page SubnetListResultPage) NotDone() bool { 8541 return !page.slr.IsEmpty() 8542} 8543 8544// Response returns the raw server response from the last page request. 8545func (page SubnetListResultPage) Response() SubnetListResult { 8546 return page.slr 8547} 8548 8549// Values returns the slice of values for the current page or nil if there are no values. 8550func (page SubnetListResultPage) Values() []Subnet { 8551 if page.slr.IsEmpty() { 8552 return nil 8553 } 8554 return *page.slr.Value 8555} 8556 8557// Creates a new instance of the SubnetListResultPage type. 8558func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage { 8559 return SubnetListResultPage{ 8560 fn: getNextPage, 8561 slr: cur, 8562 } 8563} 8564 8565// SubnetPropertiesFormat ... 8566type SubnetPropertiesFormat struct { 8567 // AddressPrefix - The address prefix for the subnet. 8568 AddressPrefix *string `json:"addressPrefix,omitempty"` 8569 // NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource. 8570 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 8571 // RouteTable - The reference of the RouteTable resource. 8572 RouteTable *RouteTable `json:"routeTable,omitempty"` 8573 // IPConfigurations - READ-ONLY; Gets an array of references to the network interface IP configurations using subnet. 8574 IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` 8575 // ResourceNavigationLinks - Gets an array of references to the external resources using subnet. 8576 ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` 8577 // ProvisioningState - The provisioning state of the resource. 8578 ProvisioningState *string `json:"provisioningState,omitempty"` 8579} 8580 8581// MarshalJSON is the custom marshaler for SubnetPropertiesFormat. 8582func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) { 8583 objectMap := make(map[string]interface{}) 8584 if spf.AddressPrefix != nil { 8585 objectMap["addressPrefix"] = spf.AddressPrefix 8586 } 8587 if spf.NetworkSecurityGroup != nil { 8588 objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup 8589 } 8590 if spf.RouteTable != nil { 8591 objectMap["routeTable"] = spf.RouteTable 8592 } 8593 if spf.ResourceNavigationLinks != nil { 8594 objectMap["resourceNavigationLinks"] = spf.ResourceNavigationLinks 8595 } 8596 if spf.ProvisioningState != nil { 8597 objectMap["provisioningState"] = spf.ProvisioningState 8598 } 8599 return json.Marshal(objectMap) 8600} 8601 8602// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8603// operation. 8604type SubnetsCreateOrUpdateFuture struct { 8605 azure.FutureAPI 8606 // Result returns the result of the asynchronous operation. 8607 // If the operation has not completed it will return an error. 8608 Result func(SubnetsClient) (Subnet, error) 8609} 8610 8611// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8612func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 8613 var azFuture azure.Future 8614 if err := json.Unmarshal(body, &azFuture); err != nil { 8615 return err 8616 } 8617 future.FutureAPI = &azFuture 8618 future.Result = future.result 8619 return nil 8620} 8621 8622// result is the default implementation for SubnetsCreateOrUpdateFuture.Result. 8623func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) { 8624 var done bool 8625 done, err = future.DoneWithContext(context.Background(), client) 8626 if err != nil { 8627 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8628 return 8629 } 8630 if !done { 8631 s.Response.Response = future.Response() 8632 err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") 8633 return 8634 } 8635 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8636 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 8637 s, err = client.CreateOrUpdateResponder(s.Response.Response) 8638 if err != nil { 8639 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 8640 } 8641 } 8642 return 8643} 8644 8645// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8646// operation. 8647type SubnetsDeleteFuture struct { 8648 azure.FutureAPI 8649 // Result returns the result of the asynchronous operation. 8650 // If the operation has not completed it will return an error. 8651 Result func(SubnetsClient) (autorest.Response, error) 8652} 8653 8654// UnmarshalJSON is the custom unmarshaller for CreateFuture. 8655func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error { 8656 var azFuture azure.Future 8657 if err := json.Unmarshal(body, &azFuture); err != nil { 8658 return err 8659 } 8660 future.FutureAPI = &azFuture 8661 future.Result = future.result 8662 return nil 8663} 8664 8665// result is the default implementation for SubnetsDeleteFuture.Result. 8666func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) { 8667 var done bool 8668 done, err = future.DoneWithContext(context.Background(), client) 8669 if err != nil { 8670 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure") 8671 return 8672 } 8673 if !done { 8674 ar.Response = future.Response() 8675 err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") 8676 return 8677 } 8678 ar.Response = future.Response() 8679 return 8680} 8681 8682// SubResource ... 8683type SubResource struct { 8684 // ID - Resource ID. 8685 ID *string `json:"id,omitempty"` 8686} 8687 8688// Topology topology of the specified resource group. 8689type Topology struct { 8690 autorest.Response `json:"-"` 8691 // ID - READ-ONLY; GUID representing the operation id. 8692 ID *string `json:"id,omitempty"` 8693 // CreatedDateTime - READ-ONLY; The datetime when the topology was initially created for the resource group. 8694 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 8695 // LastModified - READ-ONLY; The datetime when the topology was last modified. 8696 LastModified *date.Time `json:"lastModified,omitempty"` 8697 Resources *[]TopologyResource `json:"resources,omitempty"` 8698} 8699 8700// MarshalJSON is the custom marshaler for Topology. 8701func (t Topology) MarshalJSON() ([]byte, error) { 8702 objectMap := make(map[string]interface{}) 8703 if t.Resources != nil { 8704 objectMap["resources"] = t.Resources 8705 } 8706 return json.Marshal(objectMap) 8707} 8708 8709// TopologyAssociation resources that have an association with the parent resource. 8710type TopologyAssociation struct { 8711 // Name - The name of the resource that is associated with the parent resource. 8712 Name *string `json:"name,omitempty"` 8713 // ResourceID - The ID of the resource that is associated with the parent resource. 8714 ResourceID *string `json:"resourceId,omitempty"` 8715 // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains' 8716 AssociationType AssociationType `json:"associationType,omitempty"` 8717} 8718 8719// TopologyParameters parameters that define the representation of topology. 8720type TopologyParameters struct { 8721 // TargetResourceGroupName - The name of the target resource group to perform topology on. 8722 TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` 8723} 8724 8725// TopologyResource the network resource topology information for the given resource group. 8726type TopologyResource struct { 8727 // Name - Name of the resource. 8728 Name *string `json:"name,omitempty"` 8729 // ID - ID of the resource. 8730 ID *string `json:"id,omitempty"` 8731 // Location - Resource location. 8732 Location *string `json:"location,omitempty"` 8733 // Associations - Holds the associations the resource has with other resources in the resource group. 8734 Associations *[]TopologyAssociation `json:"associations,omitempty"` 8735} 8736 8737// TroubleshootingDetails information gained from troubleshooting of specified resource. 8738type TroubleshootingDetails struct { 8739 // ID - The id of the get troubleshoot operation. 8740 ID *string `json:"id,omitempty"` 8741 // ReasonType - Reason type of failure. 8742 ReasonType *string `json:"reasonType,omitempty"` 8743 // Summary - A summary of troubleshooting. 8744 Summary *string `json:"summary,omitempty"` 8745 // Detail - Details on troubleshooting results. 8746 Detail *string `json:"detail,omitempty"` 8747 // RecommendedActions - List of recommended actions. 8748 RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` 8749} 8750 8751// TroubleshootingParameters parameters that define the resource to troubleshoot. 8752type TroubleshootingParameters struct { 8753 // TargetResourceID - The target resource to troubleshoot. 8754 TargetResourceID *string `json:"targetResourceId,omitempty"` 8755 *TroubleshootingProperties `json:"properties,omitempty"` 8756} 8757 8758// MarshalJSON is the custom marshaler for TroubleshootingParameters. 8759func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) { 8760 objectMap := make(map[string]interface{}) 8761 if tp.TargetResourceID != nil { 8762 objectMap["targetResourceId"] = tp.TargetResourceID 8763 } 8764 if tp.TroubleshootingProperties != nil { 8765 objectMap["properties"] = tp.TroubleshootingProperties 8766 } 8767 return json.Marshal(objectMap) 8768} 8769 8770// UnmarshalJSON is the custom unmarshaler for TroubleshootingParameters struct. 8771func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error { 8772 var m map[string]*json.RawMessage 8773 err := json.Unmarshal(body, &m) 8774 if err != nil { 8775 return err 8776 } 8777 for k, v := range m { 8778 switch k { 8779 case "targetResourceId": 8780 if v != nil { 8781 var targetResourceID string 8782 err = json.Unmarshal(*v, &targetResourceID) 8783 if err != nil { 8784 return err 8785 } 8786 tp.TargetResourceID = &targetResourceID 8787 } 8788 case "properties": 8789 if v != nil { 8790 var troubleshootingProperties TroubleshootingProperties 8791 err = json.Unmarshal(*v, &troubleshootingProperties) 8792 if err != nil { 8793 return err 8794 } 8795 tp.TroubleshootingProperties = &troubleshootingProperties 8796 } 8797 } 8798 } 8799 8800 return nil 8801} 8802 8803// TroubleshootingProperties storage location provided for troubleshoot. 8804type TroubleshootingProperties struct { 8805 // StorageID - The ID for the storage account to save the troubleshoot result. 8806 StorageID *string `json:"storageId,omitempty"` 8807 // StoragePath - The path to the blob to save the troubleshoot result in. 8808 StoragePath *string `json:"storagePath,omitempty"` 8809} 8810 8811// TroubleshootingRecommendedActions recommended actions based on discovered issues. 8812type TroubleshootingRecommendedActions struct { 8813 // ActionID - ID of the recommended action. 8814 ActionID *string `json:"actionId,omitempty"` 8815 // ActionText - Description of recommended actions. 8816 ActionText *string `json:"actionText,omitempty"` 8817 // ActionURI - The uri linking to a documentation for the recommended troubleshooting actions. 8818 ActionURI *string `json:"actionUri,omitempty"` 8819 // ActionURIText - The information from the URI for the recommended troubleshooting actions. 8820 ActionURIText *string `json:"actionUriText,omitempty"` 8821} 8822 8823// TroubleshootingResult troubleshooting information gained from specified resource. 8824type TroubleshootingResult struct { 8825 autorest.Response `json:"-"` 8826 // StartTime - The start time of the troubleshooting. 8827 StartTime *date.Time `json:"startTime,omitempty"` 8828 // EndTime - The end time of the troubleshooting. 8829 EndTime *date.Time `json:"endTime,omitempty"` 8830 // Code - The result code of the troubleshooting. 8831 Code *string `json:"code,omitempty"` 8832 // Results - Information from troubleshooting. 8833 Results *[]TroubleshootingDetails `json:"results,omitempty"` 8834} 8835 8836// TunnelConnectionHealth virtualNetworkGatewayConnection properties 8837type TunnelConnectionHealth struct { 8838 // Tunnel - READ-ONLY; Tunnel name. 8839 Tunnel *string `json:"tunnel,omitempty"` 8840 // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' 8841 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 8842 // IngressBytesTransferred - READ-ONLY; The Ingress Bytes Transferred in this connection 8843 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 8844 // EgressBytesTransferred - READ-ONLY; The Egress Bytes Transferred in this connection 8845 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 8846 // LastConnectionEstablishedUtcTime - READ-ONLY; The time at which connection was established in Utc format. 8847 LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` 8848} 8849 8850// MarshalJSON is the custom marshaler for TunnelConnectionHealth. 8851func (tch TunnelConnectionHealth) MarshalJSON() ([]byte, error) { 8852 objectMap := make(map[string]interface{}) 8853 return json.Marshal(objectMap) 8854} 8855 8856// Usage describes network resource usage. 8857type Usage struct { 8858 // Unit - An enum describing the unit of measurement. 8859 Unit *string `json:"unit,omitempty"` 8860 // CurrentValue - The current value of the usage. 8861 CurrentValue *int64 `json:"currentValue,omitempty"` 8862 // Limit - The limit of usage. 8863 Limit *int64 `json:"limit,omitempty"` 8864 // Name - The name of the type of usage. 8865 Name *UsageName `json:"name,omitempty"` 8866} 8867 8868// UsageName the usage names. 8869type UsageName struct { 8870 // Value - A string describing the resource name. 8871 Value *string `json:"value,omitempty"` 8872 // LocalizedValue - A localized string describing the resource name. 8873 LocalizedValue *string `json:"localizedValue,omitempty"` 8874} 8875 8876// UsagesListResult the list usages operation response. 8877type UsagesListResult struct { 8878 autorest.Response `json:"-"` 8879 // Value - The list network resource usages. 8880 Value *[]Usage `json:"value,omitempty"` 8881 // NextLink - URL to get the next set of results. 8882 NextLink *string `json:"nextLink,omitempty"` 8883} 8884 8885// UsagesListResultIterator provides access to a complete listing of Usage values. 8886type UsagesListResultIterator struct { 8887 i int 8888 page UsagesListResultPage 8889} 8890 8891// NextWithContext advances to the next value. If there was an error making 8892// the request the iterator does not advance and the error is returned. 8893func (iter *UsagesListResultIterator) NextWithContext(ctx context.Context) (err error) { 8894 if tracing.IsEnabled() { 8895 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultIterator.NextWithContext") 8896 defer func() { 8897 sc := -1 8898 if iter.Response().Response.Response != nil { 8899 sc = iter.Response().Response.Response.StatusCode 8900 } 8901 tracing.EndSpan(ctx, sc, err) 8902 }() 8903 } 8904 iter.i++ 8905 if iter.i < len(iter.page.Values()) { 8906 return nil 8907 } 8908 err = iter.page.NextWithContext(ctx) 8909 if err != nil { 8910 iter.i-- 8911 return err 8912 } 8913 iter.i = 0 8914 return nil 8915} 8916 8917// Next advances to the next value. If there was an error making 8918// the request the iterator does not advance and the error is returned. 8919// Deprecated: Use NextWithContext() instead. 8920func (iter *UsagesListResultIterator) Next() error { 8921 return iter.NextWithContext(context.Background()) 8922} 8923 8924// NotDone returns true if the enumeration should be started or is not yet complete. 8925func (iter UsagesListResultIterator) NotDone() bool { 8926 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8927} 8928 8929// Response returns the raw server response from the last page request. 8930func (iter UsagesListResultIterator) Response() UsagesListResult { 8931 return iter.page.Response() 8932} 8933 8934// Value returns the current value or a zero-initialized value if the 8935// iterator has advanced beyond the end of the collection. 8936func (iter UsagesListResultIterator) Value() Usage { 8937 if !iter.page.NotDone() { 8938 return Usage{} 8939 } 8940 return iter.page.Values()[iter.i] 8941} 8942 8943// Creates a new instance of the UsagesListResultIterator type. 8944func NewUsagesListResultIterator(page UsagesListResultPage) UsagesListResultIterator { 8945 return UsagesListResultIterator{page: page} 8946} 8947 8948// IsEmpty returns true if the ListResult contains no values. 8949func (ulr UsagesListResult) IsEmpty() bool { 8950 return ulr.Value == nil || len(*ulr.Value) == 0 8951} 8952 8953// hasNextLink returns true if the NextLink is not empty. 8954func (ulr UsagesListResult) hasNextLink() bool { 8955 return ulr.NextLink != nil && len(*ulr.NextLink) != 0 8956} 8957 8958// usagesListResultPreparer prepares a request to retrieve the next set of results. 8959// It returns nil if no more results exist. 8960func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) { 8961 if !ulr.hasNextLink() { 8962 return nil, nil 8963 } 8964 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8965 autorest.AsJSON(), 8966 autorest.AsGet(), 8967 autorest.WithBaseURL(to.String(ulr.NextLink))) 8968} 8969 8970// UsagesListResultPage contains a page of Usage values. 8971type UsagesListResultPage struct { 8972 fn func(context.Context, UsagesListResult) (UsagesListResult, error) 8973 ulr UsagesListResult 8974} 8975 8976// NextWithContext advances to the next page of values. If there was an error making 8977// the request the page does not advance and the error is returned. 8978func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err error) { 8979 if tracing.IsEnabled() { 8980 ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultPage.NextWithContext") 8981 defer func() { 8982 sc := -1 8983 if page.Response().Response.Response != nil { 8984 sc = page.Response().Response.Response.StatusCode 8985 } 8986 tracing.EndSpan(ctx, sc, err) 8987 }() 8988 } 8989 for { 8990 next, err := page.fn(ctx, page.ulr) 8991 if err != nil { 8992 return err 8993 } 8994 page.ulr = next 8995 if !next.hasNextLink() || !next.IsEmpty() { 8996 break 8997 } 8998 } 8999 return nil 9000} 9001 9002// Next advances to the next page of values. If there was an error making 9003// the request the page does not advance and the error is returned. 9004// Deprecated: Use NextWithContext() instead. 9005func (page *UsagesListResultPage) Next() error { 9006 return page.NextWithContext(context.Background()) 9007} 9008 9009// NotDone returns true if the page enumeration should be started or is not yet complete. 9010func (page UsagesListResultPage) NotDone() bool { 9011 return !page.ulr.IsEmpty() 9012} 9013 9014// Response returns the raw server response from the last page request. 9015func (page UsagesListResultPage) Response() UsagesListResult { 9016 return page.ulr 9017} 9018 9019// Values returns the slice of values for the current page or nil if there are no values. 9020func (page UsagesListResultPage) Values() []Usage { 9021 if page.ulr.IsEmpty() { 9022 return nil 9023 } 9024 return *page.ulr.Value 9025} 9026 9027// Creates a new instance of the UsagesListResultPage type. 9028func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage { 9029 return UsagesListResultPage{ 9030 fn: getNextPage, 9031 ulr: cur, 9032 } 9033} 9034 9035// VerificationIPFlowParameters parameters that define the IP flow to be verified. 9036type VerificationIPFlowParameters struct { 9037 // TargetResourceID - The ID of the target resource to perform next-hop on. 9038 TargetResourceID *string `json:"targetResourceId,omitempty"` 9039 // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' 9040 Direction Direction `json:"direction,omitempty"` 9041 // Protocol - Protocol to be verified on. Possible values include: 'ProtocolTCP', 'ProtocolUDP' 9042 Protocol Protocol `json:"protocol,omitempty"` 9043 // LocalPort - The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. 9044 LocalPort *string `json:"localPort,omitempty"` 9045 // RemotePort - The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. 9046 RemotePort *string `json:"remotePort,omitempty"` 9047 // LocalIPAddress - The local IP address. Acceptable values are valid IPv4 addresses. 9048 LocalIPAddress *string `json:"localIPAddress,omitempty"` 9049 // RemoteIPAddress - The remote IP address. Acceptable values are valid IPv4 addresses. 9050 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` 9051 // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). 9052 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` 9053} 9054 9055// VerificationIPFlowResult results of IP flow verification on the target resource. 9056type VerificationIPFlowResult struct { 9057 autorest.Response `json:"-"` 9058 // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' 9059 Access Access `json:"access,omitempty"` 9060 // RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed. 9061 RuleName *string `json:"ruleName,omitempty"` 9062} 9063 9064// VirtualNetwork virtual Network resource. 9065type VirtualNetwork struct { 9066 autorest.Response `json:"-"` 9067 *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` 9068 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 9069 Etag *string `json:"etag,omitempty"` 9070 // ID - Resource ID. 9071 ID *string `json:"id,omitempty"` 9072 // Name - READ-ONLY; Resource name. 9073 Name *string `json:"name,omitempty"` 9074 // Type - READ-ONLY; Resource type. 9075 Type *string `json:"type,omitempty"` 9076 // Location - Resource location. 9077 Location *string `json:"location,omitempty"` 9078 // Tags - Resource tags. 9079 Tags map[string]*string `json:"tags"` 9080} 9081 9082// MarshalJSON is the custom marshaler for VirtualNetwork. 9083func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { 9084 objectMap := make(map[string]interface{}) 9085 if vn.VirtualNetworkPropertiesFormat != nil { 9086 objectMap["properties"] = vn.VirtualNetworkPropertiesFormat 9087 } 9088 if vn.Etag != nil { 9089 objectMap["etag"] = vn.Etag 9090 } 9091 if vn.ID != nil { 9092 objectMap["id"] = vn.ID 9093 } 9094 if vn.Location != nil { 9095 objectMap["location"] = vn.Location 9096 } 9097 if vn.Tags != nil { 9098 objectMap["tags"] = vn.Tags 9099 } 9100 return json.Marshal(objectMap) 9101} 9102 9103// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. 9104func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { 9105 var m map[string]*json.RawMessage 9106 err := json.Unmarshal(body, &m) 9107 if err != nil { 9108 return err 9109 } 9110 for k, v := range m { 9111 switch k { 9112 case "properties": 9113 if v != nil { 9114 var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat 9115 err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat) 9116 if err != nil { 9117 return err 9118 } 9119 vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat 9120 } 9121 case "etag": 9122 if v != nil { 9123 var etag string 9124 err = json.Unmarshal(*v, &etag) 9125 if err != nil { 9126 return err 9127 } 9128 vn.Etag = &etag 9129 } 9130 case "id": 9131 if v != nil { 9132 var ID string 9133 err = json.Unmarshal(*v, &ID) 9134 if err != nil { 9135 return err 9136 } 9137 vn.ID = &ID 9138 } 9139 case "name": 9140 if v != nil { 9141 var name string 9142 err = json.Unmarshal(*v, &name) 9143 if err != nil { 9144 return err 9145 } 9146 vn.Name = &name 9147 } 9148 case "type": 9149 if v != nil { 9150 var typeVar string 9151 err = json.Unmarshal(*v, &typeVar) 9152 if err != nil { 9153 return err 9154 } 9155 vn.Type = &typeVar 9156 } 9157 case "location": 9158 if v != nil { 9159 var location string 9160 err = json.Unmarshal(*v, &location) 9161 if err != nil { 9162 return err 9163 } 9164 vn.Location = &location 9165 } 9166 case "tags": 9167 if v != nil { 9168 var tags map[string]*string 9169 err = json.Unmarshal(*v, &tags) 9170 if err != nil { 9171 return err 9172 } 9173 vn.Tags = tags 9174 } 9175 } 9176 } 9177 9178 return nil 9179} 9180 9181// VirtualNetworkGateway a common class for general resource information 9182type VirtualNetworkGateway struct { 9183 autorest.Response `json:"-"` 9184 *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 9185 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 9186 Etag *string `json:"etag,omitempty"` 9187 // ID - Resource ID. 9188 ID *string `json:"id,omitempty"` 9189 // Name - READ-ONLY; Resource name. 9190 Name *string `json:"name,omitempty"` 9191 // Type - READ-ONLY; Resource type. 9192 Type *string `json:"type,omitempty"` 9193 // Location - Resource location. 9194 Location *string `json:"location,omitempty"` 9195 // Tags - Resource tags. 9196 Tags map[string]*string `json:"tags"` 9197} 9198 9199// MarshalJSON is the custom marshaler for VirtualNetworkGateway. 9200func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { 9201 objectMap := make(map[string]interface{}) 9202 if vng.VirtualNetworkGatewayPropertiesFormat != nil { 9203 objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat 9204 } 9205 if vng.Etag != nil { 9206 objectMap["etag"] = vng.Etag 9207 } 9208 if vng.ID != nil { 9209 objectMap["id"] = vng.ID 9210 } 9211 if vng.Location != nil { 9212 objectMap["location"] = vng.Location 9213 } 9214 if vng.Tags != nil { 9215 objectMap["tags"] = vng.Tags 9216 } 9217 return json.Marshal(objectMap) 9218} 9219 9220// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. 9221func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { 9222 var m map[string]*json.RawMessage 9223 err := json.Unmarshal(body, &m) 9224 if err != nil { 9225 return err 9226 } 9227 for k, v := range m { 9228 switch k { 9229 case "properties": 9230 if v != nil { 9231 var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat 9232 err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat) 9233 if err != nil { 9234 return err 9235 } 9236 vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat 9237 } 9238 case "etag": 9239 if v != nil { 9240 var etag string 9241 err = json.Unmarshal(*v, &etag) 9242 if err != nil { 9243 return err 9244 } 9245 vng.Etag = &etag 9246 } 9247 case "id": 9248 if v != nil { 9249 var ID string 9250 err = json.Unmarshal(*v, &ID) 9251 if err != nil { 9252 return err 9253 } 9254 vng.ID = &ID 9255 } 9256 case "name": 9257 if v != nil { 9258 var name string 9259 err = json.Unmarshal(*v, &name) 9260 if err != nil { 9261 return err 9262 } 9263 vng.Name = &name 9264 } 9265 case "type": 9266 if v != nil { 9267 var typeVar string 9268 err = json.Unmarshal(*v, &typeVar) 9269 if err != nil { 9270 return err 9271 } 9272 vng.Type = &typeVar 9273 } 9274 case "location": 9275 if v != nil { 9276 var location string 9277 err = json.Unmarshal(*v, &location) 9278 if err != nil { 9279 return err 9280 } 9281 vng.Location = &location 9282 } 9283 case "tags": 9284 if v != nil { 9285 var tags map[string]*string 9286 err = json.Unmarshal(*v, &tags) 9287 if err != nil { 9288 return err 9289 } 9290 vng.Tags = tags 9291 } 9292 } 9293 } 9294 9295 return nil 9296} 9297 9298// VirtualNetworkGatewayConnection a common class for general resource information 9299type VirtualNetworkGatewayConnection struct { 9300 autorest.Response `json:"-"` 9301 *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` 9302 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 9303 Etag *string `json:"etag,omitempty"` 9304 // ID - Resource ID. 9305 ID *string `json:"id,omitempty"` 9306 // Name - READ-ONLY; Resource name. 9307 Name *string `json:"name,omitempty"` 9308 // Type - READ-ONLY; Resource type. 9309 Type *string `json:"type,omitempty"` 9310 // Location - Resource location. 9311 Location *string `json:"location,omitempty"` 9312 // Tags - Resource tags. 9313 Tags map[string]*string `json:"tags"` 9314} 9315 9316// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection. 9317func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { 9318 objectMap := make(map[string]interface{}) 9319 if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil { 9320 objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat 9321 } 9322 if vngc.Etag != nil { 9323 objectMap["etag"] = vngc.Etag 9324 } 9325 if vngc.ID != nil { 9326 objectMap["id"] = vngc.ID 9327 } 9328 if vngc.Location != nil { 9329 objectMap["location"] = vngc.Location 9330 } 9331 if vngc.Tags != nil { 9332 objectMap["tags"] = vngc.Tags 9333 } 9334 return json.Marshal(objectMap) 9335} 9336 9337// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. 9338func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { 9339 var m map[string]*json.RawMessage 9340 err := json.Unmarshal(body, &m) 9341 if err != nil { 9342 return err 9343 } 9344 for k, v := range m { 9345 switch k { 9346 case "properties": 9347 if v != nil { 9348 var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat 9349 err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat) 9350 if err != nil { 9351 return err 9352 } 9353 vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat 9354 } 9355 case "etag": 9356 if v != nil { 9357 var etag string 9358 err = json.Unmarshal(*v, &etag) 9359 if err != nil { 9360 return err 9361 } 9362 vngc.Etag = &etag 9363 } 9364 case "id": 9365 if v != nil { 9366 var ID string 9367 err = json.Unmarshal(*v, &ID) 9368 if err != nil { 9369 return err 9370 } 9371 vngc.ID = &ID 9372 } 9373 case "name": 9374 if v != nil { 9375 var name string 9376 err = json.Unmarshal(*v, &name) 9377 if err != nil { 9378 return err 9379 } 9380 vngc.Name = &name 9381 } 9382 case "type": 9383 if v != nil { 9384 var typeVar string 9385 err = json.Unmarshal(*v, &typeVar) 9386 if err != nil { 9387 return err 9388 } 9389 vngc.Type = &typeVar 9390 } 9391 case "location": 9392 if v != nil { 9393 var location string 9394 err = json.Unmarshal(*v, &location) 9395 if err != nil { 9396 return err 9397 } 9398 vngc.Location = &location 9399 } 9400 case "tags": 9401 if v != nil { 9402 var tags map[string]*string 9403 err = json.Unmarshal(*v, &tags) 9404 if err != nil { 9405 return err 9406 } 9407 vngc.Tags = tags 9408 } 9409 } 9410 } 9411 9412 return nil 9413} 9414 9415// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API 9416// service call 9417type VirtualNetworkGatewayConnectionListResult struct { 9418 autorest.Response `json:"-"` 9419 // Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. 9420 Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` 9421 // NextLink - The URL to get the next set of results. 9422 NextLink *string `json:"nextLink,omitempty"` 9423} 9424 9425// VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of 9426// VirtualNetworkGatewayConnection values. 9427type VirtualNetworkGatewayConnectionListResultIterator struct { 9428 i int 9429 page VirtualNetworkGatewayConnectionListResultPage 9430} 9431 9432// NextWithContext advances to the next value. If there was an error making 9433// the request the iterator does not advance and the error is returned. 9434func (iter *VirtualNetworkGatewayConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 9435 if tracing.IsEnabled() { 9436 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultIterator.NextWithContext") 9437 defer func() { 9438 sc := -1 9439 if iter.Response().Response.Response != nil { 9440 sc = iter.Response().Response.Response.StatusCode 9441 } 9442 tracing.EndSpan(ctx, sc, err) 9443 }() 9444 } 9445 iter.i++ 9446 if iter.i < len(iter.page.Values()) { 9447 return nil 9448 } 9449 err = iter.page.NextWithContext(ctx) 9450 if err != nil { 9451 iter.i-- 9452 return err 9453 } 9454 iter.i = 0 9455 return nil 9456} 9457 9458// Next advances to the next value. If there was an error making 9459// the request the iterator does not advance and the error is returned. 9460// Deprecated: Use NextWithContext() instead. 9461func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error { 9462 return iter.NextWithContext(context.Background()) 9463} 9464 9465// NotDone returns true if the enumeration should be started or is not yet complete. 9466func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool { 9467 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9468} 9469 9470// Response returns the raw server response from the last page request. 9471func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult { 9472 return iter.page.Response() 9473} 9474 9475// Value returns the current value or a zero-initialized value if the 9476// iterator has advanced beyond the end of the collection. 9477func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection { 9478 if !iter.page.NotDone() { 9479 return VirtualNetworkGatewayConnection{} 9480 } 9481 return iter.page.Values()[iter.i] 9482} 9483 9484// Creates a new instance of the VirtualNetworkGatewayConnectionListResultIterator type. 9485func NewVirtualNetworkGatewayConnectionListResultIterator(page VirtualNetworkGatewayConnectionListResultPage) VirtualNetworkGatewayConnectionListResultIterator { 9486 return VirtualNetworkGatewayConnectionListResultIterator{page: page} 9487} 9488 9489// IsEmpty returns true if the ListResult contains no values. 9490func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { 9491 return vngclr.Value == nil || len(*vngclr.Value) == 0 9492} 9493 9494// hasNextLink returns true if the NextLink is not empty. 9495func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool { 9496 return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0 9497} 9498 9499// virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. 9500// It returns nil if no more results exist. 9501func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 9502 if !vngclr.hasNextLink() { 9503 return nil, nil 9504 } 9505 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9506 autorest.AsJSON(), 9507 autorest.AsGet(), 9508 autorest.WithBaseURL(to.String(vngclr.NextLink))) 9509} 9510 9511// VirtualNetworkGatewayConnectionListResultPage contains a page of VirtualNetworkGatewayConnection values. 9512type VirtualNetworkGatewayConnectionListResultPage struct { 9513 fn func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error) 9514 vngclr VirtualNetworkGatewayConnectionListResult 9515} 9516 9517// NextWithContext advances to the next page of values. If there was an error making 9518// the request the page does not advance and the error is returned. 9519func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 9520 if tracing.IsEnabled() { 9521 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultPage.NextWithContext") 9522 defer func() { 9523 sc := -1 9524 if page.Response().Response.Response != nil { 9525 sc = page.Response().Response.Response.StatusCode 9526 } 9527 tracing.EndSpan(ctx, sc, err) 9528 }() 9529 } 9530 for { 9531 next, err := page.fn(ctx, page.vngclr) 9532 if err != nil { 9533 return err 9534 } 9535 page.vngclr = next 9536 if !next.hasNextLink() || !next.IsEmpty() { 9537 break 9538 } 9539 } 9540 return nil 9541} 9542 9543// Next advances to the next page of values. If there was an error making 9544// the request the page does not advance and the error is returned. 9545// Deprecated: Use NextWithContext() instead. 9546func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error { 9547 return page.NextWithContext(context.Background()) 9548} 9549 9550// NotDone returns true if the page enumeration should be started or is not yet complete. 9551func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool { 9552 return !page.vngclr.IsEmpty() 9553} 9554 9555// Response returns the raw server response from the last page request. 9556func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult { 9557 return page.vngclr 9558} 9559 9560// Values returns the slice of values for the current page or nil if there are no values. 9561func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection { 9562 if page.vngclr.IsEmpty() { 9563 return nil 9564 } 9565 return *page.vngclr.Value 9566} 9567 9568// Creates a new instance of the VirtualNetworkGatewayConnectionListResultPage type. 9569func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage { 9570 return VirtualNetworkGatewayConnectionListResultPage{ 9571 fn: getNextPage, 9572 vngclr: cur, 9573 } 9574} 9575 9576// VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties 9577type VirtualNetworkGatewayConnectionPropertiesFormat struct { 9578 // AuthorizationKey - The authorizationKey. 9579 AuthorizationKey *string `json:"authorizationKey,omitempty"` 9580 VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` 9581 VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` 9582 LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` 9583 // ConnectionType - Gateway connection type. Possible values are: 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' 9584 ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` 9585 // RoutingWeight - The routing weight. 9586 RoutingWeight *int32 `json:"routingWeight,omitempty"` 9587 // SharedKey - The IPSec shared key. 9588 SharedKey *string `json:"sharedKey,omitempty"` 9589 // ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' 9590 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 9591 // TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status. 9592 TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` 9593 // EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection. 9594 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 9595 // IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection. 9596 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 9597 // Peer - The reference to peerings resource. 9598 Peer *SubResource `json:"peer,omitempty"` 9599 // EnableBgp - EnableBgp flag 9600 EnableBgp *bool `json:"enableBgp,omitempty"` 9601 // ResourceGUID - The resource GUID property of the VirtualNetworkGatewayConnection resource. 9602 ResourceGUID *string `json:"resourceGuid,omitempty"` 9603 // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 9604 ProvisioningState *string `json:"provisioningState,omitempty"` 9605} 9606 9607// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat. 9608func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) { 9609 objectMap := make(map[string]interface{}) 9610 if vngcpf.AuthorizationKey != nil { 9611 objectMap["authorizationKey"] = vngcpf.AuthorizationKey 9612 } 9613 if vngcpf.VirtualNetworkGateway1 != nil { 9614 objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1 9615 } 9616 if vngcpf.VirtualNetworkGateway2 != nil { 9617 objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2 9618 } 9619 if vngcpf.LocalNetworkGateway2 != nil { 9620 objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2 9621 } 9622 if vngcpf.ConnectionType != "" { 9623 objectMap["connectionType"] = vngcpf.ConnectionType 9624 } 9625 if vngcpf.RoutingWeight != nil { 9626 objectMap["routingWeight"] = vngcpf.RoutingWeight 9627 } 9628 if vngcpf.SharedKey != nil { 9629 objectMap["sharedKey"] = vngcpf.SharedKey 9630 } 9631 if vngcpf.Peer != nil { 9632 objectMap["peer"] = vngcpf.Peer 9633 } 9634 if vngcpf.EnableBgp != nil { 9635 objectMap["enableBgp"] = vngcpf.EnableBgp 9636 } 9637 if vngcpf.ResourceGUID != nil { 9638 objectMap["resourceGuid"] = vngcpf.ResourceGUID 9639 } 9640 return json.Marshal(objectMap) 9641} 9642 9643// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 9644// results of a long-running operation. 9645type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { 9646 azure.FutureAPI 9647 // Result returns the result of the asynchronous operation. 9648 // If the operation has not completed it will return an error. 9649 Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error) 9650} 9651 9652// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9653func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 9654 var azFuture azure.Future 9655 if err := json.Unmarshal(body, &azFuture); err != nil { 9656 return err 9657 } 9658 future.FutureAPI = &azFuture 9659 future.Result = future.result 9660 return nil 9661} 9662 9663// result is the default implementation for VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.Result. 9664func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { 9665 var done bool 9666 done, err = future.DoneWithContext(context.Background(), client) 9667 if err != nil { 9668 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9669 return 9670 } 9671 if !done { 9672 vngc.Response.Response = future.Response() 9673 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") 9674 return 9675 } 9676 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9677 if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent { 9678 vngc, err = client.CreateOrUpdateResponder(vngc.Response.Response) 9679 if err != nil { 9680 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", vngc.Response.Response, "Failure responding to request") 9681 } 9682 } 9683 return 9684} 9685 9686// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of 9687// a long-running operation. 9688type VirtualNetworkGatewayConnectionsDeleteFuture struct { 9689 azure.FutureAPI 9690 // Result returns the result of the asynchronous operation. 9691 // If the operation has not completed it will return an error. 9692 Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error) 9693} 9694 9695// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9696func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 9697 var azFuture azure.Future 9698 if err := json.Unmarshal(body, &azFuture); err != nil { 9699 return err 9700 } 9701 future.FutureAPI = &azFuture 9702 future.Result = future.result 9703 return nil 9704} 9705 9706// result is the default implementation for VirtualNetworkGatewayConnectionsDeleteFuture.Result. 9707func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { 9708 var done bool 9709 done, err = future.DoneWithContext(context.Background(), client) 9710 if err != nil { 9711 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 9712 return 9713 } 9714 if !done { 9715 ar.Response = future.Response() 9716 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") 9717 return 9718 } 9719 ar.Response = future.Response() 9720 return 9721} 9722 9723// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the 9724// results of a long-running operation. 9725type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { 9726 azure.FutureAPI 9727 // Result returns the result of the asynchronous operation. 9728 // If the operation has not completed it will return an error. 9729 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error) 9730} 9731 9732// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9733func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error { 9734 var azFuture azure.Future 9735 if err := json.Unmarshal(body, &azFuture); err != nil { 9736 return err 9737 } 9738 future.FutureAPI = &azFuture 9739 future.Result = future.result 9740 return nil 9741} 9742 9743// result is the default implementation for VirtualNetworkGatewayConnectionsResetSharedKeyFuture.Result. 9744func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { 9745 var done bool 9746 done, err = future.DoneWithContext(context.Background(), client) 9747 if err != nil { 9748 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure") 9749 return 9750 } 9751 if !done { 9752 crsk.Response.Response = future.Response() 9753 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") 9754 return 9755 } 9756 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9757 if crsk.Response.Response, err = future.GetResult(sender); err == nil && crsk.Response.Response.StatusCode != http.StatusNoContent { 9758 crsk, err = client.ResetSharedKeyResponder(crsk.Response.Response) 9759 if err != nil { 9760 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", crsk.Response.Response, "Failure responding to request") 9761 } 9762 } 9763 return 9764} 9765 9766// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the 9767// results of a long-running operation. 9768type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { 9769 azure.FutureAPI 9770 // Result returns the result of the asynchronous operation. 9771 // If the operation has not completed it will return an error. 9772 Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error) 9773} 9774 9775// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9776func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error { 9777 var azFuture azure.Future 9778 if err := json.Unmarshal(body, &azFuture); err != nil { 9779 return err 9780 } 9781 future.FutureAPI = &azFuture 9782 future.Result = future.result 9783 return nil 9784} 9785 9786// result is the default implementation for VirtualNetworkGatewayConnectionsSetSharedKeyFuture.Result. 9787func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { 9788 var done bool 9789 done, err = future.DoneWithContext(context.Background(), client) 9790 if err != nil { 9791 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure") 9792 return 9793 } 9794 if !done { 9795 csk.Response.Response = future.Response() 9796 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") 9797 return 9798 } 9799 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9800 if csk.Response.Response, err = future.GetResult(sender); err == nil && csk.Response.Response.StatusCode != http.StatusNoContent { 9801 csk, err = client.SetSharedKeyResponder(csk.Response.Response) 9802 if err != nil { 9803 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", csk.Response.Response, "Failure responding to request") 9804 } 9805 } 9806 return 9807} 9808 9809// VirtualNetworkGatewayIPConfiguration IP configuration for virtual network gateway 9810type VirtualNetworkGatewayIPConfiguration struct { 9811 *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 9812 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 9813 Name *string `json:"name,omitempty"` 9814 // Etag - A unique read-only string that changes whenever the resource is updated. 9815 Etag *string `json:"etag,omitempty"` 9816 // ID - Resource ID. 9817 ID *string `json:"id,omitempty"` 9818} 9819 9820// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration. 9821func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 9822 objectMap := make(map[string]interface{}) 9823 if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil { 9824 objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat 9825 } 9826 if vngic.Name != nil { 9827 objectMap["name"] = vngic.Name 9828 } 9829 if vngic.Etag != nil { 9830 objectMap["etag"] = vngic.Etag 9831 } 9832 if vngic.ID != nil { 9833 objectMap["id"] = vngic.ID 9834 } 9835 return json.Marshal(objectMap) 9836} 9837 9838// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. 9839func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 9840 var m map[string]*json.RawMessage 9841 err := json.Unmarshal(body, &m) 9842 if err != nil { 9843 return err 9844 } 9845 for k, v := range m { 9846 switch k { 9847 case "properties": 9848 if v != nil { 9849 var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat 9850 err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat) 9851 if err != nil { 9852 return err 9853 } 9854 vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat 9855 } 9856 case "name": 9857 if v != nil { 9858 var name string 9859 err = json.Unmarshal(*v, &name) 9860 if err != nil { 9861 return err 9862 } 9863 vngic.Name = &name 9864 } 9865 case "etag": 9866 if v != nil { 9867 var etag string 9868 err = json.Unmarshal(*v, &etag) 9869 if err != nil { 9870 return err 9871 } 9872 vngic.Etag = &etag 9873 } 9874 case "id": 9875 if v != nil { 9876 var ID string 9877 err = json.Unmarshal(*v, &ID) 9878 if err != nil { 9879 return err 9880 } 9881 vngic.ID = &ID 9882 } 9883 } 9884 } 9885 9886 return nil 9887} 9888 9889// VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration 9890type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { 9891 // PrivateIPAllocationMethod - The private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 9892 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 9893 // Subnet - The reference of the subnet resource. 9894 Subnet *SubResource `json:"subnet,omitempty"` 9895 // PublicIPAddress - The reference of the public IP resource. 9896 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 9897 // ProvisioningState - READ-ONLY; The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 9898 ProvisioningState *string `json:"provisioningState,omitempty"` 9899} 9900 9901// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfigurationPropertiesFormat. 9902func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { 9903 objectMap := make(map[string]interface{}) 9904 if vngicpf.PrivateIPAllocationMethod != "" { 9905 objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod 9906 } 9907 if vngicpf.Subnet != nil { 9908 objectMap["subnet"] = vngicpf.Subnet 9909 } 9910 if vngicpf.PublicIPAddress != nil { 9911 objectMap["publicIPAddress"] = vngicpf.PublicIPAddress 9912 } 9913 return json.Marshal(objectMap) 9914} 9915 9916// VirtualNetworkGatewayListResult response for the ListVirtualNetworkGateways API service call. 9917type VirtualNetworkGatewayListResult struct { 9918 autorest.Response `json:"-"` 9919 // Value - Gets a list of VirtualNetworkGateway resources that exists in a resource group. 9920 Value *[]VirtualNetworkGateway `json:"value,omitempty"` 9921 // NextLink - The URL to get the next set of results. 9922 NextLink *string `json:"nextLink,omitempty"` 9923} 9924 9925// VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway 9926// values. 9927type VirtualNetworkGatewayListResultIterator struct { 9928 i int 9929 page VirtualNetworkGatewayListResultPage 9930} 9931 9932// NextWithContext advances to the next value. If there was an error making 9933// the request the iterator does not advance and the error is returned. 9934func (iter *VirtualNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { 9935 if tracing.IsEnabled() { 9936 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultIterator.NextWithContext") 9937 defer func() { 9938 sc := -1 9939 if iter.Response().Response.Response != nil { 9940 sc = iter.Response().Response.Response.StatusCode 9941 } 9942 tracing.EndSpan(ctx, sc, err) 9943 }() 9944 } 9945 iter.i++ 9946 if iter.i < len(iter.page.Values()) { 9947 return nil 9948 } 9949 err = iter.page.NextWithContext(ctx) 9950 if err != nil { 9951 iter.i-- 9952 return err 9953 } 9954 iter.i = 0 9955 return nil 9956} 9957 9958// Next advances to the next value. If there was an error making 9959// the request the iterator does not advance and the error is returned. 9960// Deprecated: Use NextWithContext() instead. 9961func (iter *VirtualNetworkGatewayListResultIterator) Next() error { 9962 return iter.NextWithContext(context.Background()) 9963} 9964 9965// NotDone returns true if the enumeration should be started or is not yet complete. 9966func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool { 9967 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9968} 9969 9970// Response returns the raw server response from the last page request. 9971func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult { 9972 return iter.page.Response() 9973} 9974 9975// Value returns the current value or a zero-initialized value if the 9976// iterator has advanced beyond the end of the collection. 9977func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway { 9978 if !iter.page.NotDone() { 9979 return VirtualNetworkGateway{} 9980 } 9981 return iter.page.Values()[iter.i] 9982} 9983 9984// Creates a new instance of the VirtualNetworkGatewayListResultIterator type. 9985func NewVirtualNetworkGatewayListResultIterator(page VirtualNetworkGatewayListResultPage) VirtualNetworkGatewayListResultIterator { 9986 return VirtualNetworkGatewayListResultIterator{page: page} 9987} 9988 9989// IsEmpty returns true if the ListResult contains no values. 9990func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { 9991 return vnglr.Value == nil || len(*vnglr.Value) == 0 9992} 9993 9994// hasNextLink returns true if the NextLink is not empty. 9995func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool { 9996 return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0 9997} 9998 9999// virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 10000// It returns nil if no more results exist. 10001func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { 10002 if !vnglr.hasNextLink() { 10003 return nil, nil 10004 } 10005 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10006 autorest.AsJSON(), 10007 autorest.AsGet(), 10008 autorest.WithBaseURL(to.String(vnglr.NextLink))) 10009} 10010 10011// VirtualNetworkGatewayListResultPage contains a page of VirtualNetworkGateway values. 10012type VirtualNetworkGatewayListResultPage struct { 10013 fn func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error) 10014 vnglr VirtualNetworkGatewayListResult 10015} 10016 10017// NextWithContext advances to the next page of values. If there was an error making 10018// the request the page does not advance and the error is returned. 10019func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { 10020 if tracing.IsEnabled() { 10021 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultPage.NextWithContext") 10022 defer func() { 10023 sc := -1 10024 if page.Response().Response.Response != nil { 10025 sc = page.Response().Response.Response.StatusCode 10026 } 10027 tracing.EndSpan(ctx, sc, err) 10028 }() 10029 } 10030 for { 10031 next, err := page.fn(ctx, page.vnglr) 10032 if err != nil { 10033 return err 10034 } 10035 page.vnglr = next 10036 if !next.hasNextLink() || !next.IsEmpty() { 10037 break 10038 } 10039 } 10040 return nil 10041} 10042 10043// Next advances to the next page of values. If there was an error making 10044// the request the page does not advance and the error is returned. 10045// Deprecated: Use NextWithContext() instead. 10046func (page *VirtualNetworkGatewayListResultPage) Next() error { 10047 return page.NextWithContext(context.Background()) 10048} 10049 10050// NotDone returns true if the page enumeration should be started or is not yet complete. 10051func (page VirtualNetworkGatewayListResultPage) NotDone() bool { 10052 return !page.vnglr.IsEmpty() 10053} 10054 10055// Response returns the raw server response from the last page request. 10056func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult { 10057 return page.vnglr 10058} 10059 10060// Values returns the slice of values for the current page or nil if there are no values. 10061func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway { 10062 if page.vnglr.IsEmpty() { 10063 return nil 10064 } 10065 return *page.vnglr.Value 10066} 10067 10068// Creates a new instance of the VirtualNetworkGatewayListResultPage type. 10069func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage { 10070 return VirtualNetworkGatewayListResultPage{ 10071 fn: getNextPage, 10072 vnglr: cur, 10073 } 10074} 10075 10076// VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties 10077type VirtualNetworkGatewayPropertiesFormat struct { 10078 // IPConfigurations - IP configurations for virtual network gateway. 10079 IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` 10080 // GatewayType - The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute' 10081 GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` 10082 // VpnType - The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' 10083 VpnType VpnType `json:"vpnType,omitempty"` 10084 // EnableBgp - Whether BGP is enabled for this virtual network gateway or not. 10085 EnableBgp *bool `json:"enableBgp,omitempty"` 10086 // ActiveActive - ActiveActive flag 10087 ActiveActive *bool `json:"activeActive,omitempty"` 10088 // 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. 10089 GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` 10090 // Sku - The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. 10091 Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` 10092 // VpnClientConfiguration - The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. 10093 VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` 10094 // BgpSettings - Virtual network gateway's BGP speaker settings. 10095 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 10096 // ResourceGUID - The resource GUID property of the VirtualNetworkGateway resource. 10097 ResourceGUID *string `json:"resourceGuid,omitempty"` 10098 // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 10099 ProvisioningState *string `json:"provisioningState,omitempty"` 10100} 10101 10102// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. 10103func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { 10104 objectMap := make(map[string]interface{}) 10105 if vngpf.IPConfigurations != nil { 10106 objectMap["ipConfigurations"] = vngpf.IPConfigurations 10107 } 10108 if vngpf.GatewayType != "" { 10109 objectMap["gatewayType"] = vngpf.GatewayType 10110 } 10111 if vngpf.VpnType != "" { 10112 objectMap["vpnType"] = vngpf.VpnType 10113 } 10114 if vngpf.EnableBgp != nil { 10115 objectMap["enableBgp"] = vngpf.EnableBgp 10116 } 10117 if vngpf.ActiveActive != nil { 10118 objectMap["activeActive"] = vngpf.ActiveActive 10119 } 10120 if vngpf.GatewayDefaultSite != nil { 10121 objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite 10122 } 10123 if vngpf.Sku != nil { 10124 objectMap["sku"] = vngpf.Sku 10125 } 10126 if vngpf.VpnClientConfiguration != nil { 10127 objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration 10128 } 10129 if vngpf.BgpSettings != nil { 10130 objectMap["bgpSettings"] = vngpf.BgpSettings 10131 } 10132 if vngpf.ResourceGUID != nil { 10133 objectMap["resourceGuid"] = vngpf.ResourceGUID 10134 } 10135 return json.Marshal(objectMap) 10136} 10137 10138// VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 10139// long-running operation. 10140type VirtualNetworkGatewaysCreateOrUpdateFuture struct { 10141 azure.FutureAPI 10142 // Result returns the result of the asynchronous operation. 10143 // If the operation has not completed it will return an error. 10144 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) 10145} 10146 10147// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10148func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10149 var azFuture azure.Future 10150 if err := json.Unmarshal(body, &azFuture); err != nil { 10151 return err 10152 } 10153 future.FutureAPI = &azFuture 10154 future.Result = future.result 10155 return nil 10156} 10157 10158// result is the default implementation for VirtualNetworkGatewaysCreateOrUpdateFuture.Result. 10159func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 10160 var done bool 10161 done, err = future.DoneWithContext(context.Background(), client) 10162 if err != nil { 10163 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10164 return 10165 } 10166 if !done { 10167 vng.Response.Response = future.Response() 10168 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") 10169 return 10170 } 10171 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10172 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { 10173 vng, err = client.CreateOrUpdateResponder(vng.Response.Response) 10174 if err != nil { 10175 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", vng.Response.Response, "Failure responding to request") 10176 } 10177 } 10178 return 10179} 10180 10181// VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a 10182// long-running operation. 10183type VirtualNetworkGatewaysDeleteFuture struct { 10184 azure.FutureAPI 10185 // Result returns the result of the asynchronous operation. 10186 // If the operation has not completed it will return an error. 10187 Result func(VirtualNetworkGatewaysClient) (autorest.Response, error) 10188} 10189 10190// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10191func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { 10192 var azFuture azure.Future 10193 if err := json.Unmarshal(body, &azFuture); err != nil { 10194 return err 10195 } 10196 future.FutureAPI = &azFuture 10197 future.Result = future.result 10198 return nil 10199} 10200 10201// result is the default implementation for VirtualNetworkGatewaysDeleteFuture.Result. 10202func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { 10203 var done bool 10204 done, err = future.DoneWithContext(context.Background(), client) 10205 if err != nil { 10206 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 10207 return 10208 } 10209 if !done { 10210 ar.Response = future.Response() 10211 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") 10212 return 10213 } 10214 ar.Response = future.Response() 10215 return 10216} 10217 10218// VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the 10219// results of a long-running operation. 10220type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct { 10221 azure.FutureAPI 10222 // Result returns the result of the asynchronous operation. 10223 // If the operation has not completed it will return an error. 10224 Result func(VirtualNetworkGatewaysClient) (String, error) 10225} 10226 10227// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10228func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) UnmarshalJSON(body []byte) error { 10229 var azFuture azure.Future 10230 if err := json.Unmarshal(body, &azFuture); err != nil { 10231 return err 10232 } 10233 future.FutureAPI = &azFuture 10234 future.Result = future.result 10235 return nil 10236} 10237 10238// result is the default implementation for VirtualNetworkGatewaysGeneratevpnclientpackageFuture.Result. 10239func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) { 10240 var done bool 10241 done, err = future.DoneWithContext(context.Background(), client) 10242 if err != nil { 10243 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure") 10244 return 10245 } 10246 if !done { 10247 s.Response.Response = future.Response() 10248 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture") 10249 return 10250 } 10251 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10252 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 10253 s, err = client.GeneratevpnclientpackageResponder(s.Response.Response) 10254 if err != nil { 10255 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", s.Response.Response, "Failure responding to request") 10256 } 10257 } 10258 return 10259} 10260 10261// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results 10262// of a long-running operation. 10263type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct { 10264 azure.FutureAPI 10265 // Result returns the result of the asynchronous operation. 10266 // If the operation has not completed it will return an error. 10267 Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) 10268} 10269 10270// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10271func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error { 10272 var azFuture azure.Future 10273 if err := json.Unmarshal(body, &azFuture); err != nil { 10274 return err 10275 } 10276 future.FutureAPI = &azFuture 10277 future.Result = future.result 10278 return nil 10279} 10280 10281// result is the default implementation for VirtualNetworkGatewaysGetAdvertisedRoutesFuture.Result. 10282func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { 10283 var done bool 10284 done, err = future.DoneWithContext(context.Background(), client) 10285 if err != nil { 10286 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure") 10287 return 10288 } 10289 if !done { 10290 grlr.Response.Response = future.Response() 10291 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture") 10292 return 10293 } 10294 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10295 if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { 10296 grlr, err = client.GetAdvertisedRoutesResponder(grlr.Response.Response) 10297 if err != nil { 10298 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") 10299 } 10300 } 10301 return 10302} 10303 10304// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of 10305// a long-running operation. 10306type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct { 10307 azure.FutureAPI 10308 // Result returns the result of the asynchronous operation. 10309 // If the operation has not completed it will return an error. 10310 Result func(VirtualNetworkGatewaysClient) (BgpPeerStatusListResult, error) 10311} 10312 10313// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10314func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) UnmarshalJSON(body []byte) error { 10315 var azFuture azure.Future 10316 if err := json.Unmarshal(body, &azFuture); err != nil { 10317 return err 10318 } 10319 future.FutureAPI = &azFuture 10320 future.Result = future.result 10321 return nil 10322} 10323 10324// result is the default implementation for VirtualNetworkGatewaysGetBgpPeerStatusFuture.Result. 10325func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) { 10326 var done bool 10327 done, err = future.DoneWithContext(context.Background(), client) 10328 if err != nil { 10329 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure") 10330 return 10331 } 10332 if !done { 10333 bpslr.Response.Response = future.Response() 10334 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture") 10335 return 10336 } 10337 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10338 if bpslr.Response.Response, err = future.GetResult(sender); err == nil && bpslr.Response.Response.StatusCode != http.StatusNoContent { 10339 bpslr, err = client.GetBgpPeerStatusResponder(bpslr.Response.Response) 10340 if err != nil { 10341 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", bpslr.Response.Response, "Failure responding to request") 10342 } 10343 } 10344 return 10345} 10346 10347// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of 10348// a long-running operation. 10349type VirtualNetworkGatewaysGetLearnedRoutesFuture struct { 10350 azure.FutureAPI 10351 // Result returns the result of the asynchronous operation. 10352 // If the operation has not completed it will return an error. 10353 Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error) 10354} 10355 10356// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10357func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) UnmarshalJSON(body []byte) error { 10358 var azFuture azure.Future 10359 if err := json.Unmarshal(body, &azFuture); err != nil { 10360 return err 10361 } 10362 future.FutureAPI = &azFuture 10363 future.Result = future.result 10364 return nil 10365} 10366 10367// result is the default implementation for VirtualNetworkGatewaysGetLearnedRoutesFuture.Result. 10368func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { 10369 var done bool 10370 done, err = future.DoneWithContext(context.Background(), client) 10371 if err != nil { 10372 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure") 10373 return 10374 } 10375 if !done { 10376 grlr.Response.Response = future.Response() 10377 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture") 10378 return 10379 } 10380 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10381 if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent { 10382 grlr, err = client.GetLearnedRoutesResponder(grlr.Response.Response) 10383 if err != nil { 10384 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request") 10385 } 10386 } 10387 return 10388} 10389 10390// VirtualNetworkGatewaySku virtualNetworkGatewaySku details 10391type VirtualNetworkGatewaySku struct { 10392 // Name - Gateway SKU name. Possible values are: 'Basic', 'HighPerformance','Standard', and 'UltraPerformance'. Possible values include: 'VirtualNetworkGatewaySkuNameBasic', 'VirtualNetworkGatewaySkuNameHighPerformance', 'VirtualNetworkGatewaySkuNameStandard', 'VirtualNetworkGatewaySkuNameUltraPerformance' 10393 Name VirtualNetworkGatewaySkuName `json:"name,omitempty"` 10394 // Tier - Gateway SKU tier. Possible values are: 'Basic', 'HighPerformance','Standard', and 'UltraPerformance'. Possible values include: 'VirtualNetworkGatewaySkuTierBasic', 'VirtualNetworkGatewaySkuTierHighPerformance', 'VirtualNetworkGatewaySkuTierStandard', 'VirtualNetworkGatewaySkuTierUltraPerformance' 10395 Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` 10396 // Capacity - The capacity. 10397 Capacity *int32 `json:"capacity,omitempty"` 10398} 10399 10400// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a 10401// long-running operation. 10402type VirtualNetworkGatewaysResetFuture struct { 10403 azure.FutureAPI 10404 // Result returns the result of the asynchronous operation. 10405 // If the operation has not completed it will return an error. 10406 Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error) 10407} 10408 10409// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10410func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error { 10411 var azFuture azure.Future 10412 if err := json.Unmarshal(body, &azFuture); err != nil { 10413 return err 10414 } 10415 future.FutureAPI = &azFuture 10416 future.Result = future.result 10417 return nil 10418} 10419 10420// result is the default implementation for VirtualNetworkGatewaysResetFuture.Result. 10421func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 10422 var done bool 10423 done, err = future.DoneWithContext(context.Background(), client) 10424 if err != nil { 10425 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure") 10426 return 10427 } 10428 if !done { 10429 vng.Response.Response = future.Response() 10430 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") 10431 return 10432 } 10433 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10434 if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent { 10435 vng, err = client.ResetResponder(vng.Response.Response) 10436 if err != nil { 10437 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", vng.Response.Response, "Failure responding to request") 10438 } 10439 } 10440 return 10441} 10442 10443// VirtualNetworkListResult response for the ListVirtualNetworks API service call. 10444type VirtualNetworkListResult struct { 10445 autorest.Response `json:"-"` 10446 // Value - Gets a list of VirtualNetwork resources in a resource group. 10447 Value *[]VirtualNetwork `json:"value,omitempty"` 10448 // NextLink - The URL to get the next set of results. 10449 NextLink *string `json:"nextLink,omitempty"` 10450} 10451 10452// VirtualNetworkListResultIterator provides access to a complete listing of VirtualNetwork values. 10453type VirtualNetworkListResultIterator struct { 10454 i int 10455 page VirtualNetworkListResultPage 10456} 10457 10458// NextWithContext advances to the next value. If there was an error making 10459// the request the iterator does not advance and the error is returned. 10460func (iter *VirtualNetworkListResultIterator) NextWithContext(ctx context.Context) (err error) { 10461 if tracing.IsEnabled() { 10462 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultIterator.NextWithContext") 10463 defer func() { 10464 sc := -1 10465 if iter.Response().Response.Response != nil { 10466 sc = iter.Response().Response.Response.StatusCode 10467 } 10468 tracing.EndSpan(ctx, sc, err) 10469 }() 10470 } 10471 iter.i++ 10472 if iter.i < len(iter.page.Values()) { 10473 return nil 10474 } 10475 err = iter.page.NextWithContext(ctx) 10476 if err != nil { 10477 iter.i-- 10478 return err 10479 } 10480 iter.i = 0 10481 return nil 10482} 10483 10484// Next advances to the next value. If there was an error making 10485// the request the iterator does not advance and the error is returned. 10486// Deprecated: Use NextWithContext() instead. 10487func (iter *VirtualNetworkListResultIterator) Next() error { 10488 return iter.NextWithContext(context.Background()) 10489} 10490 10491// NotDone returns true if the enumeration should be started or is not yet complete. 10492func (iter VirtualNetworkListResultIterator) NotDone() bool { 10493 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10494} 10495 10496// Response returns the raw server response from the last page request. 10497func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult { 10498 return iter.page.Response() 10499} 10500 10501// Value returns the current value or a zero-initialized value if the 10502// iterator has advanced beyond the end of the collection. 10503func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork { 10504 if !iter.page.NotDone() { 10505 return VirtualNetwork{} 10506 } 10507 return iter.page.Values()[iter.i] 10508} 10509 10510// Creates a new instance of the VirtualNetworkListResultIterator type. 10511func NewVirtualNetworkListResultIterator(page VirtualNetworkListResultPage) VirtualNetworkListResultIterator { 10512 return VirtualNetworkListResultIterator{page: page} 10513} 10514 10515// IsEmpty returns true if the ListResult contains no values. 10516func (vnlr VirtualNetworkListResult) IsEmpty() bool { 10517 return vnlr.Value == nil || len(*vnlr.Value) == 0 10518} 10519 10520// hasNextLink returns true if the NextLink is not empty. 10521func (vnlr VirtualNetworkListResult) hasNextLink() bool { 10522 return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0 10523} 10524 10525// virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. 10526// It returns nil if no more results exist. 10527func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) { 10528 if !vnlr.hasNextLink() { 10529 return nil, nil 10530 } 10531 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10532 autorest.AsJSON(), 10533 autorest.AsGet(), 10534 autorest.WithBaseURL(to.String(vnlr.NextLink))) 10535} 10536 10537// VirtualNetworkListResultPage contains a page of VirtualNetwork values. 10538type VirtualNetworkListResultPage struct { 10539 fn func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error) 10540 vnlr VirtualNetworkListResult 10541} 10542 10543// NextWithContext advances to the next page of values. If there was an error making 10544// the request the page does not advance and the error is returned. 10545func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) (err error) { 10546 if tracing.IsEnabled() { 10547 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultPage.NextWithContext") 10548 defer func() { 10549 sc := -1 10550 if page.Response().Response.Response != nil { 10551 sc = page.Response().Response.Response.StatusCode 10552 } 10553 tracing.EndSpan(ctx, sc, err) 10554 }() 10555 } 10556 for { 10557 next, err := page.fn(ctx, page.vnlr) 10558 if err != nil { 10559 return err 10560 } 10561 page.vnlr = next 10562 if !next.hasNextLink() || !next.IsEmpty() { 10563 break 10564 } 10565 } 10566 return nil 10567} 10568 10569// Next advances to the next page of values. If there was an error making 10570// the request the page does not advance and the error is returned. 10571// Deprecated: Use NextWithContext() instead. 10572func (page *VirtualNetworkListResultPage) Next() error { 10573 return page.NextWithContext(context.Background()) 10574} 10575 10576// NotDone returns true if the page enumeration should be started or is not yet complete. 10577func (page VirtualNetworkListResultPage) NotDone() bool { 10578 return !page.vnlr.IsEmpty() 10579} 10580 10581// Response returns the raw server response from the last page request. 10582func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult { 10583 return page.vnlr 10584} 10585 10586// Values returns the slice of values for the current page or nil if there are no values. 10587func (page VirtualNetworkListResultPage) Values() []VirtualNetwork { 10588 if page.vnlr.IsEmpty() { 10589 return nil 10590 } 10591 return *page.vnlr.Value 10592} 10593 10594// Creates a new instance of the VirtualNetworkListResultPage type. 10595func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage { 10596 return VirtualNetworkListResultPage{ 10597 fn: getNextPage, 10598 vnlr: cur, 10599 } 10600} 10601 10602// VirtualNetworkPeering peerings in a virtual network resource. 10603type VirtualNetworkPeering struct { 10604 autorest.Response `json:"-"` 10605 *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` 10606 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 10607 Name *string `json:"name,omitempty"` 10608 // Etag - A unique read-only string that changes whenever the resource is updated. 10609 Etag *string `json:"etag,omitempty"` 10610 // ID - Resource ID. 10611 ID *string `json:"id,omitempty"` 10612} 10613 10614// MarshalJSON is the custom marshaler for VirtualNetworkPeering. 10615func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) { 10616 objectMap := make(map[string]interface{}) 10617 if vnp.VirtualNetworkPeeringPropertiesFormat != nil { 10618 objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat 10619 } 10620 if vnp.Name != nil { 10621 objectMap["name"] = vnp.Name 10622 } 10623 if vnp.Etag != nil { 10624 objectMap["etag"] = vnp.Etag 10625 } 10626 if vnp.ID != nil { 10627 objectMap["id"] = vnp.ID 10628 } 10629 return json.Marshal(objectMap) 10630} 10631 10632// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. 10633func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error { 10634 var m map[string]*json.RawMessage 10635 err := json.Unmarshal(body, &m) 10636 if err != nil { 10637 return err 10638 } 10639 for k, v := range m { 10640 switch k { 10641 case "properties": 10642 if v != nil { 10643 var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat 10644 err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat) 10645 if err != nil { 10646 return err 10647 } 10648 vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat 10649 } 10650 case "name": 10651 if v != nil { 10652 var name string 10653 err = json.Unmarshal(*v, &name) 10654 if err != nil { 10655 return err 10656 } 10657 vnp.Name = &name 10658 } 10659 case "etag": 10660 if v != nil { 10661 var etag string 10662 err = json.Unmarshal(*v, &etag) 10663 if err != nil { 10664 return err 10665 } 10666 vnp.Etag = &etag 10667 } 10668 case "id": 10669 if v != nil { 10670 var ID string 10671 err = json.Unmarshal(*v, &ID) 10672 if err != nil { 10673 return err 10674 } 10675 vnp.ID = &ID 10676 } 10677 } 10678 } 10679 10680 return nil 10681} 10682 10683// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that 10684// belong to a virtual network. 10685type VirtualNetworkPeeringListResult struct { 10686 autorest.Response `json:"-"` 10687 // Value - The peerings in a virtual network. 10688 Value *[]VirtualNetworkPeering `json:"value,omitempty"` 10689 // NextLink - The URL to get the next set of results. 10690 NextLink *string `json:"nextLink,omitempty"` 10691} 10692 10693// VirtualNetworkPeeringListResultIterator provides access to a complete listing of VirtualNetworkPeering 10694// values. 10695type VirtualNetworkPeeringListResultIterator struct { 10696 i int 10697 page VirtualNetworkPeeringListResultPage 10698} 10699 10700// NextWithContext advances to the next value. If there was an error making 10701// the request the iterator does not advance and the error is returned. 10702func (iter *VirtualNetworkPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) { 10703 if tracing.IsEnabled() { 10704 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultIterator.NextWithContext") 10705 defer func() { 10706 sc := -1 10707 if iter.Response().Response.Response != nil { 10708 sc = iter.Response().Response.Response.StatusCode 10709 } 10710 tracing.EndSpan(ctx, sc, err) 10711 }() 10712 } 10713 iter.i++ 10714 if iter.i < len(iter.page.Values()) { 10715 return nil 10716 } 10717 err = iter.page.NextWithContext(ctx) 10718 if err != nil { 10719 iter.i-- 10720 return err 10721 } 10722 iter.i = 0 10723 return nil 10724} 10725 10726// Next advances to the next value. If there was an error making 10727// the request the iterator does not advance and the error is returned. 10728// Deprecated: Use NextWithContext() instead. 10729func (iter *VirtualNetworkPeeringListResultIterator) Next() error { 10730 return iter.NextWithContext(context.Background()) 10731} 10732 10733// NotDone returns true if the enumeration should be started or is not yet complete. 10734func (iter VirtualNetworkPeeringListResultIterator) NotDone() bool { 10735 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10736} 10737 10738// Response returns the raw server response from the last page request. 10739func (iter VirtualNetworkPeeringListResultIterator) Response() VirtualNetworkPeeringListResult { 10740 return iter.page.Response() 10741} 10742 10743// Value returns the current value or a zero-initialized value if the 10744// iterator has advanced beyond the end of the collection. 10745func (iter VirtualNetworkPeeringListResultIterator) Value() VirtualNetworkPeering { 10746 if !iter.page.NotDone() { 10747 return VirtualNetworkPeering{} 10748 } 10749 return iter.page.Values()[iter.i] 10750} 10751 10752// Creates a new instance of the VirtualNetworkPeeringListResultIterator type. 10753func NewVirtualNetworkPeeringListResultIterator(page VirtualNetworkPeeringListResultPage) VirtualNetworkPeeringListResultIterator { 10754 return VirtualNetworkPeeringListResultIterator{page: page} 10755} 10756 10757// IsEmpty returns true if the ListResult contains no values. 10758func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool { 10759 return vnplr.Value == nil || len(*vnplr.Value) == 0 10760} 10761 10762// hasNextLink returns true if the NextLink is not empty. 10763func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool { 10764 return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0 10765} 10766 10767// virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. 10768// It returns nil if no more results exist. 10769func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) { 10770 if !vnplr.hasNextLink() { 10771 return nil, nil 10772 } 10773 return autorest.Prepare((&http.Request{}).WithContext(ctx), 10774 autorest.AsJSON(), 10775 autorest.AsGet(), 10776 autorest.WithBaseURL(to.String(vnplr.NextLink))) 10777} 10778 10779// VirtualNetworkPeeringListResultPage contains a page of VirtualNetworkPeering values. 10780type VirtualNetworkPeeringListResultPage struct { 10781 fn func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error) 10782 vnplr VirtualNetworkPeeringListResult 10783} 10784 10785// NextWithContext advances to the next page of values. If there was an error making 10786// the request the page does not advance and the error is returned. 10787func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Context) (err error) { 10788 if tracing.IsEnabled() { 10789 ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultPage.NextWithContext") 10790 defer func() { 10791 sc := -1 10792 if page.Response().Response.Response != nil { 10793 sc = page.Response().Response.Response.StatusCode 10794 } 10795 tracing.EndSpan(ctx, sc, err) 10796 }() 10797 } 10798 for { 10799 next, err := page.fn(ctx, page.vnplr) 10800 if err != nil { 10801 return err 10802 } 10803 page.vnplr = next 10804 if !next.hasNextLink() || !next.IsEmpty() { 10805 break 10806 } 10807 } 10808 return nil 10809} 10810 10811// Next advances to the next page of values. If there was an error making 10812// the request the page does not advance and the error is returned. 10813// Deprecated: Use NextWithContext() instead. 10814func (page *VirtualNetworkPeeringListResultPage) Next() error { 10815 return page.NextWithContext(context.Background()) 10816} 10817 10818// NotDone returns true if the page enumeration should be started or is not yet complete. 10819func (page VirtualNetworkPeeringListResultPage) NotDone() bool { 10820 return !page.vnplr.IsEmpty() 10821} 10822 10823// Response returns the raw server response from the last page request. 10824func (page VirtualNetworkPeeringListResultPage) Response() VirtualNetworkPeeringListResult { 10825 return page.vnplr 10826} 10827 10828// Values returns the slice of values for the current page or nil if there are no values. 10829func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering { 10830 if page.vnplr.IsEmpty() { 10831 return nil 10832 } 10833 return *page.vnplr.Value 10834} 10835 10836// Creates a new instance of the VirtualNetworkPeeringListResultPage type. 10837func NewVirtualNetworkPeeringListResultPage(cur VirtualNetworkPeeringListResult, getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage { 10838 return VirtualNetworkPeeringListResultPage{ 10839 fn: getNextPage, 10840 vnplr: cur, 10841 } 10842} 10843 10844// VirtualNetworkPeeringPropertiesFormat ... 10845type VirtualNetworkPeeringPropertiesFormat struct { 10846 // AllowVirtualNetworkAccess - Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. 10847 AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` 10848 // AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. 10849 AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` 10850 // AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network. 10851 AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` 10852 // UseRemoteGateways - If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. 10853 UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` 10854 // RemoteVirtualNetwork - The reference of the remote virtual network. 10855 RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` 10856 // PeeringState - The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' 10857 PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` 10858 // ProvisioningState - The provisioning state of the resource. 10859 ProvisioningState *string `json:"provisioningState,omitempty"` 10860} 10861 10862// VirtualNetworkPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 10863// long-running operation. 10864type VirtualNetworkPeeringsCreateOrUpdateFuture struct { 10865 azure.FutureAPI 10866 // Result returns the result of the asynchronous operation. 10867 // If the operation has not completed it will return an error. 10868 Result func(VirtualNetworkPeeringsClient) (VirtualNetworkPeering, error) 10869} 10870 10871// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10872func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10873 var azFuture azure.Future 10874 if err := json.Unmarshal(body, &azFuture); err != nil { 10875 return err 10876 } 10877 future.FutureAPI = &azFuture 10878 future.Result = future.result 10879 return nil 10880} 10881 10882// result is the default implementation for VirtualNetworkPeeringsCreateOrUpdateFuture.Result. 10883func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) { 10884 var done bool 10885 done, err = future.DoneWithContext(context.Background(), client) 10886 if err != nil { 10887 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10888 return 10889 } 10890 if !done { 10891 vnp.Response.Response = future.Response() 10892 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture") 10893 return 10894 } 10895 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10896 if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent { 10897 vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response) 10898 if err != nil { 10899 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request") 10900 } 10901 } 10902 return 10903} 10904 10905// VirtualNetworkPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a 10906// long-running operation. 10907type VirtualNetworkPeeringsDeleteFuture struct { 10908 azure.FutureAPI 10909 // Result returns the result of the asynchronous operation. 10910 // If the operation has not completed it will return an error. 10911 Result func(VirtualNetworkPeeringsClient) (autorest.Response, error) 10912} 10913 10914// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10915func (future *VirtualNetworkPeeringsDeleteFuture) UnmarshalJSON(body []byte) error { 10916 var azFuture azure.Future 10917 if err := json.Unmarshal(body, &azFuture); err != nil { 10918 return err 10919 } 10920 future.FutureAPI = &azFuture 10921 future.Result = future.result 10922 return nil 10923} 10924 10925// result is the default implementation for VirtualNetworkPeeringsDeleteFuture.Result. 10926func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) { 10927 var done bool 10928 done, err = future.DoneWithContext(context.Background(), client) 10929 if err != nil { 10930 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 10931 return 10932 } 10933 if !done { 10934 ar.Response = future.Response() 10935 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture") 10936 return 10937 } 10938 ar.Response = future.Response() 10939 return 10940} 10941 10942// VirtualNetworkPropertiesFormat ... 10943type VirtualNetworkPropertiesFormat struct { 10944 // AddressSpace - The AddressSpace that contains an array of IP address ranges that can be used by subnets. 10945 AddressSpace *AddressSpace `json:"addressSpace,omitempty"` 10946 // DhcpOptions - The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. 10947 DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` 10948 // Subnets - A list of subnets in a Virtual Network. 10949 Subnets *[]Subnet `json:"subnets,omitempty"` 10950 // VirtualNetworkPeerings - A list of peerings in a Virtual Network. 10951 VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` 10952 // ResourceGUID - The resourceGuid property of the Virtual Network resource. 10953 ResourceGUID *string `json:"resourceGuid,omitempty"` 10954 // ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 10955 ProvisioningState *string `json:"provisioningState,omitempty"` 10956} 10957 10958// VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 10959// long-running operation. 10960type VirtualNetworksCreateOrUpdateFuture struct { 10961 azure.FutureAPI 10962 // Result returns the result of the asynchronous operation. 10963 // If the operation has not completed it will return an error. 10964 Result func(VirtualNetworksClient) (VirtualNetwork, error) 10965} 10966 10967// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10968func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 10969 var azFuture azure.Future 10970 if err := json.Unmarshal(body, &azFuture); err != nil { 10971 return err 10972 } 10973 future.FutureAPI = &azFuture 10974 future.Result = future.result 10975 return nil 10976} 10977 10978// result is the default implementation for VirtualNetworksCreateOrUpdateFuture.Result. 10979func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { 10980 var done bool 10981 done, err = future.DoneWithContext(context.Background(), client) 10982 if err != nil { 10983 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10984 return 10985 } 10986 if !done { 10987 vn.Response.Response = future.Response() 10988 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") 10989 return 10990 } 10991 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10992 if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent { 10993 vn, err = client.CreateOrUpdateResponder(vn.Response.Response) 10994 if err != nil { 10995 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request") 10996 } 10997 } 10998 return 10999} 11000 11001// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11002// operation. 11003type VirtualNetworksDeleteFuture struct { 11004 azure.FutureAPI 11005 // Result returns the result of the asynchronous operation. 11006 // If the operation has not completed it will return an error. 11007 Result func(VirtualNetworksClient) (autorest.Response, error) 11008} 11009 11010// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11011func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error { 11012 var azFuture azure.Future 11013 if err := json.Unmarshal(body, &azFuture); err != nil { 11014 return err 11015 } 11016 future.FutureAPI = &azFuture 11017 future.Result = future.result 11018 return nil 11019} 11020 11021// result is the default implementation for VirtualNetworksDeleteFuture.Result. 11022func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) { 11023 var done bool 11024 done, err = future.DoneWithContext(context.Background(), client) 11025 if err != nil { 11026 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure") 11027 return 11028 } 11029 if !done { 11030 ar.Response = future.Response() 11031 err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") 11032 return 11033 } 11034 ar.Response = future.Response() 11035 return 11036} 11037 11038// VpnClientConfiguration vpnClientConfiguration for P2S client. 11039type VpnClientConfiguration struct { 11040 // VpnClientAddressPool - The reference of the address space resource which represents Address space for P2S VpnClient. 11041 VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` 11042 // VpnClientRootCertificates - VpnClientRootCertificate for virtual network gateway. 11043 VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` 11044 // VpnClientRevokedCertificates - VpnClientRevokedCertificate for Virtual network gateway. 11045 VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` 11046} 11047 11048// VpnClientParameters vpnClientParameters 11049type VpnClientParameters struct { 11050 // ProcessorArchitecture - VPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' 11051 ProcessorArchitecture ProcessorArchitecture `json:"ProcessorArchitecture,omitempty"` 11052} 11053 11054// VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway. 11055type VpnClientRevokedCertificate struct { 11056 *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` 11057 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 11058 Name *string `json:"name,omitempty"` 11059 // Etag - A unique read-only string that changes whenever the resource is updated. 11060 Etag *string `json:"etag,omitempty"` 11061 // ID - Resource ID. 11062 ID *string `json:"id,omitempty"` 11063} 11064 11065// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate. 11066func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) { 11067 objectMap := make(map[string]interface{}) 11068 if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil { 11069 objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat 11070 } 11071 if vcrc.Name != nil { 11072 objectMap["name"] = vcrc.Name 11073 } 11074 if vcrc.Etag != nil { 11075 objectMap["etag"] = vcrc.Etag 11076 } 11077 if vcrc.ID != nil { 11078 objectMap["id"] = vcrc.ID 11079 } 11080 return json.Marshal(objectMap) 11081} 11082 11083// UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. 11084func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { 11085 var m map[string]*json.RawMessage 11086 err := json.Unmarshal(body, &m) 11087 if err != nil { 11088 return err 11089 } 11090 for k, v := range m { 11091 switch k { 11092 case "properties": 11093 if v != nil { 11094 var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat 11095 err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat) 11096 if err != nil { 11097 return err 11098 } 11099 vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat 11100 } 11101 case "name": 11102 if v != nil { 11103 var name string 11104 err = json.Unmarshal(*v, &name) 11105 if err != nil { 11106 return err 11107 } 11108 vcrc.Name = &name 11109 } 11110 case "etag": 11111 if v != nil { 11112 var etag string 11113 err = json.Unmarshal(*v, &etag) 11114 if err != nil { 11115 return err 11116 } 11117 vcrc.Etag = &etag 11118 } 11119 case "id": 11120 if v != nil { 11121 var ID string 11122 err = json.Unmarshal(*v, &ID) 11123 if err != nil { 11124 return err 11125 } 11126 vcrc.ID = &ID 11127 } 11128 } 11129 } 11130 11131 return nil 11132} 11133 11134// VpnClientRevokedCertificatePropertiesFormat properties of the revoked VPN client certificate of virtual 11135// network gateway. 11136type VpnClientRevokedCertificatePropertiesFormat struct { 11137 // Thumbprint - The revoked VPN client certificate thumbprint. 11138 Thumbprint *string `json:"thumbprint,omitempty"` 11139 // ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 11140 ProvisioningState *string `json:"provisioningState,omitempty"` 11141} 11142 11143// MarshalJSON is the custom marshaler for VpnClientRevokedCertificatePropertiesFormat. 11144func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { 11145 objectMap := make(map[string]interface{}) 11146 if vcrcpf.Thumbprint != nil { 11147 objectMap["thumbprint"] = vcrcpf.Thumbprint 11148 } 11149 return json.Marshal(objectMap) 11150} 11151 11152// VpnClientRootCertificate VPN client root certificate of virtual network gateway 11153type VpnClientRootCertificate struct { 11154 *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` 11155 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 11156 Name *string `json:"name,omitempty"` 11157 // Etag - A unique read-only string that changes whenever the resource is updated. 11158 Etag *string `json:"etag,omitempty"` 11159 // ID - Resource ID. 11160 ID *string `json:"id,omitempty"` 11161} 11162 11163// MarshalJSON is the custom marshaler for VpnClientRootCertificate. 11164func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) { 11165 objectMap := make(map[string]interface{}) 11166 if vcrc.VpnClientRootCertificatePropertiesFormat != nil { 11167 objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat 11168 } 11169 if vcrc.Name != nil { 11170 objectMap["name"] = vcrc.Name 11171 } 11172 if vcrc.Etag != nil { 11173 objectMap["etag"] = vcrc.Etag 11174 } 11175 if vcrc.ID != nil { 11176 objectMap["id"] = vcrc.ID 11177 } 11178 return json.Marshal(objectMap) 11179} 11180 11181// UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. 11182func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { 11183 var m map[string]*json.RawMessage 11184 err := json.Unmarshal(body, &m) 11185 if err != nil { 11186 return err 11187 } 11188 for k, v := range m { 11189 switch k { 11190 case "properties": 11191 if v != nil { 11192 var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat 11193 err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat) 11194 if err != nil { 11195 return err 11196 } 11197 vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat 11198 } 11199 case "name": 11200 if v != nil { 11201 var name string 11202 err = json.Unmarshal(*v, &name) 11203 if err != nil { 11204 return err 11205 } 11206 vcrc.Name = &name 11207 } 11208 case "etag": 11209 if v != nil { 11210 var etag string 11211 err = json.Unmarshal(*v, &etag) 11212 if err != nil { 11213 return err 11214 } 11215 vcrc.Etag = &etag 11216 } 11217 case "id": 11218 if v != nil { 11219 var ID string 11220 err = json.Unmarshal(*v, &ID) 11221 if err != nil { 11222 return err 11223 } 11224 vcrc.ID = &ID 11225 } 11226 } 11227 } 11228 11229 return nil 11230} 11231 11232// VpnClientRootCertificatePropertiesFormat properties of SSL certificates of application gateway 11233type VpnClientRootCertificatePropertiesFormat struct { 11234 // PublicCertData - The certificate public data. 11235 PublicCertData *string `json:"publicCertData,omitempty"` 11236 // ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 11237 ProvisioningState *string `json:"provisioningState,omitempty"` 11238} 11239 11240// MarshalJSON is the custom marshaler for VpnClientRootCertificatePropertiesFormat. 11241func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { 11242 objectMap := make(map[string]interface{}) 11243 if vcrcpf.PublicCertData != nil { 11244 objectMap["publicCertData"] = vcrcpf.PublicCertData 11245 } 11246 return json.Marshal(objectMap) 11247} 11248 11249// Watcher network watcher in a resource group. 11250type Watcher struct { 11251 autorest.Response `json:"-"` 11252 // Etag - A unique read-only string that changes whenever the resource is updated. 11253 Etag *string `json:"etag,omitempty"` 11254 *WatcherPropertiesFormat `json:"properties,omitempty"` 11255 // ID - Resource ID. 11256 ID *string `json:"id,omitempty"` 11257 // Name - READ-ONLY; Resource name. 11258 Name *string `json:"name,omitempty"` 11259 // Type - READ-ONLY; Resource type. 11260 Type *string `json:"type,omitempty"` 11261 // Location - Resource location. 11262 Location *string `json:"location,omitempty"` 11263 // Tags - Resource tags. 11264 Tags map[string]*string `json:"tags"` 11265} 11266 11267// MarshalJSON is the custom marshaler for Watcher. 11268func (w Watcher) MarshalJSON() ([]byte, error) { 11269 objectMap := make(map[string]interface{}) 11270 if w.Etag != nil { 11271 objectMap["etag"] = w.Etag 11272 } 11273 if w.WatcherPropertiesFormat != nil { 11274 objectMap["properties"] = w.WatcherPropertiesFormat 11275 } 11276 if w.ID != nil { 11277 objectMap["id"] = w.ID 11278 } 11279 if w.Location != nil { 11280 objectMap["location"] = w.Location 11281 } 11282 if w.Tags != nil { 11283 objectMap["tags"] = w.Tags 11284 } 11285 return json.Marshal(objectMap) 11286} 11287 11288// UnmarshalJSON is the custom unmarshaler for Watcher struct. 11289func (w *Watcher) UnmarshalJSON(body []byte) error { 11290 var m map[string]*json.RawMessage 11291 err := json.Unmarshal(body, &m) 11292 if err != nil { 11293 return err 11294 } 11295 for k, v := range m { 11296 switch k { 11297 case "etag": 11298 if v != nil { 11299 var etag string 11300 err = json.Unmarshal(*v, &etag) 11301 if err != nil { 11302 return err 11303 } 11304 w.Etag = &etag 11305 } 11306 case "properties": 11307 if v != nil { 11308 var watcherPropertiesFormat WatcherPropertiesFormat 11309 err = json.Unmarshal(*v, &watcherPropertiesFormat) 11310 if err != nil { 11311 return err 11312 } 11313 w.WatcherPropertiesFormat = &watcherPropertiesFormat 11314 } 11315 case "id": 11316 if v != nil { 11317 var ID string 11318 err = json.Unmarshal(*v, &ID) 11319 if err != nil { 11320 return err 11321 } 11322 w.ID = &ID 11323 } 11324 case "name": 11325 if v != nil { 11326 var name string 11327 err = json.Unmarshal(*v, &name) 11328 if err != nil { 11329 return err 11330 } 11331 w.Name = &name 11332 } 11333 case "type": 11334 if v != nil { 11335 var typeVar string 11336 err = json.Unmarshal(*v, &typeVar) 11337 if err != nil { 11338 return err 11339 } 11340 w.Type = &typeVar 11341 } 11342 case "location": 11343 if v != nil { 11344 var location string 11345 err = json.Unmarshal(*v, &location) 11346 if err != nil { 11347 return err 11348 } 11349 w.Location = &location 11350 } 11351 case "tags": 11352 if v != nil { 11353 var tags map[string]*string 11354 err = json.Unmarshal(*v, &tags) 11355 if err != nil { 11356 return err 11357 } 11358 w.Tags = tags 11359 } 11360 } 11361 } 11362 11363 return nil 11364} 11365 11366// WatcherListResult list of network watcher resources. 11367type WatcherListResult struct { 11368 autorest.Response `json:"-"` 11369 Value *[]Watcher `json:"value,omitempty"` 11370} 11371 11372// WatcherPropertiesFormat the network watcher properties. 11373type WatcherPropertiesFormat struct { 11374 // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' 11375 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 11376} 11377 11378// MarshalJSON is the custom marshaler for WatcherPropertiesFormat. 11379func (wpf WatcherPropertiesFormat) MarshalJSON() ([]byte, error) { 11380 objectMap := make(map[string]interface{}) 11381 return json.Marshal(objectMap) 11382} 11383 11384// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11385// operation. 11386type WatchersDeleteFuture struct { 11387 azure.FutureAPI 11388 // Result returns the result of the asynchronous operation. 11389 // If the operation has not completed it will return an error. 11390 Result func(WatchersClient) (autorest.Response, error) 11391} 11392 11393// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11394func (future *WatchersDeleteFuture) UnmarshalJSON(body []byte) error { 11395 var azFuture azure.Future 11396 if err := json.Unmarshal(body, &azFuture); err != nil { 11397 return err 11398 } 11399 future.FutureAPI = &azFuture 11400 future.Result = future.result 11401 return nil 11402} 11403 11404// result is the default implementation for WatchersDeleteFuture.Result. 11405func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.Response, err error) { 11406 var done bool 11407 done, err = future.DoneWithContext(context.Background(), client) 11408 if err != nil { 11409 err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure") 11410 return 11411 } 11412 if !done { 11413 ar.Response = future.Response() 11414 err = azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture") 11415 return 11416 } 11417 ar.Response = future.Response() 11418 return 11419} 11420 11421// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a 11422// long-running operation. 11423type WatchersGetFlowLogStatusFuture struct { 11424 azure.FutureAPI 11425 // Result returns the result of the asynchronous operation. 11426 // If the operation has not completed it will return an error. 11427 Result func(WatchersClient) (FlowLogInformation, error) 11428} 11429 11430// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11431func (future *WatchersGetFlowLogStatusFuture) UnmarshalJSON(body []byte) error { 11432 var azFuture azure.Future 11433 if err := json.Unmarshal(body, &azFuture); err != nil { 11434 return err 11435 } 11436 future.FutureAPI = &azFuture 11437 future.Result = future.result 11438 return nil 11439} 11440 11441// result is the default implementation for WatchersGetFlowLogStatusFuture.Result. 11442func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { 11443 var done bool 11444 done, err = future.DoneWithContext(context.Background(), client) 11445 if err != nil { 11446 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure") 11447 return 11448 } 11449 if !done { 11450 fli.Response.Response = future.Response() 11451 err = azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture") 11452 return 11453 } 11454 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11455 if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { 11456 fli, err = client.GetFlowLogStatusResponder(fli.Response.Response) 11457 if err != nil { 11458 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", fli.Response.Response, "Failure responding to request") 11459 } 11460 } 11461 return 11462} 11463 11464// WatchersGetNextHopFuture an abstraction for monitoring and retrieving the results of a long-running 11465// operation. 11466type WatchersGetNextHopFuture struct { 11467 azure.FutureAPI 11468 // Result returns the result of the asynchronous operation. 11469 // If the operation has not completed it will return an error. 11470 Result func(WatchersClient) (NextHopResult, error) 11471} 11472 11473// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11474func (future *WatchersGetNextHopFuture) UnmarshalJSON(body []byte) error { 11475 var azFuture azure.Future 11476 if err := json.Unmarshal(body, &azFuture); err != nil { 11477 return err 11478 } 11479 future.FutureAPI = &azFuture 11480 future.Result = future.result 11481 return nil 11482} 11483 11484// result is the default implementation for WatchersGetNextHopFuture.Result. 11485func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextHopResult, err error) { 11486 var done bool 11487 done, err = future.DoneWithContext(context.Background(), client) 11488 if err != nil { 11489 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure") 11490 return 11491 } 11492 if !done { 11493 nhr.Response.Response = future.Response() 11494 err = azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture") 11495 return 11496 } 11497 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11498 if nhr.Response.Response, err = future.GetResult(sender); err == nil && nhr.Response.Response.StatusCode != http.StatusNoContent { 11499 nhr, err = client.GetNextHopResponder(nhr.Response.Response) 11500 if err != nil { 11501 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", nhr.Response.Response, "Failure responding to request") 11502 } 11503 } 11504 return 11505} 11506 11507// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a 11508// long-running operation. 11509type WatchersGetTroubleshootingFuture struct { 11510 azure.FutureAPI 11511 // Result returns the result of the asynchronous operation. 11512 // If the operation has not completed it will return an error. 11513 Result func(WatchersClient) (TroubleshootingResult, error) 11514} 11515 11516// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11517func (future *WatchersGetTroubleshootingFuture) UnmarshalJSON(body []byte) error { 11518 var azFuture azure.Future 11519 if err := json.Unmarshal(body, &azFuture); err != nil { 11520 return err 11521 } 11522 future.FutureAPI = &azFuture 11523 future.Result = future.result 11524 return nil 11525} 11526 11527// result is the default implementation for WatchersGetTroubleshootingFuture.Result. 11528func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { 11529 var done bool 11530 done, err = future.DoneWithContext(context.Background(), client) 11531 if err != nil { 11532 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure") 11533 return 11534 } 11535 if !done { 11536 tr.Response.Response = future.Response() 11537 err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture") 11538 return 11539 } 11540 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11541 if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { 11542 tr, err = client.GetTroubleshootingResponder(tr.Response.Response) 11543 if err != nil { 11544 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", tr.Response.Response, "Failure responding to request") 11545 } 11546 } 11547 return 11548} 11549 11550// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a 11551// long-running operation. 11552type WatchersGetTroubleshootingResultFuture struct { 11553 azure.FutureAPI 11554 // Result returns the result of the asynchronous operation. 11555 // If the operation has not completed it will return an error. 11556 Result func(WatchersClient) (TroubleshootingResult, error) 11557} 11558 11559// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11560func (future *WatchersGetTroubleshootingResultFuture) UnmarshalJSON(body []byte) error { 11561 var azFuture azure.Future 11562 if err := json.Unmarshal(body, &azFuture); err != nil { 11563 return err 11564 } 11565 future.FutureAPI = &azFuture 11566 future.Result = future.result 11567 return nil 11568} 11569 11570// result is the default implementation for WatchersGetTroubleshootingResultFuture.Result. 11571func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) { 11572 var done bool 11573 done, err = future.DoneWithContext(context.Background(), client) 11574 if err != nil { 11575 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure") 11576 return 11577 } 11578 if !done { 11579 tr.Response.Response = future.Response() 11580 err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture") 11581 return 11582 } 11583 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11584 if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { 11585 tr, err = client.GetTroubleshootingResultResponder(tr.Response.Response) 11586 if err != nil { 11587 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", tr.Response.Response, "Failure responding to request") 11588 } 11589 } 11590 return 11591} 11592 11593// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a 11594// long-running operation. 11595type WatchersGetVMSecurityRulesFuture struct { 11596 azure.FutureAPI 11597 // Result returns the result of the asynchronous operation. 11598 // If the operation has not completed it will return an error. 11599 Result func(WatchersClient) (SecurityGroupViewResult, error) 11600} 11601 11602// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11603func (future *WatchersGetVMSecurityRulesFuture) UnmarshalJSON(body []byte) error { 11604 var azFuture azure.Future 11605 if err := json.Unmarshal(body, &azFuture); err != nil { 11606 return err 11607 } 11608 future.FutureAPI = &azFuture 11609 future.Result = future.result 11610 return nil 11611} 11612 11613// result is the default implementation for WatchersGetVMSecurityRulesFuture.Result. 11614func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) { 11615 var done bool 11616 done, err = future.DoneWithContext(context.Background(), client) 11617 if err != nil { 11618 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure") 11619 return 11620 } 11621 if !done { 11622 sgvr.Response.Response = future.Response() 11623 err = azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture") 11624 return 11625 } 11626 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11627 if sgvr.Response.Response, err = future.GetResult(sender); err == nil && sgvr.Response.Response.StatusCode != http.StatusNoContent { 11628 sgvr, err = client.GetVMSecurityRulesResponder(sgvr.Response.Response) 11629 if err != nil { 11630 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", sgvr.Response.Response, "Failure responding to request") 11631 } 11632 } 11633 return 11634} 11635 11636// WatchersSetFlowLogConfigurationFuture an abstraction for monitoring and retrieving the results of a 11637// long-running operation. 11638type WatchersSetFlowLogConfigurationFuture struct { 11639 azure.FutureAPI 11640 // Result returns the result of the asynchronous operation. 11641 // If the operation has not completed it will return an error. 11642 Result func(WatchersClient) (FlowLogInformation, error) 11643} 11644 11645// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11646func (future *WatchersSetFlowLogConfigurationFuture) UnmarshalJSON(body []byte) error { 11647 var azFuture azure.Future 11648 if err := json.Unmarshal(body, &azFuture); err != nil { 11649 return err 11650 } 11651 future.FutureAPI = &azFuture 11652 future.Result = future.result 11653 return nil 11654} 11655 11656// result is the default implementation for WatchersSetFlowLogConfigurationFuture.Result. 11657func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClient) (fli FlowLogInformation, err error) { 11658 var done bool 11659 done, err = future.DoneWithContext(context.Background(), client) 11660 if err != nil { 11661 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure") 11662 return 11663 } 11664 if !done { 11665 fli.Response.Response = future.Response() 11666 err = azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture") 11667 return 11668 } 11669 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11670 if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent { 11671 fli, err = client.SetFlowLogConfigurationResponder(fli.Response.Response) 11672 if err != nil { 11673 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", fli.Response.Response, "Failure responding to request") 11674 } 11675 } 11676 return 11677} 11678 11679// WatchersVerifyIPFlowFuture an abstraction for monitoring and retrieving the results of a long-running 11680// operation. 11681type WatchersVerifyIPFlowFuture struct { 11682 azure.FutureAPI 11683 // Result returns the result of the asynchronous operation. 11684 // If the operation has not completed it will return an error. 11685 Result func(WatchersClient) (VerificationIPFlowResult, error) 11686} 11687 11688// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11689func (future *WatchersVerifyIPFlowFuture) UnmarshalJSON(body []byte) error { 11690 var azFuture azure.Future 11691 if err := json.Unmarshal(body, &azFuture); err != nil { 11692 return err 11693 } 11694 future.FutureAPI = &azFuture 11695 future.Result = future.result 11696 return nil 11697} 11698 11699// result is the default implementation for WatchersVerifyIPFlowFuture.Result. 11700func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr VerificationIPFlowResult, err error) { 11701 var done bool 11702 done, err = future.DoneWithContext(context.Background(), client) 11703 if err != nil { 11704 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure") 11705 return 11706 } 11707 if !done { 11708 vifr.Response.Response = future.Response() 11709 err = azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture") 11710 return 11711 } 11712 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11713 if vifr.Response.Response, err = future.GetResult(sender); err == nil && vifr.Response.Response.StatusCode != http.StatusNoContent { 11714 vifr, err = client.VerifyIPFlowResponder(vifr.Response.Response) 11715 if err != nil { 11716 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", vifr.Response.Response, "Failure responding to request") 11717 } 11718 } 11719 return 11720} 11721