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