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