1package peering
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/date"
14	"github.com/Azure/go-autorest/autorest/to"
15	"github.com/Azure/go-autorest/tracing"
16	"net/http"
17)
18
19// The package's fully qualified name.
20const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/peering/mgmt/2019-09-01-preview/peering"
21
22// BandwidthOffer the properties that define a peering bandwidth offer.
23type BandwidthOffer struct {
24	// OfferName - The name of the bandwidth offer.
25	OfferName *string `json:"offerName,omitempty"`
26	// ValueInMbps - The value of the bandwidth offer in Mbps.
27	ValueInMbps *int32 `json:"valueInMbps,omitempty"`
28}
29
30// BgpSession the properties that define a BGP session.
31type BgpSession struct {
32	// SessionPrefixV4 - The IPv4 prefix that contains both ends' IPv4 addresses.
33	SessionPrefixV4 *string `json:"sessionPrefixV4,omitempty"`
34	// SessionPrefixV6 - The IPv6 prefix that contains both ends' IPv6 addresses.
35	SessionPrefixV6 *string `json:"sessionPrefixV6,omitempty"`
36	// MicrosoftSessionIPv4Address - READ-ONLY; The IPv4 session address on Microsoft's end.
37	MicrosoftSessionIPv4Address *string `json:"microsoftSessionIPv4Address,omitempty"`
38	// MicrosoftSessionIPv6Address - READ-ONLY; The IPv6 session address on Microsoft's end.
39	MicrosoftSessionIPv6Address *string `json:"microsoftSessionIPv6Address,omitempty"`
40	// PeerSessionIPv4Address - The IPv4 session address on peer's end.
41	PeerSessionIPv4Address *string `json:"peerSessionIPv4Address,omitempty"`
42	// PeerSessionIPv6Address - The IPv6 session address on peer's end.
43	PeerSessionIPv6Address *string `json:"peerSessionIPv6Address,omitempty"`
44	// SessionStateV4 - READ-ONLY; The state of the IPv4 session. Possible values include: 'SessionStateV4None', 'SessionStateV4Idle', 'SessionStateV4Connect', 'SessionStateV4Active', 'SessionStateV4OpenSent', 'SessionStateV4OpenConfirm', 'SessionStateV4OpenReceived', 'SessionStateV4Established', 'SessionStateV4PendingAdd', 'SessionStateV4PendingUpdate', 'SessionStateV4PendingRemove'
45	SessionStateV4 SessionStateV4 `json:"sessionStateV4,omitempty"`
46	// SessionStateV6 - READ-ONLY; The state of the IPv6 session. Possible values include: 'SessionStateV6None', 'SessionStateV6Idle', 'SessionStateV6Connect', 'SessionStateV6Active', 'SessionStateV6OpenSent', 'SessionStateV6OpenConfirm', 'SessionStateV6OpenReceived', 'SessionStateV6Established', 'SessionStateV6PendingAdd', 'SessionStateV6PendingUpdate', 'SessionStateV6PendingRemove'
47	SessionStateV6 SessionStateV6 `json:"sessionStateV6,omitempty"`
48	// MaxPrefixesAdvertisedV4 - The maximum number of prefixes advertised over the IPv4 session.
49	MaxPrefixesAdvertisedV4 *int32 `json:"maxPrefixesAdvertisedV4,omitempty"`
50	// MaxPrefixesAdvertisedV6 - The maximum number of prefixes advertised over the IPv6 session.
51	MaxPrefixesAdvertisedV6 *int32 `json:"maxPrefixesAdvertisedV6,omitempty"`
52	// Md5AuthenticationKey - The MD5 authentication key of the session.
53	Md5AuthenticationKey *string `json:"md5AuthenticationKey,omitempty"`
54}
55
56// MarshalJSON is the custom marshaler for BgpSession.
57func (bs BgpSession) MarshalJSON() ([]byte, error) {
58	objectMap := make(map[string]interface{})
59	if bs.SessionPrefixV4 != nil {
60		objectMap["sessionPrefixV4"] = bs.SessionPrefixV4
61	}
62	if bs.SessionPrefixV6 != nil {
63		objectMap["sessionPrefixV6"] = bs.SessionPrefixV6
64	}
65	if bs.PeerSessionIPv4Address != nil {
66		objectMap["peerSessionIPv4Address"] = bs.PeerSessionIPv4Address
67	}
68	if bs.PeerSessionIPv6Address != nil {
69		objectMap["peerSessionIPv6Address"] = bs.PeerSessionIPv6Address
70	}
71	if bs.MaxPrefixesAdvertisedV4 != nil {
72		objectMap["maxPrefixesAdvertisedV4"] = bs.MaxPrefixesAdvertisedV4
73	}
74	if bs.MaxPrefixesAdvertisedV6 != nil {
75		objectMap["maxPrefixesAdvertisedV6"] = bs.MaxPrefixesAdvertisedV6
76	}
77	if bs.Md5AuthenticationKey != nil {
78		objectMap["md5AuthenticationKey"] = bs.Md5AuthenticationKey
79	}
80	return json.Marshal(objectMap)
81}
82
83// CheckServiceProviderAvailabilityInput class for CheckServiceProviderAvailabilityInput
84type CheckServiceProviderAvailabilityInput struct {
85	// PeeringServiceLocation - Gets or sets the PeeringServiceLocation
86	PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"`
87	// PeeringServiceProvider - Gets or sets the PeeringServiceProvider
88	PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"`
89}
90
91// ContactInfo the contact information of the peer.
92type ContactInfo struct {
93	// Emails - The list of email addresses.
94	Emails *[]string `json:"emails,omitempty"`
95	// Phone - The list of contact numbers.
96	Phone *[]string `json:"phone,omitempty"`
97}
98
99// DirectConnection the properties that define a direct connection.
100type DirectConnection struct {
101	// BandwidthInMbps - The bandwidth of the connection.
102	BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
103	// ProvisionedBandwidthInMbps - READ-ONLY; The bandwidth that is actually provisioned.
104	ProvisionedBandwidthInMbps *int32 `json:"provisionedBandwidthInMbps,omitempty"`
105	// SessionAddressProvider - The field indicating if Microsoft provides session ip addresses. Possible values include: 'Microsoft', 'Peer'
106	SessionAddressProvider SessionAddressProvider `json:"sessionAddressProvider,omitempty"`
107	// UseForPeeringService - The flag that indicates whether or not the connection is used for peering service.
108	UseForPeeringService *bool `json:"useForPeeringService,omitempty"`
109	// PeeringDBFacilityID - The PeeringDB.com ID of the facility at which the connection has to be set up.
110	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
111	// ConnectionState - READ-ONLY; The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active'
112	ConnectionState ConnectionState `json:"connectionState,omitempty"`
113	// BgpSession - The BGP session associated with the connection.
114	BgpSession *BgpSession `json:"bgpSession,omitempty"`
115	// ConnectionIdentifier - The unique identifier (GUID) for the connection.
116	ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"`
117	// ErrorMessage - READ-ONLY; The error message related to the connection state, if any.
118	ErrorMessage *string `json:"errorMessage,omitempty"`
119}
120
121// MarshalJSON is the custom marshaler for DirectConnection.
122func (dc DirectConnection) MarshalJSON() ([]byte, error) {
123	objectMap := make(map[string]interface{})
124	if dc.BandwidthInMbps != nil {
125		objectMap["bandwidthInMbps"] = dc.BandwidthInMbps
126	}
127	if dc.SessionAddressProvider != "" {
128		objectMap["sessionAddressProvider"] = dc.SessionAddressProvider
129	}
130	if dc.UseForPeeringService != nil {
131		objectMap["useForPeeringService"] = dc.UseForPeeringService
132	}
133	if dc.PeeringDBFacilityID != nil {
134		objectMap["peeringDBFacilityId"] = dc.PeeringDBFacilityID
135	}
136	if dc.BgpSession != nil {
137		objectMap["bgpSession"] = dc.BgpSession
138	}
139	if dc.ConnectionIdentifier != nil {
140		objectMap["connectionIdentifier"] = dc.ConnectionIdentifier
141	}
142	return json.Marshal(objectMap)
143}
144
145// DirectPeeringFacility the properties that define a direct peering facility.
146type DirectPeeringFacility struct {
147	// Address - The address of the direct peering facility.
148	Address *string `json:"address,omitempty"`
149	// DirectPeeringType - The type of the direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal'
150	DirectPeeringType DirectPeeringType `json:"directPeeringType,omitempty"`
151	// PeeringDBFacilityID - The PeeringDB.com ID of the facility.
152	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
153	// PeeringDBFacilityLink - The PeeringDB.com URL of the facility.
154	PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"`
155}
156
157// ErrorResponse the error response that indicates why an operation has failed.
158type ErrorResponse struct {
159	// Code - READ-ONLY; The error code.
160	Code *string `json:"code,omitempty"`
161	// Message - READ-ONLY; The error message.
162	Message *string `json:"message,omitempty"`
163}
164
165// MarshalJSON is the custom marshaler for ErrorResponse.
166func (er ErrorResponse) MarshalJSON() ([]byte, error) {
167	objectMap := make(map[string]interface{})
168	return json.Marshal(objectMap)
169}
170
171// ExchangeConnection the properties that define an exchange connection.
172type ExchangeConnection struct {
173	// PeeringDBFacilityID - The PeeringDB.com ID of the facility at which the connection has to be set up.
174	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
175	// ConnectionState - READ-ONLY; The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active'
176	ConnectionState ConnectionState `json:"connectionState,omitempty"`
177	// BgpSession - The BGP session associated with the connection.
178	BgpSession *BgpSession `json:"bgpSession,omitempty"`
179	// ConnectionIdentifier - The unique identifier (GUID) for the connection.
180	ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"`
181	// ErrorMessage - READ-ONLY; The error message related to the connection state, if any.
182	ErrorMessage *string `json:"errorMessage,omitempty"`
183}
184
185// MarshalJSON is the custom marshaler for ExchangeConnection.
186func (ec ExchangeConnection) MarshalJSON() ([]byte, error) {
187	objectMap := make(map[string]interface{})
188	if ec.PeeringDBFacilityID != nil {
189		objectMap["peeringDBFacilityId"] = ec.PeeringDBFacilityID
190	}
191	if ec.BgpSession != nil {
192		objectMap["bgpSession"] = ec.BgpSession
193	}
194	if ec.ConnectionIdentifier != nil {
195		objectMap["connectionIdentifier"] = ec.ConnectionIdentifier
196	}
197	return json.Marshal(objectMap)
198}
199
200// ExchangePeeringFacility the properties that define an exchange peering facility.
201type ExchangePeeringFacility struct {
202	// ExchangeName - The name of the exchange peering facility.
203	ExchangeName *string `json:"exchangeName,omitempty"`
204	// BandwidthInMbps - The bandwidth of the connection between Microsoft and the exchange peering facility.
205	BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
206	// MicrosoftIPv4Address - The IPv4 address of Microsoft at the exchange peering facility.
207	MicrosoftIPv4Address *string `json:"microsoftIPv4Address,omitempty"`
208	// MicrosoftIPv6Address - The IPv6 address of Microsoft at the exchange peering facility.
209	MicrosoftIPv6Address *string `json:"microsoftIPv6Address,omitempty"`
210	// FacilityIPv4Prefix - The IPv4 prefixes associated with the exchange peering facility.
211	FacilityIPv4Prefix *string `json:"facilityIPv4Prefix,omitempty"`
212	// FacilityIPv6Prefix - The IPv6 prefixes associated with the exchange peering facility.
213	FacilityIPv6Prefix *string `json:"facilityIPv6Prefix,omitempty"`
214	// PeeringDBFacilityID - The PeeringDB.com ID of the facility.
215	PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
216	// PeeringDBFacilityLink - The PeeringDB.com URL of the facility.
217	PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"`
218}
219
220// ListResult the paginated list of peerings.
221type ListResult struct {
222	autorest.Response `json:"-"`
223	// Value - The list of peerings.
224	Value *[]Model `json:"value,omitempty"`
225	// NextLink - The link to fetch the next page of peerings.
226	NextLink *string `json:"nextLink,omitempty"`
227}
228
229// ListResultIterator provides access to a complete listing of Model values.
230type ListResultIterator struct {
231	i    int
232	page ListResultPage
233}
234
235// NextWithContext advances to the next value.  If there was an error making
236// the request the iterator does not advance and the error is returned.
237func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) {
238	if tracing.IsEnabled() {
239		ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext")
240		defer func() {
241			sc := -1
242			if iter.Response().Response.Response != nil {
243				sc = iter.Response().Response.Response.StatusCode
244			}
245			tracing.EndSpan(ctx, sc, err)
246		}()
247	}
248	iter.i++
249	if iter.i < len(iter.page.Values()) {
250		return nil
251	}
252	err = iter.page.NextWithContext(ctx)
253	if err != nil {
254		iter.i--
255		return err
256	}
257	iter.i = 0
258	return nil
259}
260
261// Next advances to the next value.  If there was an error making
262// the request the iterator does not advance and the error is returned.
263// Deprecated: Use NextWithContext() instead.
264func (iter *ListResultIterator) Next() error {
265	return iter.NextWithContext(context.Background())
266}
267
268// NotDone returns true if the enumeration should be started or is not yet complete.
269func (iter ListResultIterator) NotDone() bool {
270	return iter.page.NotDone() && iter.i < len(iter.page.Values())
271}
272
273// Response returns the raw server response from the last page request.
274func (iter ListResultIterator) Response() ListResult {
275	return iter.page.Response()
276}
277
278// Value returns the current value or a zero-initialized value if the
279// iterator has advanced beyond the end of the collection.
280func (iter ListResultIterator) Value() Model {
281	if !iter.page.NotDone() {
282		return Model{}
283	}
284	return iter.page.Values()[iter.i]
285}
286
287// Creates a new instance of the ListResultIterator type.
288func NewListResultIterator(page ListResultPage) ListResultIterator {
289	return ListResultIterator{page: page}
290}
291
292// IsEmpty returns true if the ListResult contains no values.
293func (lr ListResult) IsEmpty() bool {
294	return lr.Value == nil || len(*lr.Value) == 0
295}
296
297// hasNextLink returns true if the NextLink is not empty.
298func (lr ListResult) hasNextLink() bool {
299	return lr.NextLink != nil && len(*lr.NextLink) != 0
300}
301
302// listResultPreparer prepares a request to retrieve the next set of results.
303// It returns nil if no more results exist.
304func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) {
305	if !lr.hasNextLink() {
306		return nil, nil
307	}
308	return autorest.Prepare((&http.Request{}).WithContext(ctx),
309		autorest.AsJSON(),
310		autorest.AsGet(),
311		autorest.WithBaseURL(to.String(lr.NextLink)))
312}
313
314// ListResultPage contains a page of Model values.
315type ListResultPage struct {
316	fn func(context.Context, ListResult) (ListResult, error)
317	lr ListResult
318}
319
320// NextWithContext advances to the next page of values.  If there was an error making
321// the request the page does not advance and the error is returned.
322func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) {
323	if tracing.IsEnabled() {
324		ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext")
325		defer func() {
326			sc := -1
327			if page.Response().Response.Response != nil {
328				sc = page.Response().Response.Response.StatusCode
329			}
330			tracing.EndSpan(ctx, sc, err)
331		}()
332	}
333	for {
334		next, err := page.fn(ctx, page.lr)
335		if err != nil {
336			return err
337		}
338		page.lr = next
339		if !next.hasNextLink() || !next.IsEmpty() {
340			break
341		}
342	}
343	return nil
344}
345
346// Next advances to the next page of values.  If there was an error making
347// the request the page does not advance and the error is returned.
348// Deprecated: Use NextWithContext() instead.
349func (page *ListResultPage) Next() error {
350	return page.NextWithContext(context.Background())
351}
352
353// NotDone returns true if the page enumeration should be started or is not yet complete.
354func (page ListResultPage) NotDone() bool {
355	return !page.lr.IsEmpty()
356}
357
358// Response returns the raw server response from the last page request.
359func (page ListResultPage) Response() ListResult {
360	return page.lr
361}
362
363// Values returns the slice of values for the current page or nil if there are no values.
364func (page ListResultPage) Values() []Model {
365	if page.lr.IsEmpty() {
366		return nil
367	}
368	return *page.lr.Value
369}
370
371// Creates a new instance of the ListResultPage type.
372func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
373	return ListResultPage{
374		fn: getNextPage,
375		lr: cur,
376	}
377}
378
379// Location peering location is where connectivity could be established to the Microsoft Cloud Edge.
380type Location struct {
381	// Kind - The kind of peering that the peering location supports. Possible values include: 'KindDirect', 'KindExchange'
382	Kind Kind `json:"kind,omitempty"`
383	// LocationProperties - The properties that define a peering location.
384	*LocationProperties `json:"properties,omitempty"`
385	// Name - READ-ONLY; The name of the resource.
386	Name *string `json:"name,omitempty"`
387	// ID - READ-ONLY; The ID of the resource.
388	ID *string `json:"id,omitempty"`
389	// Type - READ-ONLY; The type of the resource.
390	Type *string `json:"type,omitempty"`
391}
392
393// MarshalJSON is the custom marshaler for Location.
394func (l Location) MarshalJSON() ([]byte, error) {
395	objectMap := make(map[string]interface{})
396	if l.Kind != "" {
397		objectMap["kind"] = l.Kind
398	}
399	if l.LocationProperties != nil {
400		objectMap["properties"] = l.LocationProperties
401	}
402	return json.Marshal(objectMap)
403}
404
405// UnmarshalJSON is the custom unmarshaler for Location struct.
406func (l *Location) UnmarshalJSON(body []byte) error {
407	var m map[string]*json.RawMessage
408	err := json.Unmarshal(body, &m)
409	if err != nil {
410		return err
411	}
412	for k, v := range m {
413		switch k {
414		case "kind":
415			if v != nil {
416				var kind Kind
417				err = json.Unmarshal(*v, &kind)
418				if err != nil {
419					return err
420				}
421				l.Kind = kind
422			}
423		case "properties":
424			if v != nil {
425				var locationProperties LocationProperties
426				err = json.Unmarshal(*v, &locationProperties)
427				if err != nil {
428					return err
429				}
430				l.LocationProperties = &locationProperties
431			}
432		case "name":
433			if v != nil {
434				var name string
435				err = json.Unmarshal(*v, &name)
436				if err != nil {
437					return err
438				}
439				l.Name = &name
440			}
441		case "id":
442			if v != nil {
443				var ID string
444				err = json.Unmarshal(*v, &ID)
445				if err != nil {
446					return err
447				}
448				l.ID = &ID
449			}
450		case "type":
451			if v != nil {
452				var typeVar string
453				err = json.Unmarshal(*v, &typeVar)
454				if err != nil {
455					return err
456				}
457				l.Type = &typeVar
458			}
459		}
460	}
461
462	return nil
463}
464
465// LocationListResult the paginated list of peering locations.
466type LocationListResult struct {
467	autorest.Response `json:"-"`
468	// Value - The list of peering locations.
469	Value *[]Location `json:"value,omitempty"`
470	// NextLink - The link to fetch the next page of peering locations.
471	NextLink *string `json:"nextLink,omitempty"`
472}
473
474// LocationListResultIterator provides access to a complete listing of Location values.
475type LocationListResultIterator struct {
476	i    int
477	page LocationListResultPage
478}
479
480// NextWithContext advances to the next value.  If there was an error making
481// the request the iterator does not advance and the error is returned.
482func (iter *LocationListResultIterator) NextWithContext(ctx context.Context) (err error) {
483	if tracing.IsEnabled() {
484		ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultIterator.NextWithContext")
485		defer func() {
486			sc := -1
487			if iter.Response().Response.Response != nil {
488				sc = iter.Response().Response.Response.StatusCode
489			}
490			tracing.EndSpan(ctx, sc, err)
491		}()
492	}
493	iter.i++
494	if iter.i < len(iter.page.Values()) {
495		return nil
496	}
497	err = iter.page.NextWithContext(ctx)
498	if err != nil {
499		iter.i--
500		return err
501	}
502	iter.i = 0
503	return nil
504}
505
506// Next advances to the next value.  If there was an error making
507// the request the iterator does not advance and the error is returned.
508// Deprecated: Use NextWithContext() instead.
509func (iter *LocationListResultIterator) Next() error {
510	return iter.NextWithContext(context.Background())
511}
512
513// NotDone returns true if the enumeration should be started or is not yet complete.
514func (iter LocationListResultIterator) NotDone() bool {
515	return iter.page.NotDone() && iter.i < len(iter.page.Values())
516}
517
518// Response returns the raw server response from the last page request.
519func (iter LocationListResultIterator) Response() LocationListResult {
520	return iter.page.Response()
521}
522
523// Value returns the current value or a zero-initialized value if the
524// iterator has advanced beyond the end of the collection.
525func (iter LocationListResultIterator) Value() Location {
526	if !iter.page.NotDone() {
527		return Location{}
528	}
529	return iter.page.Values()[iter.i]
530}
531
532// Creates a new instance of the LocationListResultIterator type.
533func NewLocationListResultIterator(page LocationListResultPage) LocationListResultIterator {
534	return LocationListResultIterator{page: page}
535}
536
537// IsEmpty returns true if the ListResult contains no values.
538func (llr LocationListResult) IsEmpty() bool {
539	return llr.Value == nil || len(*llr.Value) == 0
540}
541
542// hasNextLink returns true if the NextLink is not empty.
543func (llr LocationListResult) hasNextLink() bool {
544	return llr.NextLink != nil && len(*llr.NextLink) != 0
545}
546
547// locationListResultPreparer prepares a request to retrieve the next set of results.
548// It returns nil if no more results exist.
549func (llr LocationListResult) locationListResultPreparer(ctx context.Context) (*http.Request, error) {
550	if !llr.hasNextLink() {
551		return nil, nil
552	}
553	return autorest.Prepare((&http.Request{}).WithContext(ctx),
554		autorest.AsJSON(),
555		autorest.AsGet(),
556		autorest.WithBaseURL(to.String(llr.NextLink)))
557}
558
559// LocationListResultPage contains a page of Location values.
560type LocationListResultPage struct {
561	fn  func(context.Context, LocationListResult) (LocationListResult, error)
562	llr LocationListResult
563}
564
565// NextWithContext advances to the next page of values.  If there was an error making
566// the request the page does not advance and the error is returned.
567func (page *LocationListResultPage) NextWithContext(ctx context.Context) (err error) {
568	if tracing.IsEnabled() {
569		ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultPage.NextWithContext")
570		defer func() {
571			sc := -1
572			if page.Response().Response.Response != nil {
573				sc = page.Response().Response.Response.StatusCode
574			}
575			tracing.EndSpan(ctx, sc, err)
576		}()
577	}
578	for {
579		next, err := page.fn(ctx, page.llr)
580		if err != nil {
581			return err
582		}
583		page.llr = next
584		if !next.hasNextLink() || !next.IsEmpty() {
585			break
586		}
587	}
588	return nil
589}
590
591// Next advances to the next page of values.  If there was an error making
592// the request the page does not advance and the error is returned.
593// Deprecated: Use NextWithContext() instead.
594func (page *LocationListResultPage) Next() error {
595	return page.NextWithContext(context.Background())
596}
597
598// NotDone returns true if the page enumeration should be started or is not yet complete.
599func (page LocationListResultPage) NotDone() bool {
600	return !page.llr.IsEmpty()
601}
602
603// Response returns the raw server response from the last page request.
604func (page LocationListResultPage) Response() LocationListResult {
605	return page.llr
606}
607
608// Values returns the slice of values for the current page or nil if there are no values.
609func (page LocationListResultPage) Values() []Location {
610	if page.llr.IsEmpty() {
611		return nil
612	}
613	return *page.llr.Value
614}
615
616// Creates a new instance of the LocationListResultPage type.
617func NewLocationListResultPage(cur LocationListResult, getNextPage func(context.Context, LocationListResult) (LocationListResult, error)) LocationListResultPage {
618	return LocationListResultPage{
619		fn:  getNextPage,
620		llr: cur,
621	}
622}
623
624// LocationProperties the properties that define a peering location.
625type LocationProperties struct {
626	// Direct - The properties that define a direct peering location.
627	Direct *LocationPropertiesDirect `json:"direct,omitempty"`
628	// Exchange - The properties that define an exchange peering location.
629	Exchange *LocationPropertiesExchange `json:"exchange,omitempty"`
630	// PeeringLocation - The name of the peering location.
631	PeeringLocation *string `json:"peeringLocation,omitempty"`
632	// Country - The country in which the peering location exists.
633	Country *string `json:"country,omitempty"`
634	// AzureRegion - The Azure region associated with the peering location.
635	AzureRegion *string `json:"azureRegion,omitempty"`
636}
637
638// LocationPropertiesDirect the properties that define a direct peering location.
639type LocationPropertiesDirect struct {
640	// PeeringFacilities - The list of direct peering facilities at the peering location.
641	PeeringFacilities *[]DirectPeeringFacility `json:"peeringFacilities,omitempty"`
642	// BandwidthOffers - The list of bandwidth offers available at the peering location.
643	BandwidthOffers *[]BandwidthOffer `json:"bandwidthOffers,omitempty"`
644}
645
646// LocationPropertiesExchange the properties that define an exchange peering location.
647type LocationPropertiesExchange struct {
648	// PeeringFacilities - The list of exchange peering facilities at the peering location.
649	PeeringFacilities *[]ExchangePeeringFacility `json:"peeringFacilities,omitempty"`
650}
651
652// Model peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a
653// location.
654type Model struct {
655	autorest.Response `json:"-"`
656	// Sku - The SKU that defines the tier and kind of the peering.
657	Sku *Sku `json:"sku,omitempty"`
658	// Kind - The kind of the peering. Possible values include: 'KindDirect', 'KindExchange'
659	Kind Kind `json:"kind,omitempty"`
660	// Properties - The properties that define a peering.
661	*Properties `json:"properties,omitempty"`
662	// Location - The location of the resource.
663	Location *string `json:"location,omitempty"`
664	// Tags - The resource tags.
665	Tags map[string]*string `json:"tags"`
666	// Name - READ-ONLY; The name of the resource.
667	Name *string `json:"name,omitempty"`
668	// ID - READ-ONLY; The ID of the resource.
669	ID *string `json:"id,omitempty"`
670	// Type - READ-ONLY; The type of the resource.
671	Type *string `json:"type,omitempty"`
672}
673
674// MarshalJSON is the custom marshaler for Model.
675func (mVar Model) MarshalJSON() ([]byte, error) {
676	objectMap := make(map[string]interface{})
677	if mVar.Sku != nil {
678		objectMap["sku"] = mVar.Sku
679	}
680	if mVar.Kind != "" {
681		objectMap["kind"] = mVar.Kind
682	}
683	if mVar.Properties != nil {
684		objectMap["properties"] = mVar.Properties
685	}
686	if mVar.Location != nil {
687		objectMap["location"] = mVar.Location
688	}
689	if mVar.Tags != nil {
690		objectMap["tags"] = mVar.Tags
691	}
692	return json.Marshal(objectMap)
693}
694
695// UnmarshalJSON is the custom unmarshaler for Model struct.
696func (mVar *Model) UnmarshalJSON(body []byte) error {
697	var m map[string]*json.RawMessage
698	err := json.Unmarshal(body, &m)
699	if err != nil {
700		return err
701	}
702	for k, v := range m {
703		switch k {
704		case "sku":
705			if v != nil {
706				var sku Sku
707				err = json.Unmarshal(*v, &sku)
708				if err != nil {
709					return err
710				}
711				mVar.Sku = &sku
712			}
713		case "kind":
714			if v != nil {
715				var kind Kind
716				err = json.Unmarshal(*v, &kind)
717				if err != nil {
718					return err
719				}
720				mVar.Kind = kind
721			}
722		case "properties":
723			if v != nil {
724				var properties Properties
725				err = json.Unmarshal(*v, &properties)
726				if err != nil {
727					return err
728				}
729				mVar.Properties = &properties
730			}
731		case "location":
732			if v != nil {
733				var location string
734				err = json.Unmarshal(*v, &location)
735				if err != nil {
736					return err
737				}
738				mVar.Location = &location
739			}
740		case "tags":
741			if v != nil {
742				var tags map[string]*string
743				err = json.Unmarshal(*v, &tags)
744				if err != nil {
745					return err
746				}
747				mVar.Tags = tags
748			}
749		case "name":
750			if v != nil {
751				var name string
752				err = json.Unmarshal(*v, &name)
753				if err != nil {
754					return err
755				}
756				mVar.Name = &name
757			}
758		case "id":
759			if v != nil {
760				var ID string
761				err = json.Unmarshal(*v, &ID)
762				if err != nil {
763					return err
764				}
765				mVar.ID = &ID
766			}
767		case "type":
768			if v != nil {
769				var typeVar string
770				err = json.Unmarshal(*v, &typeVar)
771				if err != nil {
772					return err
773				}
774				mVar.Type = &typeVar
775			}
776		}
777	}
778
779	return nil
780}
781
782// Operation the peering API operation.
783type Operation struct {
784	// Name - READ-ONLY; The name of the operation.
785	Name *string `json:"name,omitempty"`
786	// Display - READ-ONLY; The information related to the operation.
787	Display *OperationDisplayInfo `json:"display,omitempty"`
788	// IsDataAction - READ-ONLY; The flag that indicates whether the operation applies to data plane.
789	IsDataAction *bool `json:"isDataAction,omitempty"`
790}
791
792// MarshalJSON is the custom marshaler for Operation.
793func (o Operation) MarshalJSON() ([]byte, error) {
794	objectMap := make(map[string]interface{})
795	return json.Marshal(objectMap)
796}
797
798// OperationDisplayInfo the information related to the operation.
799type OperationDisplayInfo struct {
800	// Provider - READ-ONLY; The name of the resource provider.
801	Provider *string `json:"provider,omitempty"`
802	// Resource - READ-ONLY; The type of the resource.
803	Resource *string `json:"resource,omitempty"`
804	// Operation - READ-ONLY; The name of the operation.
805	Operation *string `json:"operation,omitempty"`
806	// Description - READ-ONLY; The description of the operation.
807	Description *string `json:"description,omitempty"`
808}
809
810// MarshalJSON is the custom marshaler for OperationDisplayInfo.
811func (odi OperationDisplayInfo) MarshalJSON() ([]byte, error) {
812	objectMap := make(map[string]interface{})
813	return json.Marshal(objectMap)
814}
815
816// OperationListResult the paginated list of peering API operations.
817type OperationListResult struct {
818	autorest.Response `json:"-"`
819	// Value - The list of peering API operations.
820	Value *[]Operation `json:"value,omitempty"`
821	// NextLink - The link to fetch the next page of peering API operations.
822	NextLink *string `json:"nextLink,omitempty"`
823}
824
825// OperationListResultIterator provides access to a complete listing of Operation values.
826type OperationListResultIterator struct {
827	i    int
828	page OperationListResultPage
829}
830
831// NextWithContext advances to the next value.  If there was an error making
832// the request the iterator does not advance and the error is returned.
833func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
834	if tracing.IsEnabled() {
835		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
836		defer func() {
837			sc := -1
838			if iter.Response().Response.Response != nil {
839				sc = iter.Response().Response.Response.StatusCode
840			}
841			tracing.EndSpan(ctx, sc, err)
842		}()
843	}
844	iter.i++
845	if iter.i < len(iter.page.Values()) {
846		return nil
847	}
848	err = iter.page.NextWithContext(ctx)
849	if err != nil {
850		iter.i--
851		return err
852	}
853	iter.i = 0
854	return nil
855}
856
857// Next advances to the next value.  If there was an error making
858// the request the iterator does not advance and the error is returned.
859// Deprecated: Use NextWithContext() instead.
860func (iter *OperationListResultIterator) Next() error {
861	return iter.NextWithContext(context.Background())
862}
863
864// NotDone returns true if the enumeration should be started or is not yet complete.
865func (iter OperationListResultIterator) NotDone() bool {
866	return iter.page.NotDone() && iter.i < len(iter.page.Values())
867}
868
869// Response returns the raw server response from the last page request.
870func (iter OperationListResultIterator) Response() OperationListResult {
871	return iter.page.Response()
872}
873
874// Value returns the current value or a zero-initialized value if the
875// iterator has advanced beyond the end of the collection.
876func (iter OperationListResultIterator) Value() Operation {
877	if !iter.page.NotDone() {
878		return Operation{}
879	}
880	return iter.page.Values()[iter.i]
881}
882
883// Creates a new instance of the OperationListResultIterator type.
884func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
885	return OperationListResultIterator{page: page}
886}
887
888// IsEmpty returns true if the ListResult contains no values.
889func (olr OperationListResult) IsEmpty() bool {
890	return olr.Value == nil || len(*olr.Value) == 0
891}
892
893// hasNextLink returns true if the NextLink is not empty.
894func (olr OperationListResult) hasNextLink() bool {
895	return olr.NextLink != nil && len(*olr.NextLink) != 0
896}
897
898// operationListResultPreparer prepares a request to retrieve the next set of results.
899// It returns nil if no more results exist.
900func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
901	if !olr.hasNextLink() {
902		return nil, nil
903	}
904	return autorest.Prepare((&http.Request{}).WithContext(ctx),
905		autorest.AsJSON(),
906		autorest.AsGet(),
907		autorest.WithBaseURL(to.String(olr.NextLink)))
908}
909
910// OperationListResultPage contains a page of Operation values.
911type OperationListResultPage struct {
912	fn  func(context.Context, OperationListResult) (OperationListResult, error)
913	olr OperationListResult
914}
915
916// NextWithContext advances to the next page of values.  If there was an error making
917// the request the page does not advance and the error is returned.
918func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
919	if tracing.IsEnabled() {
920		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
921		defer func() {
922			sc := -1
923			if page.Response().Response.Response != nil {
924				sc = page.Response().Response.Response.StatusCode
925			}
926			tracing.EndSpan(ctx, sc, err)
927		}()
928	}
929	for {
930		next, err := page.fn(ctx, page.olr)
931		if err != nil {
932			return err
933		}
934		page.olr = next
935		if !next.hasNextLink() || !next.IsEmpty() {
936			break
937		}
938	}
939	return nil
940}
941
942// Next advances to the next page of values.  If there was an error making
943// the request the page does not advance and the error is returned.
944// Deprecated: Use NextWithContext() instead.
945func (page *OperationListResultPage) Next() error {
946	return page.NextWithContext(context.Background())
947}
948
949// NotDone returns true if the page enumeration should be started or is not yet complete.
950func (page OperationListResultPage) NotDone() bool {
951	return !page.olr.IsEmpty()
952}
953
954// Response returns the raw server response from the last page request.
955func (page OperationListResultPage) Response() OperationListResult {
956	return page.olr
957}
958
959// Values returns the slice of values for the current page or nil if there are no values.
960func (page OperationListResultPage) Values() []Operation {
961	if page.olr.IsEmpty() {
962		return nil
963	}
964	return *page.olr.Value
965}
966
967// Creates a new instance of the OperationListResultPage type.
968func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
969	return OperationListResultPage{
970		fn:  getNextPage,
971		olr: cur,
972	}
973}
974
975// PeerAsn the essential information related to the peer's ASN.
976type PeerAsn struct {
977	autorest.Response `json:"-"`
978	// PeerAsnProperties - The properties that define a peer's ASN.
979	*PeerAsnProperties `json:"properties,omitempty"`
980	// Name - READ-ONLY; The name of the resource.
981	Name *string `json:"name,omitempty"`
982	// ID - READ-ONLY; The ID of the resource.
983	ID *string `json:"id,omitempty"`
984	// Type - READ-ONLY; The type of the resource.
985	Type *string `json:"type,omitempty"`
986}
987
988// MarshalJSON is the custom marshaler for PeerAsn.
989func (pa PeerAsn) MarshalJSON() ([]byte, error) {
990	objectMap := make(map[string]interface{})
991	if pa.PeerAsnProperties != nil {
992		objectMap["properties"] = pa.PeerAsnProperties
993	}
994	return json.Marshal(objectMap)
995}
996
997// UnmarshalJSON is the custom unmarshaler for PeerAsn struct.
998func (pa *PeerAsn) UnmarshalJSON(body []byte) error {
999	var m map[string]*json.RawMessage
1000	err := json.Unmarshal(body, &m)
1001	if err != nil {
1002		return err
1003	}
1004	for k, v := range m {
1005		switch k {
1006		case "properties":
1007			if v != nil {
1008				var peerAsnProperties PeerAsnProperties
1009				err = json.Unmarshal(*v, &peerAsnProperties)
1010				if err != nil {
1011					return err
1012				}
1013				pa.PeerAsnProperties = &peerAsnProperties
1014			}
1015		case "name":
1016			if v != nil {
1017				var name string
1018				err = json.Unmarshal(*v, &name)
1019				if err != nil {
1020					return err
1021				}
1022				pa.Name = &name
1023			}
1024		case "id":
1025			if v != nil {
1026				var ID string
1027				err = json.Unmarshal(*v, &ID)
1028				if err != nil {
1029					return err
1030				}
1031				pa.ID = &ID
1032			}
1033		case "type":
1034			if v != nil {
1035				var typeVar string
1036				err = json.Unmarshal(*v, &typeVar)
1037				if err != nil {
1038					return err
1039				}
1040				pa.Type = &typeVar
1041			}
1042		}
1043	}
1044
1045	return nil
1046}
1047
1048// PeerAsnListResult the paginated list of peer ASNs.
1049type PeerAsnListResult struct {
1050	autorest.Response `json:"-"`
1051	// Value - The list of peer ASNs.
1052	Value *[]PeerAsn `json:"value,omitempty"`
1053	// NextLink - The link to fetch the next page of peer ASNs.
1054	NextLink *string `json:"nextLink,omitempty"`
1055}
1056
1057// PeerAsnListResultIterator provides access to a complete listing of PeerAsn values.
1058type PeerAsnListResultIterator struct {
1059	i    int
1060	page PeerAsnListResultPage
1061}
1062
1063// NextWithContext advances to the next value.  If there was an error making
1064// the request the iterator does not advance and the error is returned.
1065func (iter *PeerAsnListResultIterator) NextWithContext(ctx context.Context) (err error) {
1066	if tracing.IsEnabled() {
1067		ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnListResultIterator.NextWithContext")
1068		defer func() {
1069			sc := -1
1070			if iter.Response().Response.Response != nil {
1071				sc = iter.Response().Response.Response.StatusCode
1072			}
1073			tracing.EndSpan(ctx, sc, err)
1074		}()
1075	}
1076	iter.i++
1077	if iter.i < len(iter.page.Values()) {
1078		return nil
1079	}
1080	err = iter.page.NextWithContext(ctx)
1081	if err != nil {
1082		iter.i--
1083		return err
1084	}
1085	iter.i = 0
1086	return nil
1087}
1088
1089// Next advances to the next value.  If there was an error making
1090// the request the iterator does not advance and the error is returned.
1091// Deprecated: Use NextWithContext() instead.
1092func (iter *PeerAsnListResultIterator) Next() error {
1093	return iter.NextWithContext(context.Background())
1094}
1095
1096// NotDone returns true if the enumeration should be started or is not yet complete.
1097func (iter PeerAsnListResultIterator) NotDone() bool {
1098	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1099}
1100
1101// Response returns the raw server response from the last page request.
1102func (iter PeerAsnListResultIterator) Response() PeerAsnListResult {
1103	return iter.page.Response()
1104}
1105
1106// Value returns the current value or a zero-initialized value if the
1107// iterator has advanced beyond the end of the collection.
1108func (iter PeerAsnListResultIterator) Value() PeerAsn {
1109	if !iter.page.NotDone() {
1110		return PeerAsn{}
1111	}
1112	return iter.page.Values()[iter.i]
1113}
1114
1115// Creates a new instance of the PeerAsnListResultIterator type.
1116func NewPeerAsnListResultIterator(page PeerAsnListResultPage) PeerAsnListResultIterator {
1117	return PeerAsnListResultIterator{page: page}
1118}
1119
1120// IsEmpty returns true if the ListResult contains no values.
1121func (palr PeerAsnListResult) IsEmpty() bool {
1122	return palr.Value == nil || len(*palr.Value) == 0
1123}
1124
1125// hasNextLink returns true if the NextLink is not empty.
1126func (palr PeerAsnListResult) hasNextLink() bool {
1127	return palr.NextLink != nil && len(*palr.NextLink) != 0
1128}
1129
1130// peerAsnListResultPreparer prepares a request to retrieve the next set of results.
1131// It returns nil if no more results exist.
1132func (palr PeerAsnListResult) peerAsnListResultPreparer(ctx context.Context) (*http.Request, error) {
1133	if !palr.hasNextLink() {
1134		return nil, nil
1135	}
1136	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1137		autorest.AsJSON(),
1138		autorest.AsGet(),
1139		autorest.WithBaseURL(to.String(palr.NextLink)))
1140}
1141
1142// PeerAsnListResultPage contains a page of PeerAsn values.
1143type PeerAsnListResultPage struct {
1144	fn   func(context.Context, PeerAsnListResult) (PeerAsnListResult, error)
1145	palr PeerAsnListResult
1146}
1147
1148// NextWithContext advances to the next page of values.  If there was an error making
1149// the request the page does not advance and the error is returned.
1150func (page *PeerAsnListResultPage) NextWithContext(ctx context.Context) (err error) {
1151	if tracing.IsEnabled() {
1152		ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnListResultPage.NextWithContext")
1153		defer func() {
1154			sc := -1
1155			if page.Response().Response.Response != nil {
1156				sc = page.Response().Response.Response.StatusCode
1157			}
1158			tracing.EndSpan(ctx, sc, err)
1159		}()
1160	}
1161	for {
1162		next, err := page.fn(ctx, page.palr)
1163		if err != nil {
1164			return err
1165		}
1166		page.palr = next
1167		if !next.hasNextLink() || !next.IsEmpty() {
1168			break
1169		}
1170	}
1171	return nil
1172}
1173
1174// Next advances to the next page of values.  If there was an error making
1175// the request the page does not advance and the error is returned.
1176// Deprecated: Use NextWithContext() instead.
1177func (page *PeerAsnListResultPage) Next() error {
1178	return page.NextWithContext(context.Background())
1179}
1180
1181// NotDone returns true if the page enumeration should be started or is not yet complete.
1182func (page PeerAsnListResultPage) NotDone() bool {
1183	return !page.palr.IsEmpty()
1184}
1185
1186// Response returns the raw server response from the last page request.
1187func (page PeerAsnListResultPage) Response() PeerAsnListResult {
1188	return page.palr
1189}
1190
1191// Values returns the slice of values for the current page or nil if there are no values.
1192func (page PeerAsnListResultPage) Values() []PeerAsn {
1193	if page.palr.IsEmpty() {
1194		return nil
1195	}
1196	return *page.palr.Value
1197}
1198
1199// Creates a new instance of the PeerAsnListResultPage type.
1200func NewPeerAsnListResultPage(cur PeerAsnListResult, getNextPage func(context.Context, PeerAsnListResult) (PeerAsnListResult, error)) PeerAsnListResultPage {
1201	return PeerAsnListResultPage{
1202		fn:   getNextPage,
1203		palr: cur,
1204	}
1205}
1206
1207// PeerAsnProperties the properties that define a peer's ASN.
1208type PeerAsnProperties struct {
1209	// PeerAsn - The Autonomous System Number (ASN) of the peer.
1210	PeerAsn *int32 `json:"peerAsn,omitempty"`
1211	// PeerContactInfo - The contact information of the peer.
1212	PeerContactInfo *ContactInfo `json:"peerContactInfo,omitempty"`
1213	// PeerName - The name of the peer.
1214	PeerName *string `json:"peerName,omitempty"`
1215	// ValidationState - The validation state of the ASN associated with the peer. Possible values include: 'ValidationStateNone', 'ValidationStatePending', 'ValidationStateApproved', 'ValidationStateFailed'
1216	ValidationState ValidationState `json:"validationState,omitempty"`
1217	// ErrorMessage - READ-ONLY; The error message for the validation state
1218	ErrorMessage *string `json:"errorMessage,omitempty"`
1219}
1220
1221// MarshalJSON is the custom marshaler for PeerAsnProperties.
1222func (pap PeerAsnProperties) MarshalJSON() ([]byte, error) {
1223	objectMap := make(map[string]interface{})
1224	if pap.PeerAsn != nil {
1225		objectMap["peerAsn"] = pap.PeerAsn
1226	}
1227	if pap.PeerContactInfo != nil {
1228		objectMap["peerContactInfo"] = pap.PeerContactInfo
1229	}
1230	if pap.PeerName != nil {
1231		objectMap["peerName"] = pap.PeerName
1232	}
1233	if pap.ValidationState != "" {
1234		objectMap["validationState"] = pap.ValidationState
1235	}
1236	return json.Marshal(objectMap)
1237}
1238
1239// Properties the properties that define connectivity to the Microsoft Cloud Edge.
1240type Properties struct {
1241	// Direct - The properties that define a direct peering.
1242	Direct *PropertiesDirect `json:"direct,omitempty"`
1243	// Exchange - The properties that define an exchange peering.
1244	Exchange *PropertiesExchange `json:"exchange,omitempty"`
1245	// PeeringLocation - The location of the peering.
1246	PeeringLocation *string `json:"peeringLocation,omitempty"`
1247	// ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'
1248	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1249}
1250
1251// MarshalJSON is the custom marshaler for Properties.
1252func (p Properties) MarshalJSON() ([]byte, error) {
1253	objectMap := make(map[string]interface{})
1254	if p.Direct != nil {
1255		objectMap["direct"] = p.Direct
1256	}
1257	if p.Exchange != nil {
1258		objectMap["exchange"] = p.Exchange
1259	}
1260	if p.PeeringLocation != nil {
1261		objectMap["peeringLocation"] = p.PeeringLocation
1262	}
1263	return json.Marshal(objectMap)
1264}
1265
1266// PropertiesDirect the properties that define a direct peering.
1267type PropertiesDirect struct {
1268	// Connections - The set of connections that constitute a direct peering.
1269	Connections *[]DirectConnection `json:"connections,omitempty"`
1270	// UseForPeeringService - READ-ONLY; The flag that indicates whether or not the peering is used for peering service.
1271	UseForPeeringService *bool `json:"useForPeeringService,omitempty"`
1272	// PeerAsn - The reference of the peer ASN.
1273	PeerAsn *SubResource `json:"peerAsn,omitempty"`
1274	// DirectPeeringType - The type of direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal'
1275	DirectPeeringType DirectPeeringType `json:"directPeeringType,omitempty"`
1276}
1277
1278// MarshalJSON is the custom marshaler for PropertiesDirect.
1279func (pd PropertiesDirect) MarshalJSON() ([]byte, error) {
1280	objectMap := make(map[string]interface{})
1281	if pd.Connections != nil {
1282		objectMap["connections"] = pd.Connections
1283	}
1284	if pd.PeerAsn != nil {
1285		objectMap["peerAsn"] = pd.PeerAsn
1286	}
1287	if pd.DirectPeeringType != "" {
1288		objectMap["directPeeringType"] = pd.DirectPeeringType
1289	}
1290	return json.Marshal(objectMap)
1291}
1292
1293// PropertiesExchange the properties that define an exchange peering.
1294type PropertiesExchange struct {
1295	// Connections - The set of connections that constitute an exchange peering.
1296	Connections *[]ExchangeConnection `json:"connections,omitempty"`
1297	// PeerAsn - The reference of the peer ASN.
1298	PeerAsn *SubResource `json:"peerAsn,omitempty"`
1299}
1300
1301// Resource the ARM resource class.
1302type Resource struct {
1303	// Name - READ-ONLY; The name of the resource.
1304	Name *string `json:"name,omitempty"`
1305	// ID - READ-ONLY; The ID of the resource.
1306	ID *string `json:"id,omitempty"`
1307	// Type - READ-ONLY; The type of the resource.
1308	Type *string `json:"type,omitempty"`
1309}
1310
1311// MarshalJSON is the custom marshaler for Resource.
1312func (r Resource) MarshalJSON() ([]byte, error) {
1313	objectMap := make(map[string]interface{})
1314	return json.Marshal(objectMap)
1315}
1316
1317// ResourceTags the resource tags.
1318type ResourceTags struct {
1319	// Tags - Gets or sets the tags, a dictionary of descriptors arm object
1320	Tags map[string]*string `json:"tags"`
1321}
1322
1323// MarshalJSON is the custom marshaler for ResourceTags.
1324func (rt ResourceTags) MarshalJSON() ([]byte, error) {
1325	objectMap := make(map[string]interface{})
1326	if rt.Tags != nil {
1327		objectMap["tags"] = rt.Tags
1328	}
1329	return json.Marshal(objectMap)
1330}
1331
1332// Service peering Service
1333type Service struct {
1334	autorest.Response `json:"-"`
1335	// ServiceProperties - The properties that define a peering service.
1336	*ServiceProperties `json:"properties,omitempty"`
1337	// Location - The location of the resource.
1338	Location *string `json:"location,omitempty"`
1339	// Tags - The resource tags.
1340	Tags map[string]*string `json:"tags"`
1341	// Name - READ-ONLY; The name of the resource.
1342	Name *string `json:"name,omitempty"`
1343	// ID - READ-ONLY; The ID of the resource.
1344	ID *string `json:"id,omitempty"`
1345	// Type - READ-ONLY; The type of the resource.
1346	Type *string `json:"type,omitempty"`
1347}
1348
1349// MarshalJSON is the custom marshaler for Service.
1350func (s Service) MarshalJSON() ([]byte, error) {
1351	objectMap := make(map[string]interface{})
1352	if s.ServiceProperties != nil {
1353		objectMap["properties"] = s.ServiceProperties
1354	}
1355	if s.Location != nil {
1356		objectMap["location"] = s.Location
1357	}
1358	if s.Tags != nil {
1359		objectMap["tags"] = s.Tags
1360	}
1361	return json.Marshal(objectMap)
1362}
1363
1364// UnmarshalJSON is the custom unmarshaler for Service struct.
1365func (s *Service) UnmarshalJSON(body []byte) error {
1366	var m map[string]*json.RawMessage
1367	err := json.Unmarshal(body, &m)
1368	if err != nil {
1369		return err
1370	}
1371	for k, v := range m {
1372		switch k {
1373		case "properties":
1374			if v != nil {
1375				var serviceProperties ServiceProperties
1376				err = json.Unmarshal(*v, &serviceProperties)
1377				if err != nil {
1378					return err
1379				}
1380				s.ServiceProperties = &serviceProperties
1381			}
1382		case "location":
1383			if v != nil {
1384				var location string
1385				err = json.Unmarshal(*v, &location)
1386				if err != nil {
1387					return err
1388				}
1389				s.Location = &location
1390			}
1391		case "tags":
1392			if v != nil {
1393				var tags map[string]*string
1394				err = json.Unmarshal(*v, &tags)
1395				if err != nil {
1396					return err
1397				}
1398				s.Tags = tags
1399			}
1400		case "name":
1401			if v != nil {
1402				var name string
1403				err = json.Unmarshal(*v, &name)
1404				if err != nil {
1405					return err
1406				}
1407				s.Name = &name
1408			}
1409		case "id":
1410			if v != nil {
1411				var ID string
1412				err = json.Unmarshal(*v, &ID)
1413				if err != nil {
1414					return err
1415				}
1416				s.ID = &ID
1417			}
1418		case "type":
1419			if v != nil {
1420				var typeVar string
1421				err = json.Unmarshal(*v, &typeVar)
1422				if err != nil {
1423					return err
1424				}
1425				s.Type = &typeVar
1426			}
1427		}
1428	}
1429
1430	return nil
1431}
1432
1433// ServiceListResult the paginated list of peering services.
1434type ServiceListResult struct {
1435	autorest.Response `json:"-"`
1436	// Value - The list of peering services.
1437	Value *[]Service `json:"value,omitempty"`
1438	// NextLink - The link to fetch the next page of peering services.
1439	NextLink *string `json:"nextLink,omitempty"`
1440}
1441
1442// ServiceListResultIterator provides access to a complete listing of Service values.
1443type ServiceListResultIterator struct {
1444	i    int
1445	page ServiceListResultPage
1446}
1447
1448// NextWithContext advances to the next value.  If there was an error making
1449// the request the iterator does not advance and the error is returned.
1450func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
1451	if tracing.IsEnabled() {
1452		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext")
1453		defer func() {
1454			sc := -1
1455			if iter.Response().Response.Response != nil {
1456				sc = iter.Response().Response.Response.StatusCode
1457			}
1458			tracing.EndSpan(ctx, sc, err)
1459		}()
1460	}
1461	iter.i++
1462	if iter.i < len(iter.page.Values()) {
1463		return nil
1464	}
1465	err = iter.page.NextWithContext(ctx)
1466	if err != nil {
1467		iter.i--
1468		return err
1469	}
1470	iter.i = 0
1471	return nil
1472}
1473
1474// Next advances to the next value.  If there was an error making
1475// the request the iterator does not advance and the error is returned.
1476// Deprecated: Use NextWithContext() instead.
1477func (iter *ServiceListResultIterator) Next() error {
1478	return iter.NextWithContext(context.Background())
1479}
1480
1481// NotDone returns true if the enumeration should be started or is not yet complete.
1482func (iter ServiceListResultIterator) NotDone() bool {
1483	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1484}
1485
1486// Response returns the raw server response from the last page request.
1487func (iter ServiceListResultIterator) Response() ServiceListResult {
1488	return iter.page.Response()
1489}
1490
1491// Value returns the current value or a zero-initialized value if the
1492// iterator has advanced beyond the end of the collection.
1493func (iter ServiceListResultIterator) Value() Service {
1494	if !iter.page.NotDone() {
1495		return Service{}
1496	}
1497	return iter.page.Values()[iter.i]
1498}
1499
1500// Creates a new instance of the ServiceListResultIterator type.
1501func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator {
1502	return ServiceListResultIterator{page: page}
1503}
1504
1505// IsEmpty returns true if the ListResult contains no values.
1506func (slr ServiceListResult) IsEmpty() bool {
1507	return slr.Value == nil || len(*slr.Value) == 0
1508}
1509
1510// hasNextLink returns true if the NextLink is not empty.
1511func (slr ServiceListResult) hasNextLink() bool {
1512	return slr.NextLink != nil && len(*slr.NextLink) != 0
1513}
1514
1515// serviceListResultPreparer prepares a request to retrieve the next set of results.
1516// It returns nil if no more results exist.
1517func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) {
1518	if !slr.hasNextLink() {
1519		return nil, nil
1520	}
1521	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1522		autorest.AsJSON(),
1523		autorest.AsGet(),
1524		autorest.WithBaseURL(to.String(slr.NextLink)))
1525}
1526
1527// ServiceListResultPage contains a page of Service values.
1528type ServiceListResultPage struct {
1529	fn  func(context.Context, ServiceListResult) (ServiceListResult, error)
1530	slr ServiceListResult
1531}
1532
1533// NextWithContext advances to the next page of values.  If there was an error making
1534// the request the page does not advance and the error is returned.
1535func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
1536	if tracing.IsEnabled() {
1537		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext")
1538		defer func() {
1539			sc := -1
1540			if page.Response().Response.Response != nil {
1541				sc = page.Response().Response.Response.StatusCode
1542			}
1543			tracing.EndSpan(ctx, sc, err)
1544		}()
1545	}
1546	for {
1547		next, err := page.fn(ctx, page.slr)
1548		if err != nil {
1549			return err
1550		}
1551		page.slr = next
1552		if !next.hasNextLink() || !next.IsEmpty() {
1553			break
1554		}
1555	}
1556	return nil
1557}
1558
1559// Next advances to the next page of values.  If there was an error making
1560// the request the page does not advance and the error is returned.
1561// Deprecated: Use NextWithContext() instead.
1562func (page *ServiceListResultPage) Next() error {
1563	return page.NextWithContext(context.Background())
1564}
1565
1566// NotDone returns true if the page enumeration should be started or is not yet complete.
1567func (page ServiceListResultPage) NotDone() bool {
1568	return !page.slr.IsEmpty()
1569}
1570
1571// Response returns the raw server response from the last page request.
1572func (page ServiceListResultPage) Response() ServiceListResult {
1573	return page.slr
1574}
1575
1576// Values returns the slice of values for the current page or nil if there are no values.
1577func (page ServiceListResultPage) Values() []Service {
1578	if page.slr.IsEmpty() {
1579		return nil
1580	}
1581	return *page.slr.Value
1582}
1583
1584// Creates a new instance of the ServiceListResultPage type.
1585func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage {
1586	return ServiceListResultPage{
1587		fn:  getNextPage,
1588		slr: cur,
1589	}
1590}
1591
1592// ServiceLocation the peering service location.
1593type ServiceLocation struct {
1594	// ServiceLocationProperties - The properties that define a peering service location.
1595	*ServiceLocationProperties `json:"properties,omitempty"`
1596	// Name - READ-ONLY; The name of the resource.
1597	Name *string `json:"name,omitempty"`
1598	// ID - READ-ONLY; The ID of the resource.
1599	ID *string `json:"id,omitempty"`
1600	// Type - READ-ONLY; The type of the resource.
1601	Type *string `json:"type,omitempty"`
1602}
1603
1604// MarshalJSON is the custom marshaler for ServiceLocation.
1605func (sl ServiceLocation) MarshalJSON() ([]byte, error) {
1606	objectMap := make(map[string]interface{})
1607	if sl.ServiceLocationProperties != nil {
1608		objectMap["properties"] = sl.ServiceLocationProperties
1609	}
1610	return json.Marshal(objectMap)
1611}
1612
1613// UnmarshalJSON is the custom unmarshaler for ServiceLocation struct.
1614func (sl *ServiceLocation) UnmarshalJSON(body []byte) error {
1615	var m map[string]*json.RawMessage
1616	err := json.Unmarshal(body, &m)
1617	if err != nil {
1618		return err
1619	}
1620	for k, v := range m {
1621		switch k {
1622		case "properties":
1623			if v != nil {
1624				var serviceLocationProperties ServiceLocationProperties
1625				err = json.Unmarshal(*v, &serviceLocationProperties)
1626				if err != nil {
1627					return err
1628				}
1629				sl.ServiceLocationProperties = &serviceLocationProperties
1630			}
1631		case "name":
1632			if v != nil {
1633				var name string
1634				err = json.Unmarshal(*v, &name)
1635				if err != nil {
1636					return err
1637				}
1638				sl.Name = &name
1639			}
1640		case "id":
1641			if v != nil {
1642				var ID string
1643				err = json.Unmarshal(*v, &ID)
1644				if err != nil {
1645					return err
1646				}
1647				sl.ID = &ID
1648			}
1649		case "type":
1650			if v != nil {
1651				var typeVar string
1652				err = json.Unmarshal(*v, &typeVar)
1653				if err != nil {
1654					return err
1655				}
1656				sl.Type = &typeVar
1657			}
1658		}
1659	}
1660
1661	return nil
1662}
1663
1664// ServiceLocationListResult the paginated list of peering service locations.
1665type ServiceLocationListResult struct {
1666	autorest.Response `json:"-"`
1667	// Value - The list of peering service locations.
1668	Value *[]ServiceLocation `json:"value,omitempty"`
1669	// NextLink - The link to fetch the next page of peering service locations.
1670	NextLink *string `json:"nextLink,omitempty"`
1671}
1672
1673// ServiceLocationListResultIterator provides access to a complete listing of ServiceLocation values.
1674type ServiceLocationListResultIterator struct {
1675	i    int
1676	page ServiceLocationListResultPage
1677}
1678
1679// NextWithContext advances to the next value.  If there was an error making
1680// the request the iterator does not advance and the error is returned.
1681func (iter *ServiceLocationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1682	if tracing.IsEnabled() {
1683		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationListResultIterator.NextWithContext")
1684		defer func() {
1685			sc := -1
1686			if iter.Response().Response.Response != nil {
1687				sc = iter.Response().Response.Response.StatusCode
1688			}
1689			tracing.EndSpan(ctx, sc, err)
1690		}()
1691	}
1692	iter.i++
1693	if iter.i < len(iter.page.Values()) {
1694		return nil
1695	}
1696	err = iter.page.NextWithContext(ctx)
1697	if err != nil {
1698		iter.i--
1699		return err
1700	}
1701	iter.i = 0
1702	return nil
1703}
1704
1705// Next advances to the next value.  If there was an error making
1706// the request the iterator does not advance and the error is returned.
1707// Deprecated: Use NextWithContext() instead.
1708func (iter *ServiceLocationListResultIterator) Next() error {
1709	return iter.NextWithContext(context.Background())
1710}
1711
1712// NotDone returns true if the enumeration should be started or is not yet complete.
1713func (iter ServiceLocationListResultIterator) NotDone() bool {
1714	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1715}
1716
1717// Response returns the raw server response from the last page request.
1718func (iter ServiceLocationListResultIterator) Response() ServiceLocationListResult {
1719	return iter.page.Response()
1720}
1721
1722// Value returns the current value or a zero-initialized value if the
1723// iterator has advanced beyond the end of the collection.
1724func (iter ServiceLocationListResultIterator) Value() ServiceLocation {
1725	if !iter.page.NotDone() {
1726		return ServiceLocation{}
1727	}
1728	return iter.page.Values()[iter.i]
1729}
1730
1731// Creates a new instance of the ServiceLocationListResultIterator type.
1732func NewServiceLocationListResultIterator(page ServiceLocationListResultPage) ServiceLocationListResultIterator {
1733	return ServiceLocationListResultIterator{page: page}
1734}
1735
1736// IsEmpty returns true if the ListResult contains no values.
1737func (sllr ServiceLocationListResult) IsEmpty() bool {
1738	return sllr.Value == nil || len(*sllr.Value) == 0
1739}
1740
1741// hasNextLink returns true if the NextLink is not empty.
1742func (sllr ServiceLocationListResult) hasNextLink() bool {
1743	return sllr.NextLink != nil && len(*sllr.NextLink) != 0
1744}
1745
1746// serviceLocationListResultPreparer prepares a request to retrieve the next set of results.
1747// It returns nil if no more results exist.
1748func (sllr ServiceLocationListResult) serviceLocationListResultPreparer(ctx context.Context) (*http.Request, error) {
1749	if !sllr.hasNextLink() {
1750		return nil, nil
1751	}
1752	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1753		autorest.AsJSON(),
1754		autorest.AsGet(),
1755		autorest.WithBaseURL(to.String(sllr.NextLink)))
1756}
1757
1758// ServiceLocationListResultPage contains a page of ServiceLocation values.
1759type ServiceLocationListResultPage struct {
1760	fn   func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error)
1761	sllr ServiceLocationListResult
1762}
1763
1764// NextWithContext advances to the next page of values.  If there was an error making
1765// the request the page does not advance and the error is returned.
1766func (page *ServiceLocationListResultPage) NextWithContext(ctx context.Context) (err error) {
1767	if tracing.IsEnabled() {
1768		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationListResultPage.NextWithContext")
1769		defer func() {
1770			sc := -1
1771			if page.Response().Response.Response != nil {
1772				sc = page.Response().Response.Response.StatusCode
1773			}
1774			tracing.EndSpan(ctx, sc, err)
1775		}()
1776	}
1777	for {
1778		next, err := page.fn(ctx, page.sllr)
1779		if err != nil {
1780			return err
1781		}
1782		page.sllr = next
1783		if !next.hasNextLink() || !next.IsEmpty() {
1784			break
1785		}
1786	}
1787	return nil
1788}
1789
1790// Next advances to the next page of values.  If there was an error making
1791// the request the page does not advance and the error is returned.
1792// Deprecated: Use NextWithContext() instead.
1793func (page *ServiceLocationListResultPage) Next() error {
1794	return page.NextWithContext(context.Background())
1795}
1796
1797// NotDone returns true if the page enumeration should be started or is not yet complete.
1798func (page ServiceLocationListResultPage) NotDone() bool {
1799	return !page.sllr.IsEmpty()
1800}
1801
1802// Response returns the raw server response from the last page request.
1803func (page ServiceLocationListResultPage) Response() ServiceLocationListResult {
1804	return page.sllr
1805}
1806
1807// Values returns the slice of values for the current page or nil if there are no values.
1808func (page ServiceLocationListResultPage) Values() []ServiceLocation {
1809	if page.sllr.IsEmpty() {
1810		return nil
1811	}
1812	return *page.sllr.Value
1813}
1814
1815// Creates a new instance of the ServiceLocationListResultPage type.
1816func NewServiceLocationListResultPage(cur ServiceLocationListResult, getNextPage func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error)) ServiceLocationListResultPage {
1817	return ServiceLocationListResultPage{
1818		fn:   getNextPage,
1819		sllr: cur,
1820	}
1821}
1822
1823// ServiceLocationProperties the properties that define connectivity to the Peering Service Location.
1824type ServiceLocationProperties struct {
1825	// Country - Country of the customer
1826	Country *string `json:"country,omitempty"`
1827	// State - State of the customer
1828	State *string `json:"state,omitempty"`
1829	// AzureRegion - Azure region for the location
1830	AzureRegion *string `json:"azureRegion,omitempty"`
1831}
1832
1833// ServicePrefix the peering service prefix class.
1834type ServicePrefix struct {
1835	autorest.Response `json:"-"`
1836	// ServicePrefixProperties - Gets or sets the peering prefix properties.
1837	*ServicePrefixProperties `json:"properties,omitempty"`
1838	// Name - READ-ONLY; The name of the resource.
1839	Name *string `json:"name,omitempty"`
1840	// ID - READ-ONLY; The ID of the resource.
1841	ID *string `json:"id,omitempty"`
1842	// Type - READ-ONLY; The type of the resource.
1843	Type *string `json:"type,omitempty"`
1844}
1845
1846// MarshalJSON is the custom marshaler for ServicePrefix.
1847func (sp ServicePrefix) MarshalJSON() ([]byte, error) {
1848	objectMap := make(map[string]interface{})
1849	if sp.ServicePrefixProperties != nil {
1850		objectMap["properties"] = sp.ServicePrefixProperties
1851	}
1852	return json.Marshal(objectMap)
1853}
1854
1855// UnmarshalJSON is the custom unmarshaler for ServicePrefix struct.
1856func (sp *ServicePrefix) UnmarshalJSON(body []byte) error {
1857	var m map[string]*json.RawMessage
1858	err := json.Unmarshal(body, &m)
1859	if err != nil {
1860		return err
1861	}
1862	for k, v := range m {
1863		switch k {
1864		case "properties":
1865			if v != nil {
1866				var servicePrefixProperties ServicePrefixProperties
1867				err = json.Unmarshal(*v, &servicePrefixProperties)
1868				if err != nil {
1869					return err
1870				}
1871				sp.ServicePrefixProperties = &servicePrefixProperties
1872			}
1873		case "name":
1874			if v != nil {
1875				var name string
1876				err = json.Unmarshal(*v, &name)
1877				if err != nil {
1878					return err
1879				}
1880				sp.Name = &name
1881			}
1882		case "id":
1883			if v != nil {
1884				var ID string
1885				err = json.Unmarshal(*v, &ID)
1886				if err != nil {
1887					return err
1888				}
1889				sp.ID = &ID
1890			}
1891		case "type":
1892			if v != nil {
1893				var typeVar string
1894				err = json.Unmarshal(*v, &typeVar)
1895				if err != nil {
1896					return err
1897				}
1898				sp.Type = &typeVar
1899			}
1900		}
1901	}
1902
1903	return nil
1904}
1905
1906// ServicePrefixEvent the details of the event associated with a prefix.
1907type ServicePrefixEvent struct {
1908	// EventTimestamp - READ-ONLY; The timestamp of the event associated with a prefix.
1909	EventTimestamp *date.Time `json:"eventTimestamp,omitempty"`
1910	// EventType - READ-ONLY; The type of the event associated with a prefix.
1911	EventType *string `json:"eventType,omitempty"`
1912	// EventSummary - READ-ONLY; The summary of the event associated with a prefix.
1913	EventSummary *string `json:"eventSummary,omitempty"`
1914	// EventLevel - READ-ONLY; The level of the event associated with a prefix.
1915	EventLevel *string `json:"eventLevel,omitempty"`
1916	// EventDescription - READ-ONLY; The description of the event associated with a prefix.
1917	EventDescription *string `json:"eventDescription,omitempty"`
1918}
1919
1920// MarshalJSON is the custom marshaler for ServicePrefixEvent.
1921func (spe ServicePrefixEvent) MarshalJSON() ([]byte, error) {
1922	objectMap := make(map[string]interface{})
1923	return json.Marshal(objectMap)
1924}
1925
1926// ServicePrefixListResult the paginated list of peering service prefixes.
1927type ServicePrefixListResult struct {
1928	autorest.Response `json:"-"`
1929	// Value - The list of peering service prefixes.
1930	Value *[]ServicePrefix `json:"value,omitempty"`
1931	// NextLink - The link to fetch the next page of peering service prefixes.
1932	NextLink *string `json:"nextLink,omitempty"`
1933}
1934
1935// ServicePrefixListResultIterator provides access to a complete listing of ServicePrefix values.
1936type ServicePrefixListResultIterator struct {
1937	i    int
1938	page ServicePrefixListResultPage
1939}
1940
1941// NextWithContext advances to the next value.  If there was an error making
1942// the request the iterator does not advance and the error is returned.
1943func (iter *ServicePrefixListResultIterator) NextWithContext(ctx context.Context) (err error) {
1944	if tracing.IsEnabled() {
1945		ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrefixListResultIterator.NextWithContext")
1946		defer func() {
1947			sc := -1
1948			if iter.Response().Response.Response != nil {
1949				sc = iter.Response().Response.Response.StatusCode
1950			}
1951			tracing.EndSpan(ctx, sc, err)
1952		}()
1953	}
1954	iter.i++
1955	if iter.i < len(iter.page.Values()) {
1956		return nil
1957	}
1958	err = iter.page.NextWithContext(ctx)
1959	if err != nil {
1960		iter.i--
1961		return err
1962	}
1963	iter.i = 0
1964	return nil
1965}
1966
1967// Next advances to the next value.  If there was an error making
1968// the request the iterator does not advance and the error is returned.
1969// Deprecated: Use NextWithContext() instead.
1970func (iter *ServicePrefixListResultIterator) Next() error {
1971	return iter.NextWithContext(context.Background())
1972}
1973
1974// NotDone returns true if the enumeration should be started or is not yet complete.
1975func (iter ServicePrefixListResultIterator) NotDone() bool {
1976	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1977}
1978
1979// Response returns the raw server response from the last page request.
1980func (iter ServicePrefixListResultIterator) Response() ServicePrefixListResult {
1981	return iter.page.Response()
1982}
1983
1984// Value returns the current value or a zero-initialized value if the
1985// iterator has advanced beyond the end of the collection.
1986func (iter ServicePrefixListResultIterator) Value() ServicePrefix {
1987	if !iter.page.NotDone() {
1988		return ServicePrefix{}
1989	}
1990	return iter.page.Values()[iter.i]
1991}
1992
1993// Creates a new instance of the ServicePrefixListResultIterator type.
1994func NewServicePrefixListResultIterator(page ServicePrefixListResultPage) ServicePrefixListResultIterator {
1995	return ServicePrefixListResultIterator{page: page}
1996}
1997
1998// IsEmpty returns true if the ListResult contains no values.
1999func (splr ServicePrefixListResult) IsEmpty() bool {
2000	return splr.Value == nil || len(*splr.Value) == 0
2001}
2002
2003// hasNextLink returns true if the NextLink is not empty.
2004func (splr ServicePrefixListResult) hasNextLink() bool {
2005	return splr.NextLink != nil && len(*splr.NextLink) != 0
2006}
2007
2008// servicePrefixListResultPreparer prepares a request to retrieve the next set of results.
2009// It returns nil if no more results exist.
2010func (splr ServicePrefixListResult) servicePrefixListResultPreparer(ctx context.Context) (*http.Request, error) {
2011	if !splr.hasNextLink() {
2012		return nil, nil
2013	}
2014	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2015		autorest.AsJSON(),
2016		autorest.AsGet(),
2017		autorest.WithBaseURL(to.String(splr.NextLink)))
2018}
2019
2020// ServicePrefixListResultPage contains a page of ServicePrefix values.
2021type ServicePrefixListResultPage struct {
2022	fn   func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error)
2023	splr ServicePrefixListResult
2024}
2025
2026// NextWithContext advances to the next page of values.  If there was an error making
2027// the request the page does not advance and the error is returned.
2028func (page *ServicePrefixListResultPage) NextWithContext(ctx context.Context) (err error) {
2029	if tracing.IsEnabled() {
2030		ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrefixListResultPage.NextWithContext")
2031		defer func() {
2032			sc := -1
2033			if page.Response().Response.Response != nil {
2034				sc = page.Response().Response.Response.StatusCode
2035			}
2036			tracing.EndSpan(ctx, sc, err)
2037		}()
2038	}
2039	for {
2040		next, err := page.fn(ctx, page.splr)
2041		if err != nil {
2042			return err
2043		}
2044		page.splr = next
2045		if !next.hasNextLink() || !next.IsEmpty() {
2046			break
2047		}
2048	}
2049	return nil
2050}
2051
2052// Next advances to the next page of values.  If there was an error making
2053// the request the page does not advance and the error is returned.
2054// Deprecated: Use NextWithContext() instead.
2055func (page *ServicePrefixListResultPage) Next() error {
2056	return page.NextWithContext(context.Background())
2057}
2058
2059// NotDone returns true if the page enumeration should be started or is not yet complete.
2060func (page ServicePrefixListResultPage) NotDone() bool {
2061	return !page.splr.IsEmpty()
2062}
2063
2064// Response returns the raw server response from the last page request.
2065func (page ServicePrefixListResultPage) Response() ServicePrefixListResult {
2066	return page.splr
2067}
2068
2069// Values returns the slice of values for the current page or nil if there are no values.
2070func (page ServicePrefixListResultPage) Values() []ServicePrefix {
2071	if page.splr.IsEmpty() {
2072		return nil
2073	}
2074	return *page.splr.Value
2075}
2076
2077// Creates a new instance of the ServicePrefixListResultPage type.
2078func NewServicePrefixListResultPage(cur ServicePrefixListResult, getNextPage func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error)) ServicePrefixListResultPage {
2079	return ServicePrefixListResultPage{
2080		fn:   getNextPage,
2081		splr: cur,
2082	}
2083}
2084
2085// ServicePrefixProperties the peering service prefix properties class.
2086type ServicePrefixProperties struct {
2087	// Prefix - The prefix from which your traffic originates.
2088	Prefix *string `json:"prefix,omitempty"`
2089	// PrefixValidationState - READ-ONLY; The prefix validation state. Possible values include: 'PrefixValidationStateNone', 'PrefixValidationStateInvalid', 'PrefixValidationStateVerified', 'PrefixValidationStateFailed', 'PrefixValidationStatePending', 'PrefixValidationStateWarning', 'PrefixValidationStateUnknown'
2090	PrefixValidationState PrefixValidationState `json:"prefixValidationState,omitempty"`
2091	// LearnedType - READ-ONLY; The prefix learned type. Possible values include: 'LearnedTypeNone', 'LearnedTypeViaServiceProvider', 'LearnedTypeViaSession'
2092	LearnedType LearnedType `json:"learnedType,omitempty"`
2093	// ErrorMessage - READ-ONLY; The error message for validation state
2094	ErrorMessage *string `json:"errorMessage,omitempty"`
2095	// Events - READ-ONLY; The list of events for peering service prefix
2096	Events *[]ServicePrefixEvent `json:"events,omitempty"`
2097	// ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'
2098	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2099}
2100
2101// MarshalJSON is the custom marshaler for ServicePrefixProperties.
2102func (spp ServicePrefixProperties) MarshalJSON() ([]byte, error) {
2103	objectMap := make(map[string]interface{})
2104	if spp.Prefix != nil {
2105		objectMap["prefix"] = spp.Prefix
2106	}
2107	return json.Marshal(objectMap)
2108}
2109
2110// ServiceProperties the properties that define connectivity to the Peering Service.
2111type ServiceProperties struct {
2112	// PeeringServiceLocation - The PeeringServiceLocation of the Customer.
2113	PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"`
2114	// PeeringServiceProvider - The MAPS Provider Name.
2115	PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"`
2116	// ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'
2117	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2118}
2119
2120// MarshalJSON is the custom marshaler for ServiceProperties.
2121func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
2122	objectMap := make(map[string]interface{})
2123	if sp.PeeringServiceLocation != nil {
2124		objectMap["peeringServiceLocation"] = sp.PeeringServiceLocation
2125	}
2126	if sp.PeeringServiceProvider != nil {
2127		objectMap["peeringServiceProvider"] = sp.PeeringServiceProvider
2128	}
2129	return json.Marshal(objectMap)
2130}
2131
2132// ServiceProvider peeringService provider
2133type ServiceProvider struct {
2134	// ServiceProviderProperties - The properties that define a peering service provider.
2135	*ServiceProviderProperties `json:"properties,omitempty"`
2136	// Name - READ-ONLY; The name of the resource.
2137	Name *string `json:"name,omitempty"`
2138	// ID - READ-ONLY; The ID of the resource.
2139	ID *string `json:"id,omitempty"`
2140	// Type - READ-ONLY; The type of the resource.
2141	Type *string `json:"type,omitempty"`
2142}
2143
2144// MarshalJSON is the custom marshaler for ServiceProvider.
2145func (sp ServiceProvider) MarshalJSON() ([]byte, error) {
2146	objectMap := make(map[string]interface{})
2147	if sp.ServiceProviderProperties != nil {
2148		objectMap["properties"] = sp.ServiceProviderProperties
2149	}
2150	return json.Marshal(objectMap)
2151}
2152
2153// UnmarshalJSON is the custom unmarshaler for ServiceProvider struct.
2154func (sp *ServiceProvider) UnmarshalJSON(body []byte) error {
2155	var m map[string]*json.RawMessage
2156	err := json.Unmarshal(body, &m)
2157	if err != nil {
2158		return err
2159	}
2160	for k, v := range m {
2161		switch k {
2162		case "properties":
2163			if v != nil {
2164				var serviceProviderProperties ServiceProviderProperties
2165				err = json.Unmarshal(*v, &serviceProviderProperties)
2166				if err != nil {
2167					return err
2168				}
2169				sp.ServiceProviderProperties = &serviceProviderProperties
2170			}
2171		case "name":
2172			if v != nil {
2173				var name string
2174				err = json.Unmarshal(*v, &name)
2175				if err != nil {
2176					return err
2177				}
2178				sp.Name = &name
2179			}
2180		case "id":
2181			if v != nil {
2182				var ID string
2183				err = json.Unmarshal(*v, &ID)
2184				if err != nil {
2185					return err
2186				}
2187				sp.ID = &ID
2188			}
2189		case "type":
2190			if v != nil {
2191				var typeVar string
2192				err = json.Unmarshal(*v, &typeVar)
2193				if err != nil {
2194					return err
2195				}
2196				sp.Type = &typeVar
2197			}
2198		}
2199	}
2200
2201	return nil
2202}
2203
2204// ServiceProviderListResult the paginated list of peering service providers.
2205type ServiceProviderListResult struct {
2206	autorest.Response `json:"-"`
2207	// Value - The list of peering service providers.
2208	Value *[]ServiceProvider `json:"value,omitempty"`
2209	// NextLink - The link to fetch the next page of peering service providers.
2210	NextLink *string `json:"nextLink,omitempty"`
2211}
2212
2213// ServiceProviderListResultIterator provides access to a complete listing of ServiceProvider values.
2214type ServiceProviderListResultIterator struct {
2215	i    int
2216	page ServiceProviderListResultPage
2217}
2218
2219// NextWithContext advances to the next value.  If there was an error making
2220// the request the iterator does not advance and the error is returned.
2221func (iter *ServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) {
2222	if tracing.IsEnabled() {
2223		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProviderListResultIterator.NextWithContext")
2224		defer func() {
2225			sc := -1
2226			if iter.Response().Response.Response != nil {
2227				sc = iter.Response().Response.Response.StatusCode
2228			}
2229			tracing.EndSpan(ctx, sc, err)
2230		}()
2231	}
2232	iter.i++
2233	if iter.i < len(iter.page.Values()) {
2234		return nil
2235	}
2236	err = iter.page.NextWithContext(ctx)
2237	if err != nil {
2238		iter.i--
2239		return err
2240	}
2241	iter.i = 0
2242	return nil
2243}
2244
2245// Next advances to the next value.  If there was an error making
2246// the request the iterator does not advance and the error is returned.
2247// Deprecated: Use NextWithContext() instead.
2248func (iter *ServiceProviderListResultIterator) Next() error {
2249	return iter.NextWithContext(context.Background())
2250}
2251
2252// NotDone returns true if the enumeration should be started or is not yet complete.
2253func (iter ServiceProviderListResultIterator) NotDone() bool {
2254	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2255}
2256
2257// Response returns the raw server response from the last page request.
2258func (iter ServiceProviderListResultIterator) Response() ServiceProviderListResult {
2259	return iter.page.Response()
2260}
2261
2262// Value returns the current value or a zero-initialized value if the
2263// iterator has advanced beyond the end of the collection.
2264func (iter ServiceProviderListResultIterator) Value() ServiceProvider {
2265	if !iter.page.NotDone() {
2266		return ServiceProvider{}
2267	}
2268	return iter.page.Values()[iter.i]
2269}
2270
2271// Creates a new instance of the ServiceProviderListResultIterator type.
2272func NewServiceProviderListResultIterator(page ServiceProviderListResultPage) ServiceProviderListResultIterator {
2273	return ServiceProviderListResultIterator{page: page}
2274}
2275
2276// IsEmpty returns true if the ListResult contains no values.
2277func (splr ServiceProviderListResult) IsEmpty() bool {
2278	return splr.Value == nil || len(*splr.Value) == 0
2279}
2280
2281// hasNextLink returns true if the NextLink is not empty.
2282func (splr ServiceProviderListResult) hasNextLink() bool {
2283	return splr.NextLink != nil && len(*splr.NextLink) != 0
2284}
2285
2286// serviceProviderListResultPreparer prepares a request to retrieve the next set of results.
2287// It returns nil if no more results exist.
2288func (splr ServiceProviderListResult) serviceProviderListResultPreparer(ctx context.Context) (*http.Request, error) {
2289	if !splr.hasNextLink() {
2290		return nil, nil
2291	}
2292	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2293		autorest.AsJSON(),
2294		autorest.AsGet(),
2295		autorest.WithBaseURL(to.String(splr.NextLink)))
2296}
2297
2298// ServiceProviderListResultPage contains a page of ServiceProvider values.
2299type ServiceProviderListResultPage struct {
2300	fn   func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error)
2301	splr ServiceProviderListResult
2302}
2303
2304// NextWithContext advances to the next page of values.  If there was an error making
2305// the request the page does not advance and the error is returned.
2306func (page *ServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) {
2307	if tracing.IsEnabled() {
2308		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProviderListResultPage.NextWithContext")
2309		defer func() {
2310			sc := -1
2311			if page.Response().Response.Response != nil {
2312				sc = page.Response().Response.Response.StatusCode
2313			}
2314			tracing.EndSpan(ctx, sc, err)
2315		}()
2316	}
2317	for {
2318		next, err := page.fn(ctx, page.splr)
2319		if err != nil {
2320			return err
2321		}
2322		page.splr = next
2323		if !next.hasNextLink() || !next.IsEmpty() {
2324			break
2325		}
2326	}
2327	return nil
2328}
2329
2330// Next advances to the next page of values.  If there was an error making
2331// the request the page does not advance and the error is returned.
2332// Deprecated: Use NextWithContext() instead.
2333func (page *ServiceProviderListResultPage) Next() error {
2334	return page.NextWithContext(context.Background())
2335}
2336
2337// NotDone returns true if the page enumeration should be started or is not yet complete.
2338func (page ServiceProviderListResultPage) NotDone() bool {
2339	return !page.splr.IsEmpty()
2340}
2341
2342// Response returns the raw server response from the last page request.
2343func (page ServiceProviderListResultPage) Response() ServiceProviderListResult {
2344	return page.splr
2345}
2346
2347// Values returns the slice of values for the current page or nil if there are no values.
2348func (page ServiceProviderListResultPage) Values() []ServiceProvider {
2349	if page.splr.IsEmpty() {
2350		return nil
2351	}
2352	return *page.splr.Value
2353}
2354
2355// Creates a new instance of the ServiceProviderListResultPage type.
2356func NewServiceProviderListResultPage(cur ServiceProviderListResult, getNextPage func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error)) ServiceProviderListResultPage {
2357	return ServiceProviderListResultPage{
2358		fn:   getNextPage,
2359		splr: cur,
2360	}
2361}
2362
2363// ServiceProviderProperties the properties that define connectivity to the Peering Service Provider.
2364type ServiceProviderProperties struct {
2365	// ServiceProviderName - The name of the service provider.
2366	ServiceProviderName *string `json:"serviceProviderName,omitempty"`
2367}
2368
2369// Sku the SKU that defines the tier and kind of the peering.
2370type Sku struct {
2371	// Name - The name of the peering SKU. Possible values include: 'BasicExchangeFree', 'BasicDirectFree', 'PremiumExchangeMetered', 'PremiumDirectFree', 'PremiumDirectMetered', 'PremiumDirectUnlimited'
2372	Name Name `json:"name,omitempty"`
2373	// Tier - The tier of the peering SKU. Possible values include: 'Basic', 'Premium'
2374	Tier Tier `json:"tier,omitempty"`
2375	// Family - The family of the peering SKU. Possible values include: 'Direct', 'Exchange'
2376	Family Family `json:"family,omitempty"`
2377	// Size - The size of the peering SKU. Possible values include: 'Free', 'Metered', 'Unlimited'
2378	Size Size `json:"size,omitempty"`
2379}
2380
2381// String ...
2382type String struct {
2383	autorest.Response `json:"-"`
2384	// Value - Possible values include: 'Available', 'Unavailable'
2385	Value *string `json:"value,omitempty"`
2386}
2387
2388// SubResource the sub resource.
2389type SubResource struct {
2390	// ID - The identifier of the referenced resource.
2391	ID *string `json:"id,omitempty"`
2392}
2393