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