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