1package network
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"net/http"
18)
19
20// The package's fully qualified name.
21const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2016-12-01/network"
22
23// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the
24// virtual network.
25type AddressSpace struct {
26	// AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation.
27	AddressPrefixes *[]string `json:"addressPrefixes,omitempty"`
28}
29
30// ApplicationGateway application gateway resource
31type ApplicationGateway struct {
32	autorest.Response                   `json:"-"`
33	*ApplicationGatewayPropertiesFormat `json:"properties,omitempty"`
34	// Etag - A unique read-only string that changes whenever the resource is updated.
35	Etag *string `json:"etag,omitempty"`
36	// ID - Resource ID.
37	ID *string `json:"id,omitempty"`
38	// Name - READ-ONLY; Resource name.
39	Name *string `json:"name,omitempty"`
40	// Type - READ-ONLY; Resource type.
41	Type *string `json:"type,omitempty"`
42	// Location - Resource location.
43	Location *string `json:"location,omitempty"`
44	// Tags - Resource tags.
45	Tags map[string]*string `json:"tags"`
46}
47
48// MarshalJSON is the custom marshaler for ApplicationGateway.
49func (ag ApplicationGateway) MarshalJSON() ([]byte, error) {
50	objectMap := make(map[string]interface{})
51	if ag.ApplicationGatewayPropertiesFormat != nil {
52		objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat
53	}
54	if ag.Etag != nil {
55		objectMap["etag"] = ag.Etag
56	}
57	if ag.ID != nil {
58		objectMap["id"] = ag.ID
59	}
60	if ag.Location != nil {
61		objectMap["location"] = ag.Location
62	}
63	if ag.Tags != nil {
64		objectMap["tags"] = ag.Tags
65	}
66	return json.Marshal(objectMap)
67}
68
69// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct.
70func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error {
71	var m map[string]*json.RawMessage
72	err := json.Unmarshal(body, &m)
73	if err != nil {
74		return err
75	}
76	for k, v := range m {
77		switch k {
78		case "properties":
79			if v != nil {
80				var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat
81				err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat)
82				if err != nil {
83					return err
84				}
85				ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat
86			}
87		case "etag":
88			if v != nil {
89				var etag string
90				err = json.Unmarshal(*v, &etag)
91				if err != nil {
92					return err
93				}
94				ag.Etag = &etag
95			}
96		case "id":
97			if v != nil {
98				var ID string
99				err = json.Unmarshal(*v, &ID)
100				if err != nil {
101					return err
102				}
103				ag.ID = &ID
104			}
105		case "name":
106			if v != nil {
107				var name string
108				err = json.Unmarshal(*v, &name)
109				if err != nil {
110					return err
111				}
112				ag.Name = &name
113			}
114		case "type":
115			if v != nil {
116				var typeVar string
117				err = json.Unmarshal(*v, &typeVar)
118				if err != nil {
119					return err
120				}
121				ag.Type = &typeVar
122			}
123		case "location":
124			if v != nil {
125				var location string
126				err = json.Unmarshal(*v, &location)
127				if err != nil {
128					return err
129				}
130				ag.Location = &location
131			}
132		case "tags":
133			if v != nil {
134				var tags map[string]*string
135				err = json.Unmarshal(*v, &tags)
136				if err != nil {
137					return err
138				}
139				ag.Tags = tags
140			}
141		}
142	}
143
144	return nil
145}
146
147// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway.
148type ApplicationGatewayAuthenticationCertificate struct {
149	*ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"`
150	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
151	Name *string `json:"name,omitempty"`
152	// Etag - A unique read-only string that changes whenever the resource is updated.
153	Etag *string `json:"etag,omitempty"`
154	// ID - Resource ID.
155	ID *string `json:"id,omitempty"`
156}
157
158// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate.
159func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) {
160	objectMap := make(map[string]interface{})
161	if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil {
162		objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat
163	}
164	if agac.Name != nil {
165		objectMap["name"] = agac.Name
166	}
167	if agac.Etag != nil {
168		objectMap["etag"] = agac.Etag
169	}
170	if agac.ID != nil {
171		objectMap["id"] = agac.ID
172	}
173	return json.Marshal(objectMap)
174}
175
176// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct.
177func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error {
178	var m map[string]*json.RawMessage
179	err := json.Unmarshal(body, &m)
180	if err != nil {
181		return err
182	}
183	for k, v := range m {
184		switch k {
185		case "properties":
186			if v != nil {
187				var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat
188				err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat)
189				if err != nil {
190					return err
191				}
192				agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat
193			}
194		case "name":
195			if v != nil {
196				var name string
197				err = json.Unmarshal(*v, &name)
198				if err != nil {
199					return err
200				}
201				agac.Name = &name
202			}
203		case "etag":
204			if v != nil {
205				var etag string
206				err = json.Unmarshal(*v, &etag)
207				if err != nil {
208					return err
209				}
210				agac.Etag = &etag
211			}
212		case "id":
213			if v != nil {
214				var ID string
215				err = json.Unmarshal(*v, &ID)
216				if err != nil {
217					return err
218				}
219				agac.ID = &ID
220			}
221		}
222	}
223
224	return nil
225}
226
227// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an
228// application gateway.
229type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct {
230	// Data - Certificate public data.
231	Data *string `json:"data,omitempty"`
232	// ProvisioningState - Provisioning state of the authentication certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
233	ProvisioningState *string `json:"provisioningState,omitempty"`
234}
235
236// ApplicationGatewayBackendAddress backend address of an application gateway.
237type ApplicationGatewayBackendAddress struct {
238	// Fqdn - Fully qualified domain name (FQDN).
239	Fqdn *string `json:"fqdn,omitempty"`
240	// IPAddress - IP address
241	IPAddress *string `json:"ipAddress,omitempty"`
242}
243
244// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway.
245type ApplicationGatewayBackendAddressPool struct {
246	*ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"`
247	// Name - Resource that is unique within a resource group. This name can be used to access the resource.
248	Name *string `json:"name,omitempty"`
249	// Etag - A unique read-only string that changes whenever the resource is updated.
250	Etag *string `json:"etag,omitempty"`
251	// ID - Resource ID.
252	ID *string `json:"id,omitempty"`
253}
254
255// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool.
256func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) {
257	objectMap := make(map[string]interface{})
258	if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil {
259		objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat
260	}
261	if agbap.Name != nil {
262		objectMap["name"] = agbap.Name
263	}
264	if agbap.Etag != nil {
265		objectMap["etag"] = agbap.Etag
266	}
267	if agbap.ID != nil {
268		objectMap["id"] = agbap.ID
269	}
270	return json.Marshal(objectMap)
271}
272
273// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct.
274func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error {
275	var m map[string]*json.RawMessage
276	err := json.Unmarshal(body, &m)
277	if err != nil {
278		return err
279	}
280	for k, v := range m {
281		switch k {
282		case "properties":
283			if v != nil {
284				var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat
285				err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat)
286				if err != nil {
287					return err
288				}
289				agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat
290			}
291		case "name":
292			if v != nil {
293				var name string
294				err = json.Unmarshal(*v, &name)
295				if err != nil {
296					return err
297				}
298				agbap.Name = &name
299			}
300		case "etag":
301			if v != nil {
302				var etag string
303				err = json.Unmarshal(*v, &etag)
304				if err != nil {
305					return err
306				}
307				agbap.Etag = &etag
308			}
309		case "id":
310			if v != nil {
311				var ID string
312				err = json.Unmarshal(*v, &ID)
313				if err != nil {
314					return err
315				}
316				agbap.ID = &ID
317			}
318		}
319	}
320
321	return nil
322}
323
324// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an
325// application gateway.
326type ApplicationGatewayBackendAddressPoolPropertiesFormat struct {
327	// BackendIPConfigurations - Collection of references to IPs defined in network interfaces.
328	BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
329	// BackendAddresses - Backend addresses
330	BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"`
331	// ProvisioningState - Provisioning state of the backend address pool resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
332	ProvisioningState *string `json:"provisioningState,omitempty"`
333}
334
335// ApplicationGatewayBackendHealth list of ApplicationGatewayBackendHealthPool resources.
336type ApplicationGatewayBackendHealth struct {
337	autorest.Response   `json:"-"`
338	BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"`
339}
340
341// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings.
342type ApplicationGatewayBackendHealthHTTPSettings struct {
343	// BackendHTTPSettings - Reference of an ApplicationGatewayBackendHttpSettings resource.
344	BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"`
345	// Servers - List of ApplicationGatewayBackendHealthServer resources.
346	Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"`
347}
348
349// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool.
350type ApplicationGatewayBackendHealthPool struct {
351	// BackendAddressPool - Reference of an ApplicationGatewayBackendAddressPool resource.
352	BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"`
353	// BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources.
354	BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"`
355}
356
357// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings.
358type ApplicationGatewayBackendHealthServer struct {
359	// Address - IP address or FQDN of backend server.
360	Address *string `json:"address,omitempty"`
361	// IPConfiguration - Reference of IP configuration of backend server.
362	IPConfiguration *SubResource `json:"ipConfiguration,omitempty"`
363	// Health - Health of backend server. Possible values are: 'Unknown', 'Up', 'Down', and 'Partial'. Possible values include: 'Unknown', 'Up', 'Down', 'Partial'
364	Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"`
365}
366
367// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway.
368type ApplicationGatewayBackendHTTPSettings struct {
369	*ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"`
370	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
371	Name *string `json:"name,omitempty"`
372	// Etag - A unique read-only string that changes whenever the resource is updated.
373	Etag *string `json:"etag,omitempty"`
374	// ID - Resource ID.
375	ID *string `json:"id,omitempty"`
376}
377
378// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings.
379func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) {
380	objectMap := make(map[string]interface{})
381	if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil {
382		objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat
383	}
384	if agbhs.Name != nil {
385		objectMap["name"] = agbhs.Name
386	}
387	if agbhs.Etag != nil {
388		objectMap["etag"] = agbhs.Etag
389	}
390	if agbhs.ID != nil {
391		objectMap["id"] = agbhs.ID
392	}
393	return json.Marshal(objectMap)
394}
395
396// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct.
397func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error {
398	var m map[string]*json.RawMessage
399	err := json.Unmarshal(body, &m)
400	if err != nil {
401		return err
402	}
403	for k, v := range m {
404		switch k {
405		case "properties":
406			if v != nil {
407				var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat
408				err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat)
409				if err != nil {
410					return err
411				}
412				agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat
413			}
414		case "name":
415			if v != nil {
416				var name string
417				err = json.Unmarshal(*v, &name)
418				if err != nil {
419					return err
420				}
421				agbhs.Name = &name
422			}
423		case "etag":
424			if v != nil {
425				var etag string
426				err = json.Unmarshal(*v, &etag)
427				if err != nil {
428					return err
429				}
430				agbhs.Etag = &etag
431			}
432		case "id":
433			if v != nil {
434				var ID string
435				err = json.Unmarshal(*v, &ID)
436				if err != nil {
437					return err
438				}
439				agbhs.ID = &ID
440			}
441		}
442	}
443
444	return nil
445}
446
447// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an
448// application gateway.
449type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct {
450	// Port - Port
451	Port *int32 `json:"port,omitempty"`
452	// Protocol - Protocol. Possible values are: 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS'
453	Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
454	// CookieBasedAffinity - Cookie based affinity. Possible values are: 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled'
455	CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"`
456	// 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.
457	RequestTimeout *int32 `json:"requestTimeout,omitempty"`
458	// Probe - Probe resource of an application gateway.
459	Probe *SubResource `json:"probe,omitempty"`
460	// AuthenticationCertificates - Array of references to application gateway authentication certificates.
461	AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"`
462	// ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
463	ProvisioningState *string `json:"provisioningState,omitempty"`
464	// ConnectionDraining - Connection draining of the backend http settings resource.
465	ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"`
466}
467
468// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to
469// be active for a specified time after the backend server got removed from the configuration.
470type ApplicationGatewayConnectionDraining struct {
471	// Enabled - Whether connection draining is enabled or not.
472	Enabled *bool `json:"enabled,omitempty"`
473	// DrainTimeoutInSec - The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds.
474	DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"`
475}
476
477// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway.
478type ApplicationGatewayFrontendIPConfiguration struct {
479	*ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"`
480	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
481	Name *string `json:"name,omitempty"`
482	// Etag - A unique read-only string that changes whenever the resource is updated.
483	Etag *string `json:"etag,omitempty"`
484	// ID - Resource ID.
485	ID *string `json:"id,omitempty"`
486}
487
488// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration.
489func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) {
490	objectMap := make(map[string]interface{})
491	if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil {
492		objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat
493	}
494	if agfic.Name != nil {
495		objectMap["name"] = agfic.Name
496	}
497	if agfic.Etag != nil {
498		objectMap["etag"] = agfic.Etag
499	}
500	if agfic.ID != nil {
501		objectMap["id"] = agfic.ID
502	}
503	return json.Marshal(objectMap)
504}
505
506// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct.
507func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error {
508	var m map[string]*json.RawMessage
509	err := json.Unmarshal(body, &m)
510	if err != nil {
511		return err
512	}
513	for k, v := range m {
514		switch k {
515		case "properties":
516			if v != nil {
517				var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat
518				err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat)
519				if err != nil {
520					return err
521				}
522				agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat
523			}
524		case "name":
525			if v != nil {
526				var name string
527				err = json.Unmarshal(*v, &name)
528				if err != nil {
529					return err
530				}
531				agfic.Name = &name
532			}
533		case "etag":
534			if v != nil {
535				var etag string
536				err = json.Unmarshal(*v, &etag)
537				if err != nil {
538					return err
539				}
540				agfic.Etag = &etag
541			}
542		case "id":
543			if v != nil {
544				var ID string
545				err = json.Unmarshal(*v, &ID)
546				if err != nil {
547					return err
548				}
549				agfic.ID = &ID
550			}
551		}
552	}
553
554	return nil
555}
556
557// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an
558// application gateway.
559type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct {
560	// PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration.
561	PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
562	// PrivateIPAllocationMethod - PrivateIP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'
563	PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
564	// Subnet - Reference of the subnet resource.
565	Subnet *SubResource `json:"subnet,omitempty"`
566	// PublicIPAddress - Reference of the PublicIP resource.
567	PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
568	// ProvisioningState - Provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
569	ProvisioningState *string `json:"provisioningState,omitempty"`
570}
571
572// ApplicationGatewayFrontendPort frontend port of an application gateway.
573type ApplicationGatewayFrontendPort struct {
574	*ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"`
575	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
576	Name *string `json:"name,omitempty"`
577	// Etag - A unique read-only string that changes whenever the resource is updated.
578	Etag *string `json:"etag,omitempty"`
579	// ID - Resource ID.
580	ID *string `json:"id,omitempty"`
581}
582
583// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort.
584func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) {
585	objectMap := make(map[string]interface{})
586	if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil {
587		objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat
588	}
589	if agfp.Name != nil {
590		objectMap["name"] = agfp.Name
591	}
592	if agfp.Etag != nil {
593		objectMap["etag"] = agfp.Etag
594	}
595	if agfp.ID != nil {
596		objectMap["id"] = agfp.ID
597	}
598	return json.Marshal(objectMap)
599}
600
601// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct.
602func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error {
603	var m map[string]*json.RawMessage
604	err := json.Unmarshal(body, &m)
605	if err != nil {
606		return err
607	}
608	for k, v := range m {
609		switch k {
610		case "properties":
611			if v != nil {
612				var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat
613				err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat)
614				if err != nil {
615					return err
616				}
617				agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat
618			}
619		case "name":
620			if v != nil {
621				var name string
622				err = json.Unmarshal(*v, &name)
623				if err != nil {
624					return err
625				}
626				agfp.Name = &name
627			}
628		case "etag":
629			if v != nil {
630				var etag string
631				err = json.Unmarshal(*v, &etag)
632				if err != nil {
633					return err
634				}
635				agfp.Etag = &etag
636			}
637		case "id":
638			if v != nil {
639				var ID string
640				err = json.Unmarshal(*v, &ID)
641				if err != nil {
642					return err
643				}
644				agfp.ID = &ID
645			}
646		}
647	}
648
649	return nil
650}
651
652// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway.
653type ApplicationGatewayFrontendPortPropertiesFormat struct {
654	// Port - Frontend port
655	Port *int32 `json:"port,omitempty"`
656	// ProvisioningState - Provisioning state of the frontend port resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
657	ProvisioningState *string `json:"provisioningState,omitempty"`
658}
659
660// ApplicationGatewayHTTPListener http listener of an application gateway.
661type ApplicationGatewayHTTPListener struct {
662	*ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"`
663	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
664	Name *string `json:"name,omitempty"`
665	// Etag - A unique read-only string that changes whenever the resource is updated.
666	Etag *string `json:"etag,omitempty"`
667	// ID - Resource ID.
668	ID *string `json:"id,omitempty"`
669}
670
671// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener.
672func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) {
673	objectMap := make(map[string]interface{})
674	if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil {
675		objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat
676	}
677	if aghl.Name != nil {
678		objectMap["name"] = aghl.Name
679	}
680	if aghl.Etag != nil {
681		objectMap["etag"] = aghl.Etag
682	}
683	if aghl.ID != nil {
684		objectMap["id"] = aghl.ID
685	}
686	return json.Marshal(objectMap)
687}
688
689// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct.
690func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error {
691	var m map[string]*json.RawMessage
692	err := json.Unmarshal(body, &m)
693	if err != nil {
694		return err
695	}
696	for k, v := range m {
697		switch k {
698		case "properties":
699			if v != nil {
700				var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat
701				err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat)
702				if err != nil {
703					return err
704				}
705				aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat
706			}
707		case "name":
708			if v != nil {
709				var name string
710				err = json.Unmarshal(*v, &name)
711				if err != nil {
712					return err
713				}
714				aghl.Name = &name
715			}
716		case "etag":
717			if v != nil {
718				var etag string
719				err = json.Unmarshal(*v, &etag)
720				if err != nil {
721					return err
722				}
723				aghl.Etag = &etag
724			}
725		case "id":
726			if v != nil {
727				var ID string
728				err = json.Unmarshal(*v, &ID)
729				if err != nil {
730					return err
731				}
732				aghl.ID = &ID
733			}
734		}
735	}
736
737	return nil
738}
739
740// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway.
741type ApplicationGatewayHTTPListenerPropertiesFormat struct {
742	// FrontendIPConfiguration - Frontend IP configuration resource of an application gateway.
743	FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
744	// FrontendPort - Frontend port resource of an application gateway.
745	FrontendPort *SubResource `json:"frontendPort,omitempty"`
746	// Protocol - Protocol. Possible values are: 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS'
747	Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
748	// HostName - Host name of HTTP listener.
749	HostName *string `json:"hostName,omitempty"`
750	// SslCertificate - SSL certificate resource of an application gateway.
751	SslCertificate *SubResource `json:"sslCertificate,omitempty"`
752	// RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting.
753	RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"`
754	// ProvisioningState - Provisioning state of the HTTP listener resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
755	ProvisioningState *string `json:"provisioningState,omitempty"`
756}
757
758// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1
759// private IP configuration is allowed.
760type ApplicationGatewayIPConfiguration struct {
761	*ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"`
762	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
763	Name *string `json:"name,omitempty"`
764	// Etag - A unique read-only string that changes whenever the resource is updated.
765	Etag *string `json:"etag,omitempty"`
766	// ID - Resource ID.
767	ID *string `json:"id,omitempty"`
768}
769
770// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration.
771func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) {
772	objectMap := make(map[string]interface{})
773	if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil {
774		objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat
775	}
776	if agic.Name != nil {
777		objectMap["name"] = agic.Name
778	}
779	if agic.Etag != nil {
780		objectMap["etag"] = agic.Etag
781	}
782	if agic.ID != nil {
783		objectMap["id"] = agic.ID
784	}
785	return json.Marshal(objectMap)
786}
787
788// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayIPConfiguration struct.
789func (agic *ApplicationGatewayIPConfiguration) UnmarshalJSON(body []byte) error {
790	var m map[string]*json.RawMessage
791	err := json.Unmarshal(body, &m)
792	if err != nil {
793		return err
794	}
795	for k, v := range m {
796		switch k {
797		case "properties":
798			if v != nil {
799				var applicationGatewayIPConfigurationPropertiesFormat ApplicationGatewayIPConfigurationPropertiesFormat
800				err = json.Unmarshal(*v, &applicationGatewayIPConfigurationPropertiesFormat)
801				if err != nil {
802					return err
803				}
804				agic.ApplicationGatewayIPConfigurationPropertiesFormat = &applicationGatewayIPConfigurationPropertiesFormat
805			}
806		case "name":
807			if v != nil {
808				var name string
809				err = json.Unmarshal(*v, &name)
810				if err != nil {
811					return err
812				}
813				agic.Name = &name
814			}
815		case "etag":
816			if v != nil {
817				var etag string
818				err = json.Unmarshal(*v, &etag)
819				if err != nil {
820					return err
821				}
822				agic.Etag = &etag
823			}
824		case "id":
825			if v != nil {
826				var ID string
827				err = json.Unmarshal(*v, &ID)
828				if err != nil {
829					return err
830				}
831				agic.ID = &ID
832			}
833		}
834	}
835
836	return nil
837}
838
839// ApplicationGatewayIPConfigurationPropertiesFormat properties of IP configuration of an application
840// gateway.
841type ApplicationGatewayIPConfigurationPropertiesFormat struct {
842	// Subnet - Reference of the subnet resource. A subnet from where application gateway gets its private address.
843	Subnet *SubResource `json:"subnet,omitempty"`
844	// ProvisioningState - Provisioning state of the application gateway subnet resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
845	ProvisioningState *string `json:"provisioningState,omitempty"`
846}
847
848// ApplicationGatewayListResult response for ListApplicationGateways API service call.
849type ApplicationGatewayListResult struct {
850	autorest.Response `json:"-"`
851	// Value - List of an application gateways in a resource group.
852	Value *[]ApplicationGateway `json:"value,omitempty"`
853	// NextLink - URL to get the next set of results.
854	NextLink *string `json:"nextLink,omitempty"`
855}
856
857// ApplicationGatewayListResultIterator provides access to a complete listing of ApplicationGateway values.
858type ApplicationGatewayListResultIterator struct {
859	i    int
860	page ApplicationGatewayListResultPage
861}
862
863// NextWithContext advances to the next value.  If there was an error making
864// the request the iterator does not advance and the error is returned.
865func (iter *ApplicationGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) {
866	if tracing.IsEnabled() {
867		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultIterator.NextWithContext")
868		defer func() {
869			sc := -1
870			if iter.Response().Response.Response != nil {
871				sc = iter.Response().Response.Response.StatusCode
872			}
873			tracing.EndSpan(ctx, sc, err)
874		}()
875	}
876	iter.i++
877	if iter.i < len(iter.page.Values()) {
878		return nil
879	}
880	err = iter.page.NextWithContext(ctx)
881	if err != nil {
882		iter.i--
883		return err
884	}
885	iter.i = 0
886	return nil
887}
888
889// Next advances to the next value.  If there was an error making
890// the request the iterator does not advance and the error is returned.
891// Deprecated: Use NextWithContext() instead.
892func (iter *ApplicationGatewayListResultIterator) Next() error {
893	return iter.NextWithContext(context.Background())
894}
895
896// NotDone returns true if the enumeration should be started or is not yet complete.
897func (iter ApplicationGatewayListResultIterator) NotDone() bool {
898	return iter.page.NotDone() && iter.i < len(iter.page.Values())
899}
900
901// Response returns the raw server response from the last page request.
902func (iter ApplicationGatewayListResultIterator) Response() ApplicationGatewayListResult {
903	return iter.page.Response()
904}
905
906// Value returns the current value or a zero-initialized value if the
907// iterator has advanced beyond the end of the collection.
908func (iter ApplicationGatewayListResultIterator) Value() ApplicationGateway {
909	if !iter.page.NotDone() {
910		return ApplicationGateway{}
911	}
912	return iter.page.Values()[iter.i]
913}
914
915// Creates a new instance of the ApplicationGatewayListResultIterator type.
916func NewApplicationGatewayListResultIterator(page ApplicationGatewayListResultPage) ApplicationGatewayListResultIterator {
917	return ApplicationGatewayListResultIterator{page: page}
918}
919
920// IsEmpty returns true if the ListResult contains no values.
921func (aglr ApplicationGatewayListResult) IsEmpty() bool {
922	return aglr.Value == nil || len(*aglr.Value) == 0
923}
924
925// hasNextLink returns true if the NextLink is not empty.
926func (aglr ApplicationGatewayListResult) hasNextLink() bool {
927	return aglr.NextLink != nil && len(*aglr.NextLink) != 0
928}
929
930// applicationGatewayListResultPreparer prepares a request to retrieve the next set of results.
931// It returns nil if no more results exist.
932func (aglr ApplicationGatewayListResult) applicationGatewayListResultPreparer(ctx context.Context) (*http.Request, error) {
933	if !aglr.hasNextLink() {
934		return nil, nil
935	}
936	return autorest.Prepare((&http.Request{}).WithContext(ctx),
937		autorest.AsJSON(),
938		autorest.AsGet(),
939		autorest.WithBaseURL(to.String(aglr.NextLink)))
940}
941
942// ApplicationGatewayListResultPage contains a page of ApplicationGateway values.
943type ApplicationGatewayListResultPage struct {
944	fn   func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)
945	aglr ApplicationGatewayListResult
946}
947
948// NextWithContext advances to the next page of values.  If there was an error making
949// the request the page does not advance and the error is returned.
950func (page *ApplicationGatewayListResultPage) NextWithContext(ctx context.Context) (err error) {
951	if tracing.IsEnabled() {
952		ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayListResultPage.NextWithContext")
953		defer func() {
954			sc := -1
955			if page.Response().Response.Response != nil {
956				sc = page.Response().Response.Response.StatusCode
957			}
958			tracing.EndSpan(ctx, sc, err)
959		}()
960	}
961	for {
962		next, err := page.fn(ctx, page.aglr)
963		if err != nil {
964			return err
965		}
966		page.aglr = next
967		if !next.hasNextLink() || !next.IsEmpty() {
968			break
969		}
970	}
971	return nil
972}
973
974// Next advances to the next page of values.  If there was an error making
975// the request the page does not advance and the error is returned.
976// Deprecated: Use NextWithContext() instead.
977func (page *ApplicationGatewayListResultPage) Next() error {
978	return page.NextWithContext(context.Background())
979}
980
981// NotDone returns true if the page enumeration should be started or is not yet complete.
982func (page ApplicationGatewayListResultPage) NotDone() bool {
983	return !page.aglr.IsEmpty()
984}
985
986// Response returns the raw server response from the last page request.
987func (page ApplicationGatewayListResultPage) Response() ApplicationGatewayListResult {
988	return page.aglr
989}
990
991// Values returns the slice of values for the current page or nil if there are no values.
992func (page ApplicationGatewayListResultPage) Values() []ApplicationGateway {
993	if page.aglr.IsEmpty() {
994		return nil
995	}
996	return *page.aglr.Value
997}
998
999// Creates a new instance of the ApplicationGatewayListResultPage type.
1000func NewApplicationGatewayListResultPage(cur ApplicationGatewayListResult, getNextPage func(context.Context, ApplicationGatewayListResult) (ApplicationGatewayListResult, error)) ApplicationGatewayListResultPage {
1001	return ApplicationGatewayListResultPage{
1002		fn:   getNextPage,
1003		aglr: cur,
1004	}
1005}
1006
1007// ApplicationGatewayPathRule path rule of URL path map of an application gateway.
1008type ApplicationGatewayPathRule struct {
1009	*ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"`
1010	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
1011	Name *string `json:"name,omitempty"`
1012	// Etag - A unique read-only string that changes whenever the resource is updated.
1013	Etag *string `json:"etag,omitempty"`
1014	// ID - Resource ID.
1015	ID *string `json:"id,omitempty"`
1016}
1017
1018// MarshalJSON is the custom marshaler for ApplicationGatewayPathRule.
1019func (agpr ApplicationGatewayPathRule) MarshalJSON() ([]byte, error) {
1020	objectMap := make(map[string]interface{})
1021	if agpr.ApplicationGatewayPathRulePropertiesFormat != nil {
1022		objectMap["properties"] = agpr.ApplicationGatewayPathRulePropertiesFormat
1023	}
1024	if agpr.Name != nil {
1025		objectMap["name"] = agpr.Name
1026	}
1027	if agpr.Etag != nil {
1028		objectMap["etag"] = agpr.Etag
1029	}
1030	if agpr.ID != nil {
1031		objectMap["id"] = agpr.ID
1032	}
1033	return json.Marshal(objectMap)
1034}
1035
1036// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayPathRule struct.
1037func (agpr *ApplicationGatewayPathRule) UnmarshalJSON(body []byte) error {
1038	var m map[string]*json.RawMessage
1039	err := json.Unmarshal(body, &m)
1040	if err != nil {
1041		return err
1042	}
1043	for k, v := range m {
1044		switch k {
1045		case "properties":
1046			if v != nil {
1047				var applicationGatewayPathRulePropertiesFormat ApplicationGatewayPathRulePropertiesFormat
1048				err = json.Unmarshal(*v, &applicationGatewayPathRulePropertiesFormat)
1049				if err != nil {
1050					return err
1051				}
1052				agpr.ApplicationGatewayPathRulePropertiesFormat = &applicationGatewayPathRulePropertiesFormat
1053			}
1054		case "name":
1055			if v != nil {
1056				var name string
1057				err = json.Unmarshal(*v, &name)
1058				if err != nil {
1059					return err
1060				}
1061				agpr.Name = &name
1062			}
1063		case "etag":
1064			if v != nil {
1065				var etag string
1066				err = json.Unmarshal(*v, &etag)
1067				if err != nil {
1068					return err
1069				}
1070				agpr.Etag = &etag
1071			}
1072		case "id":
1073			if v != nil {
1074				var ID string
1075				err = json.Unmarshal(*v, &ID)
1076				if err != nil {
1077					return err
1078				}
1079				agpr.ID = &ID
1080			}
1081		}
1082	}
1083
1084	return nil
1085}
1086
1087// ApplicationGatewayPathRulePropertiesFormat properties of probe of an application gateway.
1088type ApplicationGatewayPathRulePropertiesFormat struct {
1089	// Paths - Path rules of URL path map.
1090	Paths *[]string `json:"paths,omitempty"`
1091	// BackendAddressPool - Backend address pool resource of URL path map.
1092	BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
1093	// BackendHTTPSettings - Backend http settings resource of URL path map.
1094	BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"`
1095	// ProvisioningState - Path rule of URL path map resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
1096	ProvisioningState *string `json:"provisioningState,omitempty"`
1097}
1098
1099// ApplicationGatewayProbe probe of the application gateway.
1100type ApplicationGatewayProbe struct {
1101	*ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"`
1102	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
1103	Name *string `json:"name,omitempty"`
1104	// Etag - A unique read-only string that changes whenever the resource is updated.
1105	Etag *string `json:"etag,omitempty"`
1106	// ID - Resource ID.
1107	ID *string `json:"id,omitempty"`
1108}
1109
1110// MarshalJSON is the custom marshaler for ApplicationGatewayProbe.
1111func (agp ApplicationGatewayProbe) MarshalJSON() ([]byte, error) {
1112	objectMap := make(map[string]interface{})
1113	if agp.ApplicationGatewayProbePropertiesFormat != nil {
1114		objectMap["properties"] = agp.ApplicationGatewayProbePropertiesFormat
1115	}
1116	if agp.Name != nil {
1117		objectMap["name"] = agp.Name
1118	}
1119	if agp.Etag != nil {
1120		objectMap["etag"] = agp.Etag
1121	}
1122	if agp.ID != nil {
1123		objectMap["id"] = agp.ID
1124	}
1125	return json.Marshal(objectMap)
1126}
1127
1128// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayProbe struct.
1129func (agp *ApplicationGatewayProbe) UnmarshalJSON(body []byte) error {
1130	var m map[string]*json.RawMessage
1131	err := json.Unmarshal(body, &m)
1132	if err != nil {
1133		return err
1134	}
1135	for k, v := range m {
1136		switch k {
1137		case "properties":
1138			if v != nil {
1139				var applicationGatewayProbePropertiesFormat ApplicationGatewayProbePropertiesFormat
1140				err = json.Unmarshal(*v, &applicationGatewayProbePropertiesFormat)
1141				if err != nil {
1142					return err
1143				}
1144				agp.ApplicationGatewayProbePropertiesFormat = &applicationGatewayProbePropertiesFormat
1145			}
1146		case "name":
1147			if v != nil {
1148				var name string
1149				err = json.Unmarshal(*v, &name)
1150				if err != nil {
1151					return err
1152				}
1153				agp.Name = &name
1154			}
1155		case "etag":
1156			if v != nil {
1157				var etag string
1158				err = json.Unmarshal(*v, &etag)
1159				if err != nil {
1160					return err
1161				}
1162				agp.Etag = &etag
1163			}
1164		case "id":
1165			if v != nil {
1166				var ID string
1167				err = json.Unmarshal(*v, &ID)
1168				if err != nil {
1169					return err
1170				}
1171				agp.ID = &ID
1172			}
1173		}
1174	}
1175
1176	return nil
1177}
1178
1179// ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway.
1180type ApplicationGatewayProbePropertiesFormat struct {
1181	// Protocol - Protocol. Possible values are: 'Http' and 'Https'. Possible values include: 'HTTP', 'HTTPS'
1182	Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
1183	// Host - Host name to send the probe to.
1184	Host *string `json:"host,omitempty"`
1185	// Path - Relative path of probe. Valid path starts from '/'. Probe is sent to <Protocol>://<host>:<port><path>
1186	Path *string `json:"path,omitempty"`
1187	// Interval - The probing interval in seconds. This is the time interval between two consecutive probes. Acceptable values are from 1 second to 86400 seconds.
1188	Interval *int32 `json:"interval,omitempty"`
1189	// Timeout - the probe timeout in seconds. Probe marked as failed if valid response is not received with this timeout period. Acceptable values are from 1 second to 86400 seconds.
1190	Timeout *int32 `json:"timeout,omitempty"`
1191	// UnhealthyThreshold - The probe retry count. Backend server is marked down after consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second to 20.
1192	UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"`
1193	// ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
1194	ProvisioningState *string `json:"provisioningState,omitempty"`
1195}
1196
1197// ApplicationGatewayPropertiesFormat properties of the application gateway.
1198type ApplicationGatewayPropertiesFormat struct {
1199	// Sku - SKU of the application gateway resource.
1200	Sku *ApplicationGatewaySku `json:"sku,omitempty"`
1201	// SslPolicy - SSL policy of the application gateway resource.
1202	SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"`
1203	// OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values are: 'Stopped', 'Started', 'Running', and 'Stopping'. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping'
1204	OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"`
1205	// GatewayIPConfigurations - Subnets of application the gateway resource.
1206	GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"`
1207	// AuthenticationCertificates - Authentication certificates of the application gateway resource.
1208	AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"`
1209	// SslCertificates - SSL certificates of the application gateway resource.
1210	SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"`
1211	// FrontendIPConfigurations - Frontend IP addresses of the application gateway resource.
1212	FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
1213	// FrontendPorts - Frontend ports of the application gateway resource.
1214	FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"`
1215	// Probes - Probes of the application gateway resource.
1216	Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"`
1217	// BackendAddressPools - Backend address pool of the application gateway resource.
1218	BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"`
1219	// BackendHTTPSettingsCollection - Backend http settings of the application gateway resource.
1220	BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"`
1221	// HTTPListeners - Http listeners of the application gateway resource.
1222	HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"`
1223	// URLPathMaps - URL path map of the application gateway resource.
1224	URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"`
1225	// RequestRoutingRules - Request routing rules of the application gateway resource.
1226	RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"`
1227	// WebApplicationFirewallConfiguration - Web application firewall configuration.
1228	WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"`
1229	// ResourceGUID - Resource GUID property of the application gateway resource.
1230	ResourceGUID *string `json:"resourceGuid,omitempty"`
1231	// ProvisioningState - Provisioning state of the application gateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
1232	ProvisioningState *string `json:"provisioningState,omitempty"`
1233}
1234
1235// MarshalJSON is the custom marshaler for ApplicationGatewayPropertiesFormat.
1236func (agpf ApplicationGatewayPropertiesFormat) MarshalJSON() ([]byte, error) {
1237	objectMap := make(map[string]interface{})
1238	if agpf.Sku != nil {
1239		objectMap["sku"] = agpf.Sku
1240	}
1241	if agpf.SslPolicy != nil {
1242		objectMap["sslPolicy"] = agpf.SslPolicy
1243	}
1244	if agpf.GatewayIPConfigurations != nil {
1245		objectMap["gatewayIPConfigurations"] = agpf.GatewayIPConfigurations
1246	}
1247	if agpf.AuthenticationCertificates != nil {
1248		objectMap["authenticationCertificates"] = agpf.AuthenticationCertificates
1249	}
1250	if agpf.SslCertificates != nil {
1251		objectMap["sslCertificates"] = agpf.SslCertificates
1252	}
1253	if agpf.FrontendIPConfigurations != nil {
1254		objectMap["frontendIPConfigurations"] = agpf.FrontendIPConfigurations
1255	}
1256	if agpf.FrontendPorts != nil {
1257		objectMap["frontendPorts"] = agpf.FrontendPorts
1258	}
1259	if agpf.Probes != nil {
1260		objectMap["probes"] = agpf.Probes
1261	}
1262	if agpf.BackendAddressPools != nil {
1263		objectMap["backendAddressPools"] = agpf.BackendAddressPools
1264	}
1265	if agpf.BackendHTTPSettingsCollection != nil {
1266		objectMap["backendHttpSettingsCollection"] = agpf.BackendHTTPSettingsCollection
1267	}
1268	if agpf.HTTPListeners != nil {
1269		objectMap["httpListeners"] = agpf.HTTPListeners
1270	}
1271	if agpf.URLPathMaps != nil {
1272		objectMap["urlPathMaps"] = agpf.URLPathMaps
1273	}
1274	if agpf.RequestRoutingRules != nil {
1275		objectMap["requestRoutingRules"] = agpf.RequestRoutingRules
1276	}
1277	if agpf.WebApplicationFirewallConfiguration != nil {
1278		objectMap["webApplicationFirewallConfiguration"] = agpf.WebApplicationFirewallConfiguration
1279	}
1280	if agpf.ResourceGUID != nil {
1281		objectMap["resourceGuid"] = agpf.ResourceGUID
1282	}
1283	if agpf.ProvisioningState != nil {
1284		objectMap["provisioningState"] = agpf.ProvisioningState
1285	}
1286	return json.Marshal(objectMap)
1287}
1288
1289// ApplicationGatewayRequestRoutingRule request routing rule of an application gateway.
1290type ApplicationGatewayRequestRoutingRule struct {
1291	*ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"`
1292	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
1293	Name *string `json:"name,omitempty"`
1294	// Etag - A unique read-only string that changes whenever the resource is updated.
1295	Etag *string `json:"etag,omitempty"`
1296	// ID - Resource ID.
1297	ID *string `json:"id,omitempty"`
1298}
1299
1300// MarshalJSON is the custom marshaler for ApplicationGatewayRequestRoutingRule.
1301func (agrrr ApplicationGatewayRequestRoutingRule) MarshalJSON() ([]byte, error) {
1302	objectMap := make(map[string]interface{})
1303	if agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat != nil {
1304		objectMap["properties"] = agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat
1305	}
1306	if agrrr.Name != nil {
1307		objectMap["name"] = agrrr.Name
1308	}
1309	if agrrr.Etag != nil {
1310		objectMap["etag"] = agrrr.Etag
1311	}
1312	if agrrr.ID != nil {
1313		objectMap["id"] = agrrr.ID
1314	}
1315	return json.Marshal(objectMap)
1316}
1317
1318// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayRequestRoutingRule struct.
1319func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) error {
1320	var m map[string]*json.RawMessage
1321	err := json.Unmarshal(body, &m)
1322	if err != nil {
1323		return err
1324	}
1325	for k, v := range m {
1326		switch k {
1327		case "properties":
1328			if v != nil {
1329				var applicationGatewayRequestRoutingRulePropertiesFormat ApplicationGatewayRequestRoutingRulePropertiesFormat
1330				err = json.Unmarshal(*v, &applicationGatewayRequestRoutingRulePropertiesFormat)
1331				if err != nil {
1332					return err
1333				}
1334				agrrr.ApplicationGatewayRequestRoutingRulePropertiesFormat = &applicationGatewayRequestRoutingRulePropertiesFormat
1335			}
1336		case "name":
1337			if v != nil {
1338				var name string
1339				err = json.Unmarshal(*v, &name)
1340				if err != nil {
1341					return err
1342				}
1343				agrrr.Name = &name
1344			}
1345		case "etag":
1346			if v != nil {
1347				var etag string
1348				err = json.Unmarshal(*v, &etag)
1349				if err != nil {
1350					return err
1351				}
1352				agrrr.Etag = &etag
1353			}
1354		case "id":
1355			if v != nil {
1356				var ID string
1357				err = json.Unmarshal(*v, &ID)
1358				if err != nil {
1359					return err
1360				}
1361				agrrr.ID = &ID
1362			}
1363		}
1364	}
1365
1366	return nil
1367}
1368
1369// ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the
1370// application gateway.
1371type ApplicationGatewayRequestRoutingRulePropertiesFormat struct {
1372	// RuleType - Rule type. Possible values are: 'Basic' and 'PathBasedRouting'. Possible values include: 'Basic', 'PathBasedRouting'
1373	RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"`
1374	// BackendAddressPool - Backend address pool resource of the application gateway.
1375	BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
1376	// BackendHTTPSettings - Frontend port resource of the application gateway.
1377	BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"`
1378	// HTTPListener - Http listener resource of the application gateway.
1379	HTTPListener *SubResource `json:"httpListener,omitempty"`
1380	// URLPathMap - URL path map resource of the application gateway.
1381	URLPathMap *SubResource `json:"urlPathMap,omitempty"`
1382	// ProvisioningState - Provisioning state of the request routing rule resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
1383	ProvisioningState *string `json:"provisioningState,omitempty"`
1384}
1385
1386// ApplicationGatewaysBackendHealthFuture an abstraction for monitoring and retrieving the results of a
1387// long-running operation.
1388type ApplicationGatewaysBackendHealthFuture struct {
1389	azure.FutureAPI
1390	// Result returns the result of the asynchronous operation.
1391	// If the operation has not completed it will return an error.
1392	Result func(ApplicationGatewaysClient) (ApplicationGatewayBackendHealth, error)
1393}
1394
1395// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1396func (future *ApplicationGatewaysBackendHealthFuture) UnmarshalJSON(body []byte) error {
1397	var azFuture azure.Future
1398	if err := json.Unmarshal(body, &azFuture); err != nil {
1399		return err
1400	}
1401	future.FutureAPI = &azFuture
1402	future.Result = future.result
1403	return nil
1404}
1405
1406// result is the default implementation for ApplicationGatewaysBackendHealthFuture.Result.
1407func (future *ApplicationGatewaysBackendHealthFuture) result(client ApplicationGatewaysClient) (agbh ApplicationGatewayBackendHealth, err error) {
1408	var done bool
1409	done, err = future.DoneWithContext(context.Background(), client)
1410	if err != nil {
1411		err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", future.Response(), "Polling failure")
1412		return
1413	}
1414	if !done {
1415		agbh.Response.Response = future.Response()
1416		err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysBackendHealthFuture")
1417		return
1418	}
1419	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1420	if agbh.Response.Response, err = future.GetResult(sender); err == nil && agbh.Response.Response.StatusCode != http.StatusNoContent {
1421		agbh, err = client.BackendHealthResponder(agbh.Response.Response)
1422		if err != nil {
1423			err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysBackendHealthFuture", "Result", agbh.Response.Response, "Failure responding to request")
1424		}
1425	}
1426	return
1427}
1428
1429// ApplicationGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1430// long-running operation.
1431type ApplicationGatewaysCreateOrUpdateFuture struct {
1432	azure.FutureAPI
1433	// Result returns the result of the asynchronous operation.
1434	// If the operation has not completed it will return an error.
1435	Result func(ApplicationGatewaysClient) (ApplicationGateway, error)
1436}
1437
1438// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1439func (future *ApplicationGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1440	var azFuture azure.Future
1441	if err := json.Unmarshal(body, &azFuture); err != nil {
1442		return err
1443	}
1444	future.FutureAPI = &azFuture
1445	future.Result = future.result
1446	return nil
1447}
1448
1449// result is the default implementation for ApplicationGatewaysCreateOrUpdateFuture.Result.
1450func (future *ApplicationGatewaysCreateOrUpdateFuture) result(client ApplicationGatewaysClient) (ag ApplicationGateway, err error) {
1451	var done bool
1452	done, err = future.DoneWithContext(context.Background(), client)
1453	if err != nil {
1454		err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1455		return
1456	}
1457	if !done {
1458		ag.Response.Response = future.Response()
1459		err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysCreateOrUpdateFuture")
1460		return
1461	}
1462	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1463	if ag.Response.Response, err = future.GetResult(sender); err == nil && ag.Response.Response.StatusCode != http.StatusNoContent {
1464		ag, err = client.CreateOrUpdateResponder(ag.Response.Response)
1465		if err != nil {
1466			err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysCreateOrUpdateFuture", "Result", ag.Response.Response, "Failure responding to request")
1467		}
1468	}
1469	return
1470}
1471
1472// ApplicationGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a
1473// long-running operation.
1474type ApplicationGatewaysDeleteFuture struct {
1475	azure.FutureAPI
1476	// Result returns the result of the asynchronous operation.
1477	// If the operation has not completed it will return an error.
1478	Result func(ApplicationGatewaysClient) (autorest.Response, error)
1479}
1480
1481// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1482func (future *ApplicationGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
1483	var azFuture azure.Future
1484	if err := json.Unmarshal(body, &azFuture); err != nil {
1485		return err
1486	}
1487	future.FutureAPI = &azFuture
1488	future.Result = future.result
1489	return nil
1490}
1491
1492// result is the default implementation for ApplicationGatewaysDeleteFuture.Result.
1493func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
1494	var done bool
1495	done, err = future.DoneWithContext(context.Background(), client)
1496	if err != nil {
1497		err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
1498		return
1499	}
1500	if !done {
1501		ar.Response = future.Response()
1502		err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysDeleteFuture")
1503		return
1504	}
1505	ar.Response = future.Response()
1506	return
1507}
1508
1509// ApplicationGatewaySku SKU of an application gateway
1510type ApplicationGatewaySku struct {
1511	// Name - Name of an application gateway SKU. Possible values are: 'Standard_Small', 'Standard_Medium', 'Standard_Large', 'WAF_Medium', and 'WAF_Large'. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge'
1512	Name ApplicationGatewaySkuName `json:"name,omitempty"`
1513	// Tier - Tier of an application gateway. Possible values are: 'Standard' and 'WAF'. Possible values include: 'Standard', 'WAF'
1514	Tier ApplicationGatewayTier `json:"tier,omitempty"`
1515	// Capacity - Capacity (instance count) of an application gateway.
1516	Capacity *int32 `json:"capacity,omitempty"`
1517}
1518
1519// ApplicationGatewaySslCertificate SSL certificates of an application gateway.
1520type ApplicationGatewaySslCertificate struct {
1521	*ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"`
1522	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
1523	Name *string `json:"name,omitempty"`
1524	// Etag - A unique read-only string that changes whenever the resource is updated.
1525	Etag *string `json:"etag,omitempty"`
1526	// ID - Resource ID.
1527	ID *string `json:"id,omitempty"`
1528}
1529
1530// MarshalJSON is the custom marshaler for ApplicationGatewaySslCertificate.
1531func (agsc ApplicationGatewaySslCertificate) MarshalJSON() ([]byte, error) {
1532	objectMap := make(map[string]interface{})
1533	if agsc.ApplicationGatewaySslCertificatePropertiesFormat != nil {
1534		objectMap["properties"] = agsc.ApplicationGatewaySslCertificatePropertiesFormat
1535	}
1536	if agsc.Name != nil {
1537		objectMap["name"] = agsc.Name
1538	}
1539	if agsc.Etag != nil {
1540		objectMap["etag"] = agsc.Etag
1541	}
1542	if agsc.ID != nil {
1543		objectMap["id"] = agsc.ID
1544	}
1545	return json.Marshal(objectMap)
1546}
1547
1548// UnmarshalJSON is the custom unmarshaler for ApplicationGatewaySslCertificate struct.
1549func (agsc *ApplicationGatewaySslCertificate) UnmarshalJSON(body []byte) error {
1550	var m map[string]*json.RawMessage
1551	err := json.Unmarshal(body, &m)
1552	if err != nil {
1553		return err
1554	}
1555	for k, v := range m {
1556		switch k {
1557		case "properties":
1558			if v != nil {
1559				var applicationGatewaySslCertificatePropertiesFormat ApplicationGatewaySslCertificatePropertiesFormat
1560				err = json.Unmarshal(*v, &applicationGatewaySslCertificatePropertiesFormat)
1561				if err != nil {
1562					return err
1563				}
1564				agsc.ApplicationGatewaySslCertificatePropertiesFormat = &applicationGatewaySslCertificatePropertiesFormat
1565			}
1566		case "name":
1567			if v != nil {
1568				var name string
1569				err = json.Unmarshal(*v, &name)
1570				if err != nil {
1571					return err
1572				}
1573				agsc.Name = &name
1574			}
1575		case "etag":
1576			if v != nil {
1577				var etag string
1578				err = json.Unmarshal(*v, &etag)
1579				if err != nil {
1580					return err
1581				}
1582				agsc.Etag = &etag
1583			}
1584		case "id":
1585			if v != nil {
1586				var ID string
1587				err = json.Unmarshal(*v, &ID)
1588				if err != nil {
1589					return err
1590				}
1591				agsc.ID = &ID
1592			}
1593		}
1594	}
1595
1596	return nil
1597}
1598
1599// ApplicationGatewaySslCertificatePropertiesFormat properties of SSL certificates of an application
1600// gateway.
1601type ApplicationGatewaySslCertificatePropertiesFormat struct {
1602	// Data - Base-64 encoded pfx certificate. Only applicable in PUT Request.
1603	Data *string `json:"data,omitempty"`
1604	// Password - Password for the pfx file specified in data. Only applicable in PUT request.
1605	Password *string `json:"password,omitempty"`
1606	// PublicCertData - Base-64 encoded Public cert data corresponding to pfx specified in data. Only applicable in GET request.
1607	PublicCertData *string `json:"publicCertData,omitempty"`
1608	// ProvisioningState - Provisioning state of the SSL certificate resource Possible values are: 'Updating', 'Deleting', and 'Failed'.
1609	ProvisioningState *string `json:"provisioningState,omitempty"`
1610}
1611
1612// ApplicationGatewaySslPolicy application gateway SSL policy.
1613type ApplicationGatewaySslPolicy struct {
1614	// DisabledSslProtocols - SSL protocols to be disabled on application gateway. Possible values are: 'TLSv1_0', 'TLSv1_1', and 'TLSv1_2'.
1615	DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"`
1616}
1617
1618// ApplicationGatewaysStartFuture an abstraction for monitoring and retrieving the results of a
1619// long-running operation.
1620type ApplicationGatewaysStartFuture struct {
1621	azure.FutureAPI
1622	// Result returns the result of the asynchronous operation.
1623	// If the operation has not completed it will return an error.
1624	Result func(ApplicationGatewaysClient) (autorest.Response, error)
1625}
1626
1627// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1628func (future *ApplicationGatewaysStartFuture) UnmarshalJSON(body []byte) error {
1629	var azFuture azure.Future
1630	if err := json.Unmarshal(body, &azFuture); err != nil {
1631		return err
1632	}
1633	future.FutureAPI = &azFuture
1634	future.Result = future.result
1635	return nil
1636}
1637
1638// result is the default implementation for ApplicationGatewaysStartFuture.Result.
1639func (future *ApplicationGatewaysStartFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
1640	var done bool
1641	done, err = future.DoneWithContext(context.Background(), client)
1642	if err != nil {
1643		err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStartFuture", "Result", future.Response(), "Polling failure")
1644		return
1645	}
1646	if !done {
1647		ar.Response = future.Response()
1648		err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStartFuture")
1649		return
1650	}
1651	ar.Response = future.Response()
1652	return
1653}
1654
1655// ApplicationGatewaysStopFuture an abstraction for monitoring and retrieving the results of a long-running
1656// operation.
1657type ApplicationGatewaysStopFuture struct {
1658	azure.FutureAPI
1659	// Result returns the result of the asynchronous operation.
1660	// If the operation has not completed it will return an error.
1661	Result func(ApplicationGatewaysClient) (autorest.Response, error)
1662}
1663
1664// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1665func (future *ApplicationGatewaysStopFuture) UnmarshalJSON(body []byte) error {
1666	var azFuture azure.Future
1667	if err := json.Unmarshal(body, &azFuture); err != nil {
1668		return err
1669	}
1670	future.FutureAPI = &azFuture
1671	future.Result = future.result
1672	return nil
1673}
1674
1675// result is the default implementation for ApplicationGatewaysStopFuture.Result.
1676func (future *ApplicationGatewaysStopFuture) result(client ApplicationGatewaysClient) (ar autorest.Response, err error) {
1677	var done bool
1678	done, err = future.DoneWithContext(context.Background(), client)
1679	if err != nil {
1680		err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysStopFuture", "Result", future.Response(), "Polling failure")
1681		return
1682	}
1683	if !done {
1684		ar.Response = future.Response()
1685		err = azure.NewAsyncOpIncompleteError("network.ApplicationGatewaysStopFuture")
1686		return
1687	}
1688	ar.Response = future.Response()
1689	return
1690}
1691
1692// ApplicationGatewayURLPathMap urlPathMaps give a url path to the backend mapping information for
1693// PathBasedRouting.
1694type ApplicationGatewayURLPathMap struct {
1695	*ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"`
1696	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
1697	Name *string `json:"name,omitempty"`
1698	// Etag - A unique read-only string that changes whenever the resource is updated.
1699	Etag *string `json:"etag,omitempty"`
1700	// ID - Resource ID.
1701	ID *string `json:"id,omitempty"`
1702}
1703
1704// MarshalJSON is the custom marshaler for ApplicationGatewayURLPathMap.
1705func (agupm ApplicationGatewayURLPathMap) MarshalJSON() ([]byte, error) {
1706	objectMap := make(map[string]interface{})
1707	if agupm.ApplicationGatewayURLPathMapPropertiesFormat != nil {
1708		objectMap["properties"] = agupm.ApplicationGatewayURLPathMapPropertiesFormat
1709	}
1710	if agupm.Name != nil {
1711		objectMap["name"] = agupm.Name
1712	}
1713	if agupm.Etag != nil {
1714		objectMap["etag"] = agupm.Etag
1715	}
1716	if agupm.ID != nil {
1717		objectMap["id"] = agupm.ID
1718	}
1719	return json.Marshal(objectMap)
1720}
1721
1722// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayURLPathMap struct.
1723func (agupm *ApplicationGatewayURLPathMap) UnmarshalJSON(body []byte) error {
1724	var m map[string]*json.RawMessage
1725	err := json.Unmarshal(body, &m)
1726	if err != nil {
1727		return err
1728	}
1729	for k, v := range m {
1730		switch k {
1731		case "properties":
1732			if v != nil {
1733				var applicationGatewayURLPathMapPropertiesFormat ApplicationGatewayURLPathMapPropertiesFormat
1734				err = json.Unmarshal(*v, &applicationGatewayURLPathMapPropertiesFormat)
1735				if err != nil {
1736					return err
1737				}
1738				agupm.ApplicationGatewayURLPathMapPropertiesFormat = &applicationGatewayURLPathMapPropertiesFormat
1739			}
1740		case "name":
1741			if v != nil {
1742				var name string
1743				err = json.Unmarshal(*v, &name)
1744				if err != nil {
1745					return err
1746				}
1747				agupm.Name = &name
1748			}
1749		case "etag":
1750			if v != nil {
1751				var etag string
1752				err = json.Unmarshal(*v, &etag)
1753				if err != nil {
1754					return err
1755				}
1756				agupm.Etag = &etag
1757			}
1758		case "id":
1759			if v != nil {
1760				var ID string
1761				err = json.Unmarshal(*v, &ID)
1762				if err != nil {
1763					return err
1764				}
1765				agupm.ID = &ID
1766			}
1767		}
1768	}
1769
1770	return nil
1771}
1772
1773// ApplicationGatewayURLPathMapPropertiesFormat properties of UrlPathMap of the application gateway.
1774type ApplicationGatewayURLPathMapPropertiesFormat struct {
1775	// DefaultBackendAddressPool - Default backend address pool resource of URL path map.
1776	DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"`
1777	// DefaultBackendHTTPSettings - Default backend http settings resource of URL path map.
1778	DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"`
1779	// PathRules - Path rule of URL path map resource.
1780	PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"`
1781	// ProvisioningState - Provisioning state of the backend http settings resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
1782	ProvisioningState *string `json:"provisioningState,omitempty"`
1783}
1784
1785// ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall
1786// configuration.
1787type ApplicationGatewayWebApplicationFirewallConfiguration struct {
1788	// Enabled - Whether the web application firewall is enabled or not.
1789	Enabled *bool `json:"enabled,omitempty"`
1790	// FirewallMode - Web application firewall mode. Possible values are: 'Detection' and 'Prevention'. Possible values include: 'Detection', 'Prevention'
1791	FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"`
1792}
1793
1794// AuthorizationListResult response for ListAuthorizations API service call retrieves all authorizations
1795// that belongs to an ExpressRouteCircuit.
1796type AuthorizationListResult struct {
1797	autorest.Response `json:"-"`
1798	// Value - The authorizations in an ExpressRoute Circuit.
1799	Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"`
1800	// NextLink - The URL to get the next set of results.
1801	NextLink *string `json:"nextLink,omitempty"`
1802}
1803
1804// AuthorizationListResultIterator provides access to a complete listing of
1805// ExpressRouteCircuitAuthorization values.
1806type AuthorizationListResultIterator struct {
1807	i    int
1808	page AuthorizationListResultPage
1809}
1810
1811// NextWithContext advances to the next value.  If there was an error making
1812// the request the iterator does not advance and the error is returned.
1813func (iter *AuthorizationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1814	if tracing.IsEnabled() {
1815		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultIterator.NextWithContext")
1816		defer func() {
1817			sc := -1
1818			if iter.Response().Response.Response != nil {
1819				sc = iter.Response().Response.Response.StatusCode
1820			}
1821			tracing.EndSpan(ctx, sc, err)
1822		}()
1823	}
1824	iter.i++
1825	if iter.i < len(iter.page.Values()) {
1826		return nil
1827	}
1828	err = iter.page.NextWithContext(ctx)
1829	if err != nil {
1830		iter.i--
1831		return err
1832	}
1833	iter.i = 0
1834	return nil
1835}
1836
1837// Next advances to the next value.  If there was an error making
1838// the request the iterator does not advance and the error is returned.
1839// Deprecated: Use NextWithContext() instead.
1840func (iter *AuthorizationListResultIterator) Next() error {
1841	return iter.NextWithContext(context.Background())
1842}
1843
1844// NotDone returns true if the enumeration should be started or is not yet complete.
1845func (iter AuthorizationListResultIterator) NotDone() bool {
1846	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1847}
1848
1849// Response returns the raw server response from the last page request.
1850func (iter AuthorizationListResultIterator) Response() AuthorizationListResult {
1851	return iter.page.Response()
1852}
1853
1854// Value returns the current value or a zero-initialized value if the
1855// iterator has advanced beyond the end of the collection.
1856func (iter AuthorizationListResultIterator) Value() ExpressRouteCircuitAuthorization {
1857	if !iter.page.NotDone() {
1858		return ExpressRouteCircuitAuthorization{}
1859	}
1860	return iter.page.Values()[iter.i]
1861}
1862
1863// Creates a new instance of the AuthorizationListResultIterator type.
1864func NewAuthorizationListResultIterator(page AuthorizationListResultPage) AuthorizationListResultIterator {
1865	return AuthorizationListResultIterator{page: page}
1866}
1867
1868// IsEmpty returns true if the ListResult contains no values.
1869func (alr AuthorizationListResult) IsEmpty() bool {
1870	return alr.Value == nil || len(*alr.Value) == 0
1871}
1872
1873// hasNextLink returns true if the NextLink is not empty.
1874func (alr AuthorizationListResult) hasNextLink() bool {
1875	return alr.NextLink != nil && len(*alr.NextLink) != 0
1876}
1877
1878// authorizationListResultPreparer prepares a request to retrieve the next set of results.
1879// It returns nil if no more results exist.
1880func (alr AuthorizationListResult) authorizationListResultPreparer(ctx context.Context) (*http.Request, error) {
1881	if !alr.hasNextLink() {
1882		return nil, nil
1883	}
1884	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1885		autorest.AsJSON(),
1886		autorest.AsGet(),
1887		autorest.WithBaseURL(to.String(alr.NextLink)))
1888}
1889
1890// AuthorizationListResultPage contains a page of ExpressRouteCircuitAuthorization values.
1891type AuthorizationListResultPage struct {
1892	fn  func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)
1893	alr AuthorizationListResult
1894}
1895
1896// NextWithContext advances to the next page of values.  If there was an error making
1897// the request the page does not advance and the error is returned.
1898func (page *AuthorizationListResultPage) NextWithContext(ctx context.Context) (err error) {
1899	if tracing.IsEnabled() {
1900		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationListResultPage.NextWithContext")
1901		defer func() {
1902			sc := -1
1903			if page.Response().Response.Response != nil {
1904				sc = page.Response().Response.Response.StatusCode
1905			}
1906			tracing.EndSpan(ctx, sc, err)
1907		}()
1908	}
1909	for {
1910		next, err := page.fn(ctx, page.alr)
1911		if err != nil {
1912			return err
1913		}
1914		page.alr = next
1915		if !next.hasNextLink() || !next.IsEmpty() {
1916			break
1917		}
1918	}
1919	return nil
1920}
1921
1922// Next advances to the next page of values.  If there was an error making
1923// the request the page does not advance and the error is returned.
1924// Deprecated: Use NextWithContext() instead.
1925func (page *AuthorizationListResultPage) Next() error {
1926	return page.NextWithContext(context.Background())
1927}
1928
1929// NotDone returns true if the page enumeration should be started or is not yet complete.
1930func (page AuthorizationListResultPage) NotDone() bool {
1931	return !page.alr.IsEmpty()
1932}
1933
1934// Response returns the raw server response from the last page request.
1935func (page AuthorizationListResultPage) Response() AuthorizationListResult {
1936	return page.alr
1937}
1938
1939// Values returns the slice of values for the current page or nil if there are no values.
1940func (page AuthorizationListResultPage) Values() []ExpressRouteCircuitAuthorization {
1941	if page.alr.IsEmpty() {
1942		return nil
1943	}
1944	return *page.alr.Value
1945}
1946
1947// Creates a new instance of the AuthorizationListResultPage type.
1948func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage func(context.Context, AuthorizationListResult) (AuthorizationListResult, error)) AuthorizationListResultPage {
1949	return AuthorizationListResultPage{
1950		fn:  getNextPage,
1951		alr: cur,
1952	}
1953}
1954
1955// AuthorizationPropertiesFormat ...
1956type AuthorizationPropertiesFormat struct {
1957	// AuthorizationKey - The authorization key.
1958	AuthorizationKey *string `json:"authorizationKey,omitempty"`
1959	// AuthorizationUseStatus - AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. Possible values include: 'Available', 'InUse'
1960	AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"`
1961	// ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
1962	ProvisioningState *string `json:"provisioningState,omitempty"`
1963}
1964
1965// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation,
1966// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct
1967// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous
1968// operation succeeded, the response body includes the HTTP status code for the successful request. If the
1969// asynchronous operation failed, the response body includes the HTTP status code for the failed request
1970// and error information regarding the failure.
1971type AzureAsyncOperationResult struct {
1972	// Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed'
1973	Status OperationStatus `json:"status,omitempty"`
1974	Error  *Error          `json:"error,omitempty"`
1975}
1976
1977// BackendAddressPool pool of backend IP addresses.
1978type BackendAddressPool struct {
1979	*BackendAddressPoolPropertiesFormat `json:"properties,omitempty"`
1980	// Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource.
1981	Name *string `json:"name,omitempty"`
1982	// Etag - A unique read-only string that changes whenever the resource is updated.
1983	Etag *string `json:"etag,omitempty"`
1984	// ID - Resource ID.
1985	ID *string `json:"id,omitempty"`
1986}
1987
1988// MarshalJSON is the custom marshaler for BackendAddressPool.
1989func (bap BackendAddressPool) MarshalJSON() ([]byte, error) {
1990	objectMap := make(map[string]interface{})
1991	if bap.BackendAddressPoolPropertiesFormat != nil {
1992		objectMap["properties"] = bap.BackendAddressPoolPropertiesFormat
1993	}
1994	if bap.Name != nil {
1995		objectMap["name"] = bap.Name
1996	}
1997	if bap.Etag != nil {
1998		objectMap["etag"] = bap.Etag
1999	}
2000	if bap.ID != nil {
2001		objectMap["id"] = bap.ID
2002	}
2003	return json.Marshal(objectMap)
2004}
2005
2006// UnmarshalJSON is the custom unmarshaler for BackendAddressPool struct.
2007func (bap *BackendAddressPool) UnmarshalJSON(body []byte) error {
2008	var m map[string]*json.RawMessage
2009	err := json.Unmarshal(body, &m)
2010	if err != nil {
2011		return err
2012	}
2013	for k, v := range m {
2014		switch k {
2015		case "properties":
2016			if v != nil {
2017				var backendAddressPoolPropertiesFormat BackendAddressPoolPropertiesFormat
2018				err = json.Unmarshal(*v, &backendAddressPoolPropertiesFormat)
2019				if err != nil {
2020					return err
2021				}
2022				bap.BackendAddressPoolPropertiesFormat = &backendAddressPoolPropertiesFormat
2023			}
2024		case "name":
2025			if v != nil {
2026				var name string
2027				err = json.Unmarshal(*v, &name)
2028				if err != nil {
2029					return err
2030				}
2031				bap.Name = &name
2032			}
2033		case "etag":
2034			if v != nil {
2035				var etag string
2036				err = json.Unmarshal(*v, &etag)
2037				if err != nil {
2038					return err
2039				}
2040				bap.Etag = &etag
2041			}
2042		case "id":
2043			if v != nil {
2044				var ID string
2045				err = json.Unmarshal(*v, &ID)
2046				if err != nil {
2047					return err
2048				}
2049				bap.ID = &ID
2050			}
2051		}
2052	}
2053
2054	return nil
2055}
2056
2057// BackendAddressPoolPropertiesFormat properties of the backend address pool.
2058type BackendAddressPoolPropertiesFormat struct {
2059	// BackendIPConfigurations - READ-ONLY; Gets collection of references to IP addresses defined in network interfaces.
2060	BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
2061	// LoadBalancingRules - READ-ONLY; Gets load balancing rules that use this backend address pool.
2062	LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
2063	// OutboundNatRule - READ-ONLY; Gets outbound rules that use this backend address pool.
2064	OutboundNatRule *SubResource `json:"outboundNatRule,omitempty"`
2065	// ProvisioningState - Get provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
2066	ProvisioningState *string `json:"provisioningState,omitempty"`
2067}
2068
2069// MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat.
2070func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) {
2071	objectMap := make(map[string]interface{})
2072	if bappf.ProvisioningState != nil {
2073		objectMap["provisioningState"] = bappf.ProvisioningState
2074	}
2075	return json.Marshal(objectMap)
2076}
2077
2078// BGPCommunity contains bgp community information offered in Service Community resources.
2079type BGPCommunity struct {
2080	// ServiceSupportedRegion - The region which the service support. e.g. For O365, region is Global.
2081	ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"`
2082	// CommunityName - The name of the bgp community. e.g. Skype.
2083	CommunityName *string `json:"communityName,omitempty"`
2084	// CommunityValue - The value of the bgp community. For more information: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing.
2085	CommunityValue *string `json:"communityValue,omitempty"`
2086	// CommunityPrefixes - The prefixes that the bgp community contains.
2087	CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"`
2088}
2089
2090// BgpPeerStatus ...
2091type BgpPeerStatus struct {
2092	// LocalAddress - READ-ONLY; The virtual network gateway's local address
2093	LocalAddress *string `json:"localAddress,omitempty"`
2094	// Neighbor - READ-ONLY; The remote BGP peer
2095	Neighbor *string `json:"neighbor,omitempty"`
2096	// Asn - READ-ONLY; The autonomous system number of the remote BGP peer
2097	Asn *int32 `json:"asn,omitempty"`
2098	// State - READ-ONLY; The BGP peer state. Possible values include: 'BgpPeerStateUnknown', 'BgpPeerStateStopped', 'BgpPeerStateIdle', 'BgpPeerStateConnecting', 'BgpPeerStateConnected'
2099	State BgpPeerState `json:"state,omitempty"`
2100	// ConnectedDuration - READ-ONLY; For how long the peering has been up
2101	ConnectedDuration *string `json:"connectedDuration,omitempty"`
2102	// RoutesReceived - READ-ONLY; The number of routes learned from this peer
2103	RoutesReceived *int64 `json:"routesReceived,omitempty"`
2104	// MessagesSent - READ-ONLY; The number of BGP messages sent
2105	MessagesSent *int64 `json:"messagesSent,omitempty"`
2106	// MessagesReceived - READ-ONLY; The number of BGP messages received
2107	MessagesReceived *int64 `json:"messagesReceived,omitempty"`
2108}
2109
2110// MarshalJSON is the custom marshaler for BgpPeerStatus.
2111func (bps BgpPeerStatus) MarshalJSON() ([]byte, error) {
2112	objectMap := make(map[string]interface{})
2113	return json.Marshal(objectMap)
2114}
2115
2116// BgpPeerStatusListResult response for list BGP peer status API service call
2117type BgpPeerStatusListResult struct {
2118	autorest.Response `json:"-"`
2119	// Value - List of BGP peers
2120	Value *[]BgpPeerStatus `json:"value,omitempty"`
2121}
2122
2123// BgpServiceCommunity service Community Properties.
2124type BgpServiceCommunity struct {
2125	*BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"`
2126	// ID - Resource ID.
2127	ID *string `json:"id,omitempty"`
2128	// Name - READ-ONLY; Resource name.
2129	Name *string `json:"name,omitempty"`
2130	// Type - READ-ONLY; Resource type.
2131	Type *string `json:"type,omitempty"`
2132	// Location - Resource location.
2133	Location *string `json:"location,omitempty"`
2134	// Tags - Resource tags.
2135	Tags map[string]*string `json:"tags"`
2136}
2137
2138// MarshalJSON is the custom marshaler for BgpServiceCommunity.
2139func (bsc BgpServiceCommunity) MarshalJSON() ([]byte, error) {
2140	objectMap := make(map[string]interface{})
2141	if bsc.BgpServiceCommunityPropertiesFormat != nil {
2142		objectMap["properties"] = bsc.BgpServiceCommunityPropertiesFormat
2143	}
2144	if bsc.ID != nil {
2145		objectMap["id"] = bsc.ID
2146	}
2147	if bsc.Location != nil {
2148		objectMap["location"] = bsc.Location
2149	}
2150	if bsc.Tags != nil {
2151		objectMap["tags"] = bsc.Tags
2152	}
2153	return json.Marshal(objectMap)
2154}
2155
2156// UnmarshalJSON is the custom unmarshaler for BgpServiceCommunity struct.
2157func (bsc *BgpServiceCommunity) UnmarshalJSON(body []byte) error {
2158	var m map[string]*json.RawMessage
2159	err := json.Unmarshal(body, &m)
2160	if err != nil {
2161		return err
2162	}
2163	for k, v := range m {
2164		switch k {
2165		case "properties":
2166			if v != nil {
2167				var bgpServiceCommunityPropertiesFormat BgpServiceCommunityPropertiesFormat
2168				err = json.Unmarshal(*v, &bgpServiceCommunityPropertiesFormat)
2169				if err != nil {
2170					return err
2171				}
2172				bsc.BgpServiceCommunityPropertiesFormat = &bgpServiceCommunityPropertiesFormat
2173			}
2174		case "id":
2175			if v != nil {
2176				var ID string
2177				err = json.Unmarshal(*v, &ID)
2178				if err != nil {
2179					return err
2180				}
2181				bsc.ID = &ID
2182			}
2183		case "name":
2184			if v != nil {
2185				var name string
2186				err = json.Unmarshal(*v, &name)
2187				if err != nil {
2188					return err
2189				}
2190				bsc.Name = &name
2191			}
2192		case "type":
2193			if v != nil {
2194				var typeVar string
2195				err = json.Unmarshal(*v, &typeVar)
2196				if err != nil {
2197					return err
2198				}
2199				bsc.Type = &typeVar
2200			}
2201		case "location":
2202			if v != nil {
2203				var location string
2204				err = json.Unmarshal(*v, &location)
2205				if err != nil {
2206					return err
2207				}
2208				bsc.Location = &location
2209			}
2210		case "tags":
2211			if v != nil {
2212				var tags map[string]*string
2213				err = json.Unmarshal(*v, &tags)
2214				if err != nil {
2215					return err
2216				}
2217				bsc.Tags = tags
2218			}
2219		}
2220	}
2221
2222	return nil
2223}
2224
2225// BgpServiceCommunityListResult response for the ListServiceCommunity API service call.
2226type BgpServiceCommunityListResult struct {
2227	autorest.Response `json:"-"`
2228	// Value - A list of service community resources.
2229	Value *[]BgpServiceCommunity `json:"value,omitempty"`
2230	// NextLink - The URL to get the next set of results.
2231	NextLink *string `json:"nextLink,omitempty"`
2232}
2233
2234// BgpServiceCommunityListResultIterator provides access to a complete listing of BgpServiceCommunity
2235// values.
2236type BgpServiceCommunityListResultIterator struct {
2237	i    int
2238	page BgpServiceCommunityListResultPage
2239}
2240
2241// NextWithContext advances to the next value.  If there was an error making
2242// the request the iterator does not advance and the error is returned.
2243func (iter *BgpServiceCommunityListResultIterator) NextWithContext(ctx context.Context) (err error) {
2244	if tracing.IsEnabled() {
2245		ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultIterator.NextWithContext")
2246		defer func() {
2247			sc := -1
2248			if iter.Response().Response.Response != nil {
2249				sc = iter.Response().Response.Response.StatusCode
2250			}
2251			tracing.EndSpan(ctx, sc, err)
2252		}()
2253	}
2254	iter.i++
2255	if iter.i < len(iter.page.Values()) {
2256		return nil
2257	}
2258	err = iter.page.NextWithContext(ctx)
2259	if err != nil {
2260		iter.i--
2261		return err
2262	}
2263	iter.i = 0
2264	return nil
2265}
2266
2267// Next advances to the next value.  If there was an error making
2268// the request the iterator does not advance and the error is returned.
2269// Deprecated: Use NextWithContext() instead.
2270func (iter *BgpServiceCommunityListResultIterator) Next() error {
2271	return iter.NextWithContext(context.Background())
2272}
2273
2274// NotDone returns true if the enumeration should be started or is not yet complete.
2275func (iter BgpServiceCommunityListResultIterator) NotDone() bool {
2276	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2277}
2278
2279// Response returns the raw server response from the last page request.
2280func (iter BgpServiceCommunityListResultIterator) Response() BgpServiceCommunityListResult {
2281	return iter.page.Response()
2282}
2283
2284// Value returns the current value or a zero-initialized value if the
2285// iterator has advanced beyond the end of the collection.
2286func (iter BgpServiceCommunityListResultIterator) Value() BgpServiceCommunity {
2287	if !iter.page.NotDone() {
2288		return BgpServiceCommunity{}
2289	}
2290	return iter.page.Values()[iter.i]
2291}
2292
2293// Creates a new instance of the BgpServiceCommunityListResultIterator type.
2294func NewBgpServiceCommunityListResultIterator(page BgpServiceCommunityListResultPage) BgpServiceCommunityListResultIterator {
2295	return BgpServiceCommunityListResultIterator{page: page}
2296}
2297
2298// IsEmpty returns true if the ListResult contains no values.
2299func (bsclr BgpServiceCommunityListResult) IsEmpty() bool {
2300	return bsclr.Value == nil || len(*bsclr.Value) == 0
2301}
2302
2303// hasNextLink returns true if the NextLink is not empty.
2304func (bsclr BgpServiceCommunityListResult) hasNextLink() bool {
2305	return bsclr.NextLink != nil && len(*bsclr.NextLink) != 0
2306}
2307
2308// bgpServiceCommunityListResultPreparer prepares a request to retrieve the next set of results.
2309// It returns nil if no more results exist.
2310func (bsclr BgpServiceCommunityListResult) bgpServiceCommunityListResultPreparer(ctx context.Context) (*http.Request, error) {
2311	if !bsclr.hasNextLink() {
2312		return nil, nil
2313	}
2314	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2315		autorest.AsJSON(),
2316		autorest.AsGet(),
2317		autorest.WithBaseURL(to.String(bsclr.NextLink)))
2318}
2319
2320// BgpServiceCommunityListResultPage contains a page of BgpServiceCommunity values.
2321type BgpServiceCommunityListResultPage struct {
2322	fn    func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)
2323	bsclr BgpServiceCommunityListResult
2324}
2325
2326// NextWithContext advances to the next page of values.  If there was an error making
2327// the request the page does not advance and the error is returned.
2328func (page *BgpServiceCommunityListResultPage) NextWithContext(ctx context.Context) (err error) {
2329	if tracing.IsEnabled() {
2330		ctx = tracing.StartSpan(ctx, fqdn+"/BgpServiceCommunityListResultPage.NextWithContext")
2331		defer func() {
2332			sc := -1
2333			if page.Response().Response.Response != nil {
2334				sc = page.Response().Response.Response.StatusCode
2335			}
2336			tracing.EndSpan(ctx, sc, err)
2337		}()
2338	}
2339	for {
2340		next, err := page.fn(ctx, page.bsclr)
2341		if err != nil {
2342			return err
2343		}
2344		page.bsclr = next
2345		if !next.hasNextLink() || !next.IsEmpty() {
2346			break
2347		}
2348	}
2349	return nil
2350}
2351
2352// Next advances to the next page of values.  If there was an error making
2353// the request the page does not advance and the error is returned.
2354// Deprecated: Use NextWithContext() instead.
2355func (page *BgpServiceCommunityListResultPage) Next() error {
2356	return page.NextWithContext(context.Background())
2357}
2358
2359// NotDone returns true if the page enumeration should be started or is not yet complete.
2360func (page BgpServiceCommunityListResultPage) NotDone() bool {
2361	return !page.bsclr.IsEmpty()
2362}
2363
2364// Response returns the raw server response from the last page request.
2365func (page BgpServiceCommunityListResultPage) Response() BgpServiceCommunityListResult {
2366	return page.bsclr
2367}
2368
2369// Values returns the slice of values for the current page or nil if there are no values.
2370func (page BgpServiceCommunityListResultPage) Values() []BgpServiceCommunity {
2371	if page.bsclr.IsEmpty() {
2372		return nil
2373	}
2374	return *page.bsclr.Value
2375}
2376
2377// Creates a new instance of the BgpServiceCommunityListResultPage type.
2378func NewBgpServiceCommunityListResultPage(cur BgpServiceCommunityListResult, getNextPage func(context.Context, BgpServiceCommunityListResult) (BgpServiceCommunityListResult, error)) BgpServiceCommunityListResultPage {
2379	return BgpServiceCommunityListResultPage{
2380		fn:    getNextPage,
2381		bsclr: cur,
2382	}
2383}
2384
2385// BgpServiceCommunityPropertiesFormat properties of Service Community.
2386type BgpServiceCommunityPropertiesFormat struct {
2387	// ServiceName - The name of the bgp community. e.g. Skype.
2388	ServiceName *string `json:"serviceName,omitempty"`
2389	// BgpCommunities - Get a list of bgp communities.
2390	BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"`
2391}
2392
2393// BgpSettings ...
2394type BgpSettings struct {
2395	// Asn - The BGP speaker's ASN.
2396	Asn *int64 `json:"asn,omitempty"`
2397	// BgpPeeringAddress - The BGP peering address and BGP identifier of this BGP speaker.
2398	BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"`
2399	// PeerWeight - The weight added to routes learned from this BGP speaker.
2400	PeerWeight *int32 `json:"peerWeight,omitempty"`
2401}
2402
2403// ConnectionResetSharedKey ...
2404type ConnectionResetSharedKey struct {
2405	autorest.Response `json:"-"`
2406	// KeyLength - The virtual network connection reset shared key length, should between 1 and 128.
2407	KeyLength *int32 `json:"keyLength,omitempty"`
2408}
2409
2410// ConnectionSharedKey response for GetConnectionSharedKey API service call
2411type ConnectionSharedKey struct {
2412	autorest.Response `json:"-"`
2413	// Value - The virtual network connection shared key value.
2414	Value *string `json:"value,omitempty"`
2415}
2416
2417// DhcpOptions dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual
2418// network. Standard DHCP option for a subnet overrides VNET DHCP options.
2419type DhcpOptions struct {
2420	// DNSServers - The list of DNS servers IP addresses.
2421	DNSServers *[]string `json:"dnsServers,omitempty"`
2422}
2423
2424// DNSNameAvailabilityResult response for the CheckDnsNameAvailability API service call.
2425type DNSNameAvailabilityResult struct {
2426	autorest.Response `json:"-"`
2427	// Available - Domain availability (True/False).
2428	Available *bool `json:"available,omitempty"`
2429}
2430
2431// EffectiveNetworkSecurityGroup effective network security group.
2432type EffectiveNetworkSecurityGroup struct {
2433	// NetworkSecurityGroup - The ID of network security group that is applied.
2434	NetworkSecurityGroup *SubResource                              `json:"networkSecurityGroup,omitempty"`
2435	Association          *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"`
2436	// EffectiveSecurityRules - A collection of effective security rules.
2437	EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"`
2438}
2439
2440// EffectiveNetworkSecurityGroupAssociation the effective network security group association.
2441type EffectiveNetworkSecurityGroupAssociation struct {
2442	// Subnet - The ID of the subnet if assigned.
2443	Subnet *SubResource `json:"subnet,omitempty"`
2444	// NetworkInterface - The ID of the network interface if assigned.
2445	NetworkInterface *SubResource `json:"networkInterface,omitempty"`
2446}
2447
2448// EffectiveNetworkSecurityGroupListResult response for list effective network security groups API service
2449// call.
2450type EffectiveNetworkSecurityGroupListResult struct {
2451	autorest.Response `json:"-"`
2452	// Value - A list of effective network security groups.
2453	Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"`
2454	// NextLink - The URL to get the next set of results.
2455	NextLink *string `json:"nextLink,omitempty"`
2456}
2457
2458// EffectiveNetworkSecurityRule effective network security rules.
2459type EffectiveNetworkSecurityRule struct {
2460	// Name - The name of the security rule specified by the user (if created by the user).
2461	Name *string `json:"name,omitempty"`
2462	// Protocol - The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and '*'. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolAsterisk'
2463	Protocol SecurityRuleProtocol `json:"protocol,omitempty"`
2464	// SourcePortRange - The source port or range.
2465	SourcePortRange *string `json:"sourcePortRange,omitempty"`
2466	// DestinationPortRange - The destination port or range.
2467	DestinationPortRange *string `json:"destinationPortRange,omitempty"`
2468	// SourceAddressPrefix - The source address prefix.
2469	SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
2470	// DestinationAddressPrefix - The destination address prefix.
2471	DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"`
2472	// ExpandedSourceAddressPrefix - The expanded source address prefix.
2473	ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"`
2474	// ExpandedDestinationAddressPrefix - Expanded destination address prefix.
2475	ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"`
2476	// Access - Whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny'
2477	Access SecurityRuleAccess `json:"access,omitempty"`
2478	// Priority - The priority of the rule.
2479	Priority *int32 `json:"priority,omitempty"`
2480	// Direction - The direction of the rule. Possible values are: 'Inbound and Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound'
2481	Direction SecurityRuleDirection `json:"direction,omitempty"`
2482}
2483
2484// EffectiveRoute effective Route
2485type EffectiveRoute struct {
2486	// Name - The name of the user defined route. This is optional.
2487	Name *string `json:"name,omitempty"`
2488	// Source - Who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and 'Default'. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault'
2489	Source EffectiveRouteSource `json:"source,omitempty"`
2490	// State - The value of effective route. Possible values are: 'Active' and 'Invalid'. Possible values include: 'Active', 'Invalid'
2491	State EffectiveRouteState `json:"state,omitempty"`
2492	// AddressPrefix - The address prefixes of the effective routes in CIDR notation.
2493	AddressPrefix *[]string `json:"addressPrefix,omitempty"`
2494	// NextHopIPAddress - The IP address of the next hop of the effective route.
2495	NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"`
2496	// 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'
2497	NextHopType RouteNextHopType `json:"nextHopType,omitempty"`
2498}
2499
2500// EffectiveRouteListResult response for list effective route API service call.
2501type EffectiveRouteListResult struct {
2502	autorest.Response `json:"-"`
2503	// Value - A list of effective routes.
2504	Value *[]EffectiveRoute `json:"value,omitempty"`
2505	// NextLink - The URL to get the next set of results.
2506	NextLink *string `json:"nextLink,omitempty"`
2507}
2508
2509// Error ...
2510type Error struct {
2511	Code       *string         `json:"code,omitempty"`
2512	Message    *string         `json:"message,omitempty"`
2513	Target     *string         `json:"target,omitempty"`
2514	Details    *[]ErrorDetails `json:"details,omitempty"`
2515	InnerError *string         `json:"innerError,omitempty"`
2516}
2517
2518// ErrorDetails ...
2519type ErrorDetails struct {
2520	Code    *string `json:"code,omitempty"`
2521	Target  *string `json:"target,omitempty"`
2522	Message *string `json:"message,omitempty"`
2523}
2524
2525// ExpressRouteCircuit expressRouteCircuit resource
2526type ExpressRouteCircuit struct {
2527	autorest.Response `json:"-"`
2528	// Sku - The SKU.
2529	Sku                                  *ExpressRouteCircuitSku `json:"sku,omitempty"`
2530	*ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"`
2531	// Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated.
2532	Etag *string `json:"etag,omitempty"`
2533	// ID - Resource ID.
2534	ID *string `json:"id,omitempty"`
2535	// Name - READ-ONLY; Resource name.
2536	Name *string `json:"name,omitempty"`
2537	// Type - READ-ONLY; Resource type.
2538	Type *string `json:"type,omitempty"`
2539	// Location - Resource location.
2540	Location *string `json:"location,omitempty"`
2541	// Tags - Resource tags.
2542	Tags map[string]*string `json:"tags"`
2543}
2544
2545// MarshalJSON is the custom marshaler for ExpressRouteCircuit.
2546func (erc ExpressRouteCircuit) MarshalJSON() ([]byte, error) {
2547	objectMap := make(map[string]interface{})
2548	if erc.Sku != nil {
2549		objectMap["sku"] = erc.Sku
2550	}
2551	if erc.ExpressRouteCircuitPropertiesFormat != nil {
2552		objectMap["properties"] = erc.ExpressRouteCircuitPropertiesFormat
2553	}
2554	if erc.ID != nil {
2555		objectMap["id"] = erc.ID
2556	}
2557	if erc.Location != nil {
2558		objectMap["location"] = erc.Location
2559	}
2560	if erc.Tags != nil {
2561		objectMap["tags"] = erc.Tags
2562	}
2563	return json.Marshal(objectMap)
2564}
2565
2566// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuit struct.
2567func (erc *ExpressRouteCircuit) UnmarshalJSON(body []byte) error {
2568	var m map[string]*json.RawMessage
2569	err := json.Unmarshal(body, &m)
2570	if err != nil {
2571		return err
2572	}
2573	for k, v := range m {
2574		switch k {
2575		case "sku":
2576			if v != nil {
2577				var sku ExpressRouteCircuitSku
2578				err = json.Unmarshal(*v, &sku)
2579				if err != nil {
2580					return err
2581				}
2582				erc.Sku = &sku
2583			}
2584		case "properties":
2585			if v != nil {
2586				var expressRouteCircuitPropertiesFormat ExpressRouteCircuitPropertiesFormat
2587				err = json.Unmarshal(*v, &expressRouteCircuitPropertiesFormat)
2588				if err != nil {
2589					return err
2590				}
2591				erc.ExpressRouteCircuitPropertiesFormat = &expressRouteCircuitPropertiesFormat
2592			}
2593		case "etag":
2594			if v != nil {
2595				var etag string
2596				err = json.Unmarshal(*v, &etag)
2597				if err != nil {
2598					return err
2599				}
2600				erc.Etag = &etag
2601			}
2602		case "id":
2603			if v != nil {
2604				var ID string
2605				err = json.Unmarshal(*v, &ID)
2606				if err != nil {
2607					return err
2608				}
2609				erc.ID = &ID
2610			}
2611		case "name":
2612			if v != nil {
2613				var name string
2614				err = json.Unmarshal(*v, &name)
2615				if err != nil {
2616					return err
2617				}
2618				erc.Name = &name
2619			}
2620		case "type":
2621			if v != nil {
2622				var typeVar string
2623				err = json.Unmarshal(*v, &typeVar)
2624				if err != nil {
2625					return err
2626				}
2627				erc.Type = &typeVar
2628			}
2629		case "location":
2630			if v != nil {
2631				var location string
2632				err = json.Unmarshal(*v, &location)
2633				if err != nil {
2634					return err
2635				}
2636				erc.Location = &location
2637			}
2638		case "tags":
2639			if v != nil {
2640				var tags map[string]*string
2641				err = json.Unmarshal(*v, &tags)
2642				if err != nil {
2643					return err
2644				}
2645				erc.Tags = tags
2646			}
2647		}
2648	}
2649
2650	return nil
2651}
2652
2653// ExpressRouteCircuitArpTable the ARP table associated with the ExpressRouteCircuit.
2654type ExpressRouteCircuitArpTable struct {
2655	// Age - Age
2656	Age *int32 `json:"age,omitempty"`
2657	// Interface - Interface
2658	Interface *string `json:"interface,omitempty"`
2659	// IPAddress - The IP address.
2660	IPAddress *string `json:"ipAddress,omitempty"`
2661	// MacAddress - The MAC address.
2662	MacAddress *string `json:"macAddress,omitempty"`
2663}
2664
2665// ExpressRouteCircuitAuthorization authorization in an ExpressRouteCircuit resource.
2666type ExpressRouteCircuitAuthorization struct {
2667	autorest.Response              `json:"-"`
2668	*AuthorizationPropertiesFormat `json:"properties,omitempty"`
2669	// Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource.
2670	Name *string `json:"name,omitempty"`
2671	// Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
2672	Etag *string `json:"etag,omitempty"`
2673	// ID - Resource ID.
2674	ID *string `json:"id,omitempty"`
2675}
2676
2677// MarshalJSON is the custom marshaler for ExpressRouteCircuitAuthorization.
2678func (erca ExpressRouteCircuitAuthorization) MarshalJSON() ([]byte, error) {
2679	objectMap := make(map[string]interface{})
2680	if erca.AuthorizationPropertiesFormat != nil {
2681		objectMap["properties"] = erca.AuthorizationPropertiesFormat
2682	}
2683	if erca.Name != nil {
2684		objectMap["name"] = erca.Name
2685	}
2686	if erca.ID != nil {
2687		objectMap["id"] = erca.ID
2688	}
2689	return json.Marshal(objectMap)
2690}
2691
2692// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitAuthorization struct.
2693func (erca *ExpressRouteCircuitAuthorization) UnmarshalJSON(body []byte) error {
2694	var m map[string]*json.RawMessage
2695	err := json.Unmarshal(body, &m)
2696	if err != nil {
2697		return err
2698	}
2699	for k, v := range m {
2700		switch k {
2701		case "properties":
2702			if v != nil {
2703				var authorizationPropertiesFormat AuthorizationPropertiesFormat
2704				err = json.Unmarshal(*v, &authorizationPropertiesFormat)
2705				if err != nil {
2706					return err
2707				}
2708				erca.AuthorizationPropertiesFormat = &authorizationPropertiesFormat
2709			}
2710		case "name":
2711			if v != nil {
2712				var name string
2713				err = json.Unmarshal(*v, &name)
2714				if err != nil {
2715					return err
2716				}
2717				erca.Name = &name
2718			}
2719		case "etag":
2720			if v != nil {
2721				var etag string
2722				err = json.Unmarshal(*v, &etag)
2723				if err != nil {
2724					return err
2725				}
2726				erca.Etag = &etag
2727			}
2728		case "id":
2729			if v != nil {
2730				var ID string
2731				err = json.Unmarshal(*v, &ID)
2732				if err != nil {
2733					return err
2734				}
2735				erca.ID = &ID
2736			}
2737		}
2738	}
2739
2740	return nil
2741}
2742
2743// ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
2744// results of a long-running operation.
2745type ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture struct {
2746	azure.FutureAPI
2747	// Result returns the result of the asynchronous operation.
2748	// If the operation has not completed it will return an error.
2749	Result func(ExpressRouteCircuitAuthorizationsClient) (ExpressRouteCircuitAuthorization, error)
2750}
2751
2752// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2753func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2754	var azFuture azure.Future
2755	if err := json.Unmarshal(body, &azFuture); err != nil {
2756		return err
2757	}
2758	future.FutureAPI = &azFuture
2759	future.Result = future.result
2760	return nil
2761}
2762
2763// result is the default implementation for ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture.Result.
2764func (future *ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture) result(client ExpressRouteCircuitAuthorizationsClient) (erca ExpressRouteCircuitAuthorization, err error) {
2765	var done bool
2766	done, err = future.DoneWithContext(context.Background(), client)
2767	if err != nil {
2768		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2769		return
2770	}
2771	if !done {
2772		erca.Response.Response = future.Response()
2773		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture")
2774		return
2775	}
2776	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2777	if erca.Response.Response, err = future.GetResult(sender); err == nil && erca.Response.Response.StatusCode != http.StatusNoContent {
2778		erca, err = client.CreateOrUpdateResponder(erca.Response.Response)
2779		if err != nil {
2780			err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture", "Result", erca.Response.Response, "Failure responding to request")
2781		}
2782	}
2783	return
2784}
2785
2786// ExpressRouteCircuitAuthorizationsDeleteFuture an abstraction for monitoring and retrieving the results
2787// of a long-running operation.
2788type ExpressRouteCircuitAuthorizationsDeleteFuture struct {
2789	azure.FutureAPI
2790	// Result returns the result of the asynchronous operation.
2791	// If the operation has not completed it will return an error.
2792	Result func(ExpressRouteCircuitAuthorizationsClient) (autorest.Response, error)
2793}
2794
2795// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2796func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) UnmarshalJSON(body []byte) error {
2797	var azFuture azure.Future
2798	if err := json.Unmarshal(body, &azFuture); err != nil {
2799		return err
2800	}
2801	future.FutureAPI = &azFuture
2802	future.Result = future.result
2803	return nil
2804}
2805
2806// result is the default implementation for ExpressRouteCircuitAuthorizationsDeleteFuture.Result.
2807func (future *ExpressRouteCircuitAuthorizationsDeleteFuture) result(client ExpressRouteCircuitAuthorizationsClient) (ar autorest.Response, err error) {
2808	var done bool
2809	done, err = future.DoneWithContext(context.Background(), client)
2810	if err != nil {
2811		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitAuthorizationsDeleteFuture", "Result", future.Response(), "Polling failure")
2812		return
2813	}
2814	if !done {
2815		ar.Response = future.Response()
2816		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitAuthorizationsDeleteFuture")
2817		return
2818	}
2819	ar.Response = future.Response()
2820	return
2821}
2822
2823// ExpressRouteCircuitListResult response for ListExpressRouteCircuit API service call.
2824type ExpressRouteCircuitListResult struct {
2825	autorest.Response `json:"-"`
2826	// Value - A list of ExpressRouteCircuits in a resource group.
2827	Value *[]ExpressRouteCircuit `json:"value,omitempty"`
2828	// NextLink - The URL to get the next set of results.
2829	NextLink *string `json:"nextLink,omitempty"`
2830}
2831
2832// ExpressRouteCircuitListResultIterator provides access to a complete listing of ExpressRouteCircuit
2833// values.
2834type ExpressRouteCircuitListResultIterator struct {
2835	i    int
2836	page ExpressRouteCircuitListResultPage
2837}
2838
2839// NextWithContext advances to the next value.  If there was an error making
2840// the request the iterator does not advance and the error is returned.
2841func (iter *ExpressRouteCircuitListResultIterator) NextWithContext(ctx context.Context) (err error) {
2842	if tracing.IsEnabled() {
2843		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultIterator.NextWithContext")
2844		defer func() {
2845			sc := -1
2846			if iter.Response().Response.Response != nil {
2847				sc = iter.Response().Response.Response.StatusCode
2848			}
2849			tracing.EndSpan(ctx, sc, err)
2850		}()
2851	}
2852	iter.i++
2853	if iter.i < len(iter.page.Values()) {
2854		return nil
2855	}
2856	err = iter.page.NextWithContext(ctx)
2857	if err != nil {
2858		iter.i--
2859		return err
2860	}
2861	iter.i = 0
2862	return nil
2863}
2864
2865// Next advances to the next value.  If there was an error making
2866// the request the iterator does not advance and the error is returned.
2867// Deprecated: Use NextWithContext() instead.
2868func (iter *ExpressRouteCircuitListResultIterator) Next() error {
2869	return iter.NextWithContext(context.Background())
2870}
2871
2872// NotDone returns true if the enumeration should be started or is not yet complete.
2873func (iter ExpressRouteCircuitListResultIterator) NotDone() bool {
2874	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2875}
2876
2877// Response returns the raw server response from the last page request.
2878func (iter ExpressRouteCircuitListResultIterator) Response() ExpressRouteCircuitListResult {
2879	return iter.page.Response()
2880}
2881
2882// Value returns the current value or a zero-initialized value if the
2883// iterator has advanced beyond the end of the collection.
2884func (iter ExpressRouteCircuitListResultIterator) Value() ExpressRouteCircuit {
2885	if !iter.page.NotDone() {
2886		return ExpressRouteCircuit{}
2887	}
2888	return iter.page.Values()[iter.i]
2889}
2890
2891// Creates a new instance of the ExpressRouteCircuitListResultIterator type.
2892func NewExpressRouteCircuitListResultIterator(page ExpressRouteCircuitListResultPage) ExpressRouteCircuitListResultIterator {
2893	return ExpressRouteCircuitListResultIterator{page: page}
2894}
2895
2896// IsEmpty returns true if the ListResult contains no values.
2897func (erclr ExpressRouteCircuitListResult) IsEmpty() bool {
2898	return erclr.Value == nil || len(*erclr.Value) == 0
2899}
2900
2901// hasNextLink returns true if the NextLink is not empty.
2902func (erclr ExpressRouteCircuitListResult) hasNextLink() bool {
2903	return erclr.NextLink != nil && len(*erclr.NextLink) != 0
2904}
2905
2906// expressRouteCircuitListResultPreparer prepares a request to retrieve the next set of results.
2907// It returns nil if no more results exist.
2908func (erclr ExpressRouteCircuitListResult) expressRouteCircuitListResultPreparer(ctx context.Context) (*http.Request, error) {
2909	if !erclr.hasNextLink() {
2910		return nil, nil
2911	}
2912	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2913		autorest.AsJSON(),
2914		autorest.AsGet(),
2915		autorest.WithBaseURL(to.String(erclr.NextLink)))
2916}
2917
2918// ExpressRouteCircuitListResultPage contains a page of ExpressRouteCircuit values.
2919type ExpressRouteCircuitListResultPage struct {
2920	fn    func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)
2921	erclr ExpressRouteCircuitListResult
2922}
2923
2924// NextWithContext advances to the next page of values.  If there was an error making
2925// the request the page does not advance and the error is returned.
2926func (page *ExpressRouteCircuitListResultPage) NextWithContext(ctx context.Context) (err error) {
2927	if tracing.IsEnabled() {
2928		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitListResultPage.NextWithContext")
2929		defer func() {
2930			sc := -1
2931			if page.Response().Response.Response != nil {
2932				sc = page.Response().Response.Response.StatusCode
2933			}
2934			tracing.EndSpan(ctx, sc, err)
2935		}()
2936	}
2937	for {
2938		next, err := page.fn(ctx, page.erclr)
2939		if err != nil {
2940			return err
2941		}
2942		page.erclr = next
2943		if !next.hasNextLink() || !next.IsEmpty() {
2944			break
2945		}
2946	}
2947	return nil
2948}
2949
2950// Next advances to the next page of values.  If there was an error making
2951// the request the page does not advance and the error is returned.
2952// Deprecated: Use NextWithContext() instead.
2953func (page *ExpressRouteCircuitListResultPage) Next() error {
2954	return page.NextWithContext(context.Background())
2955}
2956
2957// NotDone returns true if the page enumeration should be started or is not yet complete.
2958func (page ExpressRouteCircuitListResultPage) NotDone() bool {
2959	return !page.erclr.IsEmpty()
2960}
2961
2962// Response returns the raw server response from the last page request.
2963func (page ExpressRouteCircuitListResultPage) Response() ExpressRouteCircuitListResult {
2964	return page.erclr
2965}
2966
2967// Values returns the slice of values for the current page or nil if there are no values.
2968func (page ExpressRouteCircuitListResultPage) Values() []ExpressRouteCircuit {
2969	if page.erclr.IsEmpty() {
2970		return nil
2971	}
2972	return *page.erclr.Value
2973}
2974
2975// Creates a new instance of the ExpressRouteCircuitListResultPage type.
2976func NewExpressRouteCircuitListResultPage(cur ExpressRouteCircuitListResult, getNextPage func(context.Context, ExpressRouteCircuitListResult) (ExpressRouteCircuitListResult, error)) ExpressRouteCircuitListResultPage {
2977	return ExpressRouteCircuitListResultPage{
2978		fn:    getNextPage,
2979		erclr: cur,
2980	}
2981}
2982
2983// ExpressRouteCircuitPeering peering in an ExpressRouteCircuit resource.
2984type ExpressRouteCircuitPeering struct {
2985	autorest.Response                           `json:"-"`
2986	*ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"`
2987	// Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource.
2988	Name *string `json:"name,omitempty"`
2989	// Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
2990	Etag *string `json:"etag,omitempty"`
2991	// ID - Resource ID.
2992	ID *string `json:"id,omitempty"`
2993}
2994
2995// MarshalJSON is the custom marshaler for ExpressRouteCircuitPeering.
2996func (ercp ExpressRouteCircuitPeering) MarshalJSON() ([]byte, error) {
2997	objectMap := make(map[string]interface{})
2998	if ercp.ExpressRouteCircuitPeeringPropertiesFormat != nil {
2999		objectMap["properties"] = ercp.ExpressRouteCircuitPeeringPropertiesFormat
3000	}
3001	if ercp.Name != nil {
3002		objectMap["name"] = ercp.Name
3003	}
3004	if ercp.ID != nil {
3005		objectMap["id"] = ercp.ID
3006	}
3007	return json.Marshal(objectMap)
3008}
3009
3010// UnmarshalJSON is the custom unmarshaler for ExpressRouteCircuitPeering struct.
3011func (ercp *ExpressRouteCircuitPeering) UnmarshalJSON(body []byte) error {
3012	var m map[string]*json.RawMessage
3013	err := json.Unmarshal(body, &m)
3014	if err != nil {
3015		return err
3016	}
3017	for k, v := range m {
3018		switch k {
3019		case "properties":
3020			if v != nil {
3021				var expressRouteCircuitPeeringPropertiesFormat ExpressRouteCircuitPeeringPropertiesFormat
3022				err = json.Unmarshal(*v, &expressRouteCircuitPeeringPropertiesFormat)
3023				if err != nil {
3024					return err
3025				}
3026				ercp.ExpressRouteCircuitPeeringPropertiesFormat = &expressRouteCircuitPeeringPropertiesFormat
3027			}
3028		case "name":
3029			if v != nil {
3030				var name string
3031				err = json.Unmarshal(*v, &name)
3032				if err != nil {
3033					return err
3034				}
3035				ercp.Name = &name
3036			}
3037		case "etag":
3038			if v != nil {
3039				var etag string
3040				err = json.Unmarshal(*v, &etag)
3041				if err != nil {
3042					return err
3043				}
3044				ercp.Etag = &etag
3045			}
3046		case "id":
3047			if v != nil {
3048				var ID string
3049				err = json.Unmarshal(*v, &ID)
3050				if err != nil {
3051					return err
3052				}
3053				ercp.ID = &ID
3054			}
3055		}
3056	}
3057
3058	return nil
3059}
3060
3061// ExpressRouteCircuitPeeringConfig specifies the peering configuration.
3062type ExpressRouteCircuitPeeringConfig struct {
3063	// AdvertisedPublicPrefixes - The reference of AdvertisedPublicPrefixes.
3064	AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"`
3065	// AdvertisedPublicPrefixesState - AdvertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded'
3066	AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"`
3067	// CustomerASN - The CustomerASN of the peering.
3068	CustomerASN *int32 `json:"customerASN,omitempty"`
3069	// RoutingRegistryName - The RoutingRegistryName of the configuration.
3070	RoutingRegistryName *string `json:"routingRegistryName,omitempty"`
3071}
3072
3073// ExpressRouteCircuitPeeringListResult response for ListPeering API service call retrieves all peerings
3074// that belong to an ExpressRouteCircuit.
3075type ExpressRouteCircuitPeeringListResult struct {
3076	autorest.Response `json:"-"`
3077	// Value - The peerings in an express route circuit.
3078	Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"`
3079	// NextLink - The URL to get the next set of results.
3080	NextLink *string `json:"nextLink,omitempty"`
3081}
3082
3083// ExpressRouteCircuitPeeringListResultIterator provides access to a complete listing of
3084// ExpressRouteCircuitPeering values.
3085type ExpressRouteCircuitPeeringListResultIterator struct {
3086	i    int
3087	page ExpressRouteCircuitPeeringListResultPage
3088}
3089
3090// NextWithContext advances to the next value.  If there was an error making
3091// the request the iterator does not advance and the error is returned.
3092func (iter *ExpressRouteCircuitPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) {
3093	if tracing.IsEnabled() {
3094		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultIterator.NextWithContext")
3095		defer func() {
3096			sc := -1
3097			if iter.Response().Response.Response != nil {
3098				sc = iter.Response().Response.Response.StatusCode
3099			}
3100			tracing.EndSpan(ctx, sc, err)
3101		}()
3102	}
3103	iter.i++
3104	if iter.i < len(iter.page.Values()) {
3105		return nil
3106	}
3107	err = iter.page.NextWithContext(ctx)
3108	if err != nil {
3109		iter.i--
3110		return err
3111	}
3112	iter.i = 0
3113	return nil
3114}
3115
3116// Next advances to the next value.  If there was an error making
3117// the request the iterator does not advance and the error is returned.
3118// Deprecated: Use NextWithContext() instead.
3119func (iter *ExpressRouteCircuitPeeringListResultIterator) Next() error {
3120	return iter.NextWithContext(context.Background())
3121}
3122
3123// NotDone returns true if the enumeration should be started or is not yet complete.
3124func (iter ExpressRouteCircuitPeeringListResultIterator) NotDone() bool {
3125	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3126}
3127
3128// Response returns the raw server response from the last page request.
3129func (iter ExpressRouteCircuitPeeringListResultIterator) Response() ExpressRouteCircuitPeeringListResult {
3130	return iter.page.Response()
3131}
3132
3133// Value returns the current value or a zero-initialized value if the
3134// iterator has advanced beyond the end of the collection.
3135func (iter ExpressRouteCircuitPeeringListResultIterator) Value() ExpressRouteCircuitPeering {
3136	if !iter.page.NotDone() {
3137		return ExpressRouteCircuitPeering{}
3138	}
3139	return iter.page.Values()[iter.i]
3140}
3141
3142// Creates a new instance of the ExpressRouteCircuitPeeringListResultIterator type.
3143func NewExpressRouteCircuitPeeringListResultIterator(page ExpressRouteCircuitPeeringListResultPage) ExpressRouteCircuitPeeringListResultIterator {
3144	return ExpressRouteCircuitPeeringListResultIterator{page: page}
3145}
3146
3147// IsEmpty returns true if the ListResult contains no values.
3148func (ercplr ExpressRouteCircuitPeeringListResult) IsEmpty() bool {
3149	return ercplr.Value == nil || len(*ercplr.Value) == 0
3150}
3151
3152// hasNextLink returns true if the NextLink is not empty.
3153func (ercplr ExpressRouteCircuitPeeringListResult) hasNextLink() bool {
3154	return ercplr.NextLink != nil && len(*ercplr.NextLink) != 0
3155}
3156
3157// expressRouteCircuitPeeringListResultPreparer prepares a request to retrieve the next set of results.
3158// It returns nil if no more results exist.
3159func (ercplr ExpressRouteCircuitPeeringListResult) expressRouteCircuitPeeringListResultPreparer(ctx context.Context) (*http.Request, error) {
3160	if !ercplr.hasNextLink() {
3161		return nil, nil
3162	}
3163	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3164		autorest.AsJSON(),
3165		autorest.AsGet(),
3166		autorest.WithBaseURL(to.String(ercplr.NextLink)))
3167}
3168
3169// ExpressRouteCircuitPeeringListResultPage contains a page of ExpressRouteCircuitPeering values.
3170type ExpressRouteCircuitPeeringListResultPage struct {
3171	fn     func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)
3172	ercplr ExpressRouteCircuitPeeringListResult
3173}
3174
3175// NextWithContext advances to the next page of values.  If there was an error making
3176// the request the page does not advance and the error is returned.
3177func (page *ExpressRouteCircuitPeeringListResultPage) NextWithContext(ctx context.Context) (err error) {
3178	if tracing.IsEnabled() {
3179		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteCircuitPeeringListResultPage.NextWithContext")
3180		defer func() {
3181			sc := -1
3182			if page.Response().Response.Response != nil {
3183				sc = page.Response().Response.Response.StatusCode
3184			}
3185			tracing.EndSpan(ctx, sc, err)
3186		}()
3187	}
3188	for {
3189		next, err := page.fn(ctx, page.ercplr)
3190		if err != nil {
3191			return err
3192		}
3193		page.ercplr = next
3194		if !next.hasNextLink() || !next.IsEmpty() {
3195			break
3196		}
3197	}
3198	return nil
3199}
3200
3201// Next advances to the next page of values.  If there was an error making
3202// the request the page does not advance and the error is returned.
3203// Deprecated: Use NextWithContext() instead.
3204func (page *ExpressRouteCircuitPeeringListResultPage) Next() error {
3205	return page.NextWithContext(context.Background())
3206}
3207
3208// NotDone returns true if the page enumeration should be started or is not yet complete.
3209func (page ExpressRouteCircuitPeeringListResultPage) NotDone() bool {
3210	return !page.ercplr.IsEmpty()
3211}
3212
3213// Response returns the raw server response from the last page request.
3214func (page ExpressRouteCircuitPeeringListResultPage) Response() ExpressRouteCircuitPeeringListResult {
3215	return page.ercplr
3216}
3217
3218// Values returns the slice of values for the current page or nil if there are no values.
3219func (page ExpressRouteCircuitPeeringListResultPage) Values() []ExpressRouteCircuitPeering {
3220	if page.ercplr.IsEmpty() {
3221		return nil
3222	}
3223	return *page.ercplr.Value
3224}
3225
3226// Creates a new instance of the ExpressRouteCircuitPeeringListResultPage type.
3227func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringListResult, getNextPage func(context.Context, ExpressRouteCircuitPeeringListResult) (ExpressRouteCircuitPeeringListResult, error)) ExpressRouteCircuitPeeringListResultPage {
3228	return ExpressRouteCircuitPeeringListResultPage{
3229		fn:     getNextPage,
3230		ercplr: cur,
3231	}
3232}
3233
3234// ExpressRouteCircuitPeeringPropertiesFormat ...
3235type ExpressRouteCircuitPeeringPropertiesFormat struct {
3236	// PeeringType - The PeeringType. Possible values are: 'AzurePublicPeering', 'AzurePrivatePeering', and 'MicrosoftPeering'. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering'
3237	PeeringType ExpressRouteCircuitPeeringType `json:"peeringType,omitempty"`
3238	// State - The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible values include: 'ExpressRouteCircuitPeeringStateDisabled', 'ExpressRouteCircuitPeeringStateEnabled'
3239	State ExpressRouteCircuitPeeringState `json:"state,omitempty"`
3240	// AzureASN - The Azure ASN.
3241	AzureASN *int32 `json:"azureASN,omitempty"`
3242	// PeerASN - The peer ASN.
3243	PeerASN *int32 `json:"peerASN,omitempty"`
3244	// PrimaryPeerAddressPrefix - The primary address prefix.
3245	PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"`
3246	// SecondaryPeerAddressPrefix - The secondary address prefix.
3247	SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"`
3248	// PrimaryAzurePort - The primary port.
3249	PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"`
3250	// SecondaryAzurePort - The secondary port.
3251	SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"`
3252	// SharedKey - The shared key.
3253	SharedKey *string `json:"sharedKey,omitempty"`
3254	// VlanID - The VLAN ID.
3255	VlanID *int32 `json:"vlanId,omitempty"`
3256	// MicrosoftPeeringConfig - The Microsoft peering configuration.
3257	MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"`
3258	// Stats - Gets peering stats.
3259	Stats *ExpressRouteCircuitStats `json:"stats,omitempty"`
3260	// ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
3261	ProvisioningState *string `json:"provisioningState,omitempty"`
3262	// GatewayManagerEtag - The GatewayManager Etag.
3263	GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"`
3264	// LastModifiedBy - Gets whether the provider or the customer last modified the peering.
3265	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
3266	// RouteFilter - The reference of the RouteFilter resource.
3267	RouteFilter *RouteFilter `json:"routeFilter,omitempty"`
3268}
3269
3270// ExpressRouteCircuitPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
3271// of a long-running operation.
3272type ExpressRouteCircuitPeeringsCreateOrUpdateFuture struct {
3273	azure.FutureAPI
3274	// Result returns the result of the asynchronous operation.
3275	// If the operation has not completed it will return an error.
3276	Result func(ExpressRouteCircuitPeeringsClient) (ExpressRouteCircuitPeering, error)
3277}
3278
3279// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3280func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3281	var azFuture azure.Future
3282	if err := json.Unmarshal(body, &azFuture); err != nil {
3283		return err
3284	}
3285	future.FutureAPI = &azFuture
3286	future.Result = future.result
3287	return nil
3288}
3289
3290// result is the default implementation for ExpressRouteCircuitPeeringsCreateOrUpdateFuture.Result.
3291func (future *ExpressRouteCircuitPeeringsCreateOrUpdateFuture) result(client ExpressRouteCircuitPeeringsClient) (ercp ExpressRouteCircuitPeering, err error) {
3292	var done bool
3293	done, err = future.DoneWithContext(context.Background(), client)
3294	if err != nil {
3295		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3296		return
3297	}
3298	if !done {
3299		ercp.Response.Response = future.Response()
3300		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture")
3301		return
3302	}
3303	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3304	if ercp.Response.Response, err = future.GetResult(sender); err == nil && ercp.Response.Response.StatusCode != http.StatusNoContent {
3305		ercp, err = client.CreateOrUpdateResponder(ercp.Response.Response)
3306		if err != nil {
3307			err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsCreateOrUpdateFuture", "Result", ercp.Response.Response, "Failure responding to request")
3308		}
3309	}
3310	return
3311}
3312
3313// ExpressRouteCircuitPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a
3314// long-running operation.
3315type ExpressRouteCircuitPeeringsDeleteFuture struct {
3316	azure.FutureAPI
3317	// Result returns the result of the asynchronous operation.
3318	// If the operation has not completed it will return an error.
3319	Result func(ExpressRouteCircuitPeeringsClient) (autorest.Response, error)
3320}
3321
3322// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3323func (future *ExpressRouteCircuitPeeringsDeleteFuture) UnmarshalJSON(body []byte) error {
3324	var azFuture azure.Future
3325	if err := json.Unmarshal(body, &azFuture); err != nil {
3326		return err
3327	}
3328	future.FutureAPI = &azFuture
3329	future.Result = future.result
3330	return nil
3331}
3332
3333// result is the default implementation for ExpressRouteCircuitPeeringsDeleteFuture.Result.
3334func (future *ExpressRouteCircuitPeeringsDeleteFuture) result(client ExpressRouteCircuitPeeringsClient) (ar autorest.Response, err error) {
3335	var done bool
3336	done, err = future.DoneWithContext(context.Background(), client)
3337	if err != nil {
3338		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
3339		return
3340	}
3341	if !done {
3342		ar.Response = future.Response()
3343		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitPeeringsDeleteFuture")
3344		return
3345	}
3346	ar.Response = future.Response()
3347	return
3348}
3349
3350// ExpressRouteCircuitPropertiesFormat properties of ExpressRouteCircuit.
3351type ExpressRouteCircuitPropertiesFormat struct {
3352	// AllowClassicOperations - Allow classic operations
3353	AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"`
3354	// CircuitProvisioningState - The CircuitProvisioningState state of the resource.
3355	CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"`
3356	// ServiceProviderProvisioningState - The ServiceProviderProvisioningState state of the resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. Possible values include: 'NotProvisioned', 'Provisioning', 'Provisioned', 'Deprovisioning'
3357	ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"`
3358	// Authorizations - The list of authorizations.
3359	Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"`
3360	// Peerings - The list of peerings.
3361	Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"`
3362	// ServiceKey - The ServiceKey.
3363	ServiceKey *string `json:"serviceKey,omitempty"`
3364	// ServiceProviderNotes - The ServiceProviderNotes.
3365	ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"`
3366	// ServiceProviderProperties - The ServiceProviderProperties.
3367	ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"`
3368	// ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
3369	ProvisioningState *string `json:"provisioningState,omitempty"`
3370	// GatewayManagerEtag - The GatewayManager Etag.
3371	GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"`
3372}
3373
3374// ExpressRouteCircuitRoutesTable the routes table associated with the ExpressRouteCircuit
3375type ExpressRouteCircuitRoutesTable struct {
3376	// NetworkProperty - network
3377	NetworkProperty *string `json:"network,omitempty"`
3378	// NextHop - nextHop
3379	NextHop *string `json:"nextHop,omitempty"`
3380	// LocPrf - locPrf
3381	LocPrf *string `json:"locPrf,omitempty"`
3382	// Weight - weight.
3383	Weight *int32 `json:"weight,omitempty"`
3384	// Path - path
3385	Path *string `json:"path,omitempty"`
3386}
3387
3388// ExpressRouteCircuitRoutesTableSummary the routes table associated with the ExpressRouteCircuit.
3389type ExpressRouteCircuitRoutesTableSummary struct {
3390	// Neighbor - Neighbor
3391	Neighbor *string `json:"neighbor,omitempty"`
3392	// V - BGP version number spoken to the neighbor.
3393	V *int32 `json:"v,omitempty"`
3394	// As - Autonomous system number.
3395	As *int32 `json:"as,omitempty"`
3396	// 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.
3397	UpDown *string `json:"upDown,omitempty"`
3398	// StatePfxRcd - Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer group.
3399	StatePfxRcd *string `json:"statePfxRcd,omitempty"`
3400}
3401
3402// ExpressRouteCircuitsArpTableListResult response for ListArpTable associated with the Express Route
3403// Circuits API.
3404type ExpressRouteCircuitsArpTableListResult struct {
3405	autorest.Response `json:"-"`
3406	// Value - Gets list of the ARP table.
3407	Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"`
3408	// NextLink - The URL to get the next set of results.
3409	NextLink *string `json:"nextLink,omitempty"`
3410}
3411
3412// ExpressRouteCircuitsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
3413// long-running operation.
3414type ExpressRouteCircuitsCreateOrUpdateFuture struct {
3415	azure.FutureAPI
3416	// Result returns the result of the asynchronous operation.
3417	// If the operation has not completed it will return an error.
3418	Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuit, error)
3419}
3420
3421// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3422func (future *ExpressRouteCircuitsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3423	var azFuture azure.Future
3424	if err := json.Unmarshal(body, &azFuture); err != nil {
3425		return err
3426	}
3427	future.FutureAPI = &azFuture
3428	future.Result = future.result
3429	return nil
3430}
3431
3432// result is the default implementation for ExpressRouteCircuitsCreateOrUpdateFuture.Result.
3433func (future *ExpressRouteCircuitsCreateOrUpdateFuture) result(client ExpressRouteCircuitsClient) (erc ExpressRouteCircuit, err error) {
3434	var done bool
3435	done, err = future.DoneWithContext(context.Background(), client)
3436	if err != nil {
3437		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3438		return
3439	}
3440	if !done {
3441		erc.Response.Response = future.Response()
3442		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsCreateOrUpdateFuture")
3443		return
3444	}
3445	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3446	if erc.Response.Response, err = future.GetResult(sender); err == nil && erc.Response.Response.StatusCode != http.StatusNoContent {
3447		erc, err = client.CreateOrUpdateResponder(erc.Response.Response)
3448		if err != nil {
3449			err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsCreateOrUpdateFuture", "Result", erc.Response.Response, "Failure responding to request")
3450		}
3451	}
3452	return
3453}
3454
3455// ExpressRouteCircuitsDeleteFuture an abstraction for monitoring and retrieving the results of a
3456// long-running operation.
3457type ExpressRouteCircuitsDeleteFuture struct {
3458	azure.FutureAPI
3459	// Result returns the result of the asynchronous operation.
3460	// If the operation has not completed it will return an error.
3461	Result func(ExpressRouteCircuitsClient) (autorest.Response, error)
3462}
3463
3464// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3465func (future *ExpressRouteCircuitsDeleteFuture) UnmarshalJSON(body []byte) error {
3466	var azFuture azure.Future
3467	if err := json.Unmarshal(body, &azFuture); err != nil {
3468		return err
3469	}
3470	future.FutureAPI = &azFuture
3471	future.Result = future.result
3472	return nil
3473}
3474
3475// result is the default implementation for ExpressRouteCircuitsDeleteFuture.Result.
3476func (future *ExpressRouteCircuitsDeleteFuture) result(client ExpressRouteCircuitsClient) (ar autorest.Response, err error) {
3477	var done bool
3478	done, err = future.DoneWithContext(context.Background(), client)
3479	if err != nil {
3480		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsDeleteFuture", "Result", future.Response(), "Polling failure")
3481		return
3482	}
3483	if !done {
3484		ar.Response = future.Response()
3485		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsDeleteFuture")
3486		return
3487	}
3488	ar.Response = future.Response()
3489	return
3490}
3491
3492// ExpressRouteCircuitServiceProviderProperties contains ServiceProviderProperties in an
3493// ExpressRouteCircuit.
3494type ExpressRouteCircuitServiceProviderProperties struct {
3495	// ServiceProviderName - The serviceProviderName.
3496	ServiceProviderName *string `json:"serviceProviderName,omitempty"`
3497	// PeeringLocation - The peering location.
3498	PeeringLocation *string `json:"peeringLocation,omitempty"`
3499	// BandwidthInMbps - The BandwidthInMbps.
3500	BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
3501}
3502
3503// ExpressRouteCircuitSku contains SKU in an ExpressRouteCircuit.
3504type ExpressRouteCircuitSku struct {
3505	// Name - The name of the SKU.
3506	Name *string `json:"name,omitempty"`
3507	// Tier - The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium'
3508	Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"`
3509	// Family - The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. Possible values include: 'UnlimitedData', 'MeteredData'
3510	Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"`
3511}
3512
3513// ExpressRouteCircuitsListArpTableFuture an abstraction for monitoring and retrieving the results of a
3514// long-running operation.
3515type ExpressRouteCircuitsListArpTableFuture struct {
3516	azure.FutureAPI
3517	// Result returns the result of the asynchronous operation.
3518	// If the operation has not completed it will return an error.
3519	Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsArpTableListResult, error)
3520}
3521
3522// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3523func (future *ExpressRouteCircuitsListArpTableFuture) UnmarshalJSON(body []byte) error {
3524	var azFuture azure.Future
3525	if err := json.Unmarshal(body, &azFuture); err != nil {
3526		return err
3527	}
3528	future.FutureAPI = &azFuture
3529	future.Result = future.result
3530	return nil
3531}
3532
3533// result is the default implementation for ExpressRouteCircuitsListArpTableFuture.Result.
3534func (future *ExpressRouteCircuitsListArpTableFuture) result(client ExpressRouteCircuitsClient) (ercatlr ExpressRouteCircuitsArpTableListResult, err error) {
3535	var done bool
3536	done, err = future.DoneWithContext(context.Background(), client)
3537	if err != nil {
3538		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", future.Response(), "Polling failure")
3539		return
3540	}
3541	if !done {
3542		ercatlr.Response.Response = future.Response()
3543		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListArpTableFuture")
3544		return
3545	}
3546	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3547	if ercatlr.Response.Response, err = future.GetResult(sender); err == nil && ercatlr.Response.Response.StatusCode != http.StatusNoContent {
3548		ercatlr, err = client.ListArpTableResponder(ercatlr.Response.Response)
3549		if err != nil {
3550			err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListArpTableFuture", "Result", ercatlr.Response.Response, "Failure responding to request")
3551		}
3552	}
3553	return
3554}
3555
3556// ExpressRouteCircuitsListRoutesTableFuture an abstraction for monitoring and retrieving the results of a
3557// long-running operation.
3558type ExpressRouteCircuitsListRoutesTableFuture struct {
3559	azure.FutureAPI
3560	// Result returns the result of the asynchronous operation.
3561	// If the operation has not completed it will return an error.
3562	Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableListResult, error)
3563}
3564
3565// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3566func (future *ExpressRouteCircuitsListRoutesTableFuture) UnmarshalJSON(body []byte) error {
3567	var azFuture azure.Future
3568	if err := json.Unmarshal(body, &azFuture); err != nil {
3569		return err
3570	}
3571	future.FutureAPI = &azFuture
3572	future.Result = future.result
3573	return nil
3574}
3575
3576// result is the default implementation for ExpressRouteCircuitsListRoutesTableFuture.Result.
3577func (future *ExpressRouteCircuitsListRoutesTableFuture) result(client ExpressRouteCircuitsClient) (ercrtlr ExpressRouteCircuitsRoutesTableListResult, err error) {
3578	var done bool
3579	done, err = future.DoneWithContext(context.Background(), client)
3580	if err != nil {
3581		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", future.Response(), "Polling failure")
3582		return
3583	}
3584	if !done {
3585		ercrtlr.Response.Response = future.Response()
3586		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableFuture")
3587		return
3588	}
3589	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3590	if ercrtlr.Response.Response, err = future.GetResult(sender); err == nil && ercrtlr.Response.Response.StatusCode != http.StatusNoContent {
3591		ercrtlr, err = client.ListRoutesTableResponder(ercrtlr.Response.Response)
3592		if err != nil {
3593			err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableFuture", "Result", ercrtlr.Response.Response, "Failure responding to request")
3594		}
3595	}
3596	return
3597}
3598
3599// ExpressRouteCircuitsListRoutesTableSummaryFuture an abstraction for monitoring and retrieving the
3600// results of a long-running operation.
3601type ExpressRouteCircuitsListRoutesTableSummaryFuture struct {
3602	azure.FutureAPI
3603	// Result returns the result of the asynchronous operation.
3604	// If the operation has not completed it will return an error.
3605	Result func(ExpressRouteCircuitsClient) (ExpressRouteCircuitsRoutesTableSummaryListResult, error)
3606}
3607
3608// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3609func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) UnmarshalJSON(body []byte) error {
3610	var azFuture azure.Future
3611	if err := json.Unmarshal(body, &azFuture); err != nil {
3612		return err
3613	}
3614	future.FutureAPI = &azFuture
3615	future.Result = future.result
3616	return nil
3617}
3618
3619// result is the default implementation for ExpressRouteCircuitsListRoutesTableSummaryFuture.Result.
3620func (future *ExpressRouteCircuitsListRoutesTableSummaryFuture) result(client ExpressRouteCircuitsClient) (ercrtslr ExpressRouteCircuitsRoutesTableSummaryListResult, err error) {
3621	var done bool
3622	done, err = future.DoneWithContext(context.Background(), client)
3623	if err != nil {
3624		err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", future.Response(), "Polling failure")
3625		return
3626	}
3627	if !done {
3628		ercrtslr.Response.Response = future.Response()
3629		err = azure.NewAsyncOpIncompleteError("network.ExpressRouteCircuitsListRoutesTableSummaryFuture")
3630		return
3631	}
3632	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3633	if ercrtslr.Response.Response, err = future.GetResult(sender); err == nil && ercrtslr.Response.Response.StatusCode != http.StatusNoContent {
3634		ercrtslr, err = client.ListRoutesTableSummaryResponder(ercrtslr.Response.Response)
3635		if err != nil {
3636			err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsListRoutesTableSummaryFuture", "Result", ercrtslr.Response.Response, "Failure responding to request")
3637		}
3638	}
3639	return
3640}
3641
3642// ExpressRouteCircuitsRoutesTableListResult response for ListRoutesTable associated with the Express Route
3643// Circuits API.
3644type ExpressRouteCircuitsRoutesTableListResult struct {
3645	autorest.Response `json:"-"`
3646	// Value - The list of routes table.
3647	Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"`
3648	// NextLink - The URL to get the next set of results.
3649	NextLink *string `json:"nextLink,omitempty"`
3650}
3651
3652// ExpressRouteCircuitsRoutesTableSummaryListResult response for ListRoutesTable associated with the
3653// Express Route Circuits API.
3654type ExpressRouteCircuitsRoutesTableSummaryListResult struct {
3655	autorest.Response `json:"-"`
3656	// Value - A list of the routes table.
3657	Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"`
3658	// NextLink - The URL to get the next set of results.
3659	NextLink *string `json:"nextLink,omitempty"`
3660}
3661
3662// ExpressRouteCircuitStats contains stats associated with the peering.
3663type ExpressRouteCircuitStats struct {
3664	autorest.Response `json:"-"`
3665	// PrimarybytesIn - Gets BytesIn of the peering.
3666	PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"`
3667	// PrimarybytesOut - Gets BytesOut of the peering.
3668	PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"`
3669	// SecondarybytesIn - Gets BytesIn of the peering.
3670	SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"`
3671	// SecondarybytesOut - Gets BytesOut of the peering.
3672	SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"`
3673}
3674
3675// ExpressRouteServiceProvider a ExpressRouteResourceProvider object.
3676type ExpressRouteServiceProvider struct {
3677	*ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"`
3678	// ID - Resource ID.
3679	ID *string `json:"id,omitempty"`
3680	// Name - READ-ONLY; Resource name.
3681	Name *string `json:"name,omitempty"`
3682	// Type - READ-ONLY; Resource type.
3683	Type *string `json:"type,omitempty"`
3684	// Location - Resource location.
3685	Location *string `json:"location,omitempty"`
3686	// Tags - Resource tags.
3687	Tags map[string]*string `json:"tags"`
3688}
3689
3690// MarshalJSON is the custom marshaler for ExpressRouteServiceProvider.
3691func (ersp ExpressRouteServiceProvider) MarshalJSON() ([]byte, error) {
3692	objectMap := make(map[string]interface{})
3693	if ersp.ExpressRouteServiceProviderPropertiesFormat != nil {
3694		objectMap["properties"] = ersp.ExpressRouteServiceProviderPropertiesFormat
3695	}
3696	if ersp.ID != nil {
3697		objectMap["id"] = ersp.ID
3698	}
3699	if ersp.Location != nil {
3700		objectMap["location"] = ersp.Location
3701	}
3702	if ersp.Tags != nil {
3703		objectMap["tags"] = ersp.Tags
3704	}
3705	return json.Marshal(objectMap)
3706}
3707
3708// UnmarshalJSON is the custom unmarshaler for ExpressRouteServiceProvider struct.
3709func (ersp *ExpressRouteServiceProvider) UnmarshalJSON(body []byte) error {
3710	var m map[string]*json.RawMessage
3711	err := json.Unmarshal(body, &m)
3712	if err != nil {
3713		return err
3714	}
3715	for k, v := range m {
3716		switch k {
3717		case "properties":
3718			if v != nil {
3719				var expressRouteServiceProviderPropertiesFormat ExpressRouteServiceProviderPropertiesFormat
3720				err = json.Unmarshal(*v, &expressRouteServiceProviderPropertiesFormat)
3721				if err != nil {
3722					return err
3723				}
3724				ersp.ExpressRouteServiceProviderPropertiesFormat = &expressRouteServiceProviderPropertiesFormat
3725			}
3726		case "id":
3727			if v != nil {
3728				var ID string
3729				err = json.Unmarshal(*v, &ID)
3730				if err != nil {
3731					return err
3732				}
3733				ersp.ID = &ID
3734			}
3735		case "name":
3736			if v != nil {
3737				var name string
3738				err = json.Unmarshal(*v, &name)
3739				if err != nil {
3740					return err
3741				}
3742				ersp.Name = &name
3743			}
3744		case "type":
3745			if v != nil {
3746				var typeVar string
3747				err = json.Unmarshal(*v, &typeVar)
3748				if err != nil {
3749					return err
3750				}
3751				ersp.Type = &typeVar
3752			}
3753		case "location":
3754			if v != nil {
3755				var location string
3756				err = json.Unmarshal(*v, &location)
3757				if err != nil {
3758					return err
3759				}
3760				ersp.Location = &location
3761			}
3762		case "tags":
3763			if v != nil {
3764				var tags map[string]*string
3765				err = json.Unmarshal(*v, &tags)
3766				if err != nil {
3767					return err
3768				}
3769				ersp.Tags = tags
3770			}
3771		}
3772	}
3773
3774	return nil
3775}
3776
3777// ExpressRouteServiceProviderBandwidthsOffered contains bandwidths offered in ExpressRouteServiceProvider
3778// resources.
3779type ExpressRouteServiceProviderBandwidthsOffered struct {
3780	// OfferName - The OfferName.
3781	OfferName *string `json:"offerName,omitempty"`
3782	// ValueInMbps - The ValueInMbps.
3783	ValueInMbps *int32 `json:"valueInMbps,omitempty"`
3784}
3785
3786// ExpressRouteServiceProviderListResult response for the ListExpressRouteServiceProvider API service call.
3787type ExpressRouteServiceProviderListResult struct {
3788	autorest.Response `json:"-"`
3789	// Value - A list of ExpressRouteResourceProvider resources.
3790	Value *[]ExpressRouteServiceProvider `json:"value,omitempty"`
3791	// NextLink - The URL to get the next set of results.
3792	NextLink *string `json:"nextLink,omitempty"`
3793}
3794
3795// ExpressRouteServiceProviderListResultIterator provides access to a complete listing of
3796// ExpressRouteServiceProvider values.
3797type ExpressRouteServiceProviderListResultIterator struct {
3798	i    int
3799	page ExpressRouteServiceProviderListResultPage
3800}
3801
3802// NextWithContext advances to the next value.  If there was an error making
3803// the request the iterator does not advance and the error is returned.
3804func (iter *ExpressRouteServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) {
3805	if tracing.IsEnabled() {
3806		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultIterator.NextWithContext")
3807		defer func() {
3808			sc := -1
3809			if iter.Response().Response.Response != nil {
3810				sc = iter.Response().Response.Response.StatusCode
3811			}
3812			tracing.EndSpan(ctx, sc, err)
3813		}()
3814	}
3815	iter.i++
3816	if iter.i < len(iter.page.Values()) {
3817		return nil
3818	}
3819	err = iter.page.NextWithContext(ctx)
3820	if err != nil {
3821		iter.i--
3822		return err
3823	}
3824	iter.i = 0
3825	return nil
3826}
3827
3828// Next advances to the next value.  If there was an error making
3829// the request the iterator does not advance and the error is returned.
3830// Deprecated: Use NextWithContext() instead.
3831func (iter *ExpressRouteServiceProviderListResultIterator) Next() error {
3832	return iter.NextWithContext(context.Background())
3833}
3834
3835// NotDone returns true if the enumeration should be started or is not yet complete.
3836func (iter ExpressRouteServiceProviderListResultIterator) NotDone() bool {
3837	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3838}
3839
3840// Response returns the raw server response from the last page request.
3841func (iter ExpressRouteServiceProviderListResultIterator) Response() ExpressRouteServiceProviderListResult {
3842	return iter.page.Response()
3843}
3844
3845// Value returns the current value or a zero-initialized value if the
3846// iterator has advanced beyond the end of the collection.
3847func (iter ExpressRouteServiceProviderListResultIterator) Value() ExpressRouteServiceProvider {
3848	if !iter.page.NotDone() {
3849		return ExpressRouteServiceProvider{}
3850	}
3851	return iter.page.Values()[iter.i]
3852}
3853
3854// Creates a new instance of the ExpressRouteServiceProviderListResultIterator type.
3855func NewExpressRouteServiceProviderListResultIterator(page ExpressRouteServiceProviderListResultPage) ExpressRouteServiceProviderListResultIterator {
3856	return ExpressRouteServiceProviderListResultIterator{page: page}
3857}
3858
3859// IsEmpty returns true if the ListResult contains no values.
3860func (ersplr ExpressRouteServiceProviderListResult) IsEmpty() bool {
3861	return ersplr.Value == nil || len(*ersplr.Value) == 0
3862}
3863
3864// hasNextLink returns true if the NextLink is not empty.
3865func (ersplr ExpressRouteServiceProviderListResult) hasNextLink() bool {
3866	return ersplr.NextLink != nil && len(*ersplr.NextLink) != 0
3867}
3868
3869// expressRouteServiceProviderListResultPreparer prepares a request to retrieve the next set of results.
3870// It returns nil if no more results exist.
3871func (ersplr ExpressRouteServiceProviderListResult) expressRouteServiceProviderListResultPreparer(ctx context.Context) (*http.Request, error) {
3872	if !ersplr.hasNextLink() {
3873		return nil, nil
3874	}
3875	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3876		autorest.AsJSON(),
3877		autorest.AsGet(),
3878		autorest.WithBaseURL(to.String(ersplr.NextLink)))
3879}
3880
3881// ExpressRouteServiceProviderListResultPage contains a page of ExpressRouteServiceProvider values.
3882type ExpressRouteServiceProviderListResultPage struct {
3883	fn     func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)
3884	ersplr ExpressRouteServiceProviderListResult
3885}
3886
3887// NextWithContext advances to the next page of values.  If there was an error making
3888// the request the page does not advance and the error is returned.
3889func (page *ExpressRouteServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) {
3890	if tracing.IsEnabled() {
3891		ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteServiceProviderListResultPage.NextWithContext")
3892		defer func() {
3893			sc := -1
3894			if page.Response().Response.Response != nil {
3895				sc = page.Response().Response.Response.StatusCode
3896			}
3897			tracing.EndSpan(ctx, sc, err)
3898		}()
3899	}
3900	for {
3901		next, err := page.fn(ctx, page.ersplr)
3902		if err != nil {
3903			return err
3904		}
3905		page.ersplr = next
3906		if !next.hasNextLink() || !next.IsEmpty() {
3907			break
3908		}
3909	}
3910	return nil
3911}
3912
3913// Next advances to the next page of values.  If there was an error making
3914// the request the page does not advance and the error is returned.
3915// Deprecated: Use NextWithContext() instead.
3916func (page *ExpressRouteServiceProviderListResultPage) Next() error {
3917	return page.NextWithContext(context.Background())
3918}
3919
3920// NotDone returns true if the page enumeration should be started or is not yet complete.
3921func (page ExpressRouteServiceProviderListResultPage) NotDone() bool {
3922	return !page.ersplr.IsEmpty()
3923}
3924
3925// Response returns the raw server response from the last page request.
3926func (page ExpressRouteServiceProviderListResultPage) Response() ExpressRouteServiceProviderListResult {
3927	return page.ersplr
3928}
3929
3930// Values returns the slice of values for the current page or nil if there are no values.
3931func (page ExpressRouteServiceProviderListResultPage) Values() []ExpressRouteServiceProvider {
3932	if page.ersplr.IsEmpty() {
3933		return nil
3934	}
3935	return *page.ersplr.Value
3936}
3937
3938// Creates a new instance of the ExpressRouteServiceProviderListResultPage type.
3939func NewExpressRouteServiceProviderListResultPage(cur ExpressRouteServiceProviderListResult, getNextPage func(context.Context, ExpressRouteServiceProviderListResult) (ExpressRouteServiceProviderListResult, error)) ExpressRouteServiceProviderListResultPage {
3940	return ExpressRouteServiceProviderListResultPage{
3941		fn:     getNextPage,
3942		ersplr: cur,
3943	}
3944}
3945
3946// ExpressRouteServiceProviderPropertiesFormat properties of ExpressRouteServiceProvider.
3947type ExpressRouteServiceProviderPropertiesFormat struct {
3948	// PeeringLocations - Get a list of peering locations.
3949	PeeringLocations *[]string `json:"peeringLocations,omitempty"`
3950	// BandwidthsOffered - Gets bandwidths offered.
3951	BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"`
3952	// ProvisioningState - Gets the provisioning state of the resource.
3953	ProvisioningState *string `json:"provisioningState,omitempty"`
3954}
3955
3956// FlowLogInformation information on the configuration of flow log.
3957type FlowLogInformation struct {
3958	autorest.Response `json:"-"`
3959	// TargetResourceID - The ID of the resource to configure for flow logging.
3960	TargetResourceID   *string `json:"targetResourceId,omitempty"`
3961	*FlowLogProperties `json:"properties,omitempty"`
3962}
3963
3964// MarshalJSON is the custom marshaler for FlowLogInformation.
3965func (fli FlowLogInformation) MarshalJSON() ([]byte, error) {
3966	objectMap := make(map[string]interface{})
3967	if fli.TargetResourceID != nil {
3968		objectMap["targetResourceId"] = fli.TargetResourceID
3969	}
3970	if fli.FlowLogProperties != nil {
3971		objectMap["properties"] = fli.FlowLogProperties
3972	}
3973	return json.Marshal(objectMap)
3974}
3975
3976// UnmarshalJSON is the custom unmarshaler for FlowLogInformation struct.
3977func (fli *FlowLogInformation) UnmarshalJSON(body []byte) error {
3978	var m map[string]*json.RawMessage
3979	err := json.Unmarshal(body, &m)
3980	if err != nil {
3981		return err
3982	}
3983	for k, v := range m {
3984		switch k {
3985		case "targetResourceId":
3986			if v != nil {
3987				var targetResourceID string
3988				err = json.Unmarshal(*v, &targetResourceID)
3989				if err != nil {
3990					return err
3991				}
3992				fli.TargetResourceID = &targetResourceID
3993			}
3994		case "properties":
3995			if v != nil {
3996				var flowLogProperties FlowLogProperties
3997				err = json.Unmarshal(*v, &flowLogProperties)
3998				if err != nil {
3999					return err
4000				}
4001				fli.FlowLogProperties = &flowLogProperties
4002			}
4003		}
4004	}
4005
4006	return nil
4007}
4008
4009// FlowLogProperties parameters that define the configuration of flow log.
4010type FlowLogProperties struct {
4011	// StorageID - ID of the storage account which is used to store the flow log.
4012	StorageID *string `json:"storageId,omitempty"`
4013	// Enabled - Flag to enable/disable flow logging.
4014	Enabled         *bool                      `json:"enabled,omitempty"`
4015	RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"`
4016}
4017
4018// FlowLogStatusParameters parameters that define a resource to query flow log status.
4019type FlowLogStatusParameters struct {
4020	// TargetResourceID - The target resource where getting the flow logging status.
4021	TargetResourceID *string `json:"targetResourceId,omitempty"`
4022}
4023
4024// FrontendIPConfiguration frontend IP address of the load balancer.
4025type FrontendIPConfiguration struct {
4026	*FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"`
4027	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
4028	Name *string `json:"name,omitempty"`
4029	// Etag - A unique read-only string that changes whenever the resource is updated.
4030	Etag *string `json:"etag,omitempty"`
4031	// ID - Resource ID.
4032	ID *string `json:"id,omitempty"`
4033}
4034
4035// MarshalJSON is the custom marshaler for FrontendIPConfiguration.
4036func (fic FrontendIPConfiguration) MarshalJSON() ([]byte, error) {
4037	objectMap := make(map[string]interface{})
4038	if fic.FrontendIPConfigurationPropertiesFormat != nil {
4039		objectMap["properties"] = fic.FrontendIPConfigurationPropertiesFormat
4040	}
4041	if fic.Name != nil {
4042		objectMap["name"] = fic.Name
4043	}
4044	if fic.Etag != nil {
4045		objectMap["etag"] = fic.Etag
4046	}
4047	if fic.ID != nil {
4048		objectMap["id"] = fic.ID
4049	}
4050	return json.Marshal(objectMap)
4051}
4052
4053// UnmarshalJSON is the custom unmarshaler for FrontendIPConfiguration struct.
4054func (fic *FrontendIPConfiguration) UnmarshalJSON(body []byte) error {
4055	var m map[string]*json.RawMessage
4056	err := json.Unmarshal(body, &m)
4057	if err != nil {
4058		return err
4059	}
4060	for k, v := range m {
4061		switch k {
4062		case "properties":
4063			if v != nil {
4064				var frontendIPConfigurationPropertiesFormat FrontendIPConfigurationPropertiesFormat
4065				err = json.Unmarshal(*v, &frontendIPConfigurationPropertiesFormat)
4066				if err != nil {
4067					return err
4068				}
4069				fic.FrontendIPConfigurationPropertiesFormat = &frontendIPConfigurationPropertiesFormat
4070			}
4071		case "name":
4072			if v != nil {
4073				var name string
4074				err = json.Unmarshal(*v, &name)
4075				if err != nil {
4076					return err
4077				}
4078				fic.Name = &name
4079			}
4080		case "etag":
4081			if v != nil {
4082				var etag string
4083				err = json.Unmarshal(*v, &etag)
4084				if err != nil {
4085					return err
4086				}
4087				fic.Etag = &etag
4088			}
4089		case "id":
4090			if v != nil {
4091				var ID string
4092				err = json.Unmarshal(*v, &ID)
4093				if err != nil {
4094					return err
4095				}
4096				fic.ID = &ID
4097			}
4098		}
4099	}
4100
4101	return nil
4102}
4103
4104// FrontendIPConfigurationPropertiesFormat properties of Frontend IP Configuration of the load balancer.
4105type FrontendIPConfigurationPropertiesFormat struct {
4106	// InboundNatRules - READ-ONLY; Read only. Inbound rules URIs that use this frontend IP.
4107	InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"`
4108	// InboundNatPools - READ-ONLY; Read only. Inbound pools URIs that use this frontend IP.
4109	InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"`
4110	// OutboundNatRules - READ-ONLY; Read only. Outbound rules URIs that use this frontend IP.
4111	OutboundNatRules *[]SubResource `json:"outboundNatRules,omitempty"`
4112	// LoadBalancingRules - READ-ONLY; Gets load balancing rules URIs that use this frontend IP.
4113	LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
4114	// PrivateIPAddress - The private IP address of the IP configuration.
4115	PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
4116	// PrivateIPAllocationMethod - The Private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'
4117	PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
4118	// Subnet - The reference of the subnet resource.
4119	Subnet *Subnet `json:"subnet,omitempty"`
4120	// PublicIPAddress - The reference of the Public IP resource.
4121	PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
4122	// ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
4123	ProvisioningState *string `json:"provisioningState,omitempty"`
4124}
4125
4126// MarshalJSON is the custom marshaler for FrontendIPConfigurationPropertiesFormat.
4127func (ficpf FrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
4128	objectMap := make(map[string]interface{})
4129	if ficpf.PrivateIPAddress != nil {
4130		objectMap["privateIPAddress"] = ficpf.PrivateIPAddress
4131	}
4132	if ficpf.PrivateIPAllocationMethod != "" {
4133		objectMap["privateIPAllocationMethod"] = ficpf.PrivateIPAllocationMethod
4134	}
4135	if ficpf.Subnet != nil {
4136		objectMap["subnet"] = ficpf.Subnet
4137	}
4138	if ficpf.PublicIPAddress != nil {
4139		objectMap["publicIPAddress"] = ficpf.PublicIPAddress
4140	}
4141	if ficpf.ProvisioningState != nil {
4142		objectMap["provisioningState"] = ficpf.ProvisioningState
4143	}
4144	return json.Marshal(objectMap)
4145}
4146
4147// GatewayRoute ...
4148type GatewayRoute struct {
4149	// LocalAddress - READ-ONLY; The gateway's local address
4150	LocalAddress *string `json:"localAddress,omitempty"`
4151	// NetworkProperty - READ-ONLY; The route's network prefix
4152	NetworkProperty *string `json:"network,omitempty"`
4153	// NextHop - READ-ONLY; The route's next hop
4154	NextHop *string `json:"nextHop,omitempty"`
4155	// SourcePeer - READ-ONLY; The peer this route was learned from
4156	SourcePeer *string `json:"sourcePeer,omitempty"`
4157	// Origin - READ-ONLY; The source this route was learned from
4158	Origin *string `json:"origin,omitempty"`
4159	// AsPath - READ-ONLY; The route's AS path sequence
4160	AsPath *string `json:"asPath,omitempty"`
4161	// Weight - READ-ONLY; The route's weight
4162	Weight *int32 `json:"weight,omitempty"`
4163}
4164
4165// MarshalJSON is the custom marshaler for GatewayRoute.
4166func (gr GatewayRoute) MarshalJSON() ([]byte, error) {
4167	objectMap := make(map[string]interface{})
4168	return json.Marshal(objectMap)
4169}
4170
4171// GatewayRouteListResult list of virtual network gateway routes
4172type GatewayRouteListResult struct {
4173	autorest.Response `json:"-"`
4174	// Value - List of gateway routes
4175	Value *[]GatewayRoute `json:"value,omitempty"`
4176}
4177
4178// InboundNatPool inbound NAT pool of the load balancer.
4179type InboundNatPool struct {
4180	*InboundNatPoolPropertiesFormat `json:"properties,omitempty"`
4181	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
4182	Name *string `json:"name,omitempty"`
4183	// Etag - A unique read-only string that changes whenever the resource is updated.
4184	Etag *string `json:"etag,omitempty"`
4185	// ID - Resource ID.
4186	ID *string `json:"id,omitempty"`
4187}
4188
4189// MarshalJSON is the custom marshaler for InboundNatPool.
4190func (inp InboundNatPool) MarshalJSON() ([]byte, error) {
4191	objectMap := make(map[string]interface{})
4192	if inp.InboundNatPoolPropertiesFormat != nil {
4193		objectMap["properties"] = inp.InboundNatPoolPropertiesFormat
4194	}
4195	if inp.Name != nil {
4196		objectMap["name"] = inp.Name
4197	}
4198	if inp.Etag != nil {
4199		objectMap["etag"] = inp.Etag
4200	}
4201	if inp.ID != nil {
4202		objectMap["id"] = inp.ID
4203	}
4204	return json.Marshal(objectMap)
4205}
4206
4207// UnmarshalJSON is the custom unmarshaler for InboundNatPool struct.
4208func (inp *InboundNatPool) UnmarshalJSON(body []byte) error {
4209	var m map[string]*json.RawMessage
4210	err := json.Unmarshal(body, &m)
4211	if err != nil {
4212		return err
4213	}
4214	for k, v := range m {
4215		switch k {
4216		case "properties":
4217			if v != nil {
4218				var inboundNatPoolPropertiesFormat InboundNatPoolPropertiesFormat
4219				err = json.Unmarshal(*v, &inboundNatPoolPropertiesFormat)
4220				if err != nil {
4221					return err
4222				}
4223				inp.InboundNatPoolPropertiesFormat = &inboundNatPoolPropertiesFormat
4224			}
4225		case "name":
4226			if v != nil {
4227				var name string
4228				err = json.Unmarshal(*v, &name)
4229				if err != nil {
4230					return err
4231				}
4232				inp.Name = &name
4233			}
4234		case "etag":
4235			if v != nil {
4236				var etag string
4237				err = json.Unmarshal(*v, &etag)
4238				if err != nil {
4239					return err
4240				}
4241				inp.Etag = &etag
4242			}
4243		case "id":
4244			if v != nil {
4245				var ID string
4246				err = json.Unmarshal(*v, &ID)
4247				if err != nil {
4248					return err
4249				}
4250				inp.ID = &ID
4251			}
4252		}
4253	}
4254
4255	return nil
4256}
4257
4258// InboundNatPoolPropertiesFormat properties of Inbound NAT pool.
4259type InboundNatPoolPropertiesFormat struct {
4260	// FrontendIPConfiguration - A reference to frontend IP addresses.
4261	FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
4262	// Protocol - The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP'
4263	Protocol TransportProtocol `json:"protocol,omitempty"`
4264	// 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.
4265	FrontendPortRangeStart *int32 `json:"frontendPortRangeStart,omitempty"`
4266	// 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.
4267	FrontendPortRangeEnd *int32 `json:"frontendPortRangeEnd,omitempty"`
4268	// BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.
4269	BackendPort *int32 `json:"backendPort,omitempty"`
4270	// ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
4271	ProvisioningState *string `json:"provisioningState,omitempty"`
4272}
4273
4274// InboundNatRule inbound NAT rule of the load balancer.
4275type InboundNatRule struct {
4276	*InboundNatRulePropertiesFormat `json:"properties,omitempty"`
4277	// Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource.
4278	Name *string `json:"name,omitempty"`
4279	// Etag - A unique read-only string that changes whenever the resource is updated.
4280	Etag *string `json:"etag,omitempty"`
4281	// ID - Resource ID.
4282	ID *string `json:"id,omitempty"`
4283}
4284
4285// MarshalJSON is the custom marshaler for InboundNatRule.
4286func (inr InboundNatRule) MarshalJSON() ([]byte, error) {
4287	objectMap := make(map[string]interface{})
4288	if inr.InboundNatRulePropertiesFormat != nil {
4289		objectMap["properties"] = inr.InboundNatRulePropertiesFormat
4290	}
4291	if inr.Name != nil {
4292		objectMap["name"] = inr.Name
4293	}
4294	if inr.Etag != nil {
4295		objectMap["etag"] = inr.Etag
4296	}
4297	if inr.ID != nil {
4298		objectMap["id"] = inr.ID
4299	}
4300	return json.Marshal(objectMap)
4301}
4302
4303// UnmarshalJSON is the custom unmarshaler for InboundNatRule struct.
4304func (inr *InboundNatRule) UnmarshalJSON(body []byte) error {
4305	var m map[string]*json.RawMessage
4306	err := json.Unmarshal(body, &m)
4307	if err != nil {
4308		return err
4309	}
4310	for k, v := range m {
4311		switch k {
4312		case "properties":
4313			if v != nil {
4314				var inboundNatRulePropertiesFormat InboundNatRulePropertiesFormat
4315				err = json.Unmarshal(*v, &inboundNatRulePropertiesFormat)
4316				if err != nil {
4317					return err
4318				}
4319				inr.InboundNatRulePropertiesFormat = &inboundNatRulePropertiesFormat
4320			}
4321		case "name":
4322			if v != nil {
4323				var name string
4324				err = json.Unmarshal(*v, &name)
4325				if err != nil {
4326					return err
4327				}
4328				inr.Name = &name
4329			}
4330		case "etag":
4331			if v != nil {
4332				var etag string
4333				err = json.Unmarshal(*v, &etag)
4334				if err != nil {
4335					return err
4336				}
4337				inr.Etag = &etag
4338			}
4339		case "id":
4340			if v != nil {
4341				var ID string
4342				err = json.Unmarshal(*v, &ID)
4343				if err != nil {
4344					return err
4345				}
4346				inr.ID = &ID
4347			}
4348		}
4349	}
4350
4351	return nil
4352}
4353
4354// InboundNatRulePropertiesFormat properties of the inbound NAT rule.
4355type InboundNatRulePropertiesFormat struct {
4356	// FrontendIPConfiguration - A reference to frontend IP addresses.
4357	FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
4358	// BackendIPConfiguration - READ-ONLY; A reference to a private IP address defined on a network interface of a VM. Traffic sent to the frontend port of each of the frontend IP configurations is forwarded to the backed IP.
4359	BackendIPConfiguration *InterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"`
4360	// Protocol - The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP'
4361	Protocol TransportProtocol `json:"protocol,omitempty"`
4362	// 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.
4363	FrontendPort *int32 `json:"frontendPort,omitempty"`
4364	// BackendPort - The port used for the internal endpoint. Acceptable values range from 1 to 65535.
4365	BackendPort *int32 `json:"backendPort,omitempty"`
4366	// 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.
4367	IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
4368	// 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.
4369	EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
4370	// ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
4371	ProvisioningState *string `json:"provisioningState,omitempty"`
4372}
4373
4374// MarshalJSON is the custom marshaler for InboundNatRulePropertiesFormat.
4375func (inrpf InboundNatRulePropertiesFormat) MarshalJSON() ([]byte, error) {
4376	objectMap := make(map[string]interface{})
4377	if inrpf.FrontendIPConfiguration != nil {
4378		objectMap["frontendIPConfiguration"] = inrpf.FrontendIPConfiguration
4379	}
4380	if inrpf.Protocol != "" {
4381		objectMap["protocol"] = inrpf.Protocol
4382	}
4383	if inrpf.FrontendPort != nil {
4384		objectMap["frontendPort"] = inrpf.FrontendPort
4385	}
4386	if inrpf.BackendPort != nil {
4387		objectMap["backendPort"] = inrpf.BackendPort
4388	}
4389	if inrpf.IdleTimeoutInMinutes != nil {
4390		objectMap["idleTimeoutInMinutes"] = inrpf.IdleTimeoutInMinutes
4391	}
4392	if inrpf.EnableFloatingIP != nil {
4393		objectMap["enableFloatingIP"] = inrpf.EnableFloatingIP
4394	}
4395	if inrpf.ProvisioningState != nil {
4396		objectMap["provisioningState"] = inrpf.ProvisioningState
4397	}
4398	return json.Marshal(objectMap)
4399}
4400
4401// Interface a network interface in a resource group.
4402type Interface struct {
4403	autorest.Response          `json:"-"`
4404	*InterfacePropertiesFormat `json:"properties,omitempty"`
4405	// Etag - A unique read-only string that changes whenever the resource is updated.
4406	Etag *string `json:"etag,omitempty"`
4407	// ID - Resource ID.
4408	ID *string `json:"id,omitempty"`
4409	// Name - READ-ONLY; Resource name.
4410	Name *string `json:"name,omitempty"`
4411	// Type - READ-ONLY; Resource type.
4412	Type *string `json:"type,omitempty"`
4413	// Location - Resource location.
4414	Location *string `json:"location,omitempty"`
4415	// Tags - Resource tags.
4416	Tags map[string]*string `json:"tags"`
4417}
4418
4419// MarshalJSON is the custom marshaler for Interface.
4420func (i Interface) MarshalJSON() ([]byte, error) {
4421	objectMap := make(map[string]interface{})
4422	if i.InterfacePropertiesFormat != nil {
4423		objectMap["properties"] = i.InterfacePropertiesFormat
4424	}
4425	if i.Etag != nil {
4426		objectMap["etag"] = i.Etag
4427	}
4428	if i.ID != nil {
4429		objectMap["id"] = i.ID
4430	}
4431	if i.Location != nil {
4432		objectMap["location"] = i.Location
4433	}
4434	if i.Tags != nil {
4435		objectMap["tags"] = i.Tags
4436	}
4437	return json.Marshal(objectMap)
4438}
4439
4440// UnmarshalJSON is the custom unmarshaler for Interface struct.
4441func (i *Interface) UnmarshalJSON(body []byte) error {
4442	var m map[string]*json.RawMessage
4443	err := json.Unmarshal(body, &m)
4444	if err != nil {
4445		return err
4446	}
4447	for k, v := range m {
4448		switch k {
4449		case "properties":
4450			if v != nil {
4451				var interfacePropertiesFormat InterfacePropertiesFormat
4452				err = json.Unmarshal(*v, &interfacePropertiesFormat)
4453				if err != nil {
4454					return err
4455				}
4456				i.InterfacePropertiesFormat = &interfacePropertiesFormat
4457			}
4458		case "etag":
4459			if v != nil {
4460				var etag string
4461				err = json.Unmarshal(*v, &etag)
4462				if err != nil {
4463					return err
4464				}
4465				i.Etag = &etag
4466			}
4467		case "id":
4468			if v != nil {
4469				var ID string
4470				err = json.Unmarshal(*v, &ID)
4471				if err != nil {
4472					return err
4473				}
4474				i.ID = &ID
4475			}
4476		case "name":
4477			if v != nil {
4478				var name string
4479				err = json.Unmarshal(*v, &name)
4480				if err != nil {
4481					return err
4482				}
4483				i.Name = &name
4484			}
4485		case "type":
4486			if v != nil {
4487				var typeVar string
4488				err = json.Unmarshal(*v, &typeVar)
4489				if err != nil {
4490					return err
4491				}
4492				i.Type = &typeVar
4493			}
4494		case "location":
4495			if v != nil {
4496				var location string
4497				err = json.Unmarshal(*v, &location)
4498				if err != nil {
4499					return err
4500				}
4501				i.Location = &location
4502			}
4503		case "tags":
4504			if v != nil {
4505				var tags map[string]*string
4506				err = json.Unmarshal(*v, &tags)
4507				if err != nil {
4508					return err
4509				}
4510				i.Tags = tags
4511			}
4512		}
4513	}
4514
4515	return nil
4516}
4517
4518// InterfaceAssociation network interface and its custom security rules.
4519type InterfaceAssociation struct {
4520	// ID - READ-ONLY; Network interface ID.
4521	ID *string `json:"id,omitempty"`
4522	// SecurityRules - Collection of custom security rules.
4523	SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
4524}
4525
4526// MarshalJSON is the custom marshaler for InterfaceAssociation.
4527func (ia InterfaceAssociation) MarshalJSON() ([]byte, error) {
4528	objectMap := make(map[string]interface{})
4529	if ia.SecurityRules != nil {
4530		objectMap["securityRules"] = ia.SecurityRules
4531	}
4532	return json.Marshal(objectMap)
4533}
4534
4535// InterfaceDNSSettings DNS settings of a network interface.
4536type InterfaceDNSSettings struct {
4537	// 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.
4538	DNSServers *[]string `json:"dnsServers,omitempty"`
4539	// 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.
4540	AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"`
4541	// InternalDNSNameLabel - Relative DNS name for this NIC used for internal communications between VMs in the same virtual network.
4542	InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"`
4543	// InternalFqdn - Fully qualified DNS name supporting internal communications between VMs in the same virtual network.
4544	InternalFqdn *string `json:"internalFqdn,omitempty"`
4545	// 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.
4546	InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"`
4547}
4548
4549// InterfaceIPConfiguration iPConfiguration in a network interface.
4550type InterfaceIPConfiguration struct {
4551	*InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"`
4552	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
4553	Name *string `json:"name,omitempty"`
4554	// Etag - A unique read-only string that changes whenever the resource is updated.
4555	Etag *string `json:"etag,omitempty"`
4556	// ID - Resource ID.
4557	ID *string `json:"id,omitempty"`
4558}
4559
4560// MarshalJSON is the custom marshaler for InterfaceIPConfiguration.
4561func (iic InterfaceIPConfiguration) MarshalJSON() ([]byte, error) {
4562	objectMap := make(map[string]interface{})
4563	if iic.InterfaceIPConfigurationPropertiesFormat != nil {
4564		objectMap["properties"] = iic.InterfaceIPConfigurationPropertiesFormat
4565	}
4566	if iic.Name != nil {
4567		objectMap["name"] = iic.Name
4568	}
4569	if iic.Etag != nil {
4570		objectMap["etag"] = iic.Etag
4571	}
4572	if iic.ID != nil {
4573		objectMap["id"] = iic.ID
4574	}
4575	return json.Marshal(objectMap)
4576}
4577
4578// UnmarshalJSON is the custom unmarshaler for InterfaceIPConfiguration struct.
4579func (iic *InterfaceIPConfiguration) UnmarshalJSON(body []byte) error {
4580	var m map[string]*json.RawMessage
4581	err := json.Unmarshal(body, &m)
4582	if err != nil {
4583		return err
4584	}
4585	for k, v := range m {
4586		switch k {
4587		case "properties":
4588			if v != nil {
4589				var interfaceIPConfigurationPropertiesFormat InterfaceIPConfigurationPropertiesFormat
4590				err = json.Unmarshal(*v, &interfaceIPConfigurationPropertiesFormat)
4591				if err != nil {
4592					return err
4593				}
4594				iic.InterfaceIPConfigurationPropertiesFormat = &interfaceIPConfigurationPropertiesFormat
4595			}
4596		case "name":
4597			if v != nil {
4598				var name string
4599				err = json.Unmarshal(*v, &name)
4600				if err != nil {
4601					return err
4602				}
4603				iic.Name = &name
4604			}
4605		case "etag":
4606			if v != nil {
4607				var etag string
4608				err = json.Unmarshal(*v, &etag)
4609				if err != nil {
4610					return err
4611				}
4612				iic.Etag = &etag
4613			}
4614		case "id":
4615			if v != nil {
4616				var ID string
4617				err = json.Unmarshal(*v, &ID)
4618				if err != nil {
4619					return err
4620				}
4621				iic.ID = &ID
4622			}
4623		}
4624	}
4625
4626	return nil
4627}
4628
4629// InterfaceIPConfigurationPropertiesFormat properties of IP configuration.
4630type InterfaceIPConfigurationPropertiesFormat struct {
4631	// ApplicationGatewayBackendAddressPools - The reference of ApplicationGatewayBackendAddressPool resource.
4632	ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"`
4633	// LoadBalancerBackendAddressPools - The reference of LoadBalancerBackendAddressPool resource.
4634	LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"`
4635	// LoadBalancerInboundNatRules - A list of references of LoadBalancerInboundNatRules.
4636	LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"`
4637	PrivateIPAddress            *string           `json:"privateIPAddress,omitempty"`
4638	// PrivateIPAllocationMethod - Defines how a private IP address is assigned. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'
4639	PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
4640	// 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'
4641	PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
4642	Subnet                  *Subnet   `json:"subnet,omitempty"`
4643	// Primary - Gets whether this is a primary customer address on the network interface.
4644	Primary           *bool            `json:"primary,omitempty"`
4645	PublicIPAddress   *PublicIPAddress `json:"publicIPAddress,omitempty"`
4646	ProvisioningState *string          `json:"provisioningState,omitempty"`
4647}
4648
4649// InterfaceListResult response for the ListNetworkInterface API service call.
4650type InterfaceListResult struct {
4651	autorest.Response `json:"-"`
4652	// Value - A list of network interfaces in a resource group.
4653	Value *[]Interface `json:"value,omitempty"`
4654	// NextLink - The URL to get the next set of results.
4655	NextLink *string `json:"nextLink,omitempty"`
4656}
4657
4658// InterfaceListResultIterator provides access to a complete listing of Interface values.
4659type InterfaceListResultIterator struct {
4660	i    int
4661	page InterfaceListResultPage
4662}
4663
4664// NextWithContext advances to the next value.  If there was an error making
4665// the request the iterator does not advance and the error is returned.
4666func (iter *InterfaceListResultIterator) NextWithContext(ctx context.Context) (err error) {
4667	if tracing.IsEnabled() {
4668		ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultIterator.NextWithContext")
4669		defer func() {
4670			sc := -1
4671			if iter.Response().Response.Response != nil {
4672				sc = iter.Response().Response.Response.StatusCode
4673			}
4674			tracing.EndSpan(ctx, sc, err)
4675		}()
4676	}
4677	iter.i++
4678	if iter.i < len(iter.page.Values()) {
4679		return nil
4680	}
4681	err = iter.page.NextWithContext(ctx)
4682	if err != nil {
4683		iter.i--
4684		return err
4685	}
4686	iter.i = 0
4687	return nil
4688}
4689
4690// Next advances to the next value.  If there was an error making
4691// the request the iterator does not advance and the error is returned.
4692// Deprecated: Use NextWithContext() instead.
4693func (iter *InterfaceListResultIterator) Next() error {
4694	return iter.NextWithContext(context.Background())
4695}
4696
4697// NotDone returns true if the enumeration should be started or is not yet complete.
4698func (iter InterfaceListResultIterator) NotDone() bool {
4699	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4700}
4701
4702// Response returns the raw server response from the last page request.
4703func (iter InterfaceListResultIterator) Response() InterfaceListResult {
4704	return iter.page.Response()
4705}
4706
4707// Value returns the current value or a zero-initialized value if the
4708// iterator has advanced beyond the end of the collection.
4709func (iter InterfaceListResultIterator) Value() Interface {
4710	if !iter.page.NotDone() {
4711		return Interface{}
4712	}
4713	return iter.page.Values()[iter.i]
4714}
4715
4716// Creates a new instance of the InterfaceListResultIterator type.
4717func NewInterfaceListResultIterator(page InterfaceListResultPage) InterfaceListResultIterator {
4718	return InterfaceListResultIterator{page: page}
4719}
4720
4721// IsEmpty returns true if the ListResult contains no values.
4722func (ilr InterfaceListResult) IsEmpty() bool {
4723	return ilr.Value == nil || len(*ilr.Value) == 0
4724}
4725
4726// hasNextLink returns true if the NextLink is not empty.
4727func (ilr InterfaceListResult) hasNextLink() bool {
4728	return ilr.NextLink != nil && len(*ilr.NextLink) != 0
4729}
4730
4731// interfaceListResultPreparer prepares a request to retrieve the next set of results.
4732// It returns nil if no more results exist.
4733func (ilr InterfaceListResult) interfaceListResultPreparer(ctx context.Context) (*http.Request, error) {
4734	if !ilr.hasNextLink() {
4735		return nil, nil
4736	}
4737	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4738		autorest.AsJSON(),
4739		autorest.AsGet(),
4740		autorest.WithBaseURL(to.String(ilr.NextLink)))
4741}
4742
4743// InterfaceListResultPage contains a page of Interface values.
4744type InterfaceListResultPage struct {
4745	fn  func(context.Context, InterfaceListResult) (InterfaceListResult, error)
4746	ilr InterfaceListResult
4747}
4748
4749// NextWithContext advances to the next page of values.  If there was an error making
4750// the request the page does not advance and the error is returned.
4751func (page *InterfaceListResultPage) NextWithContext(ctx context.Context) (err error) {
4752	if tracing.IsEnabled() {
4753		ctx = tracing.StartSpan(ctx, fqdn+"/InterfaceListResultPage.NextWithContext")
4754		defer func() {
4755			sc := -1
4756			if page.Response().Response.Response != nil {
4757				sc = page.Response().Response.Response.StatusCode
4758			}
4759			tracing.EndSpan(ctx, sc, err)
4760		}()
4761	}
4762	for {
4763		next, err := page.fn(ctx, page.ilr)
4764		if err != nil {
4765			return err
4766		}
4767		page.ilr = next
4768		if !next.hasNextLink() || !next.IsEmpty() {
4769			break
4770		}
4771	}
4772	return nil
4773}
4774
4775// Next advances to the next page of values.  If there was an error making
4776// the request the page does not advance and the error is returned.
4777// Deprecated: Use NextWithContext() instead.
4778func (page *InterfaceListResultPage) Next() error {
4779	return page.NextWithContext(context.Background())
4780}
4781
4782// NotDone returns true if the page enumeration should be started or is not yet complete.
4783func (page InterfaceListResultPage) NotDone() bool {
4784	return !page.ilr.IsEmpty()
4785}
4786
4787// Response returns the raw server response from the last page request.
4788func (page InterfaceListResultPage) Response() InterfaceListResult {
4789	return page.ilr
4790}
4791
4792// Values returns the slice of values for the current page or nil if there are no values.
4793func (page InterfaceListResultPage) Values() []Interface {
4794	if page.ilr.IsEmpty() {
4795		return nil
4796	}
4797	return *page.ilr.Value
4798}
4799
4800// Creates a new instance of the InterfaceListResultPage type.
4801func NewInterfaceListResultPage(cur InterfaceListResult, getNextPage func(context.Context, InterfaceListResult) (InterfaceListResult, error)) InterfaceListResultPage {
4802	return InterfaceListResultPage{
4803		fn:  getNextPage,
4804		ilr: cur,
4805	}
4806}
4807
4808// InterfacePropertiesFormat networkInterface properties.
4809type InterfacePropertiesFormat struct {
4810	// VirtualMachine - The reference of a virtual machine.
4811	VirtualMachine *SubResource `json:"virtualMachine,omitempty"`
4812	// NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource.
4813	NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
4814	// IPConfigurations - A list of IPConfigurations of the network interface.
4815	IPConfigurations *[]InterfaceIPConfiguration `json:"ipConfigurations,omitempty"`
4816	// DNSSettings - The DNS settings in network interface.
4817	DNSSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"`
4818	// MacAddress - The MAC address of the network interface.
4819	MacAddress *string `json:"macAddress,omitempty"`
4820	// Primary - Gets whether this is a primary network interface on a virtual machine.
4821	Primary *bool `json:"primary,omitempty"`
4822	// EnableAcceleratedNetworking - If the network interface is accelerated networking enabled.
4823	EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"`
4824	// EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface.
4825	EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"`
4826	// ResourceGUID - The resource GUID property of the network interface resource.
4827	ResourceGUID *string `json:"resourceGuid,omitempty"`
4828	// ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
4829	ProvisioningState *string `json:"provisioningState,omitempty"`
4830}
4831
4832// InterfacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
4833// long-running operation.
4834type InterfacesCreateOrUpdateFuture struct {
4835	azure.FutureAPI
4836	// Result returns the result of the asynchronous operation.
4837	// If the operation has not completed it will return an error.
4838	Result func(InterfacesClient) (Interface, error)
4839}
4840
4841// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4842func (future *InterfacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
4843	var azFuture azure.Future
4844	if err := json.Unmarshal(body, &azFuture); err != nil {
4845		return err
4846	}
4847	future.FutureAPI = &azFuture
4848	future.Result = future.result
4849	return nil
4850}
4851
4852// result is the default implementation for InterfacesCreateOrUpdateFuture.Result.
4853func (future *InterfacesCreateOrUpdateFuture) result(client InterfacesClient) (i Interface, err error) {
4854	var done bool
4855	done, err = future.DoneWithContext(context.Background(), client)
4856	if err != nil {
4857		err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
4858		return
4859	}
4860	if !done {
4861		i.Response.Response = future.Response()
4862		err = azure.NewAsyncOpIncompleteError("network.InterfacesCreateOrUpdateFuture")
4863		return
4864	}
4865	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4866	if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
4867		i, err = client.CreateOrUpdateResponder(i.Response.Response)
4868		if err != nil {
4869			err = autorest.NewErrorWithError(err, "network.InterfacesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
4870		}
4871	}
4872	return
4873}
4874
4875// InterfacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
4876// operation.
4877type InterfacesDeleteFuture struct {
4878	azure.FutureAPI
4879	// Result returns the result of the asynchronous operation.
4880	// If the operation has not completed it will return an error.
4881	Result func(InterfacesClient) (autorest.Response, error)
4882}
4883
4884// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4885func (future *InterfacesDeleteFuture) UnmarshalJSON(body []byte) error {
4886	var azFuture azure.Future
4887	if err := json.Unmarshal(body, &azFuture); err != nil {
4888		return err
4889	}
4890	future.FutureAPI = &azFuture
4891	future.Result = future.result
4892	return nil
4893}
4894
4895// result is the default implementation for InterfacesDeleteFuture.Result.
4896func (future *InterfacesDeleteFuture) result(client InterfacesClient) (ar autorest.Response, err error) {
4897	var done bool
4898	done, err = future.DoneWithContext(context.Background(), client)
4899	if err != nil {
4900		err = autorest.NewErrorWithError(err, "network.InterfacesDeleteFuture", "Result", future.Response(), "Polling failure")
4901		return
4902	}
4903	if !done {
4904		ar.Response = future.Response()
4905		err = azure.NewAsyncOpIncompleteError("network.InterfacesDeleteFuture")
4906		return
4907	}
4908	ar.Response = future.Response()
4909	return
4910}
4911
4912// InterfacesGetEffectiveRouteTableFuture an abstraction for monitoring and retrieving the results of a
4913// long-running operation.
4914type InterfacesGetEffectiveRouteTableFuture struct {
4915	azure.FutureAPI
4916	// Result returns the result of the asynchronous operation.
4917	// If the operation has not completed it will return an error.
4918	Result func(InterfacesClient) (EffectiveRouteListResult, error)
4919}
4920
4921// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4922func (future *InterfacesGetEffectiveRouteTableFuture) UnmarshalJSON(body []byte) error {
4923	var azFuture azure.Future
4924	if err := json.Unmarshal(body, &azFuture); err != nil {
4925		return err
4926	}
4927	future.FutureAPI = &azFuture
4928	future.Result = future.result
4929	return nil
4930}
4931
4932// result is the default implementation for InterfacesGetEffectiveRouteTableFuture.Result.
4933func (future *InterfacesGetEffectiveRouteTableFuture) result(client InterfacesClient) (erlr EffectiveRouteListResult, err error) {
4934	var done bool
4935	done, err = future.DoneWithContext(context.Background(), client)
4936	if err != nil {
4937		err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", future.Response(), "Polling failure")
4938		return
4939	}
4940	if !done {
4941		erlr.Response.Response = future.Response()
4942		err = azure.NewAsyncOpIncompleteError("network.InterfacesGetEffectiveRouteTableFuture")
4943		return
4944	}
4945	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4946	if erlr.Response.Response, err = future.GetResult(sender); err == nil && erlr.Response.Response.StatusCode != http.StatusNoContent {
4947		erlr, err = client.GetEffectiveRouteTableResponder(erlr.Response.Response)
4948		if err != nil {
4949			err = autorest.NewErrorWithError(err, "network.InterfacesGetEffectiveRouteTableFuture", "Result", erlr.Response.Response, "Failure responding to request")
4950		}
4951	}
4952	return
4953}
4954
4955// InterfacesListEffectiveNetworkSecurityGroupsFuture an abstraction for monitoring and retrieving the
4956// results of a long-running operation.
4957type InterfacesListEffectiveNetworkSecurityGroupsFuture struct {
4958	azure.FutureAPI
4959	// Result returns the result of the asynchronous operation.
4960	// If the operation has not completed it will return an error.
4961	Result func(InterfacesClient) (EffectiveNetworkSecurityGroupListResult, error)
4962}
4963
4964// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4965func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) UnmarshalJSON(body []byte) error {
4966	var azFuture azure.Future
4967	if err := json.Unmarshal(body, &azFuture); err != nil {
4968		return err
4969	}
4970	future.FutureAPI = &azFuture
4971	future.Result = future.result
4972	return nil
4973}
4974
4975// result is the default implementation for InterfacesListEffectiveNetworkSecurityGroupsFuture.Result.
4976func (future *InterfacesListEffectiveNetworkSecurityGroupsFuture) result(client InterfacesClient) (ensglr EffectiveNetworkSecurityGroupListResult, err error) {
4977	var done bool
4978	done, err = future.DoneWithContext(context.Background(), client)
4979	if err != nil {
4980		err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", future.Response(), "Polling failure")
4981		return
4982	}
4983	if !done {
4984		ensglr.Response.Response = future.Response()
4985		err = azure.NewAsyncOpIncompleteError("network.InterfacesListEffectiveNetworkSecurityGroupsFuture")
4986		return
4987	}
4988	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4989	if ensglr.Response.Response, err = future.GetResult(sender); err == nil && ensglr.Response.Response.StatusCode != http.StatusNoContent {
4990		ensglr, err = client.ListEffectiveNetworkSecurityGroupsResponder(ensglr.Response.Response)
4991		if err != nil {
4992			err = autorest.NewErrorWithError(err, "network.InterfacesListEffectiveNetworkSecurityGroupsFuture", "Result", ensglr.Response.Response, "Failure responding to request")
4993		}
4994	}
4995	return
4996}
4997
4998// IPAddressAvailabilityResult response for CheckIPAddressAvailability API service call
4999type IPAddressAvailabilityResult struct {
5000	autorest.Response `json:"-"`
5001	// Available - Private IP address availability.
5002	Available *bool `json:"available,omitempty"`
5003	// AvailableIPAddresses - Contains other available private IP addresses if the asked for address is taken.
5004	AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"`
5005}
5006
5007// IPConfiguration iPConfiguration
5008type IPConfiguration struct {
5009	*IPConfigurationPropertiesFormat `json:"properties,omitempty"`
5010	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
5011	Name *string `json:"name,omitempty"`
5012	// Etag - A unique read-only string that changes whenever the resource is updated.
5013	Etag *string `json:"etag,omitempty"`
5014	// ID - Resource ID.
5015	ID *string `json:"id,omitempty"`
5016}
5017
5018// MarshalJSON is the custom marshaler for IPConfiguration.
5019func (ic IPConfiguration) MarshalJSON() ([]byte, error) {
5020	objectMap := make(map[string]interface{})
5021	if ic.IPConfigurationPropertiesFormat != nil {
5022		objectMap["properties"] = ic.IPConfigurationPropertiesFormat
5023	}
5024	if ic.Name != nil {
5025		objectMap["name"] = ic.Name
5026	}
5027	if ic.Etag != nil {
5028		objectMap["etag"] = ic.Etag
5029	}
5030	if ic.ID != nil {
5031		objectMap["id"] = ic.ID
5032	}
5033	return json.Marshal(objectMap)
5034}
5035
5036// UnmarshalJSON is the custom unmarshaler for IPConfiguration struct.
5037func (ic *IPConfiguration) UnmarshalJSON(body []byte) error {
5038	var m map[string]*json.RawMessage
5039	err := json.Unmarshal(body, &m)
5040	if err != nil {
5041		return err
5042	}
5043	for k, v := range m {
5044		switch k {
5045		case "properties":
5046			if v != nil {
5047				var IPConfigurationPropertiesFormat IPConfigurationPropertiesFormat
5048				err = json.Unmarshal(*v, &IPConfigurationPropertiesFormat)
5049				if err != nil {
5050					return err
5051				}
5052				ic.IPConfigurationPropertiesFormat = &IPConfigurationPropertiesFormat
5053			}
5054		case "name":
5055			if v != nil {
5056				var name string
5057				err = json.Unmarshal(*v, &name)
5058				if err != nil {
5059					return err
5060				}
5061				ic.Name = &name
5062			}
5063		case "etag":
5064			if v != nil {
5065				var etag string
5066				err = json.Unmarshal(*v, &etag)
5067				if err != nil {
5068					return err
5069				}
5070				ic.Etag = &etag
5071			}
5072		case "id":
5073			if v != nil {
5074				var ID string
5075				err = json.Unmarshal(*v, &ID)
5076				if err != nil {
5077					return err
5078				}
5079				ic.ID = &ID
5080			}
5081		}
5082	}
5083
5084	return nil
5085}
5086
5087// IPConfigurationPropertiesFormat properties of IP configuration.
5088type IPConfigurationPropertiesFormat struct {
5089	// PrivateIPAddress - The private IP address of the IP configuration.
5090	PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
5091	// PrivateIPAllocationMethod - The private IP allocation method. Possible values are 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'
5092	PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
5093	// Subnet - The reference of the subnet resource.
5094	Subnet *Subnet `json:"subnet,omitempty"`
5095	// PublicIPAddress - The reference of the public IP resource.
5096	PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
5097	// ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
5098	ProvisioningState *string `json:"provisioningState,omitempty"`
5099}
5100
5101// LoadBalancer loadBalancer resource
5102type LoadBalancer struct {
5103	autorest.Response             `json:"-"`
5104	*LoadBalancerPropertiesFormat `json:"properties,omitempty"`
5105	// Etag - A unique read-only string that changes whenever the resource is updated.
5106	Etag *string `json:"etag,omitempty"`
5107	// ID - Resource ID.
5108	ID *string `json:"id,omitempty"`
5109	// Name - READ-ONLY; Resource name.
5110	Name *string `json:"name,omitempty"`
5111	// Type - READ-ONLY; Resource type.
5112	Type *string `json:"type,omitempty"`
5113	// Location - Resource location.
5114	Location *string `json:"location,omitempty"`
5115	// Tags - Resource tags.
5116	Tags map[string]*string `json:"tags"`
5117}
5118
5119// MarshalJSON is the custom marshaler for LoadBalancer.
5120func (lb LoadBalancer) MarshalJSON() ([]byte, error) {
5121	objectMap := make(map[string]interface{})
5122	if lb.LoadBalancerPropertiesFormat != nil {
5123		objectMap["properties"] = lb.LoadBalancerPropertiesFormat
5124	}
5125	if lb.Etag != nil {
5126		objectMap["etag"] = lb.Etag
5127	}
5128	if lb.ID != nil {
5129		objectMap["id"] = lb.ID
5130	}
5131	if lb.Location != nil {
5132		objectMap["location"] = lb.Location
5133	}
5134	if lb.Tags != nil {
5135		objectMap["tags"] = lb.Tags
5136	}
5137	return json.Marshal(objectMap)
5138}
5139
5140// UnmarshalJSON is the custom unmarshaler for LoadBalancer struct.
5141func (lb *LoadBalancer) UnmarshalJSON(body []byte) error {
5142	var m map[string]*json.RawMessage
5143	err := json.Unmarshal(body, &m)
5144	if err != nil {
5145		return err
5146	}
5147	for k, v := range m {
5148		switch k {
5149		case "properties":
5150			if v != nil {
5151				var loadBalancerPropertiesFormat LoadBalancerPropertiesFormat
5152				err = json.Unmarshal(*v, &loadBalancerPropertiesFormat)
5153				if err != nil {
5154					return err
5155				}
5156				lb.LoadBalancerPropertiesFormat = &loadBalancerPropertiesFormat
5157			}
5158		case "etag":
5159			if v != nil {
5160				var etag string
5161				err = json.Unmarshal(*v, &etag)
5162				if err != nil {
5163					return err
5164				}
5165				lb.Etag = &etag
5166			}
5167		case "id":
5168			if v != nil {
5169				var ID string
5170				err = json.Unmarshal(*v, &ID)
5171				if err != nil {
5172					return err
5173				}
5174				lb.ID = &ID
5175			}
5176		case "name":
5177			if v != nil {
5178				var name string
5179				err = json.Unmarshal(*v, &name)
5180				if err != nil {
5181					return err
5182				}
5183				lb.Name = &name
5184			}
5185		case "type":
5186			if v != nil {
5187				var typeVar string
5188				err = json.Unmarshal(*v, &typeVar)
5189				if err != nil {
5190					return err
5191				}
5192				lb.Type = &typeVar
5193			}
5194		case "location":
5195			if v != nil {
5196				var location string
5197				err = json.Unmarshal(*v, &location)
5198				if err != nil {
5199					return err
5200				}
5201				lb.Location = &location
5202			}
5203		case "tags":
5204			if v != nil {
5205				var tags map[string]*string
5206				err = json.Unmarshal(*v, &tags)
5207				if err != nil {
5208					return err
5209				}
5210				lb.Tags = tags
5211			}
5212		}
5213	}
5214
5215	return nil
5216}
5217
5218// LoadBalancerListResult response for ListLoadBalancers API service call.
5219type LoadBalancerListResult struct {
5220	autorest.Response `json:"-"`
5221	// Value - A list of load balancers in a resource group.
5222	Value *[]LoadBalancer `json:"value,omitempty"`
5223	// NextLink - The URL to get the next set of results.
5224	NextLink *string `json:"nextLink,omitempty"`
5225}
5226
5227// LoadBalancerListResultIterator provides access to a complete listing of LoadBalancer values.
5228type LoadBalancerListResultIterator struct {
5229	i    int
5230	page LoadBalancerListResultPage
5231}
5232
5233// NextWithContext advances to the next value.  If there was an error making
5234// the request the iterator does not advance and the error is returned.
5235func (iter *LoadBalancerListResultIterator) NextWithContext(ctx context.Context) (err error) {
5236	if tracing.IsEnabled() {
5237		ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultIterator.NextWithContext")
5238		defer func() {
5239			sc := -1
5240			if iter.Response().Response.Response != nil {
5241				sc = iter.Response().Response.Response.StatusCode
5242			}
5243			tracing.EndSpan(ctx, sc, err)
5244		}()
5245	}
5246	iter.i++
5247	if iter.i < len(iter.page.Values()) {
5248		return nil
5249	}
5250	err = iter.page.NextWithContext(ctx)
5251	if err != nil {
5252		iter.i--
5253		return err
5254	}
5255	iter.i = 0
5256	return nil
5257}
5258
5259// Next advances to the next value.  If there was an error making
5260// the request the iterator does not advance and the error is returned.
5261// Deprecated: Use NextWithContext() instead.
5262func (iter *LoadBalancerListResultIterator) Next() error {
5263	return iter.NextWithContext(context.Background())
5264}
5265
5266// NotDone returns true if the enumeration should be started or is not yet complete.
5267func (iter LoadBalancerListResultIterator) NotDone() bool {
5268	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5269}
5270
5271// Response returns the raw server response from the last page request.
5272func (iter LoadBalancerListResultIterator) Response() LoadBalancerListResult {
5273	return iter.page.Response()
5274}
5275
5276// Value returns the current value or a zero-initialized value if the
5277// iterator has advanced beyond the end of the collection.
5278func (iter LoadBalancerListResultIterator) Value() LoadBalancer {
5279	if !iter.page.NotDone() {
5280		return LoadBalancer{}
5281	}
5282	return iter.page.Values()[iter.i]
5283}
5284
5285// Creates a new instance of the LoadBalancerListResultIterator type.
5286func NewLoadBalancerListResultIterator(page LoadBalancerListResultPage) LoadBalancerListResultIterator {
5287	return LoadBalancerListResultIterator{page: page}
5288}
5289
5290// IsEmpty returns true if the ListResult contains no values.
5291func (lblr LoadBalancerListResult) IsEmpty() bool {
5292	return lblr.Value == nil || len(*lblr.Value) == 0
5293}
5294
5295// hasNextLink returns true if the NextLink is not empty.
5296func (lblr LoadBalancerListResult) hasNextLink() bool {
5297	return lblr.NextLink != nil && len(*lblr.NextLink) != 0
5298}
5299
5300// loadBalancerListResultPreparer prepares a request to retrieve the next set of results.
5301// It returns nil if no more results exist.
5302func (lblr LoadBalancerListResult) loadBalancerListResultPreparer(ctx context.Context) (*http.Request, error) {
5303	if !lblr.hasNextLink() {
5304		return nil, nil
5305	}
5306	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5307		autorest.AsJSON(),
5308		autorest.AsGet(),
5309		autorest.WithBaseURL(to.String(lblr.NextLink)))
5310}
5311
5312// LoadBalancerListResultPage contains a page of LoadBalancer values.
5313type LoadBalancerListResultPage struct {
5314	fn   func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)
5315	lblr LoadBalancerListResult
5316}
5317
5318// NextWithContext advances to the next page of values.  If there was an error making
5319// the request the page does not advance and the error is returned.
5320func (page *LoadBalancerListResultPage) NextWithContext(ctx context.Context) (err error) {
5321	if tracing.IsEnabled() {
5322		ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerListResultPage.NextWithContext")
5323		defer func() {
5324			sc := -1
5325			if page.Response().Response.Response != nil {
5326				sc = page.Response().Response.Response.StatusCode
5327			}
5328			tracing.EndSpan(ctx, sc, err)
5329		}()
5330	}
5331	for {
5332		next, err := page.fn(ctx, page.lblr)
5333		if err != nil {
5334			return err
5335		}
5336		page.lblr = next
5337		if !next.hasNextLink() || !next.IsEmpty() {
5338			break
5339		}
5340	}
5341	return nil
5342}
5343
5344// Next advances to the next page of values.  If there was an error making
5345// the request the page does not advance and the error is returned.
5346// Deprecated: Use NextWithContext() instead.
5347func (page *LoadBalancerListResultPage) Next() error {
5348	return page.NextWithContext(context.Background())
5349}
5350
5351// NotDone returns true if the page enumeration should be started or is not yet complete.
5352func (page LoadBalancerListResultPage) NotDone() bool {
5353	return !page.lblr.IsEmpty()
5354}
5355
5356// Response returns the raw server response from the last page request.
5357func (page LoadBalancerListResultPage) Response() LoadBalancerListResult {
5358	return page.lblr
5359}
5360
5361// Values returns the slice of values for the current page or nil if there are no values.
5362func (page LoadBalancerListResultPage) Values() []LoadBalancer {
5363	if page.lblr.IsEmpty() {
5364		return nil
5365	}
5366	return *page.lblr.Value
5367}
5368
5369// Creates a new instance of the LoadBalancerListResultPage type.
5370func NewLoadBalancerListResultPage(cur LoadBalancerListResult, getNextPage func(context.Context, LoadBalancerListResult) (LoadBalancerListResult, error)) LoadBalancerListResultPage {
5371	return LoadBalancerListResultPage{
5372		fn:   getNextPage,
5373		lblr: cur,
5374	}
5375}
5376
5377// LoadBalancerPropertiesFormat properties of the load balancer.
5378type LoadBalancerPropertiesFormat struct {
5379	// FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer
5380	FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
5381	// BackendAddressPools - Collection of backend address pools used by a load balancer
5382	BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"`
5383	// LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning
5384	LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"`
5385	// Probes - Collection of probe objects used in the load balancer
5386	Probes *[]Probe `json:"probes,omitempty"`
5387	// 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.
5388	InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"`
5389	// 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.
5390	InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"`
5391	// OutboundNatRules - The outbound NAT rules.
5392	OutboundNatRules *[]OutboundNatRule `json:"outboundNatRules,omitempty"`
5393	// ResourceGUID - The resource GUID property of the load balancer resource.
5394	ResourceGUID *string `json:"resourceGuid,omitempty"`
5395	// ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
5396	ProvisioningState *string `json:"provisioningState,omitempty"`
5397}
5398
5399// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
5400// long-running operation.
5401type LoadBalancersCreateOrUpdateFuture struct {
5402	azure.FutureAPI
5403	// Result returns the result of the asynchronous operation.
5404	// If the operation has not completed it will return an error.
5405	Result func(LoadBalancersClient) (LoadBalancer, error)
5406}
5407
5408// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5409func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5410	var azFuture azure.Future
5411	if err := json.Unmarshal(body, &azFuture); err != nil {
5412		return err
5413	}
5414	future.FutureAPI = &azFuture
5415	future.Result = future.result
5416	return nil
5417}
5418
5419// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result.
5420func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) {
5421	var done bool
5422	done, err = future.DoneWithContext(context.Background(), client)
5423	if err != nil {
5424		err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5425		return
5426	}
5427	if !done {
5428		lb.Response.Response = future.Response()
5429		err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture")
5430		return
5431	}
5432	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5433	if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent {
5434		lb, err = client.CreateOrUpdateResponder(lb.Response.Response)
5435		if err != nil {
5436			err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request")
5437		}
5438	}
5439	return
5440}
5441
5442// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
5443// operation.
5444type LoadBalancersDeleteFuture struct {
5445	azure.FutureAPI
5446	// Result returns the result of the asynchronous operation.
5447	// If the operation has not completed it will return an error.
5448	Result func(LoadBalancersClient) (autorest.Response, error)
5449}
5450
5451// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5452func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error {
5453	var azFuture azure.Future
5454	if err := json.Unmarshal(body, &azFuture); err != nil {
5455		return err
5456	}
5457	future.FutureAPI = &azFuture
5458	future.Result = future.result
5459	return nil
5460}
5461
5462// result is the default implementation for LoadBalancersDeleteFuture.Result.
5463func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) {
5464	var done bool
5465	done, err = future.DoneWithContext(context.Background(), client)
5466	if err != nil {
5467		err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure")
5468		return
5469	}
5470	if !done {
5471		ar.Response = future.Response()
5472		err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture")
5473		return
5474	}
5475	ar.Response = future.Response()
5476	return
5477}
5478
5479// LoadBalancingRule a load balancing rule for a load balancer.
5480type LoadBalancingRule struct {
5481	*LoadBalancingRulePropertiesFormat `json:"properties,omitempty"`
5482	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
5483	Name *string `json:"name,omitempty"`
5484	// Etag - A unique read-only string that changes whenever the resource is updated.
5485	Etag *string `json:"etag,omitempty"`
5486	// ID - Resource ID.
5487	ID *string `json:"id,omitempty"`
5488}
5489
5490// MarshalJSON is the custom marshaler for LoadBalancingRule.
5491func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) {
5492	objectMap := make(map[string]interface{})
5493	if lbr.LoadBalancingRulePropertiesFormat != nil {
5494		objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat
5495	}
5496	if lbr.Name != nil {
5497		objectMap["name"] = lbr.Name
5498	}
5499	if lbr.Etag != nil {
5500		objectMap["etag"] = lbr.Etag
5501	}
5502	if lbr.ID != nil {
5503		objectMap["id"] = lbr.ID
5504	}
5505	return json.Marshal(objectMap)
5506}
5507
5508// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct.
5509func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error {
5510	var m map[string]*json.RawMessage
5511	err := json.Unmarshal(body, &m)
5512	if err != nil {
5513		return err
5514	}
5515	for k, v := range m {
5516		switch k {
5517		case "properties":
5518			if v != nil {
5519				var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat
5520				err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat)
5521				if err != nil {
5522					return err
5523				}
5524				lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat
5525			}
5526		case "name":
5527			if v != nil {
5528				var name string
5529				err = json.Unmarshal(*v, &name)
5530				if err != nil {
5531					return err
5532				}
5533				lbr.Name = &name
5534			}
5535		case "etag":
5536			if v != nil {
5537				var etag string
5538				err = json.Unmarshal(*v, &etag)
5539				if err != nil {
5540					return err
5541				}
5542				lbr.Etag = &etag
5543			}
5544		case "id":
5545			if v != nil {
5546				var ID string
5547				err = json.Unmarshal(*v, &ID)
5548				if err != nil {
5549					return err
5550				}
5551				lbr.ID = &ID
5552			}
5553		}
5554	}
5555
5556	return nil
5557}
5558
5559// LoadBalancingRulePropertiesFormat properties of the load balancer.
5560type LoadBalancingRulePropertiesFormat struct {
5561	// FrontendIPConfiguration - A reference to frontend IP addresses.
5562	FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"`
5563	// BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs.
5564	BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
5565	// Probe - The reference of the load balancer probe used by the load balancing rule.
5566	Probe *SubResource `json:"probe,omitempty"`
5567	// Protocol - The transport protocol for the external endpoint. Possible values are 'Udp' or 'Tcp'. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP'
5568	Protocol TransportProtocol `json:"protocol,omitempty"`
5569	// LoadDistribution - The load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: 'Default', 'SourceIP', 'SourceIPProtocol'
5570	LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"`
5571	// 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.
5572	FrontendPort *int32 `json:"frontendPort,omitempty"`
5573	// BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 1 and 65535.
5574	BackendPort *int32 `json:"backendPort,omitempty"`
5575	// 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.
5576	IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
5577	// 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.
5578	EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"`
5579	// ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
5580	ProvisioningState *string `json:"provisioningState,omitempty"`
5581}
5582
5583// LocalNetworkGateway a common class for general resource information
5584type LocalNetworkGateway struct {
5585	autorest.Response                    `json:"-"`
5586	*LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"`
5587	// Etag - A unique read-only string that changes whenever the resource is updated.
5588	Etag *string `json:"etag,omitempty"`
5589	// ID - Resource ID.
5590	ID *string `json:"id,omitempty"`
5591	// Name - READ-ONLY; Resource name.
5592	Name *string `json:"name,omitempty"`
5593	// Type - READ-ONLY; Resource type.
5594	Type *string `json:"type,omitempty"`
5595	// Location - Resource location.
5596	Location *string `json:"location,omitempty"`
5597	// Tags - Resource tags.
5598	Tags map[string]*string `json:"tags"`
5599}
5600
5601// MarshalJSON is the custom marshaler for LocalNetworkGateway.
5602func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) {
5603	objectMap := make(map[string]interface{})
5604	if lng.LocalNetworkGatewayPropertiesFormat != nil {
5605		objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat
5606	}
5607	if lng.Etag != nil {
5608		objectMap["etag"] = lng.Etag
5609	}
5610	if lng.ID != nil {
5611		objectMap["id"] = lng.ID
5612	}
5613	if lng.Location != nil {
5614		objectMap["location"] = lng.Location
5615	}
5616	if lng.Tags != nil {
5617		objectMap["tags"] = lng.Tags
5618	}
5619	return json.Marshal(objectMap)
5620}
5621
5622// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct.
5623func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error {
5624	var m map[string]*json.RawMessage
5625	err := json.Unmarshal(body, &m)
5626	if err != nil {
5627		return err
5628	}
5629	for k, v := range m {
5630		switch k {
5631		case "properties":
5632			if v != nil {
5633				var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat
5634				err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat)
5635				if err != nil {
5636					return err
5637				}
5638				lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat
5639			}
5640		case "etag":
5641			if v != nil {
5642				var etag string
5643				err = json.Unmarshal(*v, &etag)
5644				if err != nil {
5645					return err
5646				}
5647				lng.Etag = &etag
5648			}
5649		case "id":
5650			if v != nil {
5651				var ID string
5652				err = json.Unmarshal(*v, &ID)
5653				if err != nil {
5654					return err
5655				}
5656				lng.ID = &ID
5657			}
5658		case "name":
5659			if v != nil {
5660				var name string
5661				err = json.Unmarshal(*v, &name)
5662				if err != nil {
5663					return err
5664				}
5665				lng.Name = &name
5666			}
5667		case "type":
5668			if v != nil {
5669				var typeVar string
5670				err = json.Unmarshal(*v, &typeVar)
5671				if err != nil {
5672					return err
5673				}
5674				lng.Type = &typeVar
5675			}
5676		case "location":
5677			if v != nil {
5678				var location string
5679				err = json.Unmarshal(*v, &location)
5680				if err != nil {
5681					return err
5682				}
5683				lng.Location = &location
5684			}
5685		case "tags":
5686			if v != nil {
5687				var tags map[string]*string
5688				err = json.Unmarshal(*v, &tags)
5689				if err != nil {
5690					return err
5691				}
5692				lng.Tags = tags
5693			}
5694		}
5695	}
5696
5697	return nil
5698}
5699
5700// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call.
5701type LocalNetworkGatewayListResult struct {
5702	autorest.Response `json:"-"`
5703	// Value - A list of local network gateways that exists in a resource group.
5704	Value *[]LocalNetworkGateway `json:"value,omitempty"`
5705	// NextLink - The URL to get the next set of results.
5706	NextLink *string `json:"nextLink,omitempty"`
5707}
5708
5709// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway
5710// values.
5711type LocalNetworkGatewayListResultIterator struct {
5712	i    int
5713	page LocalNetworkGatewayListResultPage
5714}
5715
5716// NextWithContext advances to the next value.  If there was an error making
5717// the request the iterator does not advance and the error is returned.
5718func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) {
5719	if tracing.IsEnabled() {
5720		ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext")
5721		defer func() {
5722			sc := -1
5723			if iter.Response().Response.Response != nil {
5724				sc = iter.Response().Response.Response.StatusCode
5725			}
5726			tracing.EndSpan(ctx, sc, err)
5727		}()
5728	}
5729	iter.i++
5730	if iter.i < len(iter.page.Values()) {
5731		return nil
5732	}
5733	err = iter.page.NextWithContext(ctx)
5734	if err != nil {
5735		iter.i--
5736		return err
5737	}
5738	iter.i = 0
5739	return nil
5740}
5741
5742// Next advances to the next value.  If there was an error making
5743// the request the iterator does not advance and the error is returned.
5744// Deprecated: Use NextWithContext() instead.
5745func (iter *LocalNetworkGatewayListResultIterator) Next() error {
5746	return iter.NextWithContext(context.Background())
5747}
5748
5749// NotDone returns true if the enumeration should be started or is not yet complete.
5750func (iter LocalNetworkGatewayListResultIterator) NotDone() bool {
5751	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5752}
5753
5754// Response returns the raw server response from the last page request.
5755func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult {
5756	return iter.page.Response()
5757}
5758
5759// Value returns the current value or a zero-initialized value if the
5760// iterator has advanced beyond the end of the collection.
5761func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway {
5762	if !iter.page.NotDone() {
5763		return LocalNetworkGateway{}
5764	}
5765	return iter.page.Values()[iter.i]
5766}
5767
5768// Creates a new instance of the LocalNetworkGatewayListResultIterator type.
5769func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator {
5770	return LocalNetworkGatewayListResultIterator{page: page}
5771}
5772
5773// IsEmpty returns true if the ListResult contains no values.
5774func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool {
5775	return lnglr.Value == nil || len(*lnglr.Value) == 0
5776}
5777
5778// hasNextLink returns true if the NextLink is not empty.
5779func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool {
5780	return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0
5781}
5782
5783// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results.
5784// It returns nil if no more results exist.
5785func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) {
5786	if !lnglr.hasNextLink() {
5787		return nil, nil
5788	}
5789	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5790		autorest.AsJSON(),
5791		autorest.AsGet(),
5792		autorest.WithBaseURL(to.String(lnglr.NextLink)))
5793}
5794
5795// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values.
5796type LocalNetworkGatewayListResultPage struct {
5797	fn    func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)
5798	lnglr LocalNetworkGatewayListResult
5799}
5800
5801// NextWithContext advances to the next page of values.  If there was an error making
5802// the request the page does not advance and the error is returned.
5803func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) {
5804	if tracing.IsEnabled() {
5805		ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext")
5806		defer func() {
5807			sc := -1
5808			if page.Response().Response.Response != nil {
5809				sc = page.Response().Response.Response.StatusCode
5810			}
5811			tracing.EndSpan(ctx, sc, err)
5812		}()
5813	}
5814	for {
5815		next, err := page.fn(ctx, page.lnglr)
5816		if err != nil {
5817			return err
5818		}
5819		page.lnglr = next
5820		if !next.hasNextLink() || !next.IsEmpty() {
5821			break
5822		}
5823	}
5824	return nil
5825}
5826
5827// Next advances to the next page of values.  If there was an error making
5828// the request the page does not advance and the error is returned.
5829// Deprecated: Use NextWithContext() instead.
5830func (page *LocalNetworkGatewayListResultPage) Next() error {
5831	return page.NextWithContext(context.Background())
5832}
5833
5834// NotDone returns true if the page enumeration should be started or is not yet complete.
5835func (page LocalNetworkGatewayListResultPage) NotDone() bool {
5836	return !page.lnglr.IsEmpty()
5837}
5838
5839// Response returns the raw server response from the last page request.
5840func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult {
5841	return page.lnglr
5842}
5843
5844// Values returns the slice of values for the current page or nil if there are no values.
5845func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway {
5846	if page.lnglr.IsEmpty() {
5847		return nil
5848	}
5849	return *page.lnglr.Value
5850}
5851
5852// Creates a new instance of the LocalNetworkGatewayListResultPage type.
5853func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage {
5854	return LocalNetworkGatewayListResultPage{
5855		fn:    getNextPage,
5856		lnglr: cur,
5857	}
5858}
5859
5860// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties
5861type LocalNetworkGatewayPropertiesFormat struct {
5862	// LocalNetworkAddressSpace - Local network site address space.
5863	LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"`
5864	// GatewayIPAddress - IP address of local network gateway.
5865	GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"`
5866	// BgpSettings - Local network gateway's BGP speaker settings.
5867	BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
5868	// ResourceGUID - The resource GUID property of the LocalNetworkGateway resource.
5869	ResourceGUID *string `json:"resourceGuid,omitempty"`
5870	// ProvisioningState - READ-ONLY; The provisioning state of the LocalNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
5871	ProvisioningState *string `json:"provisioningState,omitempty"`
5872}
5873
5874// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat.
5875func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) {
5876	objectMap := make(map[string]interface{})
5877	if lngpf.LocalNetworkAddressSpace != nil {
5878		objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace
5879	}
5880	if lngpf.GatewayIPAddress != nil {
5881		objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress
5882	}
5883	if lngpf.BgpSettings != nil {
5884		objectMap["bgpSettings"] = lngpf.BgpSettings
5885	}
5886	if lngpf.ResourceGUID != nil {
5887		objectMap["resourceGuid"] = lngpf.ResourceGUID
5888	}
5889	return json.Marshal(objectMap)
5890}
5891
5892// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
5893// long-running operation.
5894type LocalNetworkGatewaysCreateOrUpdateFuture struct {
5895	azure.FutureAPI
5896	// Result returns the result of the asynchronous operation.
5897	// If the operation has not completed it will return an error.
5898	Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error)
5899}
5900
5901// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5902func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
5903	var azFuture azure.Future
5904	if err := json.Unmarshal(body, &azFuture); err != nil {
5905		return err
5906	}
5907	future.FutureAPI = &azFuture
5908	future.Result = future.result
5909	return nil
5910}
5911
5912// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result.
5913func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) {
5914	var done bool
5915	done, err = future.DoneWithContext(context.Background(), client)
5916	if err != nil {
5917		err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
5918		return
5919	}
5920	if !done {
5921		lng.Response.Response = future.Response()
5922		err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture")
5923		return
5924	}
5925	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
5926	if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent {
5927		lng, err = client.CreateOrUpdateResponder(lng.Response.Response)
5928		if err != nil {
5929			err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request")
5930		}
5931	}
5932	return
5933}
5934
5935// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a
5936// long-running operation.
5937type LocalNetworkGatewaysDeleteFuture struct {
5938	azure.FutureAPI
5939	// Result returns the result of the asynchronous operation.
5940	// If the operation has not completed it will return an error.
5941	Result func(LocalNetworkGatewaysClient) (autorest.Response, error)
5942}
5943
5944// UnmarshalJSON is the custom unmarshaller for CreateFuture.
5945func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
5946	var azFuture azure.Future
5947	if err := json.Unmarshal(body, &azFuture); err != nil {
5948		return err
5949	}
5950	future.FutureAPI = &azFuture
5951	future.Result = future.result
5952	return nil
5953}
5954
5955// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result.
5956func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) {
5957	var done bool
5958	done, err = future.DoneWithContext(context.Background(), client)
5959	if err != nil {
5960		err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
5961		return
5962	}
5963	if !done {
5964		ar.Response = future.Response()
5965		err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture")
5966		return
5967	}
5968	ar.Response = future.Response()
5969	return
5970}
5971
5972// NextHopParameters parameters that define the source and destination endpoint.
5973type NextHopParameters struct {
5974	// TargetResourceID - The resource identifier of the target resource against which the action is to be performed.
5975	TargetResourceID *string `json:"targetResourceId,omitempty"`
5976	// SourceIPAddress - The source IP address.
5977	SourceIPAddress *string `json:"sourceIPAddress,omitempty"`
5978	// DestinationIPAddress - The destination IP address.
5979	DestinationIPAddress *string `json:"destinationIPAddress,omitempty"`
5980	// 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).
5981	TargetNicResourceID *string `json:"targetNicResourceId,omitempty"`
5982}
5983
5984// NextHopResult the information about next hop from the specified VM.
5985type NextHopResult struct {
5986	autorest.Response `json:"-"`
5987	// NextHopType - Next hop type. Possible values include: 'NextHopTypeInternet', 'NextHopTypeVirtualAppliance', 'NextHopTypeVirtualNetworkGateway', 'NextHopTypeVnetLocal', 'NextHopTypeHyperNetGateway', 'NextHopTypeNone'
5988	NextHopType NextHopType `json:"nextHopType,omitempty"`
5989	// NextHopIPAddress - Next hop IP Address
5990	NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"`
5991	// 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'.
5992	RouteTableID *string `json:"routeTableId,omitempty"`
5993}
5994
5995// OutboundNatRule outbound NAT pool of the load balancer.
5996type OutboundNatRule struct {
5997	*OutboundNatRulePropertiesFormat `json:"properties,omitempty"`
5998	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
5999	Name *string `json:"name,omitempty"`
6000	// Etag - A unique read-only string that changes whenever the resource is updated.
6001	Etag *string `json:"etag,omitempty"`
6002	// ID - Resource ID.
6003	ID *string `json:"id,omitempty"`
6004}
6005
6006// MarshalJSON is the custom marshaler for OutboundNatRule.
6007func (onr OutboundNatRule) MarshalJSON() ([]byte, error) {
6008	objectMap := make(map[string]interface{})
6009	if onr.OutboundNatRulePropertiesFormat != nil {
6010		objectMap["properties"] = onr.OutboundNatRulePropertiesFormat
6011	}
6012	if onr.Name != nil {
6013		objectMap["name"] = onr.Name
6014	}
6015	if onr.Etag != nil {
6016		objectMap["etag"] = onr.Etag
6017	}
6018	if onr.ID != nil {
6019		objectMap["id"] = onr.ID
6020	}
6021	return json.Marshal(objectMap)
6022}
6023
6024// UnmarshalJSON is the custom unmarshaler for OutboundNatRule struct.
6025func (onr *OutboundNatRule) UnmarshalJSON(body []byte) error {
6026	var m map[string]*json.RawMessage
6027	err := json.Unmarshal(body, &m)
6028	if err != nil {
6029		return err
6030	}
6031	for k, v := range m {
6032		switch k {
6033		case "properties":
6034			if v != nil {
6035				var outboundNatRulePropertiesFormat OutboundNatRulePropertiesFormat
6036				err = json.Unmarshal(*v, &outboundNatRulePropertiesFormat)
6037				if err != nil {
6038					return err
6039				}
6040				onr.OutboundNatRulePropertiesFormat = &outboundNatRulePropertiesFormat
6041			}
6042		case "name":
6043			if v != nil {
6044				var name string
6045				err = json.Unmarshal(*v, &name)
6046				if err != nil {
6047					return err
6048				}
6049				onr.Name = &name
6050			}
6051		case "etag":
6052			if v != nil {
6053				var etag string
6054				err = json.Unmarshal(*v, &etag)
6055				if err != nil {
6056					return err
6057				}
6058				onr.Etag = &etag
6059			}
6060		case "id":
6061			if v != nil {
6062				var ID string
6063				err = json.Unmarshal(*v, &ID)
6064				if err != nil {
6065					return err
6066				}
6067				onr.ID = &ID
6068			}
6069		}
6070	}
6071
6072	return nil
6073}
6074
6075// OutboundNatRulePropertiesFormat outbound NAT pool of the load balancer.
6076type OutboundNatRulePropertiesFormat struct {
6077	// AllocatedOutboundPorts - The number of outbound ports to be used for NAT.
6078	AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"`
6079	// FrontendIPConfigurations - The Frontend IP addresses of the load balancer.
6080	FrontendIPConfigurations *[]SubResource `json:"frontendIPConfigurations,omitempty"`
6081	// BackendAddressPool - A reference to a pool of DIPs. Outbound traffic is randomly load balanced across IPs in the backend IPs.
6082	BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"`
6083	// ProvisioningState - Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
6084	ProvisioningState *string `json:"provisioningState,omitempty"`
6085}
6086
6087// PacketCapture parameters that define the create packet capture operation.
6088type PacketCapture struct {
6089	*PacketCaptureParameters `json:"properties,omitempty"`
6090}
6091
6092// MarshalJSON is the custom marshaler for PacketCapture.
6093func (pc PacketCapture) MarshalJSON() ([]byte, error) {
6094	objectMap := make(map[string]interface{})
6095	if pc.PacketCaptureParameters != nil {
6096		objectMap["properties"] = pc.PacketCaptureParameters
6097	}
6098	return json.Marshal(objectMap)
6099}
6100
6101// UnmarshalJSON is the custom unmarshaler for PacketCapture struct.
6102func (pc *PacketCapture) UnmarshalJSON(body []byte) error {
6103	var m map[string]*json.RawMessage
6104	err := json.Unmarshal(body, &m)
6105	if err != nil {
6106		return err
6107	}
6108	for k, v := range m {
6109		switch k {
6110		case "properties":
6111			if v != nil {
6112				var packetCaptureParameters PacketCaptureParameters
6113				err = json.Unmarshal(*v, &packetCaptureParameters)
6114				if err != nil {
6115					return err
6116				}
6117				pc.PacketCaptureParameters = &packetCaptureParameters
6118			}
6119		}
6120	}
6121
6122	return nil
6123}
6124
6125// PacketCaptureFilter filter that is applied to packet capture request. Multiple filters can be applied.
6126type PacketCaptureFilter struct {
6127	// Protocol - Protocol to be filtered on. Possible values include: 'TCP', 'UDP', 'Any'
6128	Protocol PcProtocol `json:"protocol,omitempty"`
6129	// 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.
6130	LocalIPAddress *string `json:"localIPAddress,omitempty"`
6131	// 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.
6132	RemoteIPAddress *string `json:"remoteIPAddress,omitempty"`
6133	// 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.
6134	LocalPort *string `json:"localPort,omitempty"`
6135	// 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.
6136	RemotePort *string `json:"remotePort,omitempty"`
6137}
6138
6139// PacketCaptureListResult list of packet capture sessions.
6140type PacketCaptureListResult struct {
6141	autorest.Response `json:"-"`
6142	// Value - Information about packet capture sessions.
6143	Value *[]PacketCaptureResult `json:"value,omitempty"`
6144}
6145
6146// PacketCaptureParameters parameters that define the create packet capture operation.
6147type PacketCaptureParameters struct {
6148	// Target - The ID of the targeted resource, only VM is currently supported.
6149	Target *string `json:"target,omitempty"`
6150	// BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated.
6151	BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"`
6152	// TotalBytesPerSession - Maximum size of the capture output.
6153	TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"`
6154	// TimeLimitInSeconds - Maximum duration of the capture session in seconds.
6155	TimeLimitInSeconds *int32                        `json:"timeLimitInSeconds,omitempty"`
6156	StorageLocation    *PacketCaptureStorageLocation `json:"storageLocation,omitempty"`
6157	Filters            *[]PacketCaptureFilter        `json:"filters,omitempty"`
6158}
6159
6160// PacketCaptureQueryStatusResult status of packet capture session.
6161type PacketCaptureQueryStatusResult struct {
6162	autorest.Response `json:"-"`
6163	// Name - The name of the packet capture resource.
6164	Name *string `json:"name,omitempty"`
6165	// ID - The ID of the packet capture resource.
6166	ID *string `json:"id,omitempty"`
6167	// CaptureStartTime - The start time of the packet capture session.
6168	CaptureStartTime *date.Time `json:"captureStartTime,omitempty"`
6169	// PacketCaptureStatus - The status of the packet capture session. Possible values include: 'PcStatusNotStarted', 'PcStatusRunning', 'PcStatusStopped', 'PcStatusError', 'PcStatusUnknown'
6170	PacketCaptureStatus PcStatus `json:"packetCaptureStatus,omitempty"`
6171	// StopReason - The reason the current packet capture session was stopped.
6172	StopReason *string `json:"stopReason,omitempty"`
6173	// PacketCaptureError - List of errors of packet capture session.
6174	PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"`
6175}
6176
6177// PacketCaptureResult information about packet capture session.
6178type PacketCaptureResult struct {
6179	autorest.Response `json:"-"`
6180	// Name - READ-ONLY; Name of the packet capture session.
6181	Name *string `json:"name,omitempty"`
6182	// ID - READ-ONLY; ID of the packet capture operation.
6183	ID                             *string `json:"id,omitempty"`
6184	Etag                           *string `json:"etag,omitempty"`
6185	*PacketCaptureResultProperties `json:"properties,omitempty"`
6186}
6187
6188// MarshalJSON is the custom marshaler for PacketCaptureResult.
6189func (pcr PacketCaptureResult) MarshalJSON() ([]byte, error) {
6190	objectMap := make(map[string]interface{})
6191	if pcr.Etag != nil {
6192		objectMap["etag"] = pcr.Etag
6193	}
6194	if pcr.PacketCaptureResultProperties != nil {
6195		objectMap["properties"] = pcr.PacketCaptureResultProperties
6196	}
6197	return json.Marshal(objectMap)
6198}
6199
6200// UnmarshalJSON is the custom unmarshaler for PacketCaptureResult struct.
6201func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error {
6202	var m map[string]*json.RawMessage
6203	err := json.Unmarshal(body, &m)
6204	if err != nil {
6205		return err
6206	}
6207	for k, v := range m {
6208		switch k {
6209		case "name":
6210			if v != nil {
6211				var name string
6212				err = json.Unmarshal(*v, &name)
6213				if err != nil {
6214					return err
6215				}
6216				pcr.Name = &name
6217			}
6218		case "id":
6219			if v != nil {
6220				var ID string
6221				err = json.Unmarshal(*v, &ID)
6222				if err != nil {
6223					return err
6224				}
6225				pcr.ID = &ID
6226			}
6227		case "etag":
6228			if v != nil {
6229				var etag string
6230				err = json.Unmarshal(*v, &etag)
6231				if err != nil {
6232					return err
6233				}
6234				pcr.Etag = &etag
6235			}
6236		case "properties":
6237			if v != nil {
6238				var packetCaptureResultProperties PacketCaptureResultProperties
6239				err = json.Unmarshal(*v, &packetCaptureResultProperties)
6240				if err != nil {
6241					return err
6242				}
6243				pcr.PacketCaptureResultProperties = &packetCaptureResultProperties
6244			}
6245		}
6246	}
6247
6248	return nil
6249}
6250
6251// PacketCaptureResultProperties describes the properties of a packet capture session.
6252type PacketCaptureResultProperties struct {
6253	// ProvisioningState - The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed'
6254	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
6255	// Target - The ID of the targeted resource, only VM is currently supported.
6256	Target *string `json:"target,omitempty"`
6257	// BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated.
6258	BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"`
6259	// TotalBytesPerSession - Maximum size of the capture output.
6260	TotalBytesPerSession *int32 `json:"totalBytesPerSession,omitempty"`
6261	// TimeLimitInSeconds - Maximum duration of the capture session in seconds.
6262	TimeLimitInSeconds *int32                        `json:"timeLimitInSeconds,omitempty"`
6263	StorageLocation    *PacketCaptureStorageLocation `json:"storageLocation,omitempty"`
6264	Filters            *[]PacketCaptureFilter        `json:"filters,omitempty"`
6265}
6266
6267// PacketCapturesCreateFuture an abstraction for monitoring and retrieving the results of a long-running
6268// operation.
6269type PacketCapturesCreateFuture struct {
6270	azure.FutureAPI
6271	// Result returns the result of the asynchronous operation.
6272	// If the operation has not completed it will return an error.
6273	Result func(PacketCapturesClient) (PacketCaptureResult, error)
6274}
6275
6276// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6277func (future *PacketCapturesCreateFuture) UnmarshalJSON(body []byte) error {
6278	var azFuture azure.Future
6279	if err := json.Unmarshal(body, &azFuture); err != nil {
6280		return err
6281	}
6282	future.FutureAPI = &azFuture
6283	future.Result = future.result
6284	return nil
6285}
6286
6287// result is the default implementation for PacketCapturesCreateFuture.Result.
6288func (future *PacketCapturesCreateFuture) result(client PacketCapturesClient) (pcr PacketCaptureResult, err error) {
6289	var done bool
6290	done, err = future.DoneWithContext(context.Background(), client)
6291	if err != nil {
6292		err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", future.Response(), "Polling failure")
6293		return
6294	}
6295	if !done {
6296		pcr.Response.Response = future.Response()
6297		err = azure.NewAsyncOpIncompleteError("network.PacketCapturesCreateFuture")
6298		return
6299	}
6300	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6301	if pcr.Response.Response, err = future.GetResult(sender); err == nil && pcr.Response.Response.StatusCode != http.StatusNoContent {
6302		pcr, err = client.CreateResponder(pcr.Response.Response)
6303		if err != nil {
6304			err = autorest.NewErrorWithError(err, "network.PacketCapturesCreateFuture", "Result", pcr.Response.Response, "Failure responding to request")
6305		}
6306	}
6307	return
6308}
6309
6310// PacketCapturesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6311// operation.
6312type PacketCapturesDeleteFuture struct {
6313	azure.FutureAPI
6314	// Result returns the result of the asynchronous operation.
6315	// If the operation has not completed it will return an error.
6316	Result func(PacketCapturesClient) (autorest.Response, error)
6317}
6318
6319// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6320func (future *PacketCapturesDeleteFuture) UnmarshalJSON(body []byte) error {
6321	var azFuture azure.Future
6322	if err := json.Unmarshal(body, &azFuture); err != nil {
6323		return err
6324	}
6325	future.FutureAPI = &azFuture
6326	future.Result = future.result
6327	return nil
6328}
6329
6330// result is the default implementation for PacketCapturesDeleteFuture.Result.
6331func (future *PacketCapturesDeleteFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) {
6332	var done bool
6333	done, err = future.DoneWithContext(context.Background(), client)
6334	if err != nil {
6335		err = autorest.NewErrorWithError(err, "network.PacketCapturesDeleteFuture", "Result", future.Response(), "Polling failure")
6336		return
6337	}
6338	if !done {
6339		ar.Response = future.Response()
6340		err = azure.NewAsyncOpIncompleteError("network.PacketCapturesDeleteFuture")
6341		return
6342	}
6343	ar.Response = future.Response()
6344	return
6345}
6346
6347// PacketCapturesGetStatusFuture an abstraction for monitoring and retrieving the results of a long-running
6348// operation.
6349type PacketCapturesGetStatusFuture struct {
6350	azure.FutureAPI
6351	// Result returns the result of the asynchronous operation.
6352	// If the operation has not completed it will return an error.
6353	Result func(PacketCapturesClient) (PacketCaptureQueryStatusResult, error)
6354}
6355
6356// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6357func (future *PacketCapturesGetStatusFuture) UnmarshalJSON(body []byte) error {
6358	var azFuture azure.Future
6359	if err := json.Unmarshal(body, &azFuture); err != nil {
6360		return err
6361	}
6362	future.FutureAPI = &azFuture
6363	future.Result = future.result
6364	return nil
6365}
6366
6367// result is the default implementation for PacketCapturesGetStatusFuture.Result.
6368func (future *PacketCapturesGetStatusFuture) result(client PacketCapturesClient) (pcqsr PacketCaptureQueryStatusResult, err error) {
6369	var done bool
6370	done, err = future.DoneWithContext(context.Background(), client)
6371	if err != nil {
6372		err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", future.Response(), "Polling failure")
6373		return
6374	}
6375	if !done {
6376		pcqsr.Response.Response = future.Response()
6377		err = azure.NewAsyncOpIncompleteError("network.PacketCapturesGetStatusFuture")
6378		return
6379	}
6380	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6381	if pcqsr.Response.Response, err = future.GetResult(sender); err == nil && pcqsr.Response.Response.StatusCode != http.StatusNoContent {
6382		pcqsr, err = client.GetStatusResponder(pcqsr.Response.Response)
6383		if err != nil {
6384			err = autorest.NewErrorWithError(err, "network.PacketCapturesGetStatusFuture", "Result", pcqsr.Response.Response, "Failure responding to request")
6385		}
6386	}
6387	return
6388}
6389
6390// PacketCapturesStopFuture an abstraction for monitoring and retrieving the results of a long-running
6391// operation.
6392type PacketCapturesStopFuture struct {
6393	azure.FutureAPI
6394	// Result returns the result of the asynchronous operation.
6395	// If the operation has not completed it will return an error.
6396	Result func(PacketCapturesClient) (autorest.Response, error)
6397}
6398
6399// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6400func (future *PacketCapturesStopFuture) UnmarshalJSON(body []byte) error {
6401	var azFuture azure.Future
6402	if err := json.Unmarshal(body, &azFuture); err != nil {
6403		return err
6404	}
6405	future.FutureAPI = &azFuture
6406	future.Result = future.result
6407	return nil
6408}
6409
6410// result is the default implementation for PacketCapturesStopFuture.Result.
6411func (future *PacketCapturesStopFuture) result(client PacketCapturesClient) (ar autorest.Response, err error) {
6412	var done bool
6413	done, err = future.DoneWithContext(context.Background(), client)
6414	if err != nil {
6415		err = autorest.NewErrorWithError(err, "network.PacketCapturesStopFuture", "Result", future.Response(), "Polling failure")
6416		return
6417	}
6418	if !done {
6419		ar.Response = future.Response()
6420		err = azure.NewAsyncOpIncompleteError("network.PacketCapturesStopFuture")
6421		return
6422	}
6423	ar.Response = future.Response()
6424	return
6425}
6426
6427// PacketCaptureStorageLocation describes the storage location for a packet capture session.
6428type PacketCaptureStorageLocation struct {
6429	// StorageID - The ID of the storage account to save the packet capture session. Required if no local file path is provided.
6430	StorageID *string `json:"storageId,omitempty"`
6431	// 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.
6432	StoragePath *string `json:"storagePath,omitempty"`
6433	// 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.
6434	FilePath *string `json:"filePath,omitempty"`
6435}
6436
6437// PatchRouteFilter route Filter Resource.
6438type PatchRouteFilter struct {
6439	*RouteFilterPropertiesFormat `json:"properties,omitempty"`
6440	// Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource.
6441	Name *string `json:"name,omitempty"`
6442	// Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
6443	Etag *string `json:"etag,omitempty"`
6444	// Type - READ-ONLY; Resource type.
6445	Type *string `json:"type,omitempty"`
6446	// Tags - Resource tags.
6447	Tags map[string]*string `json:"tags"`
6448	// ID - Resource ID.
6449	ID *string `json:"id,omitempty"`
6450}
6451
6452// MarshalJSON is the custom marshaler for PatchRouteFilter.
6453func (prf PatchRouteFilter) MarshalJSON() ([]byte, error) {
6454	objectMap := make(map[string]interface{})
6455	if prf.RouteFilterPropertiesFormat != nil {
6456		objectMap["properties"] = prf.RouteFilterPropertiesFormat
6457	}
6458	if prf.Tags != nil {
6459		objectMap["tags"] = prf.Tags
6460	}
6461	if prf.ID != nil {
6462		objectMap["id"] = prf.ID
6463	}
6464	return json.Marshal(objectMap)
6465}
6466
6467// UnmarshalJSON is the custom unmarshaler for PatchRouteFilter struct.
6468func (prf *PatchRouteFilter) UnmarshalJSON(body []byte) error {
6469	var m map[string]*json.RawMessage
6470	err := json.Unmarshal(body, &m)
6471	if err != nil {
6472		return err
6473	}
6474	for k, v := range m {
6475		switch k {
6476		case "properties":
6477			if v != nil {
6478				var routeFilterPropertiesFormat RouteFilterPropertiesFormat
6479				err = json.Unmarshal(*v, &routeFilterPropertiesFormat)
6480				if err != nil {
6481					return err
6482				}
6483				prf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat
6484			}
6485		case "name":
6486			if v != nil {
6487				var name string
6488				err = json.Unmarshal(*v, &name)
6489				if err != nil {
6490					return err
6491				}
6492				prf.Name = &name
6493			}
6494		case "etag":
6495			if v != nil {
6496				var etag string
6497				err = json.Unmarshal(*v, &etag)
6498				if err != nil {
6499					return err
6500				}
6501				prf.Etag = &etag
6502			}
6503		case "type":
6504			if v != nil {
6505				var typeVar string
6506				err = json.Unmarshal(*v, &typeVar)
6507				if err != nil {
6508					return err
6509				}
6510				prf.Type = &typeVar
6511			}
6512		case "tags":
6513			if v != nil {
6514				var tags map[string]*string
6515				err = json.Unmarshal(*v, &tags)
6516				if err != nil {
6517					return err
6518				}
6519				prf.Tags = tags
6520			}
6521		case "id":
6522			if v != nil {
6523				var ID string
6524				err = json.Unmarshal(*v, &ID)
6525				if err != nil {
6526					return err
6527				}
6528				prf.ID = &ID
6529			}
6530		}
6531	}
6532
6533	return nil
6534}
6535
6536// PatchRouteFilterRule route Filter Rule Resource
6537type PatchRouteFilterRule struct {
6538	*RouteFilterRulePropertiesFormat `json:"properties,omitempty"`
6539	// Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource.
6540	Name *string `json:"name,omitempty"`
6541	// Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
6542	Etag *string `json:"etag,omitempty"`
6543	// Tags - Resource tags.
6544	Tags map[string]*string `json:"tags"`
6545	// ID - Resource ID.
6546	ID *string `json:"id,omitempty"`
6547}
6548
6549// MarshalJSON is the custom marshaler for PatchRouteFilterRule.
6550func (prfr PatchRouteFilterRule) MarshalJSON() ([]byte, error) {
6551	objectMap := make(map[string]interface{})
6552	if prfr.RouteFilterRulePropertiesFormat != nil {
6553		objectMap["properties"] = prfr.RouteFilterRulePropertiesFormat
6554	}
6555	if prfr.Tags != nil {
6556		objectMap["tags"] = prfr.Tags
6557	}
6558	if prfr.ID != nil {
6559		objectMap["id"] = prfr.ID
6560	}
6561	return json.Marshal(objectMap)
6562}
6563
6564// UnmarshalJSON is the custom unmarshaler for PatchRouteFilterRule struct.
6565func (prfr *PatchRouteFilterRule) UnmarshalJSON(body []byte) error {
6566	var m map[string]*json.RawMessage
6567	err := json.Unmarshal(body, &m)
6568	if err != nil {
6569		return err
6570	}
6571	for k, v := range m {
6572		switch k {
6573		case "properties":
6574			if v != nil {
6575				var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat
6576				err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat)
6577				if err != nil {
6578					return err
6579				}
6580				prfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat
6581			}
6582		case "name":
6583			if v != nil {
6584				var name string
6585				err = json.Unmarshal(*v, &name)
6586				if err != nil {
6587					return err
6588				}
6589				prfr.Name = &name
6590			}
6591		case "etag":
6592			if v != nil {
6593				var etag string
6594				err = json.Unmarshal(*v, &etag)
6595				if err != nil {
6596					return err
6597				}
6598				prfr.Etag = &etag
6599			}
6600		case "tags":
6601			if v != nil {
6602				var tags map[string]*string
6603				err = json.Unmarshal(*v, &tags)
6604				if err != nil {
6605					return err
6606				}
6607				prfr.Tags = tags
6608			}
6609		case "id":
6610			if v != nil {
6611				var ID string
6612				err = json.Unmarshal(*v, &ID)
6613				if err != nil {
6614					return err
6615				}
6616				prfr.ID = &ID
6617			}
6618		}
6619	}
6620
6621	return nil
6622}
6623
6624// Probe a load balancer probe.
6625type Probe struct {
6626	*ProbePropertiesFormat `json:"properties,omitempty"`
6627	// Name - Gets name of the resource that is unique within a resource group. This name can be used to access the resource.
6628	Name *string `json:"name,omitempty"`
6629	// Etag - A unique read-only string that changes whenever the resource is updated.
6630	Etag *string `json:"etag,omitempty"`
6631	// ID - Resource ID.
6632	ID *string `json:"id,omitempty"`
6633}
6634
6635// MarshalJSON is the custom marshaler for Probe.
6636func (p Probe) MarshalJSON() ([]byte, error) {
6637	objectMap := make(map[string]interface{})
6638	if p.ProbePropertiesFormat != nil {
6639		objectMap["properties"] = p.ProbePropertiesFormat
6640	}
6641	if p.Name != nil {
6642		objectMap["name"] = p.Name
6643	}
6644	if p.Etag != nil {
6645		objectMap["etag"] = p.Etag
6646	}
6647	if p.ID != nil {
6648		objectMap["id"] = p.ID
6649	}
6650	return json.Marshal(objectMap)
6651}
6652
6653// UnmarshalJSON is the custom unmarshaler for Probe struct.
6654func (p *Probe) UnmarshalJSON(body []byte) error {
6655	var m map[string]*json.RawMessage
6656	err := json.Unmarshal(body, &m)
6657	if err != nil {
6658		return err
6659	}
6660	for k, v := range m {
6661		switch k {
6662		case "properties":
6663			if v != nil {
6664				var probePropertiesFormat ProbePropertiesFormat
6665				err = json.Unmarshal(*v, &probePropertiesFormat)
6666				if err != nil {
6667					return err
6668				}
6669				p.ProbePropertiesFormat = &probePropertiesFormat
6670			}
6671		case "name":
6672			if v != nil {
6673				var name string
6674				err = json.Unmarshal(*v, &name)
6675				if err != nil {
6676					return err
6677				}
6678				p.Name = &name
6679			}
6680		case "etag":
6681			if v != nil {
6682				var etag string
6683				err = json.Unmarshal(*v, &etag)
6684				if err != nil {
6685					return err
6686				}
6687				p.Etag = &etag
6688			}
6689		case "id":
6690			if v != nil {
6691				var ID string
6692				err = json.Unmarshal(*v, &ID)
6693				if err != nil {
6694					return err
6695				}
6696				p.ID = &ID
6697			}
6698		}
6699	}
6700
6701	return nil
6702}
6703
6704// ProbePropertiesFormat ...
6705type ProbePropertiesFormat struct {
6706	// LoadBalancingRules - READ-ONLY; The load balancer rules that use this probe.
6707	LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"`
6708	// 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'
6709	Protocol ProbeProtocol `json:"protocol,omitempty"`
6710	// Port - The port for communicating the probe. Possible values range from 1 to 65535, inclusive.
6711	Port *int32 `json:"port,omitempty"`
6712	// 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.
6713	IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"`
6714	// 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.
6715	NumberOfProbes *int32 `json:"numberOfProbes,omitempty"`
6716	// 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.
6717	RequestPath *string `json:"requestPath,omitempty"`
6718	// ProvisioningState - Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
6719	ProvisioningState *string `json:"provisioningState,omitempty"`
6720}
6721
6722// MarshalJSON is the custom marshaler for ProbePropertiesFormat.
6723func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) {
6724	objectMap := make(map[string]interface{})
6725	if ppf.Protocol != "" {
6726		objectMap["protocol"] = ppf.Protocol
6727	}
6728	if ppf.Port != nil {
6729		objectMap["port"] = ppf.Port
6730	}
6731	if ppf.IntervalInSeconds != nil {
6732		objectMap["intervalInSeconds"] = ppf.IntervalInSeconds
6733	}
6734	if ppf.NumberOfProbes != nil {
6735		objectMap["numberOfProbes"] = ppf.NumberOfProbes
6736	}
6737	if ppf.RequestPath != nil {
6738		objectMap["requestPath"] = ppf.RequestPath
6739	}
6740	if ppf.ProvisioningState != nil {
6741		objectMap["provisioningState"] = ppf.ProvisioningState
6742	}
6743	return json.Marshal(objectMap)
6744}
6745
6746// PublicIPAddress public IP address resource.
6747type PublicIPAddress struct {
6748	autorest.Response                `json:"-"`
6749	*PublicIPAddressPropertiesFormat `json:"properties,omitempty"`
6750	// Etag - A unique read-only string that changes whenever the resource is updated.
6751	Etag *string `json:"etag,omitempty"`
6752	// ID - Resource ID.
6753	ID *string `json:"id,omitempty"`
6754	// Name - READ-ONLY; Resource name.
6755	Name *string `json:"name,omitempty"`
6756	// Type - READ-ONLY; Resource type.
6757	Type *string `json:"type,omitempty"`
6758	// Location - Resource location.
6759	Location *string `json:"location,omitempty"`
6760	// Tags - Resource tags.
6761	Tags map[string]*string `json:"tags"`
6762}
6763
6764// MarshalJSON is the custom marshaler for PublicIPAddress.
6765func (pia PublicIPAddress) MarshalJSON() ([]byte, error) {
6766	objectMap := make(map[string]interface{})
6767	if pia.PublicIPAddressPropertiesFormat != nil {
6768		objectMap["properties"] = pia.PublicIPAddressPropertiesFormat
6769	}
6770	if pia.Etag != nil {
6771		objectMap["etag"] = pia.Etag
6772	}
6773	if pia.ID != nil {
6774		objectMap["id"] = pia.ID
6775	}
6776	if pia.Location != nil {
6777		objectMap["location"] = pia.Location
6778	}
6779	if pia.Tags != nil {
6780		objectMap["tags"] = pia.Tags
6781	}
6782	return json.Marshal(objectMap)
6783}
6784
6785// UnmarshalJSON is the custom unmarshaler for PublicIPAddress struct.
6786func (pia *PublicIPAddress) UnmarshalJSON(body []byte) error {
6787	var m map[string]*json.RawMessage
6788	err := json.Unmarshal(body, &m)
6789	if err != nil {
6790		return err
6791	}
6792	for k, v := range m {
6793		switch k {
6794		case "properties":
6795			if v != nil {
6796				var publicIPAddressPropertiesFormat PublicIPAddressPropertiesFormat
6797				err = json.Unmarshal(*v, &publicIPAddressPropertiesFormat)
6798				if err != nil {
6799					return err
6800				}
6801				pia.PublicIPAddressPropertiesFormat = &publicIPAddressPropertiesFormat
6802			}
6803		case "etag":
6804			if v != nil {
6805				var etag string
6806				err = json.Unmarshal(*v, &etag)
6807				if err != nil {
6808					return err
6809				}
6810				pia.Etag = &etag
6811			}
6812		case "id":
6813			if v != nil {
6814				var ID string
6815				err = json.Unmarshal(*v, &ID)
6816				if err != nil {
6817					return err
6818				}
6819				pia.ID = &ID
6820			}
6821		case "name":
6822			if v != nil {
6823				var name string
6824				err = json.Unmarshal(*v, &name)
6825				if err != nil {
6826					return err
6827				}
6828				pia.Name = &name
6829			}
6830		case "type":
6831			if v != nil {
6832				var typeVar string
6833				err = json.Unmarshal(*v, &typeVar)
6834				if err != nil {
6835					return err
6836				}
6837				pia.Type = &typeVar
6838			}
6839		case "location":
6840			if v != nil {
6841				var location string
6842				err = json.Unmarshal(*v, &location)
6843				if err != nil {
6844					return err
6845				}
6846				pia.Location = &location
6847			}
6848		case "tags":
6849			if v != nil {
6850				var tags map[string]*string
6851				err = json.Unmarshal(*v, &tags)
6852				if err != nil {
6853					return err
6854				}
6855				pia.Tags = tags
6856			}
6857		}
6858	}
6859
6860	return nil
6861}
6862
6863// PublicIPAddressDNSSettings contains FQDN of the DNS record associated with the public IP address
6864type PublicIPAddressDNSSettings struct {
6865	// 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.
6866	DomainNameLabel *string `json:"domainNameLabel,omitempty"`
6867	// 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.
6868	Fqdn *string `json:"fqdn,omitempty"`
6869	// 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.
6870	ReverseFqdn *string `json:"reverseFqdn,omitempty"`
6871}
6872
6873// PublicIPAddressesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6874// long-running operation.
6875type PublicIPAddressesCreateOrUpdateFuture struct {
6876	azure.FutureAPI
6877	// Result returns the result of the asynchronous operation.
6878	// If the operation has not completed it will return an error.
6879	Result func(PublicIPAddressesClient) (PublicIPAddress, error)
6880}
6881
6882// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6883func (future *PublicIPAddressesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6884	var azFuture azure.Future
6885	if err := json.Unmarshal(body, &azFuture); err != nil {
6886		return err
6887	}
6888	future.FutureAPI = &azFuture
6889	future.Result = future.result
6890	return nil
6891}
6892
6893// result is the default implementation for PublicIPAddressesCreateOrUpdateFuture.Result.
6894func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddressesClient) (pia PublicIPAddress, err error) {
6895	var done bool
6896	done, err = future.DoneWithContext(context.Background(), client)
6897	if err != nil {
6898		err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
6899		return
6900	}
6901	if !done {
6902		pia.Response.Response = future.Response()
6903		err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesCreateOrUpdateFuture")
6904		return
6905	}
6906	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
6907	if pia.Response.Response, err = future.GetResult(sender); err == nil && pia.Response.Response.StatusCode != http.StatusNoContent {
6908		pia, err = client.CreateOrUpdateResponder(pia.Response.Response)
6909		if err != nil {
6910			err = autorest.NewErrorWithError(err, "network.PublicIPAddressesCreateOrUpdateFuture", "Result", pia.Response.Response, "Failure responding to request")
6911		}
6912	}
6913	return
6914}
6915
6916// PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
6917// operation.
6918type PublicIPAddressesDeleteFuture struct {
6919	azure.FutureAPI
6920	// Result returns the result of the asynchronous operation.
6921	// If the operation has not completed it will return an error.
6922	Result func(PublicIPAddressesClient) (autorest.Response, error)
6923}
6924
6925// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6926func (future *PublicIPAddressesDeleteFuture) UnmarshalJSON(body []byte) error {
6927	var azFuture azure.Future
6928	if err := json.Unmarshal(body, &azFuture); err != nil {
6929		return err
6930	}
6931	future.FutureAPI = &azFuture
6932	future.Result = future.result
6933	return nil
6934}
6935
6936// result is the default implementation for PublicIPAddressesDeleteFuture.Result.
6937func (future *PublicIPAddressesDeleteFuture) result(client PublicIPAddressesClient) (ar autorest.Response, err error) {
6938	var done bool
6939	done, err = future.DoneWithContext(context.Background(), client)
6940	if err != nil {
6941		err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDeleteFuture", "Result", future.Response(), "Polling failure")
6942		return
6943	}
6944	if !done {
6945		ar.Response = future.Response()
6946		err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDeleteFuture")
6947		return
6948	}
6949	ar.Response = future.Response()
6950	return
6951}
6952
6953// PublicIPAddressListResult response for ListPublicIpAddresses API service call.
6954type PublicIPAddressListResult struct {
6955	autorest.Response `json:"-"`
6956	// Value - A list of public IP addresses that exists in a resource group.
6957	Value *[]PublicIPAddress `json:"value,omitempty"`
6958	// NextLink - The URL to get the next set of results.
6959	NextLink *string `json:"nextLink,omitempty"`
6960}
6961
6962// PublicIPAddressListResultIterator provides access to a complete listing of PublicIPAddress values.
6963type PublicIPAddressListResultIterator struct {
6964	i    int
6965	page PublicIPAddressListResultPage
6966}
6967
6968// NextWithContext advances to the next value.  If there was an error making
6969// the request the iterator does not advance and the error is returned.
6970func (iter *PublicIPAddressListResultIterator) NextWithContext(ctx context.Context) (err error) {
6971	if tracing.IsEnabled() {
6972		ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultIterator.NextWithContext")
6973		defer func() {
6974			sc := -1
6975			if iter.Response().Response.Response != nil {
6976				sc = iter.Response().Response.Response.StatusCode
6977			}
6978			tracing.EndSpan(ctx, sc, err)
6979		}()
6980	}
6981	iter.i++
6982	if iter.i < len(iter.page.Values()) {
6983		return nil
6984	}
6985	err = iter.page.NextWithContext(ctx)
6986	if err != nil {
6987		iter.i--
6988		return err
6989	}
6990	iter.i = 0
6991	return nil
6992}
6993
6994// Next advances to the next value.  If there was an error making
6995// the request the iterator does not advance and the error is returned.
6996// Deprecated: Use NextWithContext() instead.
6997func (iter *PublicIPAddressListResultIterator) Next() error {
6998	return iter.NextWithContext(context.Background())
6999}
7000
7001// NotDone returns true if the enumeration should be started or is not yet complete.
7002func (iter PublicIPAddressListResultIterator) NotDone() bool {
7003	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7004}
7005
7006// Response returns the raw server response from the last page request.
7007func (iter PublicIPAddressListResultIterator) Response() PublicIPAddressListResult {
7008	return iter.page.Response()
7009}
7010
7011// Value returns the current value or a zero-initialized value if the
7012// iterator has advanced beyond the end of the collection.
7013func (iter PublicIPAddressListResultIterator) Value() PublicIPAddress {
7014	if !iter.page.NotDone() {
7015		return PublicIPAddress{}
7016	}
7017	return iter.page.Values()[iter.i]
7018}
7019
7020// Creates a new instance of the PublicIPAddressListResultIterator type.
7021func NewPublicIPAddressListResultIterator(page PublicIPAddressListResultPage) PublicIPAddressListResultIterator {
7022	return PublicIPAddressListResultIterator{page: page}
7023}
7024
7025// IsEmpty returns true if the ListResult contains no values.
7026func (pialr PublicIPAddressListResult) IsEmpty() bool {
7027	return pialr.Value == nil || len(*pialr.Value) == 0
7028}
7029
7030// hasNextLink returns true if the NextLink is not empty.
7031func (pialr PublicIPAddressListResult) hasNextLink() bool {
7032	return pialr.NextLink != nil && len(*pialr.NextLink) != 0
7033}
7034
7035// publicIPAddressListResultPreparer prepares a request to retrieve the next set of results.
7036// It returns nil if no more results exist.
7037func (pialr PublicIPAddressListResult) publicIPAddressListResultPreparer(ctx context.Context) (*http.Request, error) {
7038	if !pialr.hasNextLink() {
7039		return nil, nil
7040	}
7041	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7042		autorest.AsJSON(),
7043		autorest.AsGet(),
7044		autorest.WithBaseURL(to.String(pialr.NextLink)))
7045}
7046
7047// PublicIPAddressListResultPage contains a page of PublicIPAddress values.
7048type PublicIPAddressListResultPage struct {
7049	fn    func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)
7050	pialr PublicIPAddressListResult
7051}
7052
7053// NextWithContext advances to the next page of values.  If there was an error making
7054// the request the page does not advance and the error is returned.
7055func (page *PublicIPAddressListResultPage) NextWithContext(ctx context.Context) (err error) {
7056	if tracing.IsEnabled() {
7057		ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressListResultPage.NextWithContext")
7058		defer func() {
7059			sc := -1
7060			if page.Response().Response.Response != nil {
7061				sc = page.Response().Response.Response.StatusCode
7062			}
7063			tracing.EndSpan(ctx, sc, err)
7064		}()
7065	}
7066	for {
7067		next, err := page.fn(ctx, page.pialr)
7068		if err != nil {
7069			return err
7070		}
7071		page.pialr = next
7072		if !next.hasNextLink() || !next.IsEmpty() {
7073			break
7074		}
7075	}
7076	return nil
7077}
7078
7079// Next advances to the next page of values.  If there was an error making
7080// the request the page does not advance and the error is returned.
7081// Deprecated: Use NextWithContext() instead.
7082func (page *PublicIPAddressListResultPage) Next() error {
7083	return page.NextWithContext(context.Background())
7084}
7085
7086// NotDone returns true if the page enumeration should be started or is not yet complete.
7087func (page PublicIPAddressListResultPage) NotDone() bool {
7088	return !page.pialr.IsEmpty()
7089}
7090
7091// Response returns the raw server response from the last page request.
7092func (page PublicIPAddressListResultPage) Response() PublicIPAddressListResult {
7093	return page.pialr
7094}
7095
7096// Values returns the slice of values for the current page or nil if there are no values.
7097func (page PublicIPAddressListResultPage) Values() []PublicIPAddress {
7098	if page.pialr.IsEmpty() {
7099		return nil
7100	}
7101	return *page.pialr.Value
7102}
7103
7104// Creates a new instance of the PublicIPAddressListResultPage type.
7105func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage func(context.Context, PublicIPAddressListResult) (PublicIPAddressListResult, error)) PublicIPAddressListResultPage {
7106	return PublicIPAddressListResultPage{
7107		fn:    getNextPage,
7108		pialr: cur,
7109	}
7110}
7111
7112// PublicIPAddressPropertiesFormat public IP address properties.
7113type PublicIPAddressPropertiesFormat struct {
7114	// PublicIPAllocationMethod - The public IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'
7115	PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"`
7116	// PublicIPAddressVersion - The public IP address version. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6'
7117	PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"`
7118	// IPConfiguration - READ-ONLY
7119	IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"`
7120	// DNSSettings - The FQDN of the DNS record associated with the public IP address.
7121	DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"`
7122	IPAddress   *string                     `json:"ipAddress,omitempty"`
7123	// IdleTimeoutInMinutes - The idle timeout of the public IP address.
7124	IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"`
7125	// ResourceGUID - The resource GUID property of the public IP resource.
7126	ResourceGUID *string `json:"resourceGuid,omitempty"`
7127	// ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
7128	ProvisioningState *string `json:"provisioningState,omitempty"`
7129}
7130
7131// MarshalJSON is the custom marshaler for PublicIPAddressPropertiesFormat.
7132func (piapf PublicIPAddressPropertiesFormat) MarshalJSON() ([]byte, error) {
7133	objectMap := make(map[string]interface{})
7134	if piapf.PublicIPAllocationMethod != "" {
7135		objectMap["publicIPAllocationMethod"] = piapf.PublicIPAllocationMethod
7136	}
7137	if piapf.PublicIPAddressVersion != "" {
7138		objectMap["publicIPAddressVersion"] = piapf.PublicIPAddressVersion
7139	}
7140	if piapf.DNSSettings != nil {
7141		objectMap["dnsSettings"] = piapf.DNSSettings
7142	}
7143	if piapf.IPAddress != nil {
7144		objectMap["ipAddress"] = piapf.IPAddress
7145	}
7146	if piapf.IdleTimeoutInMinutes != nil {
7147		objectMap["idleTimeoutInMinutes"] = piapf.IdleTimeoutInMinutes
7148	}
7149	if piapf.ResourceGUID != nil {
7150		objectMap["resourceGuid"] = piapf.ResourceGUID
7151	}
7152	if piapf.ProvisioningState != nil {
7153		objectMap["provisioningState"] = piapf.ProvisioningState
7154	}
7155	return json.Marshal(objectMap)
7156}
7157
7158// QueryTroubleshootingParameters parameters that define the resource to query the troubleshooting result.
7159type QueryTroubleshootingParameters struct {
7160	// TargetResourceID - The target resource ID to query the troubleshooting result.
7161	TargetResourceID *string `json:"targetResourceId,omitempty"`
7162}
7163
7164// Resource ...
7165type Resource struct {
7166	// ID - Resource ID.
7167	ID *string `json:"id,omitempty"`
7168	// Name - READ-ONLY; Resource name.
7169	Name *string `json:"name,omitempty"`
7170	// Type - READ-ONLY; Resource type.
7171	Type *string `json:"type,omitempty"`
7172	// Location - Resource location.
7173	Location *string `json:"location,omitempty"`
7174	// Tags - Resource tags.
7175	Tags map[string]*string `json:"tags"`
7176}
7177
7178// MarshalJSON is the custom marshaler for Resource.
7179func (r Resource) MarshalJSON() ([]byte, error) {
7180	objectMap := make(map[string]interface{})
7181	if r.ID != nil {
7182		objectMap["id"] = r.ID
7183	}
7184	if r.Location != nil {
7185		objectMap["location"] = r.Location
7186	}
7187	if r.Tags != nil {
7188		objectMap["tags"] = r.Tags
7189	}
7190	return json.Marshal(objectMap)
7191}
7192
7193// ResourceNavigationLink resourceNavigationLink resource.
7194type ResourceNavigationLink struct {
7195	*ResourceNavigationLinkFormat `json:"properties,omitempty"`
7196	// Name - Name of the resource that is unique within a resource group. This name can be used to access the resource.
7197	Name *string `json:"name,omitempty"`
7198	// Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
7199	Etag *string `json:"etag,omitempty"`
7200	// ID - Resource ID.
7201	ID *string `json:"id,omitempty"`
7202}
7203
7204// MarshalJSON is the custom marshaler for ResourceNavigationLink.
7205func (rnl ResourceNavigationLink) MarshalJSON() ([]byte, error) {
7206	objectMap := make(map[string]interface{})
7207	if rnl.ResourceNavigationLinkFormat != nil {
7208		objectMap["properties"] = rnl.ResourceNavigationLinkFormat
7209	}
7210	if rnl.Name != nil {
7211		objectMap["name"] = rnl.Name
7212	}
7213	if rnl.ID != nil {
7214		objectMap["id"] = rnl.ID
7215	}
7216	return json.Marshal(objectMap)
7217}
7218
7219// UnmarshalJSON is the custom unmarshaler for ResourceNavigationLink struct.
7220func (rnl *ResourceNavigationLink) UnmarshalJSON(body []byte) error {
7221	var m map[string]*json.RawMessage
7222	err := json.Unmarshal(body, &m)
7223	if err != nil {
7224		return err
7225	}
7226	for k, v := range m {
7227		switch k {
7228		case "properties":
7229			if v != nil {
7230				var resourceNavigationLinkFormat ResourceNavigationLinkFormat
7231				err = json.Unmarshal(*v, &resourceNavigationLinkFormat)
7232				if err != nil {
7233					return err
7234				}
7235				rnl.ResourceNavigationLinkFormat = &resourceNavigationLinkFormat
7236			}
7237		case "name":
7238			if v != nil {
7239				var name string
7240				err = json.Unmarshal(*v, &name)
7241				if err != nil {
7242					return err
7243				}
7244				rnl.Name = &name
7245			}
7246		case "etag":
7247			if v != nil {
7248				var etag string
7249				err = json.Unmarshal(*v, &etag)
7250				if err != nil {
7251					return err
7252				}
7253				rnl.Etag = &etag
7254			}
7255		case "id":
7256			if v != nil {
7257				var ID string
7258				err = json.Unmarshal(*v, &ID)
7259				if err != nil {
7260					return err
7261				}
7262				rnl.ID = &ID
7263			}
7264		}
7265	}
7266
7267	return nil
7268}
7269
7270// ResourceNavigationLinkFormat properties of ResourceNavigationLink.
7271type ResourceNavigationLinkFormat struct {
7272	// LinkedResourceType - Resource type of the linked resource.
7273	LinkedResourceType *string `json:"linkedResourceType,omitempty"`
7274	// Link - Link to the external resource
7275	Link *string `json:"link,omitempty"`
7276	// ProvisioningState - READ-ONLY; Provisioning state of the ResourceNavigationLink resource.
7277	ProvisioningState *string `json:"provisioningState,omitempty"`
7278}
7279
7280// MarshalJSON is the custom marshaler for ResourceNavigationLinkFormat.
7281func (rnlf ResourceNavigationLinkFormat) MarshalJSON() ([]byte, error) {
7282	objectMap := make(map[string]interface{})
7283	if rnlf.LinkedResourceType != nil {
7284		objectMap["linkedResourceType"] = rnlf.LinkedResourceType
7285	}
7286	if rnlf.Link != nil {
7287		objectMap["link"] = rnlf.Link
7288	}
7289	return json.Marshal(objectMap)
7290}
7291
7292// RetentionPolicyParameters parameters that define the retention policy for flow log.
7293type RetentionPolicyParameters struct {
7294	// Days - Number of days to retain flow log records.
7295	Days *int32 `json:"days,omitempty"`
7296	// Enabled - Flag to enable/disable retention.
7297	Enabled *bool `json:"enabled,omitempty"`
7298}
7299
7300// Route route resource
7301type Route struct {
7302	autorest.Response      `json:"-"`
7303	*RoutePropertiesFormat `json:"properties,omitempty"`
7304	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
7305	Name *string `json:"name,omitempty"`
7306	// Etag - A unique read-only string that changes whenever the resource is updated.
7307	Etag *string `json:"etag,omitempty"`
7308	// ID - Resource ID.
7309	ID *string `json:"id,omitempty"`
7310}
7311
7312// MarshalJSON is the custom marshaler for Route.
7313func (r Route) MarshalJSON() ([]byte, error) {
7314	objectMap := make(map[string]interface{})
7315	if r.RoutePropertiesFormat != nil {
7316		objectMap["properties"] = r.RoutePropertiesFormat
7317	}
7318	if r.Name != nil {
7319		objectMap["name"] = r.Name
7320	}
7321	if r.Etag != nil {
7322		objectMap["etag"] = r.Etag
7323	}
7324	if r.ID != nil {
7325		objectMap["id"] = r.ID
7326	}
7327	return json.Marshal(objectMap)
7328}
7329
7330// UnmarshalJSON is the custom unmarshaler for Route struct.
7331func (r *Route) UnmarshalJSON(body []byte) error {
7332	var m map[string]*json.RawMessage
7333	err := json.Unmarshal(body, &m)
7334	if err != nil {
7335		return err
7336	}
7337	for k, v := range m {
7338		switch k {
7339		case "properties":
7340			if v != nil {
7341				var routePropertiesFormat RoutePropertiesFormat
7342				err = json.Unmarshal(*v, &routePropertiesFormat)
7343				if err != nil {
7344					return err
7345				}
7346				r.RoutePropertiesFormat = &routePropertiesFormat
7347			}
7348		case "name":
7349			if v != nil {
7350				var name string
7351				err = json.Unmarshal(*v, &name)
7352				if err != nil {
7353					return err
7354				}
7355				r.Name = &name
7356			}
7357		case "etag":
7358			if v != nil {
7359				var etag string
7360				err = json.Unmarshal(*v, &etag)
7361				if err != nil {
7362					return err
7363				}
7364				r.Etag = &etag
7365			}
7366		case "id":
7367			if v != nil {
7368				var ID string
7369				err = json.Unmarshal(*v, &ID)
7370				if err != nil {
7371					return err
7372				}
7373				r.ID = &ID
7374			}
7375		}
7376	}
7377
7378	return nil
7379}
7380
7381// RouteFilter route Filter Resource.
7382type RouteFilter struct {
7383	autorest.Response            `json:"-"`
7384	*RouteFilterPropertiesFormat `json:"properties,omitempty"`
7385	// Etag - READ-ONLY; Gets a unique read-only string that changes whenever the resource is updated.
7386	Etag *string `json:"etag,omitempty"`
7387	// ID - Resource ID.
7388	ID *string `json:"id,omitempty"`
7389	// Name - READ-ONLY; Resource name.
7390	Name *string `json:"name,omitempty"`
7391	// Type - READ-ONLY; Resource type.
7392	Type *string `json:"type,omitempty"`
7393	// Location - Resource location.
7394	Location *string `json:"location,omitempty"`
7395	// Tags - Resource tags.
7396	Tags map[string]*string `json:"tags"`
7397}
7398
7399// MarshalJSON is the custom marshaler for RouteFilter.
7400func (rf RouteFilter) MarshalJSON() ([]byte, error) {
7401	objectMap := make(map[string]interface{})
7402	if rf.RouteFilterPropertiesFormat != nil {
7403		objectMap["properties"] = rf.RouteFilterPropertiesFormat
7404	}
7405	if rf.ID != nil {
7406		objectMap["id"] = rf.ID
7407	}
7408	if rf.Location != nil {
7409		objectMap["location"] = rf.Location
7410	}
7411	if rf.Tags != nil {
7412		objectMap["tags"] = rf.Tags
7413	}
7414	return json.Marshal(objectMap)
7415}
7416
7417// UnmarshalJSON is the custom unmarshaler for RouteFilter struct.
7418func (rf *RouteFilter) UnmarshalJSON(body []byte) error {
7419	var m map[string]*json.RawMessage
7420	err := json.Unmarshal(body, &m)
7421	if err != nil {
7422		return err
7423	}
7424	for k, v := range m {
7425		switch k {
7426		case "properties":
7427			if v != nil {
7428				var routeFilterPropertiesFormat RouteFilterPropertiesFormat
7429				err = json.Unmarshal(*v, &routeFilterPropertiesFormat)
7430				if err != nil {
7431					return err
7432				}
7433				rf.RouteFilterPropertiesFormat = &routeFilterPropertiesFormat
7434			}
7435		case "etag":
7436			if v != nil {
7437				var etag string
7438				err = json.Unmarshal(*v, &etag)
7439				if err != nil {
7440					return err
7441				}
7442				rf.Etag = &etag
7443			}
7444		case "id":
7445			if v != nil {
7446				var ID string
7447				err = json.Unmarshal(*v, &ID)
7448				if err != nil {
7449					return err
7450				}
7451				rf.ID = &ID
7452			}
7453		case "name":
7454			if v != nil {
7455				var name string
7456				err = json.Unmarshal(*v, &name)
7457				if err != nil {
7458					return err
7459				}
7460				rf.Name = &name
7461			}
7462		case "type":
7463			if v != nil {
7464				var typeVar string
7465				err = json.Unmarshal(*v, &typeVar)
7466				if err != nil {
7467					return err
7468				}
7469				rf.Type = &typeVar
7470			}
7471		case "location":
7472			if v != nil {
7473				var location string
7474				err = json.Unmarshal(*v, &location)
7475				if err != nil {
7476					return err
7477				}
7478				rf.Location = &location
7479			}
7480		case "tags":
7481			if v != nil {
7482				var tags map[string]*string
7483				err = json.Unmarshal(*v, &tags)
7484				if err != nil {
7485					return err
7486				}
7487				rf.Tags = tags
7488			}
7489		}
7490	}
7491
7492	return nil
7493}
7494
7495// RouteFilterListResult response for the ListRouteFilters API service call.
7496type RouteFilterListResult struct {
7497	autorest.Response `json:"-"`
7498	// Value - Gets a list of route filters in a resource group.
7499	Value *[]RouteFilter `json:"value,omitempty"`
7500	// NextLink - The URL to get the next set of results.
7501	NextLink *string `json:"nextLink,omitempty"`
7502}
7503
7504// RouteFilterListResultIterator provides access to a complete listing of RouteFilter values.
7505type RouteFilterListResultIterator struct {
7506	i    int
7507	page RouteFilterListResultPage
7508}
7509
7510// NextWithContext advances to the next value.  If there was an error making
7511// the request the iterator does not advance and the error is returned.
7512func (iter *RouteFilterListResultIterator) NextWithContext(ctx context.Context) (err error) {
7513	if tracing.IsEnabled() {
7514		ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultIterator.NextWithContext")
7515		defer func() {
7516			sc := -1
7517			if iter.Response().Response.Response != nil {
7518				sc = iter.Response().Response.Response.StatusCode
7519			}
7520			tracing.EndSpan(ctx, sc, err)
7521		}()
7522	}
7523	iter.i++
7524	if iter.i < len(iter.page.Values()) {
7525		return nil
7526	}
7527	err = iter.page.NextWithContext(ctx)
7528	if err != nil {
7529		iter.i--
7530		return err
7531	}
7532	iter.i = 0
7533	return nil
7534}
7535
7536// Next advances to the next value.  If there was an error making
7537// the request the iterator does not advance and the error is returned.
7538// Deprecated: Use NextWithContext() instead.
7539func (iter *RouteFilterListResultIterator) Next() error {
7540	return iter.NextWithContext(context.Background())
7541}
7542
7543// NotDone returns true if the enumeration should be started or is not yet complete.
7544func (iter RouteFilterListResultIterator) NotDone() bool {
7545	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7546}
7547
7548// Response returns the raw server response from the last page request.
7549func (iter RouteFilterListResultIterator) Response() RouteFilterListResult {
7550	return iter.page.Response()
7551}
7552
7553// Value returns the current value or a zero-initialized value if the
7554// iterator has advanced beyond the end of the collection.
7555func (iter RouteFilterListResultIterator) Value() RouteFilter {
7556	if !iter.page.NotDone() {
7557		return RouteFilter{}
7558	}
7559	return iter.page.Values()[iter.i]
7560}
7561
7562// Creates a new instance of the RouteFilterListResultIterator type.
7563func NewRouteFilterListResultIterator(page RouteFilterListResultPage) RouteFilterListResultIterator {
7564	return RouteFilterListResultIterator{page: page}
7565}
7566
7567// IsEmpty returns true if the ListResult contains no values.
7568func (rflr RouteFilterListResult) IsEmpty() bool {
7569	return rflr.Value == nil || len(*rflr.Value) == 0
7570}
7571
7572// hasNextLink returns true if the NextLink is not empty.
7573func (rflr RouteFilterListResult) hasNextLink() bool {
7574	return rflr.NextLink != nil && len(*rflr.NextLink) != 0
7575}
7576
7577// routeFilterListResultPreparer prepares a request to retrieve the next set of results.
7578// It returns nil if no more results exist.
7579func (rflr RouteFilterListResult) routeFilterListResultPreparer(ctx context.Context) (*http.Request, error) {
7580	if !rflr.hasNextLink() {
7581		return nil, nil
7582	}
7583	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7584		autorest.AsJSON(),
7585		autorest.AsGet(),
7586		autorest.WithBaseURL(to.String(rflr.NextLink)))
7587}
7588
7589// RouteFilterListResultPage contains a page of RouteFilter values.
7590type RouteFilterListResultPage struct {
7591	fn   func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)
7592	rflr RouteFilterListResult
7593}
7594
7595// NextWithContext advances to the next page of values.  If there was an error making
7596// the request the page does not advance and the error is returned.
7597func (page *RouteFilterListResultPage) NextWithContext(ctx context.Context) (err error) {
7598	if tracing.IsEnabled() {
7599		ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterListResultPage.NextWithContext")
7600		defer func() {
7601			sc := -1
7602			if page.Response().Response.Response != nil {
7603				sc = page.Response().Response.Response.StatusCode
7604			}
7605			tracing.EndSpan(ctx, sc, err)
7606		}()
7607	}
7608	for {
7609		next, err := page.fn(ctx, page.rflr)
7610		if err != nil {
7611			return err
7612		}
7613		page.rflr = next
7614		if !next.hasNextLink() || !next.IsEmpty() {
7615			break
7616		}
7617	}
7618	return nil
7619}
7620
7621// Next advances to the next page of values.  If there was an error making
7622// the request the page does not advance and the error is returned.
7623// Deprecated: Use NextWithContext() instead.
7624func (page *RouteFilterListResultPage) Next() error {
7625	return page.NextWithContext(context.Background())
7626}
7627
7628// NotDone returns true if the page enumeration should be started or is not yet complete.
7629func (page RouteFilterListResultPage) NotDone() bool {
7630	return !page.rflr.IsEmpty()
7631}
7632
7633// Response returns the raw server response from the last page request.
7634func (page RouteFilterListResultPage) Response() RouteFilterListResult {
7635	return page.rflr
7636}
7637
7638// Values returns the slice of values for the current page or nil if there are no values.
7639func (page RouteFilterListResultPage) Values() []RouteFilter {
7640	if page.rflr.IsEmpty() {
7641		return nil
7642	}
7643	return *page.rflr.Value
7644}
7645
7646// Creates a new instance of the RouteFilterListResultPage type.
7647func NewRouteFilterListResultPage(cur RouteFilterListResult, getNextPage func(context.Context, RouteFilterListResult) (RouteFilterListResult, error)) RouteFilterListResultPage {
7648	return RouteFilterListResultPage{
7649		fn:   getNextPage,
7650		rflr: cur,
7651	}
7652}
7653
7654// RouteFilterPropertiesFormat route Filter Resource
7655type RouteFilterPropertiesFormat struct {
7656	// Rules - Collection of RouteFilterRules contained within a route filter.
7657	Rules *[]RouteFilterRule `json:"rules,omitempty"`
7658	// Peerings - READ-ONLY; A collection of references to express route circuit peerings.
7659	Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"`
7660	// ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'.
7661	ProvisioningState *string `json:"provisioningState,omitempty"`
7662}
7663
7664// MarshalJSON is the custom marshaler for RouteFilterPropertiesFormat.
7665func (rfpf RouteFilterPropertiesFormat) MarshalJSON() ([]byte, error) {
7666	objectMap := make(map[string]interface{})
7667	if rfpf.Rules != nil {
7668		objectMap["rules"] = rfpf.Rules
7669	}
7670	return json.Marshal(objectMap)
7671}
7672
7673// RouteFilterRule route Filter Rule Resource
7674type RouteFilterRule struct {
7675	autorest.Response                `json:"-"`
7676	*RouteFilterRulePropertiesFormat `json:"properties,omitempty"`
7677	// Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource.
7678	Name *string `json:"name,omitempty"`
7679	// Location - Resource location.
7680	Location *string `json:"location,omitempty"`
7681	// Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated.
7682	Etag *string `json:"etag,omitempty"`
7683	// Tags - Resource tags.
7684	Tags map[string]*string `json:"tags"`
7685	// ID - Resource ID.
7686	ID *string `json:"id,omitempty"`
7687}
7688
7689// MarshalJSON is the custom marshaler for RouteFilterRule.
7690func (rfr RouteFilterRule) MarshalJSON() ([]byte, error) {
7691	objectMap := make(map[string]interface{})
7692	if rfr.RouteFilterRulePropertiesFormat != nil {
7693		objectMap["properties"] = rfr.RouteFilterRulePropertiesFormat
7694	}
7695	if rfr.Location != nil {
7696		objectMap["location"] = rfr.Location
7697	}
7698	if rfr.Tags != nil {
7699		objectMap["tags"] = rfr.Tags
7700	}
7701	if rfr.ID != nil {
7702		objectMap["id"] = rfr.ID
7703	}
7704	return json.Marshal(objectMap)
7705}
7706
7707// UnmarshalJSON is the custom unmarshaler for RouteFilterRule struct.
7708func (rfr *RouteFilterRule) UnmarshalJSON(body []byte) error {
7709	var m map[string]*json.RawMessage
7710	err := json.Unmarshal(body, &m)
7711	if err != nil {
7712		return err
7713	}
7714	for k, v := range m {
7715		switch k {
7716		case "properties":
7717			if v != nil {
7718				var routeFilterRulePropertiesFormat RouteFilterRulePropertiesFormat
7719				err = json.Unmarshal(*v, &routeFilterRulePropertiesFormat)
7720				if err != nil {
7721					return err
7722				}
7723				rfr.RouteFilterRulePropertiesFormat = &routeFilterRulePropertiesFormat
7724			}
7725		case "name":
7726			if v != nil {
7727				var name string
7728				err = json.Unmarshal(*v, &name)
7729				if err != nil {
7730					return err
7731				}
7732				rfr.Name = &name
7733			}
7734		case "location":
7735			if v != nil {
7736				var location string
7737				err = json.Unmarshal(*v, &location)
7738				if err != nil {
7739					return err
7740				}
7741				rfr.Location = &location
7742			}
7743		case "etag":
7744			if v != nil {
7745				var etag string
7746				err = json.Unmarshal(*v, &etag)
7747				if err != nil {
7748					return err
7749				}
7750				rfr.Etag = &etag
7751			}
7752		case "tags":
7753			if v != nil {
7754				var tags map[string]*string
7755				err = json.Unmarshal(*v, &tags)
7756				if err != nil {
7757					return err
7758				}
7759				rfr.Tags = tags
7760			}
7761		case "id":
7762			if v != nil {
7763				var ID string
7764				err = json.Unmarshal(*v, &ID)
7765				if err != nil {
7766					return err
7767				}
7768				rfr.ID = &ID
7769			}
7770		}
7771	}
7772
7773	return nil
7774}
7775
7776// RouteFilterRuleListResult response for the ListRouteFilterRules API service call
7777type RouteFilterRuleListResult struct {
7778	autorest.Response `json:"-"`
7779	// Value - Gets a list of RouteFilterRules in a resource group.
7780	Value *[]RouteFilterRule `json:"value,omitempty"`
7781	// NextLink - The URL to get the next set of results.
7782	NextLink *string `json:"nextLink,omitempty"`
7783}
7784
7785// RouteFilterRuleListResultIterator provides access to a complete listing of RouteFilterRule values.
7786type RouteFilterRuleListResultIterator struct {
7787	i    int
7788	page RouteFilterRuleListResultPage
7789}
7790
7791// NextWithContext advances to the next value.  If there was an error making
7792// the request the iterator does not advance and the error is returned.
7793func (iter *RouteFilterRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
7794	if tracing.IsEnabled() {
7795		ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultIterator.NextWithContext")
7796		defer func() {
7797			sc := -1
7798			if iter.Response().Response.Response != nil {
7799				sc = iter.Response().Response.Response.StatusCode
7800			}
7801			tracing.EndSpan(ctx, sc, err)
7802		}()
7803	}
7804	iter.i++
7805	if iter.i < len(iter.page.Values()) {
7806		return nil
7807	}
7808	err = iter.page.NextWithContext(ctx)
7809	if err != nil {
7810		iter.i--
7811		return err
7812	}
7813	iter.i = 0
7814	return nil
7815}
7816
7817// Next advances to the next value.  If there was an error making
7818// the request the iterator does not advance and the error is returned.
7819// Deprecated: Use NextWithContext() instead.
7820func (iter *RouteFilterRuleListResultIterator) Next() error {
7821	return iter.NextWithContext(context.Background())
7822}
7823
7824// NotDone returns true if the enumeration should be started or is not yet complete.
7825func (iter RouteFilterRuleListResultIterator) NotDone() bool {
7826	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7827}
7828
7829// Response returns the raw server response from the last page request.
7830func (iter RouteFilterRuleListResultIterator) Response() RouteFilterRuleListResult {
7831	return iter.page.Response()
7832}
7833
7834// Value returns the current value or a zero-initialized value if the
7835// iterator has advanced beyond the end of the collection.
7836func (iter RouteFilterRuleListResultIterator) Value() RouteFilterRule {
7837	if !iter.page.NotDone() {
7838		return RouteFilterRule{}
7839	}
7840	return iter.page.Values()[iter.i]
7841}
7842
7843// Creates a new instance of the RouteFilterRuleListResultIterator type.
7844func NewRouteFilterRuleListResultIterator(page RouteFilterRuleListResultPage) RouteFilterRuleListResultIterator {
7845	return RouteFilterRuleListResultIterator{page: page}
7846}
7847
7848// IsEmpty returns true if the ListResult contains no values.
7849func (rfrlr RouteFilterRuleListResult) IsEmpty() bool {
7850	return rfrlr.Value == nil || len(*rfrlr.Value) == 0
7851}
7852
7853// hasNextLink returns true if the NextLink is not empty.
7854func (rfrlr RouteFilterRuleListResult) hasNextLink() bool {
7855	return rfrlr.NextLink != nil && len(*rfrlr.NextLink) != 0
7856}
7857
7858// routeFilterRuleListResultPreparer prepares a request to retrieve the next set of results.
7859// It returns nil if no more results exist.
7860func (rfrlr RouteFilterRuleListResult) routeFilterRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
7861	if !rfrlr.hasNextLink() {
7862		return nil, nil
7863	}
7864	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7865		autorest.AsJSON(),
7866		autorest.AsGet(),
7867		autorest.WithBaseURL(to.String(rfrlr.NextLink)))
7868}
7869
7870// RouteFilterRuleListResultPage contains a page of RouteFilterRule values.
7871type RouteFilterRuleListResultPage struct {
7872	fn    func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)
7873	rfrlr RouteFilterRuleListResult
7874}
7875
7876// NextWithContext advances to the next page of values.  If there was an error making
7877// the request the page does not advance and the error is returned.
7878func (page *RouteFilterRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
7879	if tracing.IsEnabled() {
7880		ctx = tracing.StartSpan(ctx, fqdn+"/RouteFilterRuleListResultPage.NextWithContext")
7881		defer func() {
7882			sc := -1
7883			if page.Response().Response.Response != nil {
7884				sc = page.Response().Response.Response.StatusCode
7885			}
7886			tracing.EndSpan(ctx, sc, err)
7887		}()
7888	}
7889	for {
7890		next, err := page.fn(ctx, page.rfrlr)
7891		if err != nil {
7892			return err
7893		}
7894		page.rfrlr = next
7895		if !next.hasNextLink() || !next.IsEmpty() {
7896			break
7897		}
7898	}
7899	return nil
7900}
7901
7902// Next advances to the next page of values.  If there was an error making
7903// the request the page does not advance and the error is returned.
7904// Deprecated: Use NextWithContext() instead.
7905func (page *RouteFilterRuleListResultPage) Next() error {
7906	return page.NextWithContext(context.Background())
7907}
7908
7909// NotDone returns true if the page enumeration should be started or is not yet complete.
7910func (page RouteFilterRuleListResultPage) NotDone() bool {
7911	return !page.rfrlr.IsEmpty()
7912}
7913
7914// Response returns the raw server response from the last page request.
7915func (page RouteFilterRuleListResultPage) Response() RouteFilterRuleListResult {
7916	return page.rfrlr
7917}
7918
7919// Values returns the slice of values for the current page or nil if there are no values.
7920func (page RouteFilterRuleListResultPage) Values() []RouteFilterRule {
7921	if page.rfrlr.IsEmpty() {
7922		return nil
7923	}
7924	return *page.rfrlr.Value
7925}
7926
7927// Creates a new instance of the RouteFilterRuleListResultPage type.
7928func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage func(context.Context, RouteFilterRuleListResult) (RouteFilterRuleListResult, error)) RouteFilterRuleListResultPage {
7929	return RouteFilterRuleListResultPage{
7930		fn:    getNextPage,
7931		rfrlr: cur,
7932	}
7933}
7934
7935// RouteFilterRulePropertiesFormat route Filter Rule Resource
7936type RouteFilterRulePropertiesFormat struct {
7937	// Access - The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values include: 'Allow', 'Deny'
7938	Access Access `json:"access,omitempty"`
7939	// RouteFilterRuleType - The rule type of the rule. Valid value is: 'Community'
7940	RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"`
7941	// Communities - The collection for bgp community values to filter on. e.g. ['12076:5010','12076:5020']
7942	Communities *[]string `json:"communities,omitempty"`
7943	// ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', 'Succeeded' and 'Failed'.
7944	ProvisioningState *string `json:"provisioningState,omitempty"`
7945}
7946
7947// MarshalJSON is the custom marshaler for RouteFilterRulePropertiesFormat.
7948func (rfrpf RouteFilterRulePropertiesFormat) MarshalJSON() ([]byte, error) {
7949	objectMap := make(map[string]interface{})
7950	if rfrpf.Access != "" {
7951		objectMap["access"] = rfrpf.Access
7952	}
7953	if rfrpf.RouteFilterRuleType != nil {
7954		objectMap["routeFilterRuleType"] = rfrpf.RouteFilterRuleType
7955	}
7956	if rfrpf.Communities != nil {
7957		objectMap["communities"] = rfrpf.Communities
7958	}
7959	return json.Marshal(objectMap)
7960}
7961
7962// RouteFilterRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
7963// long-running operation.
7964type RouteFilterRulesCreateOrUpdateFuture struct {
7965	azure.FutureAPI
7966	// Result returns the result of the asynchronous operation.
7967	// If the operation has not completed it will return an error.
7968	Result func(RouteFilterRulesClient) (RouteFilterRule, error)
7969}
7970
7971// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7972func (future *RouteFilterRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
7973	var azFuture azure.Future
7974	if err := json.Unmarshal(body, &azFuture); err != nil {
7975		return err
7976	}
7977	future.FutureAPI = &azFuture
7978	future.Result = future.result
7979	return nil
7980}
7981
7982// result is the default implementation for RouteFilterRulesCreateOrUpdateFuture.Result.
7983func (future *RouteFilterRulesCreateOrUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) {
7984	var done bool
7985	done, err = future.DoneWithContext(context.Background(), client)
7986	if err != nil {
7987		err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7988		return
7989	}
7990	if !done {
7991		rfr.Response.Response = future.Response()
7992		err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesCreateOrUpdateFuture")
7993		return
7994	}
7995	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7996	if rfr.Response.Response, err = future.GetResult(sender); err == nil && rfr.Response.Response.StatusCode != http.StatusNoContent {
7997		rfr, err = client.CreateOrUpdateResponder(rfr.Response.Response)
7998		if err != nil {
7999			err = autorest.NewErrorWithError(err, "network.RouteFilterRulesCreateOrUpdateFuture", "Result", rfr.Response.Response, "Failure responding to request")
8000		}
8001	}
8002	return
8003}
8004
8005// RouteFilterRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
8006// operation.
8007type RouteFilterRulesDeleteFuture struct {
8008	azure.FutureAPI
8009	// Result returns the result of the asynchronous operation.
8010	// If the operation has not completed it will return an error.
8011	Result func(RouteFilterRulesClient) (autorest.Response, error)
8012}
8013
8014// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8015func (future *RouteFilterRulesDeleteFuture) UnmarshalJSON(body []byte) error {
8016	var azFuture azure.Future
8017	if err := json.Unmarshal(body, &azFuture); err != nil {
8018		return err
8019	}
8020	future.FutureAPI = &azFuture
8021	future.Result = future.result
8022	return nil
8023}
8024
8025// result is the default implementation for RouteFilterRulesDeleteFuture.Result.
8026func (future *RouteFilterRulesDeleteFuture) result(client RouteFilterRulesClient) (ar autorest.Response, err error) {
8027	var done bool
8028	done, err = future.DoneWithContext(context.Background(), client)
8029	if err != nil {
8030		err = autorest.NewErrorWithError(err, "network.RouteFilterRulesDeleteFuture", "Result", future.Response(), "Polling failure")
8031		return
8032	}
8033	if !done {
8034		ar.Response = future.Response()
8035		err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesDeleteFuture")
8036		return
8037	}
8038	ar.Response = future.Response()
8039	return
8040}
8041
8042// RouteFilterRulesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8043// operation.
8044type RouteFilterRulesUpdateFuture struct {
8045	azure.FutureAPI
8046	// Result returns the result of the asynchronous operation.
8047	// If the operation has not completed it will return an error.
8048	Result func(RouteFilterRulesClient) (RouteFilterRule, error)
8049}
8050
8051// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8052func (future *RouteFilterRulesUpdateFuture) UnmarshalJSON(body []byte) error {
8053	var azFuture azure.Future
8054	if err := json.Unmarshal(body, &azFuture); err != nil {
8055		return err
8056	}
8057	future.FutureAPI = &azFuture
8058	future.Result = future.result
8059	return nil
8060}
8061
8062// result is the default implementation for RouteFilterRulesUpdateFuture.Result.
8063func (future *RouteFilterRulesUpdateFuture) result(client RouteFilterRulesClient) (rfr RouteFilterRule, err error) {
8064	var done bool
8065	done, err = future.DoneWithContext(context.Background(), client)
8066	if err != nil {
8067		err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", future.Response(), "Polling failure")
8068		return
8069	}
8070	if !done {
8071		rfr.Response.Response = future.Response()
8072		err = azure.NewAsyncOpIncompleteError("network.RouteFilterRulesUpdateFuture")
8073		return
8074	}
8075	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8076	if rfr.Response.Response, err = future.GetResult(sender); err == nil && rfr.Response.Response.StatusCode != http.StatusNoContent {
8077		rfr, err = client.UpdateResponder(rfr.Response.Response)
8078		if err != nil {
8079			err = autorest.NewErrorWithError(err, "network.RouteFilterRulesUpdateFuture", "Result", rfr.Response.Response, "Failure responding to request")
8080		}
8081	}
8082	return
8083}
8084
8085// RouteFiltersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
8086// long-running operation.
8087type RouteFiltersCreateOrUpdateFuture struct {
8088	azure.FutureAPI
8089	// Result returns the result of the asynchronous operation.
8090	// If the operation has not completed it will return an error.
8091	Result func(RouteFiltersClient) (RouteFilter, error)
8092}
8093
8094// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8095func (future *RouteFiltersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8096	var azFuture azure.Future
8097	if err := json.Unmarshal(body, &azFuture); err != nil {
8098		return err
8099	}
8100	future.FutureAPI = &azFuture
8101	future.Result = future.result
8102	return nil
8103}
8104
8105// result is the default implementation for RouteFiltersCreateOrUpdateFuture.Result.
8106func (future *RouteFiltersCreateOrUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) {
8107	var done bool
8108	done, err = future.DoneWithContext(context.Background(), client)
8109	if err != nil {
8110		err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8111		return
8112	}
8113	if !done {
8114		rf.Response.Response = future.Response()
8115		err = azure.NewAsyncOpIncompleteError("network.RouteFiltersCreateOrUpdateFuture")
8116		return
8117	}
8118	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8119	if rf.Response.Response, err = future.GetResult(sender); err == nil && rf.Response.Response.StatusCode != http.StatusNoContent {
8120		rf, err = client.CreateOrUpdateResponder(rf.Response.Response)
8121		if err != nil {
8122			err = autorest.NewErrorWithError(err, "network.RouteFiltersCreateOrUpdateFuture", "Result", rf.Response.Response, "Failure responding to request")
8123		}
8124	}
8125	return
8126}
8127
8128// RouteFiltersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
8129// operation.
8130type RouteFiltersDeleteFuture struct {
8131	azure.FutureAPI
8132	// Result returns the result of the asynchronous operation.
8133	// If the operation has not completed it will return an error.
8134	Result func(RouteFiltersClient) (autorest.Response, error)
8135}
8136
8137// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8138func (future *RouteFiltersDeleteFuture) UnmarshalJSON(body []byte) error {
8139	var azFuture azure.Future
8140	if err := json.Unmarshal(body, &azFuture); err != nil {
8141		return err
8142	}
8143	future.FutureAPI = &azFuture
8144	future.Result = future.result
8145	return nil
8146}
8147
8148// result is the default implementation for RouteFiltersDeleteFuture.Result.
8149func (future *RouteFiltersDeleteFuture) result(client RouteFiltersClient) (ar autorest.Response, err error) {
8150	var done bool
8151	done, err = future.DoneWithContext(context.Background(), client)
8152	if err != nil {
8153		err = autorest.NewErrorWithError(err, "network.RouteFiltersDeleteFuture", "Result", future.Response(), "Polling failure")
8154		return
8155	}
8156	if !done {
8157		ar.Response = future.Response()
8158		err = azure.NewAsyncOpIncompleteError("network.RouteFiltersDeleteFuture")
8159		return
8160	}
8161	ar.Response = future.Response()
8162	return
8163}
8164
8165// RouteFiltersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8166// operation.
8167type RouteFiltersUpdateFuture struct {
8168	azure.FutureAPI
8169	// Result returns the result of the asynchronous operation.
8170	// If the operation has not completed it will return an error.
8171	Result func(RouteFiltersClient) (RouteFilter, error)
8172}
8173
8174// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8175func (future *RouteFiltersUpdateFuture) UnmarshalJSON(body []byte) error {
8176	var azFuture azure.Future
8177	if err := json.Unmarshal(body, &azFuture); err != nil {
8178		return err
8179	}
8180	future.FutureAPI = &azFuture
8181	future.Result = future.result
8182	return nil
8183}
8184
8185// result is the default implementation for RouteFiltersUpdateFuture.Result.
8186func (future *RouteFiltersUpdateFuture) result(client RouteFiltersClient) (rf RouteFilter, err error) {
8187	var done bool
8188	done, err = future.DoneWithContext(context.Background(), client)
8189	if err != nil {
8190		err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", future.Response(), "Polling failure")
8191		return
8192	}
8193	if !done {
8194		rf.Response.Response = future.Response()
8195		err = azure.NewAsyncOpIncompleteError("network.RouteFiltersUpdateFuture")
8196		return
8197	}
8198	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8199	if rf.Response.Response, err = future.GetResult(sender); err == nil && rf.Response.Response.StatusCode != http.StatusNoContent {
8200		rf, err = client.UpdateResponder(rf.Response.Response)
8201		if err != nil {
8202			err = autorest.NewErrorWithError(err, "network.RouteFiltersUpdateFuture", "Result", rf.Response.Response, "Failure responding to request")
8203		}
8204	}
8205	return
8206}
8207
8208// RouteListResult response for the ListRoute API service call
8209type RouteListResult struct {
8210	autorest.Response `json:"-"`
8211	// Value - Gets a list of routes in a resource group.
8212	Value *[]Route `json:"value,omitempty"`
8213	// NextLink - The URL to get the next set of results.
8214	NextLink *string `json:"nextLink,omitempty"`
8215}
8216
8217// RouteListResultIterator provides access to a complete listing of Route values.
8218type RouteListResultIterator struct {
8219	i    int
8220	page RouteListResultPage
8221}
8222
8223// NextWithContext advances to the next value.  If there was an error making
8224// the request the iterator does not advance and the error is returned.
8225func (iter *RouteListResultIterator) NextWithContext(ctx context.Context) (err error) {
8226	if tracing.IsEnabled() {
8227		ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultIterator.NextWithContext")
8228		defer func() {
8229			sc := -1
8230			if iter.Response().Response.Response != nil {
8231				sc = iter.Response().Response.Response.StatusCode
8232			}
8233			tracing.EndSpan(ctx, sc, err)
8234		}()
8235	}
8236	iter.i++
8237	if iter.i < len(iter.page.Values()) {
8238		return nil
8239	}
8240	err = iter.page.NextWithContext(ctx)
8241	if err != nil {
8242		iter.i--
8243		return err
8244	}
8245	iter.i = 0
8246	return nil
8247}
8248
8249// Next advances to the next value.  If there was an error making
8250// the request the iterator does not advance and the error is returned.
8251// Deprecated: Use NextWithContext() instead.
8252func (iter *RouteListResultIterator) Next() error {
8253	return iter.NextWithContext(context.Background())
8254}
8255
8256// NotDone returns true if the enumeration should be started or is not yet complete.
8257func (iter RouteListResultIterator) NotDone() bool {
8258	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8259}
8260
8261// Response returns the raw server response from the last page request.
8262func (iter RouteListResultIterator) Response() RouteListResult {
8263	return iter.page.Response()
8264}
8265
8266// Value returns the current value or a zero-initialized value if the
8267// iterator has advanced beyond the end of the collection.
8268func (iter RouteListResultIterator) Value() Route {
8269	if !iter.page.NotDone() {
8270		return Route{}
8271	}
8272	return iter.page.Values()[iter.i]
8273}
8274
8275// Creates a new instance of the RouteListResultIterator type.
8276func NewRouteListResultIterator(page RouteListResultPage) RouteListResultIterator {
8277	return RouteListResultIterator{page: page}
8278}
8279
8280// IsEmpty returns true if the ListResult contains no values.
8281func (rlr RouteListResult) IsEmpty() bool {
8282	return rlr.Value == nil || len(*rlr.Value) == 0
8283}
8284
8285// hasNextLink returns true if the NextLink is not empty.
8286func (rlr RouteListResult) hasNextLink() bool {
8287	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
8288}
8289
8290// routeListResultPreparer prepares a request to retrieve the next set of results.
8291// It returns nil if no more results exist.
8292func (rlr RouteListResult) routeListResultPreparer(ctx context.Context) (*http.Request, error) {
8293	if !rlr.hasNextLink() {
8294		return nil, nil
8295	}
8296	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8297		autorest.AsJSON(),
8298		autorest.AsGet(),
8299		autorest.WithBaseURL(to.String(rlr.NextLink)))
8300}
8301
8302// RouteListResultPage contains a page of Route values.
8303type RouteListResultPage struct {
8304	fn  func(context.Context, RouteListResult) (RouteListResult, error)
8305	rlr RouteListResult
8306}
8307
8308// NextWithContext advances to the next page of values.  If there was an error making
8309// the request the page does not advance and the error is returned.
8310func (page *RouteListResultPage) NextWithContext(ctx context.Context) (err error) {
8311	if tracing.IsEnabled() {
8312		ctx = tracing.StartSpan(ctx, fqdn+"/RouteListResultPage.NextWithContext")
8313		defer func() {
8314			sc := -1
8315			if page.Response().Response.Response != nil {
8316				sc = page.Response().Response.Response.StatusCode
8317			}
8318			tracing.EndSpan(ctx, sc, err)
8319		}()
8320	}
8321	for {
8322		next, err := page.fn(ctx, page.rlr)
8323		if err != nil {
8324			return err
8325		}
8326		page.rlr = next
8327		if !next.hasNextLink() || !next.IsEmpty() {
8328			break
8329		}
8330	}
8331	return nil
8332}
8333
8334// Next advances to the next page of values.  If there was an error making
8335// the request the page does not advance and the error is returned.
8336// Deprecated: Use NextWithContext() instead.
8337func (page *RouteListResultPage) Next() error {
8338	return page.NextWithContext(context.Background())
8339}
8340
8341// NotDone returns true if the page enumeration should be started or is not yet complete.
8342func (page RouteListResultPage) NotDone() bool {
8343	return !page.rlr.IsEmpty()
8344}
8345
8346// Response returns the raw server response from the last page request.
8347func (page RouteListResultPage) Response() RouteListResult {
8348	return page.rlr
8349}
8350
8351// Values returns the slice of values for the current page or nil if there are no values.
8352func (page RouteListResultPage) Values() []Route {
8353	if page.rlr.IsEmpty() {
8354		return nil
8355	}
8356	return *page.rlr.Value
8357}
8358
8359// Creates a new instance of the RouteListResultPage type.
8360func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Context, RouteListResult) (RouteListResult, error)) RouteListResultPage {
8361	return RouteListResultPage{
8362		fn:  getNextPage,
8363		rlr: cur,
8364	}
8365}
8366
8367// RoutePropertiesFormat route resource
8368type RoutePropertiesFormat struct {
8369	// AddressPrefix - The destination CIDR to which the route applies.
8370	AddressPrefix *string `json:"addressPrefix,omitempty"`
8371	// 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'
8372	NextHopType RouteNextHopType `json:"nextHopType,omitempty"`
8373	// NextHopIPAddress - The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance.
8374	NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"`
8375	// ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
8376	ProvisioningState *string `json:"provisioningState,omitempty"`
8377}
8378
8379// RoutesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8380// operation.
8381type RoutesCreateOrUpdateFuture struct {
8382	azure.FutureAPI
8383	// Result returns the result of the asynchronous operation.
8384	// If the operation has not completed it will return an error.
8385	Result func(RoutesClient) (Route, error)
8386}
8387
8388// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8389func (future *RoutesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8390	var azFuture azure.Future
8391	if err := json.Unmarshal(body, &azFuture); err != nil {
8392		return err
8393	}
8394	future.FutureAPI = &azFuture
8395	future.Result = future.result
8396	return nil
8397}
8398
8399// result is the default implementation for RoutesCreateOrUpdateFuture.Result.
8400func (future *RoutesCreateOrUpdateFuture) result(client RoutesClient) (r Route, err error) {
8401	var done bool
8402	done, err = future.DoneWithContext(context.Background(), client)
8403	if err != nil {
8404		err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8405		return
8406	}
8407	if !done {
8408		r.Response.Response = future.Response()
8409		err = azure.NewAsyncOpIncompleteError("network.RoutesCreateOrUpdateFuture")
8410		return
8411	}
8412	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8413	if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent {
8414		r, err = client.CreateOrUpdateResponder(r.Response.Response)
8415		if err != nil {
8416			err = autorest.NewErrorWithError(err, "network.RoutesCreateOrUpdateFuture", "Result", r.Response.Response, "Failure responding to request")
8417		}
8418	}
8419	return
8420}
8421
8422// RoutesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
8423type RoutesDeleteFuture struct {
8424	azure.FutureAPI
8425	// Result returns the result of the asynchronous operation.
8426	// If the operation has not completed it will return an error.
8427	Result func(RoutesClient) (autorest.Response, error)
8428}
8429
8430// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8431func (future *RoutesDeleteFuture) UnmarshalJSON(body []byte) error {
8432	var azFuture azure.Future
8433	if err := json.Unmarshal(body, &azFuture); err != nil {
8434		return err
8435	}
8436	future.FutureAPI = &azFuture
8437	future.Result = future.result
8438	return nil
8439}
8440
8441// result is the default implementation for RoutesDeleteFuture.Result.
8442func (future *RoutesDeleteFuture) result(client RoutesClient) (ar autorest.Response, err error) {
8443	var done bool
8444	done, err = future.DoneWithContext(context.Background(), client)
8445	if err != nil {
8446		err = autorest.NewErrorWithError(err, "network.RoutesDeleteFuture", "Result", future.Response(), "Polling failure")
8447		return
8448	}
8449	if !done {
8450		ar.Response = future.Response()
8451		err = azure.NewAsyncOpIncompleteError("network.RoutesDeleteFuture")
8452		return
8453	}
8454	ar.Response = future.Response()
8455	return
8456}
8457
8458// RouteTable route table resource.
8459type RouteTable struct {
8460	autorest.Response           `json:"-"`
8461	*RouteTablePropertiesFormat `json:"properties,omitempty"`
8462	// Etag - Gets a unique read-only string that changes whenever the resource is updated.
8463	Etag *string `json:"etag,omitempty"`
8464	// ID - Resource ID.
8465	ID *string `json:"id,omitempty"`
8466	// Name - READ-ONLY; Resource name.
8467	Name *string `json:"name,omitempty"`
8468	// Type - READ-ONLY; Resource type.
8469	Type *string `json:"type,omitempty"`
8470	// Location - Resource location.
8471	Location *string `json:"location,omitempty"`
8472	// Tags - Resource tags.
8473	Tags map[string]*string `json:"tags"`
8474}
8475
8476// MarshalJSON is the custom marshaler for RouteTable.
8477func (rt RouteTable) MarshalJSON() ([]byte, error) {
8478	objectMap := make(map[string]interface{})
8479	if rt.RouteTablePropertiesFormat != nil {
8480		objectMap["properties"] = rt.RouteTablePropertiesFormat
8481	}
8482	if rt.Etag != nil {
8483		objectMap["etag"] = rt.Etag
8484	}
8485	if rt.ID != nil {
8486		objectMap["id"] = rt.ID
8487	}
8488	if rt.Location != nil {
8489		objectMap["location"] = rt.Location
8490	}
8491	if rt.Tags != nil {
8492		objectMap["tags"] = rt.Tags
8493	}
8494	return json.Marshal(objectMap)
8495}
8496
8497// UnmarshalJSON is the custom unmarshaler for RouteTable struct.
8498func (rt *RouteTable) UnmarshalJSON(body []byte) error {
8499	var m map[string]*json.RawMessage
8500	err := json.Unmarshal(body, &m)
8501	if err != nil {
8502		return err
8503	}
8504	for k, v := range m {
8505		switch k {
8506		case "properties":
8507			if v != nil {
8508				var routeTablePropertiesFormat RouteTablePropertiesFormat
8509				err = json.Unmarshal(*v, &routeTablePropertiesFormat)
8510				if err != nil {
8511					return err
8512				}
8513				rt.RouteTablePropertiesFormat = &routeTablePropertiesFormat
8514			}
8515		case "etag":
8516			if v != nil {
8517				var etag string
8518				err = json.Unmarshal(*v, &etag)
8519				if err != nil {
8520					return err
8521				}
8522				rt.Etag = &etag
8523			}
8524		case "id":
8525			if v != nil {
8526				var ID string
8527				err = json.Unmarshal(*v, &ID)
8528				if err != nil {
8529					return err
8530				}
8531				rt.ID = &ID
8532			}
8533		case "name":
8534			if v != nil {
8535				var name string
8536				err = json.Unmarshal(*v, &name)
8537				if err != nil {
8538					return err
8539				}
8540				rt.Name = &name
8541			}
8542		case "type":
8543			if v != nil {
8544				var typeVar string
8545				err = json.Unmarshal(*v, &typeVar)
8546				if err != nil {
8547					return err
8548				}
8549				rt.Type = &typeVar
8550			}
8551		case "location":
8552			if v != nil {
8553				var location string
8554				err = json.Unmarshal(*v, &location)
8555				if err != nil {
8556					return err
8557				}
8558				rt.Location = &location
8559			}
8560		case "tags":
8561			if v != nil {
8562				var tags map[string]*string
8563				err = json.Unmarshal(*v, &tags)
8564				if err != nil {
8565					return err
8566				}
8567				rt.Tags = tags
8568			}
8569		}
8570	}
8571
8572	return nil
8573}
8574
8575// RouteTableListResult response for the ListRouteTable API service call.
8576type RouteTableListResult struct {
8577	autorest.Response `json:"-"`
8578	// Value - Gets a list of route tables in a resource group.
8579	Value *[]RouteTable `json:"value,omitempty"`
8580	// NextLink - The URL to get the next set of results.
8581	NextLink *string `json:"nextLink,omitempty"`
8582}
8583
8584// RouteTableListResultIterator provides access to a complete listing of RouteTable values.
8585type RouteTableListResultIterator struct {
8586	i    int
8587	page RouteTableListResultPage
8588}
8589
8590// NextWithContext advances to the next value.  If there was an error making
8591// the request the iterator does not advance and the error is returned.
8592func (iter *RouteTableListResultIterator) NextWithContext(ctx context.Context) (err error) {
8593	if tracing.IsEnabled() {
8594		ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultIterator.NextWithContext")
8595		defer func() {
8596			sc := -1
8597			if iter.Response().Response.Response != nil {
8598				sc = iter.Response().Response.Response.StatusCode
8599			}
8600			tracing.EndSpan(ctx, sc, err)
8601		}()
8602	}
8603	iter.i++
8604	if iter.i < len(iter.page.Values()) {
8605		return nil
8606	}
8607	err = iter.page.NextWithContext(ctx)
8608	if err != nil {
8609		iter.i--
8610		return err
8611	}
8612	iter.i = 0
8613	return nil
8614}
8615
8616// Next advances to the next value.  If there was an error making
8617// the request the iterator does not advance and the error is returned.
8618// Deprecated: Use NextWithContext() instead.
8619func (iter *RouteTableListResultIterator) Next() error {
8620	return iter.NextWithContext(context.Background())
8621}
8622
8623// NotDone returns true if the enumeration should be started or is not yet complete.
8624func (iter RouteTableListResultIterator) NotDone() bool {
8625	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8626}
8627
8628// Response returns the raw server response from the last page request.
8629func (iter RouteTableListResultIterator) Response() RouteTableListResult {
8630	return iter.page.Response()
8631}
8632
8633// Value returns the current value or a zero-initialized value if the
8634// iterator has advanced beyond the end of the collection.
8635func (iter RouteTableListResultIterator) Value() RouteTable {
8636	if !iter.page.NotDone() {
8637		return RouteTable{}
8638	}
8639	return iter.page.Values()[iter.i]
8640}
8641
8642// Creates a new instance of the RouteTableListResultIterator type.
8643func NewRouteTableListResultIterator(page RouteTableListResultPage) RouteTableListResultIterator {
8644	return RouteTableListResultIterator{page: page}
8645}
8646
8647// IsEmpty returns true if the ListResult contains no values.
8648func (rtlr RouteTableListResult) IsEmpty() bool {
8649	return rtlr.Value == nil || len(*rtlr.Value) == 0
8650}
8651
8652// hasNextLink returns true if the NextLink is not empty.
8653func (rtlr RouteTableListResult) hasNextLink() bool {
8654	return rtlr.NextLink != nil && len(*rtlr.NextLink) != 0
8655}
8656
8657// routeTableListResultPreparer prepares a request to retrieve the next set of results.
8658// It returns nil if no more results exist.
8659func (rtlr RouteTableListResult) routeTableListResultPreparer(ctx context.Context) (*http.Request, error) {
8660	if !rtlr.hasNextLink() {
8661		return nil, nil
8662	}
8663	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8664		autorest.AsJSON(),
8665		autorest.AsGet(),
8666		autorest.WithBaseURL(to.String(rtlr.NextLink)))
8667}
8668
8669// RouteTableListResultPage contains a page of RouteTable values.
8670type RouteTableListResultPage struct {
8671	fn   func(context.Context, RouteTableListResult) (RouteTableListResult, error)
8672	rtlr RouteTableListResult
8673}
8674
8675// NextWithContext advances to the next page of values.  If there was an error making
8676// the request the page does not advance and the error is returned.
8677func (page *RouteTableListResultPage) NextWithContext(ctx context.Context) (err error) {
8678	if tracing.IsEnabled() {
8679		ctx = tracing.StartSpan(ctx, fqdn+"/RouteTableListResultPage.NextWithContext")
8680		defer func() {
8681			sc := -1
8682			if page.Response().Response.Response != nil {
8683				sc = page.Response().Response.Response.StatusCode
8684			}
8685			tracing.EndSpan(ctx, sc, err)
8686		}()
8687	}
8688	for {
8689		next, err := page.fn(ctx, page.rtlr)
8690		if err != nil {
8691			return err
8692		}
8693		page.rtlr = next
8694		if !next.hasNextLink() || !next.IsEmpty() {
8695			break
8696		}
8697	}
8698	return nil
8699}
8700
8701// Next advances to the next page of values.  If there was an error making
8702// the request the page does not advance and the error is returned.
8703// Deprecated: Use NextWithContext() instead.
8704func (page *RouteTableListResultPage) Next() error {
8705	return page.NextWithContext(context.Background())
8706}
8707
8708// NotDone returns true if the page enumeration should be started or is not yet complete.
8709func (page RouteTableListResultPage) NotDone() bool {
8710	return !page.rtlr.IsEmpty()
8711}
8712
8713// Response returns the raw server response from the last page request.
8714func (page RouteTableListResultPage) Response() RouteTableListResult {
8715	return page.rtlr
8716}
8717
8718// Values returns the slice of values for the current page or nil if there are no values.
8719func (page RouteTableListResultPage) Values() []RouteTable {
8720	if page.rtlr.IsEmpty() {
8721		return nil
8722	}
8723	return *page.rtlr.Value
8724}
8725
8726// Creates a new instance of the RouteTableListResultPage type.
8727func NewRouteTableListResultPage(cur RouteTableListResult, getNextPage func(context.Context, RouteTableListResult) (RouteTableListResult, error)) RouteTableListResultPage {
8728	return RouteTableListResultPage{
8729		fn:   getNextPage,
8730		rtlr: cur,
8731	}
8732}
8733
8734// RouteTablePropertiesFormat route Table resource
8735type RouteTablePropertiesFormat struct {
8736	// Routes - Collection of routes contained within a route table.
8737	Routes *[]Route `json:"routes,omitempty"`
8738	// Subnets - READ-ONLY; A collection of references to subnets.
8739	Subnets *[]Subnet `json:"subnets,omitempty"`
8740	// ProvisioningState - The provisioning state of the resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
8741	ProvisioningState *string `json:"provisioningState,omitempty"`
8742}
8743
8744// MarshalJSON is the custom marshaler for RouteTablePropertiesFormat.
8745func (rtpf RouteTablePropertiesFormat) MarshalJSON() ([]byte, error) {
8746	objectMap := make(map[string]interface{})
8747	if rtpf.Routes != nil {
8748		objectMap["routes"] = rtpf.Routes
8749	}
8750	if rtpf.ProvisioningState != nil {
8751		objectMap["provisioningState"] = rtpf.ProvisioningState
8752	}
8753	return json.Marshal(objectMap)
8754}
8755
8756// RouteTablesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
8757// long-running operation.
8758type RouteTablesCreateOrUpdateFuture struct {
8759	azure.FutureAPI
8760	// Result returns the result of the asynchronous operation.
8761	// If the operation has not completed it will return an error.
8762	Result func(RouteTablesClient) (RouteTable, error)
8763}
8764
8765// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8766func (future *RouteTablesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8767	var azFuture azure.Future
8768	if err := json.Unmarshal(body, &azFuture); err != nil {
8769		return err
8770	}
8771	future.FutureAPI = &azFuture
8772	future.Result = future.result
8773	return nil
8774}
8775
8776// result is the default implementation for RouteTablesCreateOrUpdateFuture.Result.
8777func (future *RouteTablesCreateOrUpdateFuture) result(client RouteTablesClient) (rt RouteTable, err error) {
8778	var done bool
8779	done, err = future.DoneWithContext(context.Background(), client)
8780	if err != nil {
8781		err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8782		return
8783	}
8784	if !done {
8785		rt.Response.Response = future.Response()
8786		err = azure.NewAsyncOpIncompleteError("network.RouteTablesCreateOrUpdateFuture")
8787		return
8788	}
8789	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8790	if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent {
8791		rt, err = client.CreateOrUpdateResponder(rt.Response.Response)
8792		if err != nil {
8793			err = autorest.NewErrorWithError(err, "network.RouteTablesCreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request")
8794		}
8795	}
8796	return
8797}
8798
8799// RouteTablesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
8800// operation.
8801type RouteTablesDeleteFuture struct {
8802	azure.FutureAPI
8803	// Result returns the result of the asynchronous operation.
8804	// If the operation has not completed it will return an error.
8805	Result func(RouteTablesClient) (autorest.Response, error)
8806}
8807
8808// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8809func (future *RouteTablesDeleteFuture) UnmarshalJSON(body []byte) error {
8810	var azFuture azure.Future
8811	if err := json.Unmarshal(body, &azFuture); err != nil {
8812		return err
8813	}
8814	future.FutureAPI = &azFuture
8815	future.Result = future.result
8816	return nil
8817}
8818
8819// result is the default implementation for RouteTablesDeleteFuture.Result.
8820func (future *RouteTablesDeleteFuture) result(client RouteTablesClient) (ar autorest.Response, err error) {
8821	var done bool
8822	done, err = future.DoneWithContext(context.Background(), client)
8823	if err != nil {
8824		err = autorest.NewErrorWithError(err, "network.RouteTablesDeleteFuture", "Result", future.Response(), "Polling failure")
8825		return
8826	}
8827	if !done {
8828		ar.Response = future.Response()
8829		err = azure.NewAsyncOpIncompleteError("network.RouteTablesDeleteFuture")
8830		return
8831	}
8832	ar.Response = future.Response()
8833	return
8834}
8835
8836// SecurityGroup networkSecurityGroup resource.
8837type SecurityGroup struct {
8838	autorest.Response              `json:"-"`
8839	*SecurityGroupPropertiesFormat `json:"properties,omitempty"`
8840	// Etag - A unique read-only string that changes whenever the resource is updated.
8841	Etag *string `json:"etag,omitempty"`
8842	// ID - Resource ID.
8843	ID *string `json:"id,omitempty"`
8844	// Name - READ-ONLY; Resource name.
8845	Name *string `json:"name,omitempty"`
8846	// Type - READ-ONLY; Resource type.
8847	Type *string `json:"type,omitempty"`
8848	// Location - Resource location.
8849	Location *string `json:"location,omitempty"`
8850	// Tags - Resource tags.
8851	Tags map[string]*string `json:"tags"`
8852}
8853
8854// MarshalJSON is the custom marshaler for SecurityGroup.
8855func (sg SecurityGroup) MarshalJSON() ([]byte, error) {
8856	objectMap := make(map[string]interface{})
8857	if sg.SecurityGroupPropertiesFormat != nil {
8858		objectMap["properties"] = sg.SecurityGroupPropertiesFormat
8859	}
8860	if sg.Etag != nil {
8861		objectMap["etag"] = sg.Etag
8862	}
8863	if sg.ID != nil {
8864		objectMap["id"] = sg.ID
8865	}
8866	if sg.Location != nil {
8867		objectMap["location"] = sg.Location
8868	}
8869	if sg.Tags != nil {
8870		objectMap["tags"] = sg.Tags
8871	}
8872	return json.Marshal(objectMap)
8873}
8874
8875// UnmarshalJSON is the custom unmarshaler for SecurityGroup struct.
8876func (sg *SecurityGroup) UnmarshalJSON(body []byte) error {
8877	var m map[string]*json.RawMessage
8878	err := json.Unmarshal(body, &m)
8879	if err != nil {
8880		return err
8881	}
8882	for k, v := range m {
8883		switch k {
8884		case "properties":
8885			if v != nil {
8886				var securityGroupPropertiesFormat SecurityGroupPropertiesFormat
8887				err = json.Unmarshal(*v, &securityGroupPropertiesFormat)
8888				if err != nil {
8889					return err
8890				}
8891				sg.SecurityGroupPropertiesFormat = &securityGroupPropertiesFormat
8892			}
8893		case "etag":
8894			if v != nil {
8895				var etag string
8896				err = json.Unmarshal(*v, &etag)
8897				if err != nil {
8898					return err
8899				}
8900				sg.Etag = &etag
8901			}
8902		case "id":
8903			if v != nil {
8904				var ID string
8905				err = json.Unmarshal(*v, &ID)
8906				if err != nil {
8907					return err
8908				}
8909				sg.ID = &ID
8910			}
8911		case "name":
8912			if v != nil {
8913				var name string
8914				err = json.Unmarshal(*v, &name)
8915				if err != nil {
8916					return err
8917				}
8918				sg.Name = &name
8919			}
8920		case "type":
8921			if v != nil {
8922				var typeVar string
8923				err = json.Unmarshal(*v, &typeVar)
8924				if err != nil {
8925					return err
8926				}
8927				sg.Type = &typeVar
8928			}
8929		case "location":
8930			if v != nil {
8931				var location string
8932				err = json.Unmarshal(*v, &location)
8933				if err != nil {
8934					return err
8935				}
8936				sg.Location = &location
8937			}
8938		case "tags":
8939			if v != nil {
8940				var tags map[string]*string
8941				err = json.Unmarshal(*v, &tags)
8942				if err != nil {
8943					return err
8944				}
8945				sg.Tags = tags
8946			}
8947		}
8948	}
8949
8950	return nil
8951}
8952
8953// SecurityGroupListResult response for ListNetworkSecurityGroups API service call.
8954type SecurityGroupListResult struct {
8955	autorest.Response `json:"-"`
8956	// Value - A list of NetworkSecurityGroup resources.
8957	Value *[]SecurityGroup `json:"value,omitempty"`
8958	// NextLink - The URL to get the next set of results.
8959	NextLink *string `json:"nextLink,omitempty"`
8960}
8961
8962// SecurityGroupListResultIterator provides access to a complete listing of SecurityGroup values.
8963type SecurityGroupListResultIterator struct {
8964	i    int
8965	page SecurityGroupListResultPage
8966}
8967
8968// NextWithContext advances to the next value.  If there was an error making
8969// the request the iterator does not advance and the error is returned.
8970func (iter *SecurityGroupListResultIterator) NextWithContext(ctx context.Context) (err error) {
8971	if tracing.IsEnabled() {
8972		ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultIterator.NextWithContext")
8973		defer func() {
8974			sc := -1
8975			if iter.Response().Response.Response != nil {
8976				sc = iter.Response().Response.Response.StatusCode
8977			}
8978			tracing.EndSpan(ctx, sc, err)
8979		}()
8980	}
8981	iter.i++
8982	if iter.i < len(iter.page.Values()) {
8983		return nil
8984	}
8985	err = iter.page.NextWithContext(ctx)
8986	if err != nil {
8987		iter.i--
8988		return err
8989	}
8990	iter.i = 0
8991	return nil
8992}
8993
8994// Next advances to the next value.  If there was an error making
8995// the request the iterator does not advance and the error is returned.
8996// Deprecated: Use NextWithContext() instead.
8997func (iter *SecurityGroupListResultIterator) Next() error {
8998	return iter.NextWithContext(context.Background())
8999}
9000
9001// NotDone returns true if the enumeration should be started or is not yet complete.
9002func (iter SecurityGroupListResultIterator) NotDone() bool {
9003	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9004}
9005
9006// Response returns the raw server response from the last page request.
9007func (iter SecurityGroupListResultIterator) Response() SecurityGroupListResult {
9008	return iter.page.Response()
9009}
9010
9011// Value returns the current value or a zero-initialized value if the
9012// iterator has advanced beyond the end of the collection.
9013func (iter SecurityGroupListResultIterator) Value() SecurityGroup {
9014	if !iter.page.NotDone() {
9015		return SecurityGroup{}
9016	}
9017	return iter.page.Values()[iter.i]
9018}
9019
9020// Creates a new instance of the SecurityGroupListResultIterator type.
9021func NewSecurityGroupListResultIterator(page SecurityGroupListResultPage) SecurityGroupListResultIterator {
9022	return SecurityGroupListResultIterator{page: page}
9023}
9024
9025// IsEmpty returns true if the ListResult contains no values.
9026func (sglr SecurityGroupListResult) IsEmpty() bool {
9027	return sglr.Value == nil || len(*sglr.Value) == 0
9028}
9029
9030// hasNextLink returns true if the NextLink is not empty.
9031func (sglr SecurityGroupListResult) hasNextLink() bool {
9032	return sglr.NextLink != nil && len(*sglr.NextLink) != 0
9033}
9034
9035// securityGroupListResultPreparer prepares a request to retrieve the next set of results.
9036// It returns nil if no more results exist.
9037func (sglr SecurityGroupListResult) securityGroupListResultPreparer(ctx context.Context) (*http.Request, error) {
9038	if !sglr.hasNextLink() {
9039		return nil, nil
9040	}
9041	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9042		autorest.AsJSON(),
9043		autorest.AsGet(),
9044		autorest.WithBaseURL(to.String(sglr.NextLink)))
9045}
9046
9047// SecurityGroupListResultPage contains a page of SecurityGroup values.
9048type SecurityGroupListResultPage struct {
9049	fn   func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)
9050	sglr SecurityGroupListResult
9051}
9052
9053// NextWithContext advances to the next page of values.  If there was an error making
9054// the request the page does not advance and the error is returned.
9055func (page *SecurityGroupListResultPage) NextWithContext(ctx context.Context) (err error) {
9056	if tracing.IsEnabled() {
9057		ctx = tracing.StartSpan(ctx, fqdn+"/SecurityGroupListResultPage.NextWithContext")
9058		defer func() {
9059			sc := -1
9060			if page.Response().Response.Response != nil {
9061				sc = page.Response().Response.Response.StatusCode
9062			}
9063			tracing.EndSpan(ctx, sc, err)
9064		}()
9065	}
9066	for {
9067		next, err := page.fn(ctx, page.sglr)
9068		if err != nil {
9069			return err
9070		}
9071		page.sglr = next
9072		if !next.hasNextLink() || !next.IsEmpty() {
9073			break
9074		}
9075	}
9076	return nil
9077}
9078
9079// Next advances to the next page of values.  If there was an error making
9080// the request the page does not advance and the error is returned.
9081// Deprecated: Use NextWithContext() instead.
9082func (page *SecurityGroupListResultPage) Next() error {
9083	return page.NextWithContext(context.Background())
9084}
9085
9086// NotDone returns true if the page enumeration should be started or is not yet complete.
9087func (page SecurityGroupListResultPage) NotDone() bool {
9088	return !page.sglr.IsEmpty()
9089}
9090
9091// Response returns the raw server response from the last page request.
9092func (page SecurityGroupListResultPage) Response() SecurityGroupListResult {
9093	return page.sglr
9094}
9095
9096// Values returns the slice of values for the current page or nil if there are no values.
9097func (page SecurityGroupListResultPage) Values() []SecurityGroup {
9098	if page.sglr.IsEmpty() {
9099		return nil
9100	}
9101	return *page.sglr.Value
9102}
9103
9104// Creates a new instance of the SecurityGroupListResultPage type.
9105func NewSecurityGroupListResultPage(cur SecurityGroupListResult, getNextPage func(context.Context, SecurityGroupListResult) (SecurityGroupListResult, error)) SecurityGroupListResultPage {
9106	return SecurityGroupListResultPage{
9107		fn:   getNextPage,
9108		sglr: cur,
9109	}
9110}
9111
9112// SecurityGroupNetworkInterface network interface and all its associated security rules.
9113type SecurityGroupNetworkInterface struct {
9114	// ID - ID of the network interface.
9115	ID                       *string                   `json:"id,omitempty"`
9116	SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"`
9117}
9118
9119// SecurityGroupPropertiesFormat network Security Group resource.
9120type SecurityGroupPropertiesFormat struct {
9121	// SecurityRules - A collection of security rules of the network security group.
9122	SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
9123	// DefaultSecurityRules - The default security rules of network security group.
9124	DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"`
9125	// NetworkInterfaces - READ-ONLY; A collection of references to network interfaces.
9126	NetworkInterfaces *[]Interface `json:"networkInterfaces,omitempty"`
9127	// Subnets - READ-ONLY; A collection of references to subnets.
9128	Subnets *[]Subnet `json:"subnets,omitempty"`
9129	// ResourceGUID - The resource GUID property of the network security group resource.
9130	ResourceGUID *string `json:"resourceGuid,omitempty"`
9131	// ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
9132	ProvisioningState *string `json:"provisioningState,omitempty"`
9133}
9134
9135// MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat.
9136func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) {
9137	objectMap := make(map[string]interface{})
9138	if sgpf.SecurityRules != nil {
9139		objectMap["securityRules"] = sgpf.SecurityRules
9140	}
9141	if sgpf.DefaultSecurityRules != nil {
9142		objectMap["defaultSecurityRules"] = sgpf.DefaultSecurityRules
9143	}
9144	if sgpf.ResourceGUID != nil {
9145		objectMap["resourceGuid"] = sgpf.ResourceGUID
9146	}
9147	if sgpf.ProvisioningState != nil {
9148		objectMap["provisioningState"] = sgpf.ProvisioningState
9149	}
9150	return json.Marshal(objectMap)
9151}
9152
9153// SecurityGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9154// long-running operation.
9155type SecurityGroupsCreateOrUpdateFuture struct {
9156	azure.FutureAPI
9157	// Result returns the result of the asynchronous operation.
9158	// If the operation has not completed it will return an error.
9159	Result func(SecurityGroupsClient) (SecurityGroup, error)
9160}
9161
9162// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9163func (future *SecurityGroupsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9164	var azFuture azure.Future
9165	if err := json.Unmarshal(body, &azFuture); err != nil {
9166		return err
9167	}
9168	future.FutureAPI = &azFuture
9169	future.Result = future.result
9170	return nil
9171}
9172
9173// result is the default implementation for SecurityGroupsCreateOrUpdateFuture.Result.
9174func (future *SecurityGroupsCreateOrUpdateFuture) result(client SecurityGroupsClient) (sg SecurityGroup, err error) {
9175	var done bool
9176	done, err = future.DoneWithContext(context.Background(), client)
9177	if err != nil {
9178		err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9179		return
9180	}
9181	if !done {
9182		sg.Response.Response = future.Response()
9183		err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsCreateOrUpdateFuture")
9184		return
9185	}
9186	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9187	if sg.Response.Response, err = future.GetResult(sender); err == nil && sg.Response.Response.StatusCode != http.StatusNoContent {
9188		sg, err = client.CreateOrUpdateResponder(sg.Response.Response)
9189		if err != nil {
9190			err = autorest.NewErrorWithError(err, "network.SecurityGroupsCreateOrUpdateFuture", "Result", sg.Response.Response, "Failure responding to request")
9191		}
9192	}
9193	return
9194}
9195
9196// SecurityGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
9197// operation.
9198type SecurityGroupsDeleteFuture struct {
9199	azure.FutureAPI
9200	// Result returns the result of the asynchronous operation.
9201	// If the operation has not completed it will return an error.
9202	Result func(SecurityGroupsClient) (autorest.Response, error)
9203}
9204
9205// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9206func (future *SecurityGroupsDeleteFuture) UnmarshalJSON(body []byte) error {
9207	var azFuture azure.Future
9208	if err := json.Unmarshal(body, &azFuture); err != nil {
9209		return err
9210	}
9211	future.FutureAPI = &azFuture
9212	future.Result = future.result
9213	return nil
9214}
9215
9216// result is the default implementation for SecurityGroupsDeleteFuture.Result.
9217func (future *SecurityGroupsDeleteFuture) result(client SecurityGroupsClient) (ar autorest.Response, err error) {
9218	var done bool
9219	done, err = future.DoneWithContext(context.Background(), client)
9220	if err != nil {
9221		err = autorest.NewErrorWithError(err, "network.SecurityGroupsDeleteFuture", "Result", future.Response(), "Polling failure")
9222		return
9223	}
9224	if !done {
9225		ar.Response = future.Response()
9226		err = azure.NewAsyncOpIncompleteError("network.SecurityGroupsDeleteFuture")
9227		return
9228	}
9229	ar.Response = future.Response()
9230	return
9231}
9232
9233// SecurityGroupViewParameters parameters that define the VM to check security groups for.
9234type SecurityGroupViewParameters struct {
9235	// TargetResourceID - ID of the target VM.
9236	TargetResourceID *string `json:"targetResourceId,omitempty"`
9237}
9238
9239// SecurityGroupViewResult the information about security rules applied to the specified VM.
9240type SecurityGroupViewResult struct {
9241	autorest.Response `json:"-"`
9242	// NetworkInterfaces - List of network interfaces on the specified VM.
9243	NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"`
9244}
9245
9246// SecurityRule network security rule.
9247type SecurityRule struct {
9248	autorest.Response             `json:"-"`
9249	*SecurityRulePropertiesFormat `json:"properties,omitempty"`
9250	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
9251	Name *string `json:"name,omitempty"`
9252	// Etag - A unique read-only string that changes whenever the resource is updated.
9253	Etag *string `json:"etag,omitempty"`
9254	// ID - Resource ID.
9255	ID *string `json:"id,omitempty"`
9256}
9257
9258// MarshalJSON is the custom marshaler for SecurityRule.
9259func (sr SecurityRule) MarshalJSON() ([]byte, error) {
9260	objectMap := make(map[string]interface{})
9261	if sr.SecurityRulePropertiesFormat != nil {
9262		objectMap["properties"] = sr.SecurityRulePropertiesFormat
9263	}
9264	if sr.Name != nil {
9265		objectMap["name"] = sr.Name
9266	}
9267	if sr.Etag != nil {
9268		objectMap["etag"] = sr.Etag
9269	}
9270	if sr.ID != nil {
9271		objectMap["id"] = sr.ID
9272	}
9273	return json.Marshal(objectMap)
9274}
9275
9276// UnmarshalJSON is the custom unmarshaler for SecurityRule struct.
9277func (sr *SecurityRule) UnmarshalJSON(body []byte) error {
9278	var m map[string]*json.RawMessage
9279	err := json.Unmarshal(body, &m)
9280	if err != nil {
9281		return err
9282	}
9283	for k, v := range m {
9284		switch k {
9285		case "properties":
9286			if v != nil {
9287				var securityRulePropertiesFormat SecurityRulePropertiesFormat
9288				err = json.Unmarshal(*v, &securityRulePropertiesFormat)
9289				if err != nil {
9290					return err
9291				}
9292				sr.SecurityRulePropertiesFormat = &securityRulePropertiesFormat
9293			}
9294		case "name":
9295			if v != nil {
9296				var name string
9297				err = json.Unmarshal(*v, &name)
9298				if err != nil {
9299					return err
9300				}
9301				sr.Name = &name
9302			}
9303		case "etag":
9304			if v != nil {
9305				var etag string
9306				err = json.Unmarshal(*v, &etag)
9307				if err != nil {
9308					return err
9309				}
9310				sr.Etag = &etag
9311			}
9312		case "id":
9313			if v != nil {
9314				var ID string
9315				err = json.Unmarshal(*v, &ID)
9316				if err != nil {
9317					return err
9318				}
9319				sr.ID = &ID
9320			}
9321		}
9322	}
9323
9324	return nil
9325}
9326
9327// SecurityRuleAssociations all security rules associated with the network interface.
9328type SecurityRuleAssociations struct {
9329	NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"`
9330	SubnetAssociation           *SubnetAssociation    `json:"subnetAssociation,omitempty"`
9331	// DefaultSecurityRules - Collection of default security rules of the network security group.
9332	DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"`
9333	// EffectiveSecurityRules - Collection of effective security rules.
9334	EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"`
9335}
9336
9337// SecurityRuleListResult response for ListSecurityRule API service call. Retrieves all security rules that
9338// belongs to a network security group.
9339type SecurityRuleListResult struct {
9340	autorest.Response `json:"-"`
9341	// Value - The security rules in a network security group.
9342	Value *[]SecurityRule `json:"value,omitempty"`
9343	// NextLink - The URL to get the next set of results.
9344	NextLink *string `json:"nextLink,omitempty"`
9345}
9346
9347// SecurityRuleListResultIterator provides access to a complete listing of SecurityRule values.
9348type SecurityRuleListResultIterator struct {
9349	i    int
9350	page SecurityRuleListResultPage
9351}
9352
9353// NextWithContext advances to the next value.  If there was an error making
9354// the request the iterator does not advance and the error is returned.
9355func (iter *SecurityRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
9356	if tracing.IsEnabled() {
9357		ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultIterator.NextWithContext")
9358		defer func() {
9359			sc := -1
9360			if iter.Response().Response.Response != nil {
9361				sc = iter.Response().Response.Response.StatusCode
9362			}
9363			tracing.EndSpan(ctx, sc, err)
9364		}()
9365	}
9366	iter.i++
9367	if iter.i < len(iter.page.Values()) {
9368		return nil
9369	}
9370	err = iter.page.NextWithContext(ctx)
9371	if err != nil {
9372		iter.i--
9373		return err
9374	}
9375	iter.i = 0
9376	return nil
9377}
9378
9379// Next advances to the next value.  If there was an error making
9380// the request the iterator does not advance and the error is returned.
9381// Deprecated: Use NextWithContext() instead.
9382func (iter *SecurityRuleListResultIterator) Next() error {
9383	return iter.NextWithContext(context.Background())
9384}
9385
9386// NotDone returns true if the enumeration should be started or is not yet complete.
9387func (iter SecurityRuleListResultIterator) NotDone() bool {
9388	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9389}
9390
9391// Response returns the raw server response from the last page request.
9392func (iter SecurityRuleListResultIterator) Response() SecurityRuleListResult {
9393	return iter.page.Response()
9394}
9395
9396// Value returns the current value or a zero-initialized value if the
9397// iterator has advanced beyond the end of the collection.
9398func (iter SecurityRuleListResultIterator) Value() SecurityRule {
9399	if !iter.page.NotDone() {
9400		return SecurityRule{}
9401	}
9402	return iter.page.Values()[iter.i]
9403}
9404
9405// Creates a new instance of the SecurityRuleListResultIterator type.
9406func NewSecurityRuleListResultIterator(page SecurityRuleListResultPage) SecurityRuleListResultIterator {
9407	return SecurityRuleListResultIterator{page: page}
9408}
9409
9410// IsEmpty returns true if the ListResult contains no values.
9411func (srlr SecurityRuleListResult) IsEmpty() bool {
9412	return srlr.Value == nil || len(*srlr.Value) == 0
9413}
9414
9415// hasNextLink returns true if the NextLink is not empty.
9416func (srlr SecurityRuleListResult) hasNextLink() bool {
9417	return srlr.NextLink != nil && len(*srlr.NextLink) != 0
9418}
9419
9420// securityRuleListResultPreparer prepares a request to retrieve the next set of results.
9421// It returns nil if no more results exist.
9422func (srlr SecurityRuleListResult) securityRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
9423	if !srlr.hasNextLink() {
9424		return nil, nil
9425	}
9426	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9427		autorest.AsJSON(),
9428		autorest.AsGet(),
9429		autorest.WithBaseURL(to.String(srlr.NextLink)))
9430}
9431
9432// SecurityRuleListResultPage contains a page of SecurityRule values.
9433type SecurityRuleListResultPage struct {
9434	fn   func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)
9435	srlr SecurityRuleListResult
9436}
9437
9438// NextWithContext advances to the next page of values.  If there was an error making
9439// the request the page does not advance and the error is returned.
9440func (page *SecurityRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
9441	if tracing.IsEnabled() {
9442		ctx = tracing.StartSpan(ctx, fqdn+"/SecurityRuleListResultPage.NextWithContext")
9443		defer func() {
9444			sc := -1
9445			if page.Response().Response.Response != nil {
9446				sc = page.Response().Response.Response.StatusCode
9447			}
9448			tracing.EndSpan(ctx, sc, err)
9449		}()
9450	}
9451	for {
9452		next, err := page.fn(ctx, page.srlr)
9453		if err != nil {
9454			return err
9455		}
9456		page.srlr = next
9457		if !next.hasNextLink() || !next.IsEmpty() {
9458			break
9459		}
9460	}
9461	return nil
9462}
9463
9464// Next advances to the next page of values.  If there was an error making
9465// the request the page does not advance and the error is returned.
9466// Deprecated: Use NextWithContext() instead.
9467func (page *SecurityRuleListResultPage) Next() error {
9468	return page.NextWithContext(context.Background())
9469}
9470
9471// NotDone returns true if the page enumeration should be started or is not yet complete.
9472func (page SecurityRuleListResultPage) NotDone() bool {
9473	return !page.srlr.IsEmpty()
9474}
9475
9476// Response returns the raw server response from the last page request.
9477func (page SecurityRuleListResultPage) Response() SecurityRuleListResult {
9478	return page.srlr
9479}
9480
9481// Values returns the slice of values for the current page or nil if there are no values.
9482func (page SecurityRuleListResultPage) Values() []SecurityRule {
9483	if page.srlr.IsEmpty() {
9484		return nil
9485	}
9486	return *page.srlr.Value
9487}
9488
9489// Creates a new instance of the SecurityRuleListResultPage type.
9490func NewSecurityRuleListResultPage(cur SecurityRuleListResult, getNextPage func(context.Context, SecurityRuleListResult) (SecurityRuleListResult, error)) SecurityRuleListResultPage {
9491	return SecurityRuleListResultPage{
9492		fn:   getNextPage,
9493		srlr: cur,
9494	}
9495}
9496
9497// SecurityRulePropertiesFormat ...
9498type SecurityRulePropertiesFormat struct {
9499	// Description - A description for this rule. Restricted to 140 chars.
9500	Description *string `json:"description,omitempty"`
9501	// Protocol - Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. Possible values include: 'SecurityRuleProtocolTCP', 'SecurityRuleProtocolUDP', 'SecurityRuleProtocolAsterisk'
9502	Protocol SecurityRuleProtocol `json:"protocol,omitempty"`
9503	// SourcePortRange - The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
9504	SourcePortRange *string `json:"sourcePortRange,omitempty"`
9505	// DestinationPortRange - The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
9506	DestinationPortRange *string `json:"destinationPortRange,omitempty"`
9507	// SourceAddressPrefix - The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
9508	SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
9509	// DestinationAddressPrefix - The destination address prefix. CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
9510	DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"`
9511	// Access - The network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. Possible values include: 'SecurityRuleAccessAllow', 'SecurityRuleAccessDeny'
9512	Access SecurityRuleAccess `json:"access,omitempty"`
9513	// 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.
9514	Priority *int32 `json:"priority,omitempty"`
9515	// Direction - The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values include: 'SecurityRuleDirectionInbound', 'SecurityRuleDirectionOutbound'
9516	Direction SecurityRuleDirection `json:"direction,omitempty"`
9517	// ProvisioningState - The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
9518	ProvisioningState *string `json:"provisioningState,omitempty"`
9519}
9520
9521// SecurityRulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
9522// long-running operation.
9523type SecurityRulesCreateOrUpdateFuture struct {
9524	azure.FutureAPI
9525	// Result returns the result of the asynchronous operation.
9526	// If the operation has not completed it will return an error.
9527	Result func(SecurityRulesClient) (SecurityRule, error)
9528}
9529
9530// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9531func (future *SecurityRulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9532	var azFuture azure.Future
9533	if err := json.Unmarshal(body, &azFuture); err != nil {
9534		return err
9535	}
9536	future.FutureAPI = &azFuture
9537	future.Result = future.result
9538	return nil
9539}
9540
9541// result is the default implementation for SecurityRulesCreateOrUpdateFuture.Result.
9542func (future *SecurityRulesCreateOrUpdateFuture) result(client SecurityRulesClient) (sr SecurityRule, err error) {
9543	var done bool
9544	done, err = future.DoneWithContext(context.Background(), client)
9545	if err != nil {
9546		err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9547		return
9548	}
9549	if !done {
9550		sr.Response.Response = future.Response()
9551		err = azure.NewAsyncOpIncompleteError("network.SecurityRulesCreateOrUpdateFuture")
9552		return
9553	}
9554	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9555	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
9556		sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
9557		if err != nil {
9558			err = autorest.NewErrorWithError(err, "network.SecurityRulesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
9559		}
9560	}
9561	return
9562}
9563
9564// SecurityRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
9565// operation.
9566type SecurityRulesDeleteFuture struct {
9567	azure.FutureAPI
9568	// Result returns the result of the asynchronous operation.
9569	// If the operation has not completed it will return an error.
9570	Result func(SecurityRulesClient) (autorest.Response, error)
9571}
9572
9573// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9574func (future *SecurityRulesDeleteFuture) UnmarshalJSON(body []byte) error {
9575	var azFuture azure.Future
9576	if err := json.Unmarshal(body, &azFuture); err != nil {
9577		return err
9578	}
9579	future.FutureAPI = &azFuture
9580	future.Result = future.result
9581	return nil
9582}
9583
9584// result is the default implementation for SecurityRulesDeleteFuture.Result.
9585func (future *SecurityRulesDeleteFuture) result(client SecurityRulesClient) (ar autorest.Response, err error) {
9586	var done bool
9587	done, err = future.DoneWithContext(context.Background(), client)
9588	if err != nil {
9589		err = autorest.NewErrorWithError(err, "network.SecurityRulesDeleteFuture", "Result", future.Response(), "Polling failure")
9590		return
9591	}
9592	if !done {
9593		ar.Response = future.Response()
9594		err = azure.NewAsyncOpIncompleteError("network.SecurityRulesDeleteFuture")
9595		return
9596	}
9597	ar.Response = future.Response()
9598	return
9599}
9600
9601// String ...
9602type String struct {
9603	autorest.Response `json:"-"`
9604	Value             *string `json:"value,omitempty"`
9605}
9606
9607// Subnet subnet in a virtual network resource.
9608type Subnet struct {
9609	autorest.Response       `json:"-"`
9610	*SubnetPropertiesFormat `json:"properties,omitempty"`
9611	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
9612	Name *string `json:"name,omitempty"`
9613	// Etag - A unique read-only string that changes whenever the resource is updated.
9614	Etag *string `json:"etag,omitempty"`
9615	// ID - Resource ID.
9616	ID *string `json:"id,omitempty"`
9617}
9618
9619// MarshalJSON is the custom marshaler for Subnet.
9620func (s Subnet) MarshalJSON() ([]byte, error) {
9621	objectMap := make(map[string]interface{})
9622	if s.SubnetPropertiesFormat != nil {
9623		objectMap["properties"] = s.SubnetPropertiesFormat
9624	}
9625	if s.Name != nil {
9626		objectMap["name"] = s.Name
9627	}
9628	if s.Etag != nil {
9629		objectMap["etag"] = s.Etag
9630	}
9631	if s.ID != nil {
9632		objectMap["id"] = s.ID
9633	}
9634	return json.Marshal(objectMap)
9635}
9636
9637// UnmarshalJSON is the custom unmarshaler for Subnet struct.
9638func (s *Subnet) UnmarshalJSON(body []byte) error {
9639	var m map[string]*json.RawMessage
9640	err := json.Unmarshal(body, &m)
9641	if err != nil {
9642		return err
9643	}
9644	for k, v := range m {
9645		switch k {
9646		case "properties":
9647			if v != nil {
9648				var subnetPropertiesFormat SubnetPropertiesFormat
9649				err = json.Unmarshal(*v, &subnetPropertiesFormat)
9650				if err != nil {
9651					return err
9652				}
9653				s.SubnetPropertiesFormat = &subnetPropertiesFormat
9654			}
9655		case "name":
9656			if v != nil {
9657				var name string
9658				err = json.Unmarshal(*v, &name)
9659				if err != nil {
9660					return err
9661				}
9662				s.Name = &name
9663			}
9664		case "etag":
9665			if v != nil {
9666				var etag string
9667				err = json.Unmarshal(*v, &etag)
9668				if err != nil {
9669					return err
9670				}
9671				s.Etag = &etag
9672			}
9673		case "id":
9674			if v != nil {
9675				var ID string
9676				err = json.Unmarshal(*v, &ID)
9677				if err != nil {
9678					return err
9679				}
9680				s.ID = &ID
9681			}
9682		}
9683	}
9684
9685	return nil
9686}
9687
9688// SubnetAssociation network interface and its custom security rules.
9689type SubnetAssociation struct {
9690	// ID - READ-ONLY; Subnet ID.
9691	ID *string `json:"id,omitempty"`
9692	// SecurityRules - Collection of custom security rules.
9693	SecurityRules *[]SecurityRule `json:"securityRules,omitempty"`
9694}
9695
9696// MarshalJSON is the custom marshaler for SubnetAssociation.
9697func (sa SubnetAssociation) MarshalJSON() ([]byte, error) {
9698	objectMap := make(map[string]interface{})
9699	if sa.SecurityRules != nil {
9700		objectMap["securityRules"] = sa.SecurityRules
9701	}
9702	return json.Marshal(objectMap)
9703}
9704
9705// SubnetListResult response for ListSubnets API service callRetrieves all subnet that belongs to a virtual
9706// network
9707type SubnetListResult struct {
9708	autorest.Response `json:"-"`
9709	// Value - The subnets in a virtual network.
9710	Value *[]Subnet `json:"value,omitempty"`
9711	// NextLink - The URL to get the next set of results.
9712	NextLink *string `json:"nextLink,omitempty"`
9713}
9714
9715// SubnetListResultIterator provides access to a complete listing of Subnet values.
9716type SubnetListResultIterator struct {
9717	i    int
9718	page SubnetListResultPage
9719}
9720
9721// NextWithContext advances to the next value.  If there was an error making
9722// the request the iterator does not advance and the error is returned.
9723func (iter *SubnetListResultIterator) NextWithContext(ctx context.Context) (err error) {
9724	if tracing.IsEnabled() {
9725		ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultIterator.NextWithContext")
9726		defer func() {
9727			sc := -1
9728			if iter.Response().Response.Response != nil {
9729				sc = iter.Response().Response.Response.StatusCode
9730			}
9731			tracing.EndSpan(ctx, sc, err)
9732		}()
9733	}
9734	iter.i++
9735	if iter.i < len(iter.page.Values()) {
9736		return nil
9737	}
9738	err = iter.page.NextWithContext(ctx)
9739	if err != nil {
9740		iter.i--
9741		return err
9742	}
9743	iter.i = 0
9744	return nil
9745}
9746
9747// Next advances to the next value.  If there was an error making
9748// the request the iterator does not advance and the error is returned.
9749// Deprecated: Use NextWithContext() instead.
9750func (iter *SubnetListResultIterator) Next() error {
9751	return iter.NextWithContext(context.Background())
9752}
9753
9754// NotDone returns true if the enumeration should be started or is not yet complete.
9755func (iter SubnetListResultIterator) NotDone() bool {
9756	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9757}
9758
9759// Response returns the raw server response from the last page request.
9760func (iter SubnetListResultIterator) Response() SubnetListResult {
9761	return iter.page.Response()
9762}
9763
9764// Value returns the current value or a zero-initialized value if the
9765// iterator has advanced beyond the end of the collection.
9766func (iter SubnetListResultIterator) Value() Subnet {
9767	if !iter.page.NotDone() {
9768		return Subnet{}
9769	}
9770	return iter.page.Values()[iter.i]
9771}
9772
9773// Creates a new instance of the SubnetListResultIterator type.
9774func NewSubnetListResultIterator(page SubnetListResultPage) SubnetListResultIterator {
9775	return SubnetListResultIterator{page: page}
9776}
9777
9778// IsEmpty returns true if the ListResult contains no values.
9779func (slr SubnetListResult) IsEmpty() bool {
9780	return slr.Value == nil || len(*slr.Value) == 0
9781}
9782
9783// hasNextLink returns true if the NextLink is not empty.
9784func (slr SubnetListResult) hasNextLink() bool {
9785	return slr.NextLink != nil && len(*slr.NextLink) != 0
9786}
9787
9788// subnetListResultPreparer prepares a request to retrieve the next set of results.
9789// It returns nil if no more results exist.
9790func (slr SubnetListResult) subnetListResultPreparer(ctx context.Context) (*http.Request, error) {
9791	if !slr.hasNextLink() {
9792		return nil, nil
9793	}
9794	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9795		autorest.AsJSON(),
9796		autorest.AsGet(),
9797		autorest.WithBaseURL(to.String(slr.NextLink)))
9798}
9799
9800// SubnetListResultPage contains a page of Subnet values.
9801type SubnetListResultPage struct {
9802	fn  func(context.Context, SubnetListResult) (SubnetListResult, error)
9803	slr SubnetListResult
9804}
9805
9806// NextWithContext advances to the next page of values.  If there was an error making
9807// the request the page does not advance and the error is returned.
9808func (page *SubnetListResultPage) NextWithContext(ctx context.Context) (err error) {
9809	if tracing.IsEnabled() {
9810		ctx = tracing.StartSpan(ctx, fqdn+"/SubnetListResultPage.NextWithContext")
9811		defer func() {
9812			sc := -1
9813			if page.Response().Response.Response != nil {
9814				sc = page.Response().Response.Response.StatusCode
9815			}
9816			tracing.EndSpan(ctx, sc, err)
9817		}()
9818	}
9819	for {
9820		next, err := page.fn(ctx, page.slr)
9821		if err != nil {
9822			return err
9823		}
9824		page.slr = next
9825		if !next.hasNextLink() || !next.IsEmpty() {
9826			break
9827		}
9828	}
9829	return nil
9830}
9831
9832// Next advances to the next page of values.  If there was an error making
9833// the request the page does not advance and the error is returned.
9834// Deprecated: Use NextWithContext() instead.
9835func (page *SubnetListResultPage) Next() error {
9836	return page.NextWithContext(context.Background())
9837}
9838
9839// NotDone returns true if the page enumeration should be started or is not yet complete.
9840func (page SubnetListResultPage) NotDone() bool {
9841	return !page.slr.IsEmpty()
9842}
9843
9844// Response returns the raw server response from the last page request.
9845func (page SubnetListResultPage) Response() SubnetListResult {
9846	return page.slr
9847}
9848
9849// Values returns the slice of values for the current page or nil if there are no values.
9850func (page SubnetListResultPage) Values() []Subnet {
9851	if page.slr.IsEmpty() {
9852		return nil
9853	}
9854	return *page.slr.Value
9855}
9856
9857// Creates a new instance of the SubnetListResultPage type.
9858func NewSubnetListResultPage(cur SubnetListResult, getNextPage func(context.Context, SubnetListResult) (SubnetListResult, error)) SubnetListResultPage {
9859	return SubnetListResultPage{
9860		fn:  getNextPage,
9861		slr: cur,
9862	}
9863}
9864
9865// SubnetPropertiesFormat ...
9866type SubnetPropertiesFormat struct {
9867	// AddressPrefix - The address prefix for the subnet.
9868	AddressPrefix *string `json:"addressPrefix,omitempty"`
9869	// NetworkSecurityGroup - The reference of the NetworkSecurityGroup resource.
9870	NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
9871	// RouteTable - The reference of the RouteTable resource.
9872	RouteTable *RouteTable `json:"routeTable,omitempty"`
9873	// IPConfigurations - READ-ONLY; Gets an array of references to the network interface IP configurations using subnet.
9874	IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"`
9875	// ResourceNavigationLinks - Gets an array of references to the external resources using subnet.
9876	ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"`
9877	// ProvisioningState - The provisioning state of the resource.
9878	ProvisioningState *string `json:"provisioningState,omitempty"`
9879}
9880
9881// MarshalJSON is the custom marshaler for SubnetPropertiesFormat.
9882func (spf SubnetPropertiesFormat) MarshalJSON() ([]byte, error) {
9883	objectMap := make(map[string]interface{})
9884	if spf.AddressPrefix != nil {
9885		objectMap["addressPrefix"] = spf.AddressPrefix
9886	}
9887	if spf.NetworkSecurityGroup != nil {
9888		objectMap["networkSecurityGroup"] = spf.NetworkSecurityGroup
9889	}
9890	if spf.RouteTable != nil {
9891		objectMap["routeTable"] = spf.RouteTable
9892	}
9893	if spf.ResourceNavigationLinks != nil {
9894		objectMap["resourceNavigationLinks"] = spf.ResourceNavigationLinks
9895	}
9896	if spf.ProvisioningState != nil {
9897		objectMap["provisioningState"] = spf.ProvisioningState
9898	}
9899	return json.Marshal(objectMap)
9900}
9901
9902// SubnetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
9903// operation.
9904type SubnetsCreateOrUpdateFuture struct {
9905	azure.FutureAPI
9906	// Result returns the result of the asynchronous operation.
9907	// If the operation has not completed it will return an error.
9908	Result func(SubnetsClient) (Subnet, error)
9909}
9910
9911// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9912func (future *SubnetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
9913	var azFuture azure.Future
9914	if err := json.Unmarshal(body, &azFuture); err != nil {
9915		return err
9916	}
9917	future.FutureAPI = &azFuture
9918	future.Result = future.result
9919	return nil
9920}
9921
9922// result is the default implementation for SubnetsCreateOrUpdateFuture.Result.
9923func (future *SubnetsCreateOrUpdateFuture) result(client SubnetsClient) (s Subnet, err error) {
9924	var done bool
9925	done, err = future.DoneWithContext(context.Background(), client)
9926	if err != nil {
9927		err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
9928		return
9929	}
9930	if !done {
9931		s.Response.Response = future.Response()
9932		err = azure.NewAsyncOpIncompleteError("network.SubnetsCreateOrUpdateFuture")
9933		return
9934	}
9935	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9936	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
9937		s, err = client.CreateOrUpdateResponder(s.Response.Response)
9938		if err != nil {
9939			err = autorest.NewErrorWithError(err, "network.SubnetsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request")
9940		}
9941	}
9942	return
9943}
9944
9945// SubnetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
9946// operation.
9947type SubnetsDeleteFuture struct {
9948	azure.FutureAPI
9949	// Result returns the result of the asynchronous operation.
9950	// If the operation has not completed it will return an error.
9951	Result func(SubnetsClient) (autorest.Response, error)
9952}
9953
9954// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9955func (future *SubnetsDeleteFuture) UnmarshalJSON(body []byte) error {
9956	var azFuture azure.Future
9957	if err := json.Unmarshal(body, &azFuture); err != nil {
9958		return err
9959	}
9960	future.FutureAPI = &azFuture
9961	future.Result = future.result
9962	return nil
9963}
9964
9965// result is the default implementation for SubnetsDeleteFuture.Result.
9966func (future *SubnetsDeleteFuture) result(client SubnetsClient) (ar autorest.Response, err error) {
9967	var done bool
9968	done, err = future.DoneWithContext(context.Background(), client)
9969	if err != nil {
9970		err = autorest.NewErrorWithError(err, "network.SubnetsDeleteFuture", "Result", future.Response(), "Polling failure")
9971		return
9972	}
9973	if !done {
9974		ar.Response = future.Response()
9975		err = azure.NewAsyncOpIncompleteError("network.SubnetsDeleteFuture")
9976		return
9977	}
9978	ar.Response = future.Response()
9979	return
9980}
9981
9982// SubResource ...
9983type SubResource struct {
9984	// ID - Resource ID.
9985	ID *string `json:"id,omitempty"`
9986}
9987
9988// Topology topology of the specified resource group.
9989type Topology struct {
9990	autorest.Response `json:"-"`
9991	// ID - READ-ONLY; GUID representing the operation id.
9992	ID *string `json:"id,omitempty"`
9993	// CreatedDateTime - READ-ONLY; The datetime when the topology was initially created for the resource group.
9994	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
9995	// LastModified - READ-ONLY; The datetime when the topology was last modified.
9996	LastModified *date.Time          `json:"lastModified,omitempty"`
9997	Resources    *[]TopologyResource `json:"resources,omitempty"`
9998}
9999
10000// MarshalJSON is the custom marshaler for Topology.
10001func (t Topology) MarshalJSON() ([]byte, error) {
10002	objectMap := make(map[string]interface{})
10003	if t.Resources != nil {
10004		objectMap["resources"] = t.Resources
10005	}
10006	return json.Marshal(objectMap)
10007}
10008
10009// TopologyAssociation resources that have an association with the parent resource.
10010type TopologyAssociation struct {
10011	// Name - The name of the resource that is associated with the parent resource.
10012	Name *string `json:"name,omitempty"`
10013	// ResourceID - The ID of the resource that is associated with the parent resource.
10014	ResourceID *string `json:"resourceId,omitempty"`
10015	// AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains'
10016	AssociationType AssociationType `json:"associationType,omitempty"`
10017}
10018
10019// TopologyParameters parameters that define the representation of topology.
10020type TopologyParameters struct {
10021	// TargetResourceGroupName - The name of the target resource group to perform topology on.
10022	TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"`
10023}
10024
10025// TopologyResource the network resource topology information for the given resource group.
10026type TopologyResource struct {
10027	// Name - Name of the resource.
10028	Name *string `json:"name,omitempty"`
10029	// ID - ID of the resource.
10030	ID *string `json:"id,omitempty"`
10031	// Location - Resource location.
10032	Location *string `json:"location,omitempty"`
10033	// Associations - Holds the associations the resource has with other resources in the resource group.
10034	Associations *[]TopologyAssociation `json:"associations,omitempty"`
10035}
10036
10037// TroubleshootingDetails information gained from troubleshooting of specified resource.
10038type TroubleshootingDetails struct {
10039	// ID - The id of the get troubleshoot operation.
10040	ID *string `json:"id,omitempty"`
10041	// ReasonType - Reason type of failure.
10042	ReasonType *string `json:"reasonType,omitempty"`
10043	// Summary - A summary of troubleshooting.
10044	Summary *string `json:"summary,omitempty"`
10045	// Detail - Details on troubleshooting results.
10046	Detail *string `json:"detail,omitempty"`
10047	// RecommendedActions - List of recommended actions.
10048	RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"`
10049}
10050
10051// TroubleshootingParameters parameters that define the resource to troubleshoot.
10052type TroubleshootingParameters struct {
10053	// TargetResourceID - The target resource to troubleshoot.
10054	TargetResourceID           *string `json:"targetResourceId,omitempty"`
10055	*TroubleshootingProperties `json:"properties,omitempty"`
10056}
10057
10058// MarshalJSON is the custom marshaler for TroubleshootingParameters.
10059func (tp TroubleshootingParameters) MarshalJSON() ([]byte, error) {
10060	objectMap := make(map[string]interface{})
10061	if tp.TargetResourceID != nil {
10062		objectMap["targetResourceId"] = tp.TargetResourceID
10063	}
10064	if tp.TroubleshootingProperties != nil {
10065		objectMap["properties"] = tp.TroubleshootingProperties
10066	}
10067	return json.Marshal(objectMap)
10068}
10069
10070// UnmarshalJSON is the custom unmarshaler for TroubleshootingParameters struct.
10071func (tp *TroubleshootingParameters) UnmarshalJSON(body []byte) error {
10072	var m map[string]*json.RawMessage
10073	err := json.Unmarshal(body, &m)
10074	if err != nil {
10075		return err
10076	}
10077	for k, v := range m {
10078		switch k {
10079		case "targetResourceId":
10080			if v != nil {
10081				var targetResourceID string
10082				err = json.Unmarshal(*v, &targetResourceID)
10083				if err != nil {
10084					return err
10085				}
10086				tp.TargetResourceID = &targetResourceID
10087			}
10088		case "properties":
10089			if v != nil {
10090				var troubleshootingProperties TroubleshootingProperties
10091				err = json.Unmarshal(*v, &troubleshootingProperties)
10092				if err != nil {
10093					return err
10094				}
10095				tp.TroubleshootingProperties = &troubleshootingProperties
10096			}
10097		}
10098	}
10099
10100	return nil
10101}
10102
10103// TroubleshootingProperties storage location provided for troubleshoot.
10104type TroubleshootingProperties struct {
10105	// StorageID - The ID for the storage account to save the troubleshoot result.
10106	StorageID *string `json:"storageId,omitempty"`
10107	// StoragePath - The path to the blob to save the troubleshoot result in.
10108	StoragePath *string `json:"storagePath,omitempty"`
10109}
10110
10111// TroubleshootingRecommendedActions recommended actions based on discovered issues.
10112type TroubleshootingRecommendedActions struct {
10113	// ActionID - ID of the recommended action.
10114	ActionID *string `json:"actionId,omitempty"`
10115	// ActionText - Description of recommended actions.
10116	ActionText *string `json:"actionText,omitempty"`
10117	// ActionURI - The uri linking to a documentation for the recommended troubleshooting actions.
10118	ActionURI *string `json:"actionUri,omitempty"`
10119	// ActionURIText - The information from the URI for the recommended troubleshooting actions.
10120	ActionURIText *string `json:"actionUriText,omitempty"`
10121}
10122
10123// TroubleshootingResult troubleshooting information gained from specified resource.
10124type TroubleshootingResult struct {
10125	autorest.Response `json:"-"`
10126	// StartTime - The start time of the troubleshooting.
10127	StartTime *date.Time `json:"startTime,omitempty"`
10128	// EndTime - The end time of the troubleshooting.
10129	EndTime *date.Time `json:"endTime,omitempty"`
10130	// Code - The result code of the troubleshooting.
10131	Code *string `json:"code,omitempty"`
10132	// Results - Information from troubleshooting.
10133	Results *[]TroubleshootingDetails `json:"results,omitempty"`
10134}
10135
10136// TunnelConnectionHealth virtualNetworkGatewayConnection properties
10137type TunnelConnectionHealth struct {
10138	// Tunnel - READ-ONLY; Tunnel name.
10139	Tunnel *string `json:"tunnel,omitempty"`
10140	// ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
10141	ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
10142	// IngressBytesTransferred - READ-ONLY; The Ingress Bytes Transferred in this connection
10143	IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
10144	// EgressBytesTransferred - READ-ONLY; The Egress Bytes Transferred in this connection
10145	EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
10146	// LastConnectionEstablishedUtcTime - READ-ONLY; The time at which connection was established in Utc format.
10147	LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"`
10148}
10149
10150// MarshalJSON is the custom marshaler for TunnelConnectionHealth.
10151func (tch TunnelConnectionHealth) MarshalJSON() ([]byte, error) {
10152	objectMap := make(map[string]interface{})
10153	return json.Marshal(objectMap)
10154}
10155
10156// Usage describes network resource usage.
10157type Usage struct {
10158	// Unit - An enum describing the unit of measurement.
10159	Unit *string `json:"unit,omitempty"`
10160	// CurrentValue - The current value of the usage.
10161	CurrentValue *int64 `json:"currentValue,omitempty"`
10162	// Limit - The limit of usage.
10163	Limit *int64 `json:"limit,omitempty"`
10164	// Name - The name of the type of usage.
10165	Name *UsageName `json:"name,omitempty"`
10166}
10167
10168// UsageName the usage names.
10169type UsageName struct {
10170	// Value - A string describing the resource name.
10171	Value *string `json:"value,omitempty"`
10172	// LocalizedValue - A localized string describing the resource name.
10173	LocalizedValue *string `json:"localizedValue,omitempty"`
10174}
10175
10176// UsagesListResult the list usages operation response.
10177type UsagesListResult struct {
10178	autorest.Response `json:"-"`
10179	// Value - The list network resource usages.
10180	Value *[]Usage `json:"value,omitempty"`
10181	// NextLink - URL to get the next set of results.
10182	NextLink *string `json:"nextLink,omitempty"`
10183}
10184
10185// UsagesListResultIterator provides access to a complete listing of Usage values.
10186type UsagesListResultIterator struct {
10187	i    int
10188	page UsagesListResultPage
10189}
10190
10191// NextWithContext advances to the next value.  If there was an error making
10192// the request the iterator does not advance and the error is returned.
10193func (iter *UsagesListResultIterator) NextWithContext(ctx context.Context) (err error) {
10194	if tracing.IsEnabled() {
10195		ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultIterator.NextWithContext")
10196		defer func() {
10197			sc := -1
10198			if iter.Response().Response.Response != nil {
10199				sc = iter.Response().Response.Response.StatusCode
10200			}
10201			tracing.EndSpan(ctx, sc, err)
10202		}()
10203	}
10204	iter.i++
10205	if iter.i < len(iter.page.Values()) {
10206		return nil
10207	}
10208	err = iter.page.NextWithContext(ctx)
10209	if err != nil {
10210		iter.i--
10211		return err
10212	}
10213	iter.i = 0
10214	return nil
10215}
10216
10217// Next advances to the next value.  If there was an error making
10218// the request the iterator does not advance and the error is returned.
10219// Deprecated: Use NextWithContext() instead.
10220func (iter *UsagesListResultIterator) Next() error {
10221	return iter.NextWithContext(context.Background())
10222}
10223
10224// NotDone returns true if the enumeration should be started or is not yet complete.
10225func (iter UsagesListResultIterator) NotDone() bool {
10226	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10227}
10228
10229// Response returns the raw server response from the last page request.
10230func (iter UsagesListResultIterator) Response() UsagesListResult {
10231	return iter.page.Response()
10232}
10233
10234// Value returns the current value or a zero-initialized value if the
10235// iterator has advanced beyond the end of the collection.
10236func (iter UsagesListResultIterator) Value() Usage {
10237	if !iter.page.NotDone() {
10238		return Usage{}
10239	}
10240	return iter.page.Values()[iter.i]
10241}
10242
10243// Creates a new instance of the UsagesListResultIterator type.
10244func NewUsagesListResultIterator(page UsagesListResultPage) UsagesListResultIterator {
10245	return UsagesListResultIterator{page: page}
10246}
10247
10248// IsEmpty returns true if the ListResult contains no values.
10249func (ulr UsagesListResult) IsEmpty() bool {
10250	return ulr.Value == nil || len(*ulr.Value) == 0
10251}
10252
10253// hasNextLink returns true if the NextLink is not empty.
10254func (ulr UsagesListResult) hasNextLink() bool {
10255	return ulr.NextLink != nil && len(*ulr.NextLink) != 0
10256}
10257
10258// usagesListResultPreparer prepares a request to retrieve the next set of results.
10259// It returns nil if no more results exist.
10260func (ulr UsagesListResult) usagesListResultPreparer(ctx context.Context) (*http.Request, error) {
10261	if !ulr.hasNextLink() {
10262		return nil, nil
10263	}
10264	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10265		autorest.AsJSON(),
10266		autorest.AsGet(),
10267		autorest.WithBaseURL(to.String(ulr.NextLink)))
10268}
10269
10270// UsagesListResultPage contains a page of Usage values.
10271type UsagesListResultPage struct {
10272	fn  func(context.Context, UsagesListResult) (UsagesListResult, error)
10273	ulr UsagesListResult
10274}
10275
10276// NextWithContext advances to the next page of values.  If there was an error making
10277// the request the page does not advance and the error is returned.
10278func (page *UsagesListResultPage) NextWithContext(ctx context.Context) (err error) {
10279	if tracing.IsEnabled() {
10280		ctx = tracing.StartSpan(ctx, fqdn+"/UsagesListResultPage.NextWithContext")
10281		defer func() {
10282			sc := -1
10283			if page.Response().Response.Response != nil {
10284				sc = page.Response().Response.Response.StatusCode
10285			}
10286			tracing.EndSpan(ctx, sc, err)
10287		}()
10288	}
10289	for {
10290		next, err := page.fn(ctx, page.ulr)
10291		if err != nil {
10292			return err
10293		}
10294		page.ulr = next
10295		if !next.hasNextLink() || !next.IsEmpty() {
10296			break
10297		}
10298	}
10299	return nil
10300}
10301
10302// Next advances to the next page of values.  If there was an error making
10303// the request the page does not advance and the error is returned.
10304// Deprecated: Use NextWithContext() instead.
10305func (page *UsagesListResultPage) Next() error {
10306	return page.NextWithContext(context.Background())
10307}
10308
10309// NotDone returns true if the page enumeration should be started or is not yet complete.
10310func (page UsagesListResultPage) NotDone() bool {
10311	return !page.ulr.IsEmpty()
10312}
10313
10314// Response returns the raw server response from the last page request.
10315func (page UsagesListResultPage) Response() UsagesListResult {
10316	return page.ulr
10317}
10318
10319// Values returns the slice of values for the current page or nil if there are no values.
10320func (page UsagesListResultPage) Values() []Usage {
10321	if page.ulr.IsEmpty() {
10322		return nil
10323	}
10324	return *page.ulr.Value
10325}
10326
10327// Creates a new instance of the UsagesListResultPage type.
10328func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Context, UsagesListResult) (UsagesListResult, error)) UsagesListResultPage {
10329	return UsagesListResultPage{
10330		fn:  getNextPage,
10331		ulr: cur,
10332	}
10333}
10334
10335// VerificationIPFlowParameters parameters that define the IP flow to be verified.
10336type VerificationIPFlowParameters struct {
10337	// TargetResourceID - The ID of the target resource to perform next-hop on.
10338	TargetResourceID *string `json:"targetResourceId,omitempty"`
10339	// Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound'
10340	Direction Direction `json:"direction,omitempty"`
10341	// Protocol - Protocol to be verified on. Possible values include: 'ProtocolTCP', 'ProtocolUDP'
10342	Protocol Protocol `json:"protocol,omitempty"`
10343	// 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.
10344	LocalPort *string `json:"localPort,omitempty"`
10345	// 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.
10346	RemotePort *string `json:"remotePort,omitempty"`
10347	// LocalIPAddress - The local IP address. Acceptable values are valid IPv4 addresses.
10348	LocalIPAddress *string `json:"localIPAddress,omitempty"`
10349	// RemoteIPAddress - The remote IP address. Acceptable values are valid IPv4 addresses.
10350	RemoteIPAddress *string `json:"remoteIPAddress,omitempty"`
10351	// 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).
10352	TargetNicResourceID *string `json:"targetNicResourceId,omitempty"`
10353}
10354
10355// VerificationIPFlowResult results of IP flow verification on the target resource.
10356type VerificationIPFlowResult struct {
10357	autorest.Response `json:"-"`
10358	// Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny'
10359	Access Access `json:"access,omitempty"`
10360	// RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed.
10361	RuleName *string `json:"ruleName,omitempty"`
10362}
10363
10364// VirtualNetwork virtual Network resource.
10365type VirtualNetwork struct {
10366	autorest.Response               `json:"-"`
10367	*VirtualNetworkPropertiesFormat `json:"properties,omitempty"`
10368	// Etag - Gets a unique read-only string that changes whenever the resource is updated.
10369	Etag *string `json:"etag,omitempty"`
10370	// ID - Resource ID.
10371	ID *string `json:"id,omitempty"`
10372	// Name - READ-ONLY; Resource name.
10373	Name *string `json:"name,omitempty"`
10374	// Type - READ-ONLY; Resource type.
10375	Type *string `json:"type,omitempty"`
10376	// Location - Resource location.
10377	Location *string `json:"location,omitempty"`
10378	// Tags - Resource tags.
10379	Tags map[string]*string `json:"tags"`
10380}
10381
10382// MarshalJSON is the custom marshaler for VirtualNetwork.
10383func (vn VirtualNetwork) MarshalJSON() ([]byte, error) {
10384	objectMap := make(map[string]interface{})
10385	if vn.VirtualNetworkPropertiesFormat != nil {
10386		objectMap["properties"] = vn.VirtualNetworkPropertiesFormat
10387	}
10388	if vn.Etag != nil {
10389		objectMap["etag"] = vn.Etag
10390	}
10391	if vn.ID != nil {
10392		objectMap["id"] = vn.ID
10393	}
10394	if vn.Location != nil {
10395		objectMap["location"] = vn.Location
10396	}
10397	if vn.Tags != nil {
10398		objectMap["tags"] = vn.Tags
10399	}
10400	return json.Marshal(objectMap)
10401}
10402
10403// UnmarshalJSON is the custom unmarshaler for VirtualNetwork struct.
10404func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error {
10405	var m map[string]*json.RawMessage
10406	err := json.Unmarshal(body, &m)
10407	if err != nil {
10408		return err
10409	}
10410	for k, v := range m {
10411		switch k {
10412		case "properties":
10413			if v != nil {
10414				var virtualNetworkPropertiesFormat VirtualNetworkPropertiesFormat
10415				err = json.Unmarshal(*v, &virtualNetworkPropertiesFormat)
10416				if err != nil {
10417					return err
10418				}
10419				vn.VirtualNetworkPropertiesFormat = &virtualNetworkPropertiesFormat
10420			}
10421		case "etag":
10422			if v != nil {
10423				var etag string
10424				err = json.Unmarshal(*v, &etag)
10425				if err != nil {
10426					return err
10427				}
10428				vn.Etag = &etag
10429			}
10430		case "id":
10431			if v != nil {
10432				var ID string
10433				err = json.Unmarshal(*v, &ID)
10434				if err != nil {
10435					return err
10436				}
10437				vn.ID = &ID
10438			}
10439		case "name":
10440			if v != nil {
10441				var name string
10442				err = json.Unmarshal(*v, &name)
10443				if err != nil {
10444					return err
10445				}
10446				vn.Name = &name
10447			}
10448		case "type":
10449			if v != nil {
10450				var typeVar string
10451				err = json.Unmarshal(*v, &typeVar)
10452				if err != nil {
10453					return err
10454				}
10455				vn.Type = &typeVar
10456			}
10457		case "location":
10458			if v != nil {
10459				var location string
10460				err = json.Unmarshal(*v, &location)
10461				if err != nil {
10462					return err
10463				}
10464				vn.Location = &location
10465			}
10466		case "tags":
10467			if v != nil {
10468				var tags map[string]*string
10469				err = json.Unmarshal(*v, &tags)
10470				if err != nil {
10471					return err
10472				}
10473				vn.Tags = tags
10474			}
10475		}
10476	}
10477
10478	return nil
10479}
10480
10481// VirtualNetworkGateway a common class for general resource information
10482type VirtualNetworkGateway struct {
10483	autorest.Response                      `json:"-"`
10484	*VirtualNetworkGatewayPropertiesFormat `json:"properties,omitempty"`
10485	// Etag - Gets a unique read-only string that changes whenever the resource is updated.
10486	Etag *string `json:"etag,omitempty"`
10487	// ID - Resource ID.
10488	ID *string `json:"id,omitempty"`
10489	// Name - READ-ONLY; Resource name.
10490	Name *string `json:"name,omitempty"`
10491	// Type - READ-ONLY; Resource type.
10492	Type *string `json:"type,omitempty"`
10493	// Location - Resource location.
10494	Location *string `json:"location,omitempty"`
10495	// Tags - Resource tags.
10496	Tags map[string]*string `json:"tags"`
10497}
10498
10499// MarshalJSON is the custom marshaler for VirtualNetworkGateway.
10500func (vng VirtualNetworkGateway) MarshalJSON() ([]byte, error) {
10501	objectMap := make(map[string]interface{})
10502	if vng.VirtualNetworkGatewayPropertiesFormat != nil {
10503		objectMap["properties"] = vng.VirtualNetworkGatewayPropertiesFormat
10504	}
10505	if vng.Etag != nil {
10506		objectMap["etag"] = vng.Etag
10507	}
10508	if vng.ID != nil {
10509		objectMap["id"] = vng.ID
10510	}
10511	if vng.Location != nil {
10512		objectMap["location"] = vng.Location
10513	}
10514	if vng.Tags != nil {
10515		objectMap["tags"] = vng.Tags
10516	}
10517	return json.Marshal(objectMap)
10518}
10519
10520// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGateway struct.
10521func (vng *VirtualNetworkGateway) UnmarshalJSON(body []byte) error {
10522	var m map[string]*json.RawMessage
10523	err := json.Unmarshal(body, &m)
10524	if err != nil {
10525		return err
10526	}
10527	for k, v := range m {
10528		switch k {
10529		case "properties":
10530			if v != nil {
10531				var virtualNetworkGatewayPropertiesFormat VirtualNetworkGatewayPropertiesFormat
10532				err = json.Unmarshal(*v, &virtualNetworkGatewayPropertiesFormat)
10533				if err != nil {
10534					return err
10535				}
10536				vng.VirtualNetworkGatewayPropertiesFormat = &virtualNetworkGatewayPropertiesFormat
10537			}
10538		case "etag":
10539			if v != nil {
10540				var etag string
10541				err = json.Unmarshal(*v, &etag)
10542				if err != nil {
10543					return err
10544				}
10545				vng.Etag = &etag
10546			}
10547		case "id":
10548			if v != nil {
10549				var ID string
10550				err = json.Unmarshal(*v, &ID)
10551				if err != nil {
10552					return err
10553				}
10554				vng.ID = &ID
10555			}
10556		case "name":
10557			if v != nil {
10558				var name string
10559				err = json.Unmarshal(*v, &name)
10560				if err != nil {
10561					return err
10562				}
10563				vng.Name = &name
10564			}
10565		case "type":
10566			if v != nil {
10567				var typeVar string
10568				err = json.Unmarshal(*v, &typeVar)
10569				if err != nil {
10570					return err
10571				}
10572				vng.Type = &typeVar
10573			}
10574		case "location":
10575			if v != nil {
10576				var location string
10577				err = json.Unmarshal(*v, &location)
10578				if err != nil {
10579					return err
10580				}
10581				vng.Location = &location
10582			}
10583		case "tags":
10584			if v != nil {
10585				var tags map[string]*string
10586				err = json.Unmarshal(*v, &tags)
10587				if err != nil {
10588					return err
10589				}
10590				vng.Tags = tags
10591			}
10592		}
10593	}
10594
10595	return nil
10596}
10597
10598// VirtualNetworkGatewayConnection a common class for general resource information
10599type VirtualNetworkGatewayConnection struct {
10600	autorest.Response                                `json:"-"`
10601	*VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties,omitempty"`
10602	// Etag - Gets a unique read-only string that changes whenever the resource is updated.
10603	Etag *string `json:"etag,omitempty"`
10604	// ID - Resource ID.
10605	ID *string `json:"id,omitempty"`
10606	// Name - READ-ONLY; Resource name.
10607	Name *string `json:"name,omitempty"`
10608	// Type - READ-ONLY; Resource type.
10609	Type *string `json:"type,omitempty"`
10610	// Location - Resource location.
10611	Location *string `json:"location,omitempty"`
10612	// Tags - Resource tags.
10613	Tags map[string]*string `json:"tags"`
10614}
10615
10616// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnection.
10617func (vngc VirtualNetworkGatewayConnection) MarshalJSON() ([]byte, error) {
10618	objectMap := make(map[string]interface{})
10619	if vngc.VirtualNetworkGatewayConnectionPropertiesFormat != nil {
10620		objectMap["properties"] = vngc.VirtualNetworkGatewayConnectionPropertiesFormat
10621	}
10622	if vngc.Etag != nil {
10623		objectMap["etag"] = vngc.Etag
10624	}
10625	if vngc.ID != nil {
10626		objectMap["id"] = vngc.ID
10627	}
10628	if vngc.Location != nil {
10629		objectMap["location"] = vngc.Location
10630	}
10631	if vngc.Tags != nil {
10632		objectMap["tags"] = vngc.Tags
10633	}
10634	return json.Marshal(objectMap)
10635}
10636
10637// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayConnection struct.
10638func (vngc *VirtualNetworkGatewayConnection) UnmarshalJSON(body []byte) error {
10639	var m map[string]*json.RawMessage
10640	err := json.Unmarshal(body, &m)
10641	if err != nil {
10642		return err
10643	}
10644	for k, v := range m {
10645		switch k {
10646		case "properties":
10647			if v != nil {
10648				var virtualNetworkGatewayConnectionPropertiesFormat VirtualNetworkGatewayConnectionPropertiesFormat
10649				err = json.Unmarshal(*v, &virtualNetworkGatewayConnectionPropertiesFormat)
10650				if err != nil {
10651					return err
10652				}
10653				vngc.VirtualNetworkGatewayConnectionPropertiesFormat = &virtualNetworkGatewayConnectionPropertiesFormat
10654			}
10655		case "etag":
10656			if v != nil {
10657				var etag string
10658				err = json.Unmarshal(*v, &etag)
10659				if err != nil {
10660					return err
10661				}
10662				vngc.Etag = &etag
10663			}
10664		case "id":
10665			if v != nil {
10666				var ID string
10667				err = json.Unmarshal(*v, &ID)
10668				if err != nil {
10669					return err
10670				}
10671				vngc.ID = &ID
10672			}
10673		case "name":
10674			if v != nil {
10675				var name string
10676				err = json.Unmarshal(*v, &name)
10677				if err != nil {
10678					return err
10679				}
10680				vngc.Name = &name
10681			}
10682		case "type":
10683			if v != nil {
10684				var typeVar string
10685				err = json.Unmarshal(*v, &typeVar)
10686				if err != nil {
10687					return err
10688				}
10689				vngc.Type = &typeVar
10690			}
10691		case "location":
10692			if v != nil {
10693				var location string
10694				err = json.Unmarshal(*v, &location)
10695				if err != nil {
10696					return err
10697				}
10698				vngc.Location = &location
10699			}
10700		case "tags":
10701			if v != nil {
10702				var tags map[string]*string
10703				err = json.Unmarshal(*v, &tags)
10704				if err != nil {
10705					return err
10706				}
10707				vngc.Tags = tags
10708			}
10709		}
10710	}
10711
10712	return nil
10713}
10714
10715// VirtualNetworkGatewayConnectionListResult response for the ListVirtualNetworkGatewayConnections API
10716// service call
10717type VirtualNetworkGatewayConnectionListResult struct {
10718	autorest.Response `json:"-"`
10719	// Value - Gets a list of VirtualNetworkGatewayConnection resources that exists in a resource group.
10720	Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"`
10721	// NextLink - The URL to get the next set of results.
10722	NextLink *string `json:"nextLink,omitempty"`
10723}
10724
10725// VirtualNetworkGatewayConnectionListResultIterator provides access to a complete listing of
10726// VirtualNetworkGatewayConnection values.
10727type VirtualNetworkGatewayConnectionListResultIterator struct {
10728	i    int
10729	page VirtualNetworkGatewayConnectionListResultPage
10730}
10731
10732// NextWithContext advances to the next value.  If there was an error making
10733// the request the iterator does not advance and the error is returned.
10734func (iter *VirtualNetworkGatewayConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
10735	if tracing.IsEnabled() {
10736		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultIterator.NextWithContext")
10737		defer func() {
10738			sc := -1
10739			if iter.Response().Response.Response != nil {
10740				sc = iter.Response().Response.Response.StatusCode
10741			}
10742			tracing.EndSpan(ctx, sc, err)
10743		}()
10744	}
10745	iter.i++
10746	if iter.i < len(iter.page.Values()) {
10747		return nil
10748	}
10749	err = iter.page.NextWithContext(ctx)
10750	if err != nil {
10751		iter.i--
10752		return err
10753	}
10754	iter.i = 0
10755	return nil
10756}
10757
10758// Next advances to the next value.  If there was an error making
10759// the request the iterator does not advance and the error is returned.
10760// Deprecated: Use NextWithContext() instead.
10761func (iter *VirtualNetworkGatewayConnectionListResultIterator) Next() error {
10762	return iter.NextWithContext(context.Background())
10763}
10764
10765// NotDone returns true if the enumeration should be started or is not yet complete.
10766func (iter VirtualNetworkGatewayConnectionListResultIterator) NotDone() bool {
10767	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10768}
10769
10770// Response returns the raw server response from the last page request.
10771func (iter VirtualNetworkGatewayConnectionListResultIterator) Response() VirtualNetworkGatewayConnectionListResult {
10772	return iter.page.Response()
10773}
10774
10775// Value returns the current value or a zero-initialized value if the
10776// iterator has advanced beyond the end of the collection.
10777func (iter VirtualNetworkGatewayConnectionListResultIterator) Value() VirtualNetworkGatewayConnection {
10778	if !iter.page.NotDone() {
10779		return VirtualNetworkGatewayConnection{}
10780	}
10781	return iter.page.Values()[iter.i]
10782}
10783
10784// Creates a new instance of the VirtualNetworkGatewayConnectionListResultIterator type.
10785func NewVirtualNetworkGatewayConnectionListResultIterator(page VirtualNetworkGatewayConnectionListResultPage) VirtualNetworkGatewayConnectionListResultIterator {
10786	return VirtualNetworkGatewayConnectionListResultIterator{page: page}
10787}
10788
10789// IsEmpty returns true if the ListResult contains no values.
10790func (vngclr VirtualNetworkGatewayConnectionListResult) IsEmpty() bool {
10791	return vngclr.Value == nil || len(*vngclr.Value) == 0
10792}
10793
10794// hasNextLink returns true if the NextLink is not empty.
10795func (vngclr VirtualNetworkGatewayConnectionListResult) hasNextLink() bool {
10796	return vngclr.NextLink != nil && len(*vngclr.NextLink) != 0
10797}
10798
10799// virtualNetworkGatewayConnectionListResultPreparer prepares a request to retrieve the next set of results.
10800// It returns nil if no more results exist.
10801func (vngclr VirtualNetworkGatewayConnectionListResult) virtualNetworkGatewayConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
10802	if !vngclr.hasNextLink() {
10803		return nil, nil
10804	}
10805	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10806		autorest.AsJSON(),
10807		autorest.AsGet(),
10808		autorest.WithBaseURL(to.String(vngclr.NextLink)))
10809}
10810
10811// VirtualNetworkGatewayConnectionListResultPage contains a page of VirtualNetworkGatewayConnection values.
10812type VirtualNetworkGatewayConnectionListResultPage struct {
10813	fn     func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)
10814	vngclr VirtualNetworkGatewayConnectionListResult
10815}
10816
10817// NextWithContext advances to the next page of values.  If there was an error making
10818// the request the page does not advance and the error is returned.
10819func (page *VirtualNetworkGatewayConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
10820	if tracing.IsEnabled() {
10821		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayConnectionListResultPage.NextWithContext")
10822		defer func() {
10823			sc := -1
10824			if page.Response().Response.Response != nil {
10825				sc = page.Response().Response.Response.StatusCode
10826			}
10827			tracing.EndSpan(ctx, sc, err)
10828		}()
10829	}
10830	for {
10831		next, err := page.fn(ctx, page.vngclr)
10832		if err != nil {
10833			return err
10834		}
10835		page.vngclr = next
10836		if !next.hasNextLink() || !next.IsEmpty() {
10837			break
10838		}
10839	}
10840	return nil
10841}
10842
10843// Next advances to the next page of values.  If there was an error making
10844// the request the page does not advance and the error is returned.
10845// Deprecated: Use NextWithContext() instead.
10846func (page *VirtualNetworkGatewayConnectionListResultPage) Next() error {
10847	return page.NextWithContext(context.Background())
10848}
10849
10850// NotDone returns true if the page enumeration should be started or is not yet complete.
10851func (page VirtualNetworkGatewayConnectionListResultPage) NotDone() bool {
10852	return !page.vngclr.IsEmpty()
10853}
10854
10855// Response returns the raw server response from the last page request.
10856func (page VirtualNetworkGatewayConnectionListResultPage) Response() VirtualNetworkGatewayConnectionListResult {
10857	return page.vngclr
10858}
10859
10860// Values returns the slice of values for the current page or nil if there are no values.
10861func (page VirtualNetworkGatewayConnectionListResultPage) Values() []VirtualNetworkGatewayConnection {
10862	if page.vngclr.IsEmpty() {
10863		return nil
10864	}
10865	return *page.vngclr.Value
10866}
10867
10868// Creates a new instance of the VirtualNetworkGatewayConnectionListResultPage type.
10869func NewVirtualNetworkGatewayConnectionListResultPage(cur VirtualNetworkGatewayConnectionListResult, getNextPage func(context.Context, VirtualNetworkGatewayConnectionListResult) (VirtualNetworkGatewayConnectionListResult, error)) VirtualNetworkGatewayConnectionListResultPage {
10870	return VirtualNetworkGatewayConnectionListResultPage{
10871		fn:     getNextPage,
10872		vngclr: cur,
10873	}
10874}
10875
10876// VirtualNetworkGatewayConnectionPropertiesFormat virtualNetworkGatewayConnection properties
10877type VirtualNetworkGatewayConnectionPropertiesFormat struct {
10878	// AuthorizationKey - The authorizationKey.
10879	AuthorizationKey       *string                `json:"authorizationKey,omitempty"`
10880	VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"`
10881	VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"`
10882	LocalNetworkGateway2   *LocalNetworkGateway   `json:"localNetworkGateway2,omitempty"`
10883	// ConnectionType - Gateway connection type. Possible values are: 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient'
10884	ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"`
10885	// RoutingWeight - The routing weight.
10886	RoutingWeight *int32 `json:"routingWeight,omitempty"`
10887	// SharedKey - The IPSec shared key.
10888	SharedKey *string `json:"sharedKey,omitempty"`
10889	// ConnectionStatus - READ-ONLY; Virtual network Gateway connection status. Possible values are 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: 'VirtualNetworkGatewayConnectionStatusUnknown', 'VirtualNetworkGatewayConnectionStatusConnecting', 'VirtualNetworkGatewayConnectionStatusConnected', 'VirtualNetworkGatewayConnectionStatusNotConnected'
10890	ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"`
10891	// TunnelConnectionStatus - READ-ONLY; Collection of all tunnels' connection health status.
10892	TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"`
10893	// EgressBytesTransferred - READ-ONLY; The egress bytes transferred in this connection.
10894	EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
10895	// IngressBytesTransferred - READ-ONLY; The ingress bytes transferred in this connection.
10896	IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
10897	// Peer - The reference to peerings resource.
10898	Peer *SubResource `json:"peer,omitempty"`
10899	// EnableBgp - EnableBgp flag
10900	EnableBgp *bool `json:"enableBgp,omitempty"`
10901	// ResourceGUID - The resource GUID property of the VirtualNetworkGatewayConnection resource.
10902	ResourceGUID *string `json:"resourceGuid,omitempty"`
10903	// ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayConnection resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
10904	ProvisioningState *string `json:"provisioningState,omitempty"`
10905}
10906
10907// MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat.
10908func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]byte, error) {
10909	objectMap := make(map[string]interface{})
10910	if vngcpf.AuthorizationKey != nil {
10911		objectMap["authorizationKey"] = vngcpf.AuthorizationKey
10912	}
10913	if vngcpf.VirtualNetworkGateway1 != nil {
10914		objectMap["virtualNetworkGateway1"] = vngcpf.VirtualNetworkGateway1
10915	}
10916	if vngcpf.VirtualNetworkGateway2 != nil {
10917		objectMap["virtualNetworkGateway2"] = vngcpf.VirtualNetworkGateway2
10918	}
10919	if vngcpf.LocalNetworkGateway2 != nil {
10920		objectMap["localNetworkGateway2"] = vngcpf.LocalNetworkGateway2
10921	}
10922	if vngcpf.ConnectionType != "" {
10923		objectMap["connectionType"] = vngcpf.ConnectionType
10924	}
10925	if vngcpf.RoutingWeight != nil {
10926		objectMap["routingWeight"] = vngcpf.RoutingWeight
10927	}
10928	if vngcpf.SharedKey != nil {
10929		objectMap["sharedKey"] = vngcpf.SharedKey
10930	}
10931	if vngcpf.Peer != nil {
10932		objectMap["peer"] = vngcpf.Peer
10933	}
10934	if vngcpf.EnableBgp != nil {
10935		objectMap["enableBgp"] = vngcpf.EnableBgp
10936	}
10937	if vngcpf.ResourceGUID != nil {
10938		objectMap["resourceGuid"] = vngcpf.ResourceGUID
10939	}
10940	return json.Marshal(objectMap)
10941}
10942
10943// VirtualNetworkGatewayConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
10944// results of a long-running operation.
10945type VirtualNetworkGatewayConnectionsCreateOrUpdateFuture struct {
10946	azure.FutureAPI
10947	// Result returns the result of the asynchronous operation.
10948	// If the operation has not completed it will return an error.
10949	Result func(VirtualNetworkGatewayConnectionsClient) (VirtualNetworkGatewayConnection, error)
10950}
10951
10952// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10953func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10954	var azFuture azure.Future
10955	if err := json.Unmarshal(body, &azFuture); err != nil {
10956		return err
10957	}
10958	future.FutureAPI = &azFuture
10959	future.Result = future.result
10960	return nil
10961}
10962
10963// result is the default implementation for VirtualNetworkGatewayConnectionsCreateOrUpdateFuture.Result.
10964func (future *VirtualNetworkGatewayConnectionsCreateOrUpdateFuture) result(client VirtualNetworkGatewayConnectionsClient) (vngc VirtualNetworkGatewayConnection, err error) {
10965	var done bool
10966	done, err = future.DoneWithContext(context.Background(), client)
10967	if err != nil {
10968		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10969		return
10970	}
10971	if !done {
10972		vngc.Response.Response = future.Response()
10973		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture")
10974		return
10975	}
10976	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10977	if vngc.Response.Response, err = future.GetResult(sender); err == nil && vngc.Response.Response.StatusCode != http.StatusNoContent {
10978		vngc, err = client.CreateOrUpdateResponder(vngc.Response.Response)
10979		if err != nil {
10980			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsCreateOrUpdateFuture", "Result", vngc.Response.Response, "Failure responding to request")
10981		}
10982	}
10983	return
10984}
10985
10986// VirtualNetworkGatewayConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of
10987// a long-running operation.
10988type VirtualNetworkGatewayConnectionsDeleteFuture struct {
10989	azure.FutureAPI
10990	// Result returns the result of the asynchronous operation.
10991	// If the operation has not completed it will return an error.
10992	Result func(VirtualNetworkGatewayConnectionsClient) (autorest.Response, error)
10993}
10994
10995// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10996func (future *VirtualNetworkGatewayConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
10997	var azFuture azure.Future
10998	if err := json.Unmarshal(body, &azFuture); err != nil {
10999		return err
11000	}
11001	future.FutureAPI = &azFuture
11002	future.Result = future.result
11003	return nil
11004}
11005
11006// result is the default implementation for VirtualNetworkGatewayConnectionsDeleteFuture.Result.
11007func (future *VirtualNetworkGatewayConnectionsDeleteFuture) result(client VirtualNetworkGatewayConnectionsClient) (ar autorest.Response, err error) {
11008	var done bool
11009	done, err = future.DoneWithContext(context.Background(), client)
11010	if err != nil {
11011		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
11012		return
11013	}
11014	if !done {
11015		ar.Response = future.Response()
11016		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsDeleteFuture")
11017		return
11018	}
11019	ar.Response = future.Response()
11020	return
11021}
11022
11023// VirtualNetworkGatewayConnectionsResetSharedKeyFuture an abstraction for monitoring and retrieving the
11024// results of a long-running operation.
11025type VirtualNetworkGatewayConnectionsResetSharedKeyFuture struct {
11026	azure.FutureAPI
11027	// Result returns the result of the asynchronous operation.
11028	// If the operation has not completed it will return an error.
11029	Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionResetSharedKey, error)
11030}
11031
11032// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11033func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) UnmarshalJSON(body []byte) error {
11034	var azFuture azure.Future
11035	if err := json.Unmarshal(body, &azFuture); err != nil {
11036		return err
11037	}
11038	future.FutureAPI = &azFuture
11039	future.Result = future.result
11040	return nil
11041}
11042
11043// result is the default implementation for VirtualNetworkGatewayConnectionsResetSharedKeyFuture.Result.
11044func (future *VirtualNetworkGatewayConnectionsResetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (crsk ConnectionResetSharedKey, err error) {
11045	var done bool
11046	done, err = future.DoneWithContext(context.Background(), client)
11047	if err != nil {
11048		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", future.Response(), "Polling failure")
11049		return
11050	}
11051	if !done {
11052		crsk.Response.Response = future.Response()
11053		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture")
11054		return
11055	}
11056	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11057	if crsk.Response.Response, err = future.GetResult(sender); err == nil && crsk.Response.Response.StatusCode != http.StatusNoContent {
11058		crsk, err = client.ResetSharedKeyResponder(crsk.Response.Response)
11059		if err != nil {
11060			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsResetSharedKeyFuture", "Result", crsk.Response.Response, "Failure responding to request")
11061		}
11062	}
11063	return
11064}
11065
11066// VirtualNetworkGatewayConnectionsSetSharedKeyFuture an abstraction for monitoring and retrieving the
11067// results of a long-running operation.
11068type VirtualNetworkGatewayConnectionsSetSharedKeyFuture struct {
11069	azure.FutureAPI
11070	// Result returns the result of the asynchronous operation.
11071	// If the operation has not completed it will return an error.
11072	Result func(VirtualNetworkGatewayConnectionsClient) (ConnectionSharedKey, error)
11073}
11074
11075// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11076func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) UnmarshalJSON(body []byte) error {
11077	var azFuture azure.Future
11078	if err := json.Unmarshal(body, &azFuture); err != nil {
11079		return err
11080	}
11081	future.FutureAPI = &azFuture
11082	future.Result = future.result
11083	return nil
11084}
11085
11086// result is the default implementation for VirtualNetworkGatewayConnectionsSetSharedKeyFuture.Result.
11087func (future *VirtualNetworkGatewayConnectionsSetSharedKeyFuture) result(client VirtualNetworkGatewayConnectionsClient) (csk ConnectionSharedKey, err error) {
11088	var done bool
11089	done, err = future.DoneWithContext(context.Background(), client)
11090	if err != nil {
11091		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", future.Response(), "Polling failure")
11092		return
11093	}
11094	if !done {
11095		csk.Response.Response = future.Response()
11096		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture")
11097		return
11098	}
11099	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11100	if csk.Response.Response, err = future.GetResult(sender); err == nil && csk.Response.Response.StatusCode != http.StatusNoContent {
11101		csk, err = client.SetSharedKeyResponder(csk.Response.Response)
11102		if err != nil {
11103			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsSetSharedKeyFuture", "Result", csk.Response.Response, "Failure responding to request")
11104		}
11105	}
11106	return
11107}
11108
11109// VirtualNetworkGatewayIPConfiguration IP configuration for virtual network gateway
11110type VirtualNetworkGatewayIPConfiguration struct {
11111	*VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"`
11112	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
11113	Name *string `json:"name,omitempty"`
11114	// Etag - A unique read-only string that changes whenever the resource is updated.
11115	Etag *string `json:"etag,omitempty"`
11116	// ID - Resource ID.
11117	ID *string `json:"id,omitempty"`
11118}
11119
11120// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfiguration.
11121func (vngic VirtualNetworkGatewayIPConfiguration) MarshalJSON() ([]byte, error) {
11122	objectMap := make(map[string]interface{})
11123	if vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat != nil {
11124		objectMap["properties"] = vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat
11125	}
11126	if vngic.Name != nil {
11127		objectMap["name"] = vngic.Name
11128	}
11129	if vngic.Etag != nil {
11130		objectMap["etag"] = vngic.Etag
11131	}
11132	if vngic.ID != nil {
11133		objectMap["id"] = vngic.ID
11134	}
11135	return json.Marshal(objectMap)
11136}
11137
11138// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayIPConfiguration struct.
11139func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) error {
11140	var m map[string]*json.RawMessage
11141	err := json.Unmarshal(body, &m)
11142	if err != nil {
11143		return err
11144	}
11145	for k, v := range m {
11146		switch k {
11147		case "properties":
11148			if v != nil {
11149				var virtualNetworkGatewayIPConfigurationPropertiesFormat VirtualNetworkGatewayIPConfigurationPropertiesFormat
11150				err = json.Unmarshal(*v, &virtualNetworkGatewayIPConfigurationPropertiesFormat)
11151				if err != nil {
11152					return err
11153				}
11154				vngic.VirtualNetworkGatewayIPConfigurationPropertiesFormat = &virtualNetworkGatewayIPConfigurationPropertiesFormat
11155			}
11156		case "name":
11157			if v != nil {
11158				var name string
11159				err = json.Unmarshal(*v, &name)
11160				if err != nil {
11161					return err
11162				}
11163				vngic.Name = &name
11164			}
11165		case "etag":
11166			if v != nil {
11167				var etag string
11168				err = json.Unmarshal(*v, &etag)
11169				if err != nil {
11170					return err
11171				}
11172				vngic.Etag = &etag
11173			}
11174		case "id":
11175			if v != nil {
11176				var ID string
11177				err = json.Unmarshal(*v, &ID)
11178				if err != nil {
11179					return err
11180				}
11181				vngic.ID = &ID
11182			}
11183		}
11184	}
11185
11186	return nil
11187}
11188
11189// VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration
11190type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct {
11191	// PrivateIPAllocationMethod - The private IP allocation method. Possible values are: 'Static' and 'Dynamic'. Possible values include: 'Static', 'Dynamic'
11192	PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
11193	// Subnet - The reference of the subnet resource.
11194	Subnet *SubResource `json:"subnet,omitempty"`
11195	// PublicIPAddress - The reference of the public IP resource.
11196	PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
11197	// ProvisioningState - READ-ONLY; The provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
11198	ProvisioningState *string `json:"provisioningState,omitempty"`
11199}
11200
11201// MarshalJSON is the custom marshaler for VirtualNetworkGatewayIPConfigurationPropertiesFormat.
11202func (vngicpf VirtualNetworkGatewayIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) {
11203	objectMap := make(map[string]interface{})
11204	if vngicpf.PrivateIPAllocationMethod != "" {
11205		objectMap["privateIPAllocationMethod"] = vngicpf.PrivateIPAllocationMethod
11206	}
11207	if vngicpf.Subnet != nil {
11208		objectMap["subnet"] = vngicpf.Subnet
11209	}
11210	if vngicpf.PublicIPAddress != nil {
11211		objectMap["publicIPAddress"] = vngicpf.PublicIPAddress
11212	}
11213	return json.Marshal(objectMap)
11214}
11215
11216// VirtualNetworkGatewayListResult response for the ListVirtualNetworkGateways API service call.
11217type VirtualNetworkGatewayListResult struct {
11218	autorest.Response `json:"-"`
11219	// Value - Gets a list of VirtualNetworkGateway resources that exists in a resource group.
11220	Value *[]VirtualNetworkGateway `json:"value,omitempty"`
11221	// NextLink - The URL to get the next set of results.
11222	NextLink *string `json:"nextLink,omitempty"`
11223}
11224
11225// VirtualNetworkGatewayListResultIterator provides access to a complete listing of VirtualNetworkGateway
11226// values.
11227type VirtualNetworkGatewayListResultIterator struct {
11228	i    int
11229	page VirtualNetworkGatewayListResultPage
11230}
11231
11232// NextWithContext advances to the next value.  If there was an error making
11233// the request the iterator does not advance and the error is returned.
11234func (iter *VirtualNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) {
11235	if tracing.IsEnabled() {
11236		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultIterator.NextWithContext")
11237		defer func() {
11238			sc := -1
11239			if iter.Response().Response.Response != nil {
11240				sc = iter.Response().Response.Response.StatusCode
11241			}
11242			tracing.EndSpan(ctx, sc, err)
11243		}()
11244	}
11245	iter.i++
11246	if iter.i < len(iter.page.Values()) {
11247		return nil
11248	}
11249	err = iter.page.NextWithContext(ctx)
11250	if err != nil {
11251		iter.i--
11252		return err
11253	}
11254	iter.i = 0
11255	return nil
11256}
11257
11258// Next advances to the next value.  If there was an error making
11259// the request the iterator does not advance and the error is returned.
11260// Deprecated: Use NextWithContext() instead.
11261func (iter *VirtualNetworkGatewayListResultIterator) Next() error {
11262	return iter.NextWithContext(context.Background())
11263}
11264
11265// NotDone returns true if the enumeration should be started or is not yet complete.
11266func (iter VirtualNetworkGatewayListResultIterator) NotDone() bool {
11267	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11268}
11269
11270// Response returns the raw server response from the last page request.
11271func (iter VirtualNetworkGatewayListResultIterator) Response() VirtualNetworkGatewayListResult {
11272	return iter.page.Response()
11273}
11274
11275// Value returns the current value or a zero-initialized value if the
11276// iterator has advanced beyond the end of the collection.
11277func (iter VirtualNetworkGatewayListResultIterator) Value() VirtualNetworkGateway {
11278	if !iter.page.NotDone() {
11279		return VirtualNetworkGateway{}
11280	}
11281	return iter.page.Values()[iter.i]
11282}
11283
11284// Creates a new instance of the VirtualNetworkGatewayListResultIterator type.
11285func NewVirtualNetworkGatewayListResultIterator(page VirtualNetworkGatewayListResultPage) VirtualNetworkGatewayListResultIterator {
11286	return VirtualNetworkGatewayListResultIterator{page: page}
11287}
11288
11289// IsEmpty returns true if the ListResult contains no values.
11290func (vnglr VirtualNetworkGatewayListResult) IsEmpty() bool {
11291	return vnglr.Value == nil || len(*vnglr.Value) == 0
11292}
11293
11294// hasNextLink returns true if the NextLink is not empty.
11295func (vnglr VirtualNetworkGatewayListResult) hasNextLink() bool {
11296	return vnglr.NextLink != nil && len(*vnglr.NextLink) != 0
11297}
11298
11299// virtualNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results.
11300// It returns nil if no more results exist.
11301func (vnglr VirtualNetworkGatewayListResult) virtualNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) {
11302	if !vnglr.hasNextLink() {
11303		return nil, nil
11304	}
11305	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11306		autorest.AsJSON(),
11307		autorest.AsGet(),
11308		autorest.WithBaseURL(to.String(vnglr.NextLink)))
11309}
11310
11311// VirtualNetworkGatewayListResultPage contains a page of VirtualNetworkGateway values.
11312type VirtualNetworkGatewayListResultPage struct {
11313	fn    func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)
11314	vnglr VirtualNetworkGatewayListResult
11315}
11316
11317// NextWithContext advances to the next page of values.  If there was an error making
11318// the request the page does not advance and the error is returned.
11319func (page *VirtualNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) {
11320	if tracing.IsEnabled() {
11321		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkGatewayListResultPage.NextWithContext")
11322		defer func() {
11323			sc := -1
11324			if page.Response().Response.Response != nil {
11325				sc = page.Response().Response.Response.StatusCode
11326			}
11327			tracing.EndSpan(ctx, sc, err)
11328		}()
11329	}
11330	for {
11331		next, err := page.fn(ctx, page.vnglr)
11332		if err != nil {
11333			return err
11334		}
11335		page.vnglr = next
11336		if !next.hasNextLink() || !next.IsEmpty() {
11337			break
11338		}
11339	}
11340	return nil
11341}
11342
11343// Next advances to the next page of values.  If there was an error making
11344// the request the page does not advance and the error is returned.
11345// Deprecated: Use NextWithContext() instead.
11346func (page *VirtualNetworkGatewayListResultPage) Next() error {
11347	return page.NextWithContext(context.Background())
11348}
11349
11350// NotDone returns true if the page enumeration should be started or is not yet complete.
11351func (page VirtualNetworkGatewayListResultPage) NotDone() bool {
11352	return !page.vnglr.IsEmpty()
11353}
11354
11355// Response returns the raw server response from the last page request.
11356func (page VirtualNetworkGatewayListResultPage) Response() VirtualNetworkGatewayListResult {
11357	return page.vnglr
11358}
11359
11360// Values returns the slice of values for the current page or nil if there are no values.
11361func (page VirtualNetworkGatewayListResultPage) Values() []VirtualNetworkGateway {
11362	if page.vnglr.IsEmpty() {
11363		return nil
11364	}
11365	return *page.vnglr.Value
11366}
11367
11368// Creates a new instance of the VirtualNetworkGatewayListResultPage type.
11369func NewVirtualNetworkGatewayListResultPage(cur VirtualNetworkGatewayListResult, getNextPage func(context.Context, VirtualNetworkGatewayListResult) (VirtualNetworkGatewayListResult, error)) VirtualNetworkGatewayListResultPage {
11370	return VirtualNetworkGatewayListResultPage{
11371		fn:    getNextPage,
11372		vnglr: cur,
11373	}
11374}
11375
11376// VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties
11377type VirtualNetworkGatewayPropertiesFormat struct {
11378	// IPConfigurations - IP configurations for virtual network gateway.
11379	IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"`
11380	// GatewayType - The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute'
11381	GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"`
11382	// VpnType - The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. Possible values include: 'PolicyBased', 'RouteBased'
11383	VpnType VpnType `json:"vpnType,omitempty"`
11384	// EnableBgp - Whether BGP is enabled for this virtual network gateway or not.
11385	EnableBgp *bool `json:"enableBgp,omitempty"`
11386	// ActiveActive - ActiveActive flag
11387	ActiveActive *bool `json:"activeActive,omitempty"`
11388	// 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.
11389	GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"`
11390	// Sku - The reference of the VirtualNetworkGatewaySku resource which represents the SKU selected for Virtual network gateway.
11391	Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"`
11392	// VpnClientConfiguration - The reference of the VpnClientConfiguration resource which represents the P2S VpnClient configurations.
11393	VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"`
11394	// BgpSettings - Virtual network gateway's BGP speaker settings.
11395	BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
11396	// ResourceGUID - The resource GUID property of the VirtualNetworkGateway resource.
11397	ResourceGUID *string `json:"resourceGuid,omitempty"`
11398	// ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGateway resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
11399	ProvisioningState *string `json:"provisioningState,omitempty"`
11400}
11401
11402// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat.
11403func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) {
11404	objectMap := make(map[string]interface{})
11405	if vngpf.IPConfigurations != nil {
11406		objectMap["ipConfigurations"] = vngpf.IPConfigurations
11407	}
11408	if vngpf.GatewayType != "" {
11409		objectMap["gatewayType"] = vngpf.GatewayType
11410	}
11411	if vngpf.VpnType != "" {
11412		objectMap["vpnType"] = vngpf.VpnType
11413	}
11414	if vngpf.EnableBgp != nil {
11415		objectMap["enableBgp"] = vngpf.EnableBgp
11416	}
11417	if vngpf.ActiveActive != nil {
11418		objectMap["activeActive"] = vngpf.ActiveActive
11419	}
11420	if vngpf.GatewayDefaultSite != nil {
11421		objectMap["gatewayDefaultSite"] = vngpf.GatewayDefaultSite
11422	}
11423	if vngpf.Sku != nil {
11424		objectMap["sku"] = vngpf.Sku
11425	}
11426	if vngpf.VpnClientConfiguration != nil {
11427		objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration
11428	}
11429	if vngpf.BgpSettings != nil {
11430		objectMap["bgpSettings"] = vngpf.BgpSettings
11431	}
11432	if vngpf.ResourceGUID != nil {
11433		objectMap["resourceGuid"] = vngpf.ResourceGUID
11434	}
11435	return json.Marshal(objectMap)
11436}
11437
11438// VirtualNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
11439// long-running operation.
11440type VirtualNetworkGatewaysCreateOrUpdateFuture struct {
11441	azure.FutureAPI
11442	// Result returns the result of the asynchronous operation.
11443	// If the operation has not completed it will return an error.
11444	Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error)
11445}
11446
11447// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11448func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
11449	var azFuture azure.Future
11450	if err := json.Unmarshal(body, &azFuture); err != nil {
11451		return err
11452	}
11453	future.FutureAPI = &azFuture
11454	future.Result = future.result
11455	return nil
11456}
11457
11458// result is the default implementation for VirtualNetworkGatewaysCreateOrUpdateFuture.Result.
11459func (future *VirtualNetworkGatewaysCreateOrUpdateFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
11460	var done bool
11461	done, err = future.DoneWithContext(context.Background(), client)
11462	if err != nil {
11463		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
11464		return
11465	}
11466	if !done {
11467		vng.Response.Response = future.Response()
11468		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysCreateOrUpdateFuture")
11469		return
11470	}
11471	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11472	if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent {
11473		vng, err = client.CreateOrUpdateResponder(vng.Response.Response)
11474		if err != nil {
11475			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysCreateOrUpdateFuture", "Result", vng.Response.Response, "Failure responding to request")
11476		}
11477	}
11478	return
11479}
11480
11481// VirtualNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a
11482// long-running operation.
11483type VirtualNetworkGatewaysDeleteFuture struct {
11484	azure.FutureAPI
11485	// Result returns the result of the asynchronous operation.
11486	// If the operation has not completed it will return an error.
11487	Result func(VirtualNetworkGatewaysClient) (autorest.Response, error)
11488}
11489
11490// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11491func (future *VirtualNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error {
11492	var azFuture azure.Future
11493	if err := json.Unmarshal(body, &azFuture); err != nil {
11494		return err
11495	}
11496	future.FutureAPI = &azFuture
11497	future.Result = future.result
11498	return nil
11499}
11500
11501// result is the default implementation for VirtualNetworkGatewaysDeleteFuture.Result.
11502func (future *VirtualNetworkGatewaysDeleteFuture) result(client VirtualNetworkGatewaysClient) (ar autorest.Response, err error) {
11503	var done bool
11504	done, err = future.DoneWithContext(context.Background(), client)
11505	if err != nil {
11506		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure")
11507		return
11508	}
11509	if !done {
11510		ar.Response = future.Response()
11511		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysDeleteFuture")
11512		return
11513	}
11514	ar.Response = future.Response()
11515	return
11516}
11517
11518// VirtualNetworkGatewaysGeneratevpnclientpackageFuture an abstraction for monitoring and retrieving the
11519// results of a long-running operation.
11520type VirtualNetworkGatewaysGeneratevpnclientpackageFuture struct {
11521	azure.FutureAPI
11522	// Result returns the result of the asynchronous operation.
11523	// If the operation has not completed it will return an error.
11524	Result func(VirtualNetworkGatewaysClient) (String, error)
11525}
11526
11527// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11528func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) UnmarshalJSON(body []byte) error {
11529	var azFuture azure.Future
11530	if err := json.Unmarshal(body, &azFuture); err != nil {
11531		return err
11532	}
11533	future.FutureAPI = &azFuture
11534	future.Result = future.result
11535	return nil
11536}
11537
11538// result is the default implementation for VirtualNetworkGatewaysGeneratevpnclientpackageFuture.Result.
11539func (future *VirtualNetworkGatewaysGeneratevpnclientpackageFuture) result(client VirtualNetworkGatewaysClient) (s String, err error) {
11540	var done bool
11541	done, err = future.DoneWithContext(context.Background(), client)
11542	if err != nil {
11543		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", future.Response(), "Polling failure")
11544		return
11545	}
11546	if !done {
11547		s.Response.Response = future.Response()
11548		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture")
11549		return
11550	}
11551	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11552	if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent {
11553		s, err = client.GeneratevpnclientpackageResponder(s.Response.Response)
11554		if err != nil {
11555			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGeneratevpnclientpackageFuture", "Result", s.Response.Response, "Failure responding to request")
11556		}
11557	}
11558	return
11559}
11560
11561// VirtualNetworkGatewaysGetAdvertisedRoutesFuture an abstraction for monitoring and retrieving the results
11562// of a long-running operation.
11563type VirtualNetworkGatewaysGetAdvertisedRoutesFuture struct {
11564	azure.FutureAPI
11565	// Result returns the result of the asynchronous operation.
11566	// If the operation has not completed it will return an error.
11567	Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error)
11568}
11569
11570// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11571func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) UnmarshalJSON(body []byte) error {
11572	var azFuture azure.Future
11573	if err := json.Unmarshal(body, &azFuture); err != nil {
11574		return err
11575	}
11576	future.FutureAPI = &azFuture
11577	future.Result = future.result
11578	return nil
11579}
11580
11581// result is the default implementation for VirtualNetworkGatewaysGetAdvertisedRoutesFuture.Result.
11582func (future *VirtualNetworkGatewaysGetAdvertisedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) {
11583	var done bool
11584	done, err = future.DoneWithContext(context.Background(), client)
11585	if err != nil {
11586		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", future.Response(), "Polling failure")
11587		return
11588	}
11589	if !done {
11590		grlr.Response.Response = future.Response()
11591		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture")
11592		return
11593	}
11594	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11595	if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent {
11596		grlr, err = client.GetAdvertisedRoutesResponder(grlr.Response.Response)
11597		if err != nil {
11598			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetAdvertisedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request")
11599		}
11600	}
11601	return
11602}
11603
11604// VirtualNetworkGatewaysGetBgpPeerStatusFuture an abstraction for monitoring and retrieving the results of
11605// a long-running operation.
11606type VirtualNetworkGatewaysGetBgpPeerStatusFuture struct {
11607	azure.FutureAPI
11608	// Result returns the result of the asynchronous operation.
11609	// If the operation has not completed it will return an error.
11610	Result func(VirtualNetworkGatewaysClient) (BgpPeerStatusListResult, error)
11611}
11612
11613// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11614func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) UnmarshalJSON(body []byte) error {
11615	var azFuture azure.Future
11616	if err := json.Unmarshal(body, &azFuture); err != nil {
11617		return err
11618	}
11619	future.FutureAPI = &azFuture
11620	future.Result = future.result
11621	return nil
11622}
11623
11624// result is the default implementation for VirtualNetworkGatewaysGetBgpPeerStatusFuture.Result.
11625func (future *VirtualNetworkGatewaysGetBgpPeerStatusFuture) result(client VirtualNetworkGatewaysClient) (bpslr BgpPeerStatusListResult, err error) {
11626	var done bool
11627	done, err = future.DoneWithContext(context.Background(), client)
11628	if err != nil {
11629		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", future.Response(), "Polling failure")
11630		return
11631	}
11632	if !done {
11633		bpslr.Response.Response = future.Response()
11634		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetBgpPeerStatusFuture")
11635		return
11636	}
11637	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11638	if bpslr.Response.Response, err = future.GetResult(sender); err == nil && bpslr.Response.Response.StatusCode != http.StatusNoContent {
11639		bpslr, err = client.GetBgpPeerStatusResponder(bpslr.Response.Response)
11640		if err != nil {
11641			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetBgpPeerStatusFuture", "Result", bpslr.Response.Response, "Failure responding to request")
11642		}
11643	}
11644	return
11645}
11646
11647// VirtualNetworkGatewaysGetLearnedRoutesFuture an abstraction for monitoring and retrieving the results of
11648// a long-running operation.
11649type VirtualNetworkGatewaysGetLearnedRoutesFuture struct {
11650	azure.FutureAPI
11651	// Result returns the result of the asynchronous operation.
11652	// If the operation has not completed it will return an error.
11653	Result func(VirtualNetworkGatewaysClient) (GatewayRouteListResult, error)
11654}
11655
11656// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11657func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) UnmarshalJSON(body []byte) error {
11658	var azFuture azure.Future
11659	if err := json.Unmarshal(body, &azFuture); err != nil {
11660		return err
11661	}
11662	future.FutureAPI = &azFuture
11663	future.Result = future.result
11664	return nil
11665}
11666
11667// result is the default implementation for VirtualNetworkGatewaysGetLearnedRoutesFuture.Result.
11668func (future *VirtualNetworkGatewaysGetLearnedRoutesFuture) result(client VirtualNetworkGatewaysClient) (grlr GatewayRouteListResult, err error) {
11669	var done bool
11670	done, err = future.DoneWithContext(context.Background(), client)
11671	if err != nil {
11672		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", future.Response(), "Polling failure")
11673		return
11674	}
11675	if !done {
11676		grlr.Response.Response = future.Response()
11677		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysGetLearnedRoutesFuture")
11678		return
11679	}
11680	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11681	if grlr.Response.Response, err = future.GetResult(sender); err == nil && grlr.Response.Response.StatusCode != http.StatusNoContent {
11682		grlr, err = client.GetLearnedRoutesResponder(grlr.Response.Response)
11683		if err != nil {
11684			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysGetLearnedRoutesFuture", "Result", grlr.Response.Response, "Failure responding to request")
11685		}
11686	}
11687	return
11688}
11689
11690// VirtualNetworkGatewaySku virtualNetworkGatewaySku details
11691type VirtualNetworkGatewaySku struct {
11692	// Name - Gateway SKU name. Possible values are: 'Basic', 'HighPerformance','Standard', and 'UltraPerformance'. Possible values include: 'VirtualNetworkGatewaySkuNameBasic', 'VirtualNetworkGatewaySkuNameHighPerformance', 'VirtualNetworkGatewaySkuNameStandard', 'VirtualNetworkGatewaySkuNameUltraPerformance'
11693	Name VirtualNetworkGatewaySkuName `json:"name,omitempty"`
11694	// Tier - Gateway SKU tier. Possible values are: 'Basic', 'HighPerformance','Standard', and 'UltraPerformance'. Possible values include: 'VirtualNetworkGatewaySkuTierBasic', 'VirtualNetworkGatewaySkuTierHighPerformance', 'VirtualNetworkGatewaySkuTierStandard', 'VirtualNetworkGatewaySkuTierUltraPerformance'
11695	Tier VirtualNetworkGatewaySkuTier `json:"tier,omitempty"`
11696	// Capacity - The capacity.
11697	Capacity *int32 `json:"capacity,omitempty"`
11698}
11699
11700// VirtualNetworkGatewaysResetFuture an abstraction for monitoring and retrieving the results of a
11701// long-running operation.
11702type VirtualNetworkGatewaysResetFuture struct {
11703	azure.FutureAPI
11704	// Result returns the result of the asynchronous operation.
11705	// If the operation has not completed it will return an error.
11706	Result func(VirtualNetworkGatewaysClient) (VirtualNetworkGateway, error)
11707}
11708
11709// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11710func (future *VirtualNetworkGatewaysResetFuture) UnmarshalJSON(body []byte) error {
11711	var azFuture azure.Future
11712	if err := json.Unmarshal(body, &azFuture); err != nil {
11713		return err
11714	}
11715	future.FutureAPI = &azFuture
11716	future.Result = future.result
11717	return nil
11718}
11719
11720// result is the default implementation for VirtualNetworkGatewaysResetFuture.Result.
11721func (future *VirtualNetworkGatewaysResetFuture) result(client VirtualNetworkGatewaysClient) (vng VirtualNetworkGateway, err error) {
11722	var done bool
11723	done, err = future.DoneWithContext(context.Background(), client)
11724	if err != nil {
11725		err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", future.Response(), "Polling failure")
11726		return
11727	}
11728	if !done {
11729		vng.Response.Response = future.Response()
11730		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkGatewaysResetFuture")
11731		return
11732	}
11733	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11734	if vng.Response.Response, err = future.GetResult(sender); err == nil && vng.Response.Response.StatusCode != http.StatusNoContent {
11735		vng, err = client.ResetResponder(vng.Response.Response)
11736		if err != nil {
11737			err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysResetFuture", "Result", vng.Response.Response, "Failure responding to request")
11738		}
11739	}
11740	return
11741}
11742
11743// VirtualNetworkListResult response for the ListVirtualNetworks API service call.
11744type VirtualNetworkListResult struct {
11745	autorest.Response `json:"-"`
11746	// Value - Gets a list of VirtualNetwork resources in a resource group.
11747	Value *[]VirtualNetwork `json:"value,omitempty"`
11748	// NextLink - The URL to get the next set of results.
11749	NextLink *string `json:"nextLink,omitempty"`
11750}
11751
11752// VirtualNetworkListResultIterator provides access to a complete listing of VirtualNetwork values.
11753type VirtualNetworkListResultIterator struct {
11754	i    int
11755	page VirtualNetworkListResultPage
11756}
11757
11758// NextWithContext advances to the next value.  If there was an error making
11759// the request the iterator does not advance and the error is returned.
11760func (iter *VirtualNetworkListResultIterator) NextWithContext(ctx context.Context) (err error) {
11761	if tracing.IsEnabled() {
11762		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultIterator.NextWithContext")
11763		defer func() {
11764			sc := -1
11765			if iter.Response().Response.Response != nil {
11766				sc = iter.Response().Response.Response.StatusCode
11767			}
11768			tracing.EndSpan(ctx, sc, err)
11769		}()
11770	}
11771	iter.i++
11772	if iter.i < len(iter.page.Values()) {
11773		return nil
11774	}
11775	err = iter.page.NextWithContext(ctx)
11776	if err != nil {
11777		iter.i--
11778		return err
11779	}
11780	iter.i = 0
11781	return nil
11782}
11783
11784// Next advances to the next value.  If there was an error making
11785// the request the iterator does not advance and the error is returned.
11786// Deprecated: Use NextWithContext() instead.
11787func (iter *VirtualNetworkListResultIterator) Next() error {
11788	return iter.NextWithContext(context.Background())
11789}
11790
11791// NotDone returns true if the enumeration should be started or is not yet complete.
11792func (iter VirtualNetworkListResultIterator) NotDone() bool {
11793	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11794}
11795
11796// Response returns the raw server response from the last page request.
11797func (iter VirtualNetworkListResultIterator) Response() VirtualNetworkListResult {
11798	return iter.page.Response()
11799}
11800
11801// Value returns the current value or a zero-initialized value if the
11802// iterator has advanced beyond the end of the collection.
11803func (iter VirtualNetworkListResultIterator) Value() VirtualNetwork {
11804	if !iter.page.NotDone() {
11805		return VirtualNetwork{}
11806	}
11807	return iter.page.Values()[iter.i]
11808}
11809
11810// Creates a new instance of the VirtualNetworkListResultIterator type.
11811func NewVirtualNetworkListResultIterator(page VirtualNetworkListResultPage) VirtualNetworkListResultIterator {
11812	return VirtualNetworkListResultIterator{page: page}
11813}
11814
11815// IsEmpty returns true if the ListResult contains no values.
11816func (vnlr VirtualNetworkListResult) IsEmpty() bool {
11817	return vnlr.Value == nil || len(*vnlr.Value) == 0
11818}
11819
11820// hasNextLink returns true if the NextLink is not empty.
11821func (vnlr VirtualNetworkListResult) hasNextLink() bool {
11822	return vnlr.NextLink != nil && len(*vnlr.NextLink) != 0
11823}
11824
11825// virtualNetworkListResultPreparer prepares a request to retrieve the next set of results.
11826// It returns nil if no more results exist.
11827func (vnlr VirtualNetworkListResult) virtualNetworkListResultPreparer(ctx context.Context) (*http.Request, error) {
11828	if !vnlr.hasNextLink() {
11829		return nil, nil
11830	}
11831	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11832		autorest.AsJSON(),
11833		autorest.AsGet(),
11834		autorest.WithBaseURL(to.String(vnlr.NextLink)))
11835}
11836
11837// VirtualNetworkListResultPage contains a page of VirtualNetwork values.
11838type VirtualNetworkListResultPage struct {
11839	fn   func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)
11840	vnlr VirtualNetworkListResult
11841}
11842
11843// NextWithContext advances to the next page of values.  If there was an error making
11844// the request the page does not advance and the error is returned.
11845func (page *VirtualNetworkListResultPage) NextWithContext(ctx context.Context) (err error) {
11846	if tracing.IsEnabled() {
11847		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListResultPage.NextWithContext")
11848		defer func() {
11849			sc := -1
11850			if page.Response().Response.Response != nil {
11851				sc = page.Response().Response.Response.StatusCode
11852			}
11853			tracing.EndSpan(ctx, sc, err)
11854		}()
11855	}
11856	for {
11857		next, err := page.fn(ctx, page.vnlr)
11858		if err != nil {
11859			return err
11860		}
11861		page.vnlr = next
11862		if !next.hasNextLink() || !next.IsEmpty() {
11863			break
11864		}
11865	}
11866	return nil
11867}
11868
11869// Next advances to the next page of values.  If there was an error making
11870// the request the page does not advance and the error is returned.
11871// Deprecated: Use NextWithContext() instead.
11872func (page *VirtualNetworkListResultPage) Next() error {
11873	return page.NextWithContext(context.Background())
11874}
11875
11876// NotDone returns true if the page enumeration should be started or is not yet complete.
11877func (page VirtualNetworkListResultPage) NotDone() bool {
11878	return !page.vnlr.IsEmpty()
11879}
11880
11881// Response returns the raw server response from the last page request.
11882func (page VirtualNetworkListResultPage) Response() VirtualNetworkListResult {
11883	return page.vnlr
11884}
11885
11886// Values returns the slice of values for the current page or nil if there are no values.
11887func (page VirtualNetworkListResultPage) Values() []VirtualNetwork {
11888	if page.vnlr.IsEmpty() {
11889		return nil
11890	}
11891	return *page.vnlr.Value
11892}
11893
11894// Creates a new instance of the VirtualNetworkListResultPage type.
11895func NewVirtualNetworkListResultPage(cur VirtualNetworkListResult, getNextPage func(context.Context, VirtualNetworkListResult) (VirtualNetworkListResult, error)) VirtualNetworkListResultPage {
11896	return VirtualNetworkListResultPage{
11897		fn:   getNextPage,
11898		vnlr: cur,
11899	}
11900}
11901
11902// VirtualNetworkPeering peerings in a virtual network resource.
11903type VirtualNetworkPeering struct {
11904	autorest.Response                      `json:"-"`
11905	*VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"`
11906	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
11907	Name *string `json:"name,omitempty"`
11908	// Etag - A unique read-only string that changes whenever the resource is updated.
11909	Etag *string `json:"etag,omitempty"`
11910	// ID - Resource ID.
11911	ID *string `json:"id,omitempty"`
11912}
11913
11914// MarshalJSON is the custom marshaler for VirtualNetworkPeering.
11915func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) {
11916	objectMap := make(map[string]interface{})
11917	if vnp.VirtualNetworkPeeringPropertiesFormat != nil {
11918		objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat
11919	}
11920	if vnp.Name != nil {
11921		objectMap["name"] = vnp.Name
11922	}
11923	if vnp.Etag != nil {
11924		objectMap["etag"] = vnp.Etag
11925	}
11926	if vnp.ID != nil {
11927		objectMap["id"] = vnp.ID
11928	}
11929	return json.Marshal(objectMap)
11930}
11931
11932// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct.
11933func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error {
11934	var m map[string]*json.RawMessage
11935	err := json.Unmarshal(body, &m)
11936	if err != nil {
11937		return err
11938	}
11939	for k, v := range m {
11940		switch k {
11941		case "properties":
11942			if v != nil {
11943				var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat
11944				err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat)
11945				if err != nil {
11946					return err
11947				}
11948				vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat
11949			}
11950		case "name":
11951			if v != nil {
11952				var name string
11953				err = json.Unmarshal(*v, &name)
11954				if err != nil {
11955					return err
11956				}
11957				vnp.Name = &name
11958			}
11959		case "etag":
11960			if v != nil {
11961				var etag string
11962				err = json.Unmarshal(*v, &etag)
11963				if err != nil {
11964					return err
11965				}
11966				vnp.Etag = &etag
11967			}
11968		case "id":
11969			if v != nil {
11970				var ID string
11971				err = json.Unmarshal(*v, &ID)
11972				if err != nil {
11973					return err
11974				}
11975				vnp.ID = &ID
11976			}
11977		}
11978	}
11979
11980	return nil
11981}
11982
11983// VirtualNetworkPeeringListResult response for ListSubnets API service call. Retrieves all subnets that
11984// belong to a virtual network.
11985type VirtualNetworkPeeringListResult struct {
11986	autorest.Response `json:"-"`
11987	// Value - The peerings in a virtual network.
11988	Value *[]VirtualNetworkPeering `json:"value,omitempty"`
11989	// NextLink - The URL to get the next set of results.
11990	NextLink *string `json:"nextLink,omitempty"`
11991}
11992
11993// VirtualNetworkPeeringListResultIterator provides access to a complete listing of VirtualNetworkPeering
11994// values.
11995type VirtualNetworkPeeringListResultIterator struct {
11996	i    int
11997	page VirtualNetworkPeeringListResultPage
11998}
11999
12000// NextWithContext advances to the next value.  If there was an error making
12001// the request the iterator does not advance and the error is returned.
12002func (iter *VirtualNetworkPeeringListResultIterator) NextWithContext(ctx context.Context) (err error) {
12003	if tracing.IsEnabled() {
12004		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultIterator.NextWithContext")
12005		defer func() {
12006			sc := -1
12007			if iter.Response().Response.Response != nil {
12008				sc = iter.Response().Response.Response.StatusCode
12009			}
12010			tracing.EndSpan(ctx, sc, err)
12011		}()
12012	}
12013	iter.i++
12014	if iter.i < len(iter.page.Values()) {
12015		return nil
12016	}
12017	err = iter.page.NextWithContext(ctx)
12018	if err != nil {
12019		iter.i--
12020		return err
12021	}
12022	iter.i = 0
12023	return nil
12024}
12025
12026// Next advances to the next value.  If there was an error making
12027// the request the iterator does not advance and the error is returned.
12028// Deprecated: Use NextWithContext() instead.
12029func (iter *VirtualNetworkPeeringListResultIterator) Next() error {
12030	return iter.NextWithContext(context.Background())
12031}
12032
12033// NotDone returns true if the enumeration should be started or is not yet complete.
12034func (iter VirtualNetworkPeeringListResultIterator) NotDone() bool {
12035	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12036}
12037
12038// Response returns the raw server response from the last page request.
12039func (iter VirtualNetworkPeeringListResultIterator) Response() VirtualNetworkPeeringListResult {
12040	return iter.page.Response()
12041}
12042
12043// Value returns the current value or a zero-initialized value if the
12044// iterator has advanced beyond the end of the collection.
12045func (iter VirtualNetworkPeeringListResultIterator) Value() VirtualNetworkPeering {
12046	if !iter.page.NotDone() {
12047		return VirtualNetworkPeering{}
12048	}
12049	return iter.page.Values()[iter.i]
12050}
12051
12052// Creates a new instance of the VirtualNetworkPeeringListResultIterator type.
12053func NewVirtualNetworkPeeringListResultIterator(page VirtualNetworkPeeringListResultPage) VirtualNetworkPeeringListResultIterator {
12054	return VirtualNetworkPeeringListResultIterator{page: page}
12055}
12056
12057// IsEmpty returns true if the ListResult contains no values.
12058func (vnplr VirtualNetworkPeeringListResult) IsEmpty() bool {
12059	return vnplr.Value == nil || len(*vnplr.Value) == 0
12060}
12061
12062// hasNextLink returns true if the NextLink is not empty.
12063func (vnplr VirtualNetworkPeeringListResult) hasNextLink() bool {
12064	return vnplr.NextLink != nil && len(*vnplr.NextLink) != 0
12065}
12066
12067// virtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results.
12068// It returns nil if no more results exist.
12069func (vnplr VirtualNetworkPeeringListResult) virtualNetworkPeeringListResultPreparer(ctx context.Context) (*http.Request, error) {
12070	if !vnplr.hasNextLink() {
12071		return nil, nil
12072	}
12073	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12074		autorest.AsJSON(),
12075		autorest.AsGet(),
12076		autorest.WithBaseURL(to.String(vnplr.NextLink)))
12077}
12078
12079// VirtualNetworkPeeringListResultPage contains a page of VirtualNetworkPeering values.
12080type VirtualNetworkPeeringListResultPage struct {
12081	fn    func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)
12082	vnplr VirtualNetworkPeeringListResult
12083}
12084
12085// NextWithContext advances to the next page of values.  If there was an error making
12086// the request the page does not advance and the error is returned.
12087func (page *VirtualNetworkPeeringListResultPage) NextWithContext(ctx context.Context) (err error) {
12088	if tracing.IsEnabled() {
12089		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListResultPage.NextWithContext")
12090		defer func() {
12091			sc := -1
12092			if page.Response().Response.Response != nil {
12093				sc = page.Response().Response.Response.StatusCode
12094			}
12095			tracing.EndSpan(ctx, sc, err)
12096		}()
12097	}
12098	for {
12099		next, err := page.fn(ctx, page.vnplr)
12100		if err != nil {
12101			return err
12102		}
12103		page.vnplr = next
12104		if !next.hasNextLink() || !next.IsEmpty() {
12105			break
12106		}
12107	}
12108	return nil
12109}
12110
12111// Next advances to the next page of values.  If there was an error making
12112// the request the page does not advance and the error is returned.
12113// Deprecated: Use NextWithContext() instead.
12114func (page *VirtualNetworkPeeringListResultPage) Next() error {
12115	return page.NextWithContext(context.Background())
12116}
12117
12118// NotDone returns true if the page enumeration should be started or is not yet complete.
12119func (page VirtualNetworkPeeringListResultPage) NotDone() bool {
12120	return !page.vnplr.IsEmpty()
12121}
12122
12123// Response returns the raw server response from the last page request.
12124func (page VirtualNetworkPeeringListResultPage) Response() VirtualNetworkPeeringListResult {
12125	return page.vnplr
12126}
12127
12128// Values returns the slice of values for the current page or nil if there are no values.
12129func (page VirtualNetworkPeeringListResultPage) Values() []VirtualNetworkPeering {
12130	if page.vnplr.IsEmpty() {
12131		return nil
12132	}
12133	return *page.vnplr.Value
12134}
12135
12136// Creates a new instance of the VirtualNetworkPeeringListResultPage type.
12137func NewVirtualNetworkPeeringListResultPage(cur VirtualNetworkPeeringListResult, getNextPage func(context.Context, VirtualNetworkPeeringListResult) (VirtualNetworkPeeringListResult, error)) VirtualNetworkPeeringListResultPage {
12138	return VirtualNetworkPeeringListResultPage{
12139		fn:    getNextPage,
12140		vnplr: cur,
12141	}
12142}
12143
12144// VirtualNetworkPeeringPropertiesFormat ...
12145type VirtualNetworkPeeringPropertiesFormat struct {
12146	// AllowVirtualNetworkAccess - Whether the VMs in the linked virtual network space would be able to access all the VMs in local Virtual network space.
12147	AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"`
12148	// AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the remote virtual network will be allowed/disallowed.
12149	AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"`
12150	// AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network.
12151	AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"`
12152	// 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.
12153	UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"`
12154	// RemoteVirtualNetwork - The reference of the remote virtual network.
12155	RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"`
12156	// PeeringState - The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and 'Disconnected'. Possible values include: 'Initiated', 'Connected', 'Disconnected'
12157	PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"`
12158	// ProvisioningState - The provisioning state of the resource.
12159	ProvisioningState *string `json:"provisioningState,omitempty"`
12160}
12161
12162// VirtualNetworkPeeringsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
12163// long-running operation.
12164type VirtualNetworkPeeringsCreateOrUpdateFuture struct {
12165	azure.FutureAPI
12166	// Result returns the result of the asynchronous operation.
12167	// If the operation has not completed it will return an error.
12168	Result func(VirtualNetworkPeeringsClient) (VirtualNetworkPeering, error)
12169}
12170
12171// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12172func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12173	var azFuture azure.Future
12174	if err := json.Unmarshal(body, &azFuture); err != nil {
12175		return err
12176	}
12177	future.FutureAPI = &azFuture
12178	future.Result = future.result
12179	return nil
12180}
12181
12182// result is the default implementation for VirtualNetworkPeeringsCreateOrUpdateFuture.Result.
12183func (future *VirtualNetworkPeeringsCreateOrUpdateFuture) result(client VirtualNetworkPeeringsClient) (vnp VirtualNetworkPeering, err error) {
12184	var done bool
12185	done, err = future.DoneWithContext(context.Background(), client)
12186	if err != nil {
12187		err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12188		return
12189	}
12190	if !done {
12191		vnp.Response.Response = future.Response()
12192		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsCreateOrUpdateFuture")
12193		return
12194	}
12195	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12196	if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent {
12197		vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response)
12198		if err != nil {
12199			err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request")
12200		}
12201	}
12202	return
12203}
12204
12205// VirtualNetworkPeeringsDeleteFuture an abstraction for monitoring and retrieving the results of a
12206// long-running operation.
12207type VirtualNetworkPeeringsDeleteFuture struct {
12208	azure.FutureAPI
12209	// Result returns the result of the asynchronous operation.
12210	// If the operation has not completed it will return an error.
12211	Result func(VirtualNetworkPeeringsClient) (autorest.Response, error)
12212}
12213
12214// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12215func (future *VirtualNetworkPeeringsDeleteFuture) UnmarshalJSON(body []byte) error {
12216	var azFuture azure.Future
12217	if err := json.Unmarshal(body, &azFuture); err != nil {
12218		return err
12219	}
12220	future.FutureAPI = &azFuture
12221	future.Result = future.result
12222	return nil
12223}
12224
12225// result is the default implementation for VirtualNetworkPeeringsDeleteFuture.Result.
12226func (future *VirtualNetworkPeeringsDeleteFuture) result(client VirtualNetworkPeeringsClient) (ar autorest.Response, err error) {
12227	var done bool
12228	done, err = future.DoneWithContext(context.Background(), client)
12229	if err != nil {
12230		err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsDeleteFuture", "Result", future.Response(), "Polling failure")
12231		return
12232	}
12233	if !done {
12234		ar.Response = future.Response()
12235		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworkPeeringsDeleteFuture")
12236		return
12237	}
12238	ar.Response = future.Response()
12239	return
12240}
12241
12242// VirtualNetworkPropertiesFormat ...
12243type VirtualNetworkPropertiesFormat struct {
12244	// AddressSpace - The AddressSpace that contains an array of IP address ranges that can be used by subnets.
12245	AddressSpace *AddressSpace `json:"addressSpace,omitempty"`
12246	// DhcpOptions - The dhcpOptions that contains an array of DNS servers available to VMs deployed in the virtual network.
12247	DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"`
12248	// Subnets - A list of subnets in a Virtual Network.
12249	Subnets *[]Subnet `json:"subnets,omitempty"`
12250	// VirtualNetworkPeerings - A list of peerings in a Virtual Network.
12251	VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"`
12252	// ResourceGUID - The resourceGuid property of the Virtual Network resource.
12253	ResourceGUID *string `json:"resourceGuid,omitempty"`
12254	// ProvisioningState - The provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
12255	ProvisioningState *string `json:"provisioningState,omitempty"`
12256}
12257
12258// VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
12259// long-running operation.
12260type VirtualNetworksCreateOrUpdateFuture struct {
12261	azure.FutureAPI
12262	// Result returns the result of the asynchronous operation.
12263	// If the operation has not completed it will return an error.
12264	Result func(VirtualNetworksClient) (VirtualNetwork, error)
12265}
12266
12267// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12268func (future *VirtualNetworksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12269	var azFuture azure.Future
12270	if err := json.Unmarshal(body, &azFuture); err != nil {
12271		return err
12272	}
12273	future.FutureAPI = &azFuture
12274	future.Result = future.result
12275	return nil
12276}
12277
12278// result is the default implementation for VirtualNetworksCreateOrUpdateFuture.Result.
12279func (future *VirtualNetworksCreateOrUpdateFuture) result(client VirtualNetworksClient) (vn VirtualNetwork, err error) {
12280	var done bool
12281	done, err = future.DoneWithContext(context.Background(), client)
12282	if err != nil {
12283		err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12284		return
12285	}
12286	if !done {
12287		vn.Response.Response = future.Response()
12288		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksCreateOrUpdateFuture")
12289		return
12290	}
12291	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12292	if vn.Response.Response, err = future.GetResult(sender); err == nil && vn.Response.Response.StatusCode != http.StatusNoContent {
12293		vn, err = client.CreateOrUpdateResponder(vn.Response.Response)
12294		if err != nil {
12295			err = autorest.NewErrorWithError(err, "network.VirtualNetworksCreateOrUpdateFuture", "Result", vn.Response.Response, "Failure responding to request")
12296		}
12297	}
12298	return
12299}
12300
12301// VirtualNetworksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
12302// operation.
12303type VirtualNetworksDeleteFuture struct {
12304	azure.FutureAPI
12305	// Result returns the result of the asynchronous operation.
12306	// If the operation has not completed it will return an error.
12307	Result func(VirtualNetworksClient) (autorest.Response, error)
12308}
12309
12310// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12311func (future *VirtualNetworksDeleteFuture) UnmarshalJSON(body []byte) error {
12312	var azFuture azure.Future
12313	if err := json.Unmarshal(body, &azFuture); err != nil {
12314		return err
12315	}
12316	future.FutureAPI = &azFuture
12317	future.Result = future.result
12318	return nil
12319}
12320
12321// result is the default implementation for VirtualNetworksDeleteFuture.Result.
12322func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) (ar autorest.Response, err error) {
12323	var done bool
12324	done, err = future.DoneWithContext(context.Background(), client)
12325	if err != nil {
12326		err = autorest.NewErrorWithError(err, "network.VirtualNetworksDeleteFuture", "Result", future.Response(), "Polling failure")
12327		return
12328	}
12329	if !done {
12330		ar.Response = future.Response()
12331		err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksDeleteFuture")
12332		return
12333	}
12334	ar.Response = future.Response()
12335	return
12336}
12337
12338// VpnClientConfiguration vpnClientConfiguration for P2S client.
12339type VpnClientConfiguration struct {
12340	// VpnClientAddressPool - The reference of the address space resource which represents Address space for P2S VpnClient.
12341	VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"`
12342	// VpnClientRootCertificates - VpnClientRootCertificate for virtual network gateway.
12343	VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"`
12344	// VpnClientRevokedCertificates - VpnClientRevokedCertificate for Virtual network gateway.
12345	VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"`
12346}
12347
12348// VpnClientParameters vpnClientParameters
12349type VpnClientParameters struct {
12350	// ProcessorArchitecture - VPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. Possible values include: 'Amd64', 'X86'
12351	ProcessorArchitecture ProcessorArchitecture `json:"ProcessorArchitecture,omitempty"`
12352}
12353
12354// VpnClientRevokedCertificate VPN client revoked certificate of virtual network gateway.
12355type VpnClientRevokedCertificate struct {
12356	*VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"`
12357	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
12358	Name *string `json:"name,omitempty"`
12359	// Etag - A unique read-only string that changes whenever the resource is updated.
12360	Etag *string `json:"etag,omitempty"`
12361	// ID - Resource ID.
12362	ID *string `json:"id,omitempty"`
12363}
12364
12365// MarshalJSON is the custom marshaler for VpnClientRevokedCertificate.
12366func (vcrc VpnClientRevokedCertificate) MarshalJSON() ([]byte, error) {
12367	objectMap := make(map[string]interface{})
12368	if vcrc.VpnClientRevokedCertificatePropertiesFormat != nil {
12369		objectMap["properties"] = vcrc.VpnClientRevokedCertificatePropertiesFormat
12370	}
12371	if vcrc.Name != nil {
12372		objectMap["name"] = vcrc.Name
12373	}
12374	if vcrc.Etag != nil {
12375		objectMap["etag"] = vcrc.Etag
12376	}
12377	if vcrc.ID != nil {
12378		objectMap["id"] = vcrc.ID
12379	}
12380	return json.Marshal(objectMap)
12381}
12382
12383// UnmarshalJSON is the custom unmarshaler for VpnClientRevokedCertificate struct.
12384func (vcrc *VpnClientRevokedCertificate) UnmarshalJSON(body []byte) error {
12385	var m map[string]*json.RawMessage
12386	err := json.Unmarshal(body, &m)
12387	if err != nil {
12388		return err
12389	}
12390	for k, v := range m {
12391		switch k {
12392		case "properties":
12393			if v != nil {
12394				var vpnClientRevokedCertificatePropertiesFormat VpnClientRevokedCertificatePropertiesFormat
12395				err = json.Unmarshal(*v, &vpnClientRevokedCertificatePropertiesFormat)
12396				if err != nil {
12397					return err
12398				}
12399				vcrc.VpnClientRevokedCertificatePropertiesFormat = &vpnClientRevokedCertificatePropertiesFormat
12400			}
12401		case "name":
12402			if v != nil {
12403				var name string
12404				err = json.Unmarshal(*v, &name)
12405				if err != nil {
12406					return err
12407				}
12408				vcrc.Name = &name
12409			}
12410		case "etag":
12411			if v != nil {
12412				var etag string
12413				err = json.Unmarshal(*v, &etag)
12414				if err != nil {
12415					return err
12416				}
12417				vcrc.Etag = &etag
12418			}
12419		case "id":
12420			if v != nil {
12421				var ID string
12422				err = json.Unmarshal(*v, &ID)
12423				if err != nil {
12424					return err
12425				}
12426				vcrc.ID = &ID
12427			}
12428		}
12429	}
12430
12431	return nil
12432}
12433
12434// VpnClientRevokedCertificatePropertiesFormat properties of the revoked VPN client certificate of virtual
12435// network gateway.
12436type VpnClientRevokedCertificatePropertiesFormat struct {
12437	// Thumbprint - The revoked VPN client certificate thumbprint.
12438	Thumbprint *string `json:"thumbprint,omitempty"`
12439	// ProvisioningState - READ-ONLY; The provisioning state of the VPN client revoked certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
12440	ProvisioningState *string `json:"provisioningState,omitempty"`
12441}
12442
12443// MarshalJSON is the custom marshaler for VpnClientRevokedCertificatePropertiesFormat.
12444func (vcrcpf VpnClientRevokedCertificatePropertiesFormat) MarshalJSON() ([]byte, error) {
12445	objectMap := make(map[string]interface{})
12446	if vcrcpf.Thumbprint != nil {
12447		objectMap["thumbprint"] = vcrcpf.Thumbprint
12448	}
12449	return json.Marshal(objectMap)
12450}
12451
12452// VpnClientRootCertificate VPN client root certificate of virtual network gateway
12453type VpnClientRootCertificate struct {
12454	*VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"`
12455	// Name - The name of the resource that is unique within a resource group. This name can be used to access the resource.
12456	Name *string `json:"name,omitempty"`
12457	// Etag - A unique read-only string that changes whenever the resource is updated.
12458	Etag *string `json:"etag,omitempty"`
12459	// ID - Resource ID.
12460	ID *string `json:"id,omitempty"`
12461}
12462
12463// MarshalJSON is the custom marshaler for VpnClientRootCertificate.
12464func (vcrc VpnClientRootCertificate) MarshalJSON() ([]byte, error) {
12465	objectMap := make(map[string]interface{})
12466	if vcrc.VpnClientRootCertificatePropertiesFormat != nil {
12467		objectMap["properties"] = vcrc.VpnClientRootCertificatePropertiesFormat
12468	}
12469	if vcrc.Name != nil {
12470		objectMap["name"] = vcrc.Name
12471	}
12472	if vcrc.Etag != nil {
12473		objectMap["etag"] = vcrc.Etag
12474	}
12475	if vcrc.ID != nil {
12476		objectMap["id"] = vcrc.ID
12477	}
12478	return json.Marshal(objectMap)
12479}
12480
12481// UnmarshalJSON is the custom unmarshaler for VpnClientRootCertificate struct.
12482func (vcrc *VpnClientRootCertificate) UnmarshalJSON(body []byte) error {
12483	var m map[string]*json.RawMessage
12484	err := json.Unmarshal(body, &m)
12485	if err != nil {
12486		return err
12487	}
12488	for k, v := range m {
12489		switch k {
12490		case "properties":
12491			if v != nil {
12492				var vpnClientRootCertificatePropertiesFormat VpnClientRootCertificatePropertiesFormat
12493				err = json.Unmarshal(*v, &vpnClientRootCertificatePropertiesFormat)
12494				if err != nil {
12495					return err
12496				}
12497				vcrc.VpnClientRootCertificatePropertiesFormat = &vpnClientRootCertificatePropertiesFormat
12498			}
12499		case "name":
12500			if v != nil {
12501				var name string
12502				err = json.Unmarshal(*v, &name)
12503				if err != nil {
12504					return err
12505				}
12506				vcrc.Name = &name
12507			}
12508		case "etag":
12509			if v != nil {
12510				var etag string
12511				err = json.Unmarshal(*v, &etag)
12512				if err != nil {
12513					return err
12514				}
12515				vcrc.Etag = &etag
12516			}
12517		case "id":
12518			if v != nil {
12519				var ID string
12520				err = json.Unmarshal(*v, &ID)
12521				if err != nil {
12522					return err
12523				}
12524				vcrc.ID = &ID
12525			}
12526		}
12527	}
12528
12529	return nil
12530}
12531
12532// VpnClientRootCertificatePropertiesFormat properties of SSL certificates of application gateway
12533type VpnClientRootCertificatePropertiesFormat struct {
12534	// PublicCertData - The certificate public data.
12535	PublicCertData *string `json:"publicCertData,omitempty"`
12536	// ProvisioningState - READ-ONLY; The provisioning state of the VPN client root certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
12537	ProvisioningState *string `json:"provisioningState,omitempty"`
12538}
12539
12540// MarshalJSON is the custom marshaler for VpnClientRootCertificatePropertiesFormat.
12541func (vcrcpf VpnClientRootCertificatePropertiesFormat) MarshalJSON() ([]byte, error) {
12542	objectMap := make(map[string]interface{})
12543	if vcrcpf.PublicCertData != nil {
12544		objectMap["publicCertData"] = vcrcpf.PublicCertData
12545	}
12546	return json.Marshal(objectMap)
12547}
12548
12549// Watcher network watcher in a resource group.
12550type Watcher struct {
12551	autorest.Response `json:"-"`
12552	// Etag - A unique read-only string that changes whenever the resource is updated.
12553	Etag                     *string `json:"etag,omitempty"`
12554	*WatcherPropertiesFormat `json:"properties,omitempty"`
12555	// ID - Resource ID.
12556	ID *string `json:"id,omitempty"`
12557	// Name - READ-ONLY; Resource name.
12558	Name *string `json:"name,omitempty"`
12559	// Type - READ-ONLY; Resource type.
12560	Type *string `json:"type,omitempty"`
12561	// Location - Resource location.
12562	Location *string `json:"location,omitempty"`
12563	// Tags - Resource tags.
12564	Tags map[string]*string `json:"tags"`
12565}
12566
12567// MarshalJSON is the custom marshaler for Watcher.
12568func (w Watcher) MarshalJSON() ([]byte, error) {
12569	objectMap := make(map[string]interface{})
12570	if w.Etag != nil {
12571		objectMap["etag"] = w.Etag
12572	}
12573	if w.WatcherPropertiesFormat != nil {
12574		objectMap["properties"] = w.WatcherPropertiesFormat
12575	}
12576	if w.ID != nil {
12577		objectMap["id"] = w.ID
12578	}
12579	if w.Location != nil {
12580		objectMap["location"] = w.Location
12581	}
12582	if w.Tags != nil {
12583		objectMap["tags"] = w.Tags
12584	}
12585	return json.Marshal(objectMap)
12586}
12587
12588// UnmarshalJSON is the custom unmarshaler for Watcher struct.
12589func (w *Watcher) UnmarshalJSON(body []byte) error {
12590	var m map[string]*json.RawMessage
12591	err := json.Unmarshal(body, &m)
12592	if err != nil {
12593		return err
12594	}
12595	for k, v := range m {
12596		switch k {
12597		case "etag":
12598			if v != nil {
12599				var etag string
12600				err = json.Unmarshal(*v, &etag)
12601				if err != nil {
12602					return err
12603				}
12604				w.Etag = &etag
12605			}
12606		case "properties":
12607			if v != nil {
12608				var watcherPropertiesFormat WatcherPropertiesFormat
12609				err = json.Unmarshal(*v, &watcherPropertiesFormat)
12610				if err != nil {
12611					return err
12612				}
12613				w.WatcherPropertiesFormat = &watcherPropertiesFormat
12614			}
12615		case "id":
12616			if v != nil {
12617				var ID string
12618				err = json.Unmarshal(*v, &ID)
12619				if err != nil {
12620					return err
12621				}
12622				w.ID = &ID
12623			}
12624		case "name":
12625			if v != nil {
12626				var name string
12627				err = json.Unmarshal(*v, &name)
12628				if err != nil {
12629					return err
12630				}
12631				w.Name = &name
12632			}
12633		case "type":
12634			if v != nil {
12635				var typeVar string
12636				err = json.Unmarshal(*v, &typeVar)
12637				if err != nil {
12638					return err
12639				}
12640				w.Type = &typeVar
12641			}
12642		case "location":
12643			if v != nil {
12644				var location string
12645				err = json.Unmarshal(*v, &location)
12646				if err != nil {
12647					return err
12648				}
12649				w.Location = &location
12650			}
12651		case "tags":
12652			if v != nil {
12653				var tags map[string]*string
12654				err = json.Unmarshal(*v, &tags)
12655				if err != nil {
12656					return err
12657				}
12658				w.Tags = tags
12659			}
12660		}
12661	}
12662
12663	return nil
12664}
12665
12666// WatcherListResult list of network watcher resources.
12667type WatcherListResult struct {
12668	autorest.Response `json:"-"`
12669	Value             *[]Watcher `json:"value,omitempty"`
12670}
12671
12672// WatcherPropertiesFormat the network watcher properties.
12673type WatcherPropertiesFormat struct {
12674	// ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed'
12675	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
12676}
12677
12678// MarshalJSON is the custom marshaler for WatcherPropertiesFormat.
12679func (wpf WatcherPropertiesFormat) MarshalJSON() ([]byte, error) {
12680	objectMap := make(map[string]interface{})
12681	return json.Marshal(objectMap)
12682}
12683
12684// WatchersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
12685// operation.
12686type WatchersDeleteFuture struct {
12687	azure.FutureAPI
12688	// Result returns the result of the asynchronous operation.
12689	// If the operation has not completed it will return an error.
12690	Result func(WatchersClient) (autorest.Response, error)
12691}
12692
12693// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12694func (future *WatchersDeleteFuture) UnmarshalJSON(body []byte) error {
12695	var azFuture azure.Future
12696	if err := json.Unmarshal(body, &azFuture); err != nil {
12697		return err
12698	}
12699	future.FutureAPI = &azFuture
12700	future.Result = future.result
12701	return nil
12702}
12703
12704// result is the default implementation for WatchersDeleteFuture.Result.
12705func (future *WatchersDeleteFuture) result(client WatchersClient) (ar autorest.Response, err error) {
12706	var done bool
12707	done, err = future.DoneWithContext(context.Background(), client)
12708	if err != nil {
12709		err = autorest.NewErrorWithError(err, "network.WatchersDeleteFuture", "Result", future.Response(), "Polling failure")
12710		return
12711	}
12712	if !done {
12713		ar.Response = future.Response()
12714		err = azure.NewAsyncOpIncompleteError("network.WatchersDeleteFuture")
12715		return
12716	}
12717	ar.Response = future.Response()
12718	return
12719}
12720
12721// WatchersGetFlowLogStatusFuture an abstraction for monitoring and retrieving the results of a
12722// long-running operation.
12723type WatchersGetFlowLogStatusFuture struct {
12724	azure.FutureAPI
12725	// Result returns the result of the asynchronous operation.
12726	// If the operation has not completed it will return an error.
12727	Result func(WatchersClient) (FlowLogInformation, error)
12728}
12729
12730// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12731func (future *WatchersGetFlowLogStatusFuture) UnmarshalJSON(body []byte) error {
12732	var azFuture azure.Future
12733	if err := json.Unmarshal(body, &azFuture); err != nil {
12734		return err
12735	}
12736	future.FutureAPI = &azFuture
12737	future.Result = future.result
12738	return nil
12739}
12740
12741// result is the default implementation for WatchersGetFlowLogStatusFuture.Result.
12742func (future *WatchersGetFlowLogStatusFuture) result(client WatchersClient) (fli FlowLogInformation, err error) {
12743	var done bool
12744	done, err = future.DoneWithContext(context.Background(), client)
12745	if err != nil {
12746		err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", future.Response(), "Polling failure")
12747		return
12748	}
12749	if !done {
12750		fli.Response.Response = future.Response()
12751		err = azure.NewAsyncOpIncompleteError("network.WatchersGetFlowLogStatusFuture")
12752		return
12753	}
12754	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12755	if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent {
12756		fli, err = client.GetFlowLogStatusResponder(fli.Response.Response)
12757		if err != nil {
12758			err = autorest.NewErrorWithError(err, "network.WatchersGetFlowLogStatusFuture", "Result", fli.Response.Response, "Failure responding to request")
12759		}
12760	}
12761	return
12762}
12763
12764// WatchersGetNextHopFuture an abstraction for monitoring and retrieving the results of a long-running
12765// operation.
12766type WatchersGetNextHopFuture struct {
12767	azure.FutureAPI
12768	// Result returns the result of the asynchronous operation.
12769	// If the operation has not completed it will return an error.
12770	Result func(WatchersClient) (NextHopResult, error)
12771}
12772
12773// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12774func (future *WatchersGetNextHopFuture) UnmarshalJSON(body []byte) error {
12775	var azFuture azure.Future
12776	if err := json.Unmarshal(body, &azFuture); err != nil {
12777		return err
12778	}
12779	future.FutureAPI = &azFuture
12780	future.Result = future.result
12781	return nil
12782}
12783
12784// result is the default implementation for WatchersGetNextHopFuture.Result.
12785func (future *WatchersGetNextHopFuture) result(client WatchersClient) (nhr NextHopResult, err error) {
12786	var done bool
12787	done, err = future.DoneWithContext(context.Background(), client)
12788	if err != nil {
12789		err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", future.Response(), "Polling failure")
12790		return
12791	}
12792	if !done {
12793		nhr.Response.Response = future.Response()
12794		err = azure.NewAsyncOpIncompleteError("network.WatchersGetNextHopFuture")
12795		return
12796	}
12797	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12798	if nhr.Response.Response, err = future.GetResult(sender); err == nil && nhr.Response.Response.StatusCode != http.StatusNoContent {
12799		nhr, err = client.GetNextHopResponder(nhr.Response.Response)
12800		if err != nil {
12801			err = autorest.NewErrorWithError(err, "network.WatchersGetNextHopFuture", "Result", nhr.Response.Response, "Failure responding to request")
12802		}
12803	}
12804	return
12805}
12806
12807// WatchersGetTroubleshootingFuture an abstraction for monitoring and retrieving the results of a
12808// long-running operation.
12809type WatchersGetTroubleshootingFuture struct {
12810	azure.FutureAPI
12811	// Result returns the result of the asynchronous operation.
12812	// If the operation has not completed it will return an error.
12813	Result func(WatchersClient) (TroubleshootingResult, error)
12814}
12815
12816// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12817func (future *WatchersGetTroubleshootingFuture) UnmarshalJSON(body []byte) error {
12818	var azFuture azure.Future
12819	if err := json.Unmarshal(body, &azFuture); err != nil {
12820		return err
12821	}
12822	future.FutureAPI = &azFuture
12823	future.Result = future.result
12824	return nil
12825}
12826
12827// result is the default implementation for WatchersGetTroubleshootingFuture.Result.
12828func (future *WatchersGetTroubleshootingFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) {
12829	var done bool
12830	done, err = future.DoneWithContext(context.Background(), client)
12831	if err != nil {
12832		err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", future.Response(), "Polling failure")
12833		return
12834	}
12835	if !done {
12836		tr.Response.Response = future.Response()
12837		err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingFuture")
12838		return
12839	}
12840	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12841	if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent {
12842		tr, err = client.GetTroubleshootingResponder(tr.Response.Response)
12843		if err != nil {
12844			err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingFuture", "Result", tr.Response.Response, "Failure responding to request")
12845		}
12846	}
12847	return
12848}
12849
12850// WatchersGetTroubleshootingResultFuture an abstraction for monitoring and retrieving the results of a
12851// long-running operation.
12852type WatchersGetTroubleshootingResultFuture struct {
12853	azure.FutureAPI
12854	// Result returns the result of the asynchronous operation.
12855	// If the operation has not completed it will return an error.
12856	Result func(WatchersClient) (TroubleshootingResult, error)
12857}
12858
12859// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12860func (future *WatchersGetTroubleshootingResultFuture) UnmarshalJSON(body []byte) error {
12861	var azFuture azure.Future
12862	if err := json.Unmarshal(body, &azFuture); err != nil {
12863		return err
12864	}
12865	future.FutureAPI = &azFuture
12866	future.Result = future.result
12867	return nil
12868}
12869
12870// result is the default implementation for WatchersGetTroubleshootingResultFuture.Result.
12871func (future *WatchersGetTroubleshootingResultFuture) result(client WatchersClient) (tr TroubleshootingResult, err error) {
12872	var done bool
12873	done, err = future.DoneWithContext(context.Background(), client)
12874	if err != nil {
12875		err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", future.Response(), "Polling failure")
12876		return
12877	}
12878	if !done {
12879		tr.Response.Response = future.Response()
12880		err = azure.NewAsyncOpIncompleteError("network.WatchersGetTroubleshootingResultFuture")
12881		return
12882	}
12883	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12884	if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent {
12885		tr, err = client.GetTroubleshootingResultResponder(tr.Response.Response)
12886		if err != nil {
12887			err = autorest.NewErrorWithError(err, "network.WatchersGetTroubleshootingResultFuture", "Result", tr.Response.Response, "Failure responding to request")
12888		}
12889	}
12890	return
12891}
12892
12893// WatchersGetVMSecurityRulesFuture an abstraction for monitoring and retrieving the results of a
12894// long-running operation.
12895type WatchersGetVMSecurityRulesFuture struct {
12896	azure.FutureAPI
12897	// Result returns the result of the asynchronous operation.
12898	// If the operation has not completed it will return an error.
12899	Result func(WatchersClient) (SecurityGroupViewResult, error)
12900}
12901
12902// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12903func (future *WatchersGetVMSecurityRulesFuture) UnmarshalJSON(body []byte) error {
12904	var azFuture azure.Future
12905	if err := json.Unmarshal(body, &azFuture); err != nil {
12906		return err
12907	}
12908	future.FutureAPI = &azFuture
12909	future.Result = future.result
12910	return nil
12911}
12912
12913// result is the default implementation for WatchersGetVMSecurityRulesFuture.Result.
12914func (future *WatchersGetVMSecurityRulesFuture) result(client WatchersClient) (sgvr SecurityGroupViewResult, err error) {
12915	var done bool
12916	done, err = future.DoneWithContext(context.Background(), client)
12917	if err != nil {
12918		err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", future.Response(), "Polling failure")
12919		return
12920	}
12921	if !done {
12922		sgvr.Response.Response = future.Response()
12923		err = azure.NewAsyncOpIncompleteError("network.WatchersGetVMSecurityRulesFuture")
12924		return
12925	}
12926	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12927	if sgvr.Response.Response, err = future.GetResult(sender); err == nil && sgvr.Response.Response.StatusCode != http.StatusNoContent {
12928		sgvr, err = client.GetVMSecurityRulesResponder(sgvr.Response.Response)
12929		if err != nil {
12930			err = autorest.NewErrorWithError(err, "network.WatchersGetVMSecurityRulesFuture", "Result", sgvr.Response.Response, "Failure responding to request")
12931		}
12932	}
12933	return
12934}
12935
12936// WatchersSetFlowLogConfigurationFuture an abstraction for monitoring and retrieving the results of a
12937// long-running operation.
12938type WatchersSetFlowLogConfigurationFuture struct {
12939	azure.FutureAPI
12940	// Result returns the result of the asynchronous operation.
12941	// If the operation has not completed it will return an error.
12942	Result func(WatchersClient) (FlowLogInformation, error)
12943}
12944
12945// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12946func (future *WatchersSetFlowLogConfigurationFuture) UnmarshalJSON(body []byte) error {
12947	var azFuture azure.Future
12948	if err := json.Unmarshal(body, &azFuture); err != nil {
12949		return err
12950	}
12951	future.FutureAPI = &azFuture
12952	future.Result = future.result
12953	return nil
12954}
12955
12956// result is the default implementation for WatchersSetFlowLogConfigurationFuture.Result.
12957func (future *WatchersSetFlowLogConfigurationFuture) result(client WatchersClient) (fli FlowLogInformation, err error) {
12958	var done bool
12959	done, err = future.DoneWithContext(context.Background(), client)
12960	if err != nil {
12961		err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", future.Response(), "Polling failure")
12962		return
12963	}
12964	if !done {
12965		fli.Response.Response = future.Response()
12966		err = azure.NewAsyncOpIncompleteError("network.WatchersSetFlowLogConfigurationFuture")
12967		return
12968	}
12969	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12970	if fli.Response.Response, err = future.GetResult(sender); err == nil && fli.Response.Response.StatusCode != http.StatusNoContent {
12971		fli, err = client.SetFlowLogConfigurationResponder(fli.Response.Response)
12972		if err != nil {
12973			err = autorest.NewErrorWithError(err, "network.WatchersSetFlowLogConfigurationFuture", "Result", fli.Response.Response, "Failure responding to request")
12974		}
12975	}
12976	return
12977}
12978
12979// WatchersVerifyIPFlowFuture an abstraction for monitoring and retrieving the results of a long-running
12980// operation.
12981type WatchersVerifyIPFlowFuture struct {
12982	azure.FutureAPI
12983	// Result returns the result of the asynchronous operation.
12984	// If the operation has not completed it will return an error.
12985	Result func(WatchersClient) (VerificationIPFlowResult, error)
12986}
12987
12988// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12989func (future *WatchersVerifyIPFlowFuture) UnmarshalJSON(body []byte) error {
12990	var azFuture azure.Future
12991	if err := json.Unmarshal(body, &azFuture); err != nil {
12992		return err
12993	}
12994	future.FutureAPI = &azFuture
12995	future.Result = future.result
12996	return nil
12997}
12998
12999// result is the default implementation for WatchersVerifyIPFlowFuture.Result.
13000func (future *WatchersVerifyIPFlowFuture) result(client WatchersClient) (vifr VerificationIPFlowResult, err error) {
13001	var done bool
13002	done, err = future.DoneWithContext(context.Background(), client)
13003	if err != nil {
13004		err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", future.Response(), "Polling failure")
13005		return
13006	}
13007	if !done {
13008		vifr.Response.Response = future.Response()
13009		err = azure.NewAsyncOpIncompleteError("network.WatchersVerifyIPFlowFuture")
13010		return
13011	}
13012	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13013	if vifr.Response.Response, err = future.GetResult(sender); err == nil && vifr.Response.Response.StatusCode != http.StatusNoContent {
13014		vifr, err = client.VerifyIPFlowResponder(vifr.Response.Response)
13015		if err != nil {
13016			err = autorest.NewErrorWithError(err, "network.WatchersVerifyIPFlowFuture", "Result", vifr.Response.Response, "Failure responding to request")
13017		}
13018	}
13019	return
13020}
13021