1package network 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "encoding/json" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/date" 25 "github.com/Azure/go-autorest/autorest/to" 26 "net/http" 27) 28 29// Access enumerates the values for access. 30type Access string 31 32const ( 33 // Allow ... 34 Allow Access = "Allow" 35 // Deny ... 36 Deny Access = "Deny" 37) 38 39// PossibleAccessValues returns an array of possible values for the Access const type. 40func PossibleAccessValues() []Access { 41 return []Access{Allow, Deny} 42} 43 44// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health 45// server health. 46type ApplicationGatewayBackendHealthServerHealth string 47 48const ( 49 // Down ... 50 Down ApplicationGatewayBackendHealthServerHealth = "Down" 51 // Draining ... 52 Draining ApplicationGatewayBackendHealthServerHealth = "Draining" 53 // Partial ... 54 Partial ApplicationGatewayBackendHealthServerHealth = "Partial" 55 // Unknown ... 56 Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" 57 // Up ... 58 Up ApplicationGatewayBackendHealthServerHealth = "Up" 59) 60 61// PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. 62func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { 63 return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} 64} 65 66// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. 67type ApplicationGatewayCookieBasedAffinity string 68 69const ( 70 // Disabled ... 71 Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" 72 // Enabled ... 73 Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" 74) 75 76// PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. 77func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { 78 return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} 79} 80 81// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. 82type ApplicationGatewayFirewallMode string 83 84const ( 85 // Detection ... 86 Detection ApplicationGatewayFirewallMode = "Detection" 87 // Prevention ... 88 Prevention ApplicationGatewayFirewallMode = "Prevention" 89) 90 91// PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. 92func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { 93 return []ApplicationGatewayFirewallMode{Detection, Prevention} 94} 95 96// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. 97type ApplicationGatewayOperationalState string 98 99const ( 100 // Running ... 101 Running ApplicationGatewayOperationalState = "Running" 102 // Starting ... 103 Starting ApplicationGatewayOperationalState = "Starting" 104 // Stopped ... 105 Stopped ApplicationGatewayOperationalState = "Stopped" 106 // Stopping ... 107 Stopping ApplicationGatewayOperationalState = "Stopping" 108) 109 110// PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. 111func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { 112 return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} 113} 114 115// ApplicationGatewayProtocol enumerates the values for application gateway protocol. 116type ApplicationGatewayProtocol string 117 118const ( 119 // HTTP ... 120 HTTP ApplicationGatewayProtocol = "Http" 121 // HTTPS ... 122 HTTPS ApplicationGatewayProtocol = "Https" 123) 124 125// PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. 126func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { 127 return []ApplicationGatewayProtocol{HTTP, HTTPS} 128} 129 130// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule 131// type. 132type ApplicationGatewayRequestRoutingRuleType string 133 134const ( 135 // Basic ... 136 Basic ApplicationGatewayRequestRoutingRuleType = "Basic" 137 // PathBasedRouting ... 138 PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" 139) 140 141// PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. 142func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { 143 return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} 144} 145 146// ApplicationGatewaySkuName enumerates the values for application gateway sku name. 147type ApplicationGatewaySkuName string 148 149const ( 150 // StandardLarge ... 151 StandardLarge ApplicationGatewaySkuName = "Standard_Large" 152 // StandardMedium ... 153 StandardMedium ApplicationGatewaySkuName = "Standard_Medium" 154 // StandardSmall ... 155 StandardSmall ApplicationGatewaySkuName = "Standard_Small" 156 // WAFLarge ... 157 WAFLarge ApplicationGatewaySkuName = "WAF_Large" 158 // WAFMedium ... 159 WAFMedium ApplicationGatewaySkuName = "WAF_Medium" 160) 161 162// PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. 163func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { 164 return []ApplicationGatewaySkuName{StandardLarge, StandardMedium, StandardSmall, WAFLarge, WAFMedium} 165} 166 167// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. 168type ApplicationGatewaySslProtocol string 169 170const ( 171 // TLSv10 ... 172 TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" 173 // TLSv11 ... 174 TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" 175 // TLSv12 ... 176 TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" 177) 178 179// PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. 180func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { 181 return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12} 182} 183 184// ApplicationGatewayTier enumerates the values for application gateway tier. 185type ApplicationGatewayTier string 186 187const ( 188 // Standard ... 189 Standard ApplicationGatewayTier = "Standard" 190 // WAF ... 191 WAF ApplicationGatewayTier = "WAF" 192) 193 194// PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. 195func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { 196 return []ApplicationGatewayTier{Standard, WAF} 197} 198 199// AssociationType enumerates the values for association type. 200type AssociationType string 201 202const ( 203 // Associated ... 204 Associated AssociationType = "Associated" 205 // Contains ... 206 Contains AssociationType = "Contains" 207) 208 209// PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. 210func PossibleAssociationTypeValues() []AssociationType { 211 return []AssociationType{Associated, Contains} 212} 213 214// AuthorizationUseStatus enumerates the values for authorization use status. 215type AuthorizationUseStatus string 216 217const ( 218 // Available ... 219 Available AuthorizationUseStatus = "Available" 220 // InUse ... 221 InUse AuthorizationUseStatus = "InUse" 222) 223 224// PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. 225func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { 226 return []AuthorizationUseStatus{Available, InUse} 227} 228 229// BgpPeerState enumerates the values for bgp peer state. 230type BgpPeerState string 231 232const ( 233 // BgpPeerStateConnected ... 234 BgpPeerStateConnected BgpPeerState = "Connected" 235 // BgpPeerStateConnecting ... 236 BgpPeerStateConnecting BgpPeerState = "Connecting" 237 // BgpPeerStateIdle ... 238 BgpPeerStateIdle BgpPeerState = "Idle" 239 // BgpPeerStateStopped ... 240 BgpPeerStateStopped BgpPeerState = "Stopped" 241 // BgpPeerStateUnknown ... 242 BgpPeerStateUnknown BgpPeerState = "Unknown" 243) 244 245// PossibleBgpPeerStateValues returns an array of possible values for the BgpPeerState const type. 246func PossibleBgpPeerStateValues() []BgpPeerState { 247 return []BgpPeerState{BgpPeerStateConnected, BgpPeerStateConnecting, BgpPeerStateIdle, BgpPeerStateStopped, BgpPeerStateUnknown} 248} 249 250// ConnectionStatus enumerates the values for connection status. 251type ConnectionStatus string 252 253const ( 254 // ConnectionStatusConnected ... 255 ConnectionStatusConnected ConnectionStatus = "Connected" 256 // ConnectionStatusDegraded ... 257 ConnectionStatusDegraded ConnectionStatus = "Degraded" 258 // ConnectionStatusDisconnected ... 259 ConnectionStatusDisconnected ConnectionStatus = "Disconnected" 260 // ConnectionStatusUnknown ... 261 ConnectionStatusUnknown ConnectionStatus = "Unknown" 262) 263 264// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. 265func PossibleConnectionStatusValues() []ConnectionStatus { 266 return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} 267} 268 269// DhGroup enumerates the values for dh group. 270type DhGroup string 271 272const ( 273 // DHGroup1 ... 274 DHGroup1 DhGroup = "DHGroup1" 275 // DHGroup14 ... 276 DHGroup14 DhGroup = "DHGroup14" 277 // DHGroup2 ... 278 DHGroup2 DhGroup = "DHGroup2" 279 // DHGroup2048 ... 280 DHGroup2048 DhGroup = "DHGroup2048" 281 // DHGroup24 ... 282 DHGroup24 DhGroup = "DHGroup24" 283 // ECP256 ... 284 ECP256 DhGroup = "ECP256" 285 // ECP384 ... 286 ECP384 DhGroup = "ECP384" 287 // None ... 288 None DhGroup = "None" 289) 290 291// PossibleDhGroupValues returns an array of possible values for the DhGroup const type. 292func PossibleDhGroupValues() []DhGroup { 293 return []DhGroup{DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384, None} 294} 295 296// Direction enumerates the values for direction. 297type Direction string 298 299const ( 300 // Inbound ... 301 Inbound Direction = "Inbound" 302 // Outbound ... 303 Outbound Direction = "Outbound" 304) 305 306// PossibleDirectionValues returns an array of possible values for the Direction const type. 307func PossibleDirectionValues() []Direction { 308 return []Direction{Inbound, Outbound} 309} 310 311// EffectiveRouteSource enumerates the values for effective route source. 312type EffectiveRouteSource string 313 314const ( 315 // EffectiveRouteSourceDefault ... 316 EffectiveRouteSourceDefault EffectiveRouteSource = "Default" 317 // EffectiveRouteSourceUnknown ... 318 EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" 319 // EffectiveRouteSourceUser ... 320 EffectiveRouteSourceUser EffectiveRouteSource = "User" 321 // EffectiveRouteSourceVirtualNetworkGateway ... 322 EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" 323) 324 325// PossibleEffectiveRouteSourceValues returns an array of possible values for the EffectiveRouteSource const type. 326func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { 327 return []EffectiveRouteSource{EffectiveRouteSourceDefault, EffectiveRouteSourceUnknown, EffectiveRouteSourceUser, EffectiveRouteSourceVirtualNetworkGateway} 328} 329 330// EffectiveRouteState enumerates the values for effective route state. 331type EffectiveRouteState string 332 333const ( 334 // Active ... 335 Active EffectiveRouteState = "Active" 336 // Invalid ... 337 Invalid EffectiveRouteState = "Invalid" 338) 339 340// PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. 341func PossibleEffectiveRouteStateValues() []EffectiveRouteState { 342 return []EffectiveRouteState{Active, Invalid} 343} 344 345// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit 346// peering advertised public prefix state. 347type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string 348 349const ( 350 // Configured ... 351 Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" 352 // Configuring ... 353 Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" 354 // NotConfigured ... 355 NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" 356 // ValidationNeeded ... 357 ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" 358) 359 360// PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. 361func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { 362 return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} 363} 364 365// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. 366type ExpressRouteCircuitPeeringState string 367 368const ( 369 // ExpressRouteCircuitPeeringStateDisabled ... 370 ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" 371 // ExpressRouteCircuitPeeringStateEnabled ... 372 ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" 373) 374 375// PossibleExpressRouteCircuitPeeringStateValues returns an array of possible values for the ExpressRouteCircuitPeeringState const type. 376func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeeringState { 377 return []ExpressRouteCircuitPeeringState{ExpressRouteCircuitPeeringStateDisabled, ExpressRouteCircuitPeeringStateEnabled} 378} 379 380// ExpressRouteCircuitPeeringType enumerates the values for express route circuit peering type. 381type ExpressRouteCircuitPeeringType string 382 383const ( 384 // AzurePrivatePeering ... 385 AzurePrivatePeering ExpressRouteCircuitPeeringType = "AzurePrivatePeering" 386 // AzurePublicPeering ... 387 AzurePublicPeering ExpressRouteCircuitPeeringType = "AzurePublicPeering" 388 // MicrosoftPeering ... 389 MicrosoftPeering ExpressRouteCircuitPeeringType = "MicrosoftPeering" 390) 391 392// PossibleExpressRouteCircuitPeeringTypeValues returns an array of possible values for the ExpressRouteCircuitPeeringType const type. 393func PossibleExpressRouteCircuitPeeringTypeValues() []ExpressRouteCircuitPeeringType { 394 return []ExpressRouteCircuitPeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} 395} 396 397// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. 398type ExpressRouteCircuitSkuFamily string 399 400const ( 401 // MeteredData ... 402 MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" 403 // UnlimitedData ... 404 UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" 405) 406 407// PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. 408func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { 409 return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} 410} 411 412// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. 413type ExpressRouteCircuitSkuTier string 414 415const ( 416 // ExpressRouteCircuitSkuTierPremium ... 417 ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" 418 // ExpressRouteCircuitSkuTierStandard ... 419 ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" 420) 421 422// PossibleExpressRouteCircuitSkuTierValues returns an array of possible values for the ExpressRouteCircuitSkuTier const type. 423func PossibleExpressRouteCircuitSkuTierValues() []ExpressRouteCircuitSkuTier { 424 return []ExpressRouteCircuitSkuTier{ExpressRouteCircuitSkuTierPremium, ExpressRouteCircuitSkuTierStandard} 425} 426 427// IkeEncryption enumerates the values for ike encryption. 428type IkeEncryption string 429 430const ( 431 // AES128 ... 432 AES128 IkeEncryption = "AES128" 433 // AES192 ... 434 AES192 IkeEncryption = "AES192" 435 // AES256 ... 436 AES256 IkeEncryption = "AES256" 437 // DES ... 438 DES IkeEncryption = "DES" 439 // DES3 ... 440 DES3 IkeEncryption = "DES3" 441) 442 443// PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. 444func PossibleIkeEncryptionValues() []IkeEncryption { 445 return []IkeEncryption{AES128, AES192, AES256, DES, DES3} 446} 447 448// IkeIntegrity enumerates the values for ike integrity. 449type IkeIntegrity string 450 451const ( 452 // MD5 ... 453 MD5 IkeIntegrity = "MD5" 454 // SHA1 ... 455 SHA1 IkeIntegrity = "SHA1" 456 // SHA256 ... 457 SHA256 IkeIntegrity = "SHA256" 458 // SHA384 ... 459 SHA384 IkeIntegrity = "SHA384" 460) 461 462// PossibleIkeIntegrityValues returns an array of possible values for the IkeIntegrity const type. 463func PossibleIkeIntegrityValues() []IkeIntegrity { 464 return []IkeIntegrity{MD5, SHA1, SHA256, SHA384} 465} 466 467// IPAllocationMethod enumerates the values for ip allocation method. 468type IPAllocationMethod string 469 470const ( 471 // Dynamic ... 472 Dynamic IPAllocationMethod = "Dynamic" 473 // Static ... 474 Static IPAllocationMethod = "Static" 475) 476 477// PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. 478func PossibleIPAllocationMethodValues() []IPAllocationMethod { 479 return []IPAllocationMethod{Dynamic, Static} 480} 481 482// IpsecEncryption enumerates the values for ipsec encryption. 483type IpsecEncryption string 484 485const ( 486 // IpsecEncryptionAES128 ... 487 IpsecEncryptionAES128 IpsecEncryption = "AES128" 488 // IpsecEncryptionAES192 ... 489 IpsecEncryptionAES192 IpsecEncryption = "AES192" 490 // IpsecEncryptionAES256 ... 491 IpsecEncryptionAES256 IpsecEncryption = "AES256" 492 // IpsecEncryptionDES ... 493 IpsecEncryptionDES IpsecEncryption = "DES" 494 // IpsecEncryptionDES3 ... 495 IpsecEncryptionDES3 IpsecEncryption = "DES3" 496 // IpsecEncryptionGCMAES128 ... 497 IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" 498 // IpsecEncryptionGCMAES192 ... 499 IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" 500 // IpsecEncryptionGCMAES256 ... 501 IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" 502 // IpsecEncryptionNone ... 503 IpsecEncryptionNone IpsecEncryption = "None" 504) 505 506// PossibleIpsecEncryptionValues returns an array of possible values for the IpsecEncryption const type. 507func PossibleIpsecEncryptionValues() []IpsecEncryption { 508 return []IpsecEncryption{IpsecEncryptionAES128, IpsecEncryptionAES192, IpsecEncryptionAES256, IpsecEncryptionDES, IpsecEncryptionDES3, IpsecEncryptionGCMAES128, IpsecEncryptionGCMAES192, IpsecEncryptionGCMAES256, IpsecEncryptionNone} 509} 510 511// IpsecIntegrity enumerates the values for ipsec integrity. 512type IpsecIntegrity string 513 514const ( 515 // IpsecIntegrityGCMAES128 ... 516 IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" 517 // IpsecIntegrityGCMAES192 ... 518 IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" 519 // IpsecIntegrityGCMAES256 ... 520 IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" 521 // IpsecIntegrityMD5 ... 522 IpsecIntegrityMD5 IpsecIntegrity = "MD5" 523 // IpsecIntegritySHA1 ... 524 IpsecIntegritySHA1 IpsecIntegrity = "SHA1" 525 // IpsecIntegritySHA256 ... 526 IpsecIntegritySHA256 IpsecIntegrity = "SHA256" 527) 528 529// PossibleIpsecIntegrityValues returns an array of possible values for the IpsecIntegrity const type. 530func PossibleIpsecIntegrityValues() []IpsecIntegrity { 531 return []IpsecIntegrity{IpsecIntegrityGCMAES128, IpsecIntegrityGCMAES192, IpsecIntegrityGCMAES256, IpsecIntegrityMD5, IpsecIntegritySHA1, IpsecIntegritySHA256} 532} 533 534// IPVersion enumerates the values for ip version. 535type IPVersion string 536 537const ( 538 // IPv4 ... 539 IPv4 IPVersion = "IPv4" 540 // IPv6 ... 541 IPv6 IPVersion = "IPv6" 542) 543 544// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. 545func PossibleIPVersionValues() []IPVersion { 546 return []IPVersion{IPv4, IPv6} 547} 548 549// IssueType enumerates the values for issue type. 550type IssueType string 551 552const ( 553 // IssueTypeAgentStopped ... 554 IssueTypeAgentStopped IssueType = "AgentStopped" 555 // IssueTypeDNSResolution ... 556 IssueTypeDNSResolution IssueType = "DnsResolution" 557 // IssueTypeGuestFirewall ... 558 IssueTypeGuestFirewall IssueType = "GuestFirewall" 559 // IssueTypeNetworkSecurityRule ... 560 IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" 561 // IssueTypePlatform ... 562 IssueTypePlatform IssueType = "Platform" 563 // IssueTypePortThrottled ... 564 IssueTypePortThrottled IssueType = "PortThrottled" 565 // IssueTypeSocketBind ... 566 IssueTypeSocketBind IssueType = "SocketBind" 567 // IssueTypeUnknown ... 568 IssueTypeUnknown IssueType = "Unknown" 569 // IssueTypeUserDefinedRoute ... 570 IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" 571) 572 573// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. 574func PossibleIssueTypeValues() []IssueType { 575 return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} 576} 577 578// LoadDistribution enumerates the values for load distribution. 579type LoadDistribution string 580 581const ( 582 // Default ... 583 Default LoadDistribution = "Default" 584 // SourceIP ... 585 SourceIP LoadDistribution = "SourceIP" 586 // SourceIPProtocol ... 587 SourceIPProtocol LoadDistribution = "SourceIPProtocol" 588) 589 590// PossibleLoadDistributionValues returns an array of possible values for the LoadDistribution const type. 591func PossibleLoadDistributionValues() []LoadDistribution { 592 return []LoadDistribution{Default, SourceIP, SourceIPProtocol} 593} 594 595// NextHopType enumerates the values for next hop type. 596type NextHopType string 597 598const ( 599 // NextHopTypeHyperNetGateway ... 600 NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" 601 // NextHopTypeInternet ... 602 NextHopTypeInternet NextHopType = "Internet" 603 // NextHopTypeNone ... 604 NextHopTypeNone NextHopType = "None" 605 // NextHopTypeVirtualAppliance ... 606 NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" 607 // NextHopTypeVirtualNetworkGateway ... 608 NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" 609 // NextHopTypeVnetLocal ... 610 NextHopTypeVnetLocal NextHopType = "VnetLocal" 611) 612 613// PossibleNextHopTypeValues returns an array of possible values for the NextHopType const type. 614func PossibleNextHopTypeValues() []NextHopType { 615 return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} 616} 617 618// OperationStatus enumerates the values for operation status. 619type OperationStatus string 620 621const ( 622 // Failed ... 623 Failed OperationStatus = "Failed" 624 // InProgress ... 625 InProgress OperationStatus = "InProgress" 626 // Succeeded ... 627 Succeeded OperationStatus = "Succeeded" 628) 629 630// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. 631func PossibleOperationStatusValues() []OperationStatus { 632 return []OperationStatus{Failed, InProgress, Succeeded} 633} 634 635// Origin enumerates the values for origin. 636type Origin string 637 638const ( 639 // OriginInbound ... 640 OriginInbound Origin = "Inbound" 641 // OriginLocal ... 642 OriginLocal Origin = "Local" 643 // OriginOutbound ... 644 OriginOutbound Origin = "Outbound" 645) 646 647// PossibleOriginValues returns an array of possible values for the Origin const type. 648func PossibleOriginValues() []Origin { 649 return []Origin{OriginInbound, OriginLocal, OriginOutbound} 650} 651 652// PcError enumerates the values for pc error. 653type PcError string 654 655const ( 656 // AgentStopped ... 657 AgentStopped PcError = "AgentStopped" 658 // CaptureFailed ... 659 CaptureFailed PcError = "CaptureFailed" 660 // InternalError ... 661 InternalError PcError = "InternalError" 662 // LocalFileFailed ... 663 LocalFileFailed PcError = "LocalFileFailed" 664 // StorageFailed ... 665 StorageFailed PcError = "StorageFailed" 666) 667 668// PossiblePcErrorValues returns an array of possible values for the PcError const type. 669func PossiblePcErrorValues() []PcError { 670 return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} 671} 672 673// PcProtocol enumerates the values for pc protocol. 674type PcProtocol string 675 676const ( 677 // Any ... 678 Any PcProtocol = "Any" 679 // TCP ... 680 TCP PcProtocol = "TCP" 681 // UDP ... 682 UDP PcProtocol = "UDP" 683) 684 685// PossiblePcProtocolValues returns an array of possible values for the PcProtocol const type. 686func PossiblePcProtocolValues() []PcProtocol { 687 return []PcProtocol{Any, TCP, UDP} 688} 689 690// PcStatus enumerates the values for pc status. 691type PcStatus string 692 693const ( 694 // PcStatusError ... 695 PcStatusError PcStatus = "Error" 696 // PcStatusNotStarted ... 697 PcStatusNotStarted PcStatus = "NotStarted" 698 // PcStatusRunning ... 699 PcStatusRunning PcStatus = "Running" 700 // PcStatusStopped ... 701 PcStatusStopped PcStatus = "Stopped" 702 // PcStatusUnknown ... 703 PcStatusUnknown PcStatus = "Unknown" 704) 705 706// PossiblePcStatusValues returns an array of possible values for the PcStatus const type. 707func PossiblePcStatusValues() []PcStatus { 708 return []PcStatus{PcStatusError, PcStatusNotStarted, PcStatusRunning, PcStatusStopped, PcStatusUnknown} 709} 710 711// PfsGroup enumerates the values for pfs group. 712type PfsGroup string 713 714const ( 715 // PfsGroupECP256 ... 716 PfsGroupECP256 PfsGroup = "ECP256" 717 // PfsGroupECP384 ... 718 PfsGroupECP384 PfsGroup = "ECP384" 719 // PfsGroupNone ... 720 PfsGroupNone PfsGroup = "None" 721 // PfsGroupPFS1 ... 722 PfsGroupPFS1 PfsGroup = "PFS1" 723 // PfsGroupPFS2 ... 724 PfsGroupPFS2 PfsGroup = "PFS2" 725 // PfsGroupPFS2048 ... 726 PfsGroupPFS2048 PfsGroup = "PFS2048" 727 // PfsGroupPFS24 ... 728 PfsGroupPFS24 PfsGroup = "PFS24" 729) 730 731// PossiblePfsGroupValues returns an array of possible values for the PfsGroup const type. 732func PossiblePfsGroupValues() []PfsGroup { 733 return []PfsGroup{PfsGroupECP256, PfsGroupECP384, PfsGroupNone, PfsGroupPFS1, PfsGroupPFS2, PfsGroupPFS2048, PfsGroupPFS24} 734} 735 736// ProbeProtocol enumerates the values for probe protocol. 737type ProbeProtocol string 738 739const ( 740 // ProbeProtocolHTTP ... 741 ProbeProtocolHTTP ProbeProtocol = "Http" 742 // ProbeProtocolTCP ... 743 ProbeProtocolTCP ProbeProtocol = "Tcp" 744) 745 746// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. 747func PossibleProbeProtocolValues() []ProbeProtocol { 748 return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolTCP} 749} 750 751// ProcessorArchitecture enumerates the values for processor architecture. 752type ProcessorArchitecture string 753 754const ( 755 // Amd64 ... 756 Amd64 ProcessorArchitecture = "Amd64" 757 // X86 ... 758 X86 ProcessorArchitecture = "X86" 759) 760 761// PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. 762func PossibleProcessorArchitectureValues() []ProcessorArchitecture { 763 return []ProcessorArchitecture{Amd64, X86} 764} 765 766// Protocol enumerates the values for protocol. 767type Protocol string 768 769const ( 770 // ProtocolTCP ... 771 ProtocolTCP Protocol = "TCP" 772 // ProtocolUDP ... 773 ProtocolUDP Protocol = "UDP" 774) 775 776// PossibleProtocolValues returns an array of possible values for the Protocol const type. 777func PossibleProtocolValues() []Protocol { 778 return []Protocol{ProtocolTCP, ProtocolUDP} 779} 780 781// ProvisioningState enumerates the values for provisioning state. 782type ProvisioningState string 783 784const ( 785 // ProvisioningStateDeleting ... 786 ProvisioningStateDeleting ProvisioningState = "Deleting" 787 // ProvisioningStateFailed ... 788 ProvisioningStateFailed ProvisioningState = "Failed" 789 // ProvisioningStateSucceeded ... 790 ProvisioningStateSucceeded ProvisioningState = "Succeeded" 791 // ProvisioningStateUpdating ... 792 ProvisioningStateUpdating ProvisioningState = "Updating" 793) 794 795// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. 796func PossibleProvisioningStateValues() []ProvisioningState { 797 return []ProvisioningState{ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating} 798} 799 800// RouteNextHopType enumerates the values for route next hop type. 801type RouteNextHopType string 802 803const ( 804 // RouteNextHopTypeInternet ... 805 RouteNextHopTypeInternet RouteNextHopType = "Internet" 806 // RouteNextHopTypeNone ... 807 RouteNextHopTypeNone RouteNextHopType = "None" 808 // RouteNextHopTypeVirtualAppliance ... 809 RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" 810 // RouteNextHopTypeVirtualNetworkGateway ... 811 RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" 812 // RouteNextHopTypeVnetLocal ... 813 RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" 814) 815 816// PossibleRouteNextHopTypeValues returns an array of possible values for the RouteNextHopType const type. 817func PossibleRouteNextHopTypeValues() []RouteNextHopType { 818 return []RouteNextHopType{RouteNextHopTypeInternet, RouteNextHopTypeNone, RouteNextHopTypeVirtualAppliance, RouteNextHopTypeVirtualNetworkGateway, RouteNextHopTypeVnetLocal} 819} 820 821// SecurityRuleAccess enumerates the values for security rule access. 822type SecurityRuleAccess string 823 824const ( 825 // SecurityRuleAccessAllow ... 826 SecurityRuleAccessAllow SecurityRuleAccess = "Allow" 827 // SecurityRuleAccessDeny ... 828 SecurityRuleAccessDeny SecurityRuleAccess = "Deny" 829) 830 831// PossibleSecurityRuleAccessValues returns an array of possible values for the SecurityRuleAccess const type. 832func PossibleSecurityRuleAccessValues() []SecurityRuleAccess { 833 return []SecurityRuleAccess{SecurityRuleAccessAllow, SecurityRuleAccessDeny} 834} 835 836// SecurityRuleDirection enumerates the values for security rule direction. 837type SecurityRuleDirection string 838 839const ( 840 // SecurityRuleDirectionInbound ... 841 SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" 842 // SecurityRuleDirectionOutbound ... 843 SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" 844) 845 846// PossibleSecurityRuleDirectionValues returns an array of possible values for the SecurityRuleDirection const type. 847func PossibleSecurityRuleDirectionValues() []SecurityRuleDirection { 848 return []SecurityRuleDirection{SecurityRuleDirectionInbound, SecurityRuleDirectionOutbound} 849} 850 851// SecurityRuleProtocol enumerates the values for security rule protocol. 852type SecurityRuleProtocol string 853 854const ( 855 // SecurityRuleProtocolAsterisk ... 856 SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" 857 // SecurityRuleProtocolTCP ... 858 SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" 859 // SecurityRuleProtocolUDP ... 860 SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" 861) 862 863// PossibleSecurityRuleProtocolValues returns an array of possible values for the SecurityRuleProtocol const type. 864func PossibleSecurityRuleProtocolValues() []SecurityRuleProtocol { 865 return []SecurityRuleProtocol{SecurityRuleProtocolAsterisk, SecurityRuleProtocolTCP, SecurityRuleProtocolUDP} 866} 867 868// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. 869type ServiceProviderProvisioningState string 870 871const ( 872 // Deprovisioning ... 873 Deprovisioning ServiceProviderProvisioningState = "Deprovisioning" 874 // NotProvisioned ... 875 NotProvisioned ServiceProviderProvisioningState = "NotProvisioned" 876 // Provisioned ... 877 Provisioned ServiceProviderProvisioningState = "Provisioned" 878 // Provisioning ... 879 Provisioning ServiceProviderProvisioningState = "Provisioning" 880) 881 882// PossibleServiceProviderProvisioningStateValues returns an array of possible values for the ServiceProviderProvisioningState const type. 883func PossibleServiceProviderProvisioningStateValues() []ServiceProviderProvisioningState { 884 return []ServiceProviderProvisioningState{Deprovisioning, NotProvisioned, Provisioned, Provisioning} 885} 886 887// Severity enumerates the values for severity. 888type Severity string 889 890const ( 891 // SeverityError ... 892 SeverityError Severity = "Error" 893 // SeverityWarning ... 894 SeverityWarning Severity = "Warning" 895) 896 897// PossibleSeverityValues returns an array of possible values for the Severity const type. 898func PossibleSeverityValues() []Severity { 899 return []Severity{SeverityError, SeverityWarning} 900} 901 902// TransportProtocol enumerates the values for transport protocol. 903type TransportProtocol string 904 905const ( 906 // TransportProtocolTCP ... 907 TransportProtocolTCP TransportProtocol = "Tcp" 908 // TransportProtocolUDP ... 909 TransportProtocolUDP TransportProtocol = "Udp" 910) 911 912// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. 913func PossibleTransportProtocolValues() []TransportProtocol { 914 return []TransportProtocol{TransportProtocolTCP, TransportProtocolUDP} 915} 916 917// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. 918type VirtualNetworkGatewayConnectionStatus string 919 920const ( 921 // VirtualNetworkGatewayConnectionStatusConnected ... 922 VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" 923 // VirtualNetworkGatewayConnectionStatusConnecting ... 924 VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" 925 // VirtualNetworkGatewayConnectionStatusNotConnected ... 926 VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" 927 // VirtualNetworkGatewayConnectionStatusUnknown ... 928 VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" 929) 930 931// PossibleVirtualNetworkGatewayConnectionStatusValues returns an array of possible values for the VirtualNetworkGatewayConnectionStatus const type. 932func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatewayConnectionStatus { 933 return []VirtualNetworkGatewayConnectionStatus{VirtualNetworkGatewayConnectionStatusConnected, VirtualNetworkGatewayConnectionStatusConnecting, VirtualNetworkGatewayConnectionStatusNotConnected, VirtualNetworkGatewayConnectionStatusUnknown} 934} 935 936// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. 937type VirtualNetworkGatewayConnectionType string 938 939const ( 940 // ExpressRoute ... 941 ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" 942 // IPsec ... 943 IPsec VirtualNetworkGatewayConnectionType = "IPsec" 944 // Vnet2Vnet ... 945 Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" 946 // VPNClient ... 947 VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" 948) 949 950// PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. 951func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { 952 return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} 953} 954 955// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. 956type VirtualNetworkGatewaySkuName string 957 958const ( 959 // VirtualNetworkGatewaySkuNameBasic ... 960 VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" 961 // VirtualNetworkGatewaySkuNameHighPerformance ... 962 VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" 963 // VirtualNetworkGatewaySkuNameStandard ... 964 VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" 965 // VirtualNetworkGatewaySkuNameUltraPerformance ... 966 VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" 967 // VirtualNetworkGatewaySkuNameVpnGw1 ... 968 VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" 969 // VirtualNetworkGatewaySkuNameVpnGw2 ... 970 VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" 971 // VirtualNetworkGatewaySkuNameVpnGw3 ... 972 VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" 973) 974 975// PossibleVirtualNetworkGatewaySkuNameValues returns an array of possible values for the VirtualNetworkGatewaySkuName const type. 976func PossibleVirtualNetworkGatewaySkuNameValues() []VirtualNetworkGatewaySkuName { 977 return []VirtualNetworkGatewaySkuName{VirtualNetworkGatewaySkuNameBasic, VirtualNetworkGatewaySkuNameHighPerformance, VirtualNetworkGatewaySkuNameStandard, VirtualNetworkGatewaySkuNameUltraPerformance, VirtualNetworkGatewaySkuNameVpnGw1, VirtualNetworkGatewaySkuNameVpnGw2, VirtualNetworkGatewaySkuNameVpnGw3} 978} 979 980// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. 981type VirtualNetworkGatewaySkuTier string 982 983const ( 984 // VirtualNetworkGatewaySkuTierBasic ... 985 VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" 986 // VirtualNetworkGatewaySkuTierHighPerformance ... 987 VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" 988 // VirtualNetworkGatewaySkuTierStandard ... 989 VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" 990 // VirtualNetworkGatewaySkuTierUltraPerformance ... 991 VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" 992 // VirtualNetworkGatewaySkuTierVpnGw1 ... 993 VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" 994 // VirtualNetworkGatewaySkuTierVpnGw2 ... 995 VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" 996 // VirtualNetworkGatewaySkuTierVpnGw3 ... 997 VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" 998) 999 1000// PossibleVirtualNetworkGatewaySkuTierValues returns an array of possible values for the VirtualNetworkGatewaySkuTier const type. 1001func PossibleVirtualNetworkGatewaySkuTierValues() []VirtualNetworkGatewaySkuTier { 1002 return []VirtualNetworkGatewaySkuTier{VirtualNetworkGatewaySkuTierBasic, VirtualNetworkGatewaySkuTierHighPerformance, VirtualNetworkGatewaySkuTierStandard, VirtualNetworkGatewaySkuTierUltraPerformance, VirtualNetworkGatewaySkuTierVpnGw1, VirtualNetworkGatewaySkuTierVpnGw2, VirtualNetworkGatewaySkuTierVpnGw3} 1003} 1004 1005// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. 1006type VirtualNetworkGatewayType string 1007 1008const ( 1009 // VirtualNetworkGatewayTypeExpressRoute ... 1010 VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" 1011 // VirtualNetworkGatewayTypeVpn ... 1012 VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" 1013) 1014 1015// PossibleVirtualNetworkGatewayTypeValues returns an array of possible values for the VirtualNetworkGatewayType const type. 1016func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { 1017 return []VirtualNetworkGatewayType{VirtualNetworkGatewayTypeExpressRoute, VirtualNetworkGatewayTypeVpn} 1018} 1019 1020// VirtualNetworkPeeringState enumerates the values for virtual network peering state. 1021type VirtualNetworkPeeringState string 1022 1023const ( 1024 // Connected ... 1025 Connected VirtualNetworkPeeringState = "Connected" 1026 // Disconnected ... 1027 Disconnected VirtualNetworkPeeringState = "Disconnected" 1028 // Initiated ... 1029 Initiated VirtualNetworkPeeringState = "Initiated" 1030) 1031 1032// PossibleVirtualNetworkPeeringStateValues returns an array of possible values for the VirtualNetworkPeeringState const type. 1033func PossibleVirtualNetworkPeeringStateValues() []VirtualNetworkPeeringState { 1034 return []VirtualNetworkPeeringState{Connected, Disconnected, Initiated} 1035} 1036 1037// VpnType enumerates the values for vpn type. 1038type VpnType string 1039 1040const ( 1041 // PolicyBased ... 1042 PolicyBased VpnType = "PolicyBased" 1043 // RouteBased ... 1044 RouteBased VpnType = "RouteBased" 1045) 1046 1047// PossibleVpnTypeValues returns an array of possible values for the VpnType const type. 1048func PossibleVpnTypeValues() []VpnType { 1049 return []VpnType{PolicyBased, RouteBased} 1050} 1051 1052// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the virtual 1053// network. 1054type AddressSpace struct { 1055 // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. 1056 AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` 1057} 1058 1059// ApplicationGateway application gateway resource 1060type ApplicationGateway struct { 1061 autorest.Response `json:"-"` 1062 *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` 1063 // Etag - A unique read-only string that changes whenever the resource is updated. 1064 Etag *string `json:"etag,omitempty"` 1065 // ID - Resource ID. 1066 ID *string `json:"id,omitempty"` 1067 // Name - Resource name. 1068 Name *string `json:"name,omitempty"` 1069 // Type - Resource type. 1070 Type *string `json:"type,omitempty"` 1071 // Location - Resource location. 1072 Location *string `json:"location,omitempty"` 1073 // Tags - Resource tags. 1074 Tags map[string]*string `json:"tags"` 1075} 1076 1077// MarshalJSON is the custom marshaler for ApplicationGateway. 1078func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { 1079 objectMap := make(map[string]interface{}) 1080 if ag.ApplicationGatewayPropertiesFormat != nil { 1081 objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat 1082 } 1083 if ag.Etag != nil { 1084 objectMap["etag"] = ag.Etag 1085 } 1086 if ag.ID != nil { 1087 objectMap["id"] = ag.ID 1088 } 1089 if ag.Name != nil { 1090 objectMap["name"] = ag.Name 1091 } 1092 if ag.Type != nil { 1093 objectMap["type"] = ag.Type 1094 } 1095 if ag.Location != nil { 1096 objectMap["location"] = ag.Location 1097 } 1098 if ag.Tags != nil { 1099 objectMap["tags"] = ag.Tags 1100 } 1101 return json.Marshal(objectMap) 1102} 1103 1104// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. 1105func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { 1106 var m map[string]*json.RawMessage 1107 err := json.Unmarshal(body, &m) 1108 if err != nil { 1109 return err 1110 } 1111 for k, v := range m { 1112 switch k { 1113 case "properties": 1114 if v != nil { 1115 var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat 1116 err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) 1117 if err != nil { 1118 return err 1119 } 1120 ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat 1121 } 1122 case "etag": 1123 if v != nil { 1124 var etag string 1125 err = json.Unmarshal(*v, &etag) 1126 if err != nil { 1127 return err 1128 } 1129 ag.Etag = &etag 1130 } 1131 case "id": 1132 if v != nil { 1133 var ID string 1134 err = json.Unmarshal(*v, &ID) 1135 if err != nil { 1136 return err 1137 } 1138 ag.ID = &ID 1139 } 1140 case "name": 1141 if v != nil { 1142 var name string 1143 err = json.Unmarshal(*v, &name) 1144 if err != nil { 1145 return err 1146 } 1147 ag.Name = &name 1148 } 1149 case "type": 1150 if v != nil { 1151 var typeVar string 1152 err = json.Unmarshal(*v, &typeVar) 1153 if err != nil { 1154 return err 1155 } 1156 ag.Type = &typeVar 1157 } 1158 case "location": 1159 if v != nil { 1160 var location string 1161 err = json.Unmarshal(*v, &location) 1162 if err != nil { 1163 return err 1164 } 1165 ag.Location = &location 1166 } 1167 case "tags": 1168 if v != nil { 1169 var tags map[string]*string 1170 err = json.Unmarshal(*v, &tags) 1171 if err != nil { 1172 return err 1173 } 1174 ag.Tags = tags 1175 } 1176 } 1177 } 1178 1179 return nil 1180} 1181 1182// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. 1183type ApplicationGatewayAuthenticationCertificate struct { 1184 *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` 1185 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1186 Name *string `json:"name,omitempty"` 1187 // Etag - A unique read-only string that changes whenever the resource is updated. 1188 Etag *string `json:"etag,omitempty"` 1189 // ID - Resource ID. 1190 ID *string `json:"id,omitempty"` 1191} 1192 1193// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. 1194func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { 1195 objectMap := make(map[string]interface{}) 1196 if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { 1197 objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat 1198 } 1199 if agac.Name != nil { 1200 objectMap["name"] = agac.Name 1201 } 1202 if agac.Etag != nil { 1203 objectMap["etag"] = agac.Etag 1204 } 1205 if agac.ID != nil { 1206 objectMap["id"] = agac.ID 1207 } 1208 return json.Marshal(objectMap) 1209} 1210 1211// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. 1212func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error { 1213 var m map[string]*json.RawMessage 1214 err := json.Unmarshal(body, &m) 1215 if err != nil { 1216 return err 1217 } 1218 for k, v := range m { 1219 switch k { 1220 case "properties": 1221 if v != nil { 1222 var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat 1223 err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) 1224 if err != nil { 1225 return err 1226 } 1227 agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat 1228 } 1229 case "name": 1230 if v != nil { 1231 var name string 1232 err = json.Unmarshal(*v, &name) 1233 if err != nil { 1234 return err 1235 } 1236 agac.Name = &name 1237 } 1238 case "etag": 1239 if v != nil { 1240 var etag string 1241 err = json.Unmarshal(*v, &etag) 1242 if err != nil { 1243 return err 1244 } 1245 agac.Etag = &etag 1246 } 1247 case "id": 1248 if v != nil { 1249 var ID string 1250 err = json.Unmarshal(*v, &ID) 1251 if err != nil { 1252 return err 1253 } 1254 agac.ID = &ID 1255 } 1256 } 1257 } 1258 1259 return nil 1260} 1261 1262// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an 1263// application gateway. 1264type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { 1265 // Data - Certificate public data. 1266 Data *string `json:"data,omitempty"` 1267 // ProvisioningState - Provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1268 ProvisioningState *string `json:"provisioningState,omitempty"` 1269} 1270 1271// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API service 1272// call. 1273type ApplicationGatewayAvailableWafRuleSetsResult struct { 1274 autorest.Response `json:"-"` 1275 // Value - The list of application gateway rule sets. 1276 Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` 1277} 1278 1279// ApplicationGatewayBackendAddress backend address of an application gateway. 1280type ApplicationGatewayBackendAddress struct { 1281 // Fqdn - Fully qualified domain name (FQDN). 1282 Fqdn *string `json:"fqdn,omitempty"` 1283 // IPAddress - IP address 1284 IPAddress *string `json:"ipAddress,omitempty"` 1285} 1286 1287// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. 1288type ApplicationGatewayBackendAddressPool struct { 1289 *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 1290 // Name - Resource that is unique within a resource group. This name can be used to access the resource. 1291 Name *string `json:"name,omitempty"` 1292 // Etag - A unique read-only string that changes whenever the resource is updated. 1293 Etag *string `json:"etag,omitempty"` 1294 // ID - Resource ID. 1295 ID *string `json:"id,omitempty"` 1296} 1297 1298// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. 1299func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { 1300 objectMap := make(map[string]interface{}) 1301 if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { 1302 objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat 1303 } 1304 if agbap.Name != nil { 1305 objectMap["name"] = agbap.Name 1306 } 1307 if agbap.Etag != nil { 1308 objectMap["etag"] = agbap.Etag 1309 } 1310 if agbap.ID != nil { 1311 objectMap["id"] = agbap.ID 1312 } 1313 return json.Marshal(objectMap) 1314} 1315 1316// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. 1317func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { 1318 var m map[string]*json.RawMessage 1319 err := json.Unmarshal(body, &m) 1320 if err != nil { 1321 return err 1322 } 1323 for k, v := range m { 1324 switch k { 1325 case "properties": 1326 if v != nil { 1327 var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat 1328 err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) 1329 if err != nil { 1330 return err 1331 } 1332 agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat 1333 } 1334 case "name": 1335 if v != nil { 1336 var name string 1337 err = json.Unmarshal(*v, &name) 1338 if err != nil { 1339 return err 1340 } 1341 agbap.Name = &name 1342 } 1343 case "etag": 1344 if v != nil { 1345 var etag string 1346 err = json.Unmarshal(*v, &etag) 1347 if err != nil { 1348 return err 1349 } 1350 agbap.Etag = &etag 1351 } 1352 case "id": 1353 if v != nil { 1354 var ID string 1355 err = json.Unmarshal(*v, &ID) 1356 if err != nil { 1357 return err 1358 } 1359 agbap.ID = &ID 1360 } 1361 } 1362 } 1363 1364 return nil 1365} 1366 1367// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an application 1368// gateway. 1369type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { 1370 // BackendIPConfigurations - Collection of references to IPs defined in network interfaces. 1371 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 1372 // BackendAddresses - Backend addresses 1373 BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` 1374 // ProvisioningState - Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1375 ProvisioningState *string `json:"provisioningState,omitempty"` 1376} 1377 1378// ApplicationGatewayBackendHealth list of ApplicationGatewayBackendHealthPool resources. 1379type ApplicationGatewayBackendHealth struct { 1380 autorest.Response `json:"-"` 1381 BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` 1382} 1383 1384// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings. 1385type ApplicationGatewayBackendHealthHTTPSettings struct { 1386 // BackendHTTPSettings - Reference of an ApplicationGatewayBackendHttpSettings resource. 1387 BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` 1388 // Servers - List of ApplicationGatewayBackendHealthServer resources. 1389 Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` 1390} 1391 1392// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool. 1393type ApplicationGatewayBackendHealthPool struct { 1394 // BackendAddressPool - Reference of an ApplicationGatewayBackendAddressPool resource. 1395 BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` 1396 // BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources. 1397 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` 1398} 1399 1400// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings. 1401type ApplicationGatewayBackendHealthServer struct { 1402 // Address - IP address or FQDN of backend server. 1403 Address *string `json:"address,omitempty"` 1404 // IPConfiguration - Reference of IP configuration of backend server. 1405 IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` 1406 // Health - Health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' 1407 Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` 1408} 1409 1410// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. 1411type ApplicationGatewayBackendHTTPSettings struct { 1412 *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` 1413 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1414 Name *string `json:"name,omitempty"` 1415 // Etag - A unique read-only string that changes whenever the resource is updated. 1416 Etag *string `json:"etag,omitempty"` 1417 // ID - Resource ID. 1418 ID *string `json:"id,omitempty"` 1419} 1420 1421// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. 1422func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { 1423 objectMap := make(map[string]interface{}) 1424 if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { 1425 objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat 1426 } 1427 if agbhs.Name != nil { 1428 objectMap["name"] = agbhs.Name 1429 } 1430 if agbhs.Etag != nil { 1431 objectMap["etag"] = agbhs.Etag 1432 } 1433 if agbhs.ID != nil { 1434 objectMap["id"] = agbhs.ID 1435 } 1436 return json.Marshal(objectMap) 1437} 1438 1439// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. 1440func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { 1441 var m map[string]*json.RawMessage 1442 err := json.Unmarshal(body, &m) 1443 if err != nil { 1444 return err 1445 } 1446 for k, v := range m { 1447 switch k { 1448 case "properties": 1449 if v != nil { 1450 var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat 1451 err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) 1452 if err != nil { 1453 return err 1454 } 1455 agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat 1456 } 1457 case "name": 1458 if v != nil { 1459 var name string 1460 err = json.Unmarshal(*v, &name) 1461 if err != nil { 1462 return err 1463 } 1464 agbhs.Name = &name 1465 } 1466 case "etag": 1467 if v != nil { 1468 var etag string 1469 err = json.Unmarshal(*v, &etag) 1470 if err != nil { 1471 return err 1472 } 1473 agbhs.Etag = &etag 1474 } 1475 case "id": 1476 if v != nil { 1477 var ID string 1478 err = json.Unmarshal(*v, &ID) 1479 if err != nil { 1480 return err 1481 } 1482 agbhs.ID = &ID 1483 } 1484 } 1485 } 1486 1487 return nil 1488} 1489 1490// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an 1491// application gateway. 1492type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { 1493 // Port - Port 1494 Port *int32 `json:"port,omitempty"` 1495 // Protocol - Protocol. Possible values include: 'HTTP', 'HTTPS' 1496 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 1497 // CookieBasedAffinity - Cookie based affinity. Possible values include: 'Enabled', 'Disabled' 1498 CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` 1499 // 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. 1500 RequestTimeout *int32 `json:"requestTimeout,omitempty"` 1501 // Probe - Probe resource of an application gateway. 1502 Probe *SubResource `json:"probe,omitempty"` 1503 // AuthenticationCertificates - Array of references to application gateway authentication certificates. 1504 AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` 1505 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1506 ProvisioningState *string `json:"provisioningState,omitempty"` 1507 // ConnectionDraining - Connection draining of the backend http settings resource. 1508 ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` 1509} 1510 1511// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to be 1512// active for a specified time after the backend server got removed from the configuration. 1513type ApplicationGatewayConnectionDraining struct { 1514 // Enabled - Whether connection draining is enabled or not. 1515 Enabled *bool `json:"enabled,omitempty"` 1516 // DrainTimeoutInSec - The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. 1517 DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` 1518} 1519 1520// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire rule group. 1521type ApplicationGatewayFirewallDisabledRuleGroup struct { 1522 // RuleGroupName - The name of the rule group that will be disabled. 1523 RuleGroupName *string `json:"ruleGroupName,omitempty"` 1524 // Rules - The list of rules that will be disabled. If null, all rules of the rule group will be disabled. 1525 Rules *[]int32 `json:"rules,omitempty"` 1526} 1527 1528// ApplicationGatewayFirewallRule a web application firewall rule. 1529type ApplicationGatewayFirewallRule struct { 1530 // RuleID - The identifier of the web application firewall rule. 1531 RuleID *int32 `json:"ruleId,omitempty"` 1532 // Description - The description of the web application firewall rule. 1533 Description *string `json:"description,omitempty"` 1534} 1535 1536// ApplicationGatewayFirewallRuleGroup a web application firewall rule group. 1537type ApplicationGatewayFirewallRuleGroup struct { 1538 // RuleGroupName - The name of the web application firewall rule group. 1539 RuleGroupName *string `json:"ruleGroupName,omitempty"` 1540 // Description - The description of the web application firewall rule group. 1541 Description *string `json:"description,omitempty"` 1542 // Rules - The rules of the web application firewall rule group. 1543 Rules *[]ApplicationGatewayFirewallRule `json:"rules,omitempty"` 1544} 1545 1546// ApplicationGatewayFirewallRuleSet a web application firewall rule set. 1547type ApplicationGatewayFirewallRuleSet struct { 1548 *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` 1549 // ID - Resource ID. 1550 ID *string `json:"id,omitempty"` 1551 // Name - Resource name. 1552 Name *string `json:"name,omitempty"` 1553 // Type - Resource type. 1554 Type *string `json:"type,omitempty"` 1555 // Location - Resource location. 1556 Location *string `json:"location,omitempty"` 1557 // Tags - Resource tags. 1558 Tags map[string]*string `json:"tags"` 1559} 1560 1561// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSet. 1562func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { 1563 objectMap := make(map[string]interface{}) 1564 if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil { 1565 objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat 1566 } 1567 if agfrs.ID != nil { 1568 objectMap["id"] = agfrs.ID 1569 } 1570 if agfrs.Name != nil { 1571 objectMap["name"] = agfrs.Name 1572 } 1573 if agfrs.Type != nil { 1574 objectMap["type"] = agfrs.Type 1575 } 1576 if agfrs.Location != nil { 1577 objectMap["location"] = agfrs.Location 1578 } 1579 if agfrs.Tags != nil { 1580 objectMap["tags"] = agfrs.Tags 1581 } 1582 return json.Marshal(objectMap) 1583} 1584 1585// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. 1586func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error { 1587 var m map[string]*json.RawMessage 1588 err := json.Unmarshal(body, &m) 1589 if err != nil { 1590 return err 1591 } 1592 for k, v := range m { 1593 switch k { 1594 case "properties": 1595 if v != nil { 1596 var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat 1597 err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat) 1598 if err != nil { 1599 return err 1600 } 1601 agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat 1602 } 1603 case "id": 1604 if v != nil { 1605 var ID string 1606 err = json.Unmarshal(*v, &ID) 1607 if err != nil { 1608 return err 1609 } 1610 agfrs.ID = &ID 1611 } 1612 case "name": 1613 if v != nil { 1614 var name string 1615 err = json.Unmarshal(*v, &name) 1616 if err != nil { 1617 return err 1618 } 1619 agfrs.Name = &name 1620 } 1621 case "type": 1622 if v != nil { 1623 var typeVar string 1624 err = json.Unmarshal(*v, &typeVar) 1625 if err != nil { 1626 return err 1627 } 1628 agfrs.Type = &typeVar 1629 } 1630 case "location": 1631 if v != nil { 1632 var location string 1633 err = json.Unmarshal(*v, &location) 1634 if err != nil { 1635 return err 1636 } 1637 agfrs.Location = &location 1638 } 1639 case "tags": 1640 if v != nil { 1641 var tags map[string]*string 1642 err = json.Unmarshal(*v, &tags) 1643 if err != nil { 1644 return err 1645 } 1646 agfrs.Tags = tags 1647 } 1648 } 1649 } 1650 1651 return nil 1652} 1653 1654// ApplicationGatewayFirewallRuleSetPropertiesFormat properties of the web application firewall rule set. 1655type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { 1656 // ProvisioningState - The provisioning state of the web application firewall rule set. 1657 ProvisioningState *string `json:"provisioningState,omitempty"` 1658 // RuleSetType - The type of the web application firewall rule set. 1659 RuleSetType *string `json:"ruleSetType,omitempty"` 1660 // RuleSetVersion - The version of the web application firewall rule set type. 1661 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 1662 // RuleGroups - The rule groups of the web application firewall rule set. 1663 RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` 1664} 1665 1666// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. 1667type ApplicationGatewayFrontendIPConfiguration struct { 1668 *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` 1669 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1670 Name *string `json:"name,omitempty"` 1671 // Etag - A unique read-only string that changes whenever the resource is updated. 1672 Etag *string `json:"etag,omitempty"` 1673 // ID - Resource ID. 1674 ID *string `json:"id,omitempty"` 1675} 1676 1677// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. 1678func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { 1679 objectMap := make(map[string]interface{}) 1680 if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { 1681 objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat 1682 } 1683 if agfic.Name != nil { 1684 objectMap["name"] = agfic.Name 1685 } 1686 if agfic.Etag != nil { 1687 objectMap["etag"] = agfic.Etag 1688 } 1689 if agfic.ID != nil { 1690 objectMap["id"] = agfic.ID 1691 } 1692 return json.Marshal(objectMap) 1693} 1694 1695// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. 1696func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { 1697 var m map[string]*json.RawMessage 1698 err := json.Unmarshal(body, &m) 1699 if err != nil { 1700 return err 1701 } 1702 for k, v := range m { 1703 switch k { 1704 case "properties": 1705 if v != nil { 1706 var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat 1707 err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) 1708 if err != nil { 1709 return err 1710 } 1711 agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat 1712 } 1713 case "name": 1714 if v != nil { 1715 var name string 1716 err = json.Unmarshal(*v, &name) 1717 if err != nil { 1718 return err 1719 } 1720 agfic.Name = &name 1721 } 1722 case "etag": 1723 if v != nil { 1724 var etag string 1725 err = json.Unmarshal(*v, &etag) 1726 if err != nil { 1727 return err 1728 } 1729 agfic.Etag = &etag 1730 } 1731 case "id": 1732 if v != nil { 1733 var ID string 1734 err = json.Unmarshal(*v, &ID) 1735 if err != nil { 1736 return err 1737 } 1738 agfic.ID = &ID 1739 } 1740 } 1741 } 1742 1743 return nil 1744} 1745 1746// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an 1747// application gateway. 1748type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { 1749 // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. 1750 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 1751 // PrivateIPAllocationMethod - PrivateIP allocation method. Possible values include: 'Static', 'Dynamic' 1752 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 1753 // Subnet - Reference of the subnet resource. 1754 Subnet *SubResource `json:"subnet,omitempty"` 1755 // PublicIPAddress - Reference of the PublicIP resource. 1756 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 1757 // ProvisioningState - Provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1758 ProvisioningState *string `json:"provisioningState,omitempty"` 1759} 1760 1761// ApplicationGatewayFrontendPort frontend port of an application gateway. 1762type ApplicationGatewayFrontendPort struct { 1763 *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` 1764 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1765 Name *string `json:"name,omitempty"` 1766 // Etag - A unique read-only string that changes whenever the resource is updated. 1767 Etag *string `json:"etag,omitempty"` 1768 // ID - Resource ID. 1769 ID *string `json:"id,omitempty"` 1770} 1771 1772// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. 1773func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { 1774 objectMap := make(map[string]interface{}) 1775 if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { 1776 objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat 1777 } 1778 if agfp.Name != nil { 1779 objectMap["name"] = agfp.Name 1780 } 1781 if agfp.Etag != nil { 1782 objectMap["etag"] = agfp.Etag 1783 } 1784 if agfp.ID != nil { 1785 objectMap["id"] = agfp.ID 1786 } 1787 return json.Marshal(objectMap) 1788} 1789 1790// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. 1791func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { 1792 var m map[string]*json.RawMessage 1793 err := json.Unmarshal(body, &m) 1794 if err != nil { 1795 return err 1796 } 1797 for k, v := range m { 1798 switch k { 1799 case "properties": 1800 if v != nil { 1801 var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat 1802 err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) 1803 if err != nil { 1804 return err 1805 } 1806 agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat 1807 } 1808 case "name": 1809 if v != nil { 1810 var name string 1811 err = json.Unmarshal(*v, &name) 1812 if err != nil { 1813 return err 1814 } 1815 agfp.Name = &name 1816 } 1817 case "etag": 1818 if v != nil { 1819 var etag string 1820 err = json.Unmarshal(*v, &etag) 1821 if err != nil { 1822 return err 1823 } 1824 agfp.Etag = &etag 1825 } 1826 case "id": 1827 if v != nil { 1828 var ID string 1829 err = json.Unmarshal(*v, &ID) 1830 if err != nil { 1831 return err 1832 } 1833 agfp.ID = &ID 1834 } 1835 } 1836 } 1837 1838 return nil 1839} 1840 1841// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway. 1842type ApplicationGatewayFrontendPortPropertiesFormat struct { 1843 // Port - Frontend port 1844 Port *int32 `json:"port,omitempty"` 1845 // ProvisioningState - Provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1846 ProvisioningState *string `json:"provisioningState,omitempty"` 1847} 1848 1849// ApplicationGatewayHTTPListener http listener of an application gateway. 1850type ApplicationGatewayHTTPListener struct { 1851 *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` 1852 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1853 Name *string `json:"name,omitempty"` 1854 // Etag - A unique read-only string that changes whenever the resource is updated. 1855 Etag *string `json:"etag,omitempty"` 1856 // ID - Resource ID. 1857 ID *string `json:"id,omitempty"` 1858} 1859 1860// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. 1861func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { 1862 objectMap := make(map[string]interface{}) 1863 if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { 1864 objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat 1865 } 1866 if aghl.Name != nil { 1867 objectMap["name"] = aghl.Name 1868 } 1869 if aghl.Etag != nil { 1870 objectMap["etag"] = aghl.Etag 1871 } 1872 if aghl.ID != nil { 1873 objectMap["id"] = aghl.ID 1874 } 1875 return json.Marshal(objectMap) 1876} 1877 1878// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. 1879func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { 1880 var m map[string]*json.RawMessage 1881 err := json.Unmarshal(body, &m) 1882 if err != nil { 1883 return err 1884 } 1885 for k, v := range m { 1886 switch k { 1887 case "properties": 1888 if v != nil { 1889 var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat 1890 err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) 1891 if err != nil { 1892 return err 1893 } 1894 aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat 1895 } 1896 case "name": 1897 if v != nil { 1898 var name string 1899 err = json.Unmarshal(*v, &name) 1900 if err != nil { 1901 return err 1902 } 1903 aghl.Name = &name 1904 } 1905 case "etag": 1906 if v != nil { 1907 var etag string 1908 err = json.Unmarshal(*v, &etag) 1909 if err != nil { 1910 return err 1911 } 1912 aghl.Etag = &etag 1913 } 1914 case "id": 1915 if v != nil { 1916 var ID string 1917 err = json.Unmarshal(*v, &ID) 1918 if err != nil { 1919 return err 1920 } 1921 aghl.ID = &ID 1922 } 1923 } 1924 } 1925 1926 return nil 1927} 1928 1929// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway. 1930type ApplicationGatewayHTTPListenerPropertiesFormat struct { 1931 // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. 1932 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 1933 // FrontendPort - Frontend port resource of an application gateway. 1934 FrontendPort *SubResource `json:"frontendPort,omitempty"` 1935 // Protocol - Protocol. Possible values include: 'HTTP', 'HTTPS' 1936 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 1937 // HostName - Host name of HTTP listener. 1938 HostName *string `json:"hostName,omitempty"` 1939 // SslCertificate - SSL certificate resource of an application gateway. 1940 SslCertificate *SubResource `json:"sslCertificate,omitempty"` 1941 // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. 1942 RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` 1943 // ProvisioningState - Provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 1944 ProvisioningState *string `json:"provisioningState,omitempty"` 1945} 1946 1947// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 private 1948// IP configuration is allowed. 1949type ApplicationGatewayIPConfiguration struct { 1950 *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 1951 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 1952 Name *string `json:"name,omitempty"` 1953 // Etag - A unique read-only string that changes whenever the resource is updated. 1954 Etag *string `json:"etag,omitempty"` 1955 // ID - Resource ID. 1956 ID *string `json:"id,omitempty"` 1957} 1958 1959// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. 1960func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 1961 objectMap := make(map[string]interface{}) 1962 if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { 1963 objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat 1964 } 1965 if agic.Name != nil { 1966 objectMap["name"] = agic.Name 1967 } 1968 if agic.Etag != nil { 1969 objectMap["etag"] = agic.Etag 1970 } 1971 if agic.ID != nil { 1972 objectMap["id"] = agic.ID 1973 } 1974 return json.Marshal(objectMap) 1975} 1976 1977// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct. 1978func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 1979 var m map[string]*json.RawMessage 1980 err := json.Unmarshal(body, &m) 1981 if err != nil { 1982 return err 1983 } 1984 for k, v := range m { 1985 switch k { 1986 case "properties": 1987 if v != nil { 1988 var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat 1989 err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat) 1990 if err != nil { 1991 return err 1992 } 1993 agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat 1994 } 1995 case "name": 1996 if v != nil { 1997 var name string 1998 err = json.Unmarshal(*v, &name) 1999 if err != nil { 2000 return err 2001 } 2002 agic.Name = &name 2003 } 2004 case "etag": 2005 if v != nil { 2006 var etag string 2007 err = json.Unmarshal(*v, &etag) 2008 if err != nil { 2009 return err 2010 } 2011 agic.Etag = &etag 2012 } 2013 case "id": 2014 if v != nil { 2015 var ID string 2016 err = json.Unmarshal(*v, &ID) 2017 if err != nil { 2018 return err 2019 } 2020 agic.ID = &ID 2021 } 2022 } 2023 } 2024 2025 return nil 2026} 2027 2028// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application gateway. 2029type ApplicationGatewayIPConfigurationPropertiesFormat struct { 2030 // Subnet - Reference of the subnet resource. A subnet from where application gateway gets its private address. 2031 Subnet *SubResource `json:"subnet,omitempty"` 2032 // ProvisioningState - Provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2033 ProvisioningState *string `json:"provisioningState,omitempty"` 2034} 2035 2036// ApplicationGatewayListResult response for ListApplicationGateways API service call. 2037type ApplicationGatewayListResult struct { 2038 autorest.Response `json:"-"` 2039 // Value - List of an application gateways in a resource group. 2040 Value *[]ApplicationGateway `json:"value,omitempty"` 2041 // NextLink - URL to get the next set of results. 2042 NextLink *string `json:"nextLink,omitempty"` 2043} 2044 2045// ApplicationGatewayListResultIterator provides access to a complete listing of ApplicationGateway values. 2046type ApplicationGatewayListResultIterator struct { 2047 i int 2048 page ApplicationGatewayListResultPage 2049} 2050 2051// Next advances to the next value. If there was an error making 2052// the request the iterator does not advance and the error is returned. 2053func (iter *ApplicationGatewayListResultIterator) Next() error { 2054 iter.i++ 2055 if iter.i < len(iter.page.Values()) { 2056 return nil 2057 } 2058 err := iter.page.Next() 2059 if err != nil { 2060 iter.i-- 2061 return err 2062 } 2063 iter.i = 0 2064 return nil 2065} 2066 2067// NotDone returns true if the enumeration should be started or is not yet complete. 2068func (iter ApplicationGatewayListResultIterator) NotDone() bool { 2069 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2070} 2071 2072// Response returns the raw server response from the last page request. 2073func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult { 2074 return iter.page.Response() 2075} 2076 2077// Value returns the current value or a zero-initialized value if the 2078// iterator has advanced beyond the end of the collection. 2079func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway { 2080 if !iter.page.NotDone() { 2081 return ApplicationGateway{} 2082 } 2083 return iter.page.Values()[iter.i] 2084} 2085 2086// IsEmpty returns true if the ListResult contains no values. 2087func (aglr ApplicationGatewayListResult) IsEmpty() bool { 2088 return aglr.Value == nil || len(*aglr.Value) == 0 2089} 2090 2091// applicationGatewayListResultPreparer prepares a request to retrieve the next set of results. 2092// It returns nil if no more results exist. 2093func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer() (*http.Request, error) { 2094 if aglr.NextLink == nil || len(to.String(aglr.NextLink)) < 1 { 2095 return nil, nil 2096 } 2097 return autorest.Prepare(&http.Request{}, 2098 autorest.AsJSON(), 2099 autorest.AsGet(), 2100 autorest.WithBaseURL(to.String(aglr.NextLink))) 2101} 2102 2103// ApplicationGatewayListResultPage contains a page of ApplicationGateway values. 2104type ApplicationGatewayListResultPage struct { 2105 fn func(ApplicationGatewayListResult) (ApplicationGatewayListResult, error) 2106 aglr ApplicationGatewayListResult 2107} 2108 2109// Next advances to the next page of values. If there was an error making 2110// the request the page does not advance and the error is returned. 2111func (page *ApplicationGatewayListResultPage) Next() error { 2112 next, err := page.fn(page.aglr) 2113 if err != nil { 2114 return err 2115 } 2116 page.aglr = next 2117 return nil 2118} 2119 2120// NotDone returns true if the page enumeration should be started or is not yet complete. 2121func (page ApplicationGatewayListResultPage) NotDone() bool { 2122 return !page.aglr.IsEmpty() 2123} 2124 2125// Response returns the raw server response from the last page request. 2126func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult { 2127 return page.aglr 2128} 2129 2130// Values returns the slice of values for the current page or nil if there are no values. 2131func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway { 2132 if page.aglr.IsEmpty() { 2133 return nil 2134 } 2135 return *page.aglr.Value 2136} 2137 2138// ApplicationGatewayPathRule path rule of URL path map of an application gateway. 2139type ApplicationGatewayPathRule struct { 2140 *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` 2141 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 2142 Name *string `json:"name,omitempty"` 2143 // Etag - A unique read-only string that changes whenever the resource is updated. 2144 Etag *string `json:"etag,omitempty"` 2145 // ID - Resource ID. 2146 ID *string `json:"id,omitempty"` 2147} 2148 2149// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule. 2150func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) { 2151 objectMap := make(map[string]interface{}) 2152 if agpr.ApplicationGatewayPathRulePropertiesFormat != nil { 2153 objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat 2154 } 2155 if agpr.Name != nil { 2156 objectMap["name"] = agpr.Name 2157 } 2158 if agpr.Etag != nil { 2159 objectMap["etag"] = agpr.Etag 2160 } 2161 if agpr.ID != nil { 2162 objectMap["id"] = agpr.ID 2163 } 2164 return json.Marshal(objectMap) 2165} 2166 2167// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct. 2168func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error { 2169 var m map[string]*json.RawMessage 2170 err := json.Unmarshal(body, &m) 2171 if err != nil { 2172 return err 2173 } 2174 for k, v := range m { 2175 switch k { 2176 case "properties": 2177 if v != nil { 2178 var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat 2179 err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat) 2180 if err != nil { 2181 return err 2182 } 2183 agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat 2184 } 2185 case "name": 2186 if v != nil { 2187 var name string 2188 err = json.Unmarshal(*v, &name) 2189 if err != nil { 2190 return err 2191 } 2192 agpr.Name = &name 2193 } 2194 case "etag": 2195 if v != nil { 2196 var etag string 2197 err = json.Unmarshal(*v, &etag) 2198 if err != nil { 2199 return err 2200 } 2201 agpr.Etag = &etag 2202 } 2203 case "id": 2204 if v != nil { 2205 var ID string 2206 err = json.Unmarshal(*v, &ID) 2207 if err != nil { 2208 return err 2209 } 2210 agpr.ID = &ID 2211 } 2212 } 2213 } 2214 2215 return nil 2216} 2217 2218// ApplicationGatewayPathRulePropertiesFormat properties of probe of an application gateway. 2219type ApplicationGatewayPathRulePropertiesFormat struct { 2220 // Paths - Path rules of URL path map. 2221 Paths *[]string `json:"paths,omitempty"` 2222 // BackendAddressPool - Backend address pool resource of URL path map. 2223 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 2224 // BackendHTTPSettings - Backend http settings resource of URL path map. 2225 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 2226 // ProvisioningState - Path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2227 ProvisioningState *string `json:"provisioningState,omitempty"` 2228} 2229 2230// ApplicationGatewayProbe probe of the application gateway. 2231type ApplicationGatewayProbe struct { 2232 *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` 2233 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 2234 Name *string `json:"name,omitempty"` 2235 // Etag - A unique read-only string that changes whenever the resource is updated. 2236 Etag *string `json:"etag,omitempty"` 2237 // ID - Resource ID. 2238 ID *string `json:"id,omitempty"` 2239} 2240 2241// MarshalJSON is the custom marshaler for ApplicationGatewayProbe. 2242func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) { 2243 objectMap := make(map[string]interface{}) 2244 if agp.ApplicationGatewayProbePropertiesFormat != nil { 2245 objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat 2246 } 2247 if agp.Name != nil { 2248 objectMap["name"] = agp.Name 2249 } 2250 if agp.Etag != nil { 2251 objectMap["etag"] = agp.Etag 2252 } 2253 if agp.ID != nil { 2254 objectMap["id"] = agp.ID 2255 } 2256 return json.Marshal(objectMap) 2257} 2258 2259// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct. 2260func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error { 2261 var m map[string]*json.RawMessage 2262 err := json.Unmarshal(body, &m) 2263 if err != nil { 2264 return err 2265 } 2266 for k, v := range m { 2267 switch k { 2268 case "properties": 2269 if v != nil { 2270 var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat 2271 err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat) 2272 if err != nil { 2273 return err 2274 } 2275 agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat 2276 } 2277 case "name": 2278 if v != nil { 2279 var name string 2280 err = json.Unmarshal(*v, &name) 2281 if err != nil { 2282 return err 2283 } 2284 agp.Name = &name 2285 } 2286 case "etag": 2287 if v != nil { 2288 var etag string 2289 err = json.Unmarshal(*v, &etag) 2290 if err != nil { 2291 return err 2292 } 2293 agp.Etag = &etag 2294 } 2295 case "id": 2296 if v != nil { 2297 var ID string 2298 err = json.Unmarshal(*v, &ID) 2299 if err != nil { 2300 return err 2301 } 2302 agp.ID = &ID 2303 } 2304 } 2305 } 2306 2307 return nil 2308} 2309 2310// ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. 2311type ApplicationGatewayProbePropertiesFormat struct { 2312 // Protocol - Protocol. Possible values include: 'HTTP', 'HTTPS' 2313 Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` 2314 // Host - Host name to send the probe to. 2315 Host *string `json:"host,omitempty"` 2316 // Path - Relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path> 2317 Path *string `json:"path,omitempty"` 2318 // Interval - The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds. 2319 Interval *int32 `json:"interval,omitempty"` 2320 // 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. 2321 Timeout *int32 `json:"timeout,omitempty"` 2322 // 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. 2323 UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` 2324 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2325 ProvisioningState *string `json:"provisioningState,omitempty"` 2326} 2327 2328// ApplicationGatewayPropertiesFormat properties of the application gateway. 2329type ApplicationGatewayPropertiesFormat struct { 2330 // Sku - SKU of the application gateway resource. 2331 Sku *ApplicationGatewaySku `json:"sku,omitempty"` 2332 // SslPolicy - SSL policy of the application gateway resource. 2333 SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` 2334 // OperationalState - Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' 2335 OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` 2336 // GatewayIPConfigurations - Subnets of application the gateway resource. 2337 GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` 2338 // AuthenticationCertificates - Authentication certificates of the application gateway resource. 2339 AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` 2340 // SslCertificates - SSL certificates of the application gateway resource. 2341 SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` 2342 // FrontendIPConfigurations - Frontend IP addresses of the application gateway resource. 2343 FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 2344 // FrontendPorts - Frontend ports of the application gateway resource. 2345 FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` 2346 // Probes - Probes of the application gateway resource. 2347 Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` 2348 // BackendAddressPools - Backend address pool of the application gateway resource. 2349 BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` 2350 // BackendHTTPSettingsCollection - Backend http settings of the application gateway resource. 2351 BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` 2352 // HTTPListeners - Http listeners of the application gateway resource. 2353 HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` 2354 // URLPathMaps - URL path map of the application gateway resource. 2355 URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` 2356 // RequestRoutingRules - Request routing rules of the application gateway resource. 2357 RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` 2358 // WebApplicationFirewallConfiguration - Web application firewall configuration. 2359 WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` 2360 // ResourceGUID - Resource GUID property of the application gateway resource. 2361 ResourceGUID *string `json:"resourceGuid,omitempty"` 2362 // ProvisioningState - Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2363 ProvisioningState *string `json:"provisioningState,omitempty"` 2364} 2365 2366// ApplicationGatewayRequestRoutingRule request routing rule of an application gateway. 2367type ApplicationGatewayRequestRoutingRule struct { 2368 *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` 2369 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 2370 Name *string `json:"name,omitempty"` 2371 // Etag - A unique read-only string that changes whenever the resource is updated. 2372 Etag *string `json:"etag,omitempty"` 2373 // ID - Resource ID. 2374 ID *string `json:"id,omitempty"` 2375} 2376 2377// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule. 2378func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) { 2379 objectMap := make(map[string]interface{}) 2380 if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil { 2381 objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat 2382 } 2383 if agrrr.Name != nil { 2384 objectMap["name"] = agrrr.Name 2385 } 2386 if agrrr.Etag != nil { 2387 objectMap["etag"] = agrrr.Etag 2388 } 2389 if agrrr.ID != nil { 2390 objectMap["id"] = agrrr.ID 2391 } 2392 return json.Marshal(objectMap) 2393} 2394 2395// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct. 2396func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error { 2397 var m map[string]*json.RawMessage 2398 err := json.Unmarshal(body, &m) 2399 if err != nil { 2400 return err 2401 } 2402 for k, v := range m { 2403 switch k { 2404 case "properties": 2405 if v != nil { 2406 var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat 2407 err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat) 2408 if err != nil { 2409 return err 2410 } 2411 agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat 2412 } 2413 case "name": 2414 if v != nil { 2415 var name string 2416 err = json.Unmarshal(*v, &name) 2417 if err != nil { 2418 return err 2419 } 2420 agrrr.Name = &name 2421 } 2422 case "etag": 2423 if v != nil { 2424 var etag string 2425 err = json.Unmarshal(*v, &etag) 2426 if err != nil { 2427 return err 2428 } 2429 agrrr.Etag = &etag 2430 } 2431 case "id": 2432 if v != nil { 2433 var ID string 2434 err = json.Unmarshal(*v, &ID) 2435 if err != nil { 2436 return err 2437 } 2438 agrrr.ID = &ID 2439 } 2440 } 2441 } 2442 2443 return nil 2444} 2445 2446// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the application 2447// gateway. 2448type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { 2449 // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' 2450 RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` 2451 // BackendAddressPool - Backend address pool resource of the application gateway. 2452 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 2453 // BackendHTTPSettings - Frontend port resource of the application gateway. 2454 BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` 2455 // HTTPListener - Http listener resource of the application gateway. 2456 HTTPListener *SubResource `json:"httpListener,omitempty"` 2457 // URLPathMap - URL path map resource of the application gateway. 2458 URLPathMap *SubResource `json:"urlPathMap,omitempty"` 2459 // ProvisioningState - Provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2460 ProvisioningState *string `json:"provisioningState,omitempty"` 2461} 2462 2463// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a 2464// long-running operation. 2465type ApplicationGatewaysBackendHealthFuture struct { 2466 azure.Future 2467 req *http.Request 2468} 2469 2470// Result returns the result of the asynchronous operation. 2471// If the operation has not completed it will return an error. 2472func (future ApplicationGatewaysBackendHealthFuture) Result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) { 2473 var done bool 2474 done, err = future.Done(client) 2475 if err != nil { 2476 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure") 2477 return 2478 } 2479 if !done { 2480 return agbh, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture") 2481 } 2482 if future.PollingMethod() == azure.PollingLocation { 2483 agbh, err = client.BackendHealthResponder(future.Response()) 2484 if err != nil { 2485 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Failure responding to request") 2486 } 2487 return 2488 } 2489 var req *http.Request 2490 var resp *http.Response 2491 if future.PollingURL() != "" { 2492 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 2493 if err != nil { 2494 return 2495 } 2496 } else { 2497 req = autorest.ChangeToGet(future.req) 2498 } 2499 resp, err = autorest.SendWithSender(client, req, 2500 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2501 if err != nil { 2502 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", resp, "Failure sending request") 2503 return 2504 } 2505 agbh, err = client.BackendHealthResponder(resp) 2506 if err != nil { 2507 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", resp, "Failure responding to request") 2508 } 2509 return 2510} 2511 2512// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 2513// long-running operation. 2514type ApplicationGatewaysCreateOrUpdateFuture struct { 2515 azure.Future 2516 req *http.Request 2517} 2518 2519// Result returns the result of the asynchronous operation. 2520// If the operation has not completed it will return an error. 2521func (future ApplicationGatewaysCreateOrUpdateFuture) Result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) { 2522 var done bool 2523 done, err = future.Done(client) 2524 if err != nil { 2525 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 2526 return 2527 } 2528 if !done { 2529 return ag, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture") 2530 } 2531 if future.PollingMethod() == azure.PollingLocation { 2532 ag, err = client.CreateOrUpdateResponder(future.Response()) 2533 if err != nil { 2534 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 2535 } 2536 return 2537 } 2538 var req *http.Request 2539 var resp *http.Response 2540 if future.PollingURL() != "" { 2541 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 2542 if err != nil { 2543 return 2544 } 2545 } else { 2546 req = autorest.ChangeToGet(future.req) 2547 } 2548 resp, err = autorest.SendWithSender(client, req, 2549 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2550 if err != nil { 2551 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", resp, "Failure sending request") 2552 return 2553 } 2554 ag, err = client.CreateOrUpdateResponder(resp) 2555 if err != nil { 2556 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 2557 } 2558 return 2559} 2560 2561// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2562// operation. 2563type ApplicationGatewaysDeleteFuture struct { 2564 azure.Future 2565 req *http.Request 2566} 2567 2568// Result returns the result of the asynchronous operation. 2569// If the operation has not completed it will return an error. 2570func (future ApplicationGatewaysDeleteFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 2571 var done bool 2572 done, err = future.Done(client) 2573 if err != nil { 2574 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 2575 return 2576 } 2577 if !done { 2578 return ar, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture") 2579 } 2580 if future.PollingMethod() == azure.PollingLocation { 2581 ar, err = client.DeleteResponder(future.Response()) 2582 if err != nil { 2583 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Failure responding to request") 2584 } 2585 return 2586 } 2587 var req *http.Request 2588 var resp *http.Response 2589 if future.PollingURL() != "" { 2590 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 2591 if err != nil { 2592 return 2593 } 2594 } else { 2595 req = autorest.ChangeToGet(future.req) 2596 } 2597 resp, err = autorest.SendWithSender(client, req, 2598 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2599 if err != nil { 2600 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", resp, "Failure sending request") 2601 return 2602 } 2603 ar, err = client.DeleteResponder(resp) 2604 if err != nil { 2605 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", resp, "Failure responding to request") 2606 } 2607 return 2608} 2609 2610// ApplicationGatewaySku SKU of an application gateway 2611type ApplicationGatewaySku struct { 2612 // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge' 2613 Name ApplicationGatewaySkuName `json:"name,omitempty"` 2614 // Tier - Tier of an application gateway. Possible values include: 'Standard', 'WAF' 2615 Tier ApplicationGatewayTier `json:"tier,omitempty"` 2616 // Capacity - Capacity (instance count) of an application gateway. 2617 Capacity *int32 `json:"capacity,omitempty"` 2618} 2619 2620// ApplicationGatewaySslCertificate SSL certificates of an application gateway. 2621type ApplicationGatewaySslCertificate struct { 2622 *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` 2623 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 2624 Name *string `json:"name,omitempty"` 2625 // Etag - A unique read-only string that changes whenever the resource is updated. 2626 Etag *string `json:"etag,omitempty"` 2627 // ID - Resource ID. 2628 ID *string `json:"id,omitempty"` 2629} 2630 2631// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate. 2632func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) { 2633 objectMap := make(map[string]interface{}) 2634 if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil { 2635 objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat 2636 } 2637 if agsc.Name != nil { 2638 objectMap["name"] = agsc.Name 2639 } 2640 if agsc.Etag != nil { 2641 objectMap["etag"] = agsc.Etag 2642 } 2643 if agsc.ID != nil { 2644 objectMap["id"] = agsc.ID 2645 } 2646 return json.Marshal(objectMap) 2647} 2648 2649// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct. 2650func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error { 2651 var m map[string]*json.RawMessage 2652 err := json.Unmarshal(body, &m) 2653 if err != nil { 2654 return err 2655 } 2656 for k, v := range m { 2657 switch k { 2658 case "properties": 2659 if v != nil { 2660 var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat 2661 err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat) 2662 if err != nil { 2663 return err 2664 } 2665 agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat 2666 } 2667 case "name": 2668 if v != nil { 2669 var name string 2670 err = json.Unmarshal(*v, &name) 2671 if err != nil { 2672 return err 2673 } 2674 agsc.Name = &name 2675 } 2676 case "etag": 2677 if v != nil { 2678 var etag string 2679 err = json.Unmarshal(*v, &etag) 2680 if err != nil { 2681 return err 2682 } 2683 agsc.Etag = &etag 2684 } 2685 case "id": 2686 if v != nil { 2687 var ID string 2688 err = json.Unmarshal(*v, &ID) 2689 if err != nil { 2690 return err 2691 } 2692 agsc.ID = &ID 2693 } 2694 } 2695 } 2696 2697 return nil 2698} 2699 2700// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application gateway. 2701type ApplicationGatewaySslCertificatePropertiesFormat struct { 2702 // Data - Base-64 encoded pfx certificate. Only applicable in PUT Request. 2703 Data *string `json:"data,omitempty"` 2704 // Password - Password for the pfx file specified in data. Only applicable in PUT request. 2705 Password *string `json:"password,omitempty"` 2706 // PublicCertData - Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request. 2707 PublicCertData *string `json:"publicCertData,omitempty"` 2708 // ProvisioningState - Provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'. 2709 ProvisioningState *string `json:"provisioningState,omitempty"` 2710} 2711 2712// ApplicationGatewaySslPolicy application gateway SSL policy. 2713type ApplicationGatewaySslPolicy struct { 2714 // DisabledSslProtocols - SSL protocols to be disabled on application gateway. 2715 DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` 2716} 2717 2718// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a long-running 2719// operation. 2720type ApplicationGatewaysStartFuture struct { 2721 azure.Future 2722 req *http.Request 2723} 2724 2725// Result returns the result of the asynchronous operation. 2726// If the operation has not completed it will return an error. 2727func (future ApplicationGatewaysStartFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 2728 var done bool 2729 done, err = future.Done(client) 2730 if err != nil { 2731 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure") 2732 return 2733 } 2734 if !done { 2735 return ar, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture") 2736 } 2737 if future.PollingMethod() == azure.PollingLocation { 2738 ar, err = client.StartResponder(future.Response()) 2739 if err != nil { 2740 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Failure responding to request") 2741 } 2742 return 2743 } 2744 var req *http.Request 2745 var resp *http.Response 2746 if future.PollingURL() != "" { 2747 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 2748 if err != nil { 2749 return 2750 } 2751 } else { 2752 req = autorest.ChangeToGet(future.req) 2753 } 2754 resp, err = autorest.SendWithSender(client, req, 2755 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2756 if err != nil { 2757 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", resp, "Failure sending request") 2758 return 2759 } 2760 ar, err = client.StartResponder(resp) 2761 if err != nil { 2762 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", resp, "Failure responding to request") 2763 } 2764 return 2765} 2766 2767// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running 2768// operation. 2769type ApplicationGatewaysStopFuture struct { 2770 azure.Future 2771 req *http.Request 2772} 2773 2774// Result returns the result of the asynchronous operation. 2775// If the operation has not completed it will return an error. 2776func (future ApplicationGatewaysStopFuture) Result(client ApplicationGatewaysClient) (ar autorest.Response, err error) { 2777 var done bool 2778 done, err = future.Done(client) 2779 if err != nil { 2780 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure") 2781 return 2782 } 2783 if !done { 2784 return ar, azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture") 2785 } 2786 if future.PollingMethod() == azure.PollingLocation { 2787 ar, err = client.StopResponder(future.Response()) 2788 if err != nil { 2789 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Failure responding to request") 2790 } 2791 return 2792 } 2793 var req *http.Request 2794 var resp *http.Response 2795 if future.PollingURL() != "" { 2796 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 2797 if err != nil { 2798 return 2799 } 2800 } else { 2801 req = autorest.ChangeToGet(future.req) 2802 } 2803 resp, err = autorest.SendWithSender(client, req, 2804 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2805 if err != nil { 2806 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", resp, "Failure sending request") 2807 return 2808 } 2809 ar, err = client.StopResponder(resp) 2810 if err != nil { 2811 err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", resp, "Failure responding to request") 2812 } 2813 return 2814} 2815 2816// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for 2817// PathBasedRouting. 2818type ApplicationGatewayURLPathMap struct { 2819 *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` 2820 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 2821 Name *string `json:"name,omitempty"` 2822 // Etag - A unique read-only string that changes whenever the resource is updated. 2823 Etag *string `json:"etag,omitempty"` 2824 // ID - Resource ID. 2825 ID *string `json:"id,omitempty"` 2826} 2827 2828// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap. 2829func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) { 2830 objectMap := make(map[string]interface{}) 2831 if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil { 2832 objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat 2833 } 2834 if agupm.Name != nil { 2835 objectMap["name"] = agupm.Name 2836 } 2837 if agupm.Etag != nil { 2838 objectMap["etag"] = agupm.Etag 2839 } 2840 if agupm.ID != nil { 2841 objectMap["id"] = agupm.ID 2842 } 2843 return json.Marshal(objectMap) 2844} 2845 2846// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct. 2847func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error { 2848 var m map[string]*json.RawMessage 2849 err := json.Unmarshal(body, &m) 2850 if err != nil { 2851 return err 2852 } 2853 for k, v := range m { 2854 switch k { 2855 case "properties": 2856 if v != nil { 2857 var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat 2858 err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat) 2859 if err != nil { 2860 return err 2861 } 2862 agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat 2863 } 2864 case "name": 2865 if v != nil { 2866 var name string 2867 err = json.Unmarshal(*v, &name) 2868 if err != nil { 2869 return err 2870 } 2871 agupm.Name = &name 2872 } 2873 case "etag": 2874 if v != nil { 2875 var etag string 2876 err = json.Unmarshal(*v, &etag) 2877 if err != nil { 2878 return err 2879 } 2880 agupm.Etag = &etag 2881 } 2882 case "id": 2883 if v != nil { 2884 var ID string 2885 err = json.Unmarshal(*v, &ID) 2886 if err != nil { 2887 return err 2888 } 2889 agupm.ID = &ID 2890 } 2891 } 2892 } 2893 2894 return nil 2895} 2896 2897// ApplicationGatewayURLPathMapPropertiesFormat properties of UrlPathMap of the application gateway. 2898type ApplicationGatewayURLPathMapPropertiesFormat struct { 2899 // DefaultBackendAddressPool - Default backend address pool resource of URL path map. 2900 DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` 2901 // DefaultBackendHTTPSettings - Default backend http settings resource of URL path map. 2902 DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` 2903 // PathRules - Path rule of URL path map resource. 2904 PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` 2905 // ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 2906 ProvisioningState *string `json:"provisioningState,omitempty"` 2907} 2908 2909// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall 2910// configuration. 2911type ApplicationGatewayWebApplicationFirewallConfiguration struct { 2912 // Enabled - Whether the web application firewall is enabled or not. 2913 Enabled *bool `json:"enabled,omitempty"` 2914 // FirewallMode - Web application firewall mode. Possible values include: 'Detection', 'Prevention' 2915 FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` 2916 // RuleSetType - The type of the web application firewall rule set. Possible values are: 'OWASP'. 2917 RuleSetType *string `json:"ruleSetType,omitempty"` 2918 // RuleSetVersion - The version of the rule set type. 2919 RuleSetVersion *string `json:"ruleSetVersion,omitempty"` 2920 // DisabledRuleGroups - The disabled rule groups. 2921 DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` 2922} 2923 2924// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations that 2925// belongs to an ExpressRouteCircuit. 2926type AuthorizationListResult struct { 2927 autorest.Response `json:"-"` 2928 // Value - The authorizations in an ExpressRoute Circuit. 2929 Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` 2930 // NextLink - The URL to get the next set of results. 2931 NextLink *string `json:"nextLink,omitempty"` 2932} 2933 2934// AuthorizationListResultIterator provides access to a complete listing of ExpressRouteCircuitAuthorization 2935// values. 2936type AuthorizationListResultIterator struct { 2937 i int 2938 page AuthorizationListResultPage 2939} 2940 2941// Next advances to the next value. If there was an error making 2942// the request the iterator does not advance and the error is returned. 2943func (iter *AuthorizationListResultIterator) Next() error { 2944 iter.i++ 2945 if iter.i < len(iter.page.Values()) { 2946 return nil 2947 } 2948 err := iter.page.Next() 2949 if err != nil { 2950 iter.i-- 2951 return err 2952 } 2953 iter.i = 0 2954 return nil 2955} 2956 2957// NotDone returns true if the enumeration should be started or is not yet complete. 2958func (iter AuthorizationListResultIterator) NotDone() bool { 2959 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2960} 2961 2962// Response returns the raw server response from the last page request. 2963func (iter AuthorizationListResultIterator) Response() AuthorizationListResult { 2964 return iter.page.Response() 2965} 2966 2967// Value returns the current value or a zero-initialized value if the 2968// iterator has advanced beyond the end of the collection. 2969func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization { 2970 if !iter.page.NotDone() { 2971 return ExpressRouteCircuitAuthorization{} 2972 } 2973 return iter.page.Values()[iter.i] 2974} 2975 2976// IsEmpty returns true if the ListResult contains no values. 2977func (alr AuthorizationListResult) IsEmpty() bool { 2978 return alr.Value == nil || len(*alr.Value) == 0 2979} 2980 2981// authorizationListResultPreparer prepares a request to retrieve the next set of results. 2982// It returns nil if no more results exist. 2983func (alr AuthorizationListResult) authorizationListResultPreparer() (*http.Request, error) { 2984 if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { 2985 return nil, nil 2986 } 2987 return autorest.Prepare(&http.Request{}, 2988 autorest.AsJSON(), 2989 autorest.AsGet(), 2990 autorest.WithBaseURL(to.String(alr.NextLink))) 2991} 2992 2993// AuthorizationListResultPage contains a page of ExpressRouteCircuitAuthorization values. 2994type AuthorizationListResultPage struct { 2995 fn func(AuthorizationListResult) (AuthorizationListResult, error) 2996 alr AuthorizationListResult 2997} 2998 2999// Next advances to the next page of values. If there was an error making 3000// the request the page does not advance and the error is returned. 3001func (page *AuthorizationListResultPage) Next() error { 3002 next, err := page.fn(page.alr) 3003 if err != nil { 3004 return err 3005 } 3006 page.alr = next 3007 return nil 3008} 3009 3010// NotDone returns true if the page enumeration should be started or is not yet complete. 3011func (page AuthorizationListResultPage) NotDone() bool { 3012 return !page.alr.IsEmpty() 3013} 3014 3015// Response returns the raw server response from the last page request. 3016func (page AuthorizationListResultPage) Response() AuthorizationListResult { 3017 return page.alr 3018} 3019 3020// Values returns the slice of values for the current page or nil if there are no values. 3021func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization { 3022 if page.alr.IsEmpty() { 3023 return nil 3024 } 3025 return *page.alr.Value 3026} 3027 3028// AuthorizationPropertiesFormat ... 3029type AuthorizationPropertiesFormat struct { 3030 // AuthorizationKey - The authorization key. 3031 AuthorizationKey *string `json:"authorizationKey,omitempty"` 3032 // AuthorizationUseStatus - AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse' 3033 AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` 3034 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 3035 ProvisioningState *string `json:"provisioningState,omitempty"` 3036} 3037 3038// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, 3039// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the 3040// HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation 3041// succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous 3042// operation failed, the response body includes the HTTP status code for the failed request and error information 3043// regarding the failure. 3044type AzureAsyncOperationResult struct { 3045 // Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed' 3046 Status OperationStatus `json:"status,omitempty"` 3047 Error *Error `json:"error,omitempty"` 3048} 3049 3050// BackendAddressPool pool of backend IP addresses. 3051type BackendAddressPool struct { 3052 *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` 3053 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 3054 Name *string `json:"name,omitempty"` 3055 // Etag - A unique read-only string that changes whenever the resource is updated. 3056 Etag *string `json:"etag,omitempty"` 3057 // ID - Resource ID. 3058 ID *string `json:"id,omitempty"` 3059} 3060 3061// MarshalJSON is the custom marshaler for BackendAddressPool. 3062func (bap BackendAddressPool) MarshalJSON() ([]byte, error) { 3063 objectMap := make(map[string]interface{}) 3064 if bap.BackendAddressPoolPropertiesFormat != nil { 3065 objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat 3066 } 3067 if bap.Name != nil { 3068 objectMap["name"] = bap.Name 3069 } 3070 if bap.Etag != nil { 3071 objectMap["etag"] = bap.Etag 3072 } 3073 if bap.ID != nil { 3074 objectMap["id"] = bap.ID 3075 } 3076 return json.Marshal(objectMap) 3077} 3078 3079// UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct. 3080func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error { 3081 var m map[string]*json.RawMessage 3082 err := json.Unmarshal(body, &m) 3083 if err != nil { 3084 return err 3085 } 3086 for k, v := range m { 3087 switch k { 3088 case "properties": 3089 if v != nil { 3090 var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat 3091 err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat) 3092 if err != nil { 3093 return err 3094 } 3095 bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat 3096 } 3097 case "name": 3098 if v != nil { 3099 var name string 3100 err = json.Unmarshal(*v, &name) 3101 if err != nil { 3102 return err 3103 } 3104 bap.Name = &name 3105 } 3106 case "etag": 3107 if v != nil { 3108 var etag string 3109 err = json.Unmarshal(*v, &etag) 3110 if err != nil { 3111 return err 3112 } 3113 bap.Etag = &etag 3114 } 3115 case "id": 3116 if v != nil { 3117 var ID string 3118 err = json.Unmarshal(*v, &ID) 3119 if err != nil { 3120 return err 3121 } 3122 bap.ID = &ID 3123 } 3124 } 3125 } 3126 3127 return nil 3128} 3129 3130// BackendAddressPoolPropertiesFormat properties of the backend address pool. 3131type BackendAddressPoolPropertiesFormat struct { 3132 // BackendIPConfigurations - Gets collection of references to IP addresses defined in network interfaces. 3133 BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` 3134 // LoadBalancingRules - Gets load balancing rules that use this backend address pool. 3135 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 3136 // OutboundNatRule - Gets outbound rules that use this backend address pool. 3137 OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"` 3138 // ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 3139 ProvisioningState *string `json:"provisioningState,omitempty"` 3140} 3141 3142// BGPCommunity contains bgp community information offered in Service Community resources. 3143type BGPCommunity struct { 3144 // ServiceSupportedRegion - The region which the service support. e.g. For O365, region is Global. 3145 ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` 3146 // CommunityName - The name of the bgp community. e.g. Skype. 3147 CommunityName *string `json:"communityName,omitempty"` 3148 // CommunityValue - The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. 3149 CommunityValue *string `json:"communityValue,omitempty"` 3150 // CommunityPrefixes - The prefixes that the bgp community contains. 3151 CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"` 3152} 3153 3154// BgpPeerStatus BGP peer status details 3155type BgpPeerStatus struct { 3156 // LocalAddress - The virtual network gateway's local address 3157 LocalAddress *string `json:"localAddress,omitempty"` 3158 // Neighbor - The remote BGP peer 3159 Neighbor *string `json:"neighbor,omitempty"` 3160 // Asn - The autonomous system number of the remote BGP peer 3161 Asn *int32 `json:"asn,omitempty"` 3162 // State - The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected' 3163 State BgpPeerState `json:"state,omitempty"` 3164 // ConnectedDuration - For how long the peering has been up 3165 ConnectedDuration *string `json:"connectedDuration,omitempty"` 3166 // RoutesReceived - The number of routes learned from this peer 3167 RoutesReceived *int64 `json:"routesReceived,omitempty"` 3168 // MessagesSent - The number of BGP messages sent 3169 MessagesSent *int64 `json:"messagesSent,omitempty"` 3170 // MessagesReceived - The number of BGP messages received 3171 MessagesReceived *int64 `json:"messagesReceived,omitempty"` 3172} 3173 3174// BgpPeerStatusListResult response for list BGP peer status API service call 3175type BgpPeerStatusListResult struct { 3176 autorest.Response `json:"-"` 3177 // Value - List of BGP peers 3178 Value *[]BgpPeerStatus `json:"value,omitempty"` 3179} 3180 3181// BgpServiceCommunity service Community Properties. 3182type BgpServiceCommunity struct { 3183 *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` 3184 // ID - Resource ID. 3185 ID *string `json:"id,omitempty"` 3186 // Name - Resource name. 3187 Name *string `json:"name,omitempty"` 3188 // Type - Resource type. 3189 Type *string `json:"type,omitempty"` 3190 // Location - Resource location. 3191 Location *string `json:"location,omitempty"` 3192 // Tags - Resource tags. 3193 Tags map[string]*string `json:"tags"` 3194} 3195 3196// MarshalJSON is the custom marshaler for BgpServiceCommunity. 3197func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) { 3198 objectMap := make(map[string]interface{}) 3199 if bsc.BgpServiceCommunityPropertiesFormat != nil { 3200 objectMap["properties"] = bsc.BgpServiceCommunityPropertiesFormat 3201 } 3202 if bsc.ID != nil { 3203 objectMap["id"] = bsc.ID 3204 } 3205 if bsc.Name != nil { 3206 objectMap["name"] = bsc.Name 3207 } 3208 if bsc.Type != nil { 3209 objectMap["type"] = bsc.Type 3210 } 3211 if bsc.Location != nil { 3212 objectMap["location"] = bsc.Location 3213 } 3214 if bsc.Tags != nil { 3215 objectMap["tags"] = bsc.Tags 3216 } 3217 return json.Marshal(objectMap) 3218} 3219 3220// UnmarshalJSON is the custom unmarshaler for BgpServiceCommunity struct. 3221func (bsc *BgpServiceCommunity) UnmarshalJSON(body []byte) error { 3222 var m map[string]*json.RawMessage 3223 err := json.Unmarshal(body, &m) 3224 if err != nil { 3225 return err 3226 } 3227 for k, v := range m { 3228 switch k { 3229 case "properties": 3230 if v != nil { 3231 var bgpServiceCommunityPropertiesFormat BgpServiceCommunityPropertiesFormat 3232 err = json.Unmarshal(*v, &bgpServiceCommunityPropertiesFormat) 3233 if err != nil { 3234 return err 3235 } 3236 bsc.BgpServiceCommunityPropertiesFormat = &bgpServiceCommunityPropertiesFormat 3237 } 3238 case "id": 3239 if v != nil { 3240 var ID string 3241 err = json.Unmarshal(*v, &ID) 3242 if err != nil { 3243 return err 3244 } 3245 bsc.ID = &ID 3246 } 3247 case "name": 3248 if v != nil { 3249 var name string 3250 err = json.Unmarshal(*v, &name) 3251 if err != nil { 3252 return err 3253 } 3254 bsc.Name = &name 3255 } 3256 case "type": 3257 if v != nil { 3258 var typeVar string 3259 err = json.Unmarshal(*v, &typeVar) 3260 if err != nil { 3261 return err 3262 } 3263 bsc.Type = &typeVar 3264 } 3265 case "location": 3266 if v != nil { 3267 var location string 3268 err = json.Unmarshal(*v, &location) 3269 if err != nil { 3270 return err 3271 } 3272 bsc.Location = &location 3273 } 3274 case "tags": 3275 if v != nil { 3276 var tags map[string]*string 3277 err = json.Unmarshal(*v, &tags) 3278 if err != nil { 3279 return err 3280 } 3281 bsc.Tags = tags 3282 } 3283 } 3284 } 3285 3286 return nil 3287} 3288 3289// BgpServiceCommunityListResult response for the ListServiceCommunity API service call. 3290type BgpServiceCommunityListResult struct { 3291 autorest.Response `json:"-"` 3292 // Value - A list of service community resources. 3293 Value *[]BgpServiceCommunity `json:"value,omitempty"` 3294 // NextLink - The URL to get the next set of results. 3295 NextLink *string `json:"nextLink,omitempty"` 3296} 3297 3298// BgpServiceCommunityListResultIterator provides access to a complete listing of BgpServiceCommunity values. 3299type BgpServiceCommunityListResultIterator struct { 3300 i int 3301 page BgpServiceCommunityListResultPage 3302} 3303 3304// Next advances to the next value. If there was an error making 3305// the request the iterator does not advance and the error is returned. 3306func (iter *BgpServiceCommunityListResultIterator) Next() error { 3307 iter.i++ 3308 if iter.i < len(iter.page.Values()) { 3309 return nil 3310 } 3311 err := iter.page.Next() 3312 if err != nil { 3313 iter.i-- 3314 return err 3315 } 3316 iter.i = 0 3317 return nil 3318} 3319 3320// NotDone returns true if the enumeration should be started or is not yet complete. 3321func (iter BgpServiceCommunityListResultIterator) NotDone() bool { 3322 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3323} 3324 3325// Response returns the raw server response from the last page request. 3326func (iter BgpServiceCommunityListResultIterator) Response() BgpServiceCommunityListResult { 3327 return iter.page.Response() 3328} 3329 3330// Value returns the current value or a zero-initialized value if the 3331// iterator has advanced beyond the end of the collection. 3332func (iter BgpServiceCommunityListResultIterator) Value() BgpServiceCommunity { 3333 if !iter.page.NotDone() { 3334 return BgpServiceCommunity{} 3335 } 3336 return iter.page.Values()[iter.i] 3337} 3338 3339// IsEmpty returns true if the ListResult contains no values. 3340func (bsclr BgpServiceCommunityListResult) IsEmpty() bool { 3341 return bsclr.Value == nil || len(*bsclr.Value) == 0 3342} 3343 3344// bgpServiceCommunityListResultPreparer prepares a request to retrieve the next set of results. 3345// It returns nil if no more results exist. 3346func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer() (*http.Request, error) { 3347 if bsclr.NextLink == nil || len(to.String(bsclr.NextLink)) < 1 { 3348 return nil, nil 3349 } 3350 return autorest.Prepare(&http.Request{}, 3351 autorest.AsJSON(), 3352 autorest.AsGet(), 3353 autorest.WithBaseURL(to.String(bsclr.NextLink))) 3354} 3355 3356// BgpServiceCommunityListResultPage contains a page of BgpServiceCommunity values. 3357type BgpServiceCommunityListResultPage struct { 3358 fn func(BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error) 3359 bsclr BgpServiceCommunityListResult 3360} 3361 3362// Next advances to the next page of values. If there was an error making 3363// the request the page does not advance and the error is returned. 3364func (page *BgpServiceCommunityListResultPage) Next() error { 3365 next, err := page.fn(page.bsclr) 3366 if err != nil { 3367 return err 3368 } 3369 page.bsclr = next 3370 return nil 3371} 3372 3373// NotDone returns true if the page enumeration should be started or is not yet complete. 3374func (page BgpServiceCommunityListResultPage) NotDone() bool { 3375 return !page.bsclr.IsEmpty() 3376} 3377 3378// Response returns the raw server response from the last page request. 3379func (page BgpServiceCommunityListResultPage) Response() BgpServiceCommunityListResult { 3380 return page.bsclr 3381} 3382 3383// Values returns the slice of values for the current page or nil if there are no values. 3384func (page BgpServiceCommunityListResultPage) Values() []BgpServiceCommunity { 3385 if page.bsclr.IsEmpty() { 3386 return nil 3387 } 3388 return *page.bsclr.Value 3389} 3390 3391// BgpServiceCommunityPropertiesFormat properties of Service Community. 3392type BgpServiceCommunityPropertiesFormat struct { 3393 // ServiceName - The name of the bgp community. e.g. Skype. 3394 ServiceName *string `json:"serviceName,omitempty"` 3395 // BgpCommunities - Get a list of bgp communities. 3396 BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"` 3397} 3398 3399// BgpSettings BGP settings details 3400type BgpSettings struct { 3401 // Asn - The BGP speaker's ASN. 3402 Asn *int64 `json:"asn,omitempty"` 3403 // BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker. 3404 BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` 3405 // PeerWeight - The weight added to routes learned from this BGP speaker. 3406 PeerWeight *int32 `json:"peerWeight,omitempty"` 3407} 3408 3409// ConnectionResetSharedKey the virtual network connection reset shared key 3410type ConnectionResetSharedKey struct { 3411 autorest.Response `json:"-"` 3412 // KeyLength - The virtual network connection reset shared key length, should between 1 and 128. 3413 KeyLength *int32 `json:"keyLength,omitempty"` 3414} 3415 3416// ConnectionSharedKey response for GetConnectionSharedKey API service call 3417type ConnectionSharedKey struct { 3418 autorest.Response `json:"-"` 3419 // Value - The virtual network connection shared key value. 3420 Value *string `json:"value,omitempty"` 3421} 3422 3423// ConnectivityDestination parameters that define destination of connection. 3424type ConnectivityDestination struct { 3425 // ResourceID - The ID of the resource to which a connection attempt will be made. 3426 ResourceID *string `json:"resourceId,omitempty"` 3427 // Address - The IP address or URI the resource to which a connection attempt will be made. 3428 Address *string `json:"address,omitempty"` 3429 // Port - Port on which check connectivity will be performed. 3430 Port *int32 `json:"port,omitempty"` 3431} 3432 3433// ConnectivityHop information about a hop between the source and the destination. 3434type ConnectivityHop struct { 3435 // Type - The type of the hop. 3436 Type *string `json:"type,omitempty"` 3437 // ID - The ID of the hop. 3438 ID *string `json:"id,omitempty"` 3439 // Address - The IP address of the hop. 3440 Address *string `json:"address,omitempty"` 3441 // ResourceID - The ID of the resource corresponding to this hop. 3442 ResourceID *string `json:"resourceId,omitempty"` 3443 // NextHopIds - List of next hop identifiers. 3444 NextHopIds *[]string `json:"nextHopIds,omitempty"` 3445 // Issues - List of issues. 3446 Issues *[]ConnectivityIssue `json:"issues,omitempty"` 3447} 3448 3449// ConnectivityInformation information on the connectivity status. 3450type ConnectivityInformation struct { 3451 autorest.Response `json:"-"` 3452 // Hops - List of hops between the source and the destination. 3453 Hops *[]ConnectivityHop `json:"hops,omitempty"` 3454 // ConnectionStatus - The connection status. Possible values include: 'ConnectionStatusUnknown', 'ConnectionStatusConnected', 'ConnectionStatusDisconnected', 'ConnectionStatusDegraded' 3455 ConnectionStatus ConnectionStatus `json:"connectionStatus,omitempty"` 3456 // AvgLatencyInMs - Average latency in milliseconds. 3457 AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"` 3458 // MinLatencyInMs - Minimum latency in milliseconds. 3459 MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"` 3460 // MaxLatencyInMs - Maximum latency in milliseconds. 3461 MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"` 3462 // ProbesSent - Total number of probes sent. 3463 ProbesSent *int32 `json:"probesSent,omitempty"` 3464 // ProbesFailed - Number of failed probes. 3465 ProbesFailed *int32 `json:"probesFailed,omitempty"` 3466} 3467 3468// ConnectivityIssue information about an issue encountered in the process of checking for connectivity. 3469type ConnectivityIssue struct { 3470 // Origin - The origin of the issue. Possible values include: 'OriginLocal', 'OriginInbound', 'OriginOutbound' 3471 Origin Origin `json:"origin,omitempty"` 3472 // Severity - The severity of the issue. Possible values include: 'SeverityError', 'SeverityWarning' 3473 Severity Severity `json:"severity,omitempty"` 3474 // Type - The type of issue. Possible values include: 'IssueTypeUnknown', 'IssueTypeAgentStopped', 'IssueTypeGuestFirewall', 'IssueTypeDNSResolution', 'IssueTypeSocketBind', 'IssueTypeNetworkSecurityRule', 'IssueTypeUserDefinedRoute', 'IssueTypePortThrottled', 'IssueTypePlatform' 3475 Type IssueType `json:"type,omitempty"` 3476 // Context - Provides additional context on the issue. 3477 Context *[]map[string]*string `json:"context,omitempty"` 3478} 3479 3480// ConnectivityParameters parameters that determine how the connectivity check will be performed. 3481type ConnectivityParameters struct { 3482 Source *ConnectivitySource `json:"source,omitempty"` 3483 Destination *ConnectivityDestination `json:"destination,omitempty"` 3484} 3485 3486// ConnectivitySource parameters that define the source of the connection. 3487type ConnectivitySource struct { 3488 // ResourceID - The ID of the resource from which a connectivity check will be initiated. 3489 ResourceID *string `json:"resourceId,omitempty"` 3490 // Port - The source port from which a connectivity check will be performed. 3491 Port *int32 `json:"port,omitempty"` 3492} 3493 3494// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. 3495// Standard DHCP option for a subnet overrides VNET DHCP options. 3496type DhcpOptions struct { 3497 // DNSServers - The list of DNS servers IP addresses. 3498 DNSServers *[]string `json:"dnsServers,omitempty"` 3499} 3500 3501// DNSNameAvailabilityResult response for the CheckDnsNameAvailability API service call. 3502type DNSNameAvailabilityResult struct { 3503 autorest.Response `json:"-"` 3504 // Available - Domain availability (True/False). 3505 Available *bool `json:"available,omitempty"` 3506} 3507 3508// EffectiveNetworkSecurityGroup effective network security group. 3509type EffectiveNetworkSecurityGroup struct { 3510 // NetworkSecurityGroup - The ID of network security group that is applied. 3511 NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` 3512 Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` 3513 // EffectiveSecurityRules - A collection of effective security rules. 3514 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` 3515} 3516 3517// EffectiveNetworkSecurityGroupAssociation the effective network security group association. 3518type EffectiveNetworkSecurityGroupAssociation struct { 3519 // Subnet - The ID of the subnet if assigned. 3520 Subnet *SubResource `json:"subnet,omitempty"` 3521 // NetworkInterface - The ID of the network interface if assigned. 3522 NetworkInterface *SubResource `json:"networkInterface,omitempty"` 3523} 3524 3525// EffectiveNetworkSecurityGroupListResult response for list effective network security groups API service call. 3526type EffectiveNetworkSecurityGroupListResult struct { 3527 autorest.Response `json:"-"` 3528 // Value - A list of effective network security groups. 3529 Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"` 3530 // NextLink - The URL to get the next set of results. 3531 NextLink *string `json:"nextLink,omitempty"` 3532} 3533 3534// EffectiveNetworkSecurityRule effective network security rules. 3535type EffectiveNetworkSecurityRule struct { 3536 // Name - The name of the security rule specified by the user (if created by the user). 3537 Name *string `json:"name,omitempty"` 3538 // Protocol - The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and '*'. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolAsterisk' 3539 Protocol SecurityRuleProtocol `json:"protocol,omitempty"` 3540 // SourcePortRange - The source port or range. 3541 SourcePortRange *string `json:"sourcePortRange,omitempty"` 3542 // DestinationPortRange - The destination port or range. 3543 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 3544 // SourceAddressPrefix - The source address prefix. 3545 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 3546 // DestinationAddressPrefix - The destination address prefix. 3547 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 3548 // ExpandedSourceAddressPrefix - The expanded source address prefix. 3549 ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` 3550 // ExpandedDestinationAddressPrefix - Expanded destination address prefix. 3551 ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` 3552 // Access - Whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' 3553 Access SecurityRuleAccess `json:"access,omitempty"` 3554 // Priority - The priority of the rule. 3555 Priority *int32 `json:"priority,omitempty"` 3556 // Direction - The direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' 3557 Direction SecurityRuleDirection `json:"direction,omitempty"` 3558} 3559 3560// EffectiveRoute effective Route 3561type EffectiveRoute struct { 3562 // Name - The name of the user defined route. This is optional. 3563 Name *string `json:"name,omitempty"` 3564 // Source - Who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault' 3565 Source EffectiveRouteSource `json:"source,omitempty"` 3566 // State - The value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid' 3567 State EffectiveRouteState `json:"state,omitempty"` 3568 // AddressPrefix - The address prefixes of the effective routes in CIDR notation. 3569 AddressPrefix *[]string `json:"addressPrefix,omitempty"` 3570 // NextHopIPAddress - The IP address of the next hop of the effective route. 3571 NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"` 3572 // 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' 3573 NextHopType RouteNextHopType `json:"nextHopType,omitempty"` 3574} 3575 3576// EffectiveRouteListResult response for list effective route API service call. 3577type EffectiveRouteListResult struct { 3578 autorest.Response `json:"-"` 3579 // Value - A list of effective routes. 3580 Value *[]EffectiveRoute `json:"value,omitempty"` 3581 // NextLink - The URL to get the next set of results. 3582 NextLink *string `json:"nextLink,omitempty"` 3583} 3584 3585// Error ... 3586type Error struct { 3587 Code *string `json:"code,omitempty"` 3588 Message *string `json:"message,omitempty"` 3589 Target *string `json:"target,omitempty"` 3590 Details *[]ErrorDetails `json:"details,omitempty"` 3591 InnerError *string `json:"innerError,omitempty"` 3592} 3593 3594// ErrorDetails ... 3595type ErrorDetails struct { 3596 Code *string `json:"code,omitempty"` 3597 Target *string `json:"target,omitempty"` 3598 Message *string `json:"message,omitempty"` 3599} 3600 3601// ExpressRouteCircuit expressRouteCircuit resource 3602type ExpressRouteCircuit struct { 3603 autorest.Response `json:"-"` 3604 // Sku - The SKU. 3605 Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` 3606 *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` 3607 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 3608 Etag *string `json:"etag,omitempty"` 3609 // ID - Resource ID. 3610 ID *string `json:"id,omitempty"` 3611 // Name - Resource name. 3612 Name *string `json:"name,omitempty"` 3613 // Type - Resource type. 3614 Type *string `json:"type,omitempty"` 3615 // Location - Resource location. 3616 Location *string `json:"location,omitempty"` 3617 // Tags - Resource tags. 3618 Tags map[string]*string `json:"tags"` 3619} 3620 3621// MarshalJSON is the custom marshaler for ExpressRouteCircuit. 3622func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) { 3623 objectMap := make(map[string]interface{}) 3624 if erc.Sku != nil { 3625 objectMap["sku"] = erc.Sku 3626 } 3627 if erc.ExpressRouteCircuitPropertiesFormat != nil { 3628 objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat 3629 } 3630 if erc.Etag != nil { 3631 objectMap["etag"] = erc.Etag 3632 } 3633 if erc.ID != nil { 3634 objectMap["id"] = erc.ID 3635 } 3636 if erc.Name != nil { 3637 objectMap["name"] = erc.Name 3638 } 3639 if erc.Type != nil { 3640 objectMap["type"] = erc.Type 3641 } 3642 if erc.Location != nil { 3643 objectMap["location"] = erc.Location 3644 } 3645 if erc.Tags != nil { 3646 objectMap["tags"] = erc.Tags 3647 } 3648 return json.Marshal(objectMap) 3649} 3650 3651// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct. 3652func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error { 3653 var m map[string]*json.RawMessage 3654 err := json.Unmarshal(body, &m) 3655 if err != nil { 3656 return err 3657 } 3658 for k, v := range m { 3659 switch k { 3660 case "sku": 3661 if v != nil { 3662 var sku ExpressRouteCircuitSku 3663 err = json.Unmarshal(*v, &sku) 3664 if err != nil { 3665 return err 3666 } 3667 erc.Sku = &sku 3668 } 3669 case "properties": 3670 if v != nil { 3671 var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat 3672 err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat) 3673 if err != nil { 3674 return err 3675 } 3676 erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat 3677 } 3678 case "etag": 3679 if v != nil { 3680 var etag string 3681 err = json.Unmarshal(*v, &etag) 3682 if err != nil { 3683 return err 3684 } 3685 erc.Etag = &etag 3686 } 3687 case "id": 3688 if v != nil { 3689 var ID string 3690 err = json.Unmarshal(*v, &ID) 3691 if err != nil { 3692 return err 3693 } 3694 erc.ID = &ID 3695 } 3696 case "name": 3697 if v != nil { 3698 var name string 3699 err = json.Unmarshal(*v, &name) 3700 if err != nil { 3701 return err 3702 } 3703 erc.Name = &name 3704 } 3705 case "type": 3706 if v != nil { 3707 var typeVar string 3708 err = json.Unmarshal(*v, &typeVar) 3709 if err != nil { 3710 return err 3711 } 3712 erc.Type = &typeVar 3713 } 3714 case "location": 3715 if v != nil { 3716 var location string 3717 err = json.Unmarshal(*v, &location) 3718 if err != nil { 3719 return err 3720 } 3721 erc.Location = &location 3722 } 3723 case "tags": 3724 if v != nil { 3725 var tags map[string]*string 3726 err = json.Unmarshal(*v, &tags) 3727 if err != nil { 3728 return err 3729 } 3730 erc.Tags = tags 3731 } 3732 } 3733 } 3734 3735 return nil 3736} 3737 3738// ExpressRouteCircuitArpTable the ARP table associated with the ExpressRouteCircuit. 3739type ExpressRouteCircuitArpTable struct { 3740 // Age - Age 3741 Age *int32 `json:"age,omitempty"` 3742 // Interface - Interface 3743 Interface *string `json:"interface,omitempty"` 3744 // IPAddress - The IP address. 3745 IPAddress *string `json:"ipAddress,omitempty"` 3746 // MacAddress - The MAC address. 3747 MacAddress *string `json:"macAddress,omitempty"` 3748} 3749 3750// ExpressRouteCircuitAuthorization authorization in an ExpressRouteCircuit resource. 3751type ExpressRouteCircuitAuthorization struct { 3752 autorest.Response `json:"-"` 3753 *AuthorizationPropertiesFormat `json:"properties,omitempty"` 3754 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 3755 Name *string `json:"name,omitempty"` 3756 // Etag - A unique read-only string that changes whenever the resource is updated. 3757 Etag *string `json:"etag,omitempty"` 3758 // ID - Resource ID. 3759 ID *string `json:"id,omitempty"` 3760} 3761 3762// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization. 3763func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) { 3764 objectMap := make(map[string]interface{}) 3765 if erca.AuthorizationPropertiesFormat != nil { 3766 objectMap["properties"] = erca.AuthorizationPropertiesFormat 3767 } 3768 if erca.Name != nil { 3769 objectMap["name"] = erca.Name 3770 } 3771 if erca.Etag != nil { 3772 objectMap["etag"] = erca.Etag 3773 } 3774 if erca.ID != nil { 3775 objectMap["id"] = erca.ID 3776 } 3777 return json.Marshal(objectMap) 3778} 3779 3780// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct. 3781func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error { 3782 var m map[string]*json.RawMessage 3783 err := json.Unmarshal(body, &m) 3784 if err != nil { 3785 return err 3786 } 3787 for k, v := range m { 3788 switch k { 3789 case "properties": 3790 if v != nil { 3791 var authorizationPropertiesFormat AuthorizationPropertiesFormat 3792 err = json.Unmarshal(*v, &authorizationPropertiesFormat) 3793 if err != nil { 3794 return err 3795 } 3796 erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat 3797 } 3798 case "name": 3799 if v != nil { 3800 var name string 3801 err = json.Unmarshal(*v, &name) 3802 if err != nil { 3803 return err 3804 } 3805 erca.Name = &name 3806 } 3807 case "etag": 3808 if v != nil { 3809 var etag string 3810 err = json.Unmarshal(*v, &etag) 3811 if err != nil { 3812 return err 3813 } 3814 erca.Etag = &etag 3815 } 3816 case "id": 3817 if v != nil { 3818 var ID string 3819 err = json.Unmarshal(*v, &ID) 3820 if err != nil { 3821 return err 3822 } 3823 erca.ID = &ID 3824 } 3825 } 3826 } 3827 3828 return nil 3829} 3830 3831// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 3832// of a long-running operation. 3833type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct { 3834 azure.Future 3835 req *http.Request 3836} 3837 3838// Result returns the result of the asynchronous operation. 3839// If the operation has not completed it will return an error. 3840func (future ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) Result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) { 3841 var done bool 3842 done, err = future.Done(client) 3843 if err != nil { 3844 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3845 return 3846 } 3847 if !done { 3848 return erca, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture") 3849 } 3850 if future.PollingMethod() == azure.PollingLocation { 3851 erca, err = client.CreateOrUpdateResponder(future.Response()) 3852 if err != nil { 3853 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 3854 } 3855 return 3856 } 3857 var req *http.Request 3858 var resp *http.Response 3859 if future.PollingURL() != "" { 3860 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 3861 if err != nil { 3862 return 3863 } 3864 } else { 3865 req = autorest.ChangeToGet(future.req) 3866 } 3867 resp, err = autorest.SendWithSender(client, req, 3868 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3869 if err != nil { 3870 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", resp, "Failure sending request") 3871 return 3872 } 3873 erca, err = client.CreateOrUpdateResponder(resp) 3874 if err != nil { 3875 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 3876 } 3877 return 3878} 3879 3880// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results of a 3881// long-running operation. 3882type ExpressRouteCircuitAuthorizationsDeleteFuture struct { 3883 azure.Future 3884 req *http.Request 3885} 3886 3887// Result returns the result of the asynchronous operation. 3888// If the operation has not completed it will return an error. 3889func (future ExpressRouteCircuitAuthorizationsDeleteFuture) Result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) { 3890 var done bool 3891 done, err = future.Done(client) 3892 if err != nil { 3893 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure") 3894 return 3895 } 3896 if !done { 3897 return ar, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture") 3898 } 3899 if future.PollingMethod() == azure.PollingLocation { 3900 ar, err = client.DeleteResponder(future.Response()) 3901 if err != nil { 3902 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Failure responding to request") 3903 } 3904 return 3905 } 3906 var req *http.Request 3907 var resp *http.Response 3908 if future.PollingURL() != "" { 3909 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 3910 if err != nil { 3911 return 3912 } 3913 } else { 3914 req = autorest.ChangeToGet(future.req) 3915 } 3916 resp, err = autorest.SendWithSender(client, req, 3917 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3918 if err != nil { 3919 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", resp, "Failure sending request") 3920 return 3921 } 3922 ar, err = client.DeleteResponder(resp) 3923 if err != nil { 3924 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", resp, "Failure responding to request") 3925 } 3926 return 3927} 3928 3929// ExpressRouteCircuitListResult response for ListExpressRouteCircuit API service call. 3930type ExpressRouteCircuitListResult struct { 3931 autorest.Response `json:"-"` 3932 // Value - A list of ExpressRouteCircuits in a resource group. 3933 Value *[]ExpressRouteCircuit `json:"value,omitempty"` 3934 // NextLink - The URL to get the next set of results. 3935 NextLink *string `json:"nextLink,omitempty"` 3936} 3937 3938// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit values. 3939type ExpressRouteCircuitListResultIterator struct { 3940 i int 3941 page ExpressRouteCircuitListResultPage 3942} 3943 3944// Next advances to the next value. If there was an error making 3945// the request the iterator does not advance and the error is returned. 3946func (iter *ExpressRouteCircuitListResultIterator) Next() error { 3947 iter.i++ 3948 if iter.i < len(iter.page.Values()) { 3949 return nil 3950 } 3951 err := iter.page.Next() 3952 if err != nil { 3953 iter.i-- 3954 return err 3955 } 3956 iter.i = 0 3957 return nil 3958} 3959 3960// NotDone returns true if the enumeration should be started or is not yet complete. 3961func (iter ExpressRouteCircuitListResultIterator) NotDone() bool { 3962 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3963} 3964 3965// Response returns the raw server response from the last page request. 3966func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult { 3967 return iter.page.Response() 3968} 3969 3970// Value returns the current value or a zero-initialized value if the 3971// iterator has advanced beyond the end of the collection. 3972func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit { 3973 if !iter.page.NotDone() { 3974 return ExpressRouteCircuit{} 3975 } 3976 return iter.page.Values()[iter.i] 3977} 3978 3979// IsEmpty returns true if the ListResult contains no values. 3980func (erclr ExpressRouteCircuitListResult) IsEmpty() bool { 3981 return erclr.Value == nil || len(*erclr.Value) == 0 3982} 3983 3984// expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results. 3985// It returns nil if no more results exist. 3986func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer() (*http.Request, error) { 3987 if erclr.NextLink == nil || len(to.String(erclr.NextLink)) < 1 { 3988 return nil, nil 3989 } 3990 return autorest.Prepare(&http.Request{}, 3991 autorest.AsJSON(), 3992 autorest.AsGet(), 3993 autorest.WithBaseURL(to.String(erclr.NextLink))) 3994} 3995 3996// ExpressRouteCircuitListResultPage contains a page of ExpressRouteCircuit values. 3997type ExpressRouteCircuitListResultPage struct { 3998 fn func(ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error) 3999 erclr ExpressRouteCircuitListResult 4000} 4001 4002// Next advances to the next page of values. If there was an error making 4003// the request the page does not advance and the error is returned. 4004func (page *ExpressRouteCircuitListResultPage) Next() error { 4005 next, err := page.fn(page.erclr) 4006 if err != nil { 4007 return err 4008 } 4009 page.erclr = next 4010 return nil 4011} 4012 4013// NotDone returns true if the page enumeration should be started or is not yet complete. 4014func (page ExpressRouteCircuitListResultPage) NotDone() bool { 4015 return !page.erclr.IsEmpty() 4016} 4017 4018// Response returns the raw server response from the last page request. 4019func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult { 4020 return page.erclr 4021} 4022 4023// Values returns the slice of values for the current page or nil if there are no values. 4024func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit { 4025 if page.erclr.IsEmpty() { 4026 return nil 4027 } 4028 return *page.erclr.Value 4029} 4030 4031// ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource. 4032type ExpressRouteCircuitPeering struct { 4033 autorest.Response `json:"-"` 4034 *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` 4035 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 4036 Name *string `json:"name,omitempty"` 4037 // Etag - A unique read-only string that changes whenever the resource is updated. 4038 Etag *string `json:"etag,omitempty"` 4039 // ID - Resource ID. 4040 ID *string `json:"id,omitempty"` 4041} 4042 4043// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering. 4044func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) { 4045 objectMap := make(map[string]interface{}) 4046 if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil { 4047 objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat 4048 } 4049 if ercp.Name != nil { 4050 objectMap["name"] = ercp.Name 4051 } 4052 if ercp.Etag != nil { 4053 objectMap["etag"] = ercp.Etag 4054 } 4055 if ercp.ID != nil { 4056 objectMap["id"] = ercp.ID 4057 } 4058 return json.Marshal(objectMap) 4059} 4060 4061// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct. 4062func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error { 4063 var m map[string]*json.RawMessage 4064 err := json.Unmarshal(body, &m) 4065 if err != nil { 4066 return err 4067 } 4068 for k, v := range m { 4069 switch k { 4070 case "properties": 4071 if v != nil { 4072 var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat 4073 err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat) 4074 if err != nil { 4075 return err 4076 } 4077 ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat 4078 } 4079 case "name": 4080 if v != nil { 4081 var name string 4082 err = json.Unmarshal(*v, &name) 4083 if err != nil { 4084 return err 4085 } 4086 ercp.Name = &name 4087 } 4088 case "etag": 4089 if v != nil { 4090 var etag string 4091 err = json.Unmarshal(*v, &etag) 4092 if err != nil { 4093 return err 4094 } 4095 ercp.Etag = &etag 4096 } 4097 case "id": 4098 if v != nil { 4099 var ID string 4100 err = json.Unmarshal(*v, &ID) 4101 if err != nil { 4102 return err 4103 } 4104 ercp.ID = &ID 4105 } 4106 } 4107 } 4108 4109 return nil 4110} 4111 4112// ExpressRouteCircuitPeeringConfig specifies the peering configuration. 4113type ExpressRouteCircuitPeeringConfig struct { 4114 // AdvertisedPublicPrefixes - The reference of AdvertisedPublicPrefixes. 4115 AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` 4116 // AdvertisedPublicPrefixesState - AdvertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' 4117 AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` 4118 // CustomerASN - The CustomerASN of the peering. 4119 CustomerASN *int32 `json:"customerASN,omitempty"` 4120 // RoutingRegistryName - The RoutingRegistryName of the configuration. 4121 RoutingRegistryName *string `json:"routingRegistryName,omitempty"` 4122} 4123 4124// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings that 4125// belong to an ExpressRouteCircuit. 4126type ExpressRouteCircuitPeeringListResult struct { 4127 autorest.Response `json:"-"` 4128 // Value - The peerings in an express route circuit. 4129 Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` 4130 // NextLink - The URL to get the next set of results. 4131 NextLink *string `json:"nextLink,omitempty"` 4132} 4133 4134// ExpressRouteCircuitPeeringListResultIterator provides access to a complete listing of ExpressRouteCircuitPeering 4135// values. 4136type ExpressRouteCircuitPeeringListResultIterator struct { 4137 i int 4138 page ExpressRouteCircuitPeeringListResultPage 4139} 4140 4141// Next advances to the next value. If there was an error making 4142// the request the iterator does not advance and the error is returned. 4143func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error { 4144 iter.i++ 4145 if iter.i < len(iter.page.Values()) { 4146 return nil 4147 } 4148 err := iter.page.Next() 4149 if err != nil { 4150 iter.i-- 4151 return err 4152 } 4153 iter.i = 0 4154 return nil 4155} 4156 4157// NotDone returns true if the enumeration should be started or is not yet complete. 4158func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool { 4159 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4160} 4161 4162// Response returns the raw server response from the last page request. 4163func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult { 4164 return iter.page.Response() 4165} 4166 4167// Value returns the current value or a zero-initialized value if the 4168// iterator has advanced beyond the end of the collection. 4169func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering { 4170 if !iter.page.NotDone() { 4171 return ExpressRouteCircuitPeering{} 4172 } 4173 return iter.page.Values()[iter.i] 4174} 4175 4176// IsEmpty returns true if the ListResult contains no values. 4177func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool { 4178 return ercplr.Value == nil || len(*ercplr.Value) == 0 4179} 4180 4181// expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results. 4182// It returns nil if no more results exist. 4183func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer() (*http.Request, error) { 4184 if ercplr.NextLink == nil || len(to.String(ercplr.NextLink)) < 1 { 4185 return nil, nil 4186 } 4187 return autorest.Prepare(&http.Request{}, 4188 autorest.AsJSON(), 4189 autorest.AsGet(), 4190 autorest.WithBaseURL(to.String(ercplr.NextLink))) 4191} 4192 4193// ExpressRouteCircuitPeeringListResultPage contains a page of ExpressRouteCircuitPeering values. 4194type ExpressRouteCircuitPeeringListResultPage struct { 4195 fn func(ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error) 4196 ercplr ExpressRouteCircuitPeeringListResult 4197} 4198 4199// Next advances to the next page of values. If there was an error making 4200// the request the page does not advance and the error is returned. 4201func (page *ExpressRouteCircuitPeeringListResultPage) Next() error { 4202 next, err := page.fn(page.ercplr) 4203 if err != nil { 4204 return err 4205 } 4206 page.ercplr = next 4207 return nil 4208} 4209 4210// NotDone returns true if the page enumeration should be started or is not yet complete. 4211func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool { 4212 return !page.ercplr.IsEmpty() 4213} 4214 4215// Response returns the raw server response from the last page request. 4216func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult { 4217 return page.ercplr 4218} 4219 4220// Values returns the slice of values for the current page or nil if there are no values. 4221func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering { 4222 if page.ercplr.IsEmpty() { 4223 return nil 4224 } 4225 return *page.ercplr.Value 4226} 4227 4228// ExpressRouteCircuitPeeringPropertiesFormat ... 4229type ExpressRouteCircuitPeeringPropertiesFormat struct { 4230 // PeeringType - The PeeringType. Possible values are: 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' 4231 PeeringType ExpressRouteCircuitPeeringType `json:"peeringType,omitempty"` 4232 // State - The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled' 4233 State ExpressRouteCircuitPeeringState `json:"state,omitempty"` 4234 // AzureASN - The Azure ASN. 4235 AzureASN *int32 `json:"azureASN,omitempty"` 4236 // PeerASN - The peer ASN. 4237 PeerASN *int32 `json:"peerASN,omitempty"` 4238 // PrimaryPeerAddressPrefix - The primary address prefix. 4239 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` 4240 // SecondaryPeerAddressPrefix - The secondary address prefix. 4241 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` 4242 // PrimaryAzurePort - The primary port. 4243 PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` 4244 // SecondaryAzurePort - The secondary port. 4245 SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` 4246 // SharedKey - The shared key. 4247 SharedKey *string `json:"sharedKey,omitempty"` 4248 // VlanID - The VLAN ID. 4249 VlanID *int32 `json:"vlanId,omitempty"` 4250 // MicrosoftPeeringConfig - The Microsoft peering configuration. 4251 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` 4252 // Stats - Gets peering stats. 4253 Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` 4254 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 4255 ProvisioningState *string `json:"provisioningState,omitempty"` 4256 // GatewayManagerEtag - The GatewayManager Etag. 4257 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` 4258 // LastModifiedBy - Gets whether the provider or the customer last modified the peering. 4259 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 4260 // RouteFilter - The reference of the RouteFilter resource. 4261 RouteFilter *RouteFilter `json:"routeFilter,omitempty"` 4262 // Ipv6PeeringConfig - The IPv6 peering configuration. 4263 Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` 4264} 4265 4266// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4267// long-running operation. 4268type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct { 4269 azure.Future 4270 req *http.Request 4271} 4272 4273// Result returns the result of the asynchronous operation. 4274// If the operation has not completed it will return an error. 4275func (future ExpressRouteCircuitPeeringsCreateOrUpdateFuture) Result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) { 4276 var done bool 4277 done, err = future.Done(client) 4278 if err != nil { 4279 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4280 return 4281 } 4282 if !done { 4283 return ercp, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture") 4284 } 4285 if future.PollingMethod() == azure.PollingLocation { 4286 ercp, err = client.CreateOrUpdateResponder(future.Response()) 4287 if err != nil { 4288 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 4289 } 4290 return 4291 } 4292 var req *http.Request 4293 var resp *http.Response 4294 if future.PollingURL() != "" { 4295 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 4296 if err != nil { 4297 return 4298 } 4299 } else { 4300 req = autorest.ChangeToGet(future.req) 4301 } 4302 resp, err = autorest.SendWithSender(client, req, 4303 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4304 if err != nil { 4305 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", resp, "Failure sending request") 4306 return 4307 } 4308 ercp, err = client.CreateOrUpdateResponder(resp) 4309 if err != nil { 4310 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 4311 } 4312 return 4313} 4314 4315// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a 4316// long-running operation. 4317type ExpressRouteCircuitPeeringsDeleteFuture struct { 4318 azure.Future 4319 req *http.Request 4320} 4321 4322// Result returns the result of the asynchronous operation. 4323// If the operation has not completed it will return an error. 4324func (future ExpressRouteCircuitPeeringsDeleteFuture) Result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) { 4325 var done bool 4326 done, err = future.Done(client) 4327 if err != nil { 4328 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 4329 return 4330 } 4331 if !done { 4332 return ar, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture") 4333 } 4334 if future.PollingMethod() == azure.PollingLocation { 4335 ar, err = client.DeleteResponder(future.Response()) 4336 if err != nil { 4337 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Failure responding to request") 4338 } 4339 return 4340 } 4341 var req *http.Request 4342 var resp *http.Response 4343 if future.PollingURL() != "" { 4344 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 4345 if err != nil { 4346 return 4347 } 4348 } else { 4349 req = autorest.ChangeToGet(future.req) 4350 } 4351 resp, err = autorest.SendWithSender(client, req, 4352 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4353 if err != nil { 4354 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", resp, "Failure sending request") 4355 return 4356 } 4357 ar, err = client.DeleteResponder(resp) 4358 if err != nil { 4359 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", resp, "Failure responding to request") 4360 } 4361 return 4362} 4363 4364// ExpressRouteCircuitPropertiesFormat properties of ExpressRouteCircuit. 4365type ExpressRouteCircuitPropertiesFormat struct { 4366 // AllowClassicOperations - Allow classic operations 4367 AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` 4368 // CircuitProvisioningState - The CircuitProvisioningState state of the resource. 4369 CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` 4370 // ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning' 4371 ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` 4372 // Authorizations - The list of authorizations. 4373 Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` 4374 // Peerings - The list of peerings. 4375 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` 4376 // ServiceKey - The ServiceKey. 4377 ServiceKey *string `json:"serviceKey,omitempty"` 4378 // ServiceProviderNotes - The ServiceProviderNotes. 4379 ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` 4380 // ServiceProviderProperties - The ServiceProviderProperties. 4381 ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` 4382 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 4383 ProvisioningState *string `json:"provisioningState,omitempty"` 4384 // GatewayManagerEtag - The GatewayManager Etag. 4385 GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` 4386} 4387 4388// ExpressRouteCircuitRoutesTable the routes table associated with the ExpressRouteCircuit 4389type ExpressRouteCircuitRoutesTable struct { 4390 // NetworkProperty - network 4391 NetworkProperty *string `json:"network,omitempty"` 4392 // NextHop - nextHop 4393 NextHop *string `json:"nextHop,omitempty"` 4394 // LocPrf - locPrf 4395 LocPrf *string `json:"locPrf,omitempty"` 4396 // Weight - weight. 4397 Weight *int32 `json:"weight,omitempty"` 4398 // Path - path 4399 Path *string `json:"path,omitempty"` 4400} 4401 4402// ExpressRouteCircuitRoutesTableSummary the routes table associated with the ExpressRouteCircuit. 4403type ExpressRouteCircuitRoutesTableSummary struct { 4404 // Neighbor - Neighbor 4405 Neighbor *string `json:"neighbor,omitempty"` 4406 // V - BGP version number spoken to the neighbor. 4407 V *int32 `json:"v,omitempty"` 4408 // As - Autonomous system number. 4409 As *int32 `json:"as,omitempty"` 4410 // UpDown - The length of time that the BGP session has been in the Established state, or the current status if not in the Established state. 4411 UpDown *string `json:"upDown,omitempty"` 4412 // StatePfxRcd - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group. 4413 StatePfxRcd *string `json:"statePfxRcd,omitempty"` 4414} 4415 4416// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route Circuits API. 4417type ExpressRouteCircuitsArpTableListResult struct { 4418 autorest.Response `json:"-"` 4419 // Value - Gets list of the ARP table. 4420 Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` 4421 // NextLink - The URL to get the next set of results. 4422 NextLink *string `json:"nextLink,omitempty"` 4423} 4424 4425// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4426// long-running operation. 4427type ExpressRouteCircuitsCreateOrUpdateFuture struct { 4428 azure.Future 4429 req *http.Request 4430} 4431 4432// Result returns the result of the asynchronous operation. 4433// If the operation has not completed it will return an error. 4434func (future ExpressRouteCircuitsCreateOrUpdateFuture) Result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) { 4435 var done bool 4436 done, err = future.Done(client) 4437 if err != nil { 4438 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4439 return 4440 } 4441 if !done { 4442 return erc, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture") 4443 } 4444 if future.PollingMethod() == azure.PollingLocation { 4445 erc, err = client.CreateOrUpdateResponder(future.Response()) 4446 if err != nil { 4447 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 4448 } 4449 return 4450 } 4451 var req *http.Request 4452 var resp *http.Response 4453 if future.PollingURL() != "" { 4454 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 4455 if err != nil { 4456 return 4457 } 4458 } else { 4459 req = autorest.ChangeToGet(future.req) 4460 } 4461 resp, err = autorest.SendWithSender(client, req, 4462 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4463 if err != nil { 4464 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", resp, "Failure sending request") 4465 return 4466 } 4467 erc, err = client.CreateOrUpdateResponder(resp) 4468 if err != nil { 4469 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 4470 } 4471 return 4472} 4473 4474// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 4475// operation. 4476type ExpressRouteCircuitsDeleteFuture struct { 4477 azure.Future 4478 req *http.Request 4479} 4480 4481// Result returns the result of the asynchronous operation. 4482// If the operation has not completed it will return an error. 4483func (future ExpressRouteCircuitsDeleteFuture) Result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) { 4484 var done bool 4485 done, err = future.Done(client) 4486 if err != nil { 4487 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure") 4488 return 4489 } 4490 if !done { 4491 return ar, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture") 4492 } 4493 if future.PollingMethod() == azure.PollingLocation { 4494 ar, err = client.DeleteResponder(future.Response()) 4495 if err != nil { 4496 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Failure responding to request") 4497 } 4498 return 4499 } 4500 var req *http.Request 4501 var resp *http.Response 4502 if future.PollingURL() != "" { 4503 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 4504 if err != nil { 4505 return 4506 } 4507 } else { 4508 req = autorest.ChangeToGet(future.req) 4509 } 4510 resp, err = autorest.SendWithSender(client, req, 4511 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4512 if err != nil { 4513 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", resp, "Failure sending request") 4514 return 4515 } 4516 ar, err = client.DeleteResponder(resp) 4517 if err != nil { 4518 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", resp, "Failure responding to request") 4519 } 4520 return 4521} 4522 4523// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an ExpressRouteCircuit. 4524type ExpressRouteCircuitServiceProviderProperties struct { 4525 // ServiceProviderName - The serviceProviderName. 4526 ServiceProviderName *string `json:"serviceProviderName,omitempty"` 4527 // PeeringLocation - The peering location. 4528 PeeringLocation *string `json:"peeringLocation,omitempty"` 4529 // BandwidthInMbps - The BandwidthInMbps. 4530 BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` 4531} 4532 4533// ExpressRouteCircuitSku contains SKU in an ExpressRouteCircuit. 4534type ExpressRouteCircuitSku struct { 4535 // Name - The name of the SKU. 4536 Name *string `json:"name,omitempty"` 4537 // Tier - The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium' 4538 Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` 4539 // Family - The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData' 4540 Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` 4541} 4542 4543// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a 4544// long-running operation. 4545type ExpressRouteCircuitsListArpTableFuture struct { 4546 azure.Future 4547 req *http.Request 4548} 4549 4550// Result returns the result of the asynchronous operation. 4551// If the operation has not completed it will return an error. 4552func (future ExpressRouteCircuitsListArpTableFuture) Result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) { 4553 var done bool 4554 done, err = future.Done(client) 4555 if err != nil { 4556 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure") 4557 return 4558 } 4559 if !done { 4560 return ercatlr, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture") 4561 } 4562 if future.PollingMethod() == azure.PollingLocation { 4563 ercatlr, err = client.ListArpTableResponder(future.Response()) 4564 if err != nil { 4565 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Failure responding to request") 4566 } 4567 return 4568 } 4569 var req *http.Request 4570 var resp *http.Response 4571 if future.PollingURL() != "" { 4572 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 4573 if err != nil { 4574 return 4575 } 4576 } else { 4577 req = autorest.ChangeToGet(future.req) 4578 } 4579 resp, err = autorest.SendWithSender(client, req, 4580 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4581 if err != nil { 4582 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", resp, "Failure sending request") 4583 return 4584 } 4585 ercatlr, err = client.ListArpTableResponder(resp) 4586 if err != nil { 4587 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", resp, "Failure responding to request") 4588 } 4589 return 4590} 4591 4592// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a 4593// long-running operation. 4594type ExpressRouteCircuitsListRoutesTableFuture struct { 4595 azure.Future 4596 req *http.Request 4597} 4598 4599// Result returns the result of the asynchronous operation. 4600// If the operation has not completed it will return an error. 4601func (future ExpressRouteCircuitsListRoutesTableFuture) Result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) { 4602 var done bool 4603 done, err = future.Done(client) 4604 if err != nil { 4605 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure") 4606 return 4607 } 4608 if !done { 4609 return ercrtlr, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture") 4610 } 4611 if future.PollingMethod() == azure.PollingLocation { 4612 ercrtlr, err = client.ListRoutesTableResponder(future.Response()) 4613 if err != nil { 4614 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Failure responding to request") 4615 } 4616 return 4617 } 4618 var req *http.Request 4619 var resp *http.Response 4620 if future.PollingURL() != "" { 4621 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 4622 if err != nil { 4623 return 4624 } 4625 } else { 4626 req = autorest.ChangeToGet(future.req) 4627 } 4628 resp, err = autorest.SendWithSender(client, req, 4629 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4630 if err != nil { 4631 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", resp, "Failure sending request") 4632 return 4633 } 4634 ercrtlr, err = client.ListRoutesTableResponder(resp) 4635 if err != nil { 4636 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", resp, "Failure responding to request") 4637 } 4638 return 4639} 4640 4641// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the results of a 4642// long-running operation. 4643type ExpressRouteCircuitsListRoutesTableSummaryFuture struct { 4644 azure.Future 4645 req *http.Request 4646} 4647 4648// Result returns the result of the asynchronous operation. 4649// If the operation has not completed it will return an error. 4650func (future ExpressRouteCircuitsListRoutesTableSummaryFuture) Result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) { 4651 var done bool 4652 done, err = future.Done(client) 4653 if err != nil { 4654 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure") 4655 return 4656 } 4657 if !done { 4658 return ercrtslr, azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture") 4659 } 4660 if future.PollingMethod() == azure.PollingLocation { 4661 ercrtslr, err = client.ListRoutesTableSummaryResponder(future.Response()) 4662 if err != nil { 4663 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Failure responding to request") 4664 } 4665 return 4666 } 4667 var req *http.Request 4668 var resp *http.Response 4669 if future.PollingURL() != "" { 4670 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 4671 if err != nil { 4672 return 4673 } 4674 } else { 4675 req = autorest.ChangeToGet(future.req) 4676 } 4677 resp, err = autorest.SendWithSender(client, req, 4678 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4679 if err != nil { 4680 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", resp, "Failure sending request") 4681 return 4682 } 4683 ercrtslr, err = client.ListRoutesTableSummaryResponder(resp) 4684 if err != nil { 4685 err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", resp, "Failure responding to request") 4686 } 4687 return 4688} 4689 4690// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route 4691// Circuits API. 4692type ExpressRouteCircuitsRoutesTableListResult struct { 4693 autorest.Response `json:"-"` 4694 // Value - The list of routes table. 4695 Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` 4696 // NextLink - The URL to get the next set of results. 4697 NextLink *string `json:"nextLink,omitempty"` 4698} 4699 4700// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the Express Route 4701// Circuits API. 4702type ExpressRouteCircuitsRoutesTableSummaryListResult struct { 4703 autorest.Response `json:"-"` 4704 // Value - A list of the routes table. 4705 Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` 4706 // NextLink - The URL to get the next set of results. 4707 NextLink *string `json:"nextLink,omitempty"` 4708} 4709 4710// ExpressRouteCircuitStats contains stats associated with the peering. 4711type ExpressRouteCircuitStats struct { 4712 autorest.Response `json:"-"` 4713 // PrimarybytesIn - Gets BytesIn of the peering. 4714 PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` 4715 // PrimarybytesOut - Gets BytesOut of the peering. 4716 PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` 4717 // SecondarybytesIn - Gets BytesIn of the peering. 4718 SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` 4719 // SecondarybytesOut - Gets BytesOut of the peering. 4720 SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` 4721} 4722 4723// ExpressRouteServiceProvider a ExpressRouteResourceProvider object. 4724type ExpressRouteServiceProvider struct { 4725 *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` 4726 // ID - Resource ID. 4727 ID *string `json:"id,omitempty"` 4728 // Name - Resource name. 4729 Name *string `json:"name,omitempty"` 4730 // Type - Resource type. 4731 Type *string `json:"type,omitempty"` 4732 // Location - Resource location. 4733 Location *string `json:"location,omitempty"` 4734 // Tags - Resource tags. 4735 Tags map[string]*string `json:"tags"` 4736} 4737 4738// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider. 4739func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) { 4740 objectMap := make(map[string]interface{}) 4741 if ersp.ExpressRouteServiceProviderPropertiesFormat != nil { 4742 objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat 4743 } 4744 if ersp.ID != nil { 4745 objectMap["id"] = ersp.ID 4746 } 4747 if ersp.Name != nil { 4748 objectMap["name"] = ersp.Name 4749 } 4750 if ersp.Type != nil { 4751 objectMap["type"] = ersp.Type 4752 } 4753 if ersp.Location != nil { 4754 objectMap["location"] = ersp.Location 4755 } 4756 if ersp.Tags != nil { 4757 objectMap["tags"] = ersp.Tags 4758 } 4759 return json.Marshal(objectMap) 4760} 4761 4762// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct. 4763func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error { 4764 var m map[string]*json.RawMessage 4765 err := json.Unmarshal(body, &m) 4766 if err != nil { 4767 return err 4768 } 4769 for k, v := range m { 4770 switch k { 4771 case "properties": 4772 if v != nil { 4773 var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat 4774 err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat) 4775 if err != nil { 4776 return err 4777 } 4778 ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat 4779 } 4780 case "id": 4781 if v != nil { 4782 var ID string 4783 err = json.Unmarshal(*v, &ID) 4784 if err != nil { 4785 return err 4786 } 4787 ersp.ID = &ID 4788 } 4789 case "name": 4790 if v != nil { 4791 var name string 4792 err = json.Unmarshal(*v, &name) 4793 if err != nil { 4794 return err 4795 } 4796 ersp.Name = &name 4797 } 4798 case "type": 4799 if v != nil { 4800 var typeVar string 4801 err = json.Unmarshal(*v, &typeVar) 4802 if err != nil { 4803 return err 4804 } 4805 ersp.Type = &typeVar 4806 } 4807 case "location": 4808 if v != nil { 4809 var location string 4810 err = json.Unmarshal(*v, &location) 4811 if err != nil { 4812 return err 4813 } 4814 ersp.Location = &location 4815 } 4816 case "tags": 4817 if v != nil { 4818 var tags map[string]*string 4819 err = json.Unmarshal(*v, &tags) 4820 if err != nil { 4821 return err 4822 } 4823 ersp.Tags = tags 4824 } 4825 } 4826 } 4827 4828 return nil 4829} 4830 4831// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider 4832// resources. 4833type ExpressRouteServiceProviderBandwidthsOffered struct { 4834 // OfferName - The OfferName. 4835 OfferName *string `json:"offerName,omitempty"` 4836 // ValueInMbps - The ValueInMbps. 4837 ValueInMbps *int32 `json:"valueInMbps,omitempty"` 4838} 4839 4840// ExpressRouteServiceProviderListResult response for the ListExpressRouteServiceProvider API service call. 4841type ExpressRouteServiceProviderListResult struct { 4842 autorest.Response `json:"-"` 4843 // Value - A list of ExpressRouteResourceProvider resources. 4844 Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` 4845 // NextLink - The URL to get the next set of results. 4846 NextLink *string `json:"nextLink,omitempty"` 4847} 4848 4849// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of 4850// ExpressRouteServiceProvider values. 4851type ExpressRouteServiceProviderListResultIterator struct { 4852 i int 4853 page ExpressRouteServiceProviderListResultPage 4854} 4855 4856// Next advances to the next value. If there was an error making 4857// the request the iterator does not advance and the error is returned. 4858func (iter *ExpressRouteServiceProviderListResultIterator) Next() error { 4859 iter.i++ 4860 if iter.i < len(iter.page.Values()) { 4861 return nil 4862 } 4863 err := iter.page.Next() 4864 if err != nil { 4865 iter.i-- 4866 return err 4867 } 4868 iter.i = 0 4869 return nil 4870} 4871 4872// NotDone returns true if the enumeration should be started or is not yet complete. 4873func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool { 4874 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4875} 4876 4877// Response returns the raw server response from the last page request. 4878func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult { 4879 return iter.page.Response() 4880} 4881 4882// Value returns the current value or a zero-initialized value if the 4883// iterator has advanced beyond the end of the collection. 4884func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider { 4885 if !iter.page.NotDone() { 4886 return ExpressRouteServiceProvider{} 4887 } 4888 return iter.page.Values()[iter.i] 4889} 4890 4891// IsEmpty returns true if the ListResult contains no values. 4892func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool { 4893 return ersplr.Value == nil || len(*ersplr.Value) == 0 4894} 4895 4896// expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results. 4897// It returns nil if no more results exist. 4898func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer() (*http.Request, error) { 4899 if ersplr.NextLink == nil || len(to.String(ersplr.NextLink)) < 1 { 4900 return nil, nil 4901 } 4902 return autorest.Prepare(&http.Request{}, 4903 autorest.AsJSON(), 4904 autorest.AsGet(), 4905 autorest.WithBaseURL(to.String(ersplr.NextLink))) 4906} 4907 4908// ExpressRouteServiceProviderListResultPage contains a page of ExpressRouteServiceProvider values. 4909type ExpressRouteServiceProviderListResultPage struct { 4910 fn func(ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error) 4911 ersplr ExpressRouteServiceProviderListResult 4912} 4913 4914// Next advances to the next page of values. If there was an error making 4915// the request the page does not advance and the error is returned. 4916func (page *ExpressRouteServiceProviderListResultPage) Next() error { 4917 next, err := page.fn(page.ersplr) 4918 if err != nil { 4919 return err 4920 } 4921 page.ersplr = next 4922 return nil 4923} 4924 4925// NotDone returns true if the page enumeration should be started or is not yet complete. 4926func (page ExpressRouteServiceProviderListResultPage) NotDone() bool { 4927 return !page.ersplr.IsEmpty() 4928} 4929 4930// Response returns the raw server response from the last page request. 4931func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult { 4932 return page.ersplr 4933} 4934 4935// Values returns the slice of values for the current page or nil if there are no values. 4936func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider { 4937 if page.ersplr.IsEmpty() { 4938 return nil 4939 } 4940 return *page.ersplr.Value 4941} 4942 4943// ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider. 4944type ExpressRouteServiceProviderPropertiesFormat struct { 4945 // PeeringLocations - Get a list of peering locations. 4946 PeeringLocations *[]string `json:"peeringLocations,omitempty"` 4947 // BandwidthsOffered - Gets bandwidths offered. 4948 BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` 4949 // ProvisioningState - Gets the provisioning state of the resource. 4950 ProvisioningState *string `json:"provisioningState,omitempty"` 4951} 4952 4953// FlowLogInformation information on the configuration of flow log. 4954type FlowLogInformation struct { 4955 autorest.Response `json:"-"` 4956 // TargetResourceID - The ID of the resource to configure for flow logging. 4957 TargetResourceID *string `json:"targetResourceId,omitempty"` 4958 *FlowLogProperties `json:"properties,omitempty"` 4959} 4960 4961// MarshalJSON is the custom marshaler for FlowLogInformation. 4962func (fli FlowLogInformation) MarshalJSON() ([]byte, error) { 4963 objectMap := make(map[string]interface{}) 4964 if fli.TargetResourceID != nil { 4965 objectMap["targetResourceId"] = fli.TargetResourceID 4966 } 4967 if fli.FlowLogProperties != nil { 4968 objectMap["properties"] = fli.FlowLogProperties 4969 } 4970 return json.Marshal(objectMap) 4971} 4972 4973// UnmarshalJSON is the custom unmarshaler for FlowLogInformation struct. 4974func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error { 4975 var m map[string]*json.RawMessage 4976 err := json.Unmarshal(body, &m) 4977 if err != nil { 4978 return err 4979 } 4980 for k, v := range m { 4981 switch k { 4982 case "targetResourceId": 4983 if v != nil { 4984 var targetResourceID string 4985 err = json.Unmarshal(*v, &targetResourceID) 4986 if err != nil { 4987 return err 4988 } 4989 fli.TargetResourceID = &targetResourceID 4990 } 4991 case "properties": 4992 if v != nil { 4993 var flowLogProperties FlowLogProperties 4994 err = json.Unmarshal(*v, &flowLogProperties) 4995 if err != nil { 4996 return err 4997 } 4998 fli.FlowLogProperties = &flowLogProperties 4999 } 5000 } 5001 } 5002 5003 return nil 5004} 5005 5006// FlowLogProperties parameters that define the configuration of flow log. 5007type FlowLogProperties struct { 5008 // StorageID - ID of the storage account which is used to store the flow log. 5009 StorageID *string `json:"storageId,omitempty"` 5010 // Enabled - Flag to enable/disable flow logging. 5011 Enabled *bool `json:"enabled,omitempty"` 5012 RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` 5013} 5014 5015// FlowLogStatusParameters parameters that define a resource to query flow log status. 5016type FlowLogStatusParameters struct { 5017 // TargetResourceID - The target resource where getting the flow logging status. 5018 TargetResourceID *string `json:"targetResourceId,omitempty"` 5019} 5020 5021// FrontendIPConfiguration frontend IP address of the load balancer. 5022type FrontendIPConfiguration struct { 5023 *FrontendIPConfigurationPropertiesFormat `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 ID. 5029 ID *string `json:"id,omitempty"` 5030} 5031 5032// MarshalJSON is the custom marshaler for FrontendIPConfiguration. 5033func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) { 5034 objectMap := make(map[string]interface{}) 5035 if fic.FrontendIPConfigurationPropertiesFormat != nil { 5036 objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat 5037 } 5038 if fic.Name != nil { 5039 objectMap["name"] = fic.Name 5040 } 5041 if fic.Etag != nil { 5042 objectMap["etag"] = fic.Etag 5043 } 5044 if fic.ID != nil { 5045 objectMap["id"] = fic.ID 5046 } 5047 return json.Marshal(objectMap) 5048} 5049 5050// UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct. 5051func (fic *FrontendIPConfiguration) 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 frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat 5062 err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat) 5063 if err != nil { 5064 return err 5065 } 5066 fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat 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 fic.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 fic.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 fic.ID = &ID 5094 } 5095 } 5096 } 5097 5098 return nil 5099} 5100 5101// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer. 5102type FrontendIPConfigurationPropertiesFormat struct { 5103 // InboundNatRules - Read only. Inbound rules URIs that use this frontend IP. 5104 InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` 5105 // InboundNatPools - Read only. Inbound pools URIs that use this frontend IP. 5106 InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` 5107 // OutboundNatRules - Read only. Outbound rules URIs that use this frontend IP. 5108 OutboundNatRules *[]SubResource `json:"outboundNatRules,omitempty"` 5109 // LoadBalancingRules - Gets load balancing rules URIs that use this frontend IP. 5110 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 5111 // PrivateIPAddress - The private IP address of the IP configuration. 5112 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 5113 // PrivateIPAllocationMethod - The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 5114 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 5115 // Subnet - The reference of the subnet resource. 5116 Subnet *Subnet `json:"subnet,omitempty"` 5117 // PublicIPAddress - The reference of the Public IP resource. 5118 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 5119 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5120 ProvisioningState *string `json:"provisioningState,omitempty"` 5121} 5122 5123// GatewayRoute gateway routing details 5124type GatewayRoute struct { 5125 // LocalAddress - The gateway's local address 5126 LocalAddress *string `json:"localAddress,omitempty"` 5127 // NetworkProperty - The route's network prefix 5128 NetworkProperty *string `json:"network,omitempty"` 5129 // NextHop - The route's next hop 5130 NextHop *string `json:"nextHop,omitempty"` 5131 // SourcePeer - The peer this route was learned from 5132 SourcePeer *string `json:"sourcePeer,omitempty"` 5133 // Origin - The source this route was learned from 5134 Origin *string `json:"origin,omitempty"` 5135 // AsPath - The route's AS path sequence 5136 AsPath *string `json:"asPath,omitempty"` 5137 // Weight - The route's weight 5138 Weight *int32 `json:"weight,omitempty"` 5139} 5140 5141// GatewayRouteListResult list of virtual network gateway routes 5142type GatewayRouteListResult struct { 5143 autorest.Response `json:"-"` 5144 // Value - List of gateway routes 5145 Value *[]GatewayRoute `json:"value,omitempty"` 5146} 5147 5148// InboundNatPool inbound NAT pool of the load balancer. 5149type InboundNatPool struct { 5150 *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` 5151 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 5152 Name *string `json:"name,omitempty"` 5153 // Etag - A unique read-only string that changes whenever the resource is updated. 5154 Etag *string `json:"etag,omitempty"` 5155 // ID - Resource ID. 5156 ID *string `json:"id,omitempty"` 5157} 5158 5159// MarshalJSON is the custom marshaler for InboundNatPool. 5160func (inp InboundNatPool) MarshalJSON() ([]byte, error) { 5161 objectMap := make(map[string]interface{}) 5162 if inp.InboundNatPoolPropertiesFormat != nil { 5163 objectMap["properties"] = inp.InboundNatPoolPropertiesFormat 5164 } 5165 if inp.Name != nil { 5166 objectMap["name"] = inp.Name 5167 } 5168 if inp.Etag != nil { 5169 objectMap["etag"] = inp.Etag 5170 } 5171 if inp.ID != nil { 5172 objectMap["id"] = inp.ID 5173 } 5174 return json.Marshal(objectMap) 5175} 5176 5177// UnmarshalJSON is the custom unmarshaler for InboundNatPool struct. 5178func (inp *InboundNatPool) UnmarshalJSON(body []byte) error { 5179 var m map[string]*json.RawMessage 5180 err := json.Unmarshal(body, &m) 5181 if err != nil { 5182 return err 5183 } 5184 for k, v := range m { 5185 switch k { 5186 case "properties": 5187 if v != nil { 5188 var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat 5189 err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat) 5190 if err != nil { 5191 return err 5192 } 5193 inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat 5194 } 5195 case "name": 5196 if v != nil { 5197 var name string 5198 err = json.Unmarshal(*v, &name) 5199 if err != nil { 5200 return err 5201 } 5202 inp.Name = &name 5203 } 5204 case "etag": 5205 if v != nil { 5206 var etag string 5207 err = json.Unmarshal(*v, &etag) 5208 if err != nil { 5209 return err 5210 } 5211 inp.Etag = &etag 5212 } 5213 case "id": 5214 if v != nil { 5215 var ID string 5216 err = json.Unmarshal(*v, &ID) 5217 if err != nil { 5218 return err 5219 } 5220 inp.ID = &ID 5221 } 5222 } 5223 } 5224 5225 return nil 5226} 5227 5228// InboundNatPoolPropertiesFormat properties of Inbound NAT pool. 5229type InboundNatPoolPropertiesFormat struct { 5230 // FrontendIPConfiguration - A reference to frontend IP addresses. 5231 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 5232 // Protocol - The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 5233 Protocol TransportProtocol `json:"protocol,omitempty"` 5234 // 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. 5235 FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"` 5236 // 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. 5237 FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"` 5238 // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. 5239 BackendPort *int32 `json:"backendPort,omitempty"` 5240 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5241 ProvisioningState *string `json:"provisioningState,omitempty"` 5242} 5243 5244// InboundNatRule inbound NAT rule of the load balancer. 5245type InboundNatRule struct { 5246 *InboundNatRulePropertiesFormat `json:"properties,omitempty"` 5247 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 5248 Name *string `json:"name,omitempty"` 5249 // Etag - A unique read-only string that changes whenever the resource is updated. 5250 Etag *string `json:"etag,omitempty"` 5251 // ID - Resource ID. 5252 ID *string `json:"id,omitempty"` 5253} 5254 5255// MarshalJSON is the custom marshaler for InboundNatRule. 5256func (inr InboundNatRule) MarshalJSON() ([]byte, error) { 5257 objectMap := make(map[string]interface{}) 5258 if inr.InboundNatRulePropertiesFormat != nil { 5259 objectMap["properties"] = inr.InboundNatRulePropertiesFormat 5260 } 5261 if inr.Name != nil { 5262 objectMap["name"] = inr.Name 5263 } 5264 if inr.Etag != nil { 5265 objectMap["etag"] = inr.Etag 5266 } 5267 if inr.ID != nil { 5268 objectMap["id"] = inr.ID 5269 } 5270 return json.Marshal(objectMap) 5271} 5272 5273// UnmarshalJSON is the custom unmarshaler for InboundNatRule struct. 5274func (inr *InboundNatRule) UnmarshalJSON(body []byte) error { 5275 var m map[string]*json.RawMessage 5276 err := json.Unmarshal(body, &m) 5277 if err != nil { 5278 return err 5279 } 5280 for k, v := range m { 5281 switch k { 5282 case "properties": 5283 if v != nil { 5284 var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat 5285 err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat) 5286 if err != nil { 5287 return err 5288 } 5289 inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat 5290 } 5291 case "name": 5292 if v != nil { 5293 var name string 5294 err = json.Unmarshal(*v, &name) 5295 if err != nil { 5296 return err 5297 } 5298 inr.Name = &name 5299 } 5300 case "etag": 5301 if v != nil { 5302 var etag string 5303 err = json.Unmarshal(*v, &etag) 5304 if err != nil { 5305 return err 5306 } 5307 inr.Etag = &etag 5308 } 5309 case "id": 5310 if v != nil { 5311 var ID string 5312 err = json.Unmarshal(*v, &ID) 5313 if err != nil { 5314 return err 5315 } 5316 inr.ID = &ID 5317 } 5318 } 5319 } 5320 5321 return nil 5322} 5323 5324// InboundNatRulePropertiesFormat properties of the inbound NAT rule. 5325type InboundNatRulePropertiesFormat struct { 5326 // FrontendIPConfiguration - A reference to frontend IP addresses. 5327 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 5328 // 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. 5329 BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` 5330 // Protocol - The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 5331 Protocol TransportProtocol `json:"protocol,omitempty"` 5332 // 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. 5333 FrontendPort *int32 `json:"frontendPort,omitempty"` 5334 // BackendPort - The port used for the internal endpoint. Acceptable values range from 1 to 65535. 5335 BackendPort *int32 `json:"backendPort,omitempty"` 5336 // 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. 5337 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 5338 // 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. 5339 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 5340 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5341 ProvisioningState *string `json:"provisioningState,omitempty"` 5342} 5343 5344// Interface a network interface in a resource group. 5345type Interface struct { 5346 autorest.Response `json:"-"` 5347 *InterfacePropertiesFormat `json:"properties,omitempty"` 5348 // Etag - A unique read-only string that changes whenever the resource is updated. 5349 Etag *string `json:"etag,omitempty"` 5350 // ID - Resource ID. 5351 ID *string `json:"id,omitempty"` 5352 // Name - Resource name. 5353 Name *string `json:"name,omitempty"` 5354 // Type - Resource type. 5355 Type *string `json:"type,omitempty"` 5356 // Location - Resource location. 5357 Location *string `json:"location,omitempty"` 5358 // Tags - Resource tags. 5359 Tags map[string]*string `json:"tags"` 5360} 5361 5362// MarshalJSON is the custom marshaler for Interface. 5363func (i Interface) MarshalJSON() ([]byte, error) { 5364 objectMap := make(map[string]interface{}) 5365 if i.InterfacePropertiesFormat != nil { 5366 objectMap["properties"] = i.InterfacePropertiesFormat 5367 } 5368 if i.Etag != nil { 5369 objectMap["etag"] = i.Etag 5370 } 5371 if i.ID != nil { 5372 objectMap["id"] = i.ID 5373 } 5374 if i.Name != nil { 5375 objectMap["name"] = i.Name 5376 } 5377 if i.Type != nil { 5378 objectMap["type"] = i.Type 5379 } 5380 if i.Location != nil { 5381 objectMap["location"] = i.Location 5382 } 5383 if i.Tags != nil { 5384 objectMap["tags"] = i.Tags 5385 } 5386 return json.Marshal(objectMap) 5387} 5388 5389// UnmarshalJSON is the custom unmarshaler for Interface struct. 5390func (i *Interface) UnmarshalJSON(body []byte) error { 5391 var m map[string]*json.RawMessage 5392 err := json.Unmarshal(body, &m) 5393 if err != nil { 5394 return err 5395 } 5396 for k, v := range m { 5397 switch k { 5398 case "properties": 5399 if v != nil { 5400 var interfacePropertiesFormat InterfacePropertiesFormat 5401 err = json.Unmarshal(*v, &interfacePropertiesFormat) 5402 if err != nil { 5403 return err 5404 } 5405 i.InterfacePropertiesFormat = &interfacePropertiesFormat 5406 } 5407 case "etag": 5408 if v != nil { 5409 var etag string 5410 err = json.Unmarshal(*v, &etag) 5411 if err != nil { 5412 return err 5413 } 5414 i.Etag = &etag 5415 } 5416 case "id": 5417 if v != nil { 5418 var ID string 5419 err = json.Unmarshal(*v, &ID) 5420 if err != nil { 5421 return err 5422 } 5423 i.ID = &ID 5424 } 5425 case "name": 5426 if v != nil { 5427 var name string 5428 err = json.Unmarshal(*v, &name) 5429 if err != nil { 5430 return err 5431 } 5432 i.Name = &name 5433 } 5434 case "type": 5435 if v != nil { 5436 var typeVar string 5437 err = json.Unmarshal(*v, &typeVar) 5438 if err != nil { 5439 return err 5440 } 5441 i.Type = &typeVar 5442 } 5443 case "location": 5444 if v != nil { 5445 var location string 5446 err = json.Unmarshal(*v, &location) 5447 if err != nil { 5448 return err 5449 } 5450 i.Location = &location 5451 } 5452 case "tags": 5453 if v != nil { 5454 var tags map[string]*string 5455 err = json.Unmarshal(*v, &tags) 5456 if err != nil { 5457 return err 5458 } 5459 i.Tags = tags 5460 } 5461 } 5462 } 5463 5464 return nil 5465} 5466 5467// InterfaceAssociation network interface and its custom security rules. 5468type InterfaceAssociation struct { 5469 // ID - Network interface ID. 5470 ID *string `json:"id,omitempty"` 5471 // SecurityRules - Collection of custom security rules. 5472 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 5473} 5474 5475// InterfaceDNSSettings DNS settings of a network interface. 5476type InterfaceDNSSettings struct { 5477 // 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. 5478 DNSServers *[]string `json:"dnsServers,omitempty"` 5479 // 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. 5480 AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` 5481 // InternalDNSNameLabel - Relative DNS name for this NIC used for internal communications between VMs in the same virtual network. 5482 InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"` 5483 // InternalFqdn - Fully qualified DNS name supporting internal communications between VMs in the same virtual network. 5484 InternalFqdn *string `json:"internalFqdn,omitempty"` 5485 // InternalDomainNameSuffix - Even if internalDnsNameLabel is not specified, a DNS entry is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of internalDomainNameSuffix. 5486 InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` 5487} 5488 5489// InterfaceIPConfiguration iPConfiguration in a network interface. 5490type InterfaceIPConfiguration struct { 5491 *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` 5492 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 5493 Name *string `json:"name,omitempty"` 5494 // Etag - A unique read-only string that changes whenever the resource is updated. 5495 Etag *string `json:"etag,omitempty"` 5496 // ID - Resource ID. 5497 ID *string `json:"id,omitempty"` 5498} 5499 5500// MarshalJSON is the custom marshaler for InterfaceIPConfiguration. 5501func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) { 5502 objectMap := make(map[string]interface{}) 5503 if iic.InterfaceIPConfigurationPropertiesFormat != nil { 5504 objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat 5505 } 5506 if iic.Name != nil { 5507 objectMap["name"] = iic.Name 5508 } 5509 if iic.Etag != nil { 5510 objectMap["etag"] = iic.Etag 5511 } 5512 if iic.ID != nil { 5513 objectMap["id"] = iic.ID 5514 } 5515 return json.Marshal(objectMap) 5516} 5517 5518// UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct. 5519func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error { 5520 var m map[string]*json.RawMessage 5521 err := json.Unmarshal(body, &m) 5522 if err != nil { 5523 return err 5524 } 5525 for k, v := range m { 5526 switch k { 5527 case "properties": 5528 if v != nil { 5529 var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat 5530 err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat) 5531 if err != nil { 5532 return err 5533 } 5534 iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat 5535 } 5536 case "name": 5537 if v != nil { 5538 var name string 5539 err = json.Unmarshal(*v, &name) 5540 if err != nil { 5541 return err 5542 } 5543 iic.Name = &name 5544 } 5545 case "etag": 5546 if v != nil { 5547 var etag string 5548 err = json.Unmarshal(*v, &etag) 5549 if err != nil { 5550 return err 5551 } 5552 iic.Etag = &etag 5553 } 5554 case "id": 5555 if v != nil { 5556 var ID string 5557 err = json.Unmarshal(*v, &ID) 5558 if err != nil { 5559 return err 5560 } 5561 iic.ID = &ID 5562 } 5563 } 5564 } 5565 5566 return nil 5567} 5568 5569// InterfaceIPConfigurationPropertiesFormat properties of IP configuration. 5570type InterfaceIPConfigurationPropertiesFormat struct { 5571 // ApplicationGatewayBackendAddressPools - The reference of ApplicationGatewayBackendAddressPool resource. 5572 ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` 5573 // LoadBalancerBackendAddressPools - The reference of LoadBalancerBackendAddressPool resource. 5574 LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` 5575 // LoadBalancerInboundNatRules - A list of references of LoadBalancerInboundNatRules. 5576 LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` 5577 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 5578 // PrivateIPAllocationMethod - Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 5579 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 5580 // PrivateIPAddressVersion - Available from Api-Version 2016-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 5581 PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` 5582 Subnet *Subnet `json:"subnet,omitempty"` 5583 // Primary - Gets whether this is a primary customer address on the network interface. 5584 Primary *bool `json:"primary,omitempty"` 5585 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 5586 ProvisioningState *string `json:"provisioningState,omitempty"` 5587} 5588 5589// InterfaceListResult response for the ListNetworkInterface API service call. 5590type InterfaceListResult struct { 5591 autorest.Response `json:"-"` 5592 // Value - A list of network interfaces in a resource group. 5593 Value *[]Interface `json:"value,omitempty"` 5594 // NextLink - The URL to get the next set of results. 5595 NextLink *string `json:"nextLink,omitempty"` 5596} 5597 5598// InterfaceListResultIterator provides access to a complete listing of Interface values. 5599type InterfaceListResultIterator struct { 5600 i int 5601 page InterfaceListResultPage 5602} 5603 5604// Next advances to the next value. If there was an error making 5605// the request the iterator does not advance and the error is returned. 5606func (iter *InterfaceListResultIterator) Next() error { 5607 iter.i++ 5608 if iter.i < len(iter.page.Values()) { 5609 return nil 5610 } 5611 err := iter.page.Next() 5612 if err != nil { 5613 iter.i-- 5614 return err 5615 } 5616 iter.i = 0 5617 return nil 5618} 5619 5620// NotDone returns true if the enumeration should be started or is not yet complete. 5621func (iter InterfaceListResultIterator) NotDone() bool { 5622 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5623} 5624 5625// Response returns the raw server response from the last page request. 5626func (iter InterfaceListResultIterator) Response() InterfaceListResult { 5627 return iter.page.Response() 5628} 5629 5630// Value returns the current value or a zero-initialized value if the 5631// iterator has advanced beyond the end of the collection. 5632func (iter InterfaceListResultIterator) Value() Interface { 5633 if !iter.page.NotDone() { 5634 return Interface{} 5635 } 5636 return iter.page.Values()[iter.i] 5637} 5638 5639// IsEmpty returns true if the ListResult contains no values. 5640func (ilr InterfaceListResult) IsEmpty() bool { 5641 return ilr.Value == nil || len(*ilr.Value) == 0 5642} 5643 5644// interfaceListResultPreparer prepares a request to retrieve the next set of results. 5645// It returns nil if no more results exist. 5646func (ilr InterfaceListResult) interfaceListResultPreparer() (*http.Request, error) { 5647 if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { 5648 return nil, nil 5649 } 5650 return autorest.Prepare(&http.Request{}, 5651 autorest.AsJSON(), 5652 autorest.AsGet(), 5653 autorest.WithBaseURL(to.String(ilr.NextLink))) 5654} 5655 5656// InterfaceListResultPage contains a page of Interface values. 5657type InterfaceListResultPage struct { 5658 fn func(InterfaceListResult) (InterfaceListResult, error) 5659 ilr InterfaceListResult 5660} 5661 5662// Next advances to the next page of values. If there was an error making 5663// the request the page does not advance and the error is returned. 5664func (page *InterfaceListResultPage) Next() error { 5665 next, err := page.fn(page.ilr) 5666 if err != nil { 5667 return err 5668 } 5669 page.ilr = next 5670 return nil 5671} 5672 5673// NotDone returns true if the page enumeration should be started or is not yet complete. 5674func (page InterfaceListResultPage) NotDone() bool { 5675 return !page.ilr.IsEmpty() 5676} 5677 5678// Response returns the raw server response from the last page request. 5679func (page InterfaceListResultPage) Response() InterfaceListResult { 5680 return page.ilr 5681} 5682 5683// Values returns the slice of values for the current page or nil if there are no values. 5684func (page InterfaceListResultPage) Values() []Interface { 5685 if page.ilr.IsEmpty() { 5686 return nil 5687 } 5688 return *page.ilr.Value 5689} 5690 5691// InterfacePropertiesFormat networkInterface properties. 5692type InterfacePropertiesFormat struct { 5693 // VirtualMachine - The reference of a virtual machine. 5694 VirtualMachine *SubResource `json:"virtualMachine,omitempty"` 5695 // NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource. 5696 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 5697 // IPConfigurations - A list of IPConfigurations of the network interface. 5698 IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"` 5699 // DNSSettings - The DNS settings in network interface. 5700 DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` 5701 // MacAddress - The MAC address of the network interface. 5702 MacAddress *string `json:"macAddress,omitempty"` 5703 // Primary - Gets whether this is a primary network interface on a virtual machine. 5704 Primary *bool `json:"primary,omitempty"` 5705 // EnableAcceleratedNetworking - If the network interface is accelerated networking enabled. 5706 EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` 5707 // EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface. 5708 EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` 5709 // ResourceGUID - The resource GUID property of the network interface resource. 5710 ResourceGUID *string `json:"resourceGuid,omitempty"` 5711 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 5712 ProvisioningState *string `json:"provisioningState,omitempty"` 5713} 5714 5715// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 5716// operation. 5717type InterfacesCreateOrUpdateFuture struct { 5718 azure.Future 5719 req *http.Request 5720} 5721 5722// Result returns the result of the asynchronous operation. 5723// If the operation has not completed it will return an error. 5724func (future InterfacesCreateOrUpdateFuture) Result(client InterfacesClient) (i Interface, err error) { 5725 var done bool 5726 done, err = future.Done(client) 5727 if err != nil { 5728 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 5729 return 5730 } 5731 if !done { 5732 return i, azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture") 5733 } 5734 if future.PollingMethod() == azure.PollingLocation { 5735 i, err = client.CreateOrUpdateResponder(future.Response()) 5736 if err != nil { 5737 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 5738 } 5739 return 5740 } 5741 var req *http.Request 5742 var resp *http.Response 5743 if future.PollingURL() != "" { 5744 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 5745 if err != nil { 5746 return 5747 } 5748 } else { 5749 req = autorest.ChangeToGet(future.req) 5750 } 5751 resp, err = autorest.SendWithSender(client, req, 5752 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5753 if err != nil { 5754 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", resp, "Failure sending request") 5755 return 5756 } 5757 i, err = client.CreateOrUpdateResponder(resp) 5758 if err != nil { 5759 err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 5760 } 5761 return 5762} 5763 5764// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 5765type InterfacesDeleteFuture struct { 5766 azure.Future 5767 req *http.Request 5768} 5769 5770// Result returns the result of the asynchronous operation. 5771// If the operation has not completed it will return an error. 5772func (future InterfacesDeleteFuture) Result(client InterfacesClient) (ar autorest.Response, err error) { 5773 var done bool 5774 done, err = future.Done(client) 5775 if err != nil { 5776 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure") 5777 return 5778 } 5779 if !done { 5780 return ar, azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture") 5781 } 5782 if future.PollingMethod() == azure.PollingLocation { 5783 ar, err = client.DeleteResponder(future.Response()) 5784 if err != nil { 5785 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Failure responding to request") 5786 } 5787 return 5788 } 5789 var req *http.Request 5790 var resp *http.Response 5791 if future.PollingURL() != "" { 5792 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 5793 if err != nil { 5794 return 5795 } 5796 } else { 5797 req = autorest.ChangeToGet(future.req) 5798 } 5799 resp, err = autorest.SendWithSender(client, req, 5800 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5801 if err != nil { 5802 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", resp, "Failure sending request") 5803 return 5804 } 5805 ar, err = client.DeleteResponder(resp) 5806 if err != nil { 5807 err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", resp, "Failure responding to request") 5808 } 5809 return 5810} 5811 5812// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a 5813// long-running operation. 5814type InterfacesGetEffectiveRouteTableFuture struct { 5815 azure.Future 5816 req *http.Request 5817} 5818 5819// Result returns the result of the asynchronous operation. 5820// If the operation has not completed it will return an error. 5821func (future InterfacesGetEffectiveRouteTableFuture) Result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) { 5822 var done bool 5823 done, err = future.Done(client) 5824 if err != nil { 5825 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure") 5826 return 5827 } 5828 if !done { 5829 return erlr, azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture") 5830 } 5831 if future.PollingMethod() == azure.PollingLocation { 5832 erlr, err = client.GetEffectiveRouteTableResponder(future.Response()) 5833 if err != nil { 5834 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Failure responding to request") 5835 } 5836 return 5837 } 5838 var req *http.Request 5839 var resp *http.Response 5840 if future.PollingURL() != "" { 5841 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 5842 if err != nil { 5843 return 5844 } 5845 } else { 5846 req = autorest.ChangeToGet(future.req) 5847 } 5848 resp, err = autorest.SendWithSender(client, req, 5849 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5850 if err != nil { 5851 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", resp, "Failure sending request") 5852 return 5853 } 5854 erlr, err = client.GetEffectiveRouteTableResponder(resp) 5855 if err != nil { 5856 err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", resp, "Failure responding to request") 5857 } 5858 return 5859} 5860 5861// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the results of a 5862// long-running operation. 5863type InterfacesListEffectiveNetworkSecurityGroupsFuture struct { 5864 azure.Future 5865 req *http.Request 5866} 5867 5868// Result returns the result of the asynchronous operation. 5869// If the operation has not completed it will return an error. 5870func (future InterfacesListEffectiveNetworkSecurityGroupsFuture) Result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) { 5871 var done bool 5872 done, err = future.Done(client) 5873 if err != nil { 5874 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure") 5875 return 5876 } 5877 if !done { 5878 return ensglr, azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture") 5879 } 5880 if future.PollingMethod() == azure.PollingLocation { 5881 ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(future.Response()) 5882 if err != nil { 5883 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Failure responding to request") 5884 } 5885 return 5886 } 5887 var req *http.Request 5888 var resp *http.Response 5889 if future.PollingURL() != "" { 5890 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 5891 if err != nil { 5892 return 5893 } 5894 } else { 5895 req = autorest.ChangeToGet(future.req) 5896 } 5897 resp, err = autorest.SendWithSender(client, req, 5898 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5899 if err != nil { 5900 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", resp, "Failure sending request") 5901 return 5902 } 5903 ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(resp) 5904 if err != nil { 5905 err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", resp, "Failure responding to request") 5906 } 5907 return 5908} 5909 5910// IPAddressAvailabilityResult response for CheckIPAddressAvailability API service call 5911type IPAddressAvailabilityResult struct { 5912 autorest.Response `json:"-"` 5913 // Available - Private IP address availability. 5914 Available *bool `json:"available,omitempty"` 5915 // AvailableIPAddresses - Contains other available private IP addresses if the asked for address is taken. 5916 AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` 5917} 5918 5919// IPConfiguration iPConfiguration 5920type IPConfiguration struct { 5921 *IPConfigurationPropertiesFormat `json:"properties,omitempty"` 5922 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 5923 Name *string `json:"name,omitempty"` 5924 // Etag - A unique read-only string that changes whenever the resource is updated. 5925 Etag *string `json:"etag,omitempty"` 5926 // ID - Resource ID. 5927 ID *string `json:"id,omitempty"` 5928} 5929 5930// MarshalJSON is the custom marshaler for IPConfiguration. 5931func (ic IPConfiguration) MarshalJSON() ([]byte, error) { 5932 objectMap := make(map[string]interface{}) 5933 if ic.IPConfigurationPropertiesFormat != nil { 5934 objectMap["properties"] = ic.IPConfigurationPropertiesFormat 5935 } 5936 if ic.Name != nil { 5937 objectMap["name"] = ic.Name 5938 } 5939 if ic.Etag != nil { 5940 objectMap["etag"] = ic.Etag 5941 } 5942 if ic.ID != nil { 5943 objectMap["id"] = ic.ID 5944 } 5945 return json.Marshal(objectMap) 5946} 5947 5948// UnmarshalJSON is the custom unmarshaler for IPConfiguration struct. 5949func (ic *IPConfiguration) UnmarshalJSON(body []byte) error { 5950 var m map[string]*json.RawMessage 5951 err := json.Unmarshal(body, &m) 5952 if err != nil { 5953 return err 5954 } 5955 for k, v := range m { 5956 switch k { 5957 case "properties": 5958 if v != nil { 5959 var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat 5960 err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat) 5961 if err != nil { 5962 return err 5963 } 5964 ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat 5965 } 5966 case "name": 5967 if v != nil { 5968 var name string 5969 err = json.Unmarshal(*v, &name) 5970 if err != nil { 5971 return err 5972 } 5973 ic.Name = &name 5974 } 5975 case "etag": 5976 if v != nil { 5977 var etag string 5978 err = json.Unmarshal(*v, &etag) 5979 if err != nil { 5980 return err 5981 } 5982 ic.Etag = &etag 5983 } 5984 case "id": 5985 if v != nil { 5986 var ID string 5987 err = json.Unmarshal(*v, &ID) 5988 if err != nil { 5989 return err 5990 } 5991 ic.ID = &ID 5992 } 5993 } 5994 } 5995 5996 return nil 5997} 5998 5999// IPConfigurationPropertiesFormat properties of IP configuration. 6000type IPConfigurationPropertiesFormat struct { 6001 // PrivateIPAddress - The private IP address of the IP configuration. 6002 PrivateIPAddress *string `json:"privateIPAddress,omitempty"` 6003 // PrivateIPAllocationMethod - The private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 6004 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 6005 // Subnet - The reference of the subnet resource. 6006 Subnet *Subnet `json:"subnet,omitempty"` 6007 // PublicIPAddress - The reference of the public IP resource. 6008 PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` 6009 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6010 ProvisioningState *string `json:"provisioningState,omitempty"` 6011} 6012 6013// IpsecPolicy an IPSec Policy configuration for a virtual network gateway connection 6014type IpsecPolicy struct { 6015 // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. 6016 SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` 6017 // SaDataSizeKilobytes - The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB for a site to site VPN tunnel. 6018 SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` 6019 // IpsecEncryption - The IPSec encryption algorithm (IKE phase 1). Possible values include: 'IpsecEncryptionNone', 'IpsecEncryptionDES', 'IpsecEncryptionDES3', 'IpsecEncryptionAES128', 'IpsecEncryptionAES192', 'IpsecEncryptionAES256', 'IpsecEncryptionGCMAES128', 'IpsecEncryptionGCMAES192', 'IpsecEncryptionGCMAES256' 6020 IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` 6021 // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' 6022 IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` 6023 // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256' 6024 IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` 6025 // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'MD5', 'SHA1', 'SHA256', 'SHA384' 6026 IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` 6027 // DhGroup - The DH Groups used in IKE Phase 1 for initial SA. Possible values include: 'None', 'DHGroup1', 'DHGroup2', 'DHGroup14', 'DHGroup2048', 'ECP256', 'ECP384', 'DHGroup24' 6028 DhGroup DhGroup `json:"dhGroup,omitempty"` 6029 // PfsGroup - The DH Groups used in IKE Phase 2 for new child SA. Possible values include: 'PfsGroupNone', 'PfsGroupPFS1', 'PfsGroupPFS2', 'PfsGroupPFS2048', 'PfsGroupECP256', 'PfsGroupECP384', 'PfsGroupPFS24' 6030 PfsGroup PfsGroup `json:"pfsGroup,omitempty"` 6031} 6032 6033// Ipv6ExpressRouteCircuitPeeringConfig contains IPv6 peering config. 6034type Ipv6ExpressRouteCircuitPeeringConfig struct { 6035 // PrimaryPeerAddressPrefix - The primary address prefix. 6036 PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` 6037 // SecondaryPeerAddressPrefix - The secondary address prefix. 6038 SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` 6039 // MicrosoftPeeringConfig - The Microsoft peering configuration. 6040 MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` 6041 // RouteFilter - The reference of the RouteFilter resource. 6042 RouteFilter *RouteFilter `json:"routeFilter,omitempty"` 6043 // State - The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled' 6044 State ExpressRouteCircuitPeeringState `json:"state,omitempty"` 6045} 6046 6047// LoadBalancer loadBalancer resource 6048type LoadBalancer struct { 6049 autorest.Response `json:"-"` 6050 *LoadBalancerPropertiesFormat `json:"properties,omitempty"` 6051 // Etag - A unique read-only string that changes whenever the resource is updated. 6052 Etag *string `json:"etag,omitempty"` 6053 // ID - Resource ID. 6054 ID *string `json:"id,omitempty"` 6055 // Name - Resource name. 6056 Name *string `json:"name,omitempty"` 6057 // Type - Resource type. 6058 Type *string `json:"type,omitempty"` 6059 // Location - Resource location. 6060 Location *string `json:"location,omitempty"` 6061 // Tags - Resource tags. 6062 Tags map[string]*string `json:"tags"` 6063} 6064 6065// MarshalJSON is the custom marshaler for LoadBalancer. 6066func (lb LoadBalancer) MarshalJSON() ([]byte, error) { 6067 objectMap := make(map[string]interface{}) 6068 if lb.LoadBalancerPropertiesFormat != nil { 6069 objectMap["properties"] = lb.LoadBalancerPropertiesFormat 6070 } 6071 if lb.Etag != nil { 6072 objectMap["etag"] = lb.Etag 6073 } 6074 if lb.ID != nil { 6075 objectMap["id"] = lb.ID 6076 } 6077 if lb.Name != nil { 6078 objectMap["name"] = lb.Name 6079 } 6080 if lb.Type != nil { 6081 objectMap["type"] = lb.Type 6082 } 6083 if lb.Location != nil { 6084 objectMap["location"] = lb.Location 6085 } 6086 if lb.Tags != nil { 6087 objectMap["tags"] = lb.Tags 6088 } 6089 return json.Marshal(objectMap) 6090} 6091 6092// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct. 6093func (lb *LoadBalancer) UnmarshalJSON(body []byte) error { 6094 var m map[string]*json.RawMessage 6095 err := json.Unmarshal(body, &m) 6096 if err != nil { 6097 return err 6098 } 6099 for k, v := range m { 6100 switch k { 6101 case "properties": 6102 if v != nil { 6103 var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat 6104 err = json.Unmarshal(*v, &loadBalancerPropertiesFormat) 6105 if err != nil { 6106 return err 6107 } 6108 lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat 6109 } 6110 case "etag": 6111 if v != nil { 6112 var etag string 6113 err = json.Unmarshal(*v, &etag) 6114 if err != nil { 6115 return err 6116 } 6117 lb.Etag = &etag 6118 } 6119 case "id": 6120 if v != nil { 6121 var ID string 6122 err = json.Unmarshal(*v, &ID) 6123 if err != nil { 6124 return err 6125 } 6126 lb.ID = &ID 6127 } 6128 case "name": 6129 if v != nil { 6130 var name string 6131 err = json.Unmarshal(*v, &name) 6132 if err != nil { 6133 return err 6134 } 6135 lb.Name = &name 6136 } 6137 case "type": 6138 if v != nil { 6139 var typeVar string 6140 err = json.Unmarshal(*v, &typeVar) 6141 if err != nil { 6142 return err 6143 } 6144 lb.Type = &typeVar 6145 } 6146 case "location": 6147 if v != nil { 6148 var location string 6149 err = json.Unmarshal(*v, &location) 6150 if err != nil { 6151 return err 6152 } 6153 lb.Location = &location 6154 } 6155 case "tags": 6156 if v != nil { 6157 var tags map[string]*string 6158 err = json.Unmarshal(*v, &tags) 6159 if err != nil { 6160 return err 6161 } 6162 lb.Tags = tags 6163 } 6164 } 6165 } 6166 6167 return nil 6168} 6169 6170// LoadBalancerListResult response for ListLoadBalancers API service call. 6171type LoadBalancerListResult struct { 6172 autorest.Response `json:"-"` 6173 // Value - A list of load balancers in a resource group. 6174 Value *[]LoadBalancer `json:"value,omitempty"` 6175 // NextLink - The URL to get the next set of results. 6176 NextLink *string `json:"nextLink,omitempty"` 6177} 6178 6179// LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values. 6180type LoadBalancerListResultIterator struct { 6181 i int 6182 page LoadBalancerListResultPage 6183} 6184 6185// Next advances to the next value. If there was an error making 6186// the request the iterator does not advance and the error is returned. 6187func (iter *LoadBalancerListResultIterator) Next() error { 6188 iter.i++ 6189 if iter.i < len(iter.page.Values()) { 6190 return nil 6191 } 6192 err := iter.page.Next() 6193 if err != nil { 6194 iter.i-- 6195 return err 6196 } 6197 iter.i = 0 6198 return nil 6199} 6200 6201// NotDone returns true if the enumeration should be started or is not yet complete. 6202func (iter LoadBalancerListResultIterator) NotDone() bool { 6203 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6204} 6205 6206// Response returns the raw server response from the last page request. 6207func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult { 6208 return iter.page.Response() 6209} 6210 6211// Value returns the current value or a zero-initialized value if the 6212// iterator has advanced beyond the end of the collection. 6213func (iter LoadBalancerListResultIterator) Value() LoadBalancer { 6214 if !iter.page.NotDone() { 6215 return LoadBalancer{} 6216 } 6217 return iter.page.Values()[iter.i] 6218} 6219 6220// IsEmpty returns true if the ListResult contains no values. 6221func (lblr LoadBalancerListResult) IsEmpty() bool { 6222 return lblr.Value == nil || len(*lblr.Value) == 0 6223} 6224 6225// loadBalancerListResultPreparer prepares a request to retrieve the next set of results. 6226// It returns nil if no more results exist. 6227func (lblr LoadBalancerListResult) loadBalancerListResultPreparer() (*http.Request, error) { 6228 if lblr.NextLink == nil || len(to.String(lblr.NextLink)) < 1 { 6229 return nil, nil 6230 } 6231 return autorest.Prepare(&http.Request{}, 6232 autorest.AsJSON(), 6233 autorest.AsGet(), 6234 autorest.WithBaseURL(to.String(lblr.NextLink))) 6235} 6236 6237// LoadBalancerListResultPage contains a page of LoadBalancer values. 6238type LoadBalancerListResultPage struct { 6239 fn func(LoadBalancerListResult) (LoadBalancerListResult, error) 6240 lblr LoadBalancerListResult 6241} 6242 6243// Next advances to the next page of values. If there was an error making 6244// the request the page does not advance and the error is returned. 6245func (page *LoadBalancerListResultPage) Next() error { 6246 next, err := page.fn(page.lblr) 6247 if err != nil { 6248 return err 6249 } 6250 page.lblr = next 6251 return nil 6252} 6253 6254// NotDone returns true if the page enumeration should be started or is not yet complete. 6255func (page LoadBalancerListResultPage) NotDone() bool { 6256 return !page.lblr.IsEmpty() 6257} 6258 6259// Response returns the raw server response from the last page request. 6260func (page LoadBalancerListResultPage) Response() LoadBalancerListResult { 6261 return page.lblr 6262} 6263 6264// Values returns the slice of values for the current page or nil if there are no values. 6265func (page LoadBalancerListResultPage) Values() []LoadBalancer { 6266 if page.lblr.IsEmpty() { 6267 return nil 6268 } 6269 return *page.lblr.Value 6270} 6271 6272// LoadBalancerPropertiesFormat properties of the load balancer. 6273type LoadBalancerPropertiesFormat struct { 6274 // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer 6275 FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` 6276 // BackendAddressPools - Collection of backend address pools used by a load balancer 6277 BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` 6278 // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning 6279 LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` 6280 // Probes - Collection of probe objects used in the load balancer 6281 Probes *[]Probe `json:"probes,omitempty"` 6282 // 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. 6283 InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` 6284 // 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. 6285 InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` 6286 // OutboundNatRules - The outbound NAT rules. 6287 OutboundNatRules *[]OutboundNatRule `json:"outboundNatRules,omitempty"` 6288 // ResourceGUID - The resource GUID property of the load balancer resource. 6289 ResourceGUID *string `json:"resourceGuid,omitempty"` 6290 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6291 ProvisioningState *string `json:"provisioningState,omitempty"` 6292} 6293 6294// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 6295// operation. 6296type LoadBalancersCreateOrUpdateFuture struct { 6297 azure.Future 6298 req *http.Request 6299} 6300 6301// Result returns the result of the asynchronous operation. 6302// If the operation has not completed it will return an error. 6303func (future LoadBalancersCreateOrUpdateFuture) Result(client LoadBalancersClient) (lb LoadBalancer, err error) { 6304 var done bool 6305 done, err = future.Done(client) 6306 if err != nil { 6307 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6308 return 6309 } 6310 if !done { 6311 return lb, azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") 6312 } 6313 if future.PollingMethod() == azure.PollingLocation { 6314 lb, err = client.CreateOrUpdateResponder(future.Response()) 6315 if err != nil { 6316 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 6317 } 6318 return 6319 } 6320 var req *http.Request 6321 var resp *http.Response 6322 if future.PollingURL() != "" { 6323 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 6324 if err != nil { 6325 return 6326 } 6327 } else { 6328 req = autorest.ChangeToGet(future.req) 6329 } 6330 resp, err = autorest.SendWithSender(client, req, 6331 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6332 if err != nil { 6333 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", resp, "Failure sending request") 6334 return 6335 } 6336 lb, err = client.CreateOrUpdateResponder(resp) 6337 if err != nil { 6338 err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 6339 } 6340 return 6341} 6342 6343// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 6344type LoadBalancersDeleteFuture struct { 6345 azure.Future 6346 req *http.Request 6347} 6348 6349// Result returns the result of the asynchronous operation. 6350// If the operation has not completed it will return an error. 6351func (future LoadBalancersDeleteFuture) Result(client LoadBalancersClient) (ar autorest.Response, err error) { 6352 var done bool 6353 done, err = future.Done(client) 6354 if err != nil { 6355 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") 6356 return 6357 } 6358 if !done { 6359 return ar, azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") 6360 } 6361 if future.PollingMethod() == azure.PollingLocation { 6362 ar, err = client.DeleteResponder(future.Response()) 6363 if err != nil { 6364 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Failure responding to request") 6365 } 6366 return 6367 } 6368 var req *http.Request 6369 var resp *http.Response 6370 if future.PollingURL() != "" { 6371 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 6372 if err != nil { 6373 return 6374 } 6375 } else { 6376 req = autorest.ChangeToGet(future.req) 6377 } 6378 resp, err = autorest.SendWithSender(client, req, 6379 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6380 if err != nil { 6381 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", resp, "Failure sending request") 6382 return 6383 } 6384 ar, err = client.DeleteResponder(resp) 6385 if err != nil { 6386 err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", resp, "Failure responding to request") 6387 } 6388 return 6389} 6390 6391// LoadBalancingRule a load balancing rule for a load balancer. 6392type LoadBalancingRule struct { 6393 *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` 6394 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 6395 Name *string `json:"name,omitempty"` 6396 // Etag - A unique read-only string that changes whenever the resource is updated. 6397 Etag *string `json:"etag,omitempty"` 6398 // ID - Resource ID. 6399 ID *string `json:"id,omitempty"` 6400} 6401 6402// MarshalJSON is the custom marshaler for LoadBalancingRule. 6403func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { 6404 objectMap := make(map[string]interface{}) 6405 if lbr.LoadBalancingRulePropertiesFormat != nil { 6406 objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat 6407 } 6408 if lbr.Name != nil { 6409 objectMap["name"] = lbr.Name 6410 } 6411 if lbr.Etag != nil { 6412 objectMap["etag"] = lbr.Etag 6413 } 6414 if lbr.ID != nil { 6415 objectMap["id"] = lbr.ID 6416 } 6417 return json.Marshal(objectMap) 6418} 6419 6420// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. 6421func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { 6422 var m map[string]*json.RawMessage 6423 err := json.Unmarshal(body, &m) 6424 if err != nil { 6425 return err 6426 } 6427 for k, v := range m { 6428 switch k { 6429 case "properties": 6430 if v != nil { 6431 var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat 6432 err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) 6433 if err != nil { 6434 return err 6435 } 6436 lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat 6437 } 6438 case "name": 6439 if v != nil { 6440 var name string 6441 err = json.Unmarshal(*v, &name) 6442 if err != nil { 6443 return err 6444 } 6445 lbr.Name = &name 6446 } 6447 case "etag": 6448 if v != nil { 6449 var etag string 6450 err = json.Unmarshal(*v, &etag) 6451 if err != nil { 6452 return err 6453 } 6454 lbr.Etag = &etag 6455 } 6456 case "id": 6457 if v != nil { 6458 var ID string 6459 err = json.Unmarshal(*v, &ID) 6460 if err != nil { 6461 return err 6462 } 6463 lbr.ID = &ID 6464 } 6465 } 6466 } 6467 6468 return nil 6469} 6470 6471// LoadBalancingRulePropertiesFormat properties of the load balancer. 6472type LoadBalancingRulePropertiesFormat struct { 6473 // FrontendIPConfiguration - A reference to frontend IP addresses. 6474 FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` 6475 // BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. 6476 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 6477 // Probe - The reference of the load balancer probe used by the load balancing rule. 6478 Probe *SubResource `json:"probe,omitempty"` 6479 // Protocol - The transport protocol for the external endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP' 6480 Protocol TransportProtocol `json:"protocol,omitempty"` 6481 // LoadDistribution - The load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol' 6482 LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` 6483 // 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. 6484 FrontendPort *int32 `json:"frontendPort,omitempty"` 6485 // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535. 6486 BackendPort *int32 `json:"backendPort,omitempty"` 6487 // 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. 6488 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 6489 // 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. 6490 EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` 6491 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6492 ProvisioningState *string `json:"provisioningState,omitempty"` 6493} 6494 6495// LocalNetworkGateway a common class for general resource information 6496type LocalNetworkGateway struct { 6497 autorest.Response `json:"-"` 6498 *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 6499 // Etag - A unique read-only string that changes whenever the resource is updated. 6500 Etag *string `json:"etag,omitempty"` 6501 // ID - Resource ID. 6502 ID *string `json:"id,omitempty"` 6503 // Name - Resource name. 6504 Name *string `json:"name,omitempty"` 6505 // Type - Resource type. 6506 Type *string `json:"type,omitempty"` 6507 // Location - Resource location. 6508 Location *string `json:"location,omitempty"` 6509 // Tags - Resource tags. 6510 Tags map[string]*string `json:"tags"` 6511} 6512 6513// MarshalJSON is the custom marshaler for LocalNetworkGateway. 6514func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { 6515 objectMap := make(map[string]interface{}) 6516 if lng.LocalNetworkGatewayPropertiesFormat != nil { 6517 objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat 6518 } 6519 if lng.Etag != nil { 6520 objectMap["etag"] = lng.Etag 6521 } 6522 if lng.ID != nil { 6523 objectMap["id"] = lng.ID 6524 } 6525 if lng.Name != nil { 6526 objectMap["name"] = lng.Name 6527 } 6528 if lng.Type != nil { 6529 objectMap["type"] = lng.Type 6530 } 6531 if lng.Location != nil { 6532 objectMap["location"] = lng.Location 6533 } 6534 if lng.Tags != nil { 6535 objectMap["tags"] = lng.Tags 6536 } 6537 return json.Marshal(objectMap) 6538} 6539 6540// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. 6541func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { 6542 var m map[string]*json.RawMessage 6543 err := json.Unmarshal(body, &m) 6544 if err != nil { 6545 return err 6546 } 6547 for k, v := range m { 6548 switch k { 6549 case "properties": 6550 if v != nil { 6551 var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat 6552 err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) 6553 if err != nil { 6554 return err 6555 } 6556 lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat 6557 } 6558 case "etag": 6559 if v != nil { 6560 var etag string 6561 err = json.Unmarshal(*v, &etag) 6562 if err != nil { 6563 return err 6564 } 6565 lng.Etag = &etag 6566 } 6567 case "id": 6568 if v != nil { 6569 var ID string 6570 err = json.Unmarshal(*v, &ID) 6571 if err != nil { 6572 return err 6573 } 6574 lng.ID = &ID 6575 } 6576 case "name": 6577 if v != nil { 6578 var name string 6579 err = json.Unmarshal(*v, &name) 6580 if err != nil { 6581 return err 6582 } 6583 lng.Name = &name 6584 } 6585 case "type": 6586 if v != nil { 6587 var typeVar string 6588 err = json.Unmarshal(*v, &typeVar) 6589 if err != nil { 6590 return err 6591 } 6592 lng.Type = &typeVar 6593 } 6594 case "location": 6595 if v != nil { 6596 var location string 6597 err = json.Unmarshal(*v, &location) 6598 if err != nil { 6599 return err 6600 } 6601 lng.Location = &location 6602 } 6603 case "tags": 6604 if v != nil { 6605 var tags map[string]*string 6606 err = json.Unmarshal(*v, &tags) 6607 if err != nil { 6608 return err 6609 } 6610 lng.Tags = tags 6611 } 6612 } 6613 } 6614 6615 return nil 6616} 6617 6618// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call. 6619type LocalNetworkGatewayListResult struct { 6620 autorest.Response `json:"-"` 6621 // Value - A list of local network gateways that exists in a resource group. 6622 Value *[]LocalNetworkGateway `json:"value,omitempty"` 6623 // NextLink - The URL to get the next set of results. 6624 NextLink *string `json:"nextLink,omitempty"` 6625} 6626 6627// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway values. 6628type LocalNetworkGatewayListResultIterator struct { 6629 i int 6630 page LocalNetworkGatewayListResultPage 6631} 6632 6633// Next advances to the next value. If there was an error making 6634// the request the iterator does not advance and the error is returned. 6635func (iter *LocalNetworkGatewayListResultIterator) Next() error { 6636 iter.i++ 6637 if iter.i < len(iter.page.Values()) { 6638 return nil 6639 } 6640 err := iter.page.Next() 6641 if err != nil { 6642 iter.i-- 6643 return err 6644 } 6645 iter.i = 0 6646 return nil 6647} 6648 6649// NotDone returns true if the enumeration should be started or is not yet complete. 6650func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { 6651 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6652} 6653 6654// Response returns the raw server response from the last page request. 6655func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { 6656 return iter.page.Response() 6657} 6658 6659// Value returns the current value or a zero-initialized value if the 6660// iterator has advanced beyond the end of the collection. 6661func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { 6662 if !iter.page.NotDone() { 6663 return LocalNetworkGateway{} 6664 } 6665 return iter.page.Values()[iter.i] 6666} 6667 6668// IsEmpty returns true if the ListResult contains no values. 6669func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { 6670 return lnglr.Value == nil || len(*lnglr.Value) == 0 6671} 6672 6673// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 6674// It returns nil if no more results exist. 6675func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer() (*http.Request, error) { 6676 if lnglr.NextLink == nil || len(to.String(lnglr.NextLink)) < 1 { 6677 return nil, nil 6678 } 6679 return autorest.Prepare(&http.Request{}, 6680 autorest.AsJSON(), 6681 autorest.AsGet(), 6682 autorest.WithBaseURL(to.String(lnglr.NextLink))) 6683} 6684 6685// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. 6686type LocalNetworkGatewayListResultPage struct { 6687 fn func(LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) 6688 lnglr LocalNetworkGatewayListResult 6689} 6690 6691// Next advances to the next page of values. If there was an error making 6692// the request the page does not advance and the error is returned. 6693func (page *LocalNetworkGatewayListResultPage) Next() error { 6694 next, err := page.fn(page.lnglr) 6695 if err != nil { 6696 return err 6697 } 6698 page.lnglr = next 6699 return nil 6700} 6701 6702// NotDone returns true if the page enumeration should be started or is not yet complete. 6703func (page LocalNetworkGatewayListResultPage) NotDone() bool { 6704 return !page.lnglr.IsEmpty() 6705} 6706 6707// Response returns the raw server response from the last page request. 6708func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { 6709 return page.lnglr 6710} 6711 6712// Values returns the slice of values for the current page or nil if there are no values. 6713func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { 6714 if page.lnglr.IsEmpty() { 6715 return nil 6716 } 6717 return *page.lnglr.Value 6718} 6719 6720// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties 6721type LocalNetworkGatewayPropertiesFormat struct { 6722 // LocalNetworkAddressSpace - Local network site address space. 6723 LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` 6724 // GatewayIPAddress - IP address of local network gateway. 6725 GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` 6726 // BgpSettings - Local network gateway's BGP speaker settings. 6727 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 6728 // ResourceGUID - The resource GUID property of the LocalNetworkGateway resource. 6729 ResourceGUID *string `json:"resourceGuid,omitempty"` 6730 // ProvisioningState - The provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6731 ProvisioningState *string `json:"provisioningState,omitempty"` 6732} 6733 6734// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6735// long-running operation. 6736type LocalNetworkGatewaysCreateOrUpdateFuture struct { 6737 azure.Future 6738 req *http.Request 6739} 6740 6741// Result returns the result of the asynchronous operation. 6742// If the operation has not completed it will return an error. 6743func (future LocalNetworkGatewaysCreateOrUpdateFuture) Result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { 6744 var done bool 6745 done, err = future.Done(client) 6746 if err != nil { 6747 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6748 return 6749 } 6750 if !done { 6751 return lng, azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") 6752 } 6753 if future.PollingMethod() == azure.PollingLocation { 6754 lng, err = client.CreateOrUpdateResponder(future.Response()) 6755 if err != nil { 6756 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 6757 } 6758 return 6759 } 6760 var req *http.Request 6761 var resp *http.Response 6762 if future.PollingURL() != "" { 6763 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 6764 if err != nil { 6765 return 6766 } 6767 } else { 6768 req = autorest.ChangeToGet(future.req) 6769 } 6770 resp, err = autorest.SendWithSender(client, req, 6771 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6772 if err != nil { 6773 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure sending request") 6774 return 6775 } 6776 lng, err = client.CreateOrUpdateResponder(resp) 6777 if err != nil { 6778 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 6779 } 6780 return 6781} 6782 6783// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 6784// operation. 6785type LocalNetworkGatewaysDeleteFuture struct { 6786 azure.Future 6787 req *http.Request 6788} 6789 6790// Result returns the result of the asynchronous operation. 6791// If the operation has not completed it will return an error. 6792func (future LocalNetworkGatewaysDeleteFuture) Result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { 6793 var done bool 6794 done, err = future.Done(client) 6795 if err != nil { 6796 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 6797 return 6798 } 6799 if !done { 6800 return ar, azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") 6801 } 6802 if future.PollingMethod() == azure.PollingLocation { 6803 ar, err = client.DeleteResponder(future.Response()) 6804 if err != nil { 6805 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Failure responding to request") 6806 } 6807 return 6808 } 6809 var req *http.Request 6810 var resp *http.Response 6811 if future.PollingURL() != "" { 6812 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 6813 if err != nil { 6814 return 6815 } 6816 } else { 6817 req = autorest.ChangeToGet(future.req) 6818 } 6819 resp, err = autorest.SendWithSender(client, req, 6820 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6821 if err != nil { 6822 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", resp, "Failure sending request") 6823 return 6824 } 6825 ar, err = client.DeleteResponder(resp) 6826 if err != nil { 6827 err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", resp, "Failure responding to request") 6828 } 6829 return 6830} 6831 6832// NextHopParameters parameters that define the source and destination endpoint. 6833type NextHopParameters struct { 6834 // TargetResourceID - The resource identifier of the target resource against which the action is to be performed. 6835 TargetResourceID *string `json:"targetResourceId,omitempty"` 6836 // SourceIPAddress - The source IP address. 6837 SourceIPAddress *string `json:"sourceIPAddress,omitempty"` 6838 // DestinationIPAddress - The destination IP address. 6839 DestinationIPAddress *string `json:"destinationIPAddress,omitempty"` 6840 // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional). 6841 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` 6842} 6843 6844// NextHopResult the information about next hop from the specified VM. 6845type NextHopResult struct { 6846 autorest.Response `json:"-"` 6847 // NextHopType - Next hop type. Possible values include: 'NextHopTypeInternet', 'NextHopTypeVirtualAppliance', 'NextHopTypeVirtualNetworkGateway', 'NextHopTypeVnetLocal', 'NextHopTypeHyperNetGateway', 'NextHopTypeNone' 6848 NextHopType NextHopType `json:"nextHopType,omitempty"` 6849 // NextHopIPAddress - Next hop IP Address 6850 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` 6851 // RouteTableID - The resource identifier for the route table associated with the route being returned. If the route being returned does not correspond to any user created routes then this field will be the string 'System Route'. 6852 RouteTableID *string `json:"routeTableId,omitempty"` 6853} 6854 6855// OutboundNatRule outbound NAT pool of the load balancer. 6856type OutboundNatRule struct { 6857 *OutboundNatRulePropertiesFormat `json:"properties,omitempty"` 6858 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 6859 Name *string `json:"name,omitempty"` 6860 // Etag - A unique read-only string that changes whenever the resource is updated. 6861 Etag *string `json:"etag,omitempty"` 6862 // ID - Resource ID. 6863 ID *string `json:"id,omitempty"` 6864} 6865 6866// MarshalJSON is the custom marshaler for OutboundNatRule. 6867func (onr OutboundNatRule) MarshalJSON() ([]byte, error) { 6868 objectMap := make(map[string]interface{}) 6869 if onr.OutboundNatRulePropertiesFormat != nil { 6870 objectMap["properties"] = onr.OutboundNatRulePropertiesFormat 6871 } 6872 if onr.Name != nil { 6873 objectMap["name"] = onr.Name 6874 } 6875 if onr.Etag != nil { 6876 objectMap["etag"] = onr.Etag 6877 } 6878 if onr.ID != nil { 6879 objectMap["id"] = onr.ID 6880 } 6881 return json.Marshal(objectMap) 6882} 6883 6884// UnmarshalJSON is the custom unmarshaler for OutboundNatRule struct. 6885func (onr *OutboundNatRule) UnmarshalJSON(body []byte) error { 6886 var m map[string]*json.RawMessage 6887 err := json.Unmarshal(body, &m) 6888 if err != nil { 6889 return err 6890 } 6891 for k, v := range m { 6892 switch k { 6893 case "properties": 6894 if v != nil { 6895 var outboundNatRulePropertiesFormat OutboundNatRulePropertiesFormat 6896 err = json.Unmarshal(*v, &outboundNatRulePropertiesFormat) 6897 if err != nil { 6898 return err 6899 } 6900 onr.OutboundNatRulePropertiesFormat = &outboundNatRulePropertiesFormat 6901 } 6902 case "name": 6903 if v != nil { 6904 var name string 6905 err = json.Unmarshal(*v, &name) 6906 if err != nil { 6907 return err 6908 } 6909 onr.Name = &name 6910 } 6911 case "etag": 6912 if v != nil { 6913 var etag string 6914 err = json.Unmarshal(*v, &etag) 6915 if err != nil { 6916 return err 6917 } 6918 onr.Etag = &etag 6919 } 6920 case "id": 6921 if v != nil { 6922 var ID string 6923 err = json.Unmarshal(*v, &ID) 6924 if err != nil { 6925 return err 6926 } 6927 onr.ID = &ID 6928 } 6929 } 6930 } 6931 6932 return nil 6933} 6934 6935// OutboundNatRulePropertiesFormat outbound NAT pool of the load balancer. 6936type OutboundNatRulePropertiesFormat struct { 6937 // AllocatedOutboundPorts - The number of outbound ports to be used for NAT. 6938 AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` 6939 // FrontendIPConfigurations - The Frontend IP addresses of the load balancer. 6940 FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"` 6941 // BackendAddressPool - A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs. 6942 BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` 6943 // ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 6944 ProvisioningState *string `json:"provisioningState,omitempty"` 6945} 6946 6947// PacketCapture parameters that define the create packet capture operation. 6948type PacketCapture struct { 6949 *PacketCaptureParameters `json:"properties,omitempty"` 6950} 6951 6952// MarshalJSON is the custom marshaler for PacketCapture. 6953func (pc PacketCapture) MarshalJSON() ([]byte, error) { 6954 objectMap := make(map[string]interface{}) 6955 if pc.PacketCaptureParameters != nil { 6956 objectMap["properties"] = pc.PacketCaptureParameters 6957 } 6958 return json.Marshal(objectMap) 6959} 6960 6961// UnmarshalJSON is the custom unmarshaler for PacketCapture struct. 6962func (pc *PacketCapture) UnmarshalJSON(body []byte) error { 6963 var m map[string]*json.RawMessage 6964 err := json.Unmarshal(body, &m) 6965 if err != nil { 6966 return err 6967 } 6968 for k, v := range m { 6969 switch k { 6970 case "properties": 6971 if v != nil { 6972 var packetCaptureParameters PacketCaptureParameters 6973 err = json.Unmarshal(*v, &packetCaptureParameters) 6974 if err != nil { 6975 return err 6976 } 6977 pc.PacketCaptureParameters = &packetCaptureParameters 6978 } 6979 } 6980 } 6981 6982 return nil 6983} 6984 6985// PacketCaptureFilter filter that is applied to packet capture request. Multiple filters can be applied. 6986type PacketCaptureFilter struct { 6987 // Protocol - Protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any' 6988 Protocol PcProtocol `json:"protocol,omitempty"` 6989 // LocalIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 6990 LocalIPAddress *string `json:"localIPAddress,omitempty"` 6991 // RemoteIPAddress - Local IP Address to be filtered on. Notation: "127.0.0.1" for single address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 6992 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` 6993 // LocalPort - Local port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 6994 LocalPort *string `json:"localPort,omitempty"` 6995 // RemotePort - Remote port to be filtered on. Notation: "80" for single port entry."80-85" for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing ranges with multiple entries not currently supported. Default = null. 6996 RemotePort *string `json:"remotePort,omitempty"` 6997} 6998 6999// PacketCaptureListResult list of packet capture sessions. 7000type PacketCaptureListResult struct { 7001 autorest.Response `json:"-"` 7002 // Value - Information about packet capture sessions. 7003 Value *[]PacketCaptureResult `json:"value,omitempty"` 7004} 7005 7006// PacketCaptureParameters parameters that define the create packet capture operation. 7007type PacketCaptureParameters struct { 7008 // Target - The ID of the targeted resource, only VM is currently supported. 7009 Target *string `json:"target,omitempty"` 7010 // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. 7011 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` 7012 // TotalBytesPerSession - Maximum size of the capture output. 7013 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` 7014 // TimeLimitInSeconds - Maximum duration of the capture session in seconds. 7015 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` 7016 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` 7017 Filters *[]PacketCaptureFilter `json:"filters,omitempty"` 7018} 7019 7020// PacketCaptureQueryStatusResult status of packet capture session. 7021type PacketCaptureQueryStatusResult struct { 7022 autorest.Response `json:"-"` 7023 // Name - The name of the packet capture resource. 7024 Name *string `json:"name,omitempty"` 7025 // ID - The ID of the packet capture resource. 7026 ID *string `json:"id,omitempty"` 7027 // CaptureStartTime - The start time of the packet capture session. 7028 CaptureStartTime *date.Time `json:"captureStartTime,omitempty"` 7029 // PacketCaptureStatus - The status of the packet capture session. Possible values include: 'PcStatusNotStarted', 'PcStatusRunning', 'PcStatusStopped', 'PcStatusError', 'PcStatusUnknown' 7030 PacketCaptureStatus PcStatus `json:"packetCaptureStatus,omitempty"` 7031 // StopReason - The reason the current packet capture session was stopped. 7032 StopReason *string `json:"stopReason,omitempty"` 7033 // PacketCaptureError - List of errors of packet capture session. 7034 PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"` 7035} 7036 7037// PacketCaptureResult information about packet capture session. 7038type PacketCaptureResult struct { 7039 autorest.Response `json:"-"` 7040 // Name - Name of the packet capture session. 7041 Name *string `json:"name,omitempty"` 7042 // ID - ID of the packet capture operation. 7043 ID *string `json:"id,omitempty"` 7044 Etag *string `json:"etag,omitempty"` 7045 *PacketCaptureResultProperties `json:"properties,omitempty"` 7046} 7047 7048// MarshalJSON is the custom marshaler for PacketCaptureResult. 7049func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) { 7050 objectMap := make(map[string]interface{}) 7051 if pcr.Name != nil { 7052 objectMap["name"] = pcr.Name 7053 } 7054 if pcr.ID != nil { 7055 objectMap["id"] = pcr.ID 7056 } 7057 if pcr.Etag != nil { 7058 objectMap["etag"] = pcr.Etag 7059 } 7060 if pcr.PacketCaptureResultProperties != nil { 7061 objectMap["properties"] = pcr.PacketCaptureResultProperties 7062 } 7063 return json.Marshal(objectMap) 7064} 7065 7066// UnmarshalJSON is the custom unmarshaler for PacketCaptureResult struct. 7067func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { 7068 var m map[string]*json.RawMessage 7069 err := json.Unmarshal(body, &m) 7070 if err != nil { 7071 return err 7072 } 7073 for k, v := range m { 7074 switch k { 7075 case "name": 7076 if v != nil { 7077 var name string 7078 err = json.Unmarshal(*v, &name) 7079 if err != nil { 7080 return err 7081 } 7082 pcr.Name = &name 7083 } 7084 case "id": 7085 if v != nil { 7086 var ID string 7087 err = json.Unmarshal(*v, &ID) 7088 if err != nil { 7089 return err 7090 } 7091 pcr.ID = &ID 7092 } 7093 case "etag": 7094 if v != nil { 7095 var etag string 7096 err = json.Unmarshal(*v, &etag) 7097 if err != nil { 7098 return err 7099 } 7100 pcr.Etag = &etag 7101 } 7102 case "properties": 7103 if v != nil { 7104 var packetCaptureResultProperties PacketCaptureResultProperties 7105 err = json.Unmarshal(*v, &packetCaptureResultProperties) 7106 if err != nil { 7107 return err 7108 } 7109 pcr.PacketCaptureResultProperties = &packetCaptureResultProperties 7110 } 7111 } 7112 } 7113 7114 return nil 7115} 7116 7117// PacketCaptureResultProperties describes the properties of a packet capture session. 7118type PacketCaptureResultProperties struct { 7119 // ProvisioningState - The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' 7120 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 7121 // Target - The ID of the targeted resource, only VM is currently supported. 7122 Target *string `json:"target,omitempty"` 7123 // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. 7124 BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` 7125 // TotalBytesPerSession - Maximum size of the capture output. 7126 TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"` 7127 // TimeLimitInSeconds - Maximum duration of the capture session in seconds. 7128 TimeLimitInSeconds *int32 `json:"timeLimitInSeconds,omitempty"` 7129 StorageLocation *PacketCaptureStorageLocation `json:"storageLocation,omitempty"` 7130 Filters *[]PacketCaptureFilter `json:"filters,omitempty"` 7131} 7132 7133// PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 7134type PacketCapturesCreateFuture struct { 7135 azure.Future 7136 req *http.Request 7137} 7138 7139// Result returns the result of the asynchronous operation. 7140// If the operation has not completed it will return an error. 7141func (future PacketCapturesCreateFuture) Result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) { 7142 var done bool 7143 done, err = future.Done(client) 7144 if err != nil { 7145 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure") 7146 return 7147 } 7148 if !done { 7149 return pcr, azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture") 7150 } 7151 if future.PollingMethod() == azure.PollingLocation { 7152 pcr, err = client.CreateResponder(future.Response()) 7153 if err != nil { 7154 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Failure responding to request") 7155 } 7156 return 7157 } 7158 var req *http.Request 7159 var resp *http.Response 7160 if future.PollingURL() != "" { 7161 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 7162 if err != nil { 7163 return 7164 } 7165 } else { 7166 req = autorest.ChangeToGet(future.req) 7167 } 7168 resp, err = autorest.SendWithSender(client, req, 7169 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7170 if err != nil { 7171 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", resp, "Failure sending request") 7172 return 7173 } 7174 pcr, err = client.CreateResponder(resp) 7175 if err != nil { 7176 err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", resp, "Failure responding to request") 7177 } 7178 return 7179} 7180 7181// PacketCapturesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 7182type PacketCapturesDeleteFuture struct { 7183 azure.Future 7184 req *http.Request 7185} 7186 7187// Result returns the result of the asynchronous operation. 7188// If the operation has not completed it will return an error. 7189func (future PacketCapturesDeleteFuture) Result(client PacketCapturesClient) (ar autorest.Response, err error) { 7190 var done bool 7191 done, err = future.Done(client) 7192 if err != nil { 7193 err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure") 7194 return 7195 } 7196 if !done { 7197 return ar, azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture") 7198 } 7199 if future.PollingMethod() == azure.PollingLocation { 7200 ar, err = client.DeleteResponder(future.Response()) 7201 if err != nil { 7202 err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Failure responding to request") 7203 } 7204 return 7205 } 7206 var req *http.Request 7207 var resp *http.Response 7208 if future.PollingURL() != "" { 7209 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 7210 if err != nil { 7211 return 7212 } 7213 } else { 7214 req = autorest.ChangeToGet(future.req) 7215 } 7216 resp, err = autorest.SendWithSender(client, req, 7217 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7218 if err != nil { 7219 err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", resp, "Failure sending request") 7220 return 7221 } 7222 ar, err = client.DeleteResponder(resp) 7223 if err != nil { 7224 err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", resp, "Failure responding to request") 7225 } 7226 return 7227} 7228 7229// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running 7230// operation. 7231type PacketCapturesGetStatusFuture struct { 7232 azure.Future 7233 req *http.Request 7234} 7235 7236// Result returns the result of the asynchronous operation. 7237// If the operation has not completed it will return an error. 7238func (future PacketCapturesGetStatusFuture) Result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) { 7239 var done bool 7240 done, err = future.Done(client) 7241 if err != nil { 7242 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure") 7243 return 7244 } 7245 if !done { 7246 return pcqsr, azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture") 7247 } 7248 if future.PollingMethod() == azure.PollingLocation { 7249 pcqsr, err = client.GetStatusResponder(future.Response()) 7250 if err != nil { 7251 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Failure responding to request") 7252 } 7253 return 7254 } 7255 var req *http.Request 7256 var resp *http.Response 7257 if future.PollingURL() != "" { 7258 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 7259 if err != nil { 7260 return 7261 } 7262 } else { 7263 req = autorest.ChangeToGet(future.req) 7264 } 7265 resp, err = autorest.SendWithSender(client, req, 7266 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7267 if err != nil { 7268 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", resp, "Failure sending request") 7269 return 7270 } 7271 pcqsr, err = client.GetStatusResponder(resp) 7272 if err != nil { 7273 err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", resp, "Failure responding to request") 7274 } 7275 return 7276} 7277 7278// PacketCapturesStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. 7279type PacketCapturesStopFuture struct { 7280 azure.Future 7281 req *http.Request 7282} 7283 7284// Result returns the result of the asynchronous operation. 7285// If the operation has not completed it will return an error. 7286func (future PacketCapturesStopFuture) Result(client PacketCapturesClient) (ar autorest.Response, err error) { 7287 var done bool 7288 done, err = future.Done(client) 7289 if err != nil { 7290 err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure") 7291 return 7292 } 7293 if !done { 7294 return ar, azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture") 7295 } 7296 if future.PollingMethod() == azure.PollingLocation { 7297 ar, err = client.StopResponder(future.Response()) 7298 if err != nil { 7299 err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Failure responding to request") 7300 } 7301 return 7302 } 7303 var req *http.Request 7304 var resp *http.Response 7305 if future.PollingURL() != "" { 7306 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 7307 if err != nil { 7308 return 7309 } 7310 } else { 7311 req = autorest.ChangeToGet(future.req) 7312 } 7313 resp, err = autorest.SendWithSender(client, req, 7314 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7315 if err != nil { 7316 err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", resp, "Failure sending request") 7317 return 7318 } 7319 ar, err = client.StopResponder(resp) 7320 if err != nil { 7321 err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", resp, "Failure responding to request") 7322 } 7323 return 7324} 7325 7326// PacketCaptureStorageLocation describes the storage location for a packet capture session. 7327type PacketCaptureStorageLocation struct { 7328 // StorageID - The ID of the storage account to save the packet capture session. Required if no local file path is provided. 7329 StorageID *string `json:"storageId,omitempty"` 7330 // StoragePath - The URI of the storage path to save the packet capture. Must be a well-formed URI describing the location to save the packet capture. 7331 StoragePath *string `json:"storagePath,omitempty"` 7332 // FilePath - A valid local path on the targeting VM. Must include the name of the capture file (*.cap). For linux virtual machine it must start with /var/captures. Required if no storage ID is provided, otherwise optional. 7333 FilePath *string `json:"filePath,omitempty"` 7334} 7335 7336// PatchRouteFilter route Filter Resource. 7337type PatchRouteFilter struct { 7338 *RouteFilterPropertiesFormat `json:"properties,omitempty"` 7339 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 7340 Name *string `json:"name,omitempty"` 7341 // Etag - A unique read-only string that changes whenever the resource is updated. 7342 Etag *string `json:"etag,omitempty"` 7343 // Type - Resource type. 7344 Type *string `json:"type,omitempty"` 7345 // Tags - Resource tags. 7346 Tags map[string]*string `json:"tags"` 7347 // ID - Resource ID. 7348 ID *string `json:"id,omitempty"` 7349} 7350 7351// MarshalJSON is the custom marshaler for PatchRouteFilter. 7352func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) { 7353 objectMap := make(map[string]interface{}) 7354 if prf.RouteFilterPropertiesFormat != nil { 7355 objectMap["properties"] = prf.RouteFilterPropertiesFormat 7356 } 7357 if prf.Name != nil { 7358 objectMap["name"] = prf.Name 7359 } 7360 if prf.Etag != nil { 7361 objectMap["etag"] = prf.Etag 7362 } 7363 if prf.Type != nil { 7364 objectMap["type"] = prf.Type 7365 } 7366 if prf.Tags != nil { 7367 objectMap["tags"] = prf.Tags 7368 } 7369 if prf.ID != nil { 7370 objectMap["id"] = prf.ID 7371 } 7372 return json.Marshal(objectMap) 7373} 7374 7375// UnmarshalJSON is the custom unmarshaler for PatchRouteFilter struct. 7376func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error { 7377 var m map[string]*json.RawMessage 7378 err := json.Unmarshal(body, &m) 7379 if err != nil { 7380 return err 7381 } 7382 for k, v := range m { 7383 switch k { 7384 case "properties": 7385 if v != nil { 7386 var routeFilterPropertiesFormat RouteFilterPropertiesFormat 7387 err = json.Unmarshal(*v, &routeFilterPropertiesFormat) 7388 if err != nil { 7389 return err 7390 } 7391 prf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat 7392 } 7393 case "name": 7394 if v != nil { 7395 var name string 7396 err = json.Unmarshal(*v, &name) 7397 if err != nil { 7398 return err 7399 } 7400 prf.Name = &name 7401 } 7402 case "etag": 7403 if v != nil { 7404 var etag string 7405 err = json.Unmarshal(*v, &etag) 7406 if err != nil { 7407 return err 7408 } 7409 prf.Etag = &etag 7410 } 7411 case "type": 7412 if v != nil { 7413 var typeVar string 7414 err = json.Unmarshal(*v, &typeVar) 7415 if err != nil { 7416 return err 7417 } 7418 prf.Type = &typeVar 7419 } 7420 case "tags": 7421 if v != nil { 7422 var tags map[string]*string 7423 err = json.Unmarshal(*v, &tags) 7424 if err != nil { 7425 return err 7426 } 7427 prf.Tags = tags 7428 } 7429 case "id": 7430 if v != nil { 7431 var ID string 7432 err = json.Unmarshal(*v, &ID) 7433 if err != nil { 7434 return err 7435 } 7436 prf.ID = &ID 7437 } 7438 } 7439 } 7440 7441 return nil 7442} 7443 7444// PatchRouteFilterRule route Filter Rule Resource 7445type PatchRouteFilterRule struct { 7446 *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` 7447 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 7448 Name *string `json:"name,omitempty"` 7449 // Etag - A unique read-only string that changes whenever the resource is updated. 7450 Etag *string `json:"etag,omitempty"` 7451 // Tags - Resource tags. 7452 Tags map[string]*string `json:"tags"` 7453 // ID - Resource ID. 7454 ID *string `json:"id,omitempty"` 7455} 7456 7457// MarshalJSON is the custom marshaler for PatchRouteFilterRule. 7458func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) { 7459 objectMap := make(map[string]interface{}) 7460 if prfr.RouteFilterRulePropertiesFormat != nil { 7461 objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat 7462 } 7463 if prfr.Name != nil { 7464 objectMap["name"] = prfr.Name 7465 } 7466 if prfr.Etag != nil { 7467 objectMap["etag"] = prfr.Etag 7468 } 7469 if prfr.Tags != nil { 7470 objectMap["tags"] = prfr.Tags 7471 } 7472 if prfr.ID != nil { 7473 objectMap["id"] = prfr.ID 7474 } 7475 return json.Marshal(objectMap) 7476} 7477 7478// UnmarshalJSON is the custom unmarshaler for PatchRouteFilterRule struct. 7479func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error { 7480 var m map[string]*json.RawMessage 7481 err := json.Unmarshal(body, &m) 7482 if err != nil { 7483 return err 7484 } 7485 for k, v := range m { 7486 switch k { 7487 case "properties": 7488 if v != nil { 7489 var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat 7490 err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) 7491 if err != nil { 7492 return err 7493 } 7494 prfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat 7495 } 7496 case "name": 7497 if v != nil { 7498 var name string 7499 err = json.Unmarshal(*v, &name) 7500 if err != nil { 7501 return err 7502 } 7503 prfr.Name = &name 7504 } 7505 case "etag": 7506 if v != nil { 7507 var etag string 7508 err = json.Unmarshal(*v, &etag) 7509 if err != nil { 7510 return err 7511 } 7512 prfr.Etag = &etag 7513 } 7514 case "tags": 7515 if v != nil { 7516 var tags map[string]*string 7517 err = json.Unmarshal(*v, &tags) 7518 if err != nil { 7519 return err 7520 } 7521 prfr.Tags = tags 7522 } 7523 case "id": 7524 if v != nil { 7525 var ID string 7526 err = json.Unmarshal(*v, &ID) 7527 if err != nil { 7528 return err 7529 } 7530 prfr.ID = &ID 7531 } 7532 } 7533 } 7534 7535 return nil 7536} 7537 7538// Probe a load balancer probe. 7539type Probe struct { 7540 *ProbePropertiesFormat `json:"properties,omitempty"` 7541 // Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource. 7542 Name *string `json:"name,omitempty"` 7543 // Etag - A unique read-only string that changes whenever the resource is updated. 7544 Etag *string `json:"etag,omitempty"` 7545 // ID - Resource ID. 7546 ID *string `json:"id,omitempty"` 7547} 7548 7549// MarshalJSON is the custom marshaler for Probe. 7550func (p Probe) MarshalJSON() ([]byte, error) { 7551 objectMap := make(map[string]interface{}) 7552 if p.ProbePropertiesFormat != nil { 7553 objectMap["properties"] = p.ProbePropertiesFormat 7554 } 7555 if p.Name != nil { 7556 objectMap["name"] = p.Name 7557 } 7558 if p.Etag != nil { 7559 objectMap["etag"] = p.Etag 7560 } 7561 if p.ID != nil { 7562 objectMap["id"] = p.ID 7563 } 7564 return json.Marshal(objectMap) 7565} 7566 7567// UnmarshalJSON is the custom unmarshaler for Probe struct. 7568func (p *Probe) UnmarshalJSON(body []byte) error { 7569 var m map[string]*json.RawMessage 7570 err := json.Unmarshal(body, &m) 7571 if err != nil { 7572 return err 7573 } 7574 for k, v := range m { 7575 switch k { 7576 case "properties": 7577 if v != nil { 7578 var probePropertiesFormat ProbePropertiesFormat 7579 err = json.Unmarshal(*v, &probePropertiesFormat) 7580 if err != nil { 7581 return err 7582 } 7583 p.ProbePropertiesFormat = &probePropertiesFormat 7584 } 7585 case "name": 7586 if v != nil { 7587 var name string 7588 err = json.Unmarshal(*v, &name) 7589 if err != nil { 7590 return err 7591 } 7592 p.Name = &name 7593 } 7594 case "etag": 7595 if v != nil { 7596 var etag string 7597 err = json.Unmarshal(*v, &etag) 7598 if err != nil { 7599 return err 7600 } 7601 p.Etag = &etag 7602 } 7603 case "id": 7604 if v != nil { 7605 var ID string 7606 err = json.Unmarshal(*v, &ID) 7607 if err != nil { 7608 return err 7609 } 7610 p.ID = &ID 7611 } 7612 } 7613 } 7614 7615 return nil 7616} 7617 7618// ProbePropertiesFormat ... 7619type ProbePropertiesFormat struct { 7620 // LoadBalancingRules - The load balancer rules that use this probe. 7621 LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` 7622 // 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' 7623 Protocol ProbeProtocol `json:"protocol,omitempty"` 7624 // Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive. 7625 Port *int32 `json:"port,omitempty"` 7626 // 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. 7627 IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` 7628 // 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. 7629 NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` 7630 // 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. 7631 RequestPath *string `json:"requestPath,omitempty"` 7632 // ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 7633 ProvisioningState *string `json:"provisioningState,omitempty"` 7634} 7635 7636// PublicIPAddress public IP address resource. 7637type PublicIPAddress struct { 7638 autorest.Response `json:"-"` 7639 *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` 7640 // Etag - A unique read-only string that changes whenever the resource is updated. 7641 Etag *string `json:"etag,omitempty"` 7642 // ID - Resource ID. 7643 ID *string `json:"id,omitempty"` 7644 // Name - Resource name. 7645 Name *string `json:"name,omitempty"` 7646 // Type - Resource type. 7647 Type *string `json:"type,omitempty"` 7648 // Location - Resource location. 7649 Location *string `json:"location,omitempty"` 7650 // Tags - Resource tags. 7651 Tags map[string]*string `json:"tags"` 7652} 7653 7654// MarshalJSON is the custom marshaler for PublicIPAddress. 7655func (pia PublicIPAddress) MarshalJSON() ([]byte, error) { 7656 objectMap := make(map[string]interface{}) 7657 if pia.PublicIPAddressPropertiesFormat != nil { 7658 objectMap["properties"] = pia.PublicIPAddressPropertiesFormat 7659 } 7660 if pia.Etag != nil { 7661 objectMap["etag"] = pia.Etag 7662 } 7663 if pia.ID != nil { 7664 objectMap["id"] = pia.ID 7665 } 7666 if pia.Name != nil { 7667 objectMap["name"] = pia.Name 7668 } 7669 if pia.Type != nil { 7670 objectMap["type"] = pia.Type 7671 } 7672 if pia.Location != nil { 7673 objectMap["location"] = pia.Location 7674 } 7675 if pia.Tags != nil { 7676 objectMap["tags"] = pia.Tags 7677 } 7678 return json.Marshal(objectMap) 7679} 7680 7681// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct. 7682func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error { 7683 var m map[string]*json.RawMessage 7684 err := json.Unmarshal(body, &m) 7685 if err != nil { 7686 return err 7687 } 7688 for k, v := range m { 7689 switch k { 7690 case "properties": 7691 if v != nil { 7692 var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat 7693 err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat) 7694 if err != nil { 7695 return err 7696 } 7697 pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat 7698 } 7699 case "etag": 7700 if v != nil { 7701 var etag string 7702 err = json.Unmarshal(*v, &etag) 7703 if err != nil { 7704 return err 7705 } 7706 pia.Etag = &etag 7707 } 7708 case "id": 7709 if v != nil { 7710 var ID string 7711 err = json.Unmarshal(*v, &ID) 7712 if err != nil { 7713 return err 7714 } 7715 pia.ID = &ID 7716 } 7717 case "name": 7718 if v != nil { 7719 var name string 7720 err = json.Unmarshal(*v, &name) 7721 if err != nil { 7722 return err 7723 } 7724 pia.Name = &name 7725 } 7726 case "type": 7727 if v != nil { 7728 var typeVar string 7729 err = json.Unmarshal(*v, &typeVar) 7730 if err != nil { 7731 return err 7732 } 7733 pia.Type = &typeVar 7734 } 7735 case "location": 7736 if v != nil { 7737 var location string 7738 err = json.Unmarshal(*v, &location) 7739 if err != nil { 7740 return err 7741 } 7742 pia.Location = &location 7743 } 7744 case "tags": 7745 if v != nil { 7746 var tags map[string]*string 7747 err = json.Unmarshal(*v, &tags) 7748 if err != nil { 7749 return err 7750 } 7751 pia.Tags = tags 7752 } 7753 } 7754 } 7755 7756 return nil 7757} 7758 7759// PublicIPAddressDNSSettings contains FQDN of the DNS record associated with the public IP address 7760type PublicIPAddressDNSSettings struct { 7761 // 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. 7762 DomainNameLabel *string `json:"domainNameLabel,omitempty"` 7763 // 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. 7764 Fqdn *string `json:"fqdn,omitempty"` 7765 // 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. 7766 ReverseFqdn *string `json:"reverseFqdn,omitempty"` 7767} 7768 7769// PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 7770// operation. 7771type PublicIPAddressesCreateOrUpdateFuture struct { 7772 azure.Future 7773 req *http.Request 7774} 7775 7776// Result returns the result of the asynchronous operation. 7777// If the operation has not completed it will return an error. 7778func (future PublicIPAddressesCreateOrUpdateFuture) Result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) { 7779 var done bool 7780 done, err = future.Done(client) 7781 if err != nil { 7782 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7783 return 7784 } 7785 if !done { 7786 return pia, azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture") 7787 } 7788 if future.PollingMethod() == azure.PollingLocation { 7789 pia, err = client.CreateOrUpdateResponder(future.Response()) 7790 if err != nil { 7791 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 7792 } 7793 return 7794 } 7795 var req *http.Request 7796 var resp *http.Response 7797 if future.PollingURL() != "" { 7798 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 7799 if err != nil { 7800 return 7801 } 7802 } else { 7803 req = autorest.ChangeToGet(future.req) 7804 } 7805 resp, err = autorest.SendWithSender(client, req, 7806 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7807 if err != nil { 7808 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", resp, "Failure sending request") 7809 return 7810 } 7811 pia, err = client.CreateOrUpdateResponder(resp) 7812 if err != nil { 7813 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 7814 } 7815 return 7816} 7817 7818// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7819// operation. 7820type PublicIPAddressesDeleteFuture struct { 7821 azure.Future 7822 req *http.Request 7823} 7824 7825// Result returns the result of the asynchronous operation. 7826// If the operation has not completed it will return an error. 7827func (future PublicIPAddressesDeleteFuture) Result(client PublicIPAddressesClient) (ar autorest.Response, err error) { 7828 var done bool 7829 done, err = future.Done(client) 7830 if err != nil { 7831 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure") 7832 return 7833 } 7834 if !done { 7835 return ar, azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture") 7836 } 7837 if future.PollingMethod() == azure.PollingLocation { 7838 ar, err = client.DeleteResponder(future.Response()) 7839 if err != nil { 7840 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Failure responding to request") 7841 } 7842 return 7843 } 7844 var req *http.Request 7845 var resp *http.Response 7846 if future.PollingURL() != "" { 7847 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 7848 if err != nil { 7849 return 7850 } 7851 } else { 7852 req = autorest.ChangeToGet(future.req) 7853 } 7854 resp, err = autorest.SendWithSender(client, req, 7855 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7856 if err != nil { 7857 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", resp, "Failure sending request") 7858 return 7859 } 7860 ar, err = client.DeleteResponder(resp) 7861 if err != nil { 7862 err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", resp, "Failure responding to request") 7863 } 7864 return 7865} 7866 7867// PublicIPAddressListResult response for ListPublicIpAddresses API service call. 7868type PublicIPAddressListResult struct { 7869 autorest.Response `json:"-"` 7870 // Value - A list of public IP addresses that exists in a resource group. 7871 Value *[]PublicIPAddress `json:"value,omitempty"` 7872 // NextLink - The URL to get the next set of results. 7873 NextLink *string `json:"nextLink,omitempty"` 7874} 7875 7876// PublicIPAddressListResultIterator provides access to a complete listing of PublicIPAddress values. 7877type PublicIPAddressListResultIterator struct { 7878 i int 7879 page PublicIPAddressListResultPage 7880} 7881 7882// Next advances to the next value. If there was an error making 7883// the request the iterator does not advance and the error is returned. 7884func (iter *PublicIPAddressListResultIterator) Next() error { 7885 iter.i++ 7886 if iter.i < len(iter.page.Values()) { 7887 return nil 7888 } 7889 err := iter.page.Next() 7890 if err != nil { 7891 iter.i-- 7892 return err 7893 } 7894 iter.i = 0 7895 return nil 7896} 7897 7898// NotDone returns true if the enumeration should be started or is not yet complete. 7899func (iter PublicIPAddressListResultIterator) NotDone() bool { 7900 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7901} 7902 7903// Response returns the raw server response from the last page request. 7904func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult { 7905 return iter.page.Response() 7906} 7907 7908// Value returns the current value or a zero-initialized value if the 7909// iterator has advanced beyond the end of the collection. 7910func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress { 7911 if !iter.page.NotDone() { 7912 return PublicIPAddress{} 7913 } 7914 return iter.page.Values()[iter.i] 7915} 7916 7917// IsEmpty returns true if the ListResult contains no values. 7918func (pialr PublicIPAddressListResult) IsEmpty() bool { 7919 return pialr.Value == nil || len(*pialr.Value) == 0 7920} 7921 7922// publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. 7923// It returns nil if no more results exist. 7924func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer() (*http.Request, error) { 7925 if pialr.NextLink == nil || len(to.String(pialr.NextLink)) < 1 { 7926 return nil, nil 7927 } 7928 return autorest.Prepare(&http.Request{}, 7929 autorest.AsJSON(), 7930 autorest.AsGet(), 7931 autorest.WithBaseURL(to.String(pialr.NextLink))) 7932} 7933 7934// PublicIPAddressListResultPage contains a page of PublicIPAddress values. 7935type PublicIPAddressListResultPage struct { 7936 fn func(PublicIPAddressListResult) (PublicIPAddressListResult, error) 7937 pialr PublicIPAddressListResult 7938} 7939 7940// Next advances to the next page of values. If there was an error making 7941// the request the page does not advance and the error is returned. 7942func (page *PublicIPAddressListResultPage) Next() error { 7943 next, err := page.fn(page.pialr) 7944 if err != nil { 7945 return err 7946 } 7947 page.pialr = next 7948 return nil 7949} 7950 7951// NotDone returns true if the page enumeration should be started or is not yet complete. 7952func (page PublicIPAddressListResultPage) NotDone() bool { 7953 return !page.pialr.IsEmpty() 7954} 7955 7956// Response returns the raw server response from the last page request. 7957func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult { 7958 return page.pialr 7959} 7960 7961// Values returns the slice of values for the current page or nil if there are no values. 7962func (page PublicIPAddressListResultPage) Values() []PublicIPAddress { 7963 if page.pialr.IsEmpty() { 7964 return nil 7965 } 7966 return *page.pialr.Value 7967} 7968 7969// PublicIPAddressPropertiesFormat public IP address properties. 7970type PublicIPAddressPropertiesFormat struct { 7971 // PublicIPAllocationMethod - The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 7972 PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` 7973 // PublicIPAddressVersion - The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' 7974 PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` 7975 IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` 7976 // DNSSettings - The FQDN of the DNS record associated with the public IP address. 7977 DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"` 7978 IPAddress *string `json:"ipAddress,omitempty"` 7979 // IdleTimeoutInMinutes - The idle timeout of the public IP address. 7980 IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` 7981 // ResourceGUID - The resource GUID property of the public IP resource. 7982 ResourceGUID *string `json:"resourceGuid,omitempty"` 7983 // ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 7984 ProvisioningState *string `json:"provisioningState,omitempty"` 7985} 7986 7987// QueryTroubleshootingParameters parameters that define the resource to query the troubleshooting result. 7988type QueryTroubleshootingParameters struct { 7989 // TargetResourceID - The target resource ID to query the troubleshooting result. 7990 TargetResourceID *string `json:"targetResourceId,omitempty"` 7991} 7992 7993// Resource ... 7994type Resource struct { 7995 // ID - Resource ID. 7996 ID *string `json:"id,omitempty"` 7997 // Name - Resource name. 7998 Name *string `json:"name,omitempty"` 7999 // Type - Resource type. 8000 Type *string `json:"type,omitempty"` 8001 // Location - Resource location. 8002 Location *string `json:"location,omitempty"` 8003 // Tags - Resource tags. 8004 Tags map[string]*string `json:"tags"` 8005} 8006 8007// MarshalJSON is the custom marshaler for Resource. 8008func (r Resource) MarshalJSON() ([]byte, error) { 8009 objectMap := make(map[string]interface{}) 8010 if r.ID != nil { 8011 objectMap["id"] = r.ID 8012 } 8013 if r.Name != nil { 8014 objectMap["name"] = r.Name 8015 } 8016 if r.Type != nil { 8017 objectMap["type"] = r.Type 8018 } 8019 if r.Location != nil { 8020 objectMap["location"] = r.Location 8021 } 8022 if r.Tags != nil { 8023 objectMap["tags"] = r.Tags 8024 } 8025 return json.Marshal(objectMap) 8026} 8027 8028// ResourceNavigationLink resourceNavigationLink resource. 8029type ResourceNavigationLink struct { 8030 *ResourceNavigationLinkFormat `json:"properties,omitempty"` 8031 // Name - Name of the resource that is unique within a resource group. This name can be used to access the resource. 8032 Name *string `json:"name,omitempty"` 8033 // Etag - A unique read-only string that changes whenever the resource is updated. 8034 Etag *string `json:"etag,omitempty"` 8035 // ID - Resource ID. 8036 ID *string `json:"id,omitempty"` 8037} 8038 8039// MarshalJSON is the custom marshaler for ResourceNavigationLink. 8040func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) { 8041 objectMap := make(map[string]interface{}) 8042 if rnl.ResourceNavigationLinkFormat != nil { 8043 objectMap["properties"] = rnl.ResourceNavigationLinkFormat 8044 } 8045 if rnl.Name != nil { 8046 objectMap["name"] = rnl.Name 8047 } 8048 if rnl.Etag != nil { 8049 objectMap["etag"] = rnl.Etag 8050 } 8051 if rnl.ID != nil { 8052 objectMap["id"] = rnl.ID 8053 } 8054 return json.Marshal(objectMap) 8055} 8056 8057// UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct. 8058func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error { 8059 var m map[string]*json.RawMessage 8060 err := json.Unmarshal(body, &m) 8061 if err != nil { 8062 return err 8063 } 8064 for k, v := range m { 8065 switch k { 8066 case "properties": 8067 if v != nil { 8068 var resourceNavigationLinkFormat ResourceNavigationLinkFormat 8069 err = json.Unmarshal(*v, &resourceNavigationLinkFormat) 8070 if err != nil { 8071 return err 8072 } 8073 rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat 8074 } 8075 case "name": 8076 if v != nil { 8077 var name string 8078 err = json.Unmarshal(*v, &name) 8079 if err != nil { 8080 return err 8081 } 8082 rnl.Name = &name 8083 } 8084 case "etag": 8085 if v != nil { 8086 var etag string 8087 err = json.Unmarshal(*v, &etag) 8088 if err != nil { 8089 return err 8090 } 8091 rnl.Etag = &etag 8092 } 8093 case "id": 8094 if v != nil { 8095 var ID string 8096 err = json.Unmarshal(*v, &ID) 8097 if err != nil { 8098 return err 8099 } 8100 rnl.ID = &ID 8101 } 8102 } 8103 } 8104 8105 return nil 8106} 8107 8108// ResourceNavigationLinkFormat properties of ResourceNavigationLink. 8109type ResourceNavigationLinkFormat struct { 8110 // LinkedResourceType - Resource type of the linked resource. 8111 LinkedResourceType *string `json:"linkedResourceType,omitempty"` 8112 // Link - Link to the external resource 8113 Link *string `json:"link,omitempty"` 8114 // ProvisioningState - Provisioning state of the ResourceNavigationLink resource. 8115 ProvisioningState *string `json:"provisioningState,omitempty"` 8116} 8117 8118// RetentionPolicyParameters parameters that define the retention policy for flow log. 8119type RetentionPolicyParameters struct { 8120 // Days - Number of days to retain flow log records. 8121 Days *int32 `json:"days,omitempty"` 8122 // Enabled - Flag to enable/disable retention. 8123 Enabled *bool `json:"enabled,omitempty"` 8124} 8125 8126// Route route resource 8127type Route struct { 8128 autorest.Response `json:"-"` 8129 *RoutePropertiesFormat `json:"properties,omitempty"` 8130 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 8131 Name *string `json:"name,omitempty"` 8132 // Etag - A unique read-only string that changes whenever the resource is updated. 8133 Etag *string `json:"etag,omitempty"` 8134 // ID - Resource ID. 8135 ID *string `json:"id,omitempty"` 8136} 8137 8138// MarshalJSON is the custom marshaler for Route. 8139func (r Route) MarshalJSON() ([]byte, error) { 8140 objectMap := make(map[string]interface{}) 8141 if r.RoutePropertiesFormat != nil { 8142 objectMap["properties"] = r.RoutePropertiesFormat 8143 } 8144 if r.Name != nil { 8145 objectMap["name"] = r.Name 8146 } 8147 if r.Etag != nil { 8148 objectMap["etag"] = r.Etag 8149 } 8150 if r.ID != nil { 8151 objectMap["id"] = r.ID 8152 } 8153 return json.Marshal(objectMap) 8154} 8155 8156// UnmarshalJSON is the custom unmarshaler for Route struct. 8157func (r *Route) UnmarshalJSON(body []byte) error { 8158 var m map[string]*json.RawMessage 8159 err := json.Unmarshal(body, &m) 8160 if err != nil { 8161 return err 8162 } 8163 for k, v := range m { 8164 switch k { 8165 case "properties": 8166 if v != nil { 8167 var routePropertiesFormat RoutePropertiesFormat 8168 err = json.Unmarshal(*v, &routePropertiesFormat) 8169 if err != nil { 8170 return err 8171 } 8172 r.RoutePropertiesFormat = &routePropertiesFormat 8173 } 8174 case "name": 8175 if v != nil { 8176 var name string 8177 err = json.Unmarshal(*v, &name) 8178 if err != nil { 8179 return err 8180 } 8181 r.Name = &name 8182 } 8183 case "etag": 8184 if v != nil { 8185 var etag string 8186 err = json.Unmarshal(*v, &etag) 8187 if err != nil { 8188 return err 8189 } 8190 r.Etag = &etag 8191 } 8192 case "id": 8193 if v != nil { 8194 var ID string 8195 err = json.Unmarshal(*v, &ID) 8196 if err != nil { 8197 return err 8198 } 8199 r.ID = &ID 8200 } 8201 } 8202 } 8203 8204 return nil 8205} 8206 8207// RouteFilter route Filter Resource. 8208type RouteFilter struct { 8209 autorest.Response `json:"-"` 8210 *RouteFilterPropertiesFormat `json:"properties,omitempty"` 8211 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 8212 Etag *string `json:"etag,omitempty"` 8213 // ID - Resource ID. 8214 ID *string `json:"id,omitempty"` 8215 // Name - Resource name. 8216 Name *string `json:"name,omitempty"` 8217 // Type - Resource type. 8218 Type *string `json:"type,omitempty"` 8219 // Location - Resource location. 8220 Location *string `json:"location,omitempty"` 8221 // Tags - Resource tags. 8222 Tags map[string]*string `json:"tags"` 8223} 8224 8225// MarshalJSON is the custom marshaler for RouteFilter. 8226func (rf RouteFilter) MarshalJSON() ([]byte, error) { 8227 objectMap := make(map[string]interface{}) 8228 if rf.RouteFilterPropertiesFormat != nil { 8229 objectMap["properties"] = rf.RouteFilterPropertiesFormat 8230 } 8231 if rf.Etag != nil { 8232 objectMap["etag"] = rf.Etag 8233 } 8234 if rf.ID != nil { 8235 objectMap["id"] = rf.ID 8236 } 8237 if rf.Name != nil { 8238 objectMap["name"] = rf.Name 8239 } 8240 if rf.Type != nil { 8241 objectMap["type"] = rf.Type 8242 } 8243 if rf.Location != nil { 8244 objectMap["location"] = rf.Location 8245 } 8246 if rf.Tags != nil { 8247 objectMap["tags"] = rf.Tags 8248 } 8249 return json.Marshal(objectMap) 8250} 8251 8252// UnmarshalJSON is the custom unmarshaler for RouteFilter struct. 8253func (rf *RouteFilter) UnmarshalJSON(body []byte) error { 8254 var m map[string]*json.RawMessage 8255 err := json.Unmarshal(body, &m) 8256 if err != nil { 8257 return err 8258 } 8259 for k, v := range m { 8260 switch k { 8261 case "properties": 8262 if v != nil { 8263 var routeFilterPropertiesFormat RouteFilterPropertiesFormat 8264 err = json.Unmarshal(*v, &routeFilterPropertiesFormat) 8265 if err != nil { 8266 return err 8267 } 8268 rf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat 8269 } 8270 case "etag": 8271 if v != nil { 8272 var etag string 8273 err = json.Unmarshal(*v, &etag) 8274 if err != nil { 8275 return err 8276 } 8277 rf.Etag = &etag 8278 } 8279 case "id": 8280 if v != nil { 8281 var ID string 8282 err = json.Unmarshal(*v, &ID) 8283 if err != nil { 8284 return err 8285 } 8286 rf.ID = &ID 8287 } 8288 case "name": 8289 if v != nil { 8290 var name string 8291 err = json.Unmarshal(*v, &name) 8292 if err != nil { 8293 return err 8294 } 8295 rf.Name = &name 8296 } 8297 case "type": 8298 if v != nil { 8299 var typeVar string 8300 err = json.Unmarshal(*v, &typeVar) 8301 if err != nil { 8302 return err 8303 } 8304 rf.Type = &typeVar 8305 } 8306 case "location": 8307 if v != nil { 8308 var location string 8309 err = json.Unmarshal(*v, &location) 8310 if err != nil { 8311 return err 8312 } 8313 rf.Location = &location 8314 } 8315 case "tags": 8316 if v != nil { 8317 var tags map[string]*string 8318 err = json.Unmarshal(*v, &tags) 8319 if err != nil { 8320 return err 8321 } 8322 rf.Tags = tags 8323 } 8324 } 8325 } 8326 8327 return nil 8328} 8329 8330// RouteFilterListResult response for the ListRouteFilters API service call. 8331type RouteFilterListResult struct { 8332 autorest.Response `json:"-"` 8333 // Value - Gets a list of route filters in a resource group. 8334 Value *[]RouteFilter `json:"value,omitempty"` 8335 // NextLink - The URL to get the next set of results. 8336 NextLink *string `json:"nextLink,omitempty"` 8337} 8338 8339// RouteFilterListResultIterator provides access to a complete listing of RouteFilter values. 8340type RouteFilterListResultIterator struct { 8341 i int 8342 page RouteFilterListResultPage 8343} 8344 8345// Next advances to the next value. If there was an error making 8346// the request the iterator does not advance and the error is returned. 8347func (iter *RouteFilterListResultIterator) Next() error { 8348 iter.i++ 8349 if iter.i < len(iter.page.Values()) { 8350 return nil 8351 } 8352 err := iter.page.Next() 8353 if err != nil { 8354 iter.i-- 8355 return err 8356 } 8357 iter.i = 0 8358 return nil 8359} 8360 8361// NotDone returns true if the enumeration should be started or is not yet complete. 8362func (iter RouteFilterListResultIterator) NotDone() bool { 8363 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8364} 8365 8366// Response returns the raw server response from the last page request. 8367func (iter RouteFilterListResultIterator) Response() RouteFilterListResult { 8368 return iter.page.Response() 8369} 8370 8371// Value returns the current value or a zero-initialized value if the 8372// iterator has advanced beyond the end of the collection. 8373func (iter RouteFilterListResultIterator) Value() RouteFilter { 8374 if !iter.page.NotDone() { 8375 return RouteFilter{} 8376 } 8377 return iter.page.Values()[iter.i] 8378} 8379 8380// IsEmpty returns true if the ListResult contains no values. 8381func (rflr RouteFilterListResult) IsEmpty() bool { 8382 return rflr.Value == nil || len(*rflr.Value) == 0 8383} 8384 8385// routeFilterListResultPreparer prepares a request to retrieve the next set of results. 8386// It returns nil if no more results exist. 8387func (rflr RouteFilterListResult) routeFilterListResultPreparer() (*http.Request, error) { 8388 if rflr.NextLink == nil || len(to.String(rflr.NextLink)) < 1 { 8389 return nil, nil 8390 } 8391 return autorest.Prepare(&http.Request{}, 8392 autorest.AsJSON(), 8393 autorest.AsGet(), 8394 autorest.WithBaseURL(to.String(rflr.NextLink))) 8395} 8396 8397// RouteFilterListResultPage contains a page of RouteFilter values. 8398type RouteFilterListResultPage struct { 8399 fn func(RouteFilterListResult) (RouteFilterListResult, error) 8400 rflr RouteFilterListResult 8401} 8402 8403// Next advances to the next page of values. If there was an error making 8404// the request the page does not advance and the error is returned. 8405func (page *RouteFilterListResultPage) Next() error { 8406 next, err := page.fn(page.rflr) 8407 if err != nil { 8408 return err 8409 } 8410 page.rflr = next 8411 return nil 8412} 8413 8414// NotDone returns true if the page enumeration should be started or is not yet complete. 8415func (page RouteFilterListResultPage) NotDone() bool { 8416 return !page.rflr.IsEmpty() 8417} 8418 8419// Response returns the raw server response from the last page request. 8420func (page RouteFilterListResultPage) Response() RouteFilterListResult { 8421 return page.rflr 8422} 8423 8424// Values returns the slice of values for the current page or nil if there are no values. 8425func (page RouteFilterListResultPage) Values() []RouteFilter { 8426 if page.rflr.IsEmpty() { 8427 return nil 8428 } 8429 return *page.rflr.Value 8430} 8431 8432// RouteFilterPropertiesFormat route Filter Resource 8433type RouteFilterPropertiesFormat struct { 8434 // Rules - Collection of RouteFilterRules contained within a route filter. 8435 Rules *[]RouteFilterRule `json:"rules,omitempty"` 8436 // Peerings - A collection of references to express route circuit peerings. 8437 Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` 8438 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. 8439 ProvisioningState *string `json:"provisioningState,omitempty"` 8440} 8441 8442// RouteFilterRule route Filter Rule Resource 8443type RouteFilterRule struct { 8444 autorest.Response `json:"-"` 8445 *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` 8446 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 8447 Name *string `json:"name,omitempty"` 8448 // Location - Resource location. 8449 Location *string `json:"location,omitempty"` 8450 // Etag - A unique read-only string that changes whenever the resource is updated. 8451 Etag *string `json:"etag,omitempty"` 8452 // Tags - Resource tags. 8453 Tags map[string]*string `json:"tags"` 8454 // ID - Resource ID. 8455 ID *string `json:"id,omitempty"` 8456} 8457 8458// MarshalJSON is the custom marshaler for RouteFilterRule. 8459func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) { 8460 objectMap := make(map[string]interface{}) 8461 if rfr.RouteFilterRulePropertiesFormat != nil { 8462 objectMap["properties"] = rfr.RouteFilterRulePropertiesFormat 8463 } 8464 if rfr.Name != nil { 8465 objectMap["name"] = rfr.Name 8466 } 8467 if rfr.Location != nil { 8468 objectMap["location"] = rfr.Location 8469 } 8470 if rfr.Etag != nil { 8471 objectMap["etag"] = rfr.Etag 8472 } 8473 if rfr.Tags != nil { 8474 objectMap["tags"] = rfr.Tags 8475 } 8476 if rfr.ID != nil { 8477 objectMap["id"] = rfr.ID 8478 } 8479 return json.Marshal(objectMap) 8480} 8481 8482// UnmarshalJSON is the custom unmarshaler for RouteFilterRule struct. 8483func (rfr *RouteFilterRule) UnmarshalJSON(body []byte) error { 8484 var m map[string]*json.RawMessage 8485 err := json.Unmarshal(body, &m) 8486 if err != nil { 8487 return err 8488 } 8489 for k, v := range m { 8490 switch k { 8491 case "properties": 8492 if v != nil { 8493 var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat 8494 err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat) 8495 if err != nil { 8496 return err 8497 } 8498 rfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat 8499 } 8500 case "name": 8501 if v != nil { 8502 var name string 8503 err = json.Unmarshal(*v, &name) 8504 if err != nil { 8505 return err 8506 } 8507 rfr.Name = &name 8508 } 8509 case "location": 8510 if v != nil { 8511 var location string 8512 err = json.Unmarshal(*v, &location) 8513 if err != nil { 8514 return err 8515 } 8516 rfr.Location = &location 8517 } 8518 case "etag": 8519 if v != nil { 8520 var etag string 8521 err = json.Unmarshal(*v, &etag) 8522 if err != nil { 8523 return err 8524 } 8525 rfr.Etag = &etag 8526 } 8527 case "tags": 8528 if v != nil { 8529 var tags map[string]*string 8530 err = json.Unmarshal(*v, &tags) 8531 if err != nil { 8532 return err 8533 } 8534 rfr.Tags = tags 8535 } 8536 case "id": 8537 if v != nil { 8538 var ID string 8539 err = json.Unmarshal(*v, &ID) 8540 if err != nil { 8541 return err 8542 } 8543 rfr.ID = &ID 8544 } 8545 } 8546 } 8547 8548 return nil 8549} 8550 8551// RouteFilterRuleListResult response for the ListRouteFilterRules API service call 8552type RouteFilterRuleListResult struct { 8553 autorest.Response `json:"-"` 8554 // Value - Gets a list of RouteFilterRules in a resource group. 8555 Value *[]RouteFilterRule `json:"value,omitempty"` 8556 // NextLink - The URL to get the next set of results. 8557 NextLink *string `json:"nextLink,omitempty"` 8558} 8559 8560// RouteFilterRuleListResultIterator provides access to a complete listing of RouteFilterRule values. 8561type RouteFilterRuleListResultIterator struct { 8562 i int 8563 page RouteFilterRuleListResultPage 8564} 8565 8566// Next advances to the next value. If there was an error making 8567// the request the iterator does not advance and the error is returned. 8568func (iter *RouteFilterRuleListResultIterator) Next() error { 8569 iter.i++ 8570 if iter.i < len(iter.page.Values()) { 8571 return nil 8572 } 8573 err := iter.page.Next() 8574 if err != nil { 8575 iter.i-- 8576 return err 8577 } 8578 iter.i = 0 8579 return nil 8580} 8581 8582// NotDone returns true if the enumeration should be started or is not yet complete. 8583func (iter RouteFilterRuleListResultIterator) NotDone() bool { 8584 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8585} 8586 8587// Response returns the raw server response from the last page request. 8588func (iter RouteFilterRuleListResultIterator) Response() RouteFilterRuleListResult { 8589 return iter.page.Response() 8590} 8591 8592// Value returns the current value or a zero-initialized value if the 8593// iterator has advanced beyond the end of the collection. 8594func (iter RouteFilterRuleListResultIterator) Value() RouteFilterRule { 8595 if !iter.page.NotDone() { 8596 return RouteFilterRule{} 8597 } 8598 return iter.page.Values()[iter.i] 8599} 8600 8601// IsEmpty returns true if the ListResult contains no values. 8602func (rfrlr RouteFilterRuleListResult) IsEmpty() bool { 8603 return rfrlr.Value == nil || len(*rfrlr.Value) == 0 8604} 8605 8606// routeFilterRuleListResultPreparer prepares a request to retrieve the next set of results. 8607// It returns nil if no more results exist. 8608func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer() (*http.Request, error) { 8609 if rfrlr.NextLink == nil || len(to.String(rfrlr.NextLink)) < 1 { 8610 return nil, nil 8611 } 8612 return autorest.Prepare(&http.Request{}, 8613 autorest.AsJSON(), 8614 autorest.AsGet(), 8615 autorest.WithBaseURL(to.String(rfrlr.NextLink))) 8616} 8617 8618// RouteFilterRuleListResultPage contains a page of RouteFilterRule values. 8619type RouteFilterRuleListResultPage struct { 8620 fn func(RouteFilterRuleListResult) (RouteFilterRuleListResult, error) 8621 rfrlr RouteFilterRuleListResult 8622} 8623 8624// Next advances to the next page of values. If there was an error making 8625// the request the page does not advance and the error is returned. 8626func (page *RouteFilterRuleListResultPage) Next() error { 8627 next, err := page.fn(page.rfrlr) 8628 if err != nil { 8629 return err 8630 } 8631 page.rfrlr = next 8632 return nil 8633} 8634 8635// NotDone returns true if the page enumeration should be started or is not yet complete. 8636func (page RouteFilterRuleListResultPage) NotDone() bool { 8637 return !page.rfrlr.IsEmpty() 8638} 8639 8640// Response returns the raw server response from the last page request. 8641func (page RouteFilterRuleListResultPage) Response() RouteFilterRuleListResult { 8642 return page.rfrlr 8643} 8644 8645// Values returns the slice of values for the current page or nil if there are no values. 8646func (page RouteFilterRuleListResultPage) Values() []RouteFilterRule { 8647 if page.rfrlr.IsEmpty() { 8648 return nil 8649 } 8650 return *page.rfrlr.Value 8651} 8652 8653// RouteFilterRulePropertiesFormat route Filter Rule Resource 8654type RouteFilterRulePropertiesFormat struct { 8655 // Access - The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny' 8656 Access Access `json:"access,omitempty"` 8657 // RouteFilterRuleType - The rule type of the rule. Valid value is: 'Community' 8658 RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"` 8659 // Communities - The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020'] 8660 Communities *[]string `json:"communities,omitempty"` 8661 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'. 8662 ProvisioningState *string `json:"provisioningState,omitempty"` 8663} 8664 8665// RouteFilterRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8666// operation. 8667type RouteFilterRulesCreateOrUpdateFuture struct { 8668 azure.Future 8669 req *http.Request 8670} 8671 8672// Result returns the result of the asynchronous operation. 8673// If the operation has not completed it will return an error. 8674func (future RouteFilterRulesCreateOrUpdateFuture) Result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { 8675 var done bool 8676 done, err = future.Done(client) 8677 if err != nil { 8678 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8679 return 8680 } 8681 if !done { 8682 return rfr, azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture") 8683 } 8684 if future.PollingMethod() == azure.PollingLocation { 8685 rfr, err = client.CreateOrUpdateResponder(future.Response()) 8686 if err != nil { 8687 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 8688 } 8689 return 8690 } 8691 var req *http.Request 8692 var resp *http.Response 8693 if future.PollingURL() != "" { 8694 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 8695 if err != nil { 8696 return 8697 } 8698 } else { 8699 req = autorest.ChangeToGet(future.req) 8700 } 8701 resp, err = autorest.SendWithSender(client, req, 8702 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8703 if err != nil { 8704 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") 8705 return 8706 } 8707 rfr, err = client.CreateOrUpdateResponder(resp) 8708 if err != nil { 8709 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 8710 } 8711 return 8712} 8713 8714// RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 8715// operation. 8716type RouteFilterRulesDeleteFuture struct { 8717 azure.Future 8718 req *http.Request 8719} 8720 8721// Result returns the result of the asynchronous operation. 8722// If the operation has not completed it will return an error. 8723func (future RouteFilterRulesDeleteFuture) Result(client RouteFilterRulesClient) (ar autorest.Response, err error) { 8724 var done bool 8725 done, err = future.Done(client) 8726 if err != nil { 8727 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure") 8728 return 8729 } 8730 if !done { 8731 return ar, azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture") 8732 } 8733 if future.PollingMethod() == azure.PollingLocation { 8734 ar, err = client.DeleteResponder(future.Response()) 8735 if err != nil { 8736 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") 8737 } 8738 return 8739 } 8740 var req *http.Request 8741 var resp *http.Response 8742 if future.PollingURL() != "" { 8743 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 8744 if err != nil { 8745 return 8746 } 8747 } else { 8748 req = autorest.ChangeToGet(future.req) 8749 } 8750 resp, err = autorest.SendWithSender(client, req, 8751 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8752 if err != nil { 8753 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", resp, "Failure sending request") 8754 return 8755 } 8756 ar, err = client.DeleteResponder(resp) 8757 if err != nil { 8758 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", resp, "Failure responding to request") 8759 } 8760 return 8761} 8762 8763// RouteFilterRulesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8764// operation. 8765type RouteFilterRulesUpdateFuture struct { 8766 azure.Future 8767 req *http.Request 8768} 8769 8770// Result returns the result of the asynchronous operation. 8771// If the operation has not completed it will return an error. 8772func (future RouteFilterRulesUpdateFuture) Result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) { 8773 var done bool 8774 done, err = future.Done(client) 8775 if err != nil { 8776 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", future.Response(), "Polling failure") 8777 return 8778 } 8779 if !done { 8780 return rfr, azure.NewAsyncOpIncompleteError("network.RouteFilterRulesUpdateFuture") 8781 } 8782 if future.PollingMethod() == azure.PollingLocation { 8783 rfr, err = client.UpdateResponder(future.Response()) 8784 if err != nil { 8785 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", future.Response(), "Failure responding to request") 8786 } 8787 return 8788 } 8789 var req *http.Request 8790 var resp *http.Response 8791 if future.PollingURL() != "" { 8792 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 8793 if err != nil { 8794 return 8795 } 8796 } else { 8797 req = autorest.ChangeToGet(future.req) 8798 } 8799 resp, err = autorest.SendWithSender(client, req, 8800 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8801 if err != nil { 8802 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", resp, "Failure sending request") 8803 return 8804 } 8805 rfr, err = client.UpdateResponder(resp) 8806 if err != nil { 8807 err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", resp, "Failure responding to request") 8808 } 8809 return 8810} 8811 8812// RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 8813// operation. 8814type RouteFiltersCreateOrUpdateFuture struct { 8815 azure.Future 8816 req *http.Request 8817} 8818 8819// Result returns the result of the asynchronous operation. 8820// If the operation has not completed it will return an error. 8821func (future RouteFiltersCreateOrUpdateFuture) Result(client RouteFiltersClient) (rf RouteFilter, err error) { 8822 var done bool 8823 done, err = future.Done(client) 8824 if err != nil { 8825 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 8826 return 8827 } 8828 if !done { 8829 return rf, azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture") 8830 } 8831 if future.PollingMethod() == azure.PollingLocation { 8832 rf, err = client.CreateOrUpdateResponder(future.Response()) 8833 if err != nil { 8834 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 8835 } 8836 return 8837 } 8838 var req *http.Request 8839 var resp *http.Response 8840 if future.PollingURL() != "" { 8841 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 8842 if err != nil { 8843 return 8844 } 8845 } else { 8846 req = autorest.ChangeToGet(future.req) 8847 } 8848 resp, err = autorest.SendWithSender(client, req, 8849 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8850 if err != nil { 8851 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", resp, "Failure sending request") 8852 return 8853 } 8854 rf, err = client.CreateOrUpdateResponder(resp) 8855 if err != nil { 8856 err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 8857 } 8858 return 8859} 8860 8861// RouteFiltersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8862type RouteFiltersDeleteFuture struct { 8863 azure.Future 8864 req *http.Request 8865} 8866 8867// Result returns the result of the asynchronous operation. 8868// If the operation has not completed it will return an error. 8869func (future RouteFiltersDeleteFuture) Result(client RouteFiltersClient) (ar autorest.Response, err error) { 8870 var done bool 8871 done, err = future.Done(client) 8872 if err != nil { 8873 err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure") 8874 return 8875 } 8876 if !done { 8877 return ar, azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture") 8878 } 8879 if future.PollingMethod() == azure.PollingLocation { 8880 ar, err = client.DeleteResponder(future.Response()) 8881 if err != nil { 8882 err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Failure responding to request") 8883 } 8884 return 8885 } 8886 var req *http.Request 8887 var resp *http.Response 8888 if future.PollingURL() != "" { 8889 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 8890 if err != nil { 8891 return 8892 } 8893 } else { 8894 req = autorest.ChangeToGet(future.req) 8895 } 8896 resp, err = autorest.SendWithSender(client, req, 8897 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8898 if err != nil { 8899 err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", resp, "Failure sending request") 8900 return 8901 } 8902 ar, err = client.DeleteResponder(resp) 8903 if err != nil { 8904 err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", resp, "Failure responding to request") 8905 } 8906 return 8907} 8908 8909// RouteFiltersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 8910type RouteFiltersUpdateFuture struct { 8911 azure.Future 8912 req *http.Request 8913} 8914 8915// Result returns the result of the asynchronous operation. 8916// If the operation has not completed it will return an error. 8917func (future RouteFiltersUpdateFuture) Result(client RouteFiltersClient) (rf RouteFilter, err error) { 8918 var done bool 8919 done, err = future.Done(client) 8920 if err != nil { 8921 err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", future.Response(), "Polling failure") 8922 return 8923 } 8924 if !done { 8925 return rf, azure.NewAsyncOpIncompleteError("network.RouteFiltersUpdateFuture") 8926 } 8927 if future.PollingMethod() == azure.PollingLocation { 8928 rf, err = client.UpdateResponder(future.Response()) 8929 if err != nil { 8930 err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", future.Response(), "Failure responding to request") 8931 } 8932 return 8933 } 8934 var req *http.Request 8935 var resp *http.Response 8936 if future.PollingURL() != "" { 8937 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 8938 if err != nil { 8939 return 8940 } 8941 } else { 8942 req = autorest.ChangeToGet(future.req) 8943 } 8944 resp, err = autorest.SendWithSender(client, req, 8945 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8946 if err != nil { 8947 err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", resp, "Failure sending request") 8948 return 8949 } 8950 rf, err = client.UpdateResponder(resp) 8951 if err != nil { 8952 err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", resp, "Failure responding to request") 8953 } 8954 return 8955} 8956 8957// RouteListResult response for the ListRoute API service call 8958type RouteListResult struct { 8959 autorest.Response `json:"-"` 8960 // Value - Gets a list of routes in a resource group. 8961 Value *[]Route `json:"value,omitempty"` 8962 // NextLink - The URL to get the next set of results. 8963 NextLink *string `json:"nextLink,omitempty"` 8964} 8965 8966// RouteListResultIterator provides access to a complete listing of Route values. 8967type RouteListResultIterator struct { 8968 i int 8969 page RouteListResultPage 8970} 8971 8972// Next advances to the next value. If there was an error making 8973// the request the iterator does not advance and the error is returned. 8974func (iter *RouteListResultIterator) Next() error { 8975 iter.i++ 8976 if iter.i < len(iter.page.Values()) { 8977 return nil 8978 } 8979 err := iter.page.Next() 8980 if err != nil { 8981 iter.i-- 8982 return err 8983 } 8984 iter.i = 0 8985 return nil 8986} 8987 8988// NotDone returns true if the enumeration should be started or is not yet complete. 8989func (iter RouteListResultIterator) NotDone() bool { 8990 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8991} 8992 8993// Response returns the raw server response from the last page request. 8994func (iter RouteListResultIterator) Response() RouteListResult { 8995 return iter.page.Response() 8996} 8997 8998// Value returns the current value or a zero-initialized value if the 8999// iterator has advanced beyond the end of the collection. 9000func (iter RouteListResultIterator) Value() Route { 9001 if !iter.page.NotDone() { 9002 return Route{} 9003 } 9004 return iter.page.Values()[iter.i] 9005} 9006 9007// IsEmpty returns true if the ListResult contains no values. 9008func (rlr RouteListResult) IsEmpty() bool { 9009 return rlr.Value == nil || len(*rlr.Value) == 0 9010} 9011 9012// routeListResultPreparer prepares a request to retrieve the next set of results. 9013// It returns nil if no more results exist. 9014func (rlr RouteListResult) routeListResultPreparer() (*http.Request, error) { 9015 if rlr.NextLink == nil || len(to.String(rlr.NextLink)) < 1 { 9016 return nil, nil 9017 } 9018 return autorest.Prepare(&http.Request{}, 9019 autorest.AsJSON(), 9020 autorest.AsGet(), 9021 autorest.WithBaseURL(to.String(rlr.NextLink))) 9022} 9023 9024// RouteListResultPage contains a page of Route values. 9025type RouteListResultPage struct { 9026 fn func(RouteListResult) (RouteListResult, error) 9027 rlr RouteListResult 9028} 9029 9030// Next advances to the next page of values. If there was an error making 9031// the request the page does not advance and the error is returned. 9032func (page *RouteListResultPage) Next() error { 9033 next, err := page.fn(page.rlr) 9034 if err != nil { 9035 return err 9036 } 9037 page.rlr = next 9038 return nil 9039} 9040 9041// NotDone returns true if the page enumeration should be started or is not yet complete. 9042func (page RouteListResultPage) NotDone() bool { 9043 return !page.rlr.IsEmpty() 9044} 9045 9046// Response returns the raw server response from the last page request. 9047func (page RouteListResultPage) Response() RouteListResult { 9048 return page.rlr 9049} 9050 9051// Values returns the slice of values for the current page or nil if there are no values. 9052func (page RouteListResultPage) Values() []Route { 9053 if page.rlr.IsEmpty() { 9054 return nil 9055 } 9056 return *page.rlr.Value 9057} 9058 9059// RoutePropertiesFormat route resource 9060type RoutePropertiesFormat struct { 9061 // AddressPrefix - The destination CIDR to which the route applies. 9062 AddressPrefix *string `json:"addressPrefix,omitempty"` 9063 // 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' 9064 NextHopType RouteNextHopType `json:"nextHopType,omitempty"` 9065 // NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. 9066 NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` 9067 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 9068 ProvisioningState *string `json:"provisioningState,omitempty"` 9069} 9070 9071// RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9072type RoutesCreateOrUpdateFuture struct { 9073 azure.Future 9074 req *http.Request 9075} 9076 9077// Result returns the result of the asynchronous operation. 9078// If the operation has not completed it will return an error. 9079func (future RoutesCreateOrUpdateFuture) Result(client RoutesClient) (r Route, err error) { 9080 var done bool 9081 done, err = future.Done(client) 9082 if err != nil { 9083 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9084 return 9085 } 9086 if !done { 9087 return r, azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture") 9088 } 9089 if future.PollingMethod() == azure.PollingLocation { 9090 r, err = client.CreateOrUpdateResponder(future.Response()) 9091 if err != nil { 9092 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 9093 } 9094 return 9095 } 9096 var req *http.Request 9097 var resp *http.Response 9098 if future.PollingURL() != "" { 9099 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 9100 if err != nil { 9101 return 9102 } 9103 } else { 9104 req = autorest.ChangeToGet(future.req) 9105 } 9106 resp, err = autorest.SendWithSender(client, req, 9107 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9108 if err != nil { 9109 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", resp, "Failure sending request") 9110 return 9111 } 9112 r, err = client.CreateOrUpdateResponder(resp) 9113 if err != nil { 9114 err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 9115 } 9116 return 9117} 9118 9119// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9120type RoutesDeleteFuture struct { 9121 azure.Future 9122 req *http.Request 9123} 9124 9125// Result returns the result of the asynchronous operation. 9126// If the operation has not completed it will return an error. 9127func (future RoutesDeleteFuture) Result(client RoutesClient) (ar autorest.Response, err error) { 9128 var done bool 9129 done, err = future.Done(client) 9130 if err != nil { 9131 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure") 9132 return 9133 } 9134 if !done { 9135 return ar, azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture") 9136 } 9137 if future.PollingMethod() == azure.PollingLocation { 9138 ar, err = client.DeleteResponder(future.Response()) 9139 if err != nil { 9140 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Failure responding to request") 9141 } 9142 return 9143 } 9144 var req *http.Request 9145 var resp *http.Response 9146 if future.PollingURL() != "" { 9147 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 9148 if err != nil { 9149 return 9150 } 9151 } else { 9152 req = autorest.ChangeToGet(future.req) 9153 } 9154 resp, err = autorest.SendWithSender(client, req, 9155 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9156 if err != nil { 9157 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", resp, "Failure sending request") 9158 return 9159 } 9160 ar, err = client.DeleteResponder(resp) 9161 if err != nil { 9162 err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", resp, "Failure responding to request") 9163 } 9164 return 9165} 9166 9167// RouteTable route table resource. 9168type RouteTable struct { 9169 autorest.Response `json:"-"` 9170 *RouteTablePropertiesFormat `json:"properties,omitempty"` 9171 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 9172 Etag *string `json:"etag,omitempty"` 9173 // ID - Resource ID. 9174 ID *string `json:"id,omitempty"` 9175 // Name - Resource name. 9176 Name *string `json:"name,omitempty"` 9177 // Type - Resource type. 9178 Type *string `json:"type,omitempty"` 9179 // Location - Resource location. 9180 Location *string `json:"location,omitempty"` 9181 // Tags - Resource tags. 9182 Tags map[string]*string `json:"tags"` 9183} 9184 9185// MarshalJSON is the custom marshaler for RouteTable. 9186func (rt RouteTable) MarshalJSON() ([]byte, error) { 9187 objectMap := make(map[string]interface{}) 9188 if rt.RouteTablePropertiesFormat != nil { 9189 objectMap["properties"] = rt.RouteTablePropertiesFormat 9190 } 9191 if rt.Etag != nil { 9192 objectMap["etag"] = rt.Etag 9193 } 9194 if rt.ID != nil { 9195 objectMap["id"] = rt.ID 9196 } 9197 if rt.Name != nil { 9198 objectMap["name"] = rt.Name 9199 } 9200 if rt.Type != nil { 9201 objectMap["type"] = rt.Type 9202 } 9203 if rt.Location != nil { 9204 objectMap["location"] = rt.Location 9205 } 9206 if rt.Tags != nil { 9207 objectMap["tags"] = rt.Tags 9208 } 9209 return json.Marshal(objectMap) 9210} 9211 9212// UnmarshalJSON is the custom unmarshaler for RouteTable struct. 9213func (rt *RouteTable) UnmarshalJSON(body []byte) error { 9214 var m map[string]*json.RawMessage 9215 err := json.Unmarshal(body, &m) 9216 if err != nil { 9217 return err 9218 } 9219 for k, v := range m { 9220 switch k { 9221 case "properties": 9222 if v != nil { 9223 var routeTablePropertiesFormat RouteTablePropertiesFormat 9224 err = json.Unmarshal(*v, &routeTablePropertiesFormat) 9225 if err != nil { 9226 return err 9227 } 9228 rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat 9229 } 9230 case "etag": 9231 if v != nil { 9232 var etag string 9233 err = json.Unmarshal(*v, &etag) 9234 if err != nil { 9235 return err 9236 } 9237 rt.Etag = &etag 9238 } 9239 case "id": 9240 if v != nil { 9241 var ID string 9242 err = json.Unmarshal(*v, &ID) 9243 if err != nil { 9244 return err 9245 } 9246 rt.ID = &ID 9247 } 9248 case "name": 9249 if v != nil { 9250 var name string 9251 err = json.Unmarshal(*v, &name) 9252 if err != nil { 9253 return err 9254 } 9255 rt.Name = &name 9256 } 9257 case "type": 9258 if v != nil { 9259 var typeVar string 9260 err = json.Unmarshal(*v, &typeVar) 9261 if err != nil { 9262 return err 9263 } 9264 rt.Type = &typeVar 9265 } 9266 case "location": 9267 if v != nil { 9268 var location string 9269 err = json.Unmarshal(*v, &location) 9270 if err != nil { 9271 return err 9272 } 9273 rt.Location = &location 9274 } 9275 case "tags": 9276 if v != nil { 9277 var tags map[string]*string 9278 err = json.Unmarshal(*v, &tags) 9279 if err != nil { 9280 return err 9281 } 9282 rt.Tags = tags 9283 } 9284 } 9285 } 9286 9287 return nil 9288} 9289 9290// RouteTableListResult response for the ListRouteTable API service call. 9291type RouteTableListResult struct { 9292 autorest.Response `json:"-"` 9293 // Value - Gets a list of route tables in a resource group. 9294 Value *[]RouteTable `json:"value,omitempty"` 9295 // NextLink - The URL to get the next set of results. 9296 NextLink *string `json:"nextLink,omitempty"` 9297} 9298 9299// RouteTableListResultIterator provides access to a complete listing of RouteTable values. 9300type RouteTableListResultIterator struct { 9301 i int 9302 page RouteTableListResultPage 9303} 9304 9305// Next advances to the next value. If there was an error making 9306// the request the iterator does not advance and the error is returned. 9307func (iter *RouteTableListResultIterator) Next() error { 9308 iter.i++ 9309 if iter.i < len(iter.page.Values()) { 9310 return nil 9311 } 9312 err := iter.page.Next() 9313 if err != nil { 9314 iter.i-- 9315 return err 9316 } 9317 iter.i = 0 9318 return nil 9319} 9320 9321// NotDone returns true if the enumeration should be started or is not yet complete. 9322func (iter RouteTableListResultIterator) NotDone() bool { 9323 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9324} 9325 9326// Response returns the raw server response from the last page request. 9327func (iter RouteTableListResultIterator) Response() RouteTableListResult { 9328 return iter.page.Response() 9329} 9330 9331// Value returns the current value or a zero-initialized value if the 9332// iterator has advanced beyond the end of the collection. 9333func (iter RouteTableListResultIterator) Value() RouteTable { 9334 if !iter.page.NotDone() { 9335 return RouteTable{} 9336 } 9337 return iter.page.Values()[iter.i] 9338} 9339 9340// IsEmpty returns true if the ListResult contains no values. 9341func (rtlr RouteTableListResult) IsEmpty() bool { 9342 return rtlr.Value == nil || len(*rtlr.Value) == 0 9343} 9344 9345// routeTableListResultPreparer prepares a request to retrieve the next set of results. 9346// It returns nil if no more results exist. 9347func (rtlr RouteTableListResult) routeTableListResultPreparer() (*http.Request, error) { 9348 if rtlr.NextLink == nil || len(to.String(rtlr.NextLink)) < 1 { 9349 return nil, nil 9350 } 9351 return autorest.Prepare(&http.Request{}, 9352 autorest.AsJSON(), 9353 autorest.AsGet(), 9354 autorest.WithBaseURL(to.String(rtlr.NextLink))) 9355} 9356 9357// RouteTableListResultPage contains a page of RouteTable values. 9358type RouteTableListResultPage struct { 9359 fn func(RouteTableListResult) (RouteTableListResult, error) 9360 rtlr RouteTableListResult 9361} 9362 9363// Next advances to the next page of values. If there was an error making 9364// the request the page does not advance and the error is returned. 9365func (page *RouteTableListResultPage) Next() error { 9366 next, err := page.fn(page.rtlr) 9367 if err != nil { 9368 return err 9369 } 9370 page.rtlr = next 9371 return nil 9372} 9373 9374// NotDone returns true if the page enumeration should be started or is not yet complete. 9375func (page RouteTableListResultPage) NotDone() bool { 9376 return !page.rtlr.IsEmpty() 9377} 9378 9379// Response returns the raw server response from the last page request. 9380func (page RouteTableListResultPage) Response() RouteTableListResult { 9381 return page.rtlr 9382} 9383 9384// Values returns the slice of values for the current page or nil if there are no values. 9385func (page RouteTableListResultPage) Values() []RouteTable { 9386 if page.rtlr.IsEmpty() { 9387 return nil 9388 } 9389 return *page.rtlr.Value 9390} 9391 9392// RouteTablePropertiesFormat route Table resource 9393type RouteTablePropertiesFormat struct { 9394 // Routes - Collection of routes contained within a route table. 9395 Routes *[]Route `json:"routes,omitempty"` 9396 // Subnets - A collection of references to subnets. 9397 Subnets *[]Subnet `json:"subnets,omitempty"` 9398 // ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 9399 ProvisioningState *string `json:"provisioningState,omitempty"` 9400} 9401 9402// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9403// operation. 9404type RouteTablesCreateOrUpdateFuture struct { 9405 azure.Future 9406 req *http.Request 9407} 9408 9409// Result returns the result of the asynchronous operation. 9410// If the operation has not completed it will return an error. 9411func (future RouteTablesCreateOrUpdateFuture) Result(client RouteTablesClient) (rt RouteTable, err error) { 9412 var done bool 9413 done, err = future.Done(client) 9414 if err != nil { 9415 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9416 return 9417 } 9418 if !done { 9419 return rt, azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture") 9420 } 9421 if future.PollingMethod() == azure.PollingLocation { 9422 rt, err = client.CreateOrUpdateResponder(future.Response()) 9423 if err != nil { 9424 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 9425 } 9426 return 9427 } 9428 var req *http.Request 9429 var resp *http.Response 9430 if future.PollingURL() != "" { 9431 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 9432 if err != nil { 9433 return 9434 } 9435 } else { 9436 req = autorest.ChangeToGet(future.req) 9437 } 9438 resp, err = autorest.SendWithSender(client, req, 9439 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9440 if err != nil { 9441 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", resp, "Failure sending request") 9442 return 9443 } 9444 rt, err = client.CreateOrUpdateResponder(resp) 9445 if err != nil { 9446 err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 9447 } 9448 return 9449} 9450 9451// RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9452type RouteTablesDeleteFuture struct { 9453 azure.Future 9454 req *http.Request 9455} 9456 9457// Result returns the result of the asynchronous operation. 9458// If the operation has not completed it will return an error. 9459func (future RouteTablesDeleteFuture) Result(client RouteTablesClient) (ar autorest.Response, err error) { 9460 var done bool 9461 done, err = future.Done(client) 9462 if err != nil { 9463 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure") 9464 return 9465 } 9466 if !done { 9467 return ar, azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture") 9468 } 9469 if future.PollingMethod() == azure.PollingLocation { 9470 ar, err = client.DeleteResponder(future.Response()) 9471 if err != nil { 9472 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Failure responding to request") 9473 } 9474 return 9475 } 9476 var req *http.Request 9477 var resp *http.Response 9478 if future.PollingURL() != "" { 9479 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 9480 if err != nil { 9481 return 9482 } 9483 } else { 9484 req = autorest.ChangeToGet(future.req) 9485 } 9486 resp, err = autorest.SendWithSender(client, req, 9487 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9488 if err != nil { 9489 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", resp, "Failure sending request") 9490 return 9491 } 9492 ar, err = client.DeleteResponder(resp) 9493 if err != nil { 9494 err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", resp, "Failure responding to request") 9495 } 9496 return 9497} 9498 9499// SecurityGroup networkSecurityGroup resource. 9500type SecurityGroup struct { 9501 autorest.Response `json:"-"` 9502 *SecurityGroupPropertiesFormat `json:"properties,omitempty"` 9503 // Etag - A unique read-only string that changes whenever the resource is updated. 9504 Etag *string `json:"etag,omitempty"` 9505 // ID - Resource ID. 9506 ID *string `json:"id,omitempty"` 9507 // Name - Resource name. 9508 Name *string `json:"name,omitempty"` 9509 // Type - Resource type. 9510 Type *string `json:"type,omitempty"` 9511 // Location - Resource location. 9512 Location *string `json:"location,omitempty"` 9513 // Tags - Resource tags. 9514 Tags map[string]*string `json:"tags"` 9515} 9516 9517// MarshalJSON is the custom marshaler for SecurityGroup. 9518func (sg SecurityGroup) MarshalJSON() ([]byte, error) { 9519 objectMap := make(map[string]interface{}) 9520 if sg.SecurityGroupPropertiesFormat != nil { 9521 objectMap["properties"] = sg.SecurityGroupPropertiesFormat 9522 } 9523 if sg.Etag != nil { 9524 objectMap["etag"] = sg.Etag 9525 } 9526 if sg.ID != nil { 9527 objectMap["id"] = sg.ID 9528 } 9529 if sg.Name != nil { 9530 objectMap["name"] = sg.Name 9531 } 9532 if sg.Type != nil { 9533 objectMap["type"] = sg.Type 9534 } 9535 if sg.Location != nil { 9536 objectMap["location"] = sg.Location 9537 } 9538 if sg.Tags != nil { 9539 objectMap["tags"] = sg.Tags 9540 } 9541 return json.Marshal(objectMap) 9542} 9543 9544// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct. 9545func (sg *SecurityGroup) UnmarshalJSON(body []byte) error { 9546 var m map[string]*json.RawMessage 9547 err := json.Unmarshal(body, &m) 9548 if err != nil { 9549 return err 9550 } 9551 for k, v := range m { 9552 switch k { 9553 case "properties": 9554 if v != nil { 9555 var securityGroupPropertiesFormat SecurityGroupPropertiesFormat 9556 err = json.Unmarshal(*v, &securityGroupPropertiesFormat) 9557 if err != nil { 9558 return err 9559 } 9560 sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat 9561 } 9562 case "etag": 9563 if v != nil { 9564 var etag string 9565 err = json.Unmarshal(*v, &etag) 9566 if err != nil { 9567 return err 9568 } 9569 sg.Etag = &etag 9570 } 9571 case "id": 9572 if v != nil { 9573 var ID string 9574 err = json.Unmarshal(*v, &ID) 9575 if err != nil { 9576 return err 9577 } 9578 sg.ID = &ID 9579 } 9580 case "name": 9581 if v != nil { 9582 var name string 9583 err = json.Unmarshal(*v, &name) 9584 if err != nil { 9585 return err 9586 } 9587 sg.Name = &name 9588 } 9589 case "type": 9590 if v != nil { 9591 var typeVar string 9592 err = json.Unmarshal(*v, &typeVar) 9593 if err != nil { 9594 return err 9595 } 9596 sg.Type = &typeVar 9597 } 9598 case "location": 9599 if v != nil { 9600 var location string 9601 err = json.Unmarshal(*v, &location) 9602 if err != nil { 9603 return err 9604 } 9605 sg.Location = &location 9606 } 9607 case "tags": 9608 if v != nil { 9609 var tags map[string]*string 9610 err = json.Unmarshal(*v, &tags) 9611 if err != nil { 9612 return err 9613 } 9614 sg.Tags = tags 9615 } 9616 } 9617 } 9618 9619 return nil 9620} 9621 9622// SecurityGroupListResult response for ListNetworkSecurityGroups API service call. 9623type SecurityGroupListResult struct { 9624 autorest.Response `json:"-"` 9625 // Value - A list of NetworkSecurityGroup resources. 9626 Value *[]SecurityGroup `json:"value,omitempty"` 9627 // NextLink - The URL to get the next set of results. 9628 NextLink *string `json:"nextLink,omitempty"` 9629} 9630 9631// SecurityGroupListResultIterator provides access to a complete listing of SecurityGroup values. 9632type SecurityGroupListResultIterator struct { 9633 i int 9634 page SecurityGroupListResultPage 9635} 9636 9637// Next advances to the next value. If there was an error making 9638// the request the iterator does not advance and the error is returned. 9639func (iter *SecurityGroupListResultIterator) Next() error { 9640 iter.i++ 9641 if iter.i < len(iter.page.Values()) { 9642 return nil 9643 } 9644 err := iter.page.Next() 9645 if err != nil { 9646 iter.i-- 9647 return err 9648 } 9649 iter.i = 0 9650 return nil 9651} 9652 9653// NotDone returns true if the enumeration should be started or is not yet complete. 9654func (iter SecurityGroupListResultIterator) NotDone() bool { 9655 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9656} 9657 9658// Response returns the raw server response from the last page request. 9659func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult { 9660 return iter.page.Response() 9661} 9662 9663// Value returns the current value or a zero-initialized value if the 9664// iterator has advanced beyond the end of the collection. 9665func (iter SecurityGroupListResultIterator) Value() SecurityGroup { 9666 if !iter.page.NotDone() { 9667 return SecurityGroup{} 9668 } 9669 return iter.page.Values()[iter.i] 9670} 9671 9672// IsEmpty returns true if the ListResult contains no values. 9673func (sglr SecurityGroupListResult) IsEmpty() bool { 9674 return sglr.Value == nil || len(*sglr.Value) == 0 9675} 9676 9677// securityGroupListResultPreparer prepares a request to retrieve the next set of results. 9678// It returns nil if no more results exist. 9679func (sglr SecurityGroupListResult) securityGroupListResultPreparer() (*http.Request, error) { 9680 if sglr.NextLink == nil || len(to.String(sglr.NextLink)) < 1 { 9681 return nil, nil 9682 } 9683 return autorest.Prepare(&http.Request{}, 9684 autorest.AsJSON(), 9685 autorest.AsGet(), 9686 autorest.WithBaseURL(to.String(sglr.NextLink))) 9687} 9688 9689// SecurityGroupListResultPage contains a page of SecurityGroup values. 9690type SecurityGroupListResultPage struct { 9691 fn func(SecurityGroupListResult) (SecurityGroupListResult, error) 9692 sglr SecurityGroupListResult 9693} 9694 9695// Next advances to the next page of values. If there was an error making 9696// the request the page does not advance and the error is returned. 9697func (page *SecurityGroupListResultPage) Next() error { 9698 next, err := page.fn(page.sglr) 9699 if err != nil { 9700 return err 9701 } 9702 page.sglr = next 9703 return nil 9704} 9705 9706// NotDone returns true if the page enumeration should be started or is not yet complete. 9707func (page SecurityGroupListResultPage) NotDone() bool { 9708 return !page.sglr.IsEmpty() 9709} 9710 9711// Response returns the raw server response from the last page request. 9712func (page SecurityGroupListResultPage) Response() SecurityGroupListResult { 9713 return page.sglr 9714} 9715 9716// Values returns the slice of values for the current page or nil if there are no values. 9717func (page SecurityGroupListResultPage) Values() []SecurityGroup { 9718 if page.sglr.IsEmpty() { 9719 return nil 9720 } 9721 return *page.sglr.Value 9722} 9723 9724// SecurityGroupNetworkInterface network interface and all its associated security rules. 9725type SecurityGroupNetworkInterface struct { 9726 // ID - ID of the network interface. 9727 ID *string `json:"id,omitempty"` 9728 SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` 9729} 9730 9731// SecurityGroupPropertiesFormat network Security Group resource. 9732type SecurityGroupPropertiesFormat struct { 9733 // SecurityRules - A collection of security rules of the network security group. 9734 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 9735 // DefaultSecurityRules - The default security rules of network security group. 9736 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` 9737 // NetworkInterfaces - A collection of references to network interfaces. 9738 NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"` 9739 // Subnets - A collection of references to subnets. 9740 Subnets *[]Subnet `json:"subnets,omitempty"` 9741 // ResourceGUID - The resource GUID property of the network security group resource. 9742 ResourceGUID *string `json:"resourceGuid,omitempty"` 9743 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 9744 ProvisioningState *string `json:"provisioningState,omitempty"` 9745} 9746 9747// SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 9748// operation. 9749type SecurityGroupsCreateOrUpdateFuture struct { 9750 azure.Future 9751 req *http.Request 9752} 9753 9754// Result returns the result of the asynchronous operation. 9755// If the operation has not completed it will return an error. 9756func (future SecurityGroupsCreateOrUpdateFuture) Result(client SecurityGroupsClient) (sg SecurityGroup, err error) { 9757 var done bool 9758 done, err = future.Done(client) 9759 if err != nil { 9760 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 9761 return 9762 } 9763 if !done { 9764 return sg, azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture") 9765 } 9766 if future.PollingMethod() == azure.PollingLocation { 9767 sg, err = client.CreateOrUpdateResponder(future.Response()) 9768 if err != nil { 9769 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 9770 } 9771 return 9772 } 9773 var req *http.Request 9774 var resp *http.Response 9775 if future.PollingURL() != "" { 9776 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 9777 if err != nil { 9778 return 9779 } 9780 } else { 9781 req = autorest.ChangeToGet(future.req) 9782 } 9783 resp, err = autorest.SendWithSender(client, req, 9784 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9785 if err != nil { 9786 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", resp, "Failure sending request") 9787 return 9788 } 9789 sg, err = client.CreateOrUpdateResponder(resp) 9790 if err != nil { 9791 err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 9792 } 9793 return 9794} 9795 9796// SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 9797type SecurityGroupsDeleteFuture struct { 9798 azure.Future 9799 req *http.Request 9800} 9801 9802// Result returns the result of the asynchronous operation. 9803// If the operation has not completed it will return an error. 9804func (future SecurityGroupsDeleteFuture) Result(client SecurityGroupsClient) (ar autorest.Response, err error) { 9805 var done bool 9806 done, err = future.Done(client) 9807 if err != nil { 9808 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure") 9809 return 9810 } 9811 if !done { 9812 return ar, azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture") 9813 } 9814 if future.PollingMethod() == azure.PollingLocation { 9815 ar, err = client.DeleteResponder(future.Response()) 9816 if err != nil { 9817 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Failure responding to request") 9818 } 9819 return 9820 } 9821 var req *http.Request 9822 var resp *http.Response 9823 if future.PollingURL() != "" { 9824 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 9825 if err != nil { 9826 return 9827 } 9828 } else { 9829 req = autorest.ChangeToGet(future.req) 9830 } 9831 resp, err = autorest.SendWithSender(client, req, 9832 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9833 if err != nil { 9834 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", resp, "Failure sending request") 9835 return 9836 } 9837 ar, err = client.DeleteResponder(resp) 9838 if err != nil { 9839 err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", resp, "Failure responding to request") 9840 } 9841 return 9842} 9843 9844// SecurityGroupViewParameters parameters that define the VM to check security groups for. 9845type SecurityGroupViewParameters struct { 9846 // TargetResourceID - ID of the target VM. 9847 TargetResourceID *string `json:"targetResourceId,omitempty"` 9848} 9849 9850// SecurityGroupViewResult the information about security rules applied to the specified VM. 9851type SecurityGroupViewResult struct { 9852 autorest.Response `json:"-"` 9853 // NetworkInterfaces - List of network interfaces on the specified VM. 9854 NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` 9855} 9856 9857// SecurityRule network security rule. 9858type SecurityRule struct { 9859 autorest.Response `json:"-"` 9860 *SecurityRulePropertiesFormat `json:"properties,omitempty"` 9861 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 9862 Name *string `json:"name,omitempty"` 9863 // Etag - A unique read-only string that changes whenever the resource is updated. 9864 Etag *string `json:"etag,omitempty"` 9865 // ID - Resource ID. 9866 ID *string `json:"id,omitempty"` 9867} 9868 9869// MarshalJSON is the custom marshaler for SecurityRule. 9870func (sr SecurityRule) MarshalJSON() ([]byte, error) { 9871 objectMap := make(map[string]interface{}) 9872 if sr.SecurityRulePropertiesFormat != nil { 9873 objectMap["properties"] = sr.SecurityRulePropertiesFormat 9874 } 9875 if sr.Name != nil { 9876 objectMap["name"] = sr.Name 9877 } 9878 if sr.Etag != nil { 9879 objectMap["etag"] = sr.Etag 9880 } 9881 if sr.ID != nil { 9882 objectMap["id"] = sr.ID 9883 } 9884 return json.Marshal(objectMap) 9885} 9886 9887// UnmarshalJSON is the custom unmarshaler for SecurityRule struct. 9888func (sr *SecurityRule) UnmarshalJSON(body []byte) error { 9889 var m map[string]*json.RawMessage 9890 err := json.Unmarshal(body, &m) 9891 if err != nil { 9892 return err 9893 } 9894 for k, v := range m { 9895 switch k { 9896 case "properties": 9897 if v != nil { 9898 var securityRulePropertiesFormat SecurityRulePropertiesFormat 9899 err = json.Unmarshal(*v, &securityRulePropertiesFormat) 9900 if err != nil { 9901 return err 9902 } 9903 sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat 9904 } 9905 case "name": 9906 if v != nil { 9907 var name string 9908 err = json.Unmarshal(*v, &name) 9909 if err != nil { 9910 return err 9911 } 9912 sr.Name = &name 9913 } 9914 case "etag": 9915 if v != nil { 9916 var etag string 9917 err = json.Unmarshal(*v, &etag) 9918 if err != nil { 9919 return err 9920 } 9921 sr.Etag = &etag 9922 } 9923 case "id": 9924 if v != nil { 9925 var ID string 9926 err = json.Unmarshal(*v, &ID) 9927 if err != nil { 9928 return err 9929 } 9930 sr.ID = &ID 9931 } 9932 } 9933 } 9934 9935 return nil 9936} 9937 9938// SecurityRuleAssociations all security rules associated with the network interface. 9939type SecurityRuleAssociations struct { 9940 NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` 9941 SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` 9942 // DefaultSecurityRules - Collection of default security rules of the network security group. 9943 DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` 9944 // EffectiveSecurityRules - Collection of effective security rules. 9945 EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` 9946} 9947 9948// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that belongs 9949// to a network security group. 9950type SecurityRuleListResult struct { 9951 autorest.Response `json:"-"` 9952 // Value - The security rules in a network security group. 9953 Value *[]SecurityRule `json:"value,omitempty"` 9954 // NextLink - The URL to get the next set of results. 9955 NextLink *string `json:"nextLink,omitempty"` 9956} 9957 9958// SecurityRuleListResultIterator provides access to a complete listing of SecurityRule values. 9959type SecurityRuleListResultIterator struct { 9960 i int 9961 page SecurityRuleListResultPage 9962} 9963 9964// Next advances to the next value. If there was an error making 9965// the request the iterator does not advance and the error is returned. 9966func (iter *SecurityRuleListResultIterator) Next() error { 9967 iter.i++ 9968 if iter.i < len(iter.page.Values()) { 9969 return nil 9970 } 9971 err := iter.page.Next() 9972 if err != nil { 9973 iter.i-- 9974 return err 9975 } 9976 iter.i = 0 9977 return nil 9978} 9979 9980// NotDone returns true if the enumeration should be started or is not yet complete. 9981func (iter SecurityRuleListResultIterator) NotDone() bool { 9982 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9983} 9984 9985// Response returns the raw server response from the last page request. 9986func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult { 9987 return iter.page.Response() 9988} 9989 9990// Value returns the current value or a zero-initialized value if the 9991// iterator has advanced beyond the end of the collection. 9992func (iter SecurityRuleListResultIterator) Value() SecurityRule { 9993 if !iter.page.NotDone() { 9994 return SecurityRule{} 9995 } 9996 return iter.page.Values()[iter.i] 9997} 9998 9999// IsEmpty returns true if the ListResult contains no values. 10000func (srlr SecurityRuleListResult) IsEmpty() bool { 10001 return srlr.Value == nil || len(*srlr.Value) == 0 10002} 10003 10004// securityRuleListResultPreparer prepares a request to retrieve the next set of results. 10005// It returns nil if no more results exist. 10006func (srlr SecurityRuleListResult) securityRuleListResultPreparer() (*http.Request, error) { 10007 if srlr.NextLink == nil || len(to.String(srlr.NextLink)) < 1 { 10008 return nil, nil 10009 } 10010 return autorest.Prepare(&http.Request{}, 10011 autorest.AsJSON(), 10012 autorest.AsGet(), 10013 autorest.WithBaseURL(to.String(srlr.NextLink))) 10014} 10015 10016// SecurityRuleListResultPage contains a page of SecurityRule values. 10017type SecurityRuleListResultPage struct { 10018 fn func(SecurityRuleListResult) (SecurityRuleListResult, error) 10019 srlr SecurityRuleListResult 10020} 10021 10022// Next advances to the next page of values. If there was an error making 10023// the request the page does not advance and the error is returned. 10024func (page *SecurityRuleListResultPage) Next() error { 10025 next, err := page.fn(page.srlr) 10026 if err != nil { 10027 return err 10028 } 10029 page.srlr = next 10030 return nil 10031} 10032 10033// NotDone returns true if the page enumeration should be started or is not yet complete. 10034func (page SecurityRuleListResultPage) NotDone() bool { 10035 return !page.srlr.IsEmpty() 10036} 10037 10038// Response returns the raw server response from the last page request. 10039func (page SecurityRuleListResultPage) Response() SecurityRuleListResult { 10040 return page.srlr 10041} 10042 10043// Values returns the slice of values for the current page or nil if there are no values. 10044func (page SecurityRuleListResultPage) Values() []SecurityRule { 10045 if page.srlr.IsEmpty() { 10046 return nil 10047 } 10048 return *page.srlr.Value 10049} 10050 10051// SecurityRulePropertiesFormat ... 10052type SecurityRulePropertiesFormat struct { 10053 // Description - A description for this rule. Restricted to 140 chars. 10054 Description *string `json:"description,omitempty"` 10055 // Protocol - Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolAsterisk' 10056 Protocol SecurityRuleProtocol `json:"protocol,omitempty"` 10057 // SourcePortRange - The source port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. 10058 SourcePortRange *string `json:"sourcePortRange,omitempty"` 10059 // DestinationPortRange - The destination port or range. Integer or range between 0 and 65535. Asterix '*' can also be used to match all ports. 10060 DestinationPortRange *string `json:"destinationPortRange,omitempty"` 10061 // SourceAddressPrefix - The CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from. 10062 SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` 10063 // DestinationAddressPrefix - The destination address prefix. CIDR or source IP range. Asterix '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. 10064 DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` 10065 // Access - The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny' 10066 Access SecurityRuleAccess `json:"access,omitempty"` 10067 // 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. 10068 Priority *int32 `json:"priority,omitempty"` 10069 // Direction - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outcoming traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound' 10070 Direction SecurityRuleDirection `json:"direction,omitempty"` 10071 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 10072 ProvisioningState *string `json:"provisioningState,omitempty"` 10073} 10074 10075// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 10076// operation. 10077type SecurityRulesCreateOrUpdateFuture struct { 10078 azure.Future 10079 req *http.Request 10080} 10081 10082// Result returns the result of the asynchronous operation. 10083// If the operation has not completed it will return an error. 10084func (future SecurityRulesCreateOrUpdateFuture) Result(client SecurityRulesClient) (sr SecurityRule, err error) { 10085 var done bool 10086 done, err = future.Done(client) 10087 if err != nil { 10088 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10089 return 10090 } 10091 if !done { 10092 return sr, azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture") 10093 } 10094 if future.PollingMethod() == azure.PollingLocation { 10095 sr, err = client.CreateOrUpdateResponder(future.Response()) 10096 if err != nil { 10097 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 10098 } 10099 return 10100 } 10101 var req *http.Request 10102 var resp *http.Response 10103 if future.PollingURL() != "" { 10104 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 10105 if err != nil { 10106 return 10107 } 10108 } else { 10109 req = autorest.ChangeToGet(future.req) 10110 } 10111 resp, err = autorest.SendWithSender(client, req, 10112 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10113 if err != nil { 10114 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", resp, "Failure sending request") 10115 return 10116 } 10117 sr, err = client.CreateOrUpdateResponder(resp) 10118 if err != nil { 10119 err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 10120 } 10121 return 10122} 10123 10124// SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 10125type SecurityRulesDeleteFuture struct { 10126 azure.Future 10127 req *http.Request 10128} 10129 10130// Result returns the result of the asynchronous operation. 10131// If the operation has not completed it will return an error. 10132func (future SecurityRulesDeleteFuture) Result(client SecurityRulesClient) (ar autorest.Response, err error) { 10133 var done bool 10134 done, err = future.Done(client) 10135 if err != nil { 10136 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure") 10137 return 10138 } 10139 if !done { 10140 return ar, azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture") 10141 } 10142 if future.PollingMethod() == azure.PollingLocation { 10143 ar, err = client.DeleteResponder(future.Response()) 10144 if err != nil { 10145 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Failure responding to request") 10146 } 10147 return 10148 } 10149 var req *http.Request 10150 var resp *http.Response 10151 if future.PollingURL() != "" { 10152 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 10153 if err != nil { 10154 return 10155 } 10156 } else { 10157 req = autorest.ChangeToGet(future.req) 10158 } 10159 resp, err = autorest.SendWithSender(client, req, 10160 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10161 if err != nil { 10162 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", resp, "Failure sending request") 10163 return 10164 } 10165 ar, err = client.DeleteResponder(resp) 10166 if err != nil { 10167 err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", resp, "Failure responding to request") 10168 } 10169 return 10170} 10171 10172// String ... 10173type String struct { 10174 autorest.Response `json:"-"` 10175 Value *string `json:"value,omitempty"` 10176} 10177 10178// Subnet subnet in a virtual network resource. 10179type Subnet struct { 10180 autorest.Response `json:"-"` 10181 *SubnetPropertiesFormat `json:"properties,omitempty"` 10182 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 10183 Name *string `json:"name,omitempty"` 10184 // Etag - A unique read-only string that changes whenever the resource is updated. 10185 Etag *string `json:"etag,omitempty"` 10186 // ID - Resource ID. 10187 ID *string `json:"id,omitempty"` 10188} 10189 10190// MarshalJSON is the custom marshaler for Subnet. 10191func (s Subnet) MarshalJSON() ([]byte, error) { 10192 objectMap := make(map[string]interface{}) 10193 if s.SubnetPropertiesFormat != nil { 10194 objectMap["properties"] = s.SubnetPropertiesFormat 10195 } 10196 if s.Name != nil { 10197 objectMap["name"] = s.Name 10198 } 10199 if s.Etag != nil { 10200 objectMap["etag"] = s.Etag 10201 } 10202 if s.ID != nil { 10203 objectMap["id"] = s.ID 10204 } 10205 return json.Marshal(objectMap) 10206} 10207 10208// UnmarshalJSON is the custom unmarshaler for Subnet struct. 10209func (s *Subnet) UnmarshalJSON(body []byte) error { 10210 var m map[string]*json.RawMessage 10211 err := json.Unmarshal(body, &m) 10212 if err != nil { 10213 return err 10214 } 10215 for k, v := range m { 10216 switch k { 10217 case "properties": 10218 if v != nil { 10219 var subnetPropertiesFormat SubnetPropertiesFormat 10220 err = json.Unmarshal(*v, &subnetPropertiesFormat) 10221 if err != nil { 10222 return err 10223 } 10224 s.SubnetPropertiesFormat = &subnetPropertiesFormat 10225 } 10226 case "name": 10227 if v != nil { 10228 var name string 10229 err = json.Unmarshal(*v, &name) 10230 if err != nil { 10231 return err 10232 } 10233 s.Name = &name 10234 } 10235 case "etag": 10236 if v != nil { 10237 var etag string 10238 err = json.Unmarshal(*v, &etag) 10239 if err != nil { 10240 return err 10241 } 10242 s.Etag = &etag 10243 } 10244 case "id": 10245 if v != nil { 10246 var ID string 10247 err = json.Unmarshal(*v, &ID) 10248 if err != nil { 10249 return err 10250 } 10251 s.ID = &ID 10252 } 10253 } 10254 } 10255 10256 return nil 10257} 10258 10259// SubnetAssociation network interface and its custom security rules. 10260type SubnetAssociation struct { 10261 // ID - Subnet ID. 10262 ID *string `json:"id,omitempty"` 10263 // SecurityRules - Collection of custom security rules. 10264 SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` 10265} 10266 10267// SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network 10268type SubnetListResult struct { 10269 autorest.Response `json:"-"` 10270 // Value - The subnets in a virtual network. 10271 Value *[]Subnet `json:"value,omitempty"` 10272 // NextLink - The URL to get the next set of results. 10273 NextLink *string `json:"nextLink,omitempty"` 10274} 10275 10276// SubnetListResultIterator provides access to a complete listing of Subnet values. 10277type SubnetListResultIterator struct { 10278 i int 10279 page SubnetListResultPage 10280} 10281 10282// Next advances to the next value. If there was an error making 10283// the request the iterator does not advance and the error is returned. 10284func (iter *SubnetListResultIterator) Next() error { 10285 iter.i++ 10286 if iter.i < len(iter.page.Values()) { 10287 return nil 10288 } 10289 err := iter.page.Next() 10290 if err != nil { 10291 iter.i-- 10292 return err 10293 } 10294 iter.i = 0 10295 return nil 10296} 10297 10298// NotDone returns true if the enumeration should be started or is not yet complete. 10299func (iter SubnetListResultIterator) NotDone() bool { 10300 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10301} 10302 10303// Response returns the raw server response from the last page request. 10304func (iter SubnetListResultIterator) Response() SubnetListResult { 10305 return iter.page.Response() 10306} 10307 10308// Value returns the current value or a zero-initialized value if the 10309// iterator has advanced beyond the end of the collection. 10310func (iter SubnetListResultIterator) Value() Subnet { 10311 if !iter.page.NotDone() { 10312 return Subnet{} 10313 } 10314 return iter.page.Values()[iter.i] 10315} 10316 10317// IsEmpty returns true if the ListResult contains no values. 10318func (slr SubnetListResult) IsEmpty() bool { 10319 return slr.Value == nil || len(*slr.Value) == 0 10320} 10321 10322// subnetListResultPreparer prepares a request to retrieve the next set of results. 10323// It returns nil if no more results exist. 10324func (slr SubnetListResult) subnetListResultPreparer() (*http.Request, error) { 10325 if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { 10326 return nil, nil 10327 } 10328 return autorest.Prepare(&http.Request{}, 10329 autorest.AsJSON(), 10330 autorest.AsGet(), 10331 autorest.WithBaseURL(to.String(slr.NextLink))) 10332} 10333 10334// SubnetListResultPage contains a page of Subnet values. 10335type SubnetListResultPage struct { 10336 fn func(SubnetListResult) (SubnetListResult, error) 10337 slr SubnetListResult 10338} 10339 10340// Next advances to the next page of values. If there was an error making 10341// the request the page does not advance and the error is returned. 10342func (page *SubnetListResultPage) Next() error { 10343 next, err := page.fn(page.slr) 10344 if err != nil { 10345 return err 10346 } 10347 page.slr = next 10348 return nil 10349} 10350 10351// NotDone returns true if the page enumeration should be started or is not yet complete. 10352func (page SubnetListResultPage) NotDone() bool { 10353 return !page.slr.IsEmpty() 10354} 10355 10356// Response returns the raw server response from the last page request. 10357func (page SubnetListResultPage) Response() SubnetListResult { 10358 return page.slr 10359} 10360 10361// Values returns the slice of values for the current page or nil if there are no values. 10362func (page SubnetListResultPage) Values() []Subnet { 10363 if page.slr.IsEmpty() { 10364 return nil 10365 } 10366 return *page.slr.Value 10367} 10368 10369// SubnetPropertiesFormat ... 10370type SubnetPropertiesFormat struct { 10371 // AddressPrefix - The address prefix for the subnet. 10372 AddressPrefix *string `json:"addressPrefix,omitempty"` 10373 // NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource. 10374 NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` 10375 // RouteTable - The reference of the RouteTable resource. 10376 RouteTable *RouteTable `json:"routeTable,omitempty"` 10377 // IPConfigurations - Gets an array of references to the network interface IP configurations using subnet. 10378 IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` 10379 // ResourceNavigationLinks - Gets an array of references to the external resources using subnet. 10380 ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` 10381 // ProvisioningState - The provisioning state of the resource. 10382 ProvisioningState *string `json:"provisioningState,omitempty"` 10383} 10384 10385// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 10386// operation. 10387type SubnetsCreateOrUpdateFuture struct { 10388 azure.Future 10389 req *http.Request 10390} 10391 10392// Result returns the result of the asynchronous operation. 10393// If the operation has not completed it will return an error. 10394func (future SubnetsCreateOrUpdateFuture) Result(client SubnetsClient) (s Subnet, err error) { 10395 var done bool 10396 done, err = future.Done(client) 10397 if err != nil { 10398 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 10399 return 10400 } 10401 if !done { 10402 return s, azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture") 10403 } 10404 if future.PollingMethod() == azure.PollingLocation { 10405 s, err = client.CreateOrUpdateResponder(future.Response()) 10406 if err != nil { 10407 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 10408 } 10409 return 10410 } 10411 var req *http.Request 10412 var resp *http.Response 10413 if future.PollingURL() != "" { 10414 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 10415 if err != nil { 10416 return 10417 } 10418 } else { 10419 req = autorest.ChangeToGet(future.req) 10420 } 10421 resp, err = autorest.SendWithSender(client, req, 10422 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10423 if err != nil { 10424 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", resp, "Failure sending request") 10425 return 10426 } 10427 s, err = client.CreateOrUpdateResponder(resp) 10428 if err != nil { 10429 err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 10430 } 10431 return 10432} 10433 10434// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 10435type SubnetsDeleteFuture struct { 10436 azure.Future 10437 req *http.Request 10438} 10439 10440// Result returns the result of the asynchronous operation. 10441// If the operation has not completed it will return an error. 10442func (future SubnetsDeleteFuture) Result(client SubnetsClient) (ar autorest.Response, err error) { 10443 var done bool 10444 done, err = future.Done(client) 10445 if err != nil { 10446 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure") 10447 return 10448 } 10449 if !done { 10450 return ar, azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture") 10451 } 10452 if future.PollingMethod() == azure.PollingLocation { 10453 ar, err = client.DeleteResponder(future.Response()) 10454 if err != nil { 10455 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Failure responding to request") 10456 } 10457 return 10458 } 10459 var req *http.Request 10460 var resp *http.Response 10461 if future.PollingURL() != "" { 10462 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 10463 if err != nil { 10464 return 10465 } 10466 } else { 10467 req = autorest.ChangeToGet(future.req) 10468 } 10469 resp, err = autorest.SendWithSender(client, req, 10470 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10471 if err != nil { 10472 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", resp, "Failure sending request") 10473 return 10474 } 10475 ar, err = client.DeleteResponder(resp) 10476 if err != nil { 10477 err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", resp, "Failure responding to request") 10478 } 10479 return 10480} 10481 10482// SubResource ... 10483type SubResource struct { 10484 // ID - Resource ID. 10485 ID *string `json:"id,omitempty"` 10486} 10487 10488// Topology topology of the specified resource group. 10489type Topology struct { 10490 autorest.Response `json:"-"` 10491 // ID - GUID representing the operation id. 10492 ID *string `json:"id,omitempty"` 10493 // CreatedDateTime - The datetime when the topology was initially created for the resource group. 10494 CreatedDateTime *date.Time `json:"createdDateTime,omitempty"` 10495 // LastModified - The datetime when the topology was last modified. 10496 LastModified *date.Time `json:"lastModified,omitempty"` 10497 Resources *[]TopologyResource `json:"resources,omitempty"` 10498} 10499 10500// TopologyAssociation resources that have an association with the parent resource. 10501type TopologyAssociation struct { 10502 // Name - The name of the resource that is associated with the parent resource. 10503 Name *string `json:"name,omitempty"` 10504 // ResourceID - The ID of the resource that is associated with the parent resource. 10505 ResourceID *string `json:"resourceId,omitempty"` 10506 // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains' 10507 AssociationType AssociationType `json:"associationType,omitempty"` 10508} 10509 10510// TopologyParameters parameters that define the representation of topology. 10511type TopologyParameters struct { 10512 // TargetResourceGroupName - The name of the target resource group to perform topology on. 10513 TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` 10514} 10515 10516// TopologyResource the network resource topology information for the given resource group. 10517type TopologyResource struct { 10518 // Name - Name of the resource. 10519 Name *string `json:"name,omitempty"` 10520 // ID - ID of the resource. 10521 ID *string `json:"id,omitempty"` 10522 // Location - Resource location. 10523 Location *string `json:"location,omitempty"` 10524 // Associations - Holds the associations the resource has with other resources in the resource group. 10525 Associations *[]TopologyAssociation `json:"associations,omitempty"` 10526} 10527 10528// TroubleshootingDetails information gained from troubleshooting of specified resource. 10529type TroubleshootingDetails struct { 10530 // ID - The id of the get troubleshoot operation. 10531 ID *string `json:"id,omitempty"` 10532 // ReasonType - Reason type of failure. 10533 ReasonType *string `json:"reasonType,omitempty"` 10534 // Summary - A summary of troubleshooting. 10535 Summary *string `json:"summary,omitempty"` 10536 // Detail - Details on troubleshooting results. 10537 Detail *string `json:"detail,omitempty"` 10538 // RecommendedActions - List of recommended actions. 10539 RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` 10540} 10541 10542// TroubleshootingParameters parameters that define the resource to troubleshoot. 10543type TroubleshootingParameters struct { 10544 // TargetResourceID - The target resource to troubleshoot. 10545 TargetResourceID *string `json:"targetResourceId,omitempty"` 10546 *TroubleshootingProperties `json:"properties,omitempty"` 10547} 10548 10549// MarshalJSON is the custom marshaler for TroubleshootingParameters. 10550func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) { 10551 objectMap := make(map[string]interface{}) 10552 if tp.TargetResourceID != nil { 10553 objectMap["targetResourceId"] = tp.TargetResourceID 10554 } 10555 if tp.TroubleshootingProperties != nil { 10556 objectMap["properties"] = tp.TroubleshootingProperties 10557 } 10558 return json.Marshal(objectMap) 10559} 10560 10561// UnmarshalJSON is the custom unmarshaler for TroubleshootingParameters struct. 10562func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error { 10563 var m map[string]*json.RawMessage 10564 err := json.Unmarshal(body, &m) 10565 if err != nil { 10566 return err 10567 } 10568 for k, v := range m { 10569 switch k { 10570 case "targetResourceId": 10571 if v != nil { 10572 var targetResourceID string 10573 err = json.Unmarshal(*v, &targetResourceID) 10574 if err != nil { 10575 return err 10576 } 10577 tp.TargetResourceID = &targetResourceID 10578 } 10579 case "properties": 10580 if v != nil { 10581 var troubleshootingProperties TroubleshootingProperties 10582 err = json.Unmarshal(*v, &troubleshootingProperties) 10583 if err != nil { 10584 return err 10585 } 10586 tp.TroubleshootingProperties = &troubleshootingProperties 10587 } 10588 } 10589 } 10590 10591 return nil 10592} 10593 10594// TroubleshootingProperties storage location provided for troubleshoot. 10595type TroubleshootingProperties struct { 10596 // StorageID - The ID for the storage account to save the troubleshoot result. 10597 StorageID *string `json:"storageId,omitempty"` 10598 // StoragePath - The path to the blob to save the troubleshoot result in. 10599 StoragePath *string `json:"storagePath,omitempty"` 10600} 10601 10602// TroubleshootingRecommendedActions recommended actions based on discovered issues. 10603type TroubleshootingRecommendedActions struct { 10604 // ActionID - ID of the recommended action. 10605 ActionID *string `json:"actionId,omitempty"` 10606 // ActionText - Description of recommended actions. 10607 ActionText *string `json:"actionText,omitempty"` 10608 // ActionURI - The uri linking to a documentation for the recommended troubleshooting actions. 10609 ActionURI *string `json:"actionUri,omitempty"` 10610 // ActionURIText - The information from the URI for the recommended troubleshooting actions. 10611 ActionURIText *string `json:"actionUriText,omitempty"` 10612} 10613 10614// TroubleshootingResult troubleshooting information gained from specified resource. 10615type TroubleshootingResult struct { 10616 autorest.Response `json:"-"` 10617 // StartTime - The start time of the troubleshooting. 10618 StartTime *date.Time `json:"startTime,omitempty"` 10619 // EndTime - The end time of the troubleshooting. 10620 EndTime *date.Time `json:"endTime,omitempty"` 10621 // Code - The result code of the troubleshooting. 10622 Code *string `json:"code,omitempty"` 10623 // Results - Information from troubleshooting. 10624 Results *[]TroubleshootingDetails `json:"results,omitempty"` 10625} 10626 10627// TunnelConnectionHealth virtualNetworkGatewayConnection properties 10628type TunnelConnectionHealth struct { 10629 // Tunnel - Tunnel name. 10630 Tunnel *string `json:"tunnel,omitempty"` 10631 // ConnectionStatus - Virtual network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' 10632 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 10633 // IngressBytesTransferred - The Ingress Bytes Transferred in this connection 10634 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 10635 // EgressBytesTransferred - The Egress Bytes Transferred in this connection 10636 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 10637 // LastConnectionEstablishedUtcTime - The time at which connection was established in Utc format. 10638 LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` 10639} 10640 10641// Usage describes network resource usage. 10642type Usage struct { 10643 // Unit - An enum describing the unit of measurement. 10644 Unit *string `json:"unit,omitempty"` 10645 // CurrentValue - The current value of the usage. 10646 CurrentValue *int64 `json:"currentValue,omitempty"` 10647 // Limit - The limit of usage. 10648 Limit *int64 `json:"limit,omitempty"` 10649 // Name - The name of the type of usage. 10650 Name *UsageName `json:"name,omitempty"` 10651} 10652 10653// UsageName the usage names. 10654type UsageName struct { 10655 // Value - A string describing the resource name. 10656 Value *string `json:"value,omitempty"` 10657 // LocalizedValue - A localized string describing the resource name. 10658 LocalizedValue *string `json:"localizedValue,omitempty"` 10659} 10660 10661// UsagesListResult the list usages operation response. 10662type UsagesListResult struct { 10663 autorest.Response `json:"-"` 10664 // Value - The list network resource usages. 10665 Value *[]Usage `json:"value,omitempty"` 10666 // NextLink - URL to get the next set of results. 10667 NextLink *string `json:"nextLink,omitempty"` 10668} 10669 10670// UsagesListResultIterator provides access to a complete listing of Usage values. 10671type UsagesListResultIterator struct { 10672 i int 10673 page UsagesListResultPage 10674} 10675 10676// Next advances to the next value. If there was an error making 10677// the request the iterator does not advance and the error is returned. 10678func (iter *UsagesListResultIterator) Next() error { 10679 iter.i++ 10680 if iter.i < len(iter.page.Values()) { 10681 return nil 10682 } 10683 err := iter.page.Next() 10684 if err != nil { 10685 iter.i-- 10686 return err 10687 } 10688 iter.i = 0 10689 return nil 10690} 10691 10692// NotDone returns true if the enumeration should be started or is not yet complete. 10693func (iter UsagesListResultIterator) NotDone() bool { 10694 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 10695} 10696 10697// Response returns the raw server response from the last page request. 10698func (iter UsagesListResultIterator) Response() UsagesListResult { 10699 return iter.page.Response() 10700} 10701 10702// Value returns the current value or a zero-initialized value if the 10703// iterator has advanced beyond the end of the collection. 10704func (iter UsagesListResultIterator) Value() Usage { 10705 if !iter.page.NotDone() { 10706 return Usage{} 10707 } 10708 return iter.page.Values()[iter.i] 10709} 10710 10711// IsEmpty returns true if the ListResult contains no values. 10712func (ulr UsagesListResult) IsEmpty() bool { 10713 return ulr.Value == nil || len(*ulr.Value) == 0 10714} 10715 10716// usagesListResultPreparer prepares a request to retrieve the next set of results. 10717// It returns nil if no more results exist. 10718func (ulr UsagesListResult) usagesListResultPreparer() (*http.Request, error) { 10719 if ulr.NextLink == nil || len(to.String(ulr.NextLink)) < 1 { 10720 return nil, nil 10721 } 10722 return autorest.Prepare(&http.Request{}, 10723 autorest.AsJSON(), 10724 autorest.AsGet(), 10725 autorest.WithBaseURL(to.String(ulr.NextLink))) 10726} 10727 10728// UsagesListResultPage contains a page of Usage values. 10729type UsagesListResultPage struct { 10730 fn func(UsagesListResult) (UsagesListResult, error) 10731 ulr UsagesListResult 10732} 10733 10734// Next advances to the next page of values. If there was an error making 10735// the request the page does not advance and the error is returned. 10736func (page *UsagesListResultPage) Next() error { 10737 next, err := page.fn(page.ulr) 10738 if err != nil { 10739 return err 10740 } 10741 page.ulr = next 10742 return nil 10743} 10744 10745// NotDone returns true if the page enumeration should be started or is not yet complete. 10746func (page UsagesListResultPage) NotDone() bool { 10747 return !page.ulr.IsEmpty() 10748} 10749 10750// Response returns the raw server response from the last page request. 10751func (page UsagesListResultPage) Response() UsagesListResult { 10752 return page.ulr 10753} 10754 10755// Values returns the slice of values for the current page or nil if there are no values. 10756func (page UsagesListResultPage) Values() []Usage { 10757 if page.ulr.IsEmpty() { 10758 return nil 10759 } 10760 return *page.ulr.Value 10761} 10762 10763// VerificationIPFlowParameters parameters that define the IP flow to be verified. 10764type VerificationIPFlowParameters struct { 10765 // TargetResourceID - The ID of the target resource to perform next-hop on. 10766 TargetResourceID *string `json:"targetResourceId,omitempty"` 10767 // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' 10768 Direction Direction `json:"direction,omitempty"` 10769 // Protocol - Protocol to be verified on. Possible values include: 'ProtocolTCP', 'ProtocolUDP' 10770 Protocol Protocol `json:"protocol,omitempty"` 10771 // LocalPort - The local port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. 10772 LocalPort *string `json:"localPort,omitempty"` 10773 // RemotePort - The remote port. Acceptable values are a single integer in the range (0-65535). Support for * for the source port, which depends on the direction. 10774 RemotePort *string `json:"remotePort,omitempty"` 10775 // LocalIPAddress - The local IP address. Acceptable values are valid IPv4 addresses. 10776 LocalIPAddress *string `json:"localIPAddress,omitempty"` 10777 // RemoteIPAddress - The remote IP address. Acceptable values are valid IPv4 addresses. 10778 RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` 10779 // TargetNicResourceID - The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of them, then this parameter must be specified. Otherwise optional). 10780 TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` 10781} 10782 10783// VerificationIPFlowResult results of IP flow verification on the target resource. 10784type VerificationIPFlowResult struct { 10785 autorest.Response `json:"-"` 10786 // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' 10787 Access Access `json:"access,omitempty"` 10788 // RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed. 10789 RuleName *string `json:"ruleName,omitempty"` 10790} 10791 10792// VirtualNetwork virtual Network resource. 10793type VirtualNetwork struct { 10794 autorest.Response `json:"-"` 10795 *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` 10796 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 10797 Etag *string `json:"etag,omitempty"` 10798 // ID - Resource ID. 10799 ID *string `json:"id,omitempty"` 10800 // Name - Resource name. 10801 Name *string `json:"name,omitempty"` 10802 // Type - Resource type. 10803 Type *string `json:"type,omitempty"` 10804 // Location - Resource location. 10805 Location *string `json:"location,omitempty"` 10806 // Tags - Resource tags. 10807 Tags map[string]*string `json:"tags"` 10808} 10809 10810// MarshalJSON is the custom marshaler for VirtualNetwork. 10811func (vn VirtualNetwork) MarshalJSON() ([]byte, error) { 10812 objectMap := make(map[string]interface{}) 10813 if vn.VirtualNetworkPropertiesFormat != nil { 10814 objectMap["properties"] = vn.VirtualNetworkPropertiesFormat 10815 } 10816 if vn.Etag != nil { 10817 objectMap["etag"] = vn.Etag 10818 } 10819 if vn.ID != nil { 10820 objectMap["id"] = vn.ID 10821 } 10822 if vn.Name != nil { 10823 objectMap["name"] = vn.Name 10824 } 10825 if vn.Type != nil { 10826 objectMap["type"] = vn.Type 10827 } 10828 if vn.Location != nil { 10829 objectMap["location"] = vn.Location 10830 } 10831 if vn.Tags != nil { 10832 objectMap["tags"] = vn.Tags 10833 } 10834 return json.Marshal(objectMap) 10835} 10836 10837// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct. 10838func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { 10839 var m map[string]*json.RawMessage 10840 err := json.Unmarshal(body, &m) 10841 if err != nil { 10842 return err 10843 } 10844 for k, v := range m { 10845 switch k { 10846 case "properties": 10847 if v != nil { 10848 var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat 10849 err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat) 10850 if err != nil { 10851 return err 10852 } 10853 vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat 10854 } 10855 case "etag": 10856 if v != nil { 10857 var etag string 10858 err = json.Unmarshal(*v, &etag) 10859 if err != nil { 10860 return err 10861 } 10862 vn.Etag = &etag 10863 } 10864 case "id": 10865 if v != nil { 10866 var ID string 10867 err = json.Unmarshal(*v, &ID) 10868 if err != nil { 10869 return err 10870 } 10871 vn.ID = &ID 10872 } 10873 case "name": 10874 if v != nil { 10875 var name string 10876 err = json.Unmarshal(*v, &name) 10877 if err != nil { 10878 return err 10879 } 10880 vn.Name = &name 10881 } 10882 case "type": 10883 if v != nil { 10884 var typeVar string 10885 err = json.Unmarshal(*v, &typeVar) 10886 if err != nil { 10887 return err 10888 } 10889 vn.Type = &typeVar 10890 } 10891 case "location": 10892 if v != nil { 10893 var location string 10894 err = json.Unmarshal(*v, &location) 10895 if err != nil { 10896 return err 10897 } 10898 vn.Location = &location 10899 } 10900 case "tags": 10901 if v != nil { 10902 var tags map[string]*string 10903 err = json.Unmarshal(*v, &tags) 10904 if err != nil { 10905 return err 10906 } 10907 vn.Tags = tags 10908 } 10909 } 10910 } 10911 10912 return nil 10913} 10914 10915// VirtualNetworkGateway a common class for general resource information 10916type VirtualNetworkGateway struct { 10917 autorest.Response `json:"-"` 10918 *VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"` 10919 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 10920 Etag *string `json:"etag,omitempty"` 10921 // ID - Resource ID. 10922 ID *string `json:"id,omitempty"` 10923 // Name - Resource name. 10924 Name *string `json:"name,omitempty"` 10925 // Type - Resource type. 10926 Type *string `json:"type,omitempty"` 10927 // Location - Resource location. 10928 Location *string `json:"location,omitempty"` 10929 // Tags - Resource tags. 10930 Tags map[string]*string `json:"tags"` 10931} 10932 10933// MarshalJSON is the custom marshaler for VirtualNetworkGateway. 10934func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) { 10935 objectMap := make(map[string]interface{}) 10936 if vng.VirtualNetworkGatewayPropertiesFormat != nil { 10937 objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat 10938 } 10939 if vng.Etag != nil { 10940 objectMap["etag"] = vng.Etag 10941 } 10942 if vng.ID != nil { 10943 objectMap["id"] = vng.ID 10944 } 10945 if vng.Name != nil { 10946 objectMap["name"] = vng.Name 10947 } 10948 if vng.Type != nil { 10949 objectMap["type"] = vng.Type 10950 } 10951 if vng.Location != nil { 10952 objectMap["location"] = vng.Location 10953 } 10954 if vng.Tags != nil { 10955 objectMap["tags"] = vng.Tags 10956 } 10957 return json.Marshal(objectMap) 10958} 10959 10960// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct. 10961func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error { 10962 var m map[string]*json.RawMessage 10963 err := json.Unmarshal(body, &m) 10964 if err != nil { 10965 return err 10966 } 10967 for k, v := range m { 10968 switch k { 10969 case "properties": 10970 if v != nil { 10971 var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat 10972 err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat) 10973 if err != nil { 10974 return err 10975 } 10976 vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat 10977 } 10978 case "etag": 10979 if v != nil { 10980 var etag string 10981 err = json.Unmarshal(*v, &etag) 10982 if err != nil { 10983 return err 10984 } 10985 vng.Etag = &etag 10986 } 10987 case "id": 10988 if v != nil { 10989 var ID string 10990 err = json.Unmarshal(*v, &ID) 10991 if err != nil { 10992 return err 10993 } 10994 vng.ID = &ID 10995 } 10996 case "name": 10997 if v != nil { 10998 var name string 10999 err = json.Unmarshal(*v, &name) 11000 if err != nil { 11001 return err 11002 } 11003 vng.Name = &name 11004 } 11005 case "type": 11006 if v != nil { 11007 var typeVar string 11008 err = json.Unmarshal(*v, &typeVar) 11009 if err != nil { 11010 return err 11011 } 11012 vng.Type = &typeVar 11013 } 11014 case "location": 11015 if v != nil { 11016 var location string 11017 err = json.Unmarshal(*v, &location) 11018 if err != nil { 11019 return err 11020 } 11021 vng.Location = &location 11022 } 11023 case "tags": 11024 if v != nil { 11025 var tags map[string]*string 11026 err = json.Unmarshal(*v, &tags) 11027 if err != nil { 11028 return err 11029 } 11030 vng.Tags = tags 11031 } 11032 } 11033 } 11034 11035 return nil 11036} 11037 11038// VirtualNetworkGatewayConnection a common class for general resource information 11039type VirtualNetworkGatewayConnection struct { 11040 autorest.Response `json:"-"` 11041 *VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"` 11042 // Etag - Gets a unique read-only string that changes whenever the resource is updated. 11043 Etag *string `json:"etag,omitempty"` 11044 // ID - Resource ID. 11045 ID *string `json:"id,omitempty"` 11046 // Name - Resource name. 11047 Name *string `json:"name,omitempty"` 11048 // Type - Resource type. 11049 Type *string `json:"type,omitempty"` 11050 // Location - Resource location. 11051 Location *string `json:"location,omitempty"` 11052 // Tags - Resource tags. 11053 Tags map[string]*string `json:"tags"` 11054} 11055 11056// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection. 11057func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) { 11058 objectMap := make(map[string]interface{}) 11059 if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil { 11060 objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat 11061 } 11062 if vngc.Etag != nil { 11063 objectMap["etag"] = vngc.Etag 11064 } 11065 if vngc.ID != nil { 11066 objectMap["id"] = vngc.ID 11067 } 11068 if vngc.Name != nil { 11069 objectMap["name"] = vngc.Name 11070 } 11071 if vngc.Type != nil { 11072 objectMap["type"] = vngc.Type 11073 } 11074 if vngc.Location != nil { 11075 objectMap["location"] = vngc.Location 11076 } 11077 if vngc.Tags != nil { 11078 objectMap["tags"] = vngc.Tags 11079 } 11080 return json.Marshal(objectMap) 11081} 11082 11083// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct. 11084func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error { 11085 var m map[string]*json.RawMessage 11086 err := json.Unmarshal(body, &m) 11087 if err != nil { 11088 return err 11089 } 11090 for k, v := range m { 11091 switch k { 11092 case "properties": 11093 if v != nil { 11094 var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat 11095 err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat) 11096 if err != nil { 11097 return err 11098 } 11099 vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat 11100 } 11101 case "etag": 11102 if v != nil { 11103 var etag string 11104 err = json.Unmarshal(*v, &etag) 11105 if err != nil { 11106 return err 11107 } 11108 vngc.Etag = &etag 11109 } 11110 case "id": 11111 if v != nil { 11112 var ID string 11113 err = json.Unmarshal(*v, &ID) 11114 if err != nil { 11115 return err 11116 } 11117 vngc.ID = &ID 11118 } 11119 case "name": 11120 if v != nil { 11121 var name string 11122 err = json.Unmarshal(*v, &name) 11123 if err != nil { 11124 return err 11125 } 11126 vngc.Name = &name 11127 } 11128 case "type": 11129 if v != nil { 11130 var typeVar string 11131 err = json.Unmarshal(*v, &typeVar) 11132 if err != nil { 11133 return err 11134 } 11135 vngc.Type = &typeVar 11136 } 11137 case "location": 11138 if v != nil { 11139 var location string 11140 err = json.Unmarshal(*v, &location) 11141 if err != nil { 11142 return err 11143 } 11144 vngc.Location = &location 11145 } 11146 case "tags": 11147 if v != nil { 11148 var tags map[string]*string 11149 err = json.Unmarshal(*v, &tags) 11150 if err != nil { 11151 return err 11152 } 11153 vngc.Tags = tags 11154 } 11155 } 11156 } 11157 11158 return nil 11159} 11160 11161// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API service call 11162type VirtualNetworkGatewayConnectionListResult struct { 11163 autorest.Response `json:"-"` 11164 // Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group. 11165 Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` 11166 // NextLink - The URL to get the next set of results. 11167 NextLink *string `json:"nextLink,omitempty"` 11168} 11169 11170// VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of 11171// VirtualNetworkGatewayConnection values. 11172type VirtualNetworkGatewayConnectionListResultIterator struct { 11173 i int 11174 page VirtualNetworkGatewayConnectionListResultPage 11175} 11176 11177// Next advances to the next value. If there was an error making 11178// the request the iterator does not advance and the error is returned. 11179func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error { 11180 iter.i++ 11181 if iter.i < len(iter.page.Values()) { 11182 return nil 11183 } 11184 err := iter.page.Next() 11185 if err != nil { 11186 iter.i-- 11187 return err 11188 } 11189 iter.i = 0 11190 return nil 11191} 11192 11193// NotDone returns true if the enumeration should be started or is not yet complete. 11194func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool { 11195 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11196} 11197 11198// Response returns the raw server response from the last page request. 11199func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult { 11200 return iter.page.Response() 11201} 11202 11203// Value returns the current value or a zero-initialized value if the 11204// iterator has advanced beyond the end of the collection. 11205func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection { 11206 if !iter.page.NotDone() { 11207 return VirtualNetworkGatewayConnection{} 11208 } 11209 return iter.page.Values()[iter.i] 11210} 11211 11212// IsEmpty returns true if the ListResult contains no values. 11213func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool { 11214 return vngclr.Value == nil || len(*vngclr.Value) == 0 11215} 11216 11217// virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results. 11218// It returns nil if no more results exist. 11219func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer() (*http.Request, error) { 11220 if vngclr.NextLink == nil || len(to.String(vngclr.NextLink)) < 1 { 11221 return nil, nil 11222 } 11223 return autorest.Prepare(&http.Request{}, 11224 autorest.AsJSON(), 11225 autorest.AsGet(), 11226 autorest.WithBaseURL(to.String(vngclr.NextLink))) 11227} 11228 11229// VirtualNetworkGatewayConnectionListResultPage contains a page of VirtualNetworkGatewayConnection values. 11230type VirtualNetworkGatewayConnectionListResultPage struct { 11231 fn func(VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error) 11232 vngclr VirtualNetworkGatewayConnectionListResult 11233} 11234 11235// Next advances to the next page of values. If there was an error making 11236// the request the page does not advance and the error is returned. 11237func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error { 11238 next, err := page.fn(page.vngclr) 11239 if err != nil { 11240 return err 11241 } 11242 page.vngclr = next 11243 return nil 11244} 11245 11246// NotDone returns true if the page enumeration should be started or is not yet complete. 11247func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool { 11248 return !page.vngclr.IsEmpty() 11249} 11250 11251// Response returns the raw server response from the last page request. 11252func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult { 11253 return page.vngclr 11254} 11255 11256// Values returns the slice of values for the current page or nil if there are no values. 11257func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection { 11258 if page.vngclr.IsEmpty() { 11259 return nil 11260 } 11261 return *page.vngclr.Value 11262} 11263 11264// VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties 11265type VirtualNetworkGatewayConnectionPropertiesFormat struct { 11266 // AuthorizationKey - The authorizationKey. 11267 AuthorizationKey *string `json:"authorizationKey,omitempty"` 11268 VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` 11269 VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` 11270 LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` 11271 // ConnectionType - Gateway connection type. Possible values are: 'Ipsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' 11272 ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` 11273 // RoutingWeight - The routing weight. 11274 RoutingWeight *int32 `json:"routingWeight,omitempty"` 11275 // SharedKey - The IPSec shared key. 11276 SharedKey *string `json:"sharedKey,omitempty"` 11277 // ConnectionStatus - Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected' 11278 ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` 11279 // TunnelConnectionStatus - Collection of all tunnels' connection health status. 11280 TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` 11281 // EgressBytesTransferred - The egress bytes transferred in this connection. 11282 EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` 11283 // IngressBytesTransferred - The ingress bytes transferred in this connection. 11284 IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` 11285 // Peer - The reference to peerings resource. 11286 Peer *SubResource `json:"peer,omitempty"` 11287 // EnableBgp - EnableBgp flag 11288 EnableBgp *bool `json:"enableBgp,omitempty"` 11289 // UsePolicyBasedTrafficSelectors - Enable policy-based traffic selectors. 11290 UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` 11291 // IpsecPolicies - The IPSec Policies to be considered by this connection. 11292 IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` 11293 // ResourceGUID - The resource GUID property of the VirtualNetworkGatewayConnection resource. 11294 ResourceGUID *string `json:"resourceGuid,omitempty"` 11295 // ProvisioningState - The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 11296 ProvisioningState *string `json:"provisioningState,omitempty"` 11297} 11298 11299// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of 11300// a long-running operation. 11301type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct { 11302 azure.Future 11303 req *http.Request 11304} 11305 11306// Result returns the result of the asynchronous operation. 11307// If the operation has not completed it will return an error. 11308func (future VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) Result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) { 11309 var done bool 11310 done, err = future.Done(client) 11311 if err != nil { 11312 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 11313 return 11314 } 11315 if !done { 11316 return vngc, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture") 11317 } 11318 if future.PollingMethod() == azure.PollingLocation { 11319 vngc, err = client.CreateOrUpdateResponder(future.Response()) 11320 if err != nil { 11321 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 11322 } 11323 return 11324 } 11325 var req *http.Request 11326 var resp *http.Response 11327 if future.PollingURL() != "" { 11328 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11329 if err != nil { 11330 return 11331 } 11332 } else { 11333 req = autorest.ChangeToGet(future.req) 11334 } 11335 resp, err = autorest.SendWithSender(client, req, 11336 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11337 if err != nil { 11338 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", resp, "Failure sending request") 11339 return 11340 } 11341 vngc, err = client.CreateOrUpdateResponder(resp) 11342 if err != nil { 11343 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 11344 } 11345 return 11346} 11347 11348// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 11349// long-running operation. 11350type VirtualNetworkGatewayConnectionsDeleteFuture struct { 11351 azure.Future 11352 req *http.Request 11353} 11354 11355// Result returns the result of the asynchronous operation. 11356// If the operation has not completed it will return an error. 11357func (future VirtualNetworkGatewayConnectionsDeleteFuture) Result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) { 11358 var done bool 11359 done, err = future.Done(client) 11360 if err != nil { 11361 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 11362 return 11363 } 11364 if !done { 11365 return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture") 11366 } 11367 if future.PollingMethod() == azure.PollingLocation { 11368 ar, err = client.DeleteResponder(future.Response()) 11369 if err != nil { 11370 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Failure responding to request") 11371 } 11372 return 11373 } 11374 var req *http.Request 11375 var resp *http.Response 11376 if future.PollingURL() != "" { 11377 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11378 if err != nil { 11379 return 11380 } 11381 } else { 11382 req = autorest.ChangeToGet(future.req) 11383 } 11384 resp, err = autorest.SendWithSender(client, req, 11385 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11386 if err != nil { 11387 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", resp, "Failure sending request") 11388 return 11389 } 11390 ar, err = client.DeleteResponder(resp) 11391 if err != nil { 11392 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", resp, "Failure responding to request") 11393 } 11394 return 11395} 11396 11397// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the results of 11398// a long-running operation. 11399type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct { 11400 azure.Future 11401 req *http.Request 11402} 11403 11404// Result returns the result of the asynchronous operation. 11405// If the operation has not completed it will return an error. 11406func (future VirtualNetworkGatewayConnectionsResetSharedKeyFuture) Result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) { 11407 var done bool 11408 done, err = future.Done(client) 11409 if err != nil { 11410 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure") 11411 return 11412 } 11413 if !done { 11414 return crsk, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture") 11415 } 11416 if future.PollingMethod() == azure.PollingLocation { 11417 crsk, err = client.ResetSharedKeyResponder(future.Response()) 11418 if err != nil { 11419 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Failure responding to request") 11420 } 11421 return 11422 } 11423 var req *http.Request 11424 var resp *http.Response 11425 if future.PollingURL() != "" { 11426 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11427 if err != nil { 11428 return 11429 } 11430 } else { 11431 req = autorest.ChangeToGet(future.req) 11432 } 11433 resp, err = autorest.SendWithSender(client, req, 11434 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11435 if err != nil { 11436 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", resp, "Failure sending request") 11437 return 11438 } 11439 crsk, err = client.ResetSharedKeyResponder(resp) 11440 if err != nil { 11441 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", resp, "Failure responding to request") 11442 } 11443 return 11444} 11445 11446// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the results of a 11447// long-running operation. 11448type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct { 11449 azure.Future 11450 req *http.Request 11451} 11452 11453// Result returns the result of the asynchronous operation. 11454// If the operation has not completed it will return an error. 11455func (future VirtualNetworkGatewayConnectionsSetSharedKeyFuture) Result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) { 11456 var done bool 11457 done, err = future.Done(client) 11458 if err != nil { 11459 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure") 11460 return 11461 } 11462 if !done { 11463 return csk, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture") 11464 } 11465 if future.PollingMethod() == azure.PollingLocation { 11466 csk, err = client.SetSharedKeyResponder(future.Response()) 11467 if err != nil { 11468 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Failure responding to request") 11469 } 11470 return 11471 } 11472 var req *http.Request 11473 var resp *http.Response 11474 if future.PollingURL() != "" { 11475 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11476 if err != nil { 11477 return 11478 } 11479 } else { 11480 req = autorest.ChangeToGet(future.req) 11481 } 11482 resp, err = autorest.SendWithSender(client, req, 11483 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11484 if err != nil { 11485 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", resp, "Failure sending request") 11486 return 11487 } 11488 csk, err = client.SetSharedKeyResponder(resp) 11489 if err != nil { 11490 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", resp, "Failure responding to request") 11491 } 11492 return 11493} 11494 11495// VirtualNetworkGatewayIPConfiguration IP configuration for virtual network gateway 11496type VirtualNetworkGatewayIPConfiguration struct { 11497 *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` 11498 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 11499 Name *string `json:"name,omitempty"` 11500 // Etag - A unique read-only string that changes whenever the resource is updated. 11501 Etag *string `json:"etag,omitempty"` 11502 // ID - Resource ID. 11503 ID *string `json:"id,omitempty"` 11504} 11505 11506// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration. 11507func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) { 11508 objectMap := make(map[string]interface{}) 11509 if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil { 11510 objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat 11511 } 11512 if vngic.Name != nil { 11513 objectMap["name"] = vngic.Name 11514 } 11515 if vngic.Etag != nil { 11516 objectMap["etag"] = vngic.Etag 11517 } 11518 if vngic.ID != nil { 11519 objectMap["id"] = vngic.ID 11520 } 11521 return json.Marshal(objectMap) 11522} 11523 11524// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct. 11525func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error { 11526 var m map[string]*json.RawMessage 11527 err := json.Unmarshal(body, &m) 11528 if err != nil { 11529 return err 11530 } 11531 for k, v := range m { 11532 switch k { 11533 case "properties": 11534 if v != nil { 11535 var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat 11536 err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat) 11537 if err != nil { 11538 return err 11539 } 11540 vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat 11541 } 11542 case "name": 11543 if v != nil { 11544 var name string 11545 err = json.Unmarshal(*v, &name) 11546 if err != nil { 11547 return err 11548 } 11549 vngic.Name = &name 11550 } 11551 case "etag": 11552 if v != nil { 11553 var etag string 11554 err = json.Unmarshal(*v, &etag) 11555 if err != nil { 11556 return err 11557 } 11558 vngic.Etag = &etag 11559 } 11560 case "id": 11561 if v != nil { 11562 var ID string 11563 err = json.Unmarshal(*v, &ID) 11564 if err != nil { 11565 return err 11566 } 11567 vngic.ID = &ID 11568 } 11569 } 11570 } 11571 11572 return nil 11573} 11574 11575// VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration 11576type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { 11577 // PrivateIPAllocationMethod - The private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic' 11578 PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` 11579 // Subnet - The reference of the subnet resource. 11580 Subnet *SubResource `json:"subnet,omitempty"` 11581 // PublicIPAddress - The reference of the public IP resource. 11582 PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` 11583 // ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 11584 ProvisioningState *string `json:"provisioningState,omitempty"` 11585} 11586 11587// VirtualNetworkGatewayListResult response for the ListVirtualNetworkGateways API service call. 11588type VirtualNetworkGatewayListResult struct { 11589 autorest.Response `json:"-"` 11590 // Value - Gets a list of VirtualNetworkGateway resources that exists in a resource group. 11591 Value *[]VirtualNetworkGateway `json:"value,omitempty"` 11592 // NextLink - The URL to get the next set of results. 11593 NextLink *string `json:"nextLink,omitempty"` 11594} 11595 11596// VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway values. 11597type VirtualNetworkGatewayListResultIterator struct { 11598 i int 11599 page VirtualNetworkGatewayListResultPage 11600} 11601 11602// Next advances to the next value. If there was an error making 11603// the request the iterator does not advance and the error is returned. 11604func (iter *VirtualNetworkGatewayListResultIterator) Next() error { 11605 iter.i++ 11606 if iter.i < len(iter.page.Values()) { 11607 return nil 11608 } 11609 err := iter.page.Next() 11610 if err != nil { 11611 iter.i-- 11612 return err 11613 } 11614 iter.i = 0 11615 return nil 11616} 11617 11618// NotDone returns true if the enumeration should be started or is not yet complete. 11619func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool { 11620 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 11621} 11622 11623// Response returns the raw server response from the last page request. 11624func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult { 11625 return iter.page.Response() 11626} 11627 11628// Value returns the current value or a zero-initialized value if the 11629// iterator has advanced beyond the end of the collection. 11630func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway { 11631 if !iter.page.NotDone() { 11632 return VirtualNetworkGateway{} 11633 } 11634 return iter.page.Values()[iter.i] 11635} 11636 11637// IsEmpty returns true if the ListResult contains no values. 11638func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool { 11639 return vnglr.Value == nil || len(*vnglr.Value) == 0 11640} 11641 11642// virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. 11643// It returns nil if no more results exist. 11644func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer() (*http.Request, error) { 11645 if vnglr.NextLink == nil || len(to.String(vnglr.NextLink)) < 1 { 11646 return nil, nil 11647 } 11648 return autorest.Prepare(&http.Request{}, 11649 autorest.AsJSON(), 11650 autorest.AsGet(), 11651 autorest.WithBaseURL(to.String(vnglr.NextLink))) 11652} 11653 11654// VirtualNetworkGatewayListResultPage contains a page of VirtualNetworkGateway values. 11655type VirtualNetworkGatewayListResultPage struct { 11656 fn func(VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error) 11657 vnglr VirtualNetworkGatewayListResult 11658} 11659 11660// Next advances to the next page of values. If there was an error making 11661// the request the page does not advance and the error is returned. 11662func (page *VirtualNetworkGatewayListResultPage) Next() error { 11663 next, err := page.fn(page.vnglr) 11664 if err != nil { 11665 return err 11666 } 11667 page.vnglr = next 11668 return nil 11669} 11670 11671// NotDone returns true if the page enumeration should be started or is not yet complete. 11672func (page VirtualNetworkGatewayListResultPage) NotDone() bool { 11673 return !page.vnglr.IsEmpty() 11674} 11675 11676// Response returns the raw server response from the last page request. 11677func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult { 11678 return page.vnglr 11679} 11680 11681// Values returns the slice of values for the current page or nil if there are no values. 11682func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway { 11683 if page.vnglr.IsEmpty() { 11684 return nil 11685 } 11686 return *page.vnglr.Value 11687} 11688 11689// VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties 11690type VirtualNetworkGatewayPropertiesFormat struct { 11691 // IPConfigurations - IP configurations for virtual network gateway. 11692 IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` 11693 // GatewayType - The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute' 11694 GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` 11695 // VpnType - The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased' 11696 VpnType VpnType `json:"vpnType,omitempty"` 11697 // EnableBgp - Whether BGP is enabled for this virtual network gateway or not. 11698 EnableBgp *bool `json:"enableBgp,omitempty"` 11699 // ActiveActive - ActiveActive flag 11700 ActiveActive *bool `json:"activeActive,omitempty"` 11701 // 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. 11702 GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` 11703 // Sku - The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway. 11704 Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` 11705 // VpnClientConfiguration - The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations. 11706 VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` 11707 // BgpSettings - Virtual network gateway's BGP speaker settings. 11708 BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` 11709 // ResourceGUID - The resource GUID property of the VirtualNetworkGateway resource. 11710 ResourceGUID *string `json:"resourceGuid,omitempty"` 11711 // ProvisioningState - The provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 11712 ProvisioningState *string `json:"provisioningState,omitempty"` 11713} 11714 11715// VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 11716// long-running operation. 11717type VirtualNetworkGatewaysCreateOrUpdateFuture struct { 11718 azure.Future 11719 req *http.Request 11720} 11721 11722// Result returns the result of the asynchronous operation. 11723// If the operation has not completed it will return an error. 11724func (future VirtualNetworkGatewaysCreateOrUpdateFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 11725 var done bool 11726 done, err = future.Done(client) 11727 if err != nil { 11728 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 11729 return 11730 } 11731 if !done { 11732 return vng, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture") 11733 } 11734 if future.PollingMethod() == azure.PollingLocation { 11735 vng, err = client.CreateOrUpdateResponder(future.Response()) 11736 if err != nil { 11737 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 11738 } 11739 return 11740 } 11741 var req *http.Request 11742 var resp *http.Response 11743 if future.PollingURL() != "" { 11744 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11745 if err != nil { 11746 return 11747 } 11748 } else { 11749 req = autorest.ChangeToGet(future.req) 11750 } 11751 resp, err = autorest.SendWithSender(client, req, 11752 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11753 if err != nil { 11754 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure sending request") 11755 return 11756 } 11757 vng, err = client.CreateOrUpdateResponder(resp) 11758 if err != nil { 11759 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 11760 } 11761 return 11762} 11763 11764// VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 11765// operation. 11766type VirtualNetworkGatewaysDeleteFuture struct { 11767 azure.Future 11768 req *http.Request 11769} 11770 11771// Result returns the result of the asynchronous operation. 11772// If the operation has not completed it will return an error. 11773func (future VirtualNetworkGatewaysDeleteFuture) Result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) { 11774 var done bool 11775 done, err = future.Done(client) 11776 if err != nil { 11777 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") 11778 return 11779 } 11780 if !done { 11781 return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture") 11782 } 11783 if future.PollingMethod() == azure.PollingLocation { 11784 ar, err = client.DeleteResponder(future.Response()) 11785 if err != nil { 11786 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Failure responding to request") 11787 } 11788 return 11789 } 11790 var req *http.Request 11791 var resp *http.Response 11792 if future.PollingURL() != "" { 11793 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11794 if err != nil { 11795 return 11796 } 11797 } else { 11798 req = autorest.ChangeToGet(future.req) 11799 } 11800 resp, err = autorest.SendWithSender(client, req, 11801 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11802 if err != nil { 11803 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", resp, "Failure sending request") 11804 return 11805 } 11806 ar, err = client.DeleteResponder(resp) 11807 if err != nil { 11808 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", resp, "Failure responding to request") 11809 } 11810 return 11811} 11812 11813// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results of a 11814// long-running operation. 11815type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct { 11816 azure.Future 11817 req *http.Request 11818} 11819 11820// Result returns the result of the asynchronous operation. 11821// If the operation has not completed it will return an error. 11822func (future VirtualNetworkGatewaysGetAdvertisedRoutesFuture) Result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { 11823 var done bool 11824 done, err = future.Done(client) 11825 if err != nil { 11826 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure") 11827 return 11828 } 11829 if !done { 11830 return grlr, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture") 11831 } 11832 if future.PollingMethod() == azure.PollingLocation { 11833 grlr, err = client.GetAdvertisedRoutesResponder(future.Response()) 11834 if err != nil { 11835 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Failure responding to request") 11836 } 11837 return 11838 } 11839 var req *http.Request 11840 var resp *http.Response 11841 if future.PollingURL() != "" { 11842 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11843 if err != nil { 11844 return 11845 } 11846 } else { 11847 req = autorest.ChangeToGet(future.req) 11848 } 11849 resp, err = autorest.SendWithSender(client, req, 11850 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11851 if err != nil { 11852 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", resp, "Failure sending request") 11853 return 11854 } 11855 grlr, err = client.GetAdvertisedRoutesResponder(resp) 11856 if err != nil { 11857 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", resp, "Failure responding to request") 11858 } 11859 return 11860} 11861 11862// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of a 11863// long-running operation. 11864type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct { 11865 azure.Future 11866 req *http.Request 11867} 11868 11869// Result returns the result of the asynchronous operation. 11870// If the operation has not completed it will return an error. 11871func (future VirtualNetworkGatewaysGetBgpPeerStatusFuture) Result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) { 11872 var done bool 11873 done, err = future.Done(client) 11874 if err != nil { 11875 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure") 11876 return 11877 } 11878 if !done { 11879 return bpslr, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture") 11880 } 11881 if future.PollingMethod() == azure.PollingLocation { 11882 bpslr, err = client.GetBgpPeerStatusResponder(future.Response()) 11883 if err != nil { 11884 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Failure responding to request") 11885 } 11886 return 11887 } 11888 var req *http.Request 11889 var resp *http.Response 11890 if future.PollingURL() != "" { 11891 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11892 if err != nil { 11893 return 11894 } 11895 } else { 11896 req = autorest.ChangeToGet(future.req) 11897 } 11898 resp, err = autorest.SendWithSender(client, req, 11899 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11900 if err != nil { 11901 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", resp, "Failure sending request") 11902 return 11903 } 11904 bpslr, err = client.GetBgpPeerStatusResponder(resp) 11905 if err != nil { 11906 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", resp, "Failure responding to request") 11907 } 11908 return 11909} 11910 11911// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of a 11912// long-running operation. 11913type VirtualNetworkGatewaysGetLearnedRoutesFuture struct { 11914 azure.Future 11915 req *http.Request 11916} 11917 11918// Result returns the result of the asynchronous operation. 11919// If the operation has not completed it will return an error. 11920func (future VirtualNetworkGatewaysGetLearnedRoutesFuture) Result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) { 11921 var done bool 11922 done, err = future.Done(client) 11923 if err != nil { 11924 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure") 11925 return 11926 } 11927 if !done { 11928 return grlr, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture") 11929 } 11930 if future.PollingMethod() == azure.PollingLocation { 11931 grlr, err = client.GetLearnedRoutesResponder(future.Response()) 11932 if err != nil { 11933 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Failure responding to request") 11934 } 11935 return 11936 } 11937 var req *http.Request 11938 var resp *http.Response 11939 if future.PollingURL() != "" { 11940 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 11941 if err != nil { 11942 return 11943 } 11944 } else { 11945 req = autorest.ChangeToGet(future.req) 11946 } 11947 resp, err = autorest.SendWithSender(client, req, 11948 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11949 if err != nil { 11950 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", resp, "Failure sending request") 11951 return 11952 } 11953 grlr, err = client.GetLearnedRoutesResponder(resp) 11954 if err != nil { 11955 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", resp, "Failure responding to request") 11956 } 11957 return 11958} 11959 11960// VirtualNetworkGatewaySku virtualNetworkGatewaySku details 11961type VirtualNetworkGatewaySku struct { 11962 // Name - Gateway SKU name. Possible values include: 'VirtualNetworkGatewaySkuNameBasic', 'VirtualNetworkGatewaySkuNameHighPerformance', 'VirtualNetworkGatewaySkuNameStandard', 'VirtualNetworkGatewaySkuNameUltraPerformance', 'VirtualNetworkGatewaySkuNameVpnGw1', 'VirtualNetworkGatewaySkuNameVpnGw2', 'VirtualNetworkGatewaySkuNameVpnGw3' 11963 Name VirtualNetworkGatewaySkuName `json:"name,omitempty"` 11964 // Tier - Gateway SKU tier. Possible values include: 'VirtualNetworkGatewaySkuTierBasic', 'VirtualNetworkGatewaySkuTierHighPerformance', 'VirtualNetworkGatewaySkuTierStandard', 'VirtualNetworkGatewaySkuTierUltraPerformance', 'VirtualNetworkGatewaySkuTierVpnGw1', 'VirtualNetworkGatewaySkuTierVpnGw2', 'VirtualNetworkGatewaySkuTierVpnGw3' 11965 Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` 11966 // Capacity - The capacity. 11967 Capacity *int32 `json:"capacity,omitempty"` 11968} 11969 11970// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a long-running 11971// operation. 11972type VirtualNetworkGatewaysResetFuture struct { 11973 azure.Future 11974 req *http.Request 11975} 11976 11977// Result returns the result of the asynchronous operation. 11978// If the operation has not completed it will return an error. 11979func (future VirtualNetworkGatewaysResetFuture) Result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) { 11980 var done bool 11981 done, err = future.Done(client) 11982 if err != nil { 11983 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure") 11984 return 11985 } 11986 if !done { 11987 return vng, azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture") 11988 } 11989 if future.PollingMethod() == azure.PollingLocation { 11990 vng, err = client.ResetResponder(future.Response()) 11991 if err != nil { 11992 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Failure responding to request") 11993 } 11994 return 11995 } 11996 var req *http.Request 11997 var resp *http.Response 11998 if future.PollingURL() != "" { 11999 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 12000 if err != nil { 12001 return 12002 } 12003 } else { 12004 req = autorest.ChangeToGet(future.req) 12005 } 12006 resp, err = autorest.SendWithSender(client, req, 12007 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12008 if err != nil { 12009 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", resp, "Failure sending request") 12010 return 12011 } 12012 vng, err = client.ResetResponder(resp) 12013 if err != nil { 12014 err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", resp, "Failure responding to request") 12015 } 12016 return 12017} 12018 12019// VirtualNetworkListResult response for the ListVirtualNetworks API service call. 12020type VirtualNetworkListResult struct { 12021 autorest.Response `json:"-"` 12022 // Value - Gets a list of VirtualNetwork resources in a resource group. 12023 Value *[]VirtualNetwork `json:"value,omitempty"` 12024 // NextLink - The URL to get the next set of results. 12025 NextLink *string `json:"nextLink,omitempty"` 12026} 12027 12028// VirtualNetworkListResultIterator provides access to a complete listing of VirtualNetwork values. 12029type VirtualNetworkListResultIterator struct { 12030 i int 12031 page VirtualNetworkListResultPage 12032} 12033 12034// Next advances to the next value. If there was an error making 12035// the request the iterator does not advance and the error is returned. 12036func (iter *VirtualNetworkListResultIterator) Next() error { 12037 iter.i++ 12038 if iter.i < len(iter.page.Values()) { 12039 return nil 12040 } 12041 err := iter.page.Next() 12042 if err != nil { 12043 iter.i-- 12044 return err 12045 } 12046 iter.i = 0 12047 return nil 12048} 12049 12050// NotDone returns true if the enumeration should be started or is not yet complete. 12051func (iter VirtualNetworkListResultIterator) NotDone() bool { 12052 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12053} 12054 12055// Response returns the raw server response from the last page request. 12056func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult { 12057 return iter.page.Response() 12058} 12059 12060// Value returns the current value or a zero-initialized value if the 12061// iterator has advanced beyond the end of the collection. 12062func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork { 12063 if !iter.page.NotDone() { 12064 return VirtualNetwork{} 12065 } 12066 return iter.page.Values()[iter.i] 12067} 12068 12069// IsEmpty returns true if the ListResult contains no values. 12070func (vnlr VirtualNetworkListResult) IsEmpty() bool { 12071 return vnlr.Value == nil || len(*vnlr.Value) == 0 12072} 12073 12074// virtualNetworkListResultPreparer prepares a request to retrieve the next set of results. 12075// It returns nil if no more results exist. 12076func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer() (*http.Request, error) { 12077 if vnlr.NextLink == nil || len(to.String(vnlr.NextLink)) < 1 { 12078 return nil, nil 12079 } 12080 return autorest.Prepare(&http.Request{}, 12081 autorest.AsJSON(), 12082 autorest.AsGet(), 12083 autorest.WithBaseURL(to.String(vnlr.NextLink))) 12084} 12085 12086// VirtualNetworkListResultPage contains a page of VirtualNetwork values. 12087type VirtualNetworkListResultPage struct { 12088 fn func(VirtualNetworkListResult) (VirtualNetworkListResult, error) 12089 vnlr VirtualNetworkListResult 12090} 12091 12092// Next advances to the next page of values. If there was an error making 12093// the request the page does not advance and the error is returned. 12094func (page *VirtualNetworkListResultPage) Next() error { 12095 next, err := page.fn(page.vnlr) 12096 if err != nil { 12097 return err 12098 } 12099 page.vnlr = next 12100 return nil 12101} 12102 12103// NotDone returns true if the page enumeration should be started or is not yet complete. 12104func (page VirtualNetworkListResultPage) NotDone() bool { 12105 return !page.vnlr.IsEmpty() 12106} 12107 12108// Response returns the raw server response from the last page request. 12109func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult { 12110 return page.vnlr 12111} 12112 12113// Values returns the slice of values for the current page or nil if there are no values. 12114func (page VirtualNetworkListResultPage) Values() []VirtualNetwork { 12115 if page.vnlr.IsEmpty() { 12116 return nil 12117 } 12118 return *page.vnlr.Value 12119} 12120 12121// VirtualNetworkListUsageResult response for the virtual networks GetUsage API service call. 12122type VirtualNetworkListUsageResult struct { 12123 autorest.Response `json:"-"` 12124 // Value - VirtualNetwork usage stats. 12125 Value *[]VirtualNetworkUsage `json:"value,omitempty"` 12126 // NextLink - The URL to get the next set of results. 12127 NextLink *string `json:"nextLink,omitempty"` 12128} 12129 12130// VirtualNetworkListUsageResultIterator provides access to a complete listing of VirtualNetworkUsage values. 12131type VirtualNetworkListUsageResultIterator struct { 12132 i int 12133 page VirtualNetworkListUsageResultPage 12134} 12135 12136// Next advances to the next value. If there was an error making 12137// the request the iterator does not advance and the error is returned. 12138func (iter *VirtualNetworkListUsageResultIterator) Next() error { 12139 iter.i++ 12140 if iter.i < len(iter.page.Values()) { 12141 return nil 12142 } 12143 err := iter.page.Next() 12144 if err != nil { 12145 iter.i-- 12146 return err 12147 } 12148 iter.i = 0 12149 return nil 12150} 12151 12152// NotDone returns true if the enumeration should be started or is not yet complete. 12153func (iter VirtualNetworkListUsageResultIterator) NotDone() bool { 12154 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12155} 12156 12157// Response returns the raw server response from the last page request. 12158func (iter VirtualNetworkListUsageResultIterator) Response() VirtualNetworkListUsageResult { 12159 return iter.page.Response() 12160} 12161 12162// Value returns the current value or a zero-initialized value if the 12163// iterator has advanced beyond the end of the collection. 12164func (iter VirtualNetworkListUsageResultIterator) Value() VirtualNetworkUsage { 12165 if !iter.page.NotDone() { 12166 return VirtualNetworkUsage{} 12167 } 12168 return iter.page.Values()[iter.i] 12169} 12170 12171// IsEmpty returns true if the ListResult contains no values. 12172func (vnlur VirtualNetworkListUsageResult) IsEmpty() bool { 12173 return vnlur.Value == nil || len(*vnlur.Value) == 0 12174} 12175 12176// virtualNetworkListUsageResultPreparer prepares a request to retrieve the next set of results. 12177// It returns nil if no more results exist. 12178func (vnlur VirtualNetworkListUsageResult) virtualNetworkListUsageResultPreparer() (*http.Request, error) { 12179 if vnlur.NextLink == nil || len(to.String(vnlur.NextLink)) < 1 { 12180 return nil, nil 12181 } 12182 return autorest.Prepare(&http.Request{}, 12183 autorest.AsJSON(), 12184 autorest.AsGet(), 12185 autorest.WithBaseURL(to.String(vnlur.NextLink))) 12186} 12187 12188// VirtualNetworkListUsageResultPage contains a page of VirtualNetworkUsage values. 12189type VirtualNetworkListUsageResultPage struct { 12190 fn func(VirtualNetworkListUsageResult) (VirtualNetworkListUsageResult, error) 12191 vnlur VirtualNetworkListUsageResult 12192} 12193 12194// Next advances to the next page of values. If there was an error making 12195// the request the page does not advance and the error is returned. 12196func (page *VirtualNetworkListUsageResultPage) Next() error { 12197 next, err := page.fn(page.vnlur) 12198 if err != nil { 12199 return err 12200 } 12201 page.vnlur = next 12202 return nil 12203} 12204 12205// NotDone returns true if the page enumeration should be started or is not yet complete. 12206func (page VirtualNetworkListUsageResultPage) NotDone() bool { 12207 return !page.vnlur.IsEmpty() 12208} 12209 12210// Response returns the raw server response from the last page request. 12211func (page VirtualNetworkListUsageResultPage) Response() VirtualNetworkListUsageResult { 12212 return page.vnlur 12213} 12214 12215// Values returns the slice of values for the current page or nil if there are no values. 12216func (page VirtualNetworkListUsageResultPage) Values() []VirtualNetworkUsage { 12217 if page.vnlur.IsEmpty() { 12218 return nil 12219 } 12220 return *page.vnlur.Value 12221} 12222 12223// VirtualNetworkPeering peerings in a virtual network resource. 12224type VirtualNetworkPeering struct { 12225 autorest.Response `json:"-"` 12226 *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` 12227 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 12228 Name *string `json:"name,omitempty"` 12229 // Etag - A unique read-only string that changes whenever the resource is updated. 12230 Etag *string `json:"etag,omitempty"` 12231 // ID - Resource ID. 12232 ID *string `json:"id,omitempty"` 12233} 12234 12235// MarshalJSON is the custom marshaler for VirtualNetworkPeering. 12236func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) { 12237 objectMap := make(map[string]interface{}) 12238 if vnp.VirtualNetworkPeeringPropertiesFormat != nil { 12239 objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat 12240 } 12241 if vnp.Name != nil { 12242 objectMap["name"] = vnp.Name 12243 } 12244 if vnp.Etag != nil { 12245 objectMap["etag"] = vnp.Etag 12246 } 12247 if vnp.ID != nil { 12248 objectMap["id"] = vnp.ID 12249 } 12250 return json.Marshal(objectMap) 12251} 12252 12253// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct. 12254func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error { 12255 var m map[string]*json.RawMessage 12256 err := json.Unmarshal(body, &m) 12257 if err != nil { 12258 return err 12259 } 12260 for k, v := range m { 12261 switch k { 12262 case "properties": 12263 if v != nil { 12264 var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat 12265 err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat) 12266 if err != nil { 12267 return err 12268 } 12269 vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat 12270 } 12271 case "name": 12272 if v != nil { 12273 var name string 12274 err = json.Unmarshal(*v, &name) 12275 if err != nil { 12276 return err 12277 } 12278 vnp.Name = &name 12279 } 12280 case "etag": 12281 if v != nil { 12282 var etag string 12283 err = json.Unmarshal(*v, &etag) 12284 if err != nil { 12285 return err 12286 } 12287 vnp.Etag = &etag 12288 } 12289 case "id": 12290 if v != nil { 12291 var ID string 12292 err = json.Unmarshal(*v, &ID) 12293 if err != nil { 12294 return err 12295 } 12296 vnp.ID = &ID 12297 } 12298 } 12299 } 12300 12301 return nil 12302} 12303 12304// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that belong to 12305// a virtual network. 12306type VirtualNetworkPeeringListResult struct { 12307 autorest.Response `json:"-"` 12308 // Value - The peerings in a virtual network. 12309 Value *[]VirtualNetworkPeering `json:"value,omitempty"` 12310 // NextLink - The URL to get the next set of results. 12311 NextLink *string `json:"nextLink,omitempty"` 12312} 12313 12314// VirtualNetworkPeeringListResultIterator provides access to a complete listing of VirtualNetworkPeering values. 12315type VirtualNetworkPeeringListResultIterator struct { 12316 i int 12317 page VirtualNetworkPeeringListResultPage 12318} 12319 12320// Next advances to the next value. If there was an error making 12321// the request the iterator does not advance and the error is returned. 12322func (iter *VirtualNetworkPeeringListResultIterator) Next() error { 12323 iter.i++ 12324 if iter.i < len(iter.page.Values()) { 12325 return nil 12326 } 12327 err := iter.page.Next() 12328 if err != nil { 12329 iter.i-- 12330 return err 12331 } 12332 iter.i = 0 12333 return nil 12334} 12335 12336// NotDone returns true if the enumeration should be started or is not yet complete. 12337func (iter VirtualNetworkPeeringListResultIterator) NotDone() bool { 12338 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 12339} 12340 12341// Response returns the raw server response from the last page request. 12342func (iter VirtualNetworkPeeringListResultIterator) Response() VirtualNetworkPeeringListResult { 12343 return iter.page.Response() 12344} 12345 12346// Value returns the current value or a zero-initialized value if the 12347// iterator has advanced beyond the end of the collection. 12348func (iter VirtualNetworkPeeringListResultIterator) Value() VirtualNetworkPeering { 12349 if !iter.page.NotDone() { 12350 return VirtualNetworkPeering{} 12351 } 12352 return iter.page.Values()[iter.i] 12353} 12354 12355// IsEmpty returns true if the ListResult contains no values. 12356func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool { 12357 return vnplr.Value == nil || len(*vnplr.Value) == 0 12358} 12359 12360// virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. 12361// It returns nil if no more results exist. 12362func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer() (*http.Request, error) { 12363 if vnplr.NextLink == nil || len(to.String(vnplr.NextLink)) < 1 { 12364 return nil, nil 12365 } 12366 return autorest.Prepare(&http.Request{}, 12367 autorest.AsJSON(), 12368 autorest.AsGet(), 12369 autorest.WithBaseURL(to.String(vnplr.NextLink))) 12370} 12371 12372// VirtualNetworkPeeringListResultPage contains a page of VirtualNetworkPeering values. 12373type VirtualNetworkPeeringListResultPage struct { 12374 fn func(VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error) 12375 vnplr VirtualNetworkPeeringListResult 12376} 12377 12378// Next advances to the next page of values. If there was an error making 12379// the request the page does not advance and the error is returned. 12380func (page *VirtualNetworkPeeringListResultPage) Next() error { 12381 next, err := page.fn(page.vnplr) 12382 if err != nil { 12383 return err 12384 } 12385 page.vnplr = next 12386 return nil 12387} 12388 12389// NotDone returns true if the page enumeration should be started or is not yet complete. 12390func (page VirtualNetworkPeeringListResultPage) NotDone() bool { 12391 return !page.vnplr.IsEmpty() 12392} 12393 12394// Response returns the raw server response from the last page request. 12395func (page VirtualNetworkPeeringListResultPage) Response() VirtualNetworkPeeringListResult { 12396 return page.vnplr 12397} 12398 12399// Values returns the slice of values for the current page or nil if there are no values. 12400func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering { 12401 if page.vnplr.IsEmpty() { 12402 return nil 12403 } 12404 return *page.vnplr.Value 12405} 12406 12407// VirtualNetworkPeeringPropertiesFormat ... 12408type VirtualNetworkPeeringPropertiesFormat struct { 12409 // AllowVirtualNetworkAccess - Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space. 12410 AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` 12411 // AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed. 12412 AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` 12413 // AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network. 12414 AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` 12415 // UseRemoteGateways - If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway. 12416 UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` 12417 // RemoteVirtualNetwork - The reference of the remote virtual network. 12418 RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` 12419 // PeeringState - The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected' 12420 PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` 12421 // ProvisioningState - The provisioning state of the resource. 12422 ProvisioningState *string `json:"provisioningState,omitempty"` 12423} 12424 12425// VirtualNetworkPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 12426// long-running operation. 12427type VirtualNetworkPeeringsCreateOrUpdateFuture struct { 12428 azure.Future 12429 req *http.Request 12430} 12431 12432// Result returns the result of the asynchronous operation. 12433// If the operation has not completed it will return an error. 12434func (future VirtualNetworkPeeringsCreateOrUpdateFuture) Result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) { 12435 var done bool 12436 done, err = future.Done(client) 12437 if err != nil { 12438 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12439 return 12440 } 12441 if !done { 12442 return vnp, azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture") 12443 } 12444 if future.PollingMethod() == azure.PollingLocation { 12445 vnp, err = client.CreateOrUpdateResponder(future.Response()) 12446 if err != nil { 12447 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 12448 } 12449 return 12450 } 12451 var req *http.Request 12452 var resp *http.Response 12453 if future.PollingURL() != "" { 12454 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 12455 if err != nil { 12456 return 12457 } 12458 } else { 12459 req = autorest.ChangeToGet(future.req) 12460 } 12461 resp, err = autorest.SendWithSender(client, req, 12462 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12463 if err != nil { 12464 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", resp, "Failure sending request") 12465 return 12466 } 12467 vnp, err = client.CreateOrUpdateResponder(resp) 12468 if err != nil { 12469 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 12470 } 12471 return 12472} 12473 12474// VirtualNetworkPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12475// operation. 12476type VirtualNetworkPeeringsDeleteFuture struct { 12477 azure.Future 12478 req *http.Request 12479} 12480 12481// Result returns the result of the asynchronous operation. 12482// If the operation has not completed it will return an error. 12483func (future VirtualNetworkPeeringsDeleteFuture) Result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) { 12484 var done bool 12485 done, err = future.Done(client) 12486 if err != nil { 12487 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure") 12488 return 12489 } 12490 if !done { 12491 return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture") 12492 } 12493 if future.PollingMethod() == azure.PollingLocation { 12494 ar, err = client.DeleteResponder(future.Response()) 12495 if err != nil { 12496 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Failure responding to request") 12497 } 12498 return 12499 } 12500 var req *http.Request 12501 var resp *http.Response 12502 if future.PollingURL() != "" { 12503 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 12504 if err != nil { 12505 return 12506 } 12507 } else { 12508 req = autorest.ChangeToGet(future.req) 12509 } 12510 resp, err = autorest.SendWithSender(client, req, 12511 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12512 if err != nil { 12513 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", resp, "Failure sending request") 12514 return 12515 } 12516 ar, err = client.DeleteResponder(resp) 12517 if err != nil { 12518 err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", resp, "Failure responding to request") 12519 } 12520 return 12521} 12522 12523// VirtualNetworkPropertiesFormat ... 12524type VirtualNetworkPropertiesFormat struct { 12525 // AddressSpace - The AddressSpace that contains an array of IP address ranges that can be used by subnets. 12526 AddressSpace *AddressSpace `json:"addressSpace,omitempty"` 12527 // DhcpOptions - The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network. 12528 DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` 12529 // Subnets - A list of subnets in a Virtual Network. 12530 Subnets *[]Subnet `json:"subnets,omitempty"` 12531 // VirtualNetworkPeerings - A list of peerings in a Virtual Network. 12532 VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` 12533 // ResourceGUID - The resourceGuid property of the Virtual Network resource. 12534 ResourceGUID *string `json:"resourceGuid,omitempty"` 12535 // ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 12536 ProvisioningState *string `json:"provisioningState,omitempty"` 12537} 12538 12539// VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 12540// operation. 12541type VirtualNetworksCreateOrUpdateFuture struct { 12542 azure.Future 12543 req *http.Request 12544} 12545 12546// Result returns the result of the asynchronous operation. 12547// If the operation has not completed it will return an error. 12548func (future VirtualNetworksCreateOrUpdateFuture) Result(client VirtualNetworksClient) (vn VirtualNetwork, err error) { 12549 var done bool 12550 done, err = future.Done(client) 12551 if err != nil { 12552 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 12553 return 12554 } 12555 if !done { 12556 return vn, azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture") 12557 } 12558 if future.PollingMethod() == azure.PollingLocation { 12559 vn, err = client.CreateOrUpdateResponder(future.Response()) 12560 if err != nil { 12561 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") 12562 } 12563 return 12564 } 12565 var req *http.Request 12566 var resp *http.Response 12567 if future.PollingURL() != "" { 12568 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 12569 if err != nil { 12570 return 12571 } 12572 } else { 12573 req = autorest.ChangeToGet(future.req) 12574 } 12575 resp, err = autorest.SendWithSender(client, req, 12576 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12577 if err != nil { 12578 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", resp, "Failure sending request") 12579 return 12580 } 12581 vn, err = client.CreateOrUpdateResponder(resp) 12582 if err != nil { 12583 err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", resp, "Failure responding to request") 12584 } 12585 return 12586} 12587 12588// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 12589// operation. 12590type VirtualNetworksDeleteFuture struct { 12591 azure.Future 12592 req *http.Request 12593} 12594 12595// Result returns the result of the asynchronous operation. 12596// If the operation has not completed it will return an error. 12597func (future VirtualNetworksDeleteFuture) Result(client VirtualNetworksClient) (ar autorest.Response, err error) { 12598 var done bool 12599 done, err = future.Done(client) 12600 if err != nil { 12601 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure") 12602 return 12603 } 12604 if !done { 12605 return ar, azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture") 12606 } 12607 if future.PollingMethod() == azure.PollingLocation { 12608 ar, err = client.DeleteResponder(future.Response()) 12609 if err != nil { 12610 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Failure responding to request") 12611 } 12612 return 12613 } 12614 var req *http.Request 12615 var resp *http.Response 12616 if future.PollingURL() != "" { 12617 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 12618 if err != nil { 12619 return 12620 } 12621 } else { 12622 req = autorest.ChangeToGet(future.req) 12623 } 12624 resp, err = autorest.SendWithSender(client, req, 12625 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12626 if err != nil { 12627 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", resp, "Failure sending request") 12628 return 12629 } 12630 ar, err = client.DeleteResponder(resp) 12631 if err != nil { 12632 err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", resp, "Failure responding to request") 12633 } 12634 return 12635} 12636 12637// VirtualNetworkUsage usage details for subnet. 12638type VirtualNetworkUsage struct { 12639 // CurrentValue - Indicates number of IPs used from the Subnet. 12640 CurrentValue *float64 `json:"currentValue,omitempty"` 12641 // ID - Subnet identifier. 12642 ID *string `json:"id,omitempty"` 12643 // Limit - Indicates the size of the subnet. 12644 Limit *float64 `json:"limit,omitempty"` 12645 // Name - The name containing common and localized value for usage. 12646 Name *VirtualNetworkUsageName `json:"name,omitempty"` 12647 // Unit - Usage units. Returns 'Count' 12648 Unit *string `json:"unit,omitempty"` 12649} 12650 12651// VirtualNetworkUsageName usage strings container. 12652type VirtualNetworkUsageName struct { 12653 // LocalizedValue - Localized subnet size and usage string. 12654 LocalizedValue *string `json:"localizedValue,omitempty"` 12655 // Value - Subnet size and usage string. 12656 Value *string `json:"value,omitempty"` 12657} 12658 12659// VpnClientConfiguration vpnClientConfiguration for P2S client. 12660type VpnClientConfiguration struct { 12661 // VpnClientAddressPool - The reference of the address space resource which represents Address space for P2S VpnClient. 12662 VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` 12663 // VpnClientRootCertificates - VpnClientRootCertificate for virtual network gateway. 12664 VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` 12665 // VpnClientRevokedCertificates - VpnClientRevokedCertificate for Virtual network gateway. 12666 VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` 12667} 12668 12669// VpnClientParameters vpn Client Parameters for package generation 12670type VpnClientParameters struct { 12671 // ProcessorArchitecture - VPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86' 12672 ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` 12673} 12674 12675// VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway. 12676type VpnClientRevokedCertificate struct { 12677 *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` 12678 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 12679 Name *string `json:"name,omitempty"` 12680 // Etag - A unique read-only string that changes whenever the resource is updated. 12681 Etag *string `json:"etag,omitempty"` 12682 // ID - Resource ID. 12683 ID *string `json:"id,omitempty"` 12684} 12685 12686// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate. 12687func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) { 12688 objectMap := make(map[string]interface{}) 12689 if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil { 12690 objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat 12691 } 12692 if vcrc.Name != nil { 12693 objectMap["name"] = vcrc.Name 12694 } 12695 if vcrc.Etag != nil { 12696 objectMap["etag"] = vcrc.Etag 12697 } 12698 if vcrc.ID != nil { 12699 objectMap["id"] = vcrc.ID 12700 } 12701 return json.Marshal(objectMap) 12702} 12703 12704// UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct. 12705func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error { 12706 var m map[string]*json.RawMessage 12707 err := json.Unmarshal(body, &m) 12708 if err != nil { 12709 return err 12710 } 12711 for k, v := range m { 12712 switch k { 12713 case "properties": 12714 if v != nil { 12715 var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat 12716 err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat) 12717 if err != nil { 12718 return err 12719 } 12720 vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat 12721 } 12722 case "name": 12723 if v != nil { 12724 var name string 12725 err = json.Unmarshal(*v, &name) 12726 if err != nil { 12727 return err 12728 } 12729 vcrc.Name = &name 12730 } 12731 case "etag": 12732 if v != nil { 12733 var etag string 12734 err = json.Unmarshal(*v, &etag) 12735 if err != nil { 12736 return err 12737 } 12738 vcrc.Etag = &etag 12739 } 12740 case "id": 12741 if v != nil { 12742 var ID string 12743 err = json.Unmarshal(*v, &ID) 12744 if err != nil { 12745 return err 12746 } 12747 vcrc.ID = &ID 12748 } 12749 } 12750 } 12751 12752 return nil 12753} 12754 12755// VpnClientRevokedCertificatePropertiesFormat properties of the revoked VPN client certificate of virtual network 12756// gateway. 12757type VpnClientRevokedCertificatePropertiesFormat struct { 12758 // Thumbprint - The revoked VPN client certificate thumbprint. 12759 Thumbprint *string `json:"thumbprint,omitempty"` 12760 // ProvisioningState - The provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 12761 ProvisioningState *string `json:"provisioningState,omitempty"` 12762} 12763 12764// VpnClientRootCertificate VPN client root certificate of virtual network gateway 12765type VpnClientRootCertificate struct { 12766 *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` 12767 // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. 12768 Name *string `json:"name,omitempty"` 12769 // Etag - A unique read-only string that changes whenever the resource is updated. 12770 Etag *string `json:"etag,omitempty"` 12771 // ID - Resource ID. 12772 ID *string `json:"id,omitempty"` 12773} 12774 12775// MarshalJSON is the custom marshaler for VpnClientRootCertificate. 12776func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) { 12777 objectMap := make(map[string]interface{}) 12778 if vcrc.VpnClientRootCertificatePropertiesFormat != nil { 12779 objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat 12780 } 12781 if vcrc.Name != nil { 12782 objectMap["name"] = vcrc.Name 12783 } 12784 if vcrc.Etag != nil { 12785 objectMap["etag"] = vcrc.Etag 12786 } 12787 if vcrc.ID != nil { 12788 objectMap["id"] = vcrc.ID 12789 } 12790 return json.Marshal(objectMap) 12791} 12792 12793// UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct. 12794func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error { 12795 var m map[string]*json.RawMessage 12796 err := json.Unmarshal(body, &m) 12797 if err != nil { 12798 return err 12799 } 12800 for k, v := range m { 12801 switch k { 12802 case "properties": 12803 if v != nil { 12804 var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat 12805 err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat) 12806 if err != nil { 12807 return err 12808 } 12809 vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat 12810 } 12811 case "name": 12812 if v != nil { 12813 var name string 12814 err = json.Unmarshal(*v, &name) 12815 if err != nil { 12816 return err 12817 } 12818 vcrc.Name = &name 12819 } 12820 case "etag": 12821 if v != nil { 12822 var etag string 12823 err = json.Unmarshal(*v, &etag) 12824 if err != nil { 12825 return err 12826 } 12827 vcrc.Etag = &etag 12828 } 12829 case "id": 12830 if v != nil { 12831 var ID string 12832 err = json.Unmarshal(*v, &ID) 12833 if err != nil { 12834 return err 12835 } 12836 vcrc.ID = &ID 12837 } 12838 } 12839 } 12840 12841 return nil 12842} 12843 12844// VpnClientRootCertificatePropertiesFormat properties of SSL certificates of application gateway 12845type VpnClientRootCertificatePropertiesFormat struct { 12846 // PublicCertData - The certificate public data. 12847 PublicCertData *string `json:"publicCertData,omitempty"` 12848 // ProvisioningState - The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. 12849 ProvisioningState *string `json:"provisioningState,omitempty"` 12850} 12851 12852// Watcher network watcher in a resource group. 12853type Watcher struct { 12854 autorest.Response `json:"-"` 12855 // Etag - A unique read-only string that changes whenever the resource is updated. 12856 Etag *string `json:"etag,omitempty"` 12857 *WatcherPropertiesFormat `json:"properties,omitempty"` 12858 // ID - Resource ID. 12859 ID *string `json:"id,omitempty"` 12860 // Name - Resource name. 12861 Name *string `json:"name,omitempty"` 12862 // Type - Resource type. 12863 Type *string `json:"type,omitempty"` 12864 // Location - Resource location. 12865 Location *string `json:"location,omitempty"` 12866 // Tags - Resource tags. 12867 Tags map[string]*string `json:"tags"` 12868} 12869 12870// MarshalJSON is the custom marshaler for Watcher. 12871func (w Watcher) MarshalJSON() ([]byte, error) { 12872 objectMap := make(map[string]interface{}) 12873 if w.Etag != nil { 12874 objectMap["etag"] = w.Etag 12875 } 12876 if w.WatcherPropertiesFormat != nil { 12877 objectMap["properties"] = w.WatcherPropertiesFormat 12878 } 12879 if w.ID != nil { 12880 objectMap["id"] = w.ID 12881 } 12882 if w.Name != nil { 12883 objectMap["name"] = w.Name 12884 } 12885 if w.Type != nil { 12886 objectMap["type"] = w.Type 12887 } 12888 if w.Location != nil { 12889 objectMap["location"] = w.Location 12890 } 12891 if w.Tags != nil { 12892 objectMap["tags"] = w.Tags 12893 } 12894 return json.Marshal(objectMap) 12895} 12896 12897// UnmarshalJSON is the custom unmarshaler for Watcher struct. 12898func (w *Watcher) UnmarshalJSON(body []byte) error { 12899 var m map[string]*json.RawMessage 12900 err := json.Unmarshal(body, &m) 12901 if err != nil { 12902 return err 12903 } 12904 for k, v := range m { 12905 switch k { 12906 case "etag": 12907 if v != nil { 12908 var etag string 12909 err = json.Unmarshal(*v, &etag) 12910 if err != nil { 12911 return err 12912 } 12913 w.Etag = &etag 12914 } 12915 case "properties": 12916 if v != nil { 12917 var watcherPropertiesFormat WatcherPropertiesFormat 12918 err = json.Unmarshal(*v, &watcherPropertiesFormat) 12919 if err != nil { 12920 return err 12921 } 12922 w.WatcherPropertiesFormat = &watcherPropertiesFormat 12923 } 12924 case "id": 12925 if v != nil { 12926 var ID string 12927 err = json.Unmarshal(*v, &ID) 12928 if err != nil { 12929 return err 12930 } 12931 w.ID = &ID 12932 } 12933 case "name": 12934 if v != nil { 12935 var name string 12936 err = json.Unmarshal(*v, &name) 12937 if err != nil { 12938 return err 12939 } 12940 w.Name = &name 12941 } 12942 case "type": 12943 if v != nil { 12944 var typeVar string 12945 err = json.Unmarshal(*v, &typeVar) 12946 if err != nil { 12947 return err 12948 } 12949 w.Type = &typeVar 12950 } 12951 case "location": 12952 if v != nil { 12953 var location string 12954 err = json.Unmarshal(*v, &location) 12955 if err != nil { 12956 return err 12957 } 12958 w.Location = &location 12959 } 12960 case "tags": 12961 if v != nil { 12962 var tags map[string]*string 12963 err = json.Unmarshal(*v, &tags) 12964 if err != nil { 12965 return err 12966 } 12967 w.Tags = tags 12968 } 12969 } 12970 } 12971 12972 return nil 12973} 12974 12975// WatcherListResult list of network watcher resources. 12976type WatcherListResult struct { 12977 autorest.Response `json:"-"` 12978 Value *[]Watcher `json:"value,omitempty"` 12979} 12980 12981// WatcherPropertiesFormat the network watcher properties. 12982type WatcherPropertiesFormat struct { 12983 // ProvisioningState - The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' 12984 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 12985} 12986 12987// WatchersCheckConnectivityFuture an abstraction for monitoring and retrieving the results of a long-running 12988// operation. 12989type WatchersCheckConnectivityFuture struct { 12990 azure.Future 12991 req *http.Request 12992} 12993 12994// Result returns the result of the asynchronous operation. 12995// If the operation has not completed it will return an error. 12996func (future WatchersCheckConnectivityFuture) Result(client WatchersClient) (ci ConnectivityInformation, err error) { 12997 var done bool 12998 done, err = future.Done(client) 12999 if err != nil { 13000 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Polling failure") 13001 return 13002 } 13003 if !done { 13004 return ci, azure.NewAsyncOpIncompleteError("network.WatchersCheckConnectivityFuture") 13005 } 13006 if future.PollingMethod() == azure.PollingLocation { 13007 ci, err = client.CheckConnectivityResponder(future.Response()) 13008 if err != nil { 13009 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", future.Response(), "Failure responding to request") 13010 } 13011 return 13012 } 13013 var req *http.Request 13014 var resp *http.Response 13015 if future.PollingURL() != "" { 13016 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13017 if err != nil { 13018 return 13019 } 13020 } else { 13021 req = autorest.ChangeToGet(future.req) 13022 } 13023 resp, err = autorest.SendWithSender(client, req, 13024 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13025 if err != nil { 13026 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", resp, "Failure sending request") 13027 return 13028 } 13029 ci, err = client.CheckConnectivityResponder(resp) 13030 if err != nil { 13031 err = autorest.NewErrorWithError(err, "network.WatchersCheckConnectivityFuture", "Result", resp, "Failure responding to request") 13032 } 13033 return 13034} 13035 13036// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 13037type WatchersDeleteFuture struct { 13038 azure.Future 13039 req *http.Request 13040} 13041 13042// Result returns the result of the asynchronous operation. 13043// If the operation has not completed it will return an error. 13044func (future WatchersDeleteFuture) Result(client WatchersClient) (ar autorest.Response, err error) { 13045 var done bool 13046 done, err = future.Done(client) 13047 if err != nil { 13048 err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure") 13049 return 13050 } 13051 if !done { 13052 return ar, azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture") 13053 } 13054 if future.PollingMethod() == azure.PollingLocation { 13055 ar, err = client.DeleteResponder(future.Response()) 13056 if err != nil { 13057 err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Failure responding to request") 13058 } 13059 return 13060 } 13061 var req *http.Request 13062 var resp *http.Response 13063 if future.PollingURL() != "" { 13064 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13065 if err != nil { 13066 return 13067 } 13068 } else { 13069 req = autorest.ChangeToGet(future.req) 13070 } 13071 resp, err = autorest.SendWithSender(client, req, 13072 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13073 if err != nil { 13074 err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", resp, "Failure sending request") 13075 return 13076 } 13077 ar, err = client.DeleteResponder(resp) 13078 if err != nil { 13079 err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", resp, "Failure responding to request") 13080 } 13081 return 13082} 13083 13084// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a long-running 13085// operation. 13086type WatchersGetFlowLogStatusFuture struct { 13087 azure.Future 13088 req *http.Request 13089} 13090 13091// Result returns the result of the asynchronous operation. 13092// If the operation has not completed it will return an error. 13093func (future WatchersGetFlowLogStatusFuture) Result(client WatchersClient) (fli FlowLogInformation, err error) { 13094 var done bool 13095 done, err = future.Done(client) 13096 if err != nil { 13097 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure") 13098 return 13099 } 13100 if !done { 13101 return fli, azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture") 13102 } 13103 if future.PollingMethod() == azure.PollingLocation { 13104 fli, err = client.GetFlowLogStatusResponder(future.Response()) 13105 if err != nil { 13106 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Failure responding to request") 13107 } 13108 return 13109 } 13110 var req *http.Request 13111 var resp *http.Response 13112 if future.PollingURL() != "" { 13113 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13114 if err != nil { 13115 return 13116 } 13117 } else { 13118 req = autorest.ChangeToGet(future.req) 13119 } 13120 resp, err = autorest.SendWithSender(client, req, 13121 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13122 if err != nil { 13123 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", resp, "Failure sending request") 13124 return 13125 } 13126 fli, err = client.GetFlowLogStatusResponder(resp) 13127 if err != nil { 13128 err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", resp, "Failure responding to request") 13129 } 13130 return 13131} 13132 13133// WatchersGetNextHopFuture an abstraction for monitoring and retrieving the results of a long-running operation. 13134type WatchersGetNextHopFuture struct { 13135 azure.Future 13136 req *http.Request 13137} 13138 13139// Result returns the result of the asynchronous operation. 13140// If the operation has not completed it will return an error. 13141func (future WatchersGetNextHopFuture) Result(client WatchersClient) (nhr NextHopResult, err error) { 13142 var done bool 13143 done, err = future.Done(client) 13144 if err != nil { 13145 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure") 13146 return 13147 } 13148 if !done { 13149 return nhr, azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture") 13150 } 13151 if future.PollingMethod() == azure.PollingLocation { 13152 nhr, err = client.GetNextHopResponder(future.Response()) 13153 if err != nil { 13154 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Failure responding to request") 13155 } 13156 return 13157 } 13158 var req *http.Request 13159 var resp *http.Response 13160 if future.PollingURL() != "" { 13161 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13162 if err != nil { 13163 return 13164 } 13165 } else { 13166 req = autorest.ChangeToGet(future.req) 13167 } 13168 resp, err = autorest.SendWithSender(client, req, 13169 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13170 if err != nil { 13171 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", resp, "Failure sending request") 13172 return 13173 } 13174 nhr, err = client.GetNextHopResponder(resp) 13175 if err != nil { 13176 err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", resp, "Failure responding to request") 13177 } 13178 return 13179} 13180 13181// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a long-running 13182// operation. 13183type WatchersGetTroubleshootingFuture struct { 13184 azure.Future 13185 req *http.Request 13186} 13187 13188// Result returns the result of the asynchronous operation. 13189// If the operation has not completed it will return an error. 13190func (future WatchersGetTroubleshootingFuture) Result(client WatchersClient) (tr TroubleshootingResult, err error) { 13191 var done bool 13192 done, err = future.Done(client) 13193 if err != nil { 13194 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure") 13195 return 13196 } 13197 if !done { 13198 return tr, azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture") 13199 } 13200 if future.PollingMethod() == azure.PollingLocation { 13201 tr, err = client.GetTroubleshootingResponder(future.Response()) 13202 if err != nil { 13203 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Failure responding to request") 13204 } 13205 return 13206 } 13207 var req *http.Request 13208 var resp *http.Response 13209 if future.PollingURL() != "" { 13210 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13211 if err != nil { 13212 return 13213 } 13214 } else { 13215 req = autorest.ChangeToGet(future.req) 13216 } 13217 resp, err = autorest.SendWithSender(client, req, 13218 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13219 if err != nil { 13220 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", resp, "Failure sending request") 13221 return 13222 } 13223 tr, err = client.GetTroubleshootingResponder(resp) 13224 if err != nil { 13225 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", resp, "Failure responding to request") 13226 } 13227 return 13228} 13229 13230// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a 13231// long-running operation. 13232type WatchersGetTroubleshootingResultFuture struct { 13233 azure.Future 13234 req *http.Request 13235} 13236 13237// Result returns the result of the asynchronous operation. 13238// If the operation has not completed it will return an error. 13239func (future WatchersGetTroubleshootingResultFuture) Result(client WatchersClient) (tr TroubleshootingResult, err error) { 13240 var done bool 13241 done, err = future.Done(client) 13242 if err != nil { 13243 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure") 13244 return 13245 } 13246 if !done { 13247 return tr, azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture") 13248 } 13249 if future.PollingMethod() == azure.PollingLocation { 13250 tr, err = client.GetTroubleshootingResultResponder(future.Response()) 13251 if err != nil { 13252 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Failure responding to request") 13253 } 13254 return 13255 } 13256 var req *http.Request 13257 var resp *http.Response 13258 if future.PollingURL() != "" { 13259 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13260 if err != nil { 13261 return 13262 } 13263 } else { 13264 req = autorest.ChangeToGet(future.req) 13265 } 13266 resp, err = autorest.SendWithSender(client, req, 13267 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13268 if err != nil { 13269 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", resp, "Failure sending request") 13270 return 13271 } 13272 tr, err = client.GetTroubleshootingResultResponder(resp) 13273 if err != nil { 13274 err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", resp, "Failure responding to request") 13275 } 13276 return 13277} 13278 13279// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a long-running 13280// operation. 13281type WatchersGetVMSecurityRulesFuture struct { 13282 azure.Future 13283 req *http.Request 13284} 13285 13286// Result returns the result of the asynchronous operation. 13287// If the operation has not completed it will return an error. 13288func (future WatchersGetVMSecurityRulesFuture) Result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) { 13289 var done bool 13290 done, err = future.Done(client) 13291 if err != nil { 13292 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure") 13293 return 13294 } 13295 if !done { 13296 return sgvr, azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture") 13297 } 13298 if future.PollingMethod() == azure.PollingLocation { 13299 sgvr, err = client.GetVMSecurityRulesResponder(future.Response()) 13300 if err != nil { 13301 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Failure responding to request") 13302 } 13303 return 13304 } 13305 var req *http.Request 13306 var resp *http.Response 13307 if future.PollingURL() != "" { 13308 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13309 if err != nil { 13310 return 13311 } 13312 } else { 13313 req = autorest.ChangeToGet(future.req) 13314 } 13315 resp, err = autorest.SendWithSender(client, req, 13316 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13317 if err != nil { 13318 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", resp, "Failure sending request") 13319 return 13320 } 13321 sgvr, err = client.GetVMSecurityRulesResponder(resp) 13322 if err != nil { 13323 err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", resp, "Failure responding to request") 13324 } 13325 return 13326} 13327 13328// WatchersSetFlowLogConfigurationFuture an abstraction for monitoring and retrieving the results of a long-running 13329// operation. 13330type WatchersSetFlowLogConfigurationFuture struct { 13331 azure.Future 13332 req *http.Request 13333} 13334 13335// Result returns the result of the asynchronous operation. 13336// If the operation has not completed it will return an error. 13337func (future WatchersSetFlowLogConfigurationFuture) Result(client WatchersClient) (fli FlowLogInformation, err error) { 13338 var done bool 13339 done, err = future.Done(client) 13340 if err != nil { 13341 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure") 13342 return 13343 } 13344 if !done { 13345 return fli, azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture") 13346 } 13347 if future.PollingMethod() == azure.PollingLocation { 13348 fli, err = client.SetFlowLogConfigurationResponder(future.Response()) 13349 if err != nil { 13350 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Failure responding to request") 13351 } 13352 return 13353 } 13354 var req *http.Request 13355 var resp *http.Response 13356 if future.PollingURL() != "" { 13357 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13358 if err != nil { 13359 return 13360 } 13361 } else { 13362 req = autorest.ChangeToGet(future.req) 13363 } 13364 resp, err = autorest.SendWithSender(client, req, 13365 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13366 if err != nil { 13367 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", resp, "Failure sending request") 13368 return 13369 } 13370 fli, err = client.SetFlowLogConfigurationResponder(resp) 13371 if err != nil { 13372 err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", resp, "Failure responding to request") 13373 } 13374 return 13375} 13376 13377// WatchersVerifyIPFlowFuture an abstraction for monitoring and retrieving the results of a long-running operation. 13378type WatchersVerifyIPFlowFuture struct { 13379 azure.Future 13380 req *http.Request 13381} 13382 13383// Result returns the result of the asynchronous operation. 13384// If the operation has not completed it will return an error. 13385func (future WatchersVerifyIPFlowFuture) Result(client WatchersClient) (vifr VerificationIPFlowResult, err error) { 13386 var done bool 13387 done, err = future.Done(client) 13388 if err != nil { 13389 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure") 13390 return 13391 } 13392 if !done { 13393 return vifr, azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture") 13394 } 13395 if future.PollingMethod() == azure.PollingLocation { 13396 vifr, err = client.VerifyIPFlowResponder(future.Response()) 13397 if err != nil { 13398 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Failure responding to request") 13399 } 13400 return 13401 } 13402 var req *http.Request 13403 var resp *http.Response 13404 if future.PollingURL() != "" { 13405 req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil) 13406 if err != nil { 13407 return 13408 } 13409 } else { 13410 req = autorest.ChangeToGet(future.req) 13411 } 13412 resp, err = autorest.SendWithSender(client, req, 13413 autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13414 if err != nil { 13415 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", resp, "Failure sending request") 13416 return 13417 } 13418 vifr, err = client.VerifyIPFlowResponder(resp) 13419 if err != nil { 13420 err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", resp, "Failure responding to request") 13421 } 13422 return 13423} 13424