1package apimanagement
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	"github.com/gofrs/uuid"
18	"net/http"
19)
20
21// The package's fully qualified name.
22const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2017-03-01/apimanagement"
23
24// AccessInformationContract tenant access information contract of the API Management service.
25type AccessInformationContract struct {
26	autorest.Response `json:"-"`
27	// ID - Identifier.
28	ID *string `json:"id,omitempty"`
29	// PrimaryKey - Primary access key.
30	PrimaryKey *string `json:"primaryKey,omitempty"`
31	// SecondaryKey - Secondary access key.
32	SecondaryKey *string `json:"secondaryKey,omitempty"`
33	// Enabled - Tenant access information of the API Management service.
34	Enabled *bool `json:"enabled,omitempty"`
35}
36
37// AccessInformationUpdateParameters tenant access information update parameters of the API Management
38// service.
39type AccessInformationUpdateParameters struct {
40	// Enabled - Tenant access information of the API Management service.
41	Enabled *bool `json:"enabled,omitempty"`
42}
43
44// AdditionalLocation description of an additional API Management resource location.
45type AdditionalLocation struct {
46	// Location - The location name of the additional region among Azure Data center regions.
47	Location *string `json:"location,omitempty"`
48	// Sku - SKU properties of the API Management service.
49	Sku *ServiceSkuProperties `json:"sku,omitempty"`
50	// StaticIps - READ-ONLY; Static IP addresses of the location's virtual machines.
51	StaticIps *[]string `json:"staticIps,omitempty"`
52	// VirtualNetworkConfiguration - Virtual network configuration for the location.
53	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
54	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region.
55	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
56}
57
58// MarshalJSON is the custom marshaler for AdditionalLocation.
59func (al AdditionalLocation) MarshalJSON() ([]byte, error) {
60	objectMap := make(map[string]interface{})
61	if al.Location != nil {
62		objectMap["location"] = al.Location
63	}
64	if al.Sku != nil {
65		objectMap["sku"] = al.Sku
66	}
67	if al.VirtualNetworkConfiguration != nil {
68		objectMap["virtualNetworkConfiguration"] = al.VirtualNetworkConfiguration
69	}
70	return json.Marshal(objectMap)
71}
72
73// APICollection paged Api list representation.
74type APICollection struct {
75	autorest.Response `json:"-"`
76	// Value - READ-ONLY; Page values.
77	Value *[]APIContract `json:"value,omitempty"`
78	// NextLink - READ-ONLY; Next page link if any.
79	NextLink *string `json:"nextLink,omitempty"`
80}
81
82// MarshalJSON is the custom marshaler for APICollection.
83func (ac APICollection) MarshalJSON() ([]byte, error) {
84	objectMap := make(map[string]interface{})
85	return json.Marshal(objectMap)
86}
87
88// APICollectionIterator provides access to a complete listing of APIContract values.
89type APICollectionIterator struct {
90	i    int
91	page APICollectionPage
92}
93
94// NextWithContext advances to the next value.  If there was an error making
95// the request the iterator does not advance and the error is returned.
96func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) {
97	if tracing.IsEnabled() {
98		ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext")
99		defer func() {
100			sc := -1
101			if iter.Response().Response.Response != nil {
102				sc = iter.Response().Response.Response.StatusCode
103			}
104			tracing.EndSpan(ctx, sc, err)
105		}()
106	}
107	iter.i++
108	if iter.i < len(iter.page.Values()) {
109		return nil
110	}
111	err = iter.page.NextWithContext(ctx)
112	if err != nil {
113		iter.i--
114		return err
115	}
116	iter.i = 0
117	return nil
118}
119
120// Next advances to the next value.  If there was an error making
121// the request the iterator does not advance and the error is returned.
122// Deprecated: Use NextWithContext() instead.
123func (iter *APICollectionIterator) Next() error {
124	return iter.NextWithContext(context.Background())
125}
126
127// NotDone returns true if the enumeration should be started or is not yet complete.
128func (iter APICollectionIterator) NotDone() bool {
129	return iter.page.NotDone() && iter.i < len(iter.page.Values())
130}
131
132// Response returns the raw server response from the last page request.
133func (iter APICollectionIterator) Response() APICollection {
134	return iter.page.Response()
135}
136
137// Value returns the current value or a zero-initialized value if the
138// iterator has advanced beyond the end of the collection.
139func (iter APICollectionIterator) Value() APIContract {
140	if !iter.page.NotDone() {
141		return APIContract{}
142	}
143	return iter.page.Values()[iter.i]
144}
145
146// Creates a new instance of the APICollectionIterator type.
147func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator {
148	return APICollectionIterator{page: page}
149}
150
151// IsEmpty returns true if the ListResult contains no values.
152func (ac APICollection) IsEmpty() bool {
153	return ac.Value == nil || len(*ac.Value) == 0
154}
155
156// hasNextLink returns true if the NextLink is not empty.
157func (ac APICollection) hasNextLink() bool {
158	return ac.NextLink != nil && len(*ac.NextLink) != 0
159}
160
161// aPICollectionPreparer prepares a request to retrieve the next set of results.
162// It returns nil if no more results exist.
163func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) {
164	if !ac.hasNextLink() {
165		return nil, nil
166	}
167	return autorest.Prepare((&http.Request{}).WithContext(ctx),
168		autorest.AsJSON(),
169		autorest.AsGet(),
170		autorest.WithBaseURL(to.String(ac.NextLink)))
171}
172
173// APICollectionPage contains a page of APIContract values.
174type APICollectionPage struct {
175	fn func(context.Context, APICollection) (APICollection, error)
176	ac APICollection
177}
178
179// NextWithContext advances to the next page of values.  If there was an error making
180// the request the page does not advance and the error is returned.
181func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) {
182	if tracing.IsEnabled() {
183		ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext")
184		defer func() {
185			sc := -1
186			if page.Response().Response.Response != nil {
187				sc = page.Response().Response.Response.StatusCode
188			}
189			tracing.EndSpan(ctx, sc, err)
190		}()
191	}
192	for {
193		next, err := page.fn(ctx, page.ac)
194		if err != nil {
195			return err
196		}
197		page.ac = next
198		if !next.hasNextLink() || !next.IsEmpty() {
199			break
200		}
201	}
202	return nil
203}
204
205// Next advances to the next page of values.  If there was an error making
206// the request the page does not advance and the error is returned.
207// Deprecated: Use NextWithContext() instead.
208func (page *APICollectionPage) Next() error {
209	return page.NextWithContext(context.Background())
210}
211
212// NotDone returns true if the page enumeration should be started or is not yet complete.
213func (page APICollectionPage) NotDone() bool {
214	return !page.ac.IsEmpty()
215}
216
217// Response returns the raw server response from the last page request.
218func (page APICollectionPage) Response() APICollection {
219	return page.ac
220}
221
222// Values returns the slice of values for the current page or nil if there are no values.
223func (page APICollectionPage) Values() []APIContract {
224	if page.ac.IsEmpty() {
225		return nil
226	}
227	return *page.ac.Value
228}
229
230// Creates a new instance of the APICollectionPage type.
231func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage {
232	return APICollectionPage{
233		fn: getNextPage,
234		ac: cur,
235	}
236}
237
238// APIContract API details.
239type APIContract struct {
240	autorest.Response `json:"-"`
241	// APIContractProperties - Api entity contract properties.
242	*APIContractProperties `json:"properties,omitempty"`
243	// ID - READ-ONLY; Resource ID.
244	ID *string `json:"id,omitempty"`
245	// Name - READ-ONLY; Resource name.
246	Name *string `json:"name,omitempty"`
247	// Type - READ-ONLY; Resource type for API Management resource.
248	Type *string `json:"type,omitempty"`
249}
250
251// MarshalJSON is the custom marshaler for APIContract.
252func (ac APIContract) MarshalJSON() ([]byte, error) {
253	objectMap := make(map[string]interface{})
254	if ac.APIContractProperties != nil {
255		objectMap["properties"] = ac.APIContractProperties
256	}
257	return json.Marshal(objectMap)
258}
259
260// UnmarshalJSON is the custom unmarshaler for APIContract struct.
261func (ac *APIContract) UnmarshalJSON(body []byte) error {
262	var m map[string]*json.RawMessage
263	err := json.Unmarshal(body, &m)
264	if err != nil {
265		return err
266	}
267	for k, v := range m {
268		switch k {
269		case "properties":
270			if v != nil {
271				var APIContractProperties APIContractProperties
272				err = json.Unmarshal(*v, &APIContractProperties)
273				if err != nil {
274					return err
275				}
276				ac.APIContractProperties = &APIContractProperties
277			}
278		case "id":
279			if v != nil {
280				var ID string
281				err = json.Unmarshal(*v, &ID)
282				if err != nil {
283					return err
284				}
285				ac.ID = &ID
286			}
287		case "name":
288			if v != nil {
289				var name string
290				err = json.Unmarshal(*v, &name)
291				if err != nil {
292					return err
293				}
294				ac.Name = &name
295			}
296		case "type":
297			if v != nil {
298				var typeVar string
299				err = json.Unmarshal(*v, &typeVar)
300				if err != nil {
301					return err
302				}
303				ac.Type = &typeVar
304			}
305		}
306	}
307
308	return nil
309}
310
311// APIContractProperties api Entity Properties
312type APIContractProperties struct {
313	// DisplayName - API name.
314	DisplayName *string `json:"displayName,omitempty"`
315	// ServiceURL - Absolute URL of the backend service implementing this API.
316	ServiceURL *string `json:"serviceUrl,omitempty"`
317	// Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
318	Path *string `json:"path,omitempty"`
319	// Protocols - Describes on which protocols the operations in this API can be invoked.
320	Protocols     *[]Protocol            `json:"protocols,omitempty"`
321	APIVersionSet *APIVersionSetContract `json:"apiVersionSet,omitempty"`
322	// Description - Description of the API. May include HTML formatting tags.
323	Description *string `json:"description,omitempty"`
324	// AuthenticationSettings - Collection of authentication settings included into this API.
325	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
326	// SubscriptionKeyParameterNames - Protocols over which API is made available.
327	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
328	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
329	APIType APIType `json:"type,omitempty"`
330	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
331	APIRevision *string `json:"apiRevision,omitempty"`
332	// APIVersion - Indicates the Version identifier of the API if the API is versioned
333	APIVersion *string `json:"apiVersion,omitempty"`
334	// IsCurrent - READ-ONLY; Indicates if API revision is current api revision.
335	IsCurrent *bool `json:"isCurrent,omitempty"`
336	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
337	IsOnline *bool `json:"isOnline,omitempty"`
338	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
339	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
340}
341
342// MarshalJSON is the custom marshaler for APIContractProperties.
343func (acp APIContractProperties) MarshalJSON() ([]byte, error) {
344	objectMap := make(map[string]interface{})
345	if acp.DisplayName != nil {
346		objectMap["displayName"] = acp.DisplayName
347	}
348	if acp.ServiceURL != nil {
349		objectMap["serviceUrl"] = acp.ServiceURL
350	}
351	if acp.Path != nil {
352		objectMap["path"] = acp.Path
353	}
354	if acp.Protocols != nil {
355		objectMap["protocols"] = acp.Protocols
356	}
357	if acp.APIVersionSet != nil {
358		objectMap["apiVersionSet"] = acp.APIVersionSet
359	}
360	if acp.Description != nil {
361		objectMap["description"] = acp.Description
362	}
363	if acp.AuthenticationSettings != nil {
364		objectMap["authenticationSettings"] = acp.AuthenticationSettings
365	}
366	if acp.SubscriptionKeyParameterNames != nil {
367		objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames
368	}
369	if acp.APIType != "" {
370		objectMap["type"] = acp.APIType
371	}
372	if acp.APIRevision != nil {
373		objectMap["apiRevision"] = acp.APIRevision
374	}
375	if acp.APIVersion != nil {
376		objectMap["apiVersion"] = acp.APIVersion
377	}
378	if acp.APIVersionSetID != nil {
379		objectMap["apiVersionSetId"] = acp.APIVersionSetID
380	}
381	return json.Marshal(objectMap)
382}
383
384// APIContractUpdateProperties API update contract properties.
385type APIContractUpdateProperties struct {
386	// DisplayName - API name.
387	DisplayName *string `json:"displayName,omitempty"`
388	// ServiceURL - Absolute URL of the backend service implementing this API.
389	ServiceURL *string `json:"serviceUrl,omitempty"`
390	// Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
391	Path *string `json:"path,omitempty"`
392	// Protocols - Describes on which protocols the operations in this API can be invoked.
393	Protocols *[]Protocol `json:"protocols,omitempty"`
394	// Description - Description of the API. May include HTML formatting tags.
395	Description *string `json:"description,omitempty"`
396	// AuthenticationSettings - Collection of authentication settings included into this API.
397	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
398	// SubscriptionKeyParameterNames - Protocols over which API is made available.
399	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
400	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
401	APIType APIType `json:"type,omitempty"`
402	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
403	APIRevision *string `json:"apiRevision,omitempty"`
404	// APIVersion - Indicates the Version identifier of the API if the API is versioned
405	APIVersion *string `json:"apiVersion,omitempty"`
406	// IsCurrent - READ-ONLY; Indicates if API revision is current api revision.
407	IsCurrent *bool `json:"isCurrent,omitempty"`
408	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
409	IsOnline *bool `json:"isOnline,omitempty"`
410	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
411	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
412}
413
414// MarshalJSON is the custom marshaler for APIContractUpdateProperties.
415func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) {
416	objectMap := make(map[string]interface{})
417	if acup.DisplayName != nil {
418		objectMap["displayName"] = acup.DisplayName
419	}
420	if acup.ServiceURL != nil {
421		objectMap["serviceUrl"] = acup.ServiceURL
422	}
423	if acup.Path != nil {
424		objectMap["path"] = acup.Path
425	}
426	if acup.Protocols != nil {
427		objectMap["protocols"] = acup.Protocols
428	}
429	if acup.Description != nil {
430		objectMap["description"] = acup.Description
431	}
432	if acup.AuthenticationSettings != nil {
433		objectMap["authenticationSettings"] = acup.AuthenticationSettings
434	}
435	if acup.SubscriptionKeyParameterNames != nil {
436		objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames
437	}
438	if acup.APIType != "" {
439		objectMap["type"] = acup.APIType
440	}
441	if acup.APIRevision != nil {
442		objectMap["apiRevision"] = acup.APIRevision
443	}
444	if acup.APIVersion != nil {
445		objectMap["apiVersion"] = acup.APIVersion
446	}
447	if acup.APIVersionSetID != nil {
448		objectMap["apiVersionSetId"] = acup.APIVersionSetID
449	}
450	return json.Marshal(objectMap)
451}
452
453// APICreateOrUpdateParameter API Create or Update Parameters.
454type APICreateOrUpdateParameter struct {
455	// APICreateOrUpdateProperties - Api entity create of update properties.
456	*APICreateOrUpdateProperties `json:"properties,omitempty"`
457}
458
459// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter.
460func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) {
461	objectMap := make(map[string]interface{})
462	if acoup.APICreateOrUpdateProperties != nil {
463		objectMap["properties"] = acoup.APICreateOrUpdateProperties
464	}
465	return json.Marshal(objectMap)
466}
467
468// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct.
469func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error {
470	var m map[string]*json.RawMessage
471	err := json.Unmarshal(body, &m)
472	if err != nil {
473		return err
474	}
475	for k, v := range m {
476		switch k {
477		case "properties":
478			if v != nil {
479				var APICreateOrUpdateProperties APICreateOrUpdateProperties
480				err = json.Unmarshal(*v, &APICreateOrUpdateProperties)
481				if err != nil {
482					return err
483				}
484				acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties
485			}
486		}
487	}
488
489	return nil
490}
491
492// APICreateOrUpdateProperties api Create or Update Properties.
493type APICreateOrUpdateProperties struct {
494	// ContentValue - Content value when Importing an API.
495	ContentValue *string `json:"contentValue,omitempty"`
496	// ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink'
497	ContentFormat ContentFormat `json:"contentFormat,omitempty"`
498	// WsdlSelector - Criteria to limit import of WSDL to a subset of the document.
499	WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"`
500	// DisplayName - API name.
501	DisplayName *string `json:"displayName,omitempty"`
502	// ServiceURL - Absolute URL of the backend service implementing this API.
503	ServiceURL *string `json:"serviceUrl,omitempty"`
504	// Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API.
505	Path *string `json:"path,omitempty"`
506	// Protocols - Describes on which protocols the operations in this API can be invoked.
507	Protocols     *[]Protocol            `json:"protocols,omitempty"`
508	APIVersionSet *APIVersionSetContract `json:"apiVersionSet,omitempty"`
509	// Description - Description of the API. May include HTML formatting tags.
510	Description *string `json:"description,omitempty"`
511	// AuthenticationSettings - Collection of authentication settings included into this API.
512	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
513	// SubscriptionKeyParameterNames - Protocols over which API is made available.
514	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
515	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
516	APIType APIType `json:"type,omitempty"`
517	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
518	APIRevision *string `json:"apiRevision,omitempty"`
519	// APIVersion - Indicates the Version identifier of the API if the API is versioned
520	APIVersion *string `json:"apiVersion,omitempty"`
521	// IsCurrent - READ-ONLY; Indicates if API revision is current api revision.
522	IsCurrent *bool `json:"isCurrent,omitempty"`
523	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
524	IsOnline *bool `json:"isOnline,omitempty"`
525	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
526	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
527}
528
529// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties.
530func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) {
531	objectMap := make(map[string]interface{})
532	if acoup.ContentValue != nil {
533		objectMap["contentValue"] = acoup.ContentValue
534	}
535	if acoup.ContentFormat != "" {
536		objectMap["contentFormat"] = acoup.ContentFormat
537	}
538	if acoup.WsdlSelector != nil {
539		objectMap["wsdlSelector"] = acoup.WsdlSelector
540	}
541	if acoup.DisplayName != nil {
542		objectMap["displayName"] = acoup.DisplayName
543	}
544	if acoup.ServiceURL != nil {
545		objectMap["serviceUrl"] = acoup.ServiceURL
546	}
547	if acoup.Path != nil {
548		objectMap["path"] = acoup.Path
549	}
550	if acoup.Protocols != nil {
551		objectMap["protocols"] = acoup.Protocols
552	}
553	if acoup.APIVersionSet != nil {
554		objectMap["apiVersionSet"] = acoup.APIVersionSet
555	}
556	if acoup.Description != nil {
557		objectMap["description"] = acoup.Description
558	}
559	if acoup.AuthenticationSettings != nil {
560		objectMap["authenticationSettings"] = acoup.AuthenticationSettings
561	}
562	if acoup.SubscriptionKeyParameterNames != nil {
563		objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames
564	}
565	if acoup.APIType != "" {
566		objectMap["type"] = acoup.APIType
567	}
568	if acoup.APIRevision != nil {
569		objectMap["apiRevision"] = acoup.APIRevision
570	}
571	if acoup.APIVersion != nil {
572		objectMap["apiVersion"] = acoup.APIVersion
573	}
574	if acoup.APIVersionSetID != nil {
575		objectMap["apiVersionSetId"] = acoup.APIVersionSetID
576	}
577	return json.Marshal(objectMap)
578}
579
580// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document.
581type APICreateOrUpdatePropertiesWsdlSelector struct {
582	// WsdlServiceName - Name of service to import from WSDL
583	WsdlServiceName *string `json:"wsdlServiceName,omitempty"`
584	// WsdlEndpointName - Name of endpoint(port) to import from WSDL
585	WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"`
586}
587
588// APIEntityBaseContract API base contract details.
589type APIEntityBaseContract struct {
590	// Description - Description of the API. May include HTML formatting tags.
591	Description *string `json:"description,omitempty"`
592	// AuthenticationSettings - Collection of authentication settings included into this API.
593	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
594	// SubscriptionKeyParameterNames - Protocols over which API is made available.
595	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
596	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
597	APIType APIType `json:"type,omitempty"`
598	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
599	APIRevision *string `json:"apiRevision,omitempty"`
600	// APIVersion - Indicates the Version identifier of the API if the API is versioned
601	APIVersion *string `json:"apiVersion,omitempty"`
602	// IsCurrent - READ-ONLY; Indicates if API revision is current api revision.
603	IsCurrent *bool `json:"isCurrent,omitempty"`
604	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
605	IsOnline *bool `json:"isOnline,omitempty"`
606	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
607	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
608}
609
610// MarshalJSON is the custom marshaler for APIEntityBaseContract.
611func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) {
612	objectMap := make(map[string]interface{})
613	if aebc.Description != nil {
614		objectMap["description"] = aebc.Description
615	}
616	if aebc.AuthenticationSettings != nil {
617		objectMap["authenticationSettings"] = aebc.AuthenticationSettings
618	}
619	if aebc.SubscriptionKeyParameterNames != nil {
620		objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames
621	}
622	if aebc.APIType != "" {
623		objectMap["type"] = aebc.APIType
624	}
625	if aebc.APIRevision != nil {
626		objectMap["apiRevision"] = aebc.APIRevision
627	}
628	if aebc.APIVersion != nil {
629		objectMap["apiVersion"] = aebc.APIVersion
630	}
631	if aebc.APIVersionSetID != nil {
632		objectMap["apiVersionSetId"] = aebc.APIVersionSetID
633	}
634	return json.Marshal(objectMap)
635}
636
637// APIExportResult API Export result Blob Uri.
638type APIExportResult struct {
639	autorest.Response `json:"-"`
640	// Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes.
641	Link *string `json:"link,omitempty"`
642}
643
644// ApimResource the Resource definition.
645type ApimResource struct {
646	// ID - READ-ONLY; Resource ID.
647	ID *string `json:"id,omitempty"`
648	// Name - READ-ONLY; Resource name.
649	Name *string `json:"name,omitempty"`
650	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
651	Type *string `json:"type,omitempty"`
652	// Tags - Resource tags.
653	Tags map[string]*string `json:"tags"`
654}
655
656// MarshalJSON is the custom marshaler for ApimResource.
657func (ar ApimResource) MarshalJSON() ([]byte, error) {
658	objectMap := make(map[string]interface{})
659	if ar.Tags != nil {
660		objectMap["tags"] = ar.Tags
661	}
662	return json.Marshal(objectMap)
663}
664
665// APIReleaseCollection paged Api Revision list representation.
666type APIReleaseCollection struct {
667	autorest.Response `json:"-"`
668	// Value - READ-ONLY; Page values.
669	Value *[]APIReleaseContract `json:"value,omitempty"`
670	// NextLink - READ-ONLY; Next page link if any.
671	NextLink *string `json:"nextLink,omitempty"`
672}
673
674// MarshalJSON is the custom marshaler for APIReleaseCollection.
675func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) {
676	objectMap := make(map[string]interface{})
677	return json.Marshal(objectMap)
678}
679
680// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values.
681type APIReleaseCollectionIterator struct {
682	i    int
683	page APIReleaseCollectionPage
684}
685
686// NextWithContext advances to the next value.  If there was an error making
687// the request the iterator does not advance and the error is returned.
688func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) {
689	if tracing.IsEnabled() {
690		ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext")
691		defer func() {
692			sc := -1
693			if iter.Response().Response.Response != nil {
694				sc = iter.Response().Response.Response.StatusCode
695			}
696			tracing.EndSpan(ctx, sc, err)
697		}()
698	}
699	iter.i++
700	if iter.i < len(iter.page.Values()) {
701		return nil
702	}
703	err = iter.page.NextWithContext(ctx)
704	if err != nil {
705		iter.i--
706		return err
707	}
708	iter.i = 0
709	return nil
710}
711
712// Next advances to the next value.  If there was an error making
713// the request the iterator does not advance and the error is returned.
714// Deprecated: Use NextWithContext() instead.
715func (iter *APIReleaseCollectionIterator) Next() error {
716	return iter.NextWithContext(context.Background())
717}
718
719// NotDone returns true if the enumeration should be started or is not yet complete.
720func (iter APIReleaseCollectionIterator) NotDone() bool {
721	return iter.page.NotDone() && iter.i < len(iter.page.Values())
722}
723
724// Response returns the raw server response from the last page request.
725func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection {
726	return iter.page.Response()
727}
728
729// Value returns the current value or a zero-initialized value if the
730// iterator has advanced beyond the end of the collection.
731func (iter APIReleaseCollectionIterator) Value() APIReleaseContract {
732	if !iter.page.NotDone() {
733		return APIReleaseContract{}
734	}
735	return iter.page.Values()[iter.i]
736}
737
738// Creates a new instance of the APIReleaseCollectionIterator type.
739func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator {
740	return APIReleaseCollectionIterator{page: page}
741}
742
743// IsEmpty returns true if the ListResult contains no values.
744func (arc APIReleaseCollection) IsEmpty() bool {
745	return arc.Value == nil || len(*arc.Value) == 0
746}
747
748// hasNextLink returns true if the NextLink is not empty.
749func (arc APIReleaseCollection) hasNextLink() bool {
750	return arc.NextLink != nil && len(*arc.NextLink) != 0
751}
752
753// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results.
754// It returns nil if no more results exist.
755func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) {
756	if !arc.hasNextLink() {
757		return nil, nil
758	}
759	return autorest.Prepare((&http.Request{}).WithContext(ctx),
760		autorest.AsJSON(),
761		autorest.AsGet(),
762		autorest.WithBaseURL(to.String(arc.NextLink)))
763}
764
765// APIReleaseCollectionPage contains a page of APIReleaseContract values.
766type APIReleaseCollectionPage struct {
767	fn  func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)
768	arc APIReleaseCollection
769}
770
771// NextWithContext advances to the next page of values.  If there was an error making
772// the request the page does not advance and the error is returned.
773func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) {
774	if tracing.IsEnabled() {
775		ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext")
776		defer func() {
777			sc := -1
778			if page.Response().Response.Response != nil {
779				sc = page.Response().Response.Response.StatusCode
780			}
781			tracing.EndSpan(ctx, sc, err)
782		}()
783	}
784	for {
785		next, err := page.fn(ctx, page.arc)
786		if err != nil {
787			return err
788		}
789		page.arc = next
790		if !next.hasNextLink() || !next.IsEmpty() {
791			break
792		}
793	}
794	return nil
795}
796
797// Next advances to the next page of values.  If there was an error making
798// the request the page does not advance and the error is returned.
799// Deprecated: Use NextWithContext() instead.
800func (page *APIReleaseCollectionPage) Next() error {
801	return page.NextWithContext(context.Background())
802}
803
804// NotDone returns true if the page enumeration should be started or is not yet complete.
805func (page APIReleaseCollectionPage) NotDone() bool {
806	return !page.arc.IsEmpty()
807}
808
809// Response returns the raw server response from the last page request.
810func (page APIReleaseCollectionPage) Response() APIReleaseCollection {
811	return page.arc
812}
813
814// Values returns the slice of values for the current page or nil if there are no values.
815func (page APIReleaseCollectionPage) Values() []APIReleaseContract {
816	if page.arc.IsEmpty() {
817		return nil
818	}
819	return *page.arc.Value
820}
821
822// Creates a new instance of the APIReleaseCollectionPage type.
823func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage {
824	return APIReleaseCollectionPage{
825		fn:  getNextPage,
826		arc: cur,
827	}
828}
829
830// APIReleaseContract api Release details.
831type APIReleaseContract struct {
832	autorest.Response `json:"-"`
833	// APIReleaseContractProperties - Properties of the Api Release Contract.
834	*APIReleaseContractProperties `json:"properties,omitempty"`
835	// ID - READ-ONLY; Resource ID.
836	ID *string `json:"id,omitempty"`
837	// Name - READ-ONLY; Resource name.
838	Name *string `json:"name,omitempty"`
839	// Type - READ-ONLY; Resource type for API Management resource.
840	Type *string `json:"type,omitempty"`
841}
842
843// MarshalJSON is the custom marshaler for APIReleaseContract.
844func (arc APIReleaseContract) MarshalJSON() ([]byte, error) {
845	objectMap := make(map[string]interface{})
846	if arc.APIReleaseContractProperties != nil {
847		objectMap["properties"] = arc.APIReleaseContractProperties
848	}
849	return json.Marshal(objectMap)
850}
851
852// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct.
853func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error {
854	var m map[string]*json.RawMessage
855	err := json.Unmarshal(body, &m)
856	if err != nil {
857		return err
858	}
859	for k, v := range m {
860		switch k {
861		case "properties":
862			if v != nil {
863				var APIReleaseContractProperties APIReleaseContractProperties
864				err = json.Unmarshal(*v, &APIReleaseContractProperties)
865				if err != nil {
866					return err
867				}
868				arc.APIReleaseContractProperties = &APIReleaseContractProperties
869			}
870		case "id":
871			if v != nil {
872				var ID string
873				err = json.Unmarshal(*v, &ID)
874				if err != nil {
875					return err
876				}
877				arc.ID = &ID
878			}
879		case "name":
880			if v != nil {
881				var name string
882				err = json.Unmarshal(*v, &name)
883				if err != nil {
884					return err
885				}
886				arc.Name = &name
887			}
888		case "type":
889			if v != nil {
890				var typeVar string
891				err = json.Unmarshal(*v, &typeVar)
892				if err != nil {
893					return err
894				}
895				arc.Type = &typeVar
896			}
897		}
898	}
899
900	return nil
901}
902
903// APIReleaseContractProperties API Release details
904type APIReleaseContractProperties struct {
905	// APIID - Identifier of the API the release belongs to.
906	APIID *string `json:"apiId,omitempty"`
907	// CreatedDateTime - READ-ONLY; The time the API was released. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
908	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
909	// UpdatedDateTime - READ-ONLY; The time the API release was updated.
910	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
911	// Notes - Release Notes
912	Notes *string `json:"notes,omitempty"`
913}
914
915// MarshalJSON is the custom marshaler for APIReleaseContractProperties.
916func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) {
917	objectMap := make(map[string]interface{})
918	if arcp.APIID != nil {
919		objectMap["apiId"] = arcp.APIID
920	}
921	if arcp.Notes != nil {
922		objectMap["notes"] = arcp.Notes
923	}
924	return json.Marshal(objectMap)
925}
926
927// APIRevisionCollection paged Api Revision list representation.
928type APIRevisionCollection struct {
929	autorest.Response `json:"-"`
930	// Value - Page values.
931	Value *[]APIRevisionContract `json:"value,omitempty"`
932	// NextLink - Next page link if any.
933	NextLink *string `json:"nextLink,omitempty"`
934}
935
936// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values.
937type APIRevisionCollectionIterator struct {
938	i    int
939	page APIRevisionCollectionPage
940}
941
942// NextWithContext advances to the next value.  If there was an error making
943// the request the iterator does not advance and the error is returned.
944func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
945	if tracing.IsEnabled() {
946		ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext")
947		defer func() {
948			sc := -1
949			if iter.Response().Response.Response != nil {
950				sc = iter.Response().Response.Response.StatusCode
951			}
952			tracing.EndSpan(ctx, sc, err)
953		}()
954	}
955	iter.i++
956	if iter.i < len(iter.page.Values()) {
957		return nil
958	}
959	err = iter.page.NextWithContext(ctx)
960	if err != nil {
961		iter.i--
962		return err
963	}
964	iter.i = 0
965	return nil
966}
967
968// Next advances to the next value.  If there was an error making
969// the request the iterator does not advance and the error is returned.
970// Deprecated: Use NextWithContext() instead.
971func (iter *APIRevisionCollectionIterator) Next() error {
972	return iter.NextWithContext(context.Background())
973}
974
975// NotDone returns true if the enumeration should be started or is not yet complete.
976func (iter APIRevisionCollectionIterator) NotDone() bool {
977	return iter.page.NotDone() && iter.i < len(iter.page.Values())
978}
979
980// Response returns the raw server response from the last page request.
981func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection {
982	return iter.page.Response()
983}
984
985// Value returns the current value or a zero-initialized value if the
986// iterator has advanced beyond the end of the collection.
987func (iter APIRevisionCollectionIterator) Value() APIRevisionContract {
988	if !iter.page.NotDone() {
989		return APIRevisionContract{}
990	}
991	return iter.page.Values()[iter.i]
992}
993
994// Creates a new instance of the APIRevisionCollectionIterator type.
995func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator {
996	return APIRevisionCollectionIterator{page: page}
997}
998
999// IsEmpty returns true if the ListResult contains no values.
1000func (arc APIRevisionCollection) IsEmpty() bool {
1001	return arc.Value == nil || len(*arc.Value) == 0
1002}
1003
1004// hasNextLink returns true if the NextLink is not empty.
1005func (arc APIRevisionCollection) hasNextLink() bool {
1006	return arc.NextLink != nil && len(*arc.NextLink) != 0
1007}
1008
1009// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results.
1010// It returns nil if no more results exist.
1011func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) {
1012	if !arc.hasNextLink() {
1013		return nil, nil
1014	}
1015	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1016		autorest.AsJSON(),
1017		autorest.AsGet(),
1018		autorest.WithBaseURL(to.String(arc.NextLink)))
1019}
1020
1021// APIRevisionCollectionPage contains a page of APIRevisionContract values.
1022type APIRevisionCollectionPage struct {
1023	fn  func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)
1024	arc APIRevisionCollection
1025}
1026
1027// NextWithContext advances to the next page of values.  If there was an error making
1028// the request the page does not advance and the error is returned.
1029func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) {
1030	if tracing.IsEnabled() {
1031		ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext")
1032		defer func() {
1033			sc := -1
1034			if page.Response().Response.Response != nil {
1035				sc = page.Response().Response.Response.StatusCode
1036			}
1037			tracing.EndSpan(ctx, sc, err)
1038		}()
1039	}
1040	for {
1041		next, err := page.fn(ctx, page.arc)
1042		if err != nil {
1043			return err
1044		}
1045		page.arc = next
1046		if !next.hasNextLink() || !next.IsEmpty() {
1047			break
1048		}
1049	}
1050	return nil
1051}
1052
1053// Next advances to the next page of values.  If there was an error making
1054// the request the page does not advance and the error is returned.
1055// Deprecated: Use NextWithContext() instead.
1056func (page *APIRevisionCollectionPage) Next() error {
1057	return page.NextWithContext(context.Background())
1058}
1059
1060// NotDone returns true if the page enumeration should be started or is not yet complete.
1061func (page APIRevisionCollectionPage) NotDone() bool {
1062	return !page.arc.IsEmpty()
1063}
1064
1065// Response returns the raw server response from the last page request.
1066func (page APIRevisionCollectionPage) Response() APIRevisionCollection {
1067	return page.arc
1068}
1069
1070// Values returns the slice of values for the current page or nil if there are no values.
1071func (page APIRevisionCollectionPage) Values() []APIRevisionContract {
1072	if page.arc.IsEmpty() {
1073		return nil
1074	}
1075	return *page.arc.Value
1076}
1077
1078// Creates a new instance of the APIRevisionCollectionPage type.
1079func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage {
1080	return APIRevisionCollectionPage{
1081		fn:  getNextPage,
1082		arc: cur,
1083	}
1084}
1085
1086// APIRevisionContract api Revision details.
1087type APIRevisionContract struct {
1088	// APIRevisionContractProperties - Properties of the Api Revision Contract.
1089	*APIRevisionContractProperties `json:"properties,omitempty"`
1090	// ID - READ-ONLY; Resource ID.
1091	ID *string `json:"id,omitempty"`
1092	// Name - READ-ONLY; Resource name.
1093	Name *string `json:"name,omitempty"`
1094	// Type - READ-ONLY; Resource type for API Management resource.
1095	Type *string `json:"type,omitempty"`
1096}
1097
1098// MarshalJSON is the custom marshaler for APIRevisionContract.
1099func (arc APIRevisionContract) MarshalJSON() ([]byte, error) {
1100	objectMap := make(map[string]interface{})
1101	if arc.APIRevisionContractProperties != nil {
1102		objectMap["properties"] = arc.APIRevisionContractProperties
1103	}
1104	return json.Marshal(objectMap)
1105}
1106
1107// UnmarshalJSON is the custom unmarshaler for APIRevisionContract struct.
1108func (arc *APIRevisionContract) UnmarshalJSON(body []byte) error {
1109	var m map[string]*json.RawMessage
1110	err := json.Unmarshal(body, &m)
1111	if err != nil {
1112		return err
1113	}
1114	for k, v := range m {
1115		switch k {
1116		case "properties":
1117			if v != nil {
1118				var APIRevisionContractProperties APIRevisionContractProperties
1119				err = json.Unmarshal(*v, &APIRevisionContractProperties)
1120				if err != nil {
1121					return err
1122				}
1123				arc.APIRevisionContractProperties = &APIRevisionContractProperties
1124			}
1125		case "id":
1126			if v != nil {
1127				var ID string
1128				err = json.Unmarshal(*v, &ID)
1129				if err != nil {
1130					return err
1131				}
1132				arc.ID = &ID
1133			}
1134		case "name":
1135			if v != nil {
1136				var name string
1137				err = json.Unmarshal(*v, &name)
1138				if err != nil {
1139					return err
1140				}
1141				arc.Name = &name
1142			}
1143		case "type":
1144			if v != nil {
1145				var typeVar string
1146				err = json.Unmarshal(*v, &typeVar)
1147				if err != nil {
1148					return err
1149				}
1150				arc.Type = &typeVar
1151			}
1152		}
1153	}
1154
1155	return nil
1156}
1157
1158// APIRevisionContractProperties summary of revision metadata.
1159type APIRevisionContractProperties struct {
1160	// APIID - READ-ONLY; Identifier of the API Revision.
1161	APIID *string `json:"apiId,omitempty"`
1162	// APIRevision - READ-ONLY; Revision number of API.
1163	APIRevision *string `json:"apiRevision,omitempty"`
1164	// CreatedDateTime - READ-ONLY; The time the API Revision was created. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
1165	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
1166	// UpdatedDateTime - READ-ONLY; The time the API Revision were updated. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
1167	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
1168	// Description - READ-ONLY; Description of the API Revision.
1169	Description *string `json:"description,omitempty"`
1170	// PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision.
1171	PrivateURL *string `json:"privateUrl,omitempty"`
1172	// IsOnline - READ-ONLY; Indicates if API revision is the current api revision.
1173	IsOnline *bool `json:"isOnline,omitempty"`
1174	// IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway.
1175	IsCurrent *bool `json:"isCurrent,omitempty"`
1176}
1177
1178// MarshalJSON is the custom marshaler for APIRevisionContractProperties.
1179func (arcp APIRevisionContractProperties) MarshalJSON() ([]byte, error) {
1180	objectMap := make(map[string]interface{})
1181	return json.Marshal(objectMap)
1182}
1183
1184// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API
1185// Revision
1186type APIRevisionInfoContract struct {
1187	// SourceAPIID - Resource identifier of API to be used to create the revision from.
1188	SourceAPIID *string `json:"sourceApiId,omitempty"`
1189	// APIVersionName - Version identifier for the new API Version.
1190	APIVersionName *string `json:"apiVersionName,omitempty"`
1191	// APIRevisionDescription - Description of new API Revision.
1192	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
1193	// APIVersionSet - Version set details
1194	APIVersionSet *APIVersionSetContractProperties `json:"apiVersionSet,omitempty"`
1195}
1196
1197// APIUpdateContract API update contract details.
1198type APIUpdateContract struct {
1199	// APIContractUpdateProperties - Properties of the API entity that can be updated.
1200	*APIContractUpdateProperties `json:"properties,omitempty"`
1201}
1202
1203// MarshalJSON is the custom marshaler for APIUpdateContract.
1204func (auc APIUpdateContract) MarshalJSON() ([]byte, error) {
1205	objectMap := make(map[string]interface{})
1206	if auc.APIContractUpdateProperties != nil {
1207		objectMap["properties"] = auc.APIContractUpdateProperties
1208	}
1209	return json.Marshal(objectMap)
1210}
1211
1212// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct.
1213func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error {
1214	var m map[string]*json.RawMessage
1215	err := json.Unmarshal(body, &m)
1216	if err != nil {
1217		return err
1218	}
1219	for k, v := range m {
1220		switch k {
1221		case "properties":
1222			if v != nil {
1223				var APIContractUpdateProperties APIContractUpdateProperties
1224				err = json.Unmarshal(*v, &APIContractUpdateProperties)
1225				if err != nil {
1226					return err
1227				}
1228				auc.APIContractUpdateProperties = &APIContractUpdateProperties
1229			}
1230		}
1231	}
1232
1233	return nil
1234}
1235
1236// APIVersionSetCollection paged Api Version Set list representation.
1237type APIVersionSetCollection struct {
1238	autorest.Response `json:"-"`
1239	// Value - Page values.
1240	Value *[]APIVersionSetContract `json:"value,omitempty"`
1241	// NextLink - Next page link if any.
1242	NextLink *string `json:"nextLink,omitempty"`
1243}
1244
1245// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values.
1246type APIVersionSetCollectionIterator struct {
1247	i    int
1248	page APIVersionSetCollectionPage
1249}
1250
1251// NextWithContext advances to the next value.  If there was an error making
1252// the request the iterator does not advance and the error is returned.
1253func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1254	if tracing.IsEnabled() {
1255		ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext")
1256		defer func() {
1257			sc := -1
1258			if iter.Response().Response.Response != nil {
1259				sc = iter.Response().Response.Response.StatusCode
1260			}
1261			tracing.EndSpan(ctx, sc, err)
1262		}()
1263	}
1264	iter.i++
1265	if iter.i < len(iter.page.Values()) {
1266		return nil
1267	}
1268	err = iter.page.NextWithContext(ctx)
1269	if err != nil {
1270		iter.i--
1271		return err
1272	}
1273	iter.i = 0
1274	return nil
1275}
1276
1277// Next advances to the next value.  If there was an error making
1278// the request the iterator does not advance and the error is returned.
1279// Deprecated: Use NextWithContext() instead.
1280func (iter *APIVersionSetCollectionIterator) Next() error {
1281	return iter.NextWithContext(context.Background())
1282}
1283
1284// NotDone returns true if the enumeration should be started or is not yet complete.
1285func (iter APIVersionSetCollectionIterator) NotDone() bool {
1286	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1287}
1288
1289// Response returns the raw server response from the last page request.
1290func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection {
1291	return iter.page.Response()
1292}
1293
1294// Value returns the current value or a zero-initialized value if the
1295// iterator has advanced beyond the end of the collection.
1296func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract {
1297	if !iter.page.NotDone() {
1298		return APIVersionSetContract{}
1299	}
1300	return iter.page.Values()[iter.i]
1301}
1302
1303// Creates a new instance of the APIVersionSetCollectionIterator type.
1304func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator {
1305	return APIVersionSetCollectionIterator{page: page}
1306}
1307
1308// IsEmpty returns true if the ListResult contains no values.
1309func (avsc APIVersionSetCollection) IsEmpty() bool {
1310	return avsc.Value == nil || len(*avsc.Value) == 0
1311}
1312
1313// hasNextLink returns true if the NextLink is not empty.
1314func (avsc APIVersionSetCollection) hasNextLink() bool {
1315	return avsc.NextLink != nil && len(*avsc.NextLink) != 0
1316}
1317
1318// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results.
1319// It returns nil if no more results exist.
1320func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) {
1321	if !avsc.hasNextLink() {
1322		return nil, nil
1323	}
1324	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1325		autorest.AsJSON(),
1326		autorest.AsGet(),
1327		autorest.WithBaseURL(to.String(avsc.NextLink)))
1328}
1329
1330// APIVersionSetCollectionPage contains a page of APIVersionSetContract values.
1331type APIVersionSetCollectionPage struct {
1332	fn   func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)
1333	avsc APIVersionSetCollection
1334}
1335
1336// NextWithContext advances to the next page of values.  If there was an error making
1337// the request the page does not advance and the error is returned.
1338func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) {
1339	if tracing.IsEnabled() {
1340		ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext")
1341		defer func() {
1342			sc := -1
1343			if page.Response().Response.Response != nil {
1344				sc = page.Response().Response.Response.StatusCode
1345			}
1346			tracing.EndSpan(ctx, sc, err)
1347		}()
1348	}
1349	for {
1350		next, err := page.fn(ctx, page.avsc)
1351		if err != nil {
1352			return err
1353		}
1354		page.avsc = next
1355		if !next.hasNextLink() || !next.IsEmpty() {
1356			break
1357		}
1358	}
1359	return nil
1360}
1361
1362// Next advances to the next page of values.  If there was an error making
1363// the request the page does not advance and the error is returned.
1364// Deprecated: Use NextWithContext() instead.
1365func (page *APIVersionSetCollectionPage) Next() error {
1366	return page.NextWithContext(context.Background())
1367}
1368
1369// NotDone returns true if the page enumeration should be started or is not yet complete.
1370func (page APIVersionSetCollectionPage) NotDone() bool {
1371	return !page.avsc.IsEmpty()
1372}
1373
1374// Response returns the raw server response from the last page request.
1375func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection {
1376	return page.avsc
1377}
1378
1379// Values returns the slice of values for the current page or nil if there are no values.
1380func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract {
1381	if page.avsc.IsEmpty() {
1382		return nil
1383	}
1384	return *page.avsc.Value
1385}
1386
1387// Creates a new instance of the APIVersionSetCollectionPage type.
1388func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage {
1389	return APIVersionSetCollectionPage{
1390		fn:   getNextPage,
1391		avsc: cur,
1392	}
1393}
1394
1395// APIVersionSetContract api Version Set Contract details.
1396type APIVersionSetContract struct {
1397	autorest.Response                `json:"-"`
1398	*APIVersionSetContractProperties `json:"properties,omitempty"`
1399	// ID - READ-ONLY; Resource ID.
1400	ID *string `json:"id,omitempty"`
1401	// Name - READ-ONLY; Resource name.
1402	Name *string `json:"name,omitempty"`
1403	// Type - READ-ONLY; Resource type for API Management resource.
1404	Type *string `json:"type,omitempty"`
1405}
1406
1407// MarshalJSON is the custom marshaler for APIVersionSetContract.
1408func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) {
1409	objectMap := make(map[string]interface{})
1410	if avsc.APIVersionSetContractProperties != nil {
1411		objectMap["properties"] = avsc.APIVersionSetContractProperties
1412	}
1413	return json.Marshal(objectMap)
1414}
1415
1416// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct.
1417func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error {
1418	var m map[string]*json.RawMessage
1419	err := json.Unmarshal(body, &m)
1420	if err != nil {
1421		return err
1422	}
1423	for k, v := range m {
1424		switch k {
1425		case "properties":
1426			if v != nil {
1427				var APIVersionSetContractProperties APIVersionSetContractProperties
1428				err = json.Unmarshal(*v, &APIVersionSetContractProperties)
1429				if err != nil {
1430					return err
1431				}
1432				avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties
1433			}
1434		case "id":
1435			if v != nil {
1436				var ID string
1437				err = json.Unmarshal(*v, &ID)
1438				if err != nil {
1439					return err
1440				}
1441				avsc.ID = &ID
1442			}
1443		case "name":
1444			if v != nil {
1445				var name string
1446				err = json.Unmarshal(*v, &name)
1447				if err != nil {
1448					return err
1449				}
1450				avsc.Name = &name
1451			}
1452		case "type":
1453			if v != nil {
1454				var typeVar string
1455				err = json.Unmarshal(*v, &typeVar)
1456				if err != nil {
1457					return err
1458				}
1459				avsc.Type = &typeVar
1460			}
1461		}
1462	}
1463
1464	return nil
1465}
1466
1467// APIVersionSetContractProperties properties of an API Version Set.
1468type APIVersionSetContractProperties struct {
1469	// DisplayName - Name of API Version Set
1470	DisplayName *string `json:"displayName,omitempty"`
1471	// VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader'
1472	VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"`
1473	// Description - Description of API Version Set.
1474	Description *string `json:"description,omitempty"`
1475	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
1476	VersionQueryName *string `json:"versionQueryName,omitempty"`
1477	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
1478	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
1479}
1480
1481// APIVersionSetEntityBase ...
1482type APIVersionSetEntityBase struct {
1483	// Description - Description of API Version Set.
1484	Description *string `json:"description,omitempty"`
1485	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
1486	VersionQueryName *string `json:"versionQueryName,omitempty"`
1487	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
1488	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
1489}
1490
1491// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract.
1492type APIVersionSetUpdateParameters struct {
1493	// APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract.
1494	*APIVersionSetUpdateParametersProperties `json:"properties,omitempty"`
1495}
1496
1497// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters.
1498func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) {
1499	objectMap := make(map[string]interface{})
1500	if avsup.APIVersionSetUpdateParametersProperties != nil {
1501		objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties
1502	}
1503	return json.Marshal(objectMap)
1504}
1505
1506// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct.
1507func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error {
1508	var m map[string]*json.RawMessage
1509	err := json.Unmarshal(body, &m)
1510	if err != nil {
1511		return err
1512	}
1513	for k, v := range m {
1514		switch k {
1515		case "properties":
1516			if v != nil {
1517				var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties
1518				err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties)
1519				if err != nil {
1520					return err
1521				}
1522				avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties
1523			}
1524		}
1525	}
1526
1527	return nil
1528}
1529
1530// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set.
1531type APIVersionSetUpdateParametersProperties struct {
1532	// DisplayName - Name of API Version Set
1533	DisplayName *string `json:"displayName,omitempty"`
1534	// VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader'
1535	VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"`
1536	// Description - Description of API Version Set.
1537	Description *string `json:"description,omitempty"`
1538	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
1539	VersionQueryName *string `json:"versionQueryName,omitempty"`
1540	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
1541	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
1542}
1543
1544// AuthenticationSettingsContract API Authentication Settings.
1545type AuthenticationSettingsContract struct {
1546	// OAuth2 - OAuth2 Authentication settings
1547	OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"`
1548}
1549
1550// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation.
1551type AuthorizationServerCollection struct {
1552	autorest.Response `json:"-"`
1553	// Value - Page values.
1554	Value *[]AuthorizationServerContract `json:"value,omitempty"`
1555	// Count - Total record count number across all pages.
1556	Count *int64 `json:"count,omitempty"`
1557	// NextLink - Next page link if any.
1558	NextLink *string `json:"nextLink,omitempty"`
1559}
1560
1561// AuthorizationServerCollectionIterator provides access to a complete listing of
1562// AuthorizationServerContract values.
1563type AuthorizationServerCollectionIterator struct {
1564	i    int
1565	page AuthorizationServerCollectionPage
1566}
1567
1568// NextWithContext advances to the next value.  If there was an error making
1569// the request the iterator does not advance and the error is returned.
1570func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1571	if tracing.IsEnabled() {
1572		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext")
1573		defer func() {
1574			sc := -1
1575			if iter.Response().Response.Response != nil {
1576				sc = iter.Response().Response.Response.StatusCode
1577			}
1578			tracing.EndSpan(ctx, sc, err)
1579		}()
1580	}
1581	iter.i++
1582	if iter.i < len(iter.page.Values()) {
1583		return nil
1584	}
1585	err = iter.page.NextWithContext(ctx)
1586	if err != nil {
1587		iter.i--
1588		return err
1589	}
1590	iter.i = 0
1591	return nil
1592}
1593
1594// Next advances to the next value.  If there was an error making
1595// the request the iterator does not advance and the error is returned.
1596// Deprecated: Use NextWithContext() instead.
1597func (iter *AuthorizationServerCollectionIterator) Next() error {
1598	return iter.NextWithContext(context.Background())
1599}
1600
1601// NotDone returns true if the enumeration should be started or is not yet complete.
1602func (iter AuthorizationServerCollectionIterator) NotDone() bool {
1603	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1604}
1605
1606// Response returns the raw server response from the last page request.
1607func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection {
1608	return iter.page.Response()
1609}
1610
1611// Value returns the current value or a zero-initialized value if the
1612// iterator has advanced beyond the end of the collection.
1613func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract {
1614	if !iter.page.NotDone() {
1615		return AuthorizationServerContract{}
1616	}
1617	return iter.page.Values()[iter.i]
1618}
1619
1620// Creates a new instance of the AuthorizationServerCollectionIterator type.
1621func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator {
1622	return AuthorizationServerCollectionIterator{page: page}
1623}
1624
1625// IsEmpty returns true if the ListResult contains no values.
1626func (asc AuthorizationServerCollection) IsEmpty() bool {
1627	return asc.Value == nil || len(*asc.Value) == 0
1628}
1629
1630// hasNextLink returns true if the NextLink is not empty.
1631func (asc AuthorizationServerCollection) hasNextLink() bool {
1632	return asc.NextLink != nil && len(*asc.NextLink) != 0
1633}
1634
1635// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results.
1636// It returns nil if no more results exist.
1637func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) {
1638	if !asc.hasNextLink() {
1639		return nil, nil
1640	}
1641	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1642		autorest.AsJSON(),
1643		autorest.AsGet(),
1644		autorest.WithBaseURL(to.String(asc.NextLink)))
1645}
1646
1647// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values.
1648type AuthorizationServerCollectionPage struct {
1649	fn  func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)
1650	asc AuthorizationServerCollection
1651}
1652
1653// NextWithContext advances to the next page of values.  If there was an error making
1654// the request the page does not advance and the error is returned.
1655func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) {
1656	if tracing.IsEnabled() {
1657		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext")
1658		defer func() {
1659			sc := -1
1660			if page.Response().Response.Response != nil {
1661				sc = page.Response().Response.Response.StatusCode
1662			}
1663			tracing.EndSpan(ctx, sc, err)
1664		}()
1665	}
1666	for {
1667		next, err := page.fn(ctx, page.asc)
1668		if err != nil {
1669			return err
1670		}
1671		page.asc = next
1672		if !next.hasNextLink() || !next.IsEmpty() {
1673			break
1674		}
1675	}
1676	return nil
1677}
1678
1679// Next advances to the next page of values.  If there was an error making
1680// the request the page does not advance and the error is returned.
1681// Deprecated: Use NextWithContext() instead.
1682func (page *AuthorizationServerCollectionPage) Next() error {
1683	return page.NextWithContext(context.Background())
1684}
1685
1686// NotDone returns true if the page enumeration should be started or is not yet complete.
1687func (page AuthorizationServerCollectionPage) NotDone() bool {
1688	return !page.asc.IsEmpty()
1689}
1690
1691// Response returns the raw server response from the last page request.
1692func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection {
1693	return page.asc
1694}
1695
1696// Values returns the slice of values for the current page or nil if there are no values.
1697func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract {
1698	if page.asc.IsEmpty() {
1699		return nil
1700	}
1701	return *page.asc.Value
1702}
1703
1704// Creates a new instance of the AuthorizationServerCollectionPage type.
1705func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage {
1706	return AuthorizationServerCollectionPage{
1707		fn:  getNextPage,
1708		asc: cur,
1709	}
1710}
1711
1712// AuthorizationServerContract external OAuth authorization server settings.
1713type AuthorizationServerContract struct {
1714	autorest.Response `json:"-"`
1715	// AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract.
1716	*AuthorizationServerContractProperties `json:"properties,omitempty"`
1717	// ID - READ-ONLY; Resource ID.
1718	ID *string `json:"id,omitempty"`
1719	// Name - READ-ONLY; Resource name.
1720	Name *string `json:"name,omitempty"`
1721	// Type - READ-ONLY; Resource type for API Management resource.
1722	Type *string `json:"type,omitempty"`
1723}
1724
1725// MarshalJSON is the custom marshaler for AuthorizationServerContract.
1726func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) {
1727	objectMap := make(map[string]interface{})
1728	if asc.AuthorizationServerContractProperties != nil {
1729		objectMap["properties"] = asc.AuthorizationServerContractProperties
1730	}
1731	return json.Marshal(objectMap)
1732}
1733
1734// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct.
1735func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error {
1736	var m map[string]*json.RawMessage
1737	err := json.Unmarshal(body, &m)
1738	if err != nil {
1739		return err
1740	}
1741	for k, v := range m {
1742		switch k {
1743		case "properties":
1744			if v != nil {
1745				var authorizationServerContractProperties AuthorizationServerContractProperties
1746				err = json.Unmarshal(*v, &authorizationServerContractProperties)
1747				if err != nil {
1748					return err
1749				}
1750				asc.AuthorizationServerContractProperties = &authorizationServerContractProperties
1751			}
1752		case "id":
1753			if v != nil {
1754				var ID string
1755				err = json.Unmarshal(*v, &ID)
1756				if err != nil {
1757					return err
1758				}
1759				asc.ID = &ID
1760			}
1761		case "name":
1762			if v != nil {
1763				var name string
1764				err = json.Unmarshal(*v, &name)
1765				if err != nil {
1766					return err
1767				}
1768				asc.Name = &name
1769			}
1770		case "type":
1771			if v != nil {
1772				var typeVar string
1773				err = json.Unmarshal(*v, &typeVar)
1774				if err != nil {
1775					return err
1776				}
1777				asc.Type = &typeVar
1778			}
1779		}
1780	}
1781
1782	return nil
1783}
1784
1785// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract.
1786type AuthorizationServerContractBaseProperties struct {
1787	// Description - Description of the authorization server. Can contain HTML formatting tags.
1788	Description *string `json:"description,omitempty"`
1789	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
1790	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
1791	// ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format.
1792	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
1793	// TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}.
1794	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
1795	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
1796	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
1797	// SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.
1798	SupportState *bool `json:"supportState,omitempty"`
1799	// DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.
1800	DefaultScope *string `json:"defaultScope,omitempty"`
1801	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
1802	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
1803	// ClientSecret - Client or app secret registered with this authorization server.
1804	ClientSecret *string `json:"clientSecret,omitempty"`
1805	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
1806	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
1807	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
1808	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
1809}
1810
1811// AuthorizationServerContractProperties external OAuth authorization server settings Properties.
1812type AuthorizationServerContractProperties struct {
1813	// DisplayName - User-friendly authorization server name.
1814	DisplayName *string `json:"displayName,omitempty"`
1815	// ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.
1816	ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"`
1817	// AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
1818	AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"`
1819	// GrantTypes - Form of an authorization grant, which the client uses to request the access token.
1820	GrantTypes *[]GrantType `json:"grantTypes,omitempty"`
1821	// ClientID - Client or app id registered with this authorization server.
1822	ClientID *string `json:"clientId,omitempty"`
1823	// Description - Description of the authorization server. Can contain HTML formatting tags.
1824	Description *string `json:"description,omitempty"`
1825	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
1826	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
1827	// ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format.
1828	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
1829	// TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}.
1830	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
1831	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
1832	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
1833	// SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.
1834	SupportState *bool `json:"supportState,omitempty"`
1835	// DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.
1836	DefaultScope *string `json:"defaultScope,omitempty"`
1837	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
1838	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
1839	// ClientSecret - Client or app secret registered with this authorization server.
1840	ClientSecret *string `json:"clientSecret,omitempty"`
1841	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
1842	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
1843	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
1844	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
1845}
1846
1847// AuthorizationServerUpdateContract external OAuth authorization server settings.
1848type AuthorizationServerUpdateContract struct {
1849	// AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract.
1850	*AuthorizationServerUpdateContractProperties `json:"properties,omitempty"`
1851	// ID - READ-ONLY; Resource ID.
1852	ID *string `json:"id,omitempty"`
1853	// Name - READ-ONLY; Resource name.
1854	Name *string `json:"name,omitempty"`
1855	// Type - READ-ONLY; Resource type for API Management resource.
1856	Type *string `json:"type,omitempty"`
1857}
1858
1859// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract.
1860func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) {
1861	objectMap := make(map[string]interface{})
1862	if asuc.AuthorizationServerUpdateContractProperties != nil {
1863		objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties
1864	}
1865	return json.Marshal(objectMap)
1866}
1867
1868// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct.
1869func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error {
1870	var m map[string]*json.RawMessage
1871	err := json.Unmarshal(body, &m)
1872	if err != nil {
1873		return err
1874	}
1875	for k, v := range m {
1876		switch k {
1877		case "properties":
1878			if v != nil {
1879				var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties
1880				err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties)
1881				if err != nil {
1882					return err
1883				}
1884				asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties
1885			}
1886		case "id":
1887			if v != nil {
1888				var ID string
1889				err = json.Unmarshal(*v, &ID)
1890				if err != nil {
1891					return err
1892				}
1893				asuc.ID = &ID
1894			}
1895		case "name":
1896			if v != nil {
1897				var name string
1898				err = json.Unmarshal(*v, &name)
1899				if err != nil {
1900					return err
1901				}
1902				asuc.Name = &name
1903			}
1904		case "type":
1905			if v != nil {
1906				var typeVar string
1907				err = json.Unmarshal(*v, &typeVar)
1908				if err != nil {
1909					return err
1910				}
1911				asuc.Type = &typeVar
1912			}
1913		}
1914	}
1915
1916	return nil
1917}
1918
1919// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings
1920// contract.
1921type AuthorizationServerUpdateContractProperties struct {
1922	// DisplayName - User-friendly authorization server name.
1923	DisplayName *string `json:"displayName,omitempty"`
1924	// ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.
1925	ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"`
1926	// AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
1927	AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"`
1928	// GrantTypes - Form of an authorization grant, which the client uses to request the access token.
1929	GrantTypes *[]GrantType `json:"grantTypes,omitempty"`
1930	// ClientID - Client or app id registered with this authorization server.
1931	ClientID *string `json:"clientId,omitempty"`
1932	// Description - Description of the authorization server. Can contain HTML formatting tags.
1933	Description *string `json:"description,omitempty"`
1934	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
1935	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
1936	// ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format.
1937	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
1938	// TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}.
1939	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
1940	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
1941	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
1942	// SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security.
1943	SupportState *bool `json:"supportState,omitempty"`
1944	// DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values.
1945	DefaultScope *string `json:"defaultScope,omitempty"`
1946	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
1947	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
1948	// ClientSecret - Client or app secret registered with this authorization server.
1949	ClientSecret *string `json:"clientSecret,omitempty"`
1950	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
1951	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
1952	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
1953	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
1954}
1955
1956// BackendAuthorizationHeaderCredentials authorization header information.
1957type BackendAuthorizationHeaderCredentials struct {
1958	// Scheme - Authentication Scheme name.
1959	Scheme *string `json:"scheme,omitempty"`
1960	// Parameter - Authentication Parameter value.
1961	Parameter *string `json:"parameter,omitempty"`
1962}
1963
1964// BackendBaseParameters backend entity base Parameter set.
1965type BackendBaseParameters struct {
1966	// Title - Backend Title.
1967	Title *string `json:"title,omitempty"`
1968	// Description - Backend Description.
1969	Description *string `json:"description,omitempty"`
1970	// ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps.
1971	ResourceID *string `json:"resourceId,omitempty"`
1972	// Properties - Backend Properties contract
1973	Properties *BackendProperties `json:"properties,omitempty"`
1974	// Credentials - Backend Credentials Contract Properties
1975	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
1976	// Proxy - Backend Proxy Contract Properties
1977	Proxy *BackendProxyContract `json:"proxy,omitempty"`
1978	// TLS - Backend TLS Properties
1979	TLS *BackendTLSProperties `json:"tls,omitempty"`
1980}
1981
1982// BackendCollection paged Backend list representation.
1983type BackendCollection struct {
1984	autorest.Response `json:"-"`
1985	// Value - Backend values.
1986	Value *[]BackendContract `json:"value,omitempty"`
1987	// NextLink - Next page link if any.
1988	NextLink *string `json:"nextLink,omitempty"`
1989}
1990
1991// BackendCollectionIterator provides access to a complete listing of BackendContract values.
1992type BackendCollectionIterator struct {
1993	i    int
1994	page BackendCollectionPage
1995}
1996
1997// NextWithContext advances to the next value.  If there was an error making
1998// the request the iterator does not advance and the error is returned.
1999func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2000	if tracing.IsEnabled() {
2001		ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext")
2002		defer func() {
2003			sc := -1
2004			if iter.Response().Response.Response != nil {
2005				sc = iter.Response().Response.Response.StatusCode
2006			}
2007			tracing.EndSpan(ctx, sc, err)
2008		}()
2009	}
2010	iter.i++
2011	if iter.i < len(iter.page.Values()) {
2012		return nil
2013	}
2014	err = iter.page.NextWithContext(ctx)
2015	if err != nil {
2016		iter.i--
2017		return err
2018	}
2019	iter.i = 0
2020	return nil
2021}
2022
2023// Next advances to the next value.  If there was an error making
2024// the request the iterator does not advance and the error is returned.
2025// Deprecated: Use NextWithContext() instead.
2026func (iter *BackendCollectionIterator) Next() error {
2027	return iter.NextWithContext(context.Background())
2028}
2029
2030// NotDone returns true if the enumeration should be started or is not yet complete.
2031func (iter BackendCollectionIterator) NotDone() bool {
2032	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2033}
2034
2035// Response returns the raw server response from the last page request.
2036func (iter BackendCollectionIterator) Response() BackendCollection {
2037	return iter.page.Response()
2038}
2039
2040// Value returns the current value or a zero-initialized value if the
2041// iterator has advanced beyond the end of the collection.
2042func (iter BackendCollectionIterator) Value() BackendContract {
2043	if !iter.page.NotDone() {
2044		return BackendContract{}
2045	}
2046	return iter.page.Values()[iter.i]
2047}
2048
2049// Creates a new instance of the BackendCollectionIterator type.
2050func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator {
2051	return BackendCollectionIterator{page: page}
2052}
2053
2054// IsEmpty returns true if the ListResult contains no values.
2055func (bc BackendCollection) IsEmpty() bool {
2056	return bc.Value == nil || len(*bc.Value) == 0
2057}
2058
2059// hasNextLink returns true if the NextLink is not empty.
2060func (bc BackendCollection) hasNextLink() bool {
2061	return bc.NextLink != nil && len(*bc.NextLink) != 0
2062}
2063
2064// backendCollectionPreparer prepares a request to retrieve the next set of results.
2065// It returns nil if no more results exist.
2066func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) {
2067	if !bc.hasNextLink() {
2068		return nil, nil
2069	}
2070	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2071		autorest.AsJSON(),
2072		autorest.AsGet(),
2073		autorest.WithBaseURL(to.String(bc.NextLink)))
2074}
2075
2076// BackendCollectionPage contains a page of BackendContract values.
2077type BackendCollectionPage struct {
2078	fn func(context.Context, BackendCollection) (BackendCollection, error)
2079	bc BackendCollection
2080}
2081
2082// NextWithContext advances to the next page of values.  If there was an error making
2083// the request the page does not advance and the error is returned.
2084func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) {
2085	if tracing.IsEnabled() {
2086		ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext")
2087		defer func() {
2088			sc := -1
2089			if page.Response().Response.Response != nil {
2090				sc = page.Response().Response.Response.StatusCode
2091			}
2092			tracing.EndSpan(ctx, sc, err)
2093		}()
2094	}
2095	for {
2096		next, err := page.fn(ctx, page.bc)
2097		if err != nil {
2098			return err
2099		}
2100		page.bc = next
2101		if !next.hasNextLink() || !next.IsEmpty() {
2102			break
2103		}
2104	}
2105	return nil
2106}
2107
2108// Next advances to the next page of values.  If there was an error making
2109// the request the page does not advance and the error is returned.
2110// Deprecated: Use NextWithContext() instead.
2111func (page *BackendCollectionPage) Next() error {
2112	return page.NextWithContext(context.Background())
2113}
2114
2115// NotDone returns true if the page enumeration should be started or is not yet complete.
2116func (page BackendCollectionPage) NotDone() bool {
2117	return !page.bc.IsEmpty()
2118}
2119
2120// Response returns the raw server response from the last page request.
2121func (page BackendCollectionPage) Response() BackendCollection {
2122	return page.bc
2123}
2124
2125// Values returns the slice of values for the current page or nil if there are no values.
2126func (page BackendCollectionPage) Values() []BackendContract {
2127	if page.bc.IsEmpty() {
2128		return nil
2129	}
2130	return *page.bc.Value
2131}
2132
2133// Creates a new instance of the BackendCollectionPage type.
2134func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage {
2135	return BackendCollectionPage{
2136		fn: getNextPage,
2137		bc: cur,
2138	}
2139}
2140
2141// BackendContract backend details.
2142type BackendContract struct {
2143	autorest.Response `json:"-"`
2144	// BackendContractProperties - Backend entity contract properties.
2145	*BackendContractProperties `json:"properties,omitempty"`
2146	// ID - READ-ONLY; Resource ID.
2147	ID *string `json:"id,omitempty"`
2148	// Name - READ-ONLY; Resource name.
2149	Name *string `json:"name,omitempty"`
2150	// Type - READ-ONLY; Resource type for API Management resource.
2151	Type *string `json:"type,omitempty"`
2152}
2153
2154// MarshalJSON is the custom marshaler for BackendContract.
2155func (bc BackendContract) MarshalJSON() ([]byte, error) {
2156	objectMap := make(map[string]interface{})
2157	if bc.BackendContractProperties != nil {
2158		objectMap["properties"] = bc.BackendContractProperties
2159	}
2160	return json.Marshal(objectMap)
2161}
2162
2163// UnmarshalJSON is the custom unmarshaler for BackendContract struct.
2164func (bc *BackendContract) UnmarshalJSON(body []byte) error {
2165	var m map[string]*json.RawMessage
2166	err := json.Unmarshal(body, &m)
2167	if err != nil {
2168		return err
2169	}
2170	for k, v := range m {
2171		switch k {
2172		case "properties":
2173			if v != nil {
2174				var backendContractProperties BackendContractProperties
2175				err = json.Unmarshal(*v, &backendContractProperties)
2176				if err != nil {
2177					return err
2178				}
2179				bc.BackendContractProperties = &backendContractProperties
2180			}
2181		case "id":
2182			if v != nil {
2183				var ID string
2184				err = json.Unmarshal(*v, &ID)
2185				if err != nil {
2186					return err
2187				}
2188				bc.ID = &ID
2189			}
2190		case "name":
2191			if v != nil {
2192				var name string
2193				err = json.Unmarshal(*v, &name)
2194				if err != nil {
2195					return err
2196				}
2197				bc.Name = &name
2198			}
2199		case "type":
2200			if v != nil {
2201				var typeVar string
2202				err = json.Unmarshal(*v, &typeVar)
2203				if err != nil {
2204					return err
2205				}
2206				bc.Type = &typeVar
2207			}
2208		}
2209	}
2210
2211	return nil
2212}
2213
2214// BackendContractProperties parameters supplied to the Create Backend operation.
2215type BackendContractProperties struct {
2216	// URL - Runtime Url of the Backend.
2217	URL *string `json:"url,omitempty"`
2218	// Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap'
2219	Protocol BackendProtocol `json:"protocol,omitempty"`
2220	// Title - Backend Title.
2221	Title *string `json:"title,omitempty"`
2222	// Description - Backend Description.
2223	Description *string `json:"description,omitempty"`
2224	// ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps.
2225	ResourceID *string `json:"resourceId,omitempty"`
2226	// Properties - Backend Properties contract
2227	Properties *BackendProperties `json:"properties,omitempty"`
2228	// Credentials - Backend Credentials Contract Properties
2229	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
2230	// Proxy - Backend Proxy Contract Properties
2231	Proxy *BackendProxyContract `json:"proxy,omitempty"`
2232	// TLS - Backend TLS Properties
2233	TLS *BackendTLSProperties `json:"tls,omitempty"`
2234}
2235
2236// BackendCredentialsContract details of the Credentials used to connect to Backend.
2237type BackendCredentialsContract struct {
2238	// Certificate - List of Client Certificate Thumbprint.
2239	Certificate *[]string `json:"certificate,omitempty"`
2240	// Query - Query Parameter description.
2241	Query map[string][]string `json:"query"`
2242	// Header - Header Parameter description.
2243	Header map[string][]string `json:"header"`
2244	// Authorization - Authorization header authentication
2245	Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"`
2246}
2247
2248// MarshalJSON is the custom marshaler for BackendCredentialsContract.
2249func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) {
2250	objectMap := make(map[string]interface{})
2251	if bcc.Certificate != nil {
2252		objectMap["certificate"] = bcc.Certificate
2253	}
2254	if bcc.Query != nil {
2255		objectMap["query"] = bcc.Query
2256	}
2257	if bcc.Header != nil {
2258		objectMap["header"] = bcc.Header
2259	}
2260	if bcc.Authorization != nil {
2261		objectMap["authorization"] = bcc.Authorization
2262	}
2263	return json.Marshal(objectMap)
2264}
2265
2266// BackendProperties properties specific to the Backend Type.
2267type BackendProperties struct {
2268	// ServiceFabricCluster - Backend Service Fabric Cluster Properties
2269	ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"`
2270}
2271
2272// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend.
2273type BackendProxyContract struct {
2274	// URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.
2275	URL *string `json:"url,omitempty"`
2276	// Username - Username to connect to the WebProxy server
2277	Username *string `json:"username,omitempty"`
2278	// Password - Password to connect to the WebProxy Server
2279	Password *string `json:"password,omitempty"`
2280}
2281
2282// BackendReconnectContract reconnect request parameters.
2283type BackendReconnectContract struct {
2284	// BackendReconnectProperties - Reconnect request properties.
2285	*BackendReconnectProperties `json:"properties,omitempty"`
2286	// ID - READ-ONLY; Resource ID.
2287	ID *string `json:"id,omitempty"`
2288	// Name - READ-ONLY; Resource name.
2289	Name *string `json:"name,omitempty"`
2290	// Type - READ-ONLY; Resource type for API Management resource.
2291	Type *string `json:"type,omitempty"`
2292}
2293
2294// MarshalJSON is the custom marshaler for BackendReconnectContract.
2295func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) {
2296	objectMap := make(map[string]interface{})
2297	if brc.BackendReconnectProperties != nil {
2298		objectMap["properties"] = brc.BackendReconnectProperties
2299	}
2300	return json.Marshal(objectMap)
2301}
2302
2303// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct.
2304func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error {
2305	var m map[string]*json.RawMessage
2306	err := json.Unmarshal(body, &m)
2307	if err != nil {
2308		return err
2309	}
2310	for k, v := range m {
2311		switch k {
2312		case "properties":
2313			if v != nil {
2314				var backendReconnectProperties BackendReconnectProperties
2315				err = json.Unmarshal(*v, &backendReconnectProperties)
2316				if err != nil {
2317					return err
2318				}
2319				brc.BackendReconnectProperties = &backendReconnectProperties
2320			}
2321		case "id":
2322			if v != nil {
2323				var ID string
2324				err = json.Unmarshal(*v, &ID)
2325				if err != nil {
2326					return err
2327				}
2328				brc.ID = &ID
2329			}
2330		case "name":
2331			if v != nil {
2332				var name string
2333				err = json.Unmarshal(*v, &name)
2334				if err != nil {
2335					return err
2336				}
2337				brc.Name = &name
2338			}
2339		case "type":
2340			if v != nil {
2341				var typeVar string
2342				err = json.Unmarshal(*v, &typeVar)
2343				if err != nil {
2344					return err
2345				}
2346				brc.Type = &typeVar
2347			}
2348		}
2349	}
2350
2351	return nil
2352}
2353
2354// BackendReconnectProperties properties to control reconnect requests.
2355type BackendReconnectProperties struct {
2356	// After - Duration in ISO8601 format after which reconnect will be initiated.
2357	After *string `json:"after,omitempty"`
2358}
2359
2360// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend.
2361type BackendServiceFabricClusterProperties struct {
2362	// ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint.
2363	ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"`
2364	// MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition.
2365	MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"`
2366	// ManagementEndpoints - The cluster management endpoint.
2367	ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"`
2368	// ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication
2369	ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"`
2370	// ServerX509Names - Server X509 Certificate Names Collection
2371	ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"`
2372}
2373
2374// BackendTLSProperties properties controlling TLS Certificate Validation.
2375type BackendTLSProperties struct {
2376	// ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.
2377	ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"`
2378	// ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.
2379	ValidateCertificateName *bool `json:"validateCertificateName,omitempty"`
2380}
2381
2382// BackendUpdateParameterProperties parameters supplied to the Update Backend operation.
2383type BackendUpdateParameterProperties struct {
2384	// URL - Runtime Url of the Backend.
2385	URL *string `json:"url,omitempty"`
2386	// Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap'
2387	Protocol BackendProtocol `json:"protocol,omitempty"`
2388	// Title - Backend Title.
2389	Title *string `json:"title,omitempty"`
2390	// Description - Backend Description.
2391	Description *string `json:"description,omitempty"`
2392	// ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps.
2393	ResourceID *string `json:"resourceId,omitempty"`
2394	// Properties - Backend Properties contract
2395	Properties *BackendProperties `json:"properties,omitempty"`
2396	// Credentials - Backend Credentials Contract Properties
2397	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
2398	// Proxy - Backend Proxy Contract Properties
2399	Proxy *BackendProxyContract `json:"proxy,omitempty"`
2400	// TLS - Backend TLS Properties
2401	TLS *BackendTLSProperties `json:"tls,omitempty"`
2402}
2403
2404// BackendUpdateParameters backend update parameters.
2405type BackendUpdateParameters struct {
2406	// BackendUpdateParameterProperties - Backend entity update contract properties.
2407	*BackendUpdateParameterProperties `json:"properties,omitempty"`
2408}
2409
2410// MarshalJSON is the custom marshaler for BackendUpdateParameters.
2411func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) {
2412	objectMap := make(map[string]interface{})
2413	if bup.BackendUpdateParameterProperties != nil {
2414		objectMap["properties"] = bup.BackendUpdateParameterProperties
2415	}
2416	return json.Marshal(objectMap)
2417}
2418
2419// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct.
2420func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error {
2421	var m map[string]*json.RawMessage
2422	err := json.Unmarshal(body, &m)
2423	if err != nil {
2424		return err
2425	}
2426	for k, v := range m {
2427		switch k {
2428		case "properties":
2429			if v != nil {
2430				var backendUpdateParameterProperties BackendUpdateParameterProperties
2431				err = json.Unmarshal(*v, &backendUpdateParameterProperties)
2432				if err != nil {
2433					return err
2434				}
2435				bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties
2436			}
2437		}
2438	}
2439
2440	return nil
2441}
2442
2443// CertificateCollection paged Certificates list representation.
2444type CertificateCollection struct {
2445	autorest.Response `json:"-"`
2446	// Value - Page values.
2447	Value *[]CertificateContract `json:"value,omitempty"`
2448	// NextLink - Next page link if any.
2449	NextLink *string `json:"nextLink,omitempty"`
2450}
2451
2452// CertificateCollectionIterator provides access to a complete listing of CertificateContract values.
2453type CertificateCollectionIterator struct {
2454	i    int
2455	page CertificateCollectionPage
2456}
2457
2458// NextWithContext advances to the next value.  If there was an error making
2459// the request the iterator does not advance and the error is returned.
2460func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2461	if tracing.IsEnabled() {
2462		ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext")
2463		defer func() {
2464			sc := -1
2465			if iter.Response().Response.Response != nil {
2466				sc = iter.Response().Response.Response.StatusCode
2467			}
2468			tracing.EndSpan(ctx, sc, err)
2469		}()
2470	}
2471	iter.i++
2472	if iter.i < len(iter.page.Values()) {
2473		return nil
2474	}
2475	err = iter.page.NextWithContext(ctx)
2476	if err != nil {
2477		iter.i--
2478		return err
2479	}
2480	iter.i = 0
2481	return nil
2482}
2483
2484// Next advances to the next value.  If there was an error making
2485// the request the iterator does not advance and the error is returned.
2486// Deprecated: Use NextWithContext() instead.
2487func (iter *CertificateCollectionIterator) Next() error {
2488	return iter.NextWithContext(context.Background())
2489}
2490
2491// NotDone returns true if the enumeration should be started or is not yet complete.
2492func (iter CertificateCollectionIterator) NotDone() bool {
2493	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2494}
2495
2496// Response returns the raw server response from the last page request.
2497func (iter CertificateCollectionIterator) Response() CertificateCollection {
2498	return iter.page.Response()
2499}
2500
2501// Value returns the current value or a zero-initialized value if the
2502// iterator has advanced beyond the end of the collection.
2503func (iter CertificateCollectionIterator) Value() CertificateContract {
2504	if !iter.page.NotDone() {
2505		return CertificateContract{}
2506	}
2507	return iter.page.Values()[iter.i]
2508}
2509
2510// Creates a new instance of the CertificateCollectionIterator type.
2511func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator {
2512	return CertificateCollectionIterator{page: page}
2513}
2514
2515// IsEmpty returns true if the ListResult contains no values.
2516func (cc CertificateCollection) IsEmpty() bool {
2517	return cc.Value == nil || len(*cc.Value) == 0
2518}
2519
2520// hasNextLink returns true if the NextLink is not empty.
2521func (cc CertificateCollection) hasNextLink() bool {
2522	return cc.NextLink != nil && len(*cc.NextLink) != 0
2523}
2524
2525// certificateCollectionPreparer prepares a request to retrieve the next set of results.
2526// It returns nil if no more results exist.
2527func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) {
2528	if !cc.hasNextLink() {
2529		return nil, nil
2530	}
2531	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2532		autorest.AsJSON(),
2533		autorest.AsGet(),
2534		autorest.WithBaseURL(to.String(cc.NextLink)))
2535}
2536
2537// CertificateCollectionPage contains a page of CertificateContract values.
2538type CertificateCollectionPage struct {
2539	fn func(context.Context, CertificateCollection) (CertificateCollection, error)
2540	cc CertificateCollection
2541}
2542
2543// NextWithContext advances to the next page of values.  If there was an error making
2544// the request the page does not advance and the error is returned.
2545func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) {
2546	if tracing.IsEnabled() {
2547		ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext")
2548		defer func() {
2549			sc := -1
2550			if page.Response().Response.Response != nil {
2551				sc = page.Response().Response.Response.StatusCode
2552			}
2553			tracing.EndSpan(ctx, sc, err)
2554		}()
2555	}
2556	for {
2557		next, err := page.fn(ctx, page.cc)
2558		if err != nil {
2559			return err
2560		}
2561		page.cc = next
2562		if !next.hasNextLink() || !next.IsEmpty() {
2563			break
2564		}
2565	}
2566	return nil
2567}
2568
2569// Next advances to the next page of values.  If there was an error making
2570// the request the page does not advance and the error is returned.
2571// Deprecated: Use NextWithContext() instead.
2572func (page *CertificateCollectionPage) Next() error {
2573	return page.NextWithContext(context.Background())
2574}
2575
2576// NotDone returns true if the page enumeration should be started or is not yet complete.
2577func (page CertificateCollectionPage) NotDone() bool {
2578	return !page.cc.IsEmpty()
2579}
2580
2581// Response returns the raw server response from the last page request.
2582func (page CertificateCollectionPage) Response() CertificateCollection {
2583	return page.cc
2584}
2585
2586// Values returns the slice of values for the current page or nil if there are no values.
2587func (page CertificateCollectionPage) Values() []CertificateContract {
2588	if page.cc.IsEmpty() {
2589		return nil
2590	}
2591	return *page.cc.Value
2592}
2593
2594// Creates a new instance of the CertificateCollectionPage type.
2595func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage {
2596	return CertificateCollectionPage{
2597		fn: getNextPage,
2598		cc: cur,
2599	}
2600}
2601
2602// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root
2603// certificates.
2604type CertificateConfiguration struct {
2605	// EncodedCertificate - Base64 Encoded certificate.
2606	EncodedCertificate *string `json:"encodedCertificate,omitempty"`
2607	// CertificatePassword - Certificate Password.
2608	CertificatePassword *string `json:"certificatePassword,omitempty"`
2609	// StoreName - The local certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root'
2610	StoreName StoreName `json:"storeName,omitempty"`
2611	// Certificate - READ-ONLY; Certificate information.
2612	Certificate *CertificateInformation `json:"certificate,omitempty"`
2613}
2614
2615// MarshalJSON is the custom marshaler for CertificateConfiguration.
2616func (cc CertificateConfiguration) MarshalJSON() ([]byte, error) {
2617	objectMap := make(map[string]interface{})
2618	if cc.EncodedCertificate != nil {
2619		objectMap["encodedCertificate"] = cc.EncodedCertificate
2620	}
2621	if cc.CertificatePassword != nil {
2622		objectMap["certificatePassword"] = cc.CertificatePassword
2623	}
2624	if cc.StoreName != "" {
2625		objectMap["storeName"] = cc.StoreName
2626	}
2627	return json.Marshal(objectMap)
2628}
2629
2630// CertificateContract certificate details.
2631type CertificateContract struct {
2632	autorest.Response `json:"-"`
2633	// CertificateContractProperties - Certificate properties details.
2634	*CertificateContractProperties `json:"properties,omitempty"`
2635	// ID - READ-ONLY; Resource ID.
2636	ID *string `json:"id,omitempty"`
2637	// Name - READ-ONLY; Resource name.
2638	Name *string `json:"name,omitempty"`
2639	// Type - READ-ONLY; Resource type for API Management resource.
2640	Type *string `json:"type,omitempty"`
2641}
2642
2643// MarshalJSON is the custom marshaler for CertificateContract.
2644func (cc CertificateContract) MarshalJSON() ([]byte, error) {
2645	objectMap := make(map[string]interface{})
2646	if cc.CertificateContractProperties != nil {
2647		objectMap["properties"] = cc.CertificateContractProperties
2648	}
2649	return json.Marshal(objectMap)
2650}
2651
2652// UnmarshalJSON is the custom unmarshaler for CertificateContract struct.
2653func (cc *CertificateContract) UnmarshalJSON(body []byte) error {
2654	var m map[string]*json.RawMessage
2655	err := json.Unmarshal(body, &m)
2656	if err != nil {
2657		return err
2658	}
2659	for k, v := range m {
2660		switch k {
2661		case "properties":
2662			if v != nil {
2663				var certificateContractProperties CertificateContractProperties
2664				err = json.Unmarshal(*v, &certificateContractProperties)
2665				if err != nil {
2666					return err
2667				}
2668				cc.CertificateContractProperties = &certificateContractProperties
2669			}
2670		case "id":
2671			if v != nil {
2672				var ID string
2673				err = json.Unmarshal(*v, &ID)
2674				if err != nil {
2675					return err
2676				}
2677				cc.ID = &ID
2678			}
2679		case "name":
2680			if v != nil {
2681				var name string
2682				err = json.Unmarshal(*v, &name)
2683				if err != nil {
2684					return err
2685				}
2686				cc.Name = &name
2687			}
2688		case "type":
2689			if v != nil {
2690				var typeVar string
2691				err = json.Unmarshal(*v, &typeVar)
2692				if err != nil {
2693					return err
2694				}
2695				cc.Type = &typeVar
2696			}
2697		}
2698	}
2699
2700	return nil
2701}
2702
2703// CertificateContractProperties properties of the Certificate contract.
2704type CertificateContractProperties struct {
2705	// Subject - Subject attribute of the certificate.
2706	Subject *string `json:"subject,omitempty"`
2707	// Thumbprint - Thumbprint of the certificate.
2708	Thumbprint *string `json:"thumbprint,omitempty"`
2709	// ExpirationDate - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
2710	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
2711}
2712
2713// CertificateCreateOrUpdateParameters certificate create or update details.
2714type CertificateCreateOrUpdateParameters struct {
2715	// CertificateCreateOrUpdateProperties - Certificate create or update properties details.
2716	*CertificateCreateOrUpdateProperties `json:"properties,omitempty"`
2717}
2718
2719// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters.
2720func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) {
2721	objectMap := make(map[string]interface{})
2722	if ccoup.CertificateCreateOrUpdateProperties != nil {
2723		objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties
2724	}
2725	return json.Marshal(objectMap)
2726}
2727
2728// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct.
2729func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error {
2730	var m map[string]*json.RawMessage
2731	err := json.Unmarshal(body, &m)
2732	if err != nil {
2733		return err
2734	}
2735	for k, v := range m {
2736		switch k {
2737		case "properties":
2738			if v != nil {
2739				var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties
2740				err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties)
2741				if err != nil {
2742					return err
2743				}
2744				ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties
2745			}
2746		}
2747	}
2748
2749	return nil
2750}
2751
2752// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation.
2753type CertificateCreateOrUpdateProperties struct {
2754	// Data - Base 64 encoded certificate using the application/x-pkcs12 representation.
2755	Data *string `json:"data,omitempty"`
2756	// Password - Password for the Certificate
2757	Password *string `json:"password,omitempty"`
2758}
2759
2760// CertificateInformation SSL certificate information.
2761type CertificateInformation struct {
2762	autorest.Response `json:"-"`
2763	// Expiry - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
2764	Expiry *date.Time `json:"expiry,omitempty"`
2765	// Thumbprint - Thumbprint of the certificate.
2766	Thumbprint *string `json:"thumbprint,omitempty"`
2767	// Subject - Subject of the certificate.
2768	Subject *string `json:"subject,omitempty"`
2769}
2770
2771// ConnectivityStatusContract details about connectivity to a resource.
2772type ConnectivityStatusContract struct {
2773	// Name - The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon.
2774	Name *string `json:"name,omitempty"`
2775	// Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure'
2776	Status ConnectivityStatusType `json:"status,omitempty"`
2777	// Error - Error details of the connectivity to the resource.
2778	Error *string `json:"error,omitempty"`
2779	// LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
2780	LastUpdated *date.Time `json:"lastUpdated,omitempty"`
2781	// LastStatusChange - The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
2782	LastStatusChange *date.Time `json:"lastStatusChange,omitempty"`
2783}
2784
2785// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation.
2786type DeployConfigurationParameters struct {
2787	// Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database.
2788	Branch *string `json:"branch,omitempty"`
2789	// Force - The value enforcing deleting subscriptions to products that are deleted in this update.
2790	Force *bool `json:"force,omitempty"`
2791}
2792
2793// DiagnosticCollection paged Diagnostic list representation.
2794type DiagnosticCollection struct {
2795	autorest.Response `json:"-"`
2796	// Value - Page values.
2797	Value *[]DiagnosticContract `json:"value,omitempty"`
2798	// NextLink - Next page link if any.
2799	NextLink *string `json:"nextLink,omitempty"`
2800}
2801
2802// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values.
2803type DiagnosticCollectionIterator struct {
2804	i    int
2805	page DiagnosticCollectionPage
2806}
2807
2808// NextWithContext advances to the next value.  If there was an error making
2809// the request the iterator does not advance and the error is returned.
2810func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2811	if tracing.IsEnabled() {
2812		ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext")
2813		defer func() {
2814			sc := -1
2815			if iter.Response().Response.Response != nil {
2816				sc = iter.Response().Response.Response.StatusCode
2817			}
2818			tracing.EndSpan(ctx, sc, err)
2819		}()
2820	}
2821	iter.i++
2822	if iter.i < len(iter.page.Values()) {
2823		return nil
2824	}
2825	err = iter.page.NextWithContext(ctx)
2826	if err != nil {
2827		iter.i--
2828		return err
2829	}
2830	iter.i = 0
2831	return nil
2832}
2833
2834// Next advances to the next value.  If there was an error making
2835// the request the iterator does not advance and the error is returned.
2836// Deprecated: Use NextWithContext() instead.
2837func (iter *DiagnosticCollectionIterator) Next() error {
2838	return iter.NextWithContext(context.Background())
2839}
2840
2841// NotDone returns true if the enumeration should be started or is not yet complete.
2842func (iter DiagnosticCollectionIterator) NotDone() bool {
2843	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2844}
2845
2846// Response returns the raw server response from the last page request.
2847func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection {
2848	return iter.page.Response()
2849}
2850
2851// Value returns the current value or a zero-initialized value if the
2852// iterator has advanced beyond the end of the collection.
2853func (iter DiagnosticCollectionIterator) Value() DiagnosticContract {
2854	if !iter.page.NotDone() {
2855		return DiagnosticContract{}
2856	}
2857	return iter.page.Values()[iter.i]
2858}
2859
2860// Creates a new instance of the DiagnosticCollectionIterator type.
2861func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator {
2862	return DiagnosticCollectionIterator{page: page}
2863}
2864
2865// IsEmpty returns true if the ListResult contains no values.
2866func (dc DiagnosticCollection) IsEmpty() bool {
2867	return dc.Value == nil || len(*dc.Value) == 0
2868}
2869
2870// hasNextLink returns true if the NextLink is not empty.
2871func (dc DiagnosticCollection) hasNextLink() bool {
2872	return dc.NextLink != nil && len(*dc.NextLink) != 0
2873}
2874
2875// diagnosticCollectionPreparer prepares a request to retrieve the next set of results.
2876// It returns nil if no more results exist.
2877func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) {
2878	if !dc.hasNextLink() {
2879		return nil, nil
2880	}
2881	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2882		autorest.AsJSON(),
2883		autorest.AsGet(),
2884		autorest.WithBaseURL(to.String(dc.NextLink)))
2885}
2886
2887// DiagnosticCollectionPage contains a page of DiagnosticContract values.
2888type DiagnosticCollectionPage struct {
2889	fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)
2890	dc DiagnosticCollection
2891}
2892
2893// NextWithContext advances to the next page of values.  If there was an error making
2894// the request the page does not advance and the error is returned.
2895func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) {
2896	if tracing.IsEnabled() {
2897		ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext")
2898		defer func() {
2899			sc := -1
2900			if page.Response().Response.Response != nil {
2901				sc = page.Response().Response.Response.StatusCode
2902			}
2903			tracing.EndSpan(ctx, sc, err)
2904		}()
2905	}
2906	for {
2907		next, err := page.fn(ctx, page.dc)
2908		if err != nil {
2909			return err
2910		}
2911		page.dc = next
2912		if !next.hasNextLink() || !next.IsEmpty() {
2913			break
2914		}
2915	}
2916	return nil
2917}
2918
2919// Next advances to the next page of values.  If there was an error making
2920// the request the page does not advance and the error is returned.
2921// Deprecated: Use NextWithContext() instead.
2922func (page *DiagnosticCollectionPage) Next() error {
2923	return page.NextWithContext(context.Background())
2924}
2925
2926// NotDone returns true if the page enumeration should be started or is not yet complete.
2927func (page DiagnosticCollectionPage) NotDone() bool {
2928	return !page.dc.IsEmpty()
2929}
2930
2931// Response returns the raw server response from the last page request.
2932func (page DiagnosticCollectionPage) Response() DiagnosticCollection {
2933	return page.dc
2934}
2935
2936// Values returns the slice of values for the current page or nil if there are no values.
2937func (page DiagnosticCollectionPage) Values() []DiagnosticContract {
2938	if page.dc.IsEmpty() {
2939		return nil
2940	}
2941	return *page.dc.Value
2942}
2943
2944// Creates a new instance of the DiagnosticCollectionPage type.
2945func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage {
2946	return DiagnosticCollectionPage{
2947		fn: getNextPage,
2948		dc: cur,
2949	}
2950}
2951
2952// DiagnosticContract diagnostic details.
2953type DiagnosticContract struct {
2954	autorest.Response `json:"-"`
2955	// DiagnosticContractProperties - Diagnostic entity contract properties.
2956	*DiagnosticContractProperties `json:"properties,omitempty"`
2957	// ID - READ-ONLY; Resource ID.
2958	ID *string `json:"id,omitempty"`
2959	// Name - READ-ONLY; Resource name.
2960	Name *string `json:"name,omitempty"`
2961	// Type - READ-ONLY; Resource type for API Management resource.
2962	Type *string `json:"type,omitempty"`
2963}
2964
2965// MarshalJSON is the custom marshaler for DiagnosticContract.
2966func (dc DiagnosticContract) MarshalJSON() ([]byte, error) {
2967	objectMap := make(map[string]interface{})
2968	if dc.DiagnosticContractProperties != nil {
2969		objectMap["properties"] = dc.DiagnosticContractProperties
2970	}
2971	return json.Marshal(objectMap)
2972}
2973
2974// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct.
2975func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error {
2976	var m map[string]*json.RawMessage
2977	err := json.Unmarshal(body, &m)
2978	if err != nil {
2979		return err
2980	}
2981	for k, v := range m {
2982		switch k {
2983		case "properties":
2984			if v != nil {
2985				var diagnosticContractProperties DiagnosticContractProperties
2986				err = json.Unmarshal(*v, &diagnosticContractProperties)
2987				if err != nil {
2988					return err
2989				}
2990				dc.DiagnosticContractProperties = &diagnosticContractProperties
2991			}
2992		case "id":
2993			if v != nil {
2994				var ID string
2995				err = json.Unmarshal(*v, &ID)
2996				if err != nil {
2997					return err
2998				}
2999				dc.ID = &ID
3000			}
3001		case "name":
3002			if v != nil {
3003				var name string
3004				err = json.Unmarshal(*v, &name)
3005				if err != nil {
3006					return err
3007				}
3008				dc.Name = &name
3009			}
3010		case "type":
3011			if v != nil {
3012				var typeVar string
3013				err = json.Unmarshal(*v, &typeVar)
3014				if err != nil {
3015					return err
3016				}
3017				dc.Type = &typeVar
3018			}
3019		}
3020	}
3021
3022	return nil
3023}
3024
3025// DiagnosticContractProperties diagnostic Entity Properties
3026type DiagnosticContractProperties struct {
3027	// Enabled - Indicates whether a diagnostic should receive data or not.
3028	Enabled *bool `json:"enabled,omitempty"`
3029}
3030
3031// EmailTemplateCollection paged email template list representation.
3032type EmailTemplateCollection struct {
3033	autorest.Response `json:"-"`
3034	// Value - Page values.
3035	Value *[]EmailTemplateContract `json:"value,omitempty"`
3036	// NextLink - Next page link if any.
3037	NextLink *string `json:"nextLink,omitempty"`
3038}
3039
3040// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values.
3041type EmailTemplateCollectionIterator struct {
3042	i    int
3043	page EmailTemplateCollectionPage
3044}
3045
3046// NextWithContext advances to the next value.  If there was an error making
3047// the request the iterator does not advance and the error is returned.
3048func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3049	if tracing.IsEnabled() {
3050		ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext")
3051		defer func() {
3052			sc := -1
3053			if iter.Response().Response.Response != nil {
3054				sc = iter.Response().Response.Response.StatusCode
3055			}
3056			tracing.EndSpan(ctx, sc, err)
3057		}()
3058	}
3059	iter.i++
3060	if iter.i < len(iter.page.Values()) {
3061		return nil
3062	}
3063	err = iter.page.NextWithContext(ctx)
3064	if err != nil {
3065		iter.i--
3066		return err
3067	}
3068	iter.i = 0
3069	return nil
3070}
3071
3072// Next advances to the next value.  If there was an error making
3073// the request the iterator does not advance and the error is returned.
3074// Deprecated: Use NextWithContext() instead.
3075func (iter *EmailTemplateCollectionIterator) Next() error {
3076	return iter.NextWithContext(context.Background())
3077}
3078
3079// NotDone returns true if the enumeration should be started or is not yet complete.
3080func (iter EmailTemplateCollectionIterator) NotDone() bool {
3081	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3082}
3083
3084// Response returns the raw server response from the last page request.
3085func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection {
3086	return iter.page.Response()
3087}
3088
3089// Value returns the current value or a zero-initialized value if the
3090// iterator has advanced beyond the end of the collection.
3091func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract {
3092	if !iter.page.NotDone() {
3093		return EmailTemplateContract{}
3094	}
3095	return iter.page.Values()[iter.i]
3096}
3097
3098// Creates a new instance of the EmailTemplateCollectionIterator type.
3099func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator {
3100	return EmailTemplateCollectionIterator{page: page}
3101}
3102
3103// IsEmpty returns true if the ListResult contains no values.
3104func (etc EmailTemplateCollection) IsEmpty() bool {
3105	return etc.Value == nil || len(*etc.Value) == 0
3106}
3107
3108// hasNextLink returns true if the NextLink is not empty.
3109func (etc EmailTemplateCollection) hasNextLink() bool {
3110	return etc.NextLink != nil && len(*etc.NextLink) != 0
3111}
3112
3113// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results.
3114// It returns nil if no more results exist.
3115func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) {
3116	if !etc.hasNextLink() {
3117		return nil, nil
3118	}
3119	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3120		autorest.AsJSON(),
3121		autorest.AsGet(),
3122		autorest.WithBaseURL(to.String(etc.NextLink)))
3123}
3124
3125// EmailTemplateCollectionPage contains a page of EmailTemplateContract values.
3126type EmailTemplateCollectionPage struct {
3127	fn  func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)
3128	etc EmailTemplateCollection
3129}
3130
3131// NextWithContext advances to the next page of values.  If there was an error making
3132// the request the page does not advance and the error is returned.
3133func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) {
3134	if tracing.IsEnabled() {
3135		ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext")
3136		defer func() {
3137			sc := -1
3138			if page.Response().Response.Response != nil {
3139				sc = page.Response().Response.Response.StatusCode
3140			}
3141			tracing.EndSpan(ctx, sc, err)
3142		}()
3143	}
3144	for {
3145		next, err := page.fn(ctx, page.etc)
3146		if err != nil {
3147			return err
3148		}
3149		page.etc = next
3150		if !next.hasNextLink() || !next.IsEmpty() {
3151			break
3152		}
3153	}
3154	return nil
3155}
3156
3157// Next advances to the next page of values.  If there was an error making
3158// the request the page does not advance and the error is returned.
3159// Deprecated: Use NextWithContext() instead.
3160func (page *EmailTemplateCollectionPage) Next() error {
3161	return page.NextWithContext(context.Background())
3162}
3163
3164// NotDone returns true if the page enumeration should be started or is not yet complete.
3165func (page EmailTemplateCollectionPage) NotDone() bool {
3166	return !page.etc.IsEmpty()
3167}
3168
3169// Response returns the raw server response from the last page request.
3170func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection {
3171	return page.etc
3172}
3173
3174// Values returns the slice of values for the current page or nil if there are no values.
3175func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract {
3176	if page.etc.IsEmpty() {
3177		return nil
3178	}
3179	return *page.etc.Value
3180}
3181
3182// Creates a new instance of the EmailTemplateCollectionPage type.
3183func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage {
3184	return EmailTemplateCollectionPage{
3185		fn:  getNextPage,
3186		etc: cur,
3187	}
3188}
3189
3190// EmailTemplateContract email Template details.
3191type EmailTemplateContract struct {
3192	autorest.Response `json:"-"`
3193	// EmailTemplateContractProperties - Email Template entity contract properties.
3194	*EmailTemplateContractProperties `json:"properties,omitempty"`
3195	// ID - READ-ONLY; Resource ID.
3196	ID *string `json:"id,omitempty"`
3197	// Name - READ-ONLY; Resource name.
3198	Name *string `json:"name,omitempty"`
3199	// Type - READ-ONLY; Resource type for API Management resource.
3200	Type *string `json:"type,omitempty"`
3201}
3202
3203// MarshalJSON is the custom marshaler for EmailTemplateContract.
3204func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) {
3205	objectMap := make(map[string]interface{})
3206	if etc.EmailTemplateContractProperties != nil {
3207		objectMap["properties"] = etc.EmailTemplateContractProperties
3208	}
3209	return json.Marshal(objectMap)
3210}
3211
3212// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct.
3213func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error {
3214	var m map[string]*json.RawMessage
3215	err := json.Unmarshal(body, &m)
3216	if err != nil {
3217		return err
3218	}
3219	for k, v := range m {
3220		switch k {
3221		case "properties":
3222			if v != nil {
3223				var emailTemplateContractProperties EmailTemplateContractProperties
3224				err = json.Unmarshal(*v, &emailTemplateContractProperties)
3225				if err != nil {
3226					return err
3227				}
3228				etc.EmailTemplateContractProperties = &emailTemplateContractProperties
3229			}
3230		case "id":
3231			if v != nil {
3232				var ID string
3233				err = json.Unmarshal(*v, &ID)
3234				if err != nil {
3235					return err
3236				}
3237				etc.ID = &ID
3238			}
3239		case "name":
3240			if v != nil {
3241				var name string
3242				err = json.Unmarshal(*v, &name)
3243				if err != nil {
3244					return err
3245				}
3246				etc.Name = &name
3247			}
3248		case "type":
3249			if v != nil {
3250				var typeVar string
3251				err = json.Unmarshal(*v, &typeVar)
3252				if err != nil {
3253					return err
3254				}
3255				etc.Type = &typeVar
3256			}
3257		}
3258	}
3259
3260	return nil
3261}
3262
3263// EmailTemplateContractProperties email Template Contract properties.
3264type EmailTemplateContractProperties struct {
3265	// Subject - Subject of the Template.
3266	Subject *string `json:"subject,omitempty"`
3267	// Body - Email Template Body. This should be a valid XDocument
3268	Body *string `json:"body,omitempty"`
3269	// Title - Title of the Template.
3270	Title *string `json:"title,omitempty"`
3271	// Description - Description of the Email Template.
3272	Description *string `json:"description,omitempty"`
3273	// IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited.
3274	IsDefault *bool `json:"isDefault,omitempty"`
3275	// Parameters - Email Template Parameter values.
3276	Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"`
3277}
3278
3279// MarshalJSON is the custom marshaler for EmailTemplateContractProperties.
3280func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) {
3281	objectMap := make(map[string]interface{})
3282	if etcp.Subject != nil {
3283		objectMap["subject"] = etcp.Subject
3284	}
3285	if etcp.Body != nil {
3286		objectMap["body"] = etcp.Body
3287	}
3288	if etcp.Title != nil {
3289		objectMap["title"] = etcp.Title
3290	}
3291	if etcp.Description != nil {
3292		objectMap["description"] = etcp.Description
3293	}
3294	if etcp.Parameters != nil {
3295		objectMap["parameters"] = etcp.Parameters
3296	}
3297	return json.Marshal(objectMap)
3298}
3299
3300// EmailTemplateParametersContractProperties email Template Parameter contract.
3301type EmailTemplateParametersContractProperties struct {
3302	// Name - Template parameter name.
3303	Name *string `json:"name,omitempty"`
3304	// Title - Template parameter title.
3305	Title *string `json:"title,omitempty"`
3306	// Description - Template parameter description.
3307	Description *string `json:"description,omitempty"`
3308}
3309
3310// EmailTemplateUpdateParameterProperties email Template Update Contract properties.
3311type EmailTemplateUpdateParameterProperties struct {
3312	// Subject - Subject of the Template.
3313	Subject *string `json:"subject,omitempty"`
3314	// Title - Title of the Template.
3315	Title *string `json:"title,omitempty"`
3316	// Description - Description of the Email Template.
3317	Description *string `json:"description,omitempty"`
3318	// Body - Email Template Body. This should be a valid XDocument
3319	Body *string `json:"body,omitempty"`
3320	// Parameters - Email Template Parameter values.
3321	Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"`
3322}
3323
3324// EmailTemplateUpdateParameters email Template update Parameters.
3325type EmailTemplateUpdateParameters struct {
3326	// EmailTemplateUpdateParameterProperties - Email Template Update contract properties.
3327	*EmailTemplateUpdateParameterProperties `json:"properties,omitempty"`
3328}
3329
3330// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters.
3331func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) {
3332	objectMap := make(map[string]interface{})
3333	if etup.EmailTemplateUpdateParameterProperties != nil {
3334		objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties
3335	}
3336	return json.Marshal(objectMap)
3337}
3338
3339// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct.
3340func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error {
3341	var m map[string]*json.RawMessage
3342	err := json.Unmarshal(body, &m)
3343	if err != nil {
3344		return err
3345	}
3346	for k, v := range m {
3347		switch k {
3348		case "properties":
3349			if v != nil {
3350				var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties
3351				err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties)
3352				if err != nil {
3353					return err
3354				}
3355				etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties
3356			}
3357		}
3358	}
3359
3360	return nil
3361}
3362
3363// ErrorFieldContract error Field contract.
3364type ErrorFieldContract struct {
3365	// Code - Property level error code.
3366	Code *string `json:"code,omitempty"`
3367	// Message - Human-readable representation of property-level error.
3368	Message *string `json:"message,omitempty"`
3369	// Target - Property name.
3370	Target *string `json:"target,omitempty"`
3371}
3372
3373// ErrorResponse error Body contract.
3374type ErrorResponse struct {
3375	// Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
3376	Code *string `json:"code,omitempty"`
3377	// Message - Human-readable representation of the error.
3378	Message *string `json:"message,omitempty"`
3379	// Details - The list of invalid fields send in request, in case of validation error.
3380	Details *[]ErrorFieldContract `json:"details,omitempty"`
3381}
3382
3383// GenerateSsoURLResult generate SSO Url operations response details.
3384type GenerateSsoURLResult struct {
3385	autorest.Response `json:"-"`
3386	// Value - Redirect Url containing the SSO URL value.
3387	Value *string `json:"value,omitempty"`
3388}
3389
3390// GroupCollection paged Group list representation.
3391type GroupCollection struct {
3392	autorest.Response `json:"-"`
3393	// Value - Page values.
3394	Value *[]GroupContract `json:"value,omitempty"`
3395	// NextLink - Next page link if any.
3396	NextLink *string `json:"nextLink,omitempty"`
3397}
3398
3399// GroupCollectionIterator provides access to a complete listing of GroupContract values.
3400type GroupCollectionIterator struct {
3401	i    int
3402	page GroupCollectionPage
3403}
3404
3405// NextWithContext advances to the next value.  If there was an error making
3406// the request the iterator does not advance and the error is returned.
3407func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3408	if tracing.IsEnabled() {
3409		ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext")
3410		defer func() {
3411			sc := -1
3412			if iter.Response().Response.Response != nil {
3413				sc = iter.Response().Response.Response.StatusCode
3414			}
3415			tracing.EndSpan(ctx, sc, err)
3416		}()
3417	}
3418	iter.i++
3419	if iter.i < len(iter.page.Values()) {
3420		return nil
3421	}
3422	err = iter.page.NextWithContext(ctx)
3423	if err != nil {
3424		iter.i--
3425		return err
3426	}
3427	iter.i = 0
3428	return nil
3429}
3430
3431// Next advances to the next value.  If there was an error making
3432// the request the iterator does not advance and the error is returned.
3433// Deprecated: Use NextWithContext() instead.
3434func (iter *GroupCollectionIterator) Next() error {
3435	return iter.NextWithContext(context.Background())
3436}
3437
3438// NotDone returns true if the enumeration should be started or is not yet complete.
3439func (iter GroupCollectionIterator) NotDone() bool {
3440	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3441}
3442
3443// Response returns the raw server response from the last page request.
3444func (iter GroupCollectionIterator) Response() GroupCollection {
3445	return iter.page.Response()
3446}
3447
3448// Value returns the current value or a zero-initialized value if the
3449// iterator has advanced beyond the end of the collection.
3450func (iter GroupCollectionIterator) Value() GroupContract {
3451	if !iter.page.NotDone() {
3452		return GroupContract{}
3453	}
3454	return iter.page.Values()[iter.i]
3455}
3456
3457// Creates a new instance of the GroupCollectionIterator type.
3458func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator {
3459	return GroupCollectionIterator{page: page}
3460}
3461
3462// IsEmpty returns true if the ListResult contains no values.
3463func (gc GroupCollection) IsEmpty() bool {
3464	return gc.Value == nil || len(*gc.Value) == 0
3465}
3466
3467// hasNextLink returns true if the NextLink is not empty.
3468func (gc GroupCollection) hasNextLink() bool {
3469	return gc.NextLink != nil && len(*gc.NextLink) != 0
3470}
3471
3472// groupCollectionPreparer prepares a request to retrieve the next set of results.
3473// It returns nil if no more results exist.
3474func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) {
3475	if !gc.hasNextLink() {
3476		return nil, nil
3477	}
3478	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3479		autorest.AsJSON(),
3480		autorest.AsGet(),
3481		autorest.WithBaseURL(to.String(gc.NextLink)))
3482}
3483
3484// GroupCollectionPage contains a page of GroupContract values.
3485type GroupCollectionPage struct {
3486	fn func(context.Context, GroupCollection) (GroupCollection, error)
3487	gc GroupCollection
3488}
3489
3490// NextWithContext advances to the next page of values.  If there was an error making
3491// the request the page does not advance and the error is returned.
3492func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) {
3493	if tracing.IsEnabled() {
3494		ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext")
3495		defer func() {
3496			sc := -1
3497			if page.Response().Response.Response != nil {
3498				sc = page.Response().Response.Response.StatusCode
3499			}
3500			tracing.EndSpan(ctx, sc, err)
3501		}()
3502	}
3503	for {
3504		next, err := page.fn(ctx, page.gc)
3505		if err != nil {
3506			return err
3507		}
3508		page.gc = next
3509		if !next.hasNextLink() || !next.IsEmpty() {
3510			break
3511		}
3512	}
3513	return nil
3514}
3515
3516// Next advances to the next page of values.  If there was an error making
3517// the request the page does not advance and the error is returned.
3518// Deprecated: Use NextWithContext() instead.
3519func (page *GroupCollectionPage) Next() error {
3520	return page.NextWithContext(context.Background())
3521}
3522
3523// NotDone returns true if the page enumeration should be started or is not yet complete.
3524func (page GroupCollectionPage) NotDone() bool {
3525	return !page.gc.IsEmpty()
3526}
3527
3528// Response returns the raw server response from the last page request.
3529func (page GroupCollectionPage) Response() GroupCollection {
3530	return page.gc
3531}
3532
3533// Values returns the slice of values for the current page or nil if there are no values.
3534func (page GroupCollectionPage) Values() []GroupContract {
3535	if page.gc.IsEmpty() {
3536		return nil
3537	}
3538	return *page.gc.Value
3539}
3540
3541// Creates a new instance of the GroupCollectionPage type.
3542func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage {
3543	return GroupCollectionPage{
3544		fn: getNextPage,
3545		gc: cur,
3546	}
3547}
3548
3549// GroupContract contract details.
3550type GroupContract struct {
3551	autorest.Response `json:"-"`
3552	// GroupContractProperties - Group entity contract properties.
3553	*GroupContractProperties `json:"properties,omitempty"`
3554	// ID - READ-ONLY; Resource ID.
3555	ID *string `json:"id,omitempty"`
3556	// Name - READ-ONLY; Resource name.
3557	Name *string `json:"name,omitempty"`
3558	// Type - READ-ONLY; Resource type for API Management resource.
3559	Type *string `json:"type,omitempty"`
3560}
3561
3562// MarshalJSON is the custom marshaler for GroupContract.
3563func (gc GroupContract) MarshalJSON() ([]byte, error) {
3564	objectMap := make(map[string]interface{})
3565	if gc.GroupContractProperties != nil {
3566		objectMap["properties"] = gc.GroupContractProperties
3567	}
3568	return json.Marshal(objectMap)
3569}
3570
3571// UnmarshalJSON is the custom unmarshaler for GroupContract struct.
3572func (gc *GroupContract) UnmarshalJSON(body []byte) error {
3573	var m map[string]*json.RawMessage
3574	err := json.Unmarshal(body, &m)
3575	if err != nil {
3576		return err
3577	}
3578	for k, v := range m {
3579		switch k {
3580		case "properties":
3581			if v != nil {
3582				var groupContractProperties GroupContractProperties
3583				err = json.Unmarshal(*v, &groupContractProperties)
3584				if err != nil {
3585					return err
3586				}
3587				gc.GroupContractProperties = &groupContractProperties
3588			}
3589		case "id":
3590			if v != nil {
3591				var ID string
3592				err = json.Unmarshal(*v, &ID)
3593				if err != nil {
3594					return err
3595				}
3596				gc.ID = &ID
3597			}
3598		case "name":
3599			if v != nil {
3600				var name string
3601				err = json.Unmarshal(*v, &name)
3602				if err != nil {
3603					return err
3604				}
3605				gc.Name = &name
3606			}
3607		case "type":
3608			if v != nil {
3609				var typeVar string
3610				err = json.Unmarshal(*v, &typeVar)
3611				if err != nil {
3612					return err
3613				}
3614				gc.Type = &typeVar
3615			}
3616		}
3617	}
3618
3619	return nil
3620}
3621
3622// GroupContractProperties group contract Properties.
3623type GroupContractProperties struct {
3624	// DisplayName - Group name.
3625	DisplayName *string `json:"displayName,omitempty"`
3626	// Description - Group description. Can contain HTML formatting tags.
3627	Description *string `json:"description,omitempty"`
3628	// BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false.
3629	BuiltIn *bool `json:"builtIn,omitempty"`
3630	// Type - Group type. Possible values include: 'Custom', 'System', 'External'
3631	Type GroupType `json:"type,omitempty"`
3632	// ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise the value is null.
3633	ExternalID *string `json:"externalId,omitempty"`
3634}
3635
3636// MarshalJSON is the custom marshaler for GroupContractProperties.
3637func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) {
3638	objectMap := make(map[string]interface{})
3639	if gcp.DisplayName != nil {
3640		objectMap["displayName"] = gcp.DisplayName
3641	}
3642	if gcp.Description != nil {
3643		objectMap["description"] = gcp.Description
3644	}
3645	if gcp.Type != "" {
3646		objectMap["type"] = gcp.Type
3647	}
3648	if gcp.ExternalID != nil {
3649		objectMap["externalId"] = gcp.ExternalID
3650	}
3651	return json.Marshal(objectMap)
3652}
3653
3654// GroupCreateParameters parameters supplied to the Create Group operation.
3655type GroupCreateParameters struct {
3656	// GroupCreateParametersProperties - Properties supplied to Create Group operation.
3657	*GroupCreateParametersProperties `json:"properties,omitempty"`
3658}
3659
3660// MarshalJSON is the custom marshaler for GroupCreateParameters.
3661func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) {
3662	objectMap := make(map[string]interface{})
3663	if gcp.GroupCreateParametersProperties != nil {
3664		objectMap["properties"] = gcp.GroupCreateParametersProperties
3665	}
3666	return json.Marshal(objectMap)
3667}
3668
3669// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct.
3670func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error {
3671	var m map[string]*json.RawMessage
3672	err := json.Unmarshal(body, &m)
3673	if err != nil {
3674		return err
3675	}
3676	for k, v := range m {
3677		switch k {
3678		case "properties":
3679			if v != nil {
3680				var groupCreateParametersProperties GroupCreateParametersProperties
3681				err = json.Unmarshal(*v, &groupCreateParametersProperties)
3682				if err != nil {
3683					return err
3684				}
3685				gcp.GroupCreateParametersProperties = &groupCreateParametersProperties
3686			}
3687		}
3688	}
3689
3690	return nil
3691}
3692
3693// GroupCreateParametersProperties parameters supplied to the Create Group operation.
3694type GroupCreateParametersProperties struct {
3695	// DisplayName - Group name.
3696	DisplayName *string `json:"displayName,omitempty"`
3697	// Description - Group description.
3698	Description *string `json:"description,omitempty"`
3699	// Type - Group type. Possible values include: 'Custom', 'System', 'External'
3700	Type GroupType `json:"type,omitempty"`
3701	// ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise the value is null.
3702	ExternalID *string `json:"externalId,omitempty"`
3703}
3704
3705// GroupUpdateParameters parameters supplied to the Update Group operation.
3706type GroupUpdateParameters struct {
3707	// GroupUpdateParametersProperties - Group entity update contract properties.
3708	*GroupUpdateParametersProperties `json:"properties,omitempty"`
3709}
3710
3711// MarshalJSON is the custom marshaler for GroupUpdateParameters.
3712func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) {
3713	objectMap := make(map[string]interface{})
3714	if gup.GroupUpdateParametersProperties != nil {
3715		objectMap["properties"] = gup.GroupUpdateParametersProperties
3716	}
3717	return json.Marshal(objectMap)
3718}
3719
3720// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct.
3721func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error {
3722	var m map[string]*json.RawMessage
3723	err := json.Unmarshal(body, &m)
3724	if err != nil {
3725		return err
3726	}
3727	for k, v := range m {
3728		switch k {
3729		case "properties":
3730			if v != nil {
3731				var groupUpdateParametersProperties GroupUpdateParametersProperties
3732				err = json.Unmarshal(*v, &groupUpdateParametersProperties)
3733				if err != nil {
3734					return err
3735				}
3736				gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties
3737			}
3738		}
3739	}
3740
3741	return nil
3742}
3743
3744// GroupUpdateParametersProperties parameters supplied to the Update Group operation.
3745type GroupUpdateParametersProperties struct {
3746	// DisplayName - Group name.
3747	DisplayName *string `json:"displayName,omitempty"`
3748	// Description - Group description.
3749	Description *string `json:"description,omitempty"`
3750	// Type - Group type. Possible values include: 'Custom', 'System', 'External'
3751	Type GroupType `json:"type,omitempty"`
3752	// ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise the value is null.
3753	ExternalID *string `json:"externalId,omitempty"`
3754}
3755
3756// HostnameConfiguration custom hostname configuration.
3757type HostnameConfiguration struct {
3758	// Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm'
3759	Type HostnameType `json:"type,omitempty"`
3760	// HostName - Hostname to configure on the Api Management service.
3761	HostName *string `json:"hostName,omitempty"`
3762	// KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with MSI. The secret should be of type *application/x-pkcs12*
3763	KeyVaultID *string `json:"keyVaultId,omitempty"`
3764	// EncodedCertificate - Base64 Encoded certificate.
3765	EncodedCertificate *string `json:"encodedCertificate,omitempty"`
3766	// CertificatePassword - Certificate Password.
3767	CertificatePassword *string `json:"certificatePassword,omitempty"`
3768	// DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type.
3769	DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"`
3770	// NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false.
3771	NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"`
3772	// Certificate - READ-ONLY; Certificate information.
3773	Certificate *CertificateInformation `json:"certificate,omitempty"`
3774}
3775
3776// MarshalJSON is the custom marshaler for HostnameConfiguration.
3777func (hc HostnameConfiguration) MarshalJSON() ([]byte, error) {
3778	objectMap := make(map[string]interface{})
3779	if hc.Type != "" {
3780		objectMap["type"] = hc.Type
3781	}
3782	if hc.HostName != nil {
3783		objectMap["hostName"] = hc.HostName
3784	}
3785	if hc.KeyVaultID != nil {
3786		objectMap["keyVaultId"] = hc.KeyVaultID
3787	}
3788	if hc.EncodedCertificate != nil {
3789		objectMap["encodedCertificate"] = hc.EncodedCertificate
3790	}
3791	if hc.CertificatePassword != nil {
3792		objectMap["certificatePassword"] = hc.CertificatePassword
3793	}
3794	if hc.DefaultSslBinding != nil {
3795		objectMap["defaultSslBinding"] = hc.DefaultSslBinding
3796	}
3797	if hc.NegotiateClientCertificate != nil {
3798		objectMap["negotiateClientCertificate"] = hc.NegotiateClientCertificate
3799	}
3800	return json.Marshal(objectMap)
3801}
3802
3803// HostnameConfigurationOld custom hostname configuration.
3804type HostnameConfigurationOld struct {
3805	// Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm'
3806	Type HostnameType `json:"type,omitempty"`
3807	// Hostname - Hostname to configure.
3808	Hostname *string `json:"hostname,omitempty"`
3809	// Certificate - Certificate information.
3810	Certificate *CertificateInformation `json:"certificate,omitempty"`
3811}
3812
3813// IdentityProviderBaseParameters identity Provider Base Parameter Properties.
3814type IdentityProviderBaseParameters struct {
3815	// Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C'
3816	Type IdentityProviderType `json:"type,omitempty"`
3817	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
3818	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
3819	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
3820	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
3821	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
3822	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
3823	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
3824	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
3825	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
3826	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
3827}
3828
3829// IdentityProviderContract identity Provider details.
3830type IdentityProviderContract struct {
3831	autorest.Response `json:"-"`
3832	// IdentityProviderContractProperties - Identity Provider contract properties.
3833	*IdentityProviderContractProperties `json:"properties,omitempty"`
3834	// ID - READ-ONLY; Resource ID.
3835	ID *string `json:"id,omitempty"`
3836	// Name - READ-ONLY; Resource name.
3837	Name *string `json:"name,omitempty"`
3838	// Type - READ-ONLY; Resource type for API Management resource.
3839	Type *string `json:"type,omitempty"`
3840}
3841
3842// MarshalJSON is the custom marshaler for IdentityProviderContract.
3843func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) {
3844	objectMap := make(map[string]interface{})
3845	if ipc.IdentityProviderContractProperties != nil {
3846		objectMap["properties"] = ipc.IdentityProviderContractProperties
3847	}
3848	return json.Marshal(objectMap)
3849}
3850
3851// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct.
3852func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error {
3853	var m map[string]*json.RawMessage
3854	err := json.Unmarshal(body, &m)
3855	if err != nil {
3856		return err
3857	}
3858	for k, v := range m {
3859		switch k {
3860		case "properties":
3861			if v != nil {
3862				var identityProviderContractProperties IdentityProviderContractProperties
3863				err = json.Unmarshal(*v, &identityProviderContractProperties)
3864				if err != nil {
3865					return err
3866				}
3867				ipc.IdentityProviderContractProperties = &identityProviderContractProperties
3868			}
3869		case "id":
3870			if v != nil {
3871				var ID string
3872				err = json.Unmarshal(*v, &ID)
3873				if err != nil {
3874					return err
3875				}
3876				ipc.ID = &ID
3877			}
3878		case "name":
3879			if v != nil {
3880				var name string
3881				err = json.Unmarshal(*v, &name)
3882				if err != nil {
3883					return err
3884				}
3885				ipc.Name = &name
3886			}
3887		case "type":
3888			if v != nil {
3889				var typeVar string
3890				err = json.Unmarshal(*v, &typeVar)
3891				if err != nil {
3892					return err
3893				}
3894				ipc.Type = &typeVar
3895			}
3896		}
3897	}
3898
3899	return nil
3900}
3901
3902// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft,
3903// Twitter or Azure Active Directory which can be used to enable access to the API Management service
3904// developer portal for all users.
3905type IdentityProviderContractProperties struct {
3906	// ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.
3907	ClientID *string `json:"clientId,omitempty"`
3908	// ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft.
3909	ClientSecret *string `json:"clientSecret,omitempty"`
3910	// Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C'
3911	Type IdentityProviderType `json:"type,omitempty"`
3912	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
3913	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
3914	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
3915	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
3916	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
3917	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
3918	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
3919	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
3920	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
3921	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
3922}
3923
3924// IdentityProviderList list of all the Identity Providers configured on the service instance.
3925type IdentityProviderList struct {
3926	autorest.Response `json:"-"`
3927	// Value - Identity Provider configuration values.
3928	Value *[]IdentityProviderContract `json:"value,omitempty"`
3929	// NextLink - Next page link if any.
3930	NextLink *string `json:"nextLink,omitempty"`
3931}
3932
3933// IdentityProviderUpdateParameters parameters supplied to update Identity Provider
3934type IdentityProviderUpdateParameters struct {
3935	// IdentityProviderUpdateProperties - Identity Provider update properties.
3936	*IdentityProviderUpdateProperties `json:"properties,omitempty"`
3937}
3938
3939// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters.
3940func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) {
3941	objectMap := make(map[string]interface{})
3942	if ipup.IdentityProviderUpdateProperties != nil {
3943		objectMap["properties"] = ipup.IdentityProviderUpdateProperties
3944	}
3945	return json.Marshal(objectMap)
3946}
3947
3948// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct.
3949func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error {
3950	var m map[string]*json.RawMessage
3951	err := json.Unmarshal(body, &m)
3952	if err != nil {
3953		return err
3954	}
3955	for k, v := range m {
3956		switch k {
3957		case "properties":
3958			if v != nil {
3959				var identityProviderUpdateProperties IdentityProviderUpdateProperties
3960				err = json.Unmarshal(*v, &identityProviderUpdateProperties)
3961				if err != nil {
3962					return err
3963				}
3964				ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties
3965			}
3966		}
3967	}
3968
3969	return nil
3970}
3971
3972// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation.
3973type IdentityProviderUpdateProperties struct {
3974	// ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft.
3975	ClientID *string `json:"clientId,omitempty"`
3976	// ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft.
3977	ClientSecret *string `json:"clientSecret,omitempty"`
3978	// Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C'
3979	Type IdentityProviderType `json:"type,omitempty"`
3980	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
3981	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
3982	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
3983	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
3984	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
3985	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
3986	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
3987	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
3988	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
3989	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
3990}
3991
3992// IssueAttachmentCollection paged Issue Attachment list representation.
3993type IssueAttachmentCollection struct {
3994	autorest.Response `json:"-"`
3995	// Value - READ-ONLY; Issue Attachment values.
3996	Value *[]IssueAttachmentContract `json:"value,omitempty"`
3997	// NextLink - READ-ONLY; Next page link if any.
3998	NextLink *string `json:"nextLink,omitempty"`
3999}
4000
4001// MarshalJSON is the custom marshaler for IssueAttachmentCollection.
4002func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) {
4003	objectMap := make(map[string]interface{})
4004	return json.Marshal(objectMap)
4005}
4006
4007// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract
4008// values.
4009type IssueAttachmentCollectionIterator struct {
4010	i    int
4011	page IssueAttachmentCollectionPage
4012}
4013
4014// NextWithContext advances to the next value.  If there was an error making
4015// the request the iterator does not advance and the error is returned.
4016func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4017	if tracing.IsEnabled() {
4018		ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext")
4019		defer func() {
4020			sc := -1
4021			if iter.Response().Response.Response != nil {
4022				sc = iter.Response().Response.Response.StatusCode
4023			}
4024			tracing.EndSpan(ctx, sc, err)
4025		}()
4026	}
4027	iter.i++
4028	if iter.i < len(iter.page.Values()) {
4029		return nil
4030	}
4031	err = iter.page.NextWithContext(ctx)
4032	if err != nil {
4033		iter.i--
4034		return err
4035	}
4036	iter.i = 0
4037	return nil
4038}
4039
4040// Next advances to the next value.  If there was an error making
4041// the request the iterator does not advance and the error is returned.
4042// Deprecated: Use NextWithContext() instead.
4043func (iter *IssueAttachmentCollectionIterator) Next() error {
4044	return iter.NextWithContext(context.Background())
4045}
4046
4047// NotDone returns true if the enumeration should be started or is not yet complete.
4048func (iter IssueAttachmentCollectionIterator) NotDone() bool {
4049	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4050}
4051
4052// Response returns the raw server response from the last page request.
4053func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection {
4054	return iter.page.Response()
4055}
4056
4057// Value returns the current value or a zero-initialized value if the
4058// iterator has advanced beyond the end of the collection.
4059func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract {
4060	if !iter.page.NotDone() {
4061		return IssueAttachmentContract{}
4062	}
4063	return iter.page.Values()[iter.i]
4064}
4065
4066// Creates a new instance of the IssueAttachmentCollectionIterator type.
4067func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator {
4068	return IssueAttachmentCollectionIterator{page: page}
4069}
4070
4071// IsEmpty returns true if the ListResult contains no values.
4072func (iac IssueAttachmentCollection) IsEmpty() bool {
4073	return iac.Value == nil || len(*iac.Value) == 0
4074}
4075
4076// hasNextLink returns true if the NextLink is not empty.
4077func (iac IssueAttachmentCollection) hasNextLink() bool {
4078	return iac.NextLink != nil && len(*iac.NextLink) != 0
4079}
4080
4081// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results.
4082// It returns nil if no more results exist.
4083func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) {
4084	if !iac.hasNextLink() {
4085		return nil, nil
4086	}
4087	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4088		autorest.AsJSON(),
4089		autorest.AsGet(),
4090		autorest.WithBaseURL(to.String(iac.NextLink)))
4091}
4092
4093// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values.
4094type IssueAttachmentCollectionPage struct {
4095	fn  func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)
4096	iac IssueAttachmentCollection
4097}
4098
4099// NextWithContext advances to the next page of values.  If there was an error making
4100// the request the page does not advance and the error is returned.
4101func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) {
4102	if tracing.IsEnabled() {
4103		ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext")
4104		defer func() {
4105			sc := -1
4106			if page.Response().Response.Response != nil {
4107				sc = page.Response().Response.Response.StatusCode
4108			}
4109			tracing.EndSpan(ctx, sc, err)
4110		}()
4111	}
4112	for {
4113		next, err := page.fn(ctx, page.iac)
4114		if err != nil {
4115			return err
4116		}
4117		page.iac = next
4118		if !next.hasNextLink() || !next.IsEmpty() {
4119			break
4120		}
4121	}
4122	return nil
4123}
4124
4125// Next advances to the next page of values.  If there was an error making
4126// the request the page does not advance and the error is returned.
4127// Deprecated: Use NextWithContext() instead.
4128func (page *IssueAttachmentCollectionPage) Next() error {
4129	return page.NextWithContext(context.Background())
4130}
4131
4132// NotDone returns true if the page enumeration should be started or is not yet complete.
4133func (page IssueAttachmentCollectionPage) NotDone() bool {
4134	return !page.iac.IsEmpty()
4135}
4136
4137// Response returns the raw server response from the last page request.
4138func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection {
4139	return page.iac
4140}
4141
4142// Values returns the slice of values for the current page or nil if there are no values.
4143func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract {
4144	if page.iac.IsEmpty() {
4145		return nil
4146	}
4147	return *page.iac.Value
4148}
4149
4150// Creates a new instance of the IssueAttachmentCollectionPage type.
4151func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage {
4152	return IssueAttachmentCollectionPage{
4153		fn:  getNextPage,
4154		iac: cur,
4155	}
4156}
4157
4158// IssueAttachmentContract issue Attachment Contract details.
4159type IssueAttachmentContract struct {
4160	autorest.Response `json:"-"`
4161	// IssueAttachmentContractProperties - Properties of the Issue Attachment.
4162	*IssueAttachmentContractProperties `json:"properties,omitempty"`
4163	// ID - READ-ONLY; Resource ID.
4164	ID *string `json:"id,omitempty"`
4165	// Name - READ-ONLY; Resource name.
4166	Name *string `json:"name,omitempty"`
4167	// Type - READ-ONLY; Resource type for API Management resource.
4168	Type *string `json:"type,omitempty"`
4169}
4170
4171// MarshalJSON is the custom marshaler for IssueAttachmentContract.
4172func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) {
4173	objectMap := make(map[string]interface{})
4174	if iac.IssueAttachmentContractProperties != nil {
4175		objectMap["properties"] = iac.IssueAttachmentContractProperties
4176	}
4177	return json.Marshal(objectMap)
4178}
4179
4180// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct.
4181func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error {
4182	var m map[string]*json.RawMessage
4183	err := json.Unmarshal(body, &m)
4184	if err != nil {
4185		return err
4186	}
4187	for k, v := range m {
4188		switch k {
4189		case "properties":
4190			if v != nil {
4191				var issueAttachmentContractProperties IssueAttachmentContractProperties
4192				err = json.Unmarshal(*v, &issueAttachmentContractProperties)
4193				if err != nil {
4194					return err
4195				}
4196				iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties
4197			}
4198		case "id":
4199			if v != nil {
4200				var ID string
4201				err = json.Unmarshal(*v, &ID)
4202				if err != nil {
4203					return err
4204				}
4205				iac.ID = &ID
4206			}
4207		case "name":
4208			if v != nil {
4209				var name string
4210				err = json.Unmarshal(*v, &name)
4211				if err != nil {
4212					return err
4213				}
4214				iac.Name = &name
4215			}
4216		case "type":
4217			if v != nil {
4218				var typeVar string
4219				err = json.Unmarshal(*v, &typeVar)
4220				if err != nil {
4221					return err
4222				}
4223				iac.Type = &typeVar
4224			}
4225		}
4226	}
4227
4228	return nil
4229}
4230
4231// IssueAttachmentContractProperties issue Attachment contract Properties.
4232type IssueAttachmentContractProperties struct {
4233	// Title - Filename by which the binary data will be saved.
4234	Title *string `json:"title,omitempty"`
4235	// ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property.
4236	ContentFormat *string `json:"contentFormat,omitempty"`
4237	// Content - An HTTP link or Base64-encoded binary data.
4238	Content *string `json:"content,omitempty"`
4239}
4240
4241// IssueCollection paged Issue list representation.
4242type IssueCollection struct {
4243	autorest.Response `json:"-"`
4244	// Value - READ-ONLY; Issue values.
4245	Value *[]IssueContract `json:"value,omitempty"`
4246	// NextLink - READ-ONLY; Next page link if any.
4247	NextLink *string `json:"nextLink,omitempty"`
4248}
4249
4250// MarshalJSON is the custom marshaler for IssueCollection.
4251func (ic IssueCollection) MarshalJSON() ([]byte, error) {
4252	objectMap := make(map[string]interface{})
4253	return json.Marshal(objectMap)
4254}
4255
4256// IssueCollectionIterator provides access to a complete listing of IssueContract values.
4257type IssueCollectionIterator struct {
4258	i    int
4259	page IssueCollectionPage
4260}
4261
4262// NextWithContext advances to the next value.  If there was an error making
4263// the request the iterator does not advance and the error is returned.
4264func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4265	if tracing.IsEnabled() {
4266		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext")
4267		defer func() {
4268			sc := -1
4269			if iter.Response().Response.Response != nil {
4270				sc = iter.Response().Response.Response.StatusCode
4271			}
4272			tracing.EndSpan(ctx, sc, err)
4273		}()
4274	}
4275	iter.i++
4276	if iter.i < len(iter.page.Values()) {
4277		return nil
4278	}
4279	err = iter.page.NextWithContext(ctx)
4280	if err != nil {
4281		iter.i--
4282		return err
4283	}
4284	iter.i = 0
4285	return nil
4286}
4287
4288// Next advances to the next value.  If there was an error making
4289// the request the iterator does not advance and the error is returned.
4290// Deprecated: Use NextWithContext() instead.
4291func (iter *IssueCollectionIterator) Next() error {
4292	return iter.NextWithContext(context.Background())
4293}
4294
4295// NotDone returns true if the enumeration should be started or is not yet complete.
4296func (iter IssueCollectionIterator) NotDone() bool {
4297	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4298}
4299
4300// Response returns the raw server response from the last page request.
4301func (iter IssueCollectionIterator) Response() IssueCollection {
4302	return iter.page.Response()
4303}
4304
4305// Value returns the current value or a zero-initialized value if the
4306// iterator has advanced beyond the end of the collection.
4307func (iter IssueCollectionIterator) Value() IssueContract {
4308	if !iter.page.NotDone() {
4309		return IssueContract{}
4310	}
4311	return iter.page.Values()[iter.i]
4312}
4313
4314// Creates a new instance of the IssueCollectionIterator type.
4315func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator {
4316	return IssueCollectionIterator{page: page}
4317}
4318
4319// IsEmpty returns true if the ListResult contains no values.
4320func (ic IssueCollection) IsEmpty() bool {
4321	return ic.Value == nil || len(*ic.Value) == 0
4322}
4323
4324// hasNextLink returns true if the NextLink is not empty.
4325func (ic IssueCollection) hasNextLink() bool {
4326	return ic.NextLink != nil && len(*ic.NextLink) != 0
4327}
4328
4329// issueCollectionPreparer prepares a request to retrieve the next set of results.
4330// It returns nil if no more results exist.
4331func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) {
4332	if !ic.hasNextLink() {
4333		return nil, nil
4334	}
4335	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4336		autorest.AsJSON(),
4337		autorest.AsGet(),
4338		autorest.WithBaseURL(to.String(ic.NextLink)))
4339}
4340
4341// IssueCollectionPage contains a page of IssueContract values.
4342type IssueCollectionPage struct {
4343	fn func(context.Context, IssueCollection) (IssueCollection, error)
4344	ic IssueCollection
4345}
4346
4347// NextWithContext advances to the next page of values.  If there was an error making
4348// the request the page does not advance and the error is returned.
4349func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) {
4350	if tracing.IsEnabled() {
4351		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext")
4352		defer func() {
4353			sc := -1
4354			if page.Response().Response.Response != nil {
4355				sc = page.Response().Response.Response.StatusCode
4356			}
4357			tracing.EndSpan(ctx, sc, err)
4358		}()
4359	}
4360	for {
4361		next, err := page.fn(ctx, page.ic)
4362		if err != nil {
4363			return err
4364		}
4365		page.ic = next
4366		if !next.hasNextLink() || !next.IsEmpty() {
4367			break
4368		}
4369	}
4370	return nil
4371}
4372
4373// Next advances to the next page of values.  If there was an error making
4374// the request the page does not advance and the error is returned.
4375// Deprecated: Use NextWithContext() instead.
4376func (page *IssueCollectionPage) Next() error {
4377	return page.NextWithContext(context.Background())
4378}
4379
4380// NotDone returns true if the page enumeration should be started or is not yet complete.
4381func (page IssueCollectionPage) NotDone() bool {
4382	return !page.ic.IsEmpty()
4383}
4384
4385// Response returns the raw server response from the last page request.
4386func (page IssueCollectionPage) Response() IssueCollection {
4387	return page.ic
4388}
4389
4390// Values returns the slice of values for the current page or nil if there are no values.
4391func (page IssueCollectionPage) Values() []IssueContract {
4392	if page.ic.IsEmpty() {
4393		return nil
4394	}
4395	return *page.ic.Value
4396}
4397
4398// Creates a new instance of the IssueCollectionPage type.
4399func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage {
4400	return IssueCollectionPage{
4401		fn: getNextPage,
4402		ic: cur,
4403	}
4404}
4405
4406// IssueCommentCollection paged Issue Comment list representation.
4407type IssueCommentCollection struct {
4408	autorest.Response `json:"-"`
4409	// Value - READ-ONLY; Issue Comment values.
4410	Value *[]IssueCommentContract `json:"value,omitempty"`
4411	// NextLink - READ-ONLY; Next page link if any.
4412	NextLink *string `json:"nextLink,omitempty"`
4413}
4414
4415// MarshalJSON is the custom marshaler for IssueCommentCollection.
4416func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) {
4417	objectMap := make(map[string]interface{})
4418	return json.Marshal(objectMap)
4419}
4420
4421// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values.
4422type IssueCommentCollectionIterator struct {
4423	i    int
4424	page IssueCommentCollectionPage
4425}
4426
4427// NextWithContext advances to the next value.  If there was an error making
4428// the request the iterator does not advance and the error is returned.
4429func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4430	if tracing.IsEnabled() {
4431		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext")
4432		defer func() {
4433			sc := -1
4434			if iter.Response().Response.Response != nil {
4435				sc = iter.Response().Response.Response.StatusCode
4436			}
4437			tracing.EndSpan(ctx, sc, err)
4438		}()
4439	}
4440	iter.i++
4441	if iter.i < len(iter.page.Values()) {
4442		return nil
4443	}
4444	err = iter.page.NextWithContext(ctx)
4445	if err != nil {
4446		iter.i--
4447		return err
4448	}
4449	iter.i = 0
4450	return nil
4451}
4452
4453// Next advances to the next value.  If there was an error making
4454// the request the iterator does not advance and the error is returned.
4455// Deprecated: Use NextWithContext() instead.
4456func (iter *IssueCommentCollectionIterator) Next() error {
4457	return iter.NextWithContext(context.Background())
4458}
4459
4460// NotDone returns true if the enumeration should be started or is not yet complete.
4461func (iter IssueCommentCollectionIterator) NotDone() bool {
4462	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4463}
4464
4465// Response returns the raw server response from the last page request.
4466func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection {
4467	return iter.page.Response()
4468}
4469
4470// Value returns the current value or a zero-initialized value if the
4471// iterator has advanced beyond the end of the collection.
4472func (iter IssueCommentCollectionIterator) Value() IssueCommentContract {
4473	if !iter.page.NotDone() {
4474		return IssueCommentContract{}
4475	}
4476	return iter.page.Values()[iter.i]
4477}
4478
4479// Creates a new instance of the IssueCommentCollectionIterator type.
4480func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator {
4481	return IssueCommentCollectionIterator{page: page}
4482}
4483
4484// IsEmpty returns true if the ListResult contains no values.
4485func (icc IssueCommentCollection) IsEmpty() bool {
4486	return icc.Value == nil || len(*icc.Value) == 0
4487}
4488
4489// hasNextLink returns true if the NextLink is not empty.
4490func (icc IssueCommentCollection) hasNextLink() bool {
4491	return icc.NextLink != nil && len(*icc.NextLink) != 0
4492}
4493
4494// issueCommentCollectionPreparer prepares a request to retrieve the next set of results.
4495// It returns nil if no more results exist.
4496func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) {
4497	if !icc.hasNextLink() {
4498		return nil, nil
4499	}
4500	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4501		autorest.AsJSON(),
4502		autorest.AsGet(),
4503		autorest.WithBaseURL(to.String(icc.NextLink)))
4504}
4505
4506// IssueCommentCollectionPage contains a page of IssueCommentContract values.
4507type IssueCommentCollectionPage struct {
4508	fn  func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)
4509	icc IssueCommentCollection
4510}
4511
4512// NextWithContext advances to the next page of values.  If there was an error making
4513// the request the page does not advance and the error is returned.
4514func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) {
4515	if tracing.IsEnabled() {
4516		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext")
4517		defer func() {
4518			sc := -1
4519			if page.Response().Response.Response != nil {
4520				sc = page.Response().Response.Response.StatusCode
4521			}
4522			tracing.EndSpan(ctx, sc, err)
4523		}()
4524	}
4525	for {
4526		next, err := page.fn(ctx, page.icc)
4527		if err != nil {
4528			return err
4529		}
4530		page.icc = next
4531		if !next.hasNextLink() || !next.IsEmpty() {
4532			break
4533		}
4534	}
4535	return nil
4536}
4537
4538// Next advances to the next page of values.  If there was an error making
4539// the request the page does not advance and the error is returned.
4540// Deprecated: Use NextWithContext() instead.
4541func (page *IssueCommentCollectionPage) Next() error {
4542	return page.NextWithContext(context.Background())
4543}
4544
4545// NotDone returns true if the page enumeration should be started or is not yet complete.
4546func (page IssueCommentCollectionPage) NotDone() bool {
4547	return !page.icc.IsEmpty()
4548}
4549
4550// Response returns the raw server response from the last page request.
4551func (page IssueCommentCollectionPage) Response() IssueCommentCollection {
4552	return page.icc
4553}
4554
4555// Values returns the slice of values for the current page or nil if there are no values.
4556func (page IssueCommentCollectionPage) Values() []IssueCommentContract {
4557	if page.icc.IsEmpty() {
4558		return nil
4559	}
4560	return *page.icc.Value
4561}
4562
4563// Creates a new instance of the IssueCommentCollectionPage type.
4564func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage {
4565	return IssueCommentCollectionPage{
4566		fn:  getNextPage,
4567		icc: cur,
4568	}
4569}
4570
4571// IssueCommentContract issue Comment Contract details.
4572type IssueCommentContract struct {
4573	autorest.Response `json:"-"`
4574	// IssueCommentContractProperties - Properties of the Issue Comment.
4575	*IssueCommentContractProperties `json:"properties,omitempty"`
4576	// ID - READ-ONLY; Resource ID.
4577	ID *string `json:"id,omitempty"`
4578	// Name - READ-ONLY; Resource name.
4579	Name *string `json:"name,omitempty"`
4580	// Type - READ-ONLY; Resource type for API Management resource.
4581	Type *string `json:"type,omitempty"`
4582}
4583
4584// MarshalJSON is the custom marshaler for IssueCommentContract.
4585func (icc IssueCommentContract) MarshalJSON() ([]byte, error) {
4586	objectMap := make(map[string]interface{})
4587	if icc.IssueCommentContractProperties != nil {
4588		objectMap["properties"] = icc.IssueCommentContractProperties
4589	}
4590	return json.Marshal(objectMap)
4591}
4592
4593// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct.
4594func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error {
4595	var m map[string]*json.RawMessage
4596	err := json.Unmarshal(body, &m)
4597	if err != nil {
4598		return err
4599	}
4600	for k, v := range m {
4601		switch k {
4602		case "properties":
4603			if v != nil {
4604				var issueCommentContractProperties IssueCommentContractProperties
4605				err = json.Unmarshal(*v, &issueCommentContractProperties)
4606				if err != nil {
4607					return err
4608				}
4609				icc.IssueCommentContractProperties = &issueCommentContractProperties
4610			}
4611		case "id":
4612			if v != nil {
4613				var ID string
4614				err = json.Unmarshal(*v, &ID)
4615				if err != nil {
4616					return err
4617				}
4618				icc.ID = &ID
4619			}
4620		case "name":
4621			if v != nil {
4622				var name string
4623				err = json.Unmarshal(*v, &name)
4624				if err != nil {
4625					return err
4626				}
4627				icc.Name = &name
4628			}
4629		case "type":
4630			if v != nil {
4631				var typeVar string
4632				err = json.Unmarshal(*v, &typeVar)
4633				if err != nil {
4634					return err
4635				}
4636				icc.Type = &typeVar
4637			}
4638		}
4639	}
4640
4641	return nil
4642}
4643
4644// IssueCommentContractProperties issue Comment contract Properties.
4645type IssueCommentContractProperties struct {
4646	// Text - Comment text.
4647	Text *string `json:"text,omitempty"`
4648	// CreatedDate - Date and time when the comment was created.
4649	CreatedDate *date.Time `json:"createdDate,omitempty"`
4650	// UserID - A resource identifier for the user who left the comment.
4651	UserID *string `json:"userId,omitempty"`
4652}
4653
4654// IssueContract issue Contract details.
4655type IssueContract struct {
4656	autorest.Response `json:"-"`
4657	// IssueContractProperties - Properties of the Issue.
4658	*IssueContractProperties `json:"properties,omitempty"`
4659	// ID - READ-ONLY; Resource ID.
4660	ID *string `json:"id,omitempty"`
4661	// Name - READ-ONLY; Resource name.
4662	Name *string `json:"name,omitempty"`
4663	// Type - READ-ONLY; Resource type for API Management resource.
4664	Type *string `json:"type,omitempty"`
4665}
4666
4667// MarshalJSON is the custom marshaler for IssueContract.
4668func (ic IssueContract) MarshalJSON() ([]byte, error) {
4669	objectMap := make(map[string]interface{})
4670	if ic.IssueContractProperties != nil {
4671		objectMap["properties"] = ic.IssueContractProperties
4672	}
4673	return json.Marshal(objectMap)
4674}
4675
4676// UnmarshalJSON is the custom unmarshaler for IssueContract struct.
4677func (ic *IssueContract) UnmarshalJSON(body []byte) error {
4678	var m map[string]*json.RawMessage
4679	err := json.Unmarshal(body, &m)
4680	if err != nil {
4681		return err
4682	}
4683	for k, v := range m {
4684		switch k {
4685		case "properties":
4686			if v != nil {
4687				var issueContractProperties IssueContractProperties
4688				err = json.Unmarshal(*v, &issueContractProperties)
4689				if err != nil {
4690					return err
4691				}
4692				ic.IssueContractProperties = &issueContractProperties
4693			}
4694		case "id":
4695			if v != nil {
4696				var ID string
4697				err = json.Unmarshal(*v, &ID)
4698				if err != nil {
4699					return err
4700				}
4701				ic.ID = &ID
4702			}
4703		case "name":
4704			if v != nil {
4705				var name string
4706				err = json.Unmarshal(*v, &name)
4707				if err != nil {
4708					return err
4709				}
4710				ic.Name = &name
4711			}
4712		case "type":
4713			if v != nil {
4714				var typeVar string
4715				err = json.Unmarshal(*v, &typeVar)
4716				if err != nil {
4717					return err
4718				}
4719				ic.Type = &typeVar
4720			}
4721		}
4722	}
4723
4724	return nil
4725}
4726
4727// IssueContractProperties issue contract Properties.
4728type IssueContractProperties struct {
4729	// Title - The issue title.
4730	Title *string `json:"title,omitempty"`
4731	// Description - Text describing the issue.
4732	Description *string `json:"description,omitempty"`
4733	// CreatedDate - Date and time when the issue was created.
4734	CreatedDate *date.Time `json:"createdDate,omitempty"`
4735	// State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed'
4736	State State `json:"state,omitempty"`
4737	// UserID - A resource identifier for the user created the issue.
4738	UserID *string `json:"userId,omitempty"`
4739	// APIID - A resource identifier for the API the issue was created for.
4740	APIID *string `json:"apiId,omitempty"`
4741}
4742
4743// LoggerCollection paged Logger list representation.
4744type LoggerCollection struct {
4745	autorest.Response `json:"-"`
4746	// Value - Logger values.
4747	Value *[]LoggerContract `json:"value,omitempty"`
4748	// Count - Total record count number across all pages.
4749	Count *int64 `json:"count,omitempty"`
4750	// NextLink - Next page link if any.
4751	NextLink *string `json:"nextLink,omitempty"`
4752}
4753
4754// LoggerCollectionIterator provides access to a complete listing of LoggerContract values.
4755type LoggerCollectionIterator struct {
4756	i    int
4757	page LoggerCollectionPage
4758}
4759
4760// NextWithContext advances to the next value.  If there was an error making
4761// the request the iterator does not advance and the error is returned.
4762func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4763	if tracing.IsEnabled() {
4764		ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext")
4765		defer func() {
4766			sc := -1
4767			if iter.Response().Response.Response != nil {
4768				sc = iter.Response().Response.Response.StatusCode
4769			}
4770			tracing.EndSpan(ctx, sc, err)
4771		}()
4772	}
4773	iter.i++
4774	if iter.i < len(iter.page.Values()) {
4775		return nil
4776	}
4777	err = iter.page.NextWithContext(ctx)
4778	if err != nil {
4779		iter.i--
4780		return err
4781	}
4782	iter.i = 0
4783	return nil
4784}
4785
4786// Next advances to the next value.  If there was an error making
4787// the request the iterator does not advance and the error is returned.
4788// Deprecated: Use NextWithContext() instead.
4789func (iter *LoggerCollectionIterator) Next() error {
4790	return iter.NextWithContext(context.Background())
4791}
4792
4793// NotDone returns true if the enumeration should be started or is not yet complete.
4794func (iter LoggerCollectionIterator) NotDone() bool {
4795	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4796}
4797
4798// Response returns the raw server response from the last page request.
4799func (iter LoggerCollectionIterator) Response() LoggerCollection {
4800	return iter.page.Response()
4801}
4802
4803// Value returns the current value or a zero-initialized value if the
4804// iterator has advanced beyond the end of the collection.
4805func (iter LoggerCollectionIterator) Value() LoggerContract {
4806	if !iter.page.NotDone() {
4807		return LoggerContract{}
4808	}
4809	return iter.page.Values()[iter.i]
4810}
4811
4812// Creates a new instance of the LoggerCollectionIterator type.
4813func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator {
4814	return LoggerCollectionIterator{page: page}
4815}
4816
4817// IsEmpty returns true if the ListResult contains no values.
4818func (lc LoggerCollection) IsEmpty() bool {
4819	return lc.Value == nil || len(*lc.Value) == 0
4820}
4821
4822// hasNextLink returns true if the NextLink is not empty.
4823func (lc LoggerCollection) hasNextLink() bool {
4824	return lc.NextLink != nil && len(*lc.NextLink) != 0
4825}
4826
4827// loggerCollectionPreparer prepares a request to retrieve the next set of results.
4828// It returns nil if no more results exist.
4829func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) {
4830	if !lc.hasNextLink() {
4831		return nil, nil
4832	}
4833	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4834		autorest.AsJSON(),
4835		autorest.AsGet(),
4836		autorest.WithBaseURL(to.String(lc.NextLink)))
4837}
4838
4839// LoggerCollectionPage contains a page of LoggerContract values.
4840type LoggerCollectionPage struct {
4841	fn func(context.Context, LoggerCollection) (LoggerCollection, error)
4842	lc LoggerCollection
4843}
4844
4845// NextWithContext advances to the next page of values.  If there was an error making
4846// the request the page does not advance and the error is returned.
4847func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) {
4848	if tracing.IsEnabled() {
4849		ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext")
4850		defer func() {
4851			sc := -1
4852			if page.Response().Response.Response != nil {
4853				sc = page.Response().Response.Response.StatusCode
4854			}
4855			tracing.EndSpan(ctx, sc, err)
4856		}()
4857	}
4858	for {
4859		next, err := page.fn(ctx, page.lc)
4860		if err != nil {
4861			return err
4862		}
4863		page.lc = next
4864		if !next.hasNextLink() || !next.IsEmpty() {
4865			break
4866		}
4867	}
4868	return nil
4869}
4870
4871// Next advances to the next page of values.  If there was an error making
4872// the request the page does not advance and the error is returned.
4873// Deprecated: Use NextWithContext() instead.
4874func (page *LoggerCollectionPage) Next() error {
4875	return page.NextWithContext(context.Background())
4876}
4877
4878// NotDone returns true if the page enumeration should be started or is not yet complete.
4879func (page LoggerCollectionPage) NotDone() bool {
4880	return !page.lc.IsEmpty()
4881}
4882
4883// Response returns the raw server response from the last page request.
4884func (page LoggerCollectionPage) Response() LoggerCollection {
4885	return page.lc
4886}
4887
4888// Values returns the slice of values for the current page or nil if there are no values.
4889func (page LoggerCollectionPage) Values() []LoggerContract {
4890	if page.lc.IsEmpty() {
4891		return nil
4892	}
4893	return *page.lc.Value
4894}
4895
4896// Creates a new instance of the LoggerCollectionPage type.
4897func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage {
4898	return LoggerCollectionPage{
4899		fn: getNextPage,
4900		lc: cur,
4901	}
4902}
4903
4904// LoggerContract logger details.
4905type LoggerContract struct {
4906	autorest.Response `json:"-"`
4907	// LoggerContractProperties - Logger entity contract properties.
4908	*LoggerContractProperties `json:"properties,omitempty"`
4909	// ID - READ-ONLY; Resource ID.
4910	ID *string `json:"id,omitempty"`
4911	// Name - READ-ONLY; Resource name.
4912	Name *string `json:"name,omitempty"`
4913	// Type - READ-ONLY; Resource type for API Management resource.
4914	Type *string `json:"type,omitempty"`
4915}
4916
4917// MarshalJSON is the custom marshaler for LoggerContract.
4918func (lc LoggerContract) MarshalJSON() ([]byte, error) {
4919	objectMap := make(map[string]interface{})
4920	if lc.LoggerContractProperties != nil {
4921		objectMap["properties"] = lc.LoggerContractProperties
4922	}
4923	return json.Marshal(objectMap)
4924}
4925
4926// UnmarshalJSON is the custom unmarshaler for LoggerContract struct.
4927func (lc *LoggerContract) UnmarshalJSON(body []byte) error {
4928	var m map[string]*json.RawMessage
4929	err := json.Unmarshal(body, &m)
4930	if err != nil {
4931		return err
4932	}
4933	for k, v := range m {
4934		switch k {
4935		case "properties":
4936			if v != nil {
4937				var loggerContractProperties LoggerContractProperties
4938				err = json.Unmarshal(*v, &loggerContractProperties)
4939				if err != nil {
4940					return err
4941				}
4942				lc.LoggerContractProperties = &loggerContractProperties
4943			}
4944		case "id":
4945			if v != nil {
4946				var ID string
4947				err = json.Unmarshal(*v, &ID)
4948				if err != nil {
4949					return err
4950				}
4951				lc.ID = &ID
4952			}
4953		case "name":
4954			if v != nil {
4955				var name string
4956				err = json.Unmarshal(*v, &name)
4957				if err != nil {
4958					return err
4959				}
4960				lc.Name = &name
4961			}
4962		case "type":
4963			if v != nil {
4964				var typeVar string
4965				err = json.Unmarshal(*v, &typeVar)
4966				if err != nil {
4967					return err
4968				}
4969				lc.Type = &typeVar
4970			}
4971		}
4972	}
4973
4974	return nil
4975}
4976
4977// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use
4978// to log API Management events. Currently the Logger entity supports logging API Management events to
4979// Azure Event Hubs.
4980type LoggerContractProperties struct {
4981	// LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights'
4982	LoggerType LoggerType `json:"loggerType,omitempty"`
4983	// Description - Logger description.
4984	Description *string `json:"description,omitempty"`
4985	// Credentials - The name and SendRule connection string of the event hub for azureEventHub logger.
4986	// Instrumentation key for applicationInsights logger.
4987	Credentials map[string]*string `json:"credentials"`
4988	// IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true.
4989	IsBuffered *bool `json:"isBuffered,omitempty"`
4990	// Sampling - Sampling settings for an ApplicationInsights logger.
4991	Sampling *LoggerSamplingContract `json:"sampling,omitempty"`
4992}
4993
4994// MarshalJSON is the custom marshaler for LoggerContractProperties.
4995func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) {
4996	objectMap := make(map[string]interface{})
4997	if lcp.LoggerType != "" {
4998		objectMap["loggerType"] = lcp.LoggerType
4999	}
5000	if lcp.Description != nil {
5001		objectMap["description"] = lcp.Description
5002	}
5003	if lcp.Credentials != nil {
5004		objectMap["credentials"] = lcp.Credentials
5005	}
5006	if lcp.IsBuffered != nil {
5007		objectMap["isBuffered"] = lcp.IsBuffered
5008	}
5009	if lcp.Sampling != nil {
5010		objectMap["sampling"] = lcp.Sampling
5011	}
5012	return json.Marshal(objectMap)
5013}
5014
5015// LoggerSamplingContract sampling settings contract.
5016type LoggerSamplingContract struct {
5017	// LoggerSamplingProperties - Sampling settings entity contract properties.
5018	*LoggerSamplingProperties `json:"properties,omitempty"`
5019}
5020
5021// MarshalJSON is the custom marshaler for LoggerSamplingContract.
5022func (lsc LoggerSamplingContract) MarshalJSON() ([]byte, error) {
5023	objectMap := make(map[string]interface{})
5024	if lsc.LoggerSamplingProperties != nil {
5025		objectMap["properties"] = lsc.LoggerSamplingProperties
5026	}
5027	return json.Marshal(objectMap)
5028}
5029
5030// UnmarshalJSON is the custom unmarshaler for LoggerSamplingContract struct.
5031func (lsc *LoggerSamplingContract) UnmarshalJSON(body []byte) error {
5032	var m map[string]*json.RawMessage
5033	err := json.Unmarshal(body, &m)
5034	if err != nil {
5035		return err
5036	}
5037	for k, v := range m {
5038		switch k {
5039		case "properties":
5040			if v != nil {
5041				var loggerSamplingProperties LoggerSamplingProperties
5042				err = json.Unmarshal(*v, &loggerSamplingProperties)
5043				if err != nil {
5044					return err
5045				}
5046				lsc.LoggerSamplingProperties = &loggerSamplingProperties
5047			}
5048		}
5049	}
5050
5051	return nil
5052}
5053
5054// LoggerSamplingProperties sampling settings for an ApplicationInsights logger.
5055type LoggerSamplingProperties struct {
5056	// SamplingType - Sampling type. Possible values include: 'Fixed', 'Adaptive'
5057	SamplingType SamplingType `json:"samplingType,omitempty"`
5058	// Percentage - Rate of sampling for fixed-rate sampling.
5059	Percentage *float64 `json:"percentage,omitempty"`
5060	// MaxTelemetryItemsPerSecond - Target rate of telemetry items per second.
5061	MaxTelemetryItemsPerSecond *int32 `json:"maxTelemetryItemsPerSecond,omitempty"`
5062	// EvaluationInterval - Rate re-evaluation interval in ISO8601 format.
5063	EvaluationInterval *string `json:"evaluationInterval,omitempty"`
5064	// PercentageDecreaseTimeout - Duration in ISO8601 format after which it's allowed to lower the sampling rate.
5065	PercentageDecreaseTimeout *string `json:"percentageDecreaseTimeout,omitempty"`
5066	// PercentageIncreaseTimeout - Duration in ISO8601 format after which it's allowed to increase the sampling rate.
5067	PercentageIncreaseTimeout *string `json:"percentageIncreaseTimeout,omitempty"`
5068	// MinPercentage - Minimum allowed rate of sampling.
5069	MinPercentage *float64 `json:"minPercentage,omitempty"`
5070	// MaxPercentage - Maximum allowed rate of sampling.
5071	MaxPercentage *float64 `json:"maxPercentage,omitempty"`
5072	// MovingAverageRatio - Moving average ration assigned to most recent value.
5073	MovingAverageRatio *float64 `json:"movingAverageRatio,omitempty"`
5074	// InitialPercentage - Initial sampling rate.
5075	InitialPercentage *float64 `json:"initialPercentage,omitempty"`
5076}
5077
5078// LoggerUpdateContract logger update contract.
5079type LoggerUpdateContract struct {
5080	// LoggerUpdateParameters - Logger entity update contract properties.
5081	*LoggerUpdateParameters `json:"properties,omitempty"`
5082}
5083
5084// MarshalJSON is the custom marshaler for LoggerUpdateContract.
5085func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) {
5086	objectMap := make(map[string]interface{})
5087	if luc.LoggerUpdateParameters != nil {
5088		objectMap["properties"] = luc.LoggerUpdateParameters
5089	}
5090	return json.Marshal(objectMap)
5091}
5092
5093// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct.
5094func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error {
5095	var m map[string]*json.RawMessage
5096	err := json.Unmarshal(body, &m)
5097	if err != nil {
5098		return err
5099	}
5100	for k, v := range m {
5101		switch k {
5102		case "properties":
5103			if v != nil {
5104				var loggerUpdateParameters LoggerUpdateParameters
5105				err = json.Unmarshal(*v, &loggerUpdateParameters)
5106				if err != nil {
5107					return err
5108				}
5109				luc.LoggerUpdateParameters = &loggerUpdateParameters
5110			}
5111		}
5112	}
5113
5114	return nil
5115}
5116
5117// LoggerUpdateParameters parameters supplied to the Update Logger operation.
5118type LoggerUpdateParameters struct {
5119	// LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights'
5120	LoggerType LoggerType `json:"loggerType,omitempty"`
5121	// Description - Logger description.
5122	Description *string `json:"description,omitempty"`
5123	// Credentials - Logger credentials.
5124	Credentials map[string]*string `json:"credentials"`
5125	// IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true.
5126	IsBuffered *bool `json:"isBuffered,omitempty"`
5127}
5128
5129// MarshalJSON is the custom marshaler for LoggerUpdateParameters.
5130func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) {
5131	objectMap := make(map[string]interface{})
5132	if lup.LoggerType != "" {
5133		objectMap["loggerType"] = lup.LoggerType
5134	}
5135	if lup.Description != nil {
5136		objectMap["description"] = lup.Description
5137	}
5138	if lup.Credentials != nil {
5139		objectMap["credentials"] = lup.Credentials
5140	}
5141	if lup.IsBuffered != nil {
5142		objectMap["isBuffered"] = lup.IsBuffered
5143	}
5144	return json.Marshal(objectMap)
5145}
5146
5147// NetworkStatusContract network Status details.
5148type NetworkStatusContract struct {
5149	autorest.Response `json:"-"`
5150	// DNSServers - Gets the list of DNS servers IPV4 addresses.
5151	DNSServers *[]string `json:"dnsServers,omitempty"`
5152	// ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon.
5153	ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"`
5154}
5155
5156// NotificationCollection paged Notification list representation.
5157type NotificationCollection struct {
5158	autorest.Response `json:"-"`
5159	// Value - Page values.
5160	Value *[]NotificationContract `json:"value,omitempty"`
5161	// NextLink - Next page link if any.
5162	NextLink *string `json:"nextLink,omitempty"`
5163}
5164
5165// NotificationCollectionIterator provides access to a complete listing of NotificationContract values.
5166type NotificationCollectionIterator struct {
5167	i    int
5168	page NotificationCollectionPage
5169}
5170
5171// NextWithContext advances to the next value.  If there was an error making
5172// the request the iterator does not advance and the error is returned.
5173func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5174	if tracing.IsEnabled() {
5175		ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext")
5176		defer func() {
5177			sc := -1
5178			if iter.Response().Response.Response != nil {
5179				sc = iter.Response().Response.Response.StatusCode
5180			}
5181			tracing.EndSpan(ctx, sc, err)
5182		}()
5183	}
5184	iter.i++
5185	if iter.i < len(iter.page.Values()) {
5186		return nil
5187	}
5188	err = iter.page.NextWithContext(ctx)
5189	if err != nil {
5190		iter.i--
5191		return err
5192	}
5193	iter.i = 0
5194	return nil
5195}
5196
5197// Next advances to the next value.  If there was an error making
5198// the request the iterator does not advance and the error is returned.
5199// Deprecated: Use NextWithContext() instead.
5200func (iter *NotificationCollectionIterator) Next() error {
5201	return iter.NextWithContext(context.Background())
5202}
5203
5204// NotDone returns true if the enumeration should be started or is not yet complete.
5205func (iter NotificationCollectionIterator) NotDone() bool {
5206	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5207}
5208
5209// Response returns the raw server response from the last page request.
5210func (iter NotificationCollectionIterator) Response() NotificationCollection {
5211	return iter.page.Response()
5212}
5213
5214// Value returns the current value or a zero-initialized value if the
5215// iterator has advanced beyond the end of the collection.
5216func (iter NotificationCollectionIterator) Value() NotificationContract {
5217	if !iter.page.NotDone() {
5218		return NotificationContract{}
5219	}
5220	return iter.page.Values()[iter.i]
5221}
5222
5223// Creates a new instance of the NotificationCollectionIterator type.
5224func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator {
5225	return NotificationCollectionIterator{page: page}
5226}
5227
5228// IsEmpty returns true if the ListResult contains no values.
5229func (nc NotificationCollection) IsEmpty() bool {
5230	return nc.Value == nil || len(*nc.Value) == 0
5231}
5232
5233// hasNextLink returns true if the NextLink is not empty.
5234func (nc NotificationCollection) hasNextLink() bool {
5235	return nc.NextLink != nil && len(*nc.NextLink) != 0
5236}
5237
5238// notificationCollectionPreparer prepares a request to retrieve the next set of results.
5239// It returns nil if no more results exist.
5240func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) {
5241	if !nc.hasNextLink() {
5242		return nil, nil
5243	}
5244	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5245		autorest.AsJSON(),
5246		autorest.AsGet(),
5247		autorest.WithBaseURL(to.String(nc.NextLink)))
5248}
5249
5250// NotificationCollectionPage contains a page of NotificationContract values.
5251type NotificationCollectionPage struct {
5252	fn func(context.Context, NotificationCollection) (NotificationCollection, error)
5253	nc NotificationCollection
5254}
5255
5256// NextWithContext advances to the next page of values.  If there was an error making
5257// the request the page does not advance and the error is returned.
5258func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) {
5259	if tracing.IsEnabled() {
5260		ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext")
5261		defer func() {
5262			sc := -1
5263			if page.Response().Response.Response != nil {
5264				sc = page.Response().Response.Response.StatusCode
5265			}
5266			tracing.EndSpan(ctx, sc, err)
5267		}()
5268	}
5269	for {
5270		next, err := page.fn(ctx, page.nc)
5271		if err != nil {
5272			return err
5273		}
5274		page.nc = next
5275		if !next.hasNextLink() || !next.IsEmpty() {
5276			break
5277		}
5278	}
5279	return nil
5280}
5281
5282// Next advances to the next page of values.  If there was an error making
5283// the request the page does not advance and the error is returned.
5284// Deprecated: Use NextWithContext() instead.
5285func (page *NotificationCollectionPage) Next() error {
5286	return page.NextWithContext(context.Background())
5287}
5288
5289// NotDone returns true if the page enumeration should be started or is not yet complete.
5290func (page NotificationCollectionPage) NotDone() bool {
5291	return !page.nc.IsEmpty()
5292}
5293
5294// Response returns the raw server response from the last page request.
5295func (page NotificationCollectionPage) Response() NotificationCollection {
5296	return page.nc
5297}
5298
5299// Values returns the slice of values for the current page or nil if there are no values.
5300func (page NotificationCollectionPage) Values() []NotificationContract {
5301	if page.nc.IsEmpty() {
5302		return nil
5303	}
5304	return *page.nc.Value
5305}
5306
5307// Creates a new instance of the NotificationCollectionPage type.
5308func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage {
5309	return NotificationCollectionPage{
5310		fn: getNextPage,
5311		nc: cur,
5312	}
5313}
5314
5315// NotificationContract notification details.
5316type NotificationContract struct {
5317	autorest.Response `json:"-"`
5318	// NotificationContractProperties - Notification entity contract properties.
5319	*NotificationContractProperties `json:"properties,omitempty"`
5320	// ID - READ-ONLY; Resource ID.
5321	ID *string `json:"id,omitempty"`
5322	// Name - READ-ONLY; Resource name.
5323	Name *string `json:"name,omitempty"`
5324	// Type - READ-ONLY; Resource type for API Management resource.
5325	Type *string `json:"type,omitempty"`
5326}
5327
5328// MarshalJSON is the custom marshaler for NotificationContract.
5329func (nc NotificationContract) MarshalJSON() ([]byte, error) {
5330	objectMap := make(map[string]interface{})
5331	if nc.NotificationContractProperties != nil {
5332		objectMap["properties"] = nc.NotificationContractProperties
5333	}
5334	return json.Marshal(objectMap)
5335}
5336
5337// UnmarshalJSON is the custom unmarshaler for NotificationContract struct.
5338func (nc *NotificationContract) UnmarshalJSON(body []byte) error {
5339	var m map[string]*json.RawMessage
5340	err := json.Unmarshal(body, &m)
5341	if err != nil {
5342		return err
5343	}
5344	for k, v := range m {
5345		switch k {
5346		case "properties":
5347			if v != nil {
5348				var notificationContractProperties NotificationContractProperties
5349				err = json.Unmarshal(*v, &notificationContractProperties)
5350				if err != nil {
5351					return err
5352				}
5353				nc.NotificationContractProperties = &notificationContractProperties
5354			}
5355		case "id":
5356			if v != nil {
5357				var ID string
5358				err = json.Unmarshal(*v, &ID)
5359				if err != nil {
5360					return err
5361				}
5362				nc.ID = &ID
5363			}
5364		case "name":
5365			if v != nil {
5366				var name string
5367				err = json.Unmarshal(*v, &name)
5368				if err != nil {
5369					return err
5370				}
5371				nc.Name = &name
5372			}
5373		case "type":
5374			if v != nil {
5375				var typeVar string
5376				err = json.Unmarshal(*v, &typeVar)
5377				if err != nil {
5378					return err
5379				}
5380				nc.Type = &typeVar
5381			}
5382		}
5383	}
5384
5385	return nil
5386}
5387
5388// NotificationContractProperties notification Contract properties.
5389type NotificationContractProperties struct {
5390	// Title - Title of the Notification.
5391	Title *string `json:"title,omitempty"`
5392	// Description - Description of the Notification.
5393	Description *string `json:"description,omitempty"`
5394	// Recipients - Recipient Parameter values.
5395	Recipients *RecipientsContractProperties `json:"recipients,omitempty"`
5396}
5397
5398// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details.
5399type OAuth2AuthenticationSettingsContract struct {
5400	// AuthorizationServerID - OAuth authorization server identifier.
5401	AuthorizationServerID *string `json:"authorizationServerId,omitempty"`
5402	// Scope - operations scope.
5403	Scope *string `json:"scope,omitempty"`
5404}
5405
5406// OpenIDConnectProviderCollection paged OpenIdProviders list representation.
5407type OpenIDConnectProviderCollection struct {
5408	autorest.Response `json:"-"`
5409	// Value - Page values.
5410	Value *[]OpenidConnectProviderContract `json:"value,omitempty"`
5411	// NextLink - Next page link if any.
5412	NextLink *string `json:"nextLink,omitempty"`
5413}
5414
5415// OpenIDConnectProviderCollectionIterator provides access to a complete listing of
5416// OpenidConnectProviderContract values.
5417type OpenIDConnectProviderCollectionIterator struct {
5418	i    int
5419	page OpenIDConnectProviderCollectionPage
5420}
5421
5422// NextWithContext advances to the next value.  If there was an error making
5423// the request the iterator does not advance and the error is returned.
5424func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5425	if tracing.IsEnabled() {
5426		ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext")
5427		defer func() {
5428			sc := -1
5429			if iter.Response().Response.Response != nil {
5430				sc = iter.Response().Response.Response.StatusCode
5431			}
5432			tracing.EndSpan(ctx, sc, err)
5433		}()
5434	}
5435	iter.i++
5436	if iter.i < len(iter.page.Values()) {
5437		return nil
5438	}
5439	err = iter.page.NextWithContext(ctx)
5440	if err != nil {
5441		iter.i--
5442		return err
5443	}
5444	iter.i = 0
5445	return nil
5446}
5447
5448// Next advances to the next value.  If there was an error making
5449// the request the iterator does not advance and the error is returned.
5450// Deprecated: Use NextWithContext() instead.
5451func (iter *OpenIDConnectProviderCollectionIterator) Next() error {
5452	return iter.NextWithContext(context.Background())
5453}
5454
5455// NotDone returns true if the enumeration should be started or is not yet complete.
5456func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool {
5457	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5458}
5459
5460// Response returns the raw server response from the last page request.
5461func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection {
5462	return iter.page.Response()
5463}
5464
5465// Value returns the current value or a zero-initialized value if the
5466// iterator has advanced beyond the end of the collection.
5467func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract {
5468	if !iter.page.NotDone() {
5469		return OpenidConnectProviderContract{}
5470	}
5471	return iter.page.Values()[iter.i]
5472}
5473
5474// Creates a new instance of the OpenIDConnectProviderCollectionIterator type.
5475func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator {
5476	return OpenIDConnectProviderCollectionIterator{page: page}
5477}
5478
5479// IsEmpty returns true if the ListResult contains no values.
5480func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool {
5481	return oicpc.Value == nil || len(*oicpc.Value) == 0
5482}
5483
5484// hasNextLink returns true if the NextLink is not empty.
5485func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool {
5486	return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0
5487}
5488
5489// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results.
5490// It returns nil if no more results exist.
5491func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) {
5492	if !oicpc.hasNextLink() {
5493		return nil, nil
5494	}
5495	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5496		autorest.AsJSON(),
5497		autorest.AsGet(),
5498		autorest.WithBaseURL(to.String(oicpc.NextLink)))
5499}
5500
5501// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values.
5502type OpenIDConnectProviderCollectionPage struct {
5503	fn    func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)
5504	oicpc OpenIDConnectProviderCollection
5505}
5506
5507// NextWithContext advances to the next page of values.  If there was an error making
5508// the request the page does not advance and the error is returned.
5509func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) {
5510	if tracing.IsEnabled() {
5511		ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext")
5512		defer func() {
5513			sc := -1
5514			if page.Response().Response.Response != nil {
5515				sc = page.Response().Response.Response.StatusCode
5516			}
5517			tracing.EndSpan(ctx, sc, err)
5518		}()
5519	}
5520	for {
5521		next, err := page.fn(ctx, page.oicpc)
5522		if err != nil {
5523			return err
5524		}
5525		page.oicpc = next
5526		if !next.hasNextLink() || !next.IsEmpty() {
5527			break
5528		}
5529	}
5530	return nil
5531}
5532
5533// Next advances to the next page of values.  If there was an error making
5534// the request the page does not advance and the error is returned.
5535// Deprecated: Use NextWithContext() instead.
5536func (page *OpenIDConnectProviderCollectionPage) Next() error {
5537	return page.NextWithContext(context.Background())
5538}
5539
5540// NotDone returns true if the page enumeration should be started or is not yet complete.
5541func (page OpenIDConnectProviderCollectionPage) NotDone() bool {
5542	return !page.oicpc.IsEmpty()
5543}
5544
5545// Response returns the raw server response from the last page request.
5546func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection {
5547	return page.oicpc
5548}
5549
5550// Values returns the slice of values for the current page or nil if there are no values.
5551func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract {
5552	if page.oicpc.IsEmpty() {
5553		return nil
5554	}
5555	return *page.oicpc.Value
5556}
5557
5558// Creates a new instance of the OpenIDConnectProviderCollectionPage type.
5559func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage {
5560	return OpenIDConnectProviderCollectionPage{
5561		fn:    getNextPage,
5562		oicpc: cur,
5563	}
5564}
5565
5566// OpenidConnectProviderContract openId Connect Provider details.
5567type OpenidConnectProviderContract struct {
5568	autorest.Response `json:"-"`
5569	// OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties.
5570	*OpenidConnectProviderContractProperties `json:"properties,omitempty"`
5571	// ID - READ-ONLY; Resource ID.
5572	ID *string `json:"id,omitempty"`
5573	// Name - READ-ONLY; Resource name.
5574	Name *string `json:"name,omitempty"`
5575	// Type - READ-ONLY; Resource type for API Management resource.
5576	Type *string `json:"type,omitempty"`
5577}
5578
5579// MarshalJSON is the custom marshaler for OpenidConnectProviderContract.
5580func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) {
5581	objectMap := make(map[string]interface{})
5582	if ocpc.OpenidConnectProviderContractProperties != nil {
5583		objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties
5584	}
5585	return json.Marshal(objectMap)
5586}
5587
5588// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct.
5589func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error {
5590	var m map[string]*json.RawMessage
5591	err := json.Unmarshal(body, &m)
5592	if err != nil {
5593		return err
5594	}
5595	for k, v := range m {
5596		switch k {
5597		case "properties":
5598			if v != nil {
5599				var openidConnectProviderContractProperties OpenidConnectProviderContractProperties
5600				err = json.Unmarshal(*v, &openidConnectProviderContractProperties)
5601				if err != nil {
5602					return err
5603				}
5604				ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties
5605			}
5606		case "id":
5607			if v != nil {
5608				var ID string
5609				err = json.Unmarshal(*v, &ID)
5610				if err != nil {
5611					return err
5612				}
5613				ocpc.ID = &ID
5614			}
5615		case "name":
5616			if v != nil {
5617				var name string
5618				err = json.Unmarshal(*v, &name)
5619				if err != nil {
5620					return err
5621				}
5622				ocpc.Name = &name
5623			}
5624		case "type":
5625			if v != nil {
5626				var typeVar string
5627				err = json.Unmarshal(*v, &typeVar)
5628				if err != nil {
5629					return err
5630				}
5631				ocpc.Type = &typeVar
5632			}
5633		}
5634	}
5635
5636	return nil
5637}
5638
5639// OpenidConnectProviderContractProperties openID Connect Providers Contract.
5640type OpenidConnectProviderContractProperties struct {
5641	// DisplayName - User-friendly OpenID Connect Provider name.
5642	DisplayName *string `json:"displayName,omitempty"`
5643	// Description - User-friendly description of OpenID Connect Provider.
5644	Description *string `json:"description,omitempty"`
5645	// MetadataEndpoint - Metadata endpoint URI.
5646	MetadataEndpoint *string `json:"metadataEndpoint,omitempty"`
5647	// ClientID - Client ID of developer console which is the client application.
5648	ClientID *string `json:"clientId,omitempty"`
5649	// ClientSecret - Client Secret of developer console which is the client application.
5650	ClientSecret *string `json:"clientSecret,omitempty"`
5651}
5652
5653// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation.
5654type OpenidConnectProviderUpdateContract struct {
5655	// OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties.
5656	*OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"`
5657}
5658
5659// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract.
5660func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) {
5661	objectMap := make(map[string]interface{})
5662	if ocpuc.OpenidConnectProviderUpdateContractProperties != nil {
5663		objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties
5664	}
5665	return json.Marshal(objectMap)
5666}
5667
5668// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct.
5669func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error {
5670	var m map[string]*json.RawMessage
5671	err := json.Unmarshal(body, &m)
5672	if err != nil {
5673		return err
5674	}
5675	for k, v := range m {
5676		switch k {
5677		case "properties":
5678			if v != nil {
5679				var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties
5680				err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties)
5681				if err != nil {
5682					return err
5683				}
5684				ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties
5685			}
5686		}
5687	}
5688
5689	return nil
5690}
5691
5692// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider
5693// operation.
5694type OpenidConnectProviderUpdateContractProperties struct {
5695	// DisplayName - User-friendly OpenID Connect Provider name.
5696	DisplayName *string `json:"displayName,omitempty"`
5697	// Description - User-friendly description of OpenID Connect Provider.
5698	Description *string `json:"description,omitempty"`
5699	// MetadataEndpoint - Metadata endpoint URI.
5700	MetadataEndpoint *string `json:"metadataEndpoint,omitempty"`
5701	// ClientID - Client ID of developer console which is the client application.
5702	ClientID *string `json:"clientId,omitempty"`
5703	// ClientSecret - Client Secret of developer console which is the client application.
5704	ClientSecret *string `json:"clientSecret,omitempty"`
5705}
5706
5707// Operation REST API operation
5708type Operation struct {
5709	// Name - Operation name: {provider}/{resource}/{operation}
5710	Name *string `json:"name,omitempty"`
5711	// Display - The object that describes the operation.
5712	Display *OperationDisplay `json:"display,omitempty"`
5713	// Origin - The operation origin.
5714	Origin *string `json:"origin,omitempty"`
5715	// Properties - The operation properties.
5716	Properties interface{} `json:"properties,omitempty"`
5717}
5718
5719// OperationCollection paged Operation list representation.
5720type OperationCollection struct {
5721	autorest.Response `json:"-"`
5722	// Value - READ-ONLY; Page values.
5723	Value *[]OperationContract `json:"value,omitempty"`
5724	// NextLink - READ-ONLY; Next page link if any.
5725	NextLink *string `json:"nextLink,omitempty"`
5726}
5727
5728// MarshalJSON is the custom marshaler for OperationCollection.
5729func (oc OperationCollection) MarshalJSON() ([]byte, error) {
5730	objectMap := make(map[string]interface{})
5731	return json.Marshal(objectMap)
5732}
5733
5734// OperationCollectionIterator provides access to a complete listing of OperationContract values.
5735type OperationCollectionIterator struct {
5736	i    int
5737	page OperationCollectionPage
5738}
5739
5740// NextWithContext advances to the next value.  If there was an error making
5741// the request the iterator does not advance and the error is returned.
5742func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5743	if tracing.IsEnabled() {
5744		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext")
5745		defer func() {
5746			sc := -1
5747			if iter.Response().Response.Response != nil {
5748				sc = iter.Response().Response.Response.StatusCode
5749			}
5750			tracing.EndSpan(ctx, sc, err)
5751		}()
5752	}
5753	iter.i++
5754	if iter.i < len(iter.page.Values()) {
5755		return nil
5756	}
5757	err = iter.page.NextWithContext(ctx)
5758	if err != nil {
5759		iter.i--
5760		return err
5761	}
5762	iter.i = 0
5763	return nil
5764}
5765
5766// Next advances to the next value.  If there was an error making
5767// the request the iterator does not advance and the error is returned.
5768// Deprecated: Use NextWithContext() instead.
5769func (iter *OperationCollectionIterator) Next() error {
5770	return iter.NextWithContext(context.Background())
5771}
5772
5773// NotDone returns true if the enumeration should be started or is not yet complete.
5774func (iter OperationCollectionIterator) NotDone() bool {
5775	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5776}
5777
5778// Response returns the raw server response from the last page request.
5779func (iter OperationCollectionIterator) Response() OperationCollection {
5780	return iter.page.Response()
5781}
5782
5783// Value returns the current value or a zero-initialized value if the
5784// iterator has advanced beyond the end of the collection.
5785func (iter OperationCollectionIterator) Value() OperationContract {
5786	if !iter.page.NotDone() {
5787		return OperationContract{}
5788	}
5789	return iter.page.Values()[iter.i]
5790}
5791
5792// Creates a new instance of the OperationCollectionIterator type.
5793func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator {
5794	return OperationCollectionIterator{page: page}
5795}
5796
5797// IsEmpty returns true if the ListResult contains no values.
5798func (oc OperationCollection) IsEmpty() bool {
5799	return oc.Value == nil || len(*oc.Value) == 0
5800}
5801
5802// hasNextLink returns true if the NextLink is not empty.
5803func (oc OperationCollection) hasNextLink() bool {
5804	return oc.NextLink != nil && len(*oc.NextLink) != 0
5805}
5806
5807// operationCollectionPreparer prepares a request to retrieve the next set of results.
5808// It returns nil if no more results exist.
5809func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) {
5810	if !oc.hasNextLink() {
5811		return nil, nil
5812	}
5813	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5814		autorest.AsJSON(),
5815		autorest.AsGet(),
5816		autorest.WithBaseURL(to.String(oc.NextLink)))
5817}
5818
5819// OperationCollectionPage contains a page of OperationContract values.
5820type OperationCollectionPage struct {
5821	fn func(context.Context, OperationCollection) (OperationCollection, error)
5822	oc OperationCollection
5823}
5824
5825// NextWithContext advances to the next page of values.  If there was an error making
5826// the request the page does not advance and the error is returned.
5827func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) {
5828	if tracing.IsEnabled() {
5829		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext")
5830		defer func() {
5831			sc := -1
5832			if page.Response().Response.Response != nil {
5833				sc = page.Response().Response.Response.StatusCode
5834			}
5835			tracing.EndSpan(ctx, sc, err)
5836		}()
5837	}
5838	for {
5839		next, err := page.fn(ctx, page.oc)
5840		if err != nil {
5841			return err
5842		}
5843		page.oc = next
5844		if !next.hasNextLink() || !next.IsEmpty() {
5845			break
5846		}
5847	}
5848	return nil
5849}
5850
5851// Next advances to the next page of values.  If there was an error making
5852// the request the page does not advance and the error is returned.
5853// Deprecated: Use NextWithContext() instead.
5854func (page *OperationCollectionPage) Next() error {
5855	return page.NextWithContext(context.Background())
5856}
5857
5858// NotDone returns true if the page enumeration should be started or is not yet complete.
5859func (page OperationCollectionPage) NotDone() bool {
5860	return !page.oc.IsEmpty()
5861}
5862
5863// Response returns the raw server response from the last page request.
5864func (page OperationCollectionPage) Response() OperationCollection {
5865	return page.oc
5866}
5867
5868// Values returns the slice of values for the current page or nil if there are no values.
5869func (page OperationCollectionPage) Values() []OperationContract {
5870	if page.oc.IsEmpty() {
5871		return nil
5872	}
5873	return *page.oc.Value
5874}
5875
5876// Creates a new instance of the OperationCollectionPage type.
5877func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage {
5878	return OperationCollectionPage{
5879		fn: getNextPage,
5880		oc: cur,
5881	}
5882}
5883
5884// OperationContract api Operation details.
5885type OperationContract struct {
5886	autorest.Response `json:"-"`
5887	// OperationContractProperties - Properties of the Operation Contract.
5888	*OperationContractProperties `json:"properties,omitempty"`
5889	// ID - READ-ONLY; Resource ID.
5890	ID *string `json:"id,omitempty"`
5891	// Name - READ-ONLY; Resource name.
5892	Name *string `json:"name,omitempty"`
5893	// Type - READ-ONLY; Resource type for API Management resource.
5894	Type *string `json:"type,omitempty"`
5895}
5896
5897// MarshalJSON is the custom marshaler for OperationContract.
5898func (oc OperationContract) MarshalJSON() ([]byte, error) {
5899	objectMap := make(map[string]interface{})
5900	if oc.OperationContractProperties != nil {
5901		objectMap["properties"] = oc.OperationContractProperties
5902	}
5903	return json.Marshal(objectMap)
5904}
5905
5906// UnmarshalJSON is the custom unmarshaler for OperationContract struct.
5907func (oc *OperationContract) UnmarshalJSON(body []byte) error {
5908	var m map[string]*json.RawMessage
5909	err := json.Unmarshal(body, &m)
5910	if err != nil {
5911		return err
5912	}
5913	for k, v := range m {
5914		switch k {
5915		case "properties":
5916			if v != nil {
5917				var operationContractProperties OperationContractProperties
5918				err = json.Unmarshal(*v, &operationContractProperties)
5919				if err != nil {
5920					return err
5921				}
5922				oc.OperationContractProperties = &operationContractProperties
5923			}
5924		case "id":
5925			if v != nil {
5926				var ID string
5927				err = json.Unmarshal(*v, &ID)
5928				if err != nil {
5929					return err
5930				}
5931				oc.ID = &ID
5932			}
5933		case "name":
5934			if v != nil {
5935				var name string
5936				err = json.Unmarshal(*v, &name)
5937				if err != nil {
5938					return err
5939				}
5940				oc.Name = &name
5941			}
5942		case "type":
5943			if v != nil {
5944				var typeVar string
5945				err = json.Unmarshal(*v, &typeVar)
5946				if err != nil {
5947					return err
5948				}
5949				oc.Type = &typeVar
5950			}
5951		}
5952	}
5953
5954	return nil
5955}
5956
5957// OperationContractProperties operation Contract Properties
5958type OperationContractProperties struct {
5959	// DisplayName - Operation Name.
5960	DisplayName *string `json:"displayName,omitempty"`
5961	// Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
5962	Method *string `json:"method,omitempty"`
5963	// URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
5964	URLTemplate *string `json:"urlTemplate,omitempty"`
5965	// TemplateParameters - Collection of URL template parameters.
5966	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
5967	// Description - Description of the operation. May include HTML formatting tags.
5968	Description *string `json:"description,omitempty"`
5969	// Request - An entity containing request details.
5970	Request *RequestContract `json:"request,omitempty"`
5971	// Responses - Array of Operation responses.
5972	Responses *[]ResponseContract `json:"responses,omitempty"`
5973	// Policies - Operation Policies
5974	Policies *string `json:"policies,omitempty"`
5975}
5976
5977// OperationDisplay the object that describes the operation.
5978type OperationDisplay struct {
5979	// Provider - Friendly name of the resource provider
5980	Provider *string `json:"provider,omitempty"`
5981	// Operation - Operation type: read, write, delete, listKeys/action, etc.
5982	Operation *string `json:"operation,omitempty"`
5983	// Resource - Resource type on which the operation is performed.
5984	Resource *string `json:"resource,omitempty"`
5985	// Description - Friendly name of the operation
5986	Description *string `json:"description,omitempty"`
5987}
5988
5989// OperationEntityBaseContract api Operation Entity Base Contract details.
5990type OperationEntityBaseContract struct {
5991	// TemplateParameters - Collection of URL template parameters.
5992	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
5993	// Description - Description of the operation. May include HTML formatting tags.
5994	Description *string `json:"description,omitempty"`
5995	// Request - An entity containing request details.
5996	Request *RequestContract `json:"request,omitempty"`
5997	// Responses - Array of Operation responses.
5998	Responses *[]ResponseContract `json:"responses,omitempty"`
5999	// Policies - Operation Policies
6000	Policies *string `json:"policies,omitempty"`
6001}
6002
6003// OperationEntityContract operation Entity Contract Properties.
6004type OperationEntityContract struct {
6005	// OperationEntityContractProperties - Operation entity contract properties.
6006	*OperationEntityContractProperties `json:"properties,omitempty"`
6007	// ID - READ-ONLY; Resource ID.
6008	ID *string `json:"id,omitempty"`
6009	// Name - READ-ONLY; Resource name.
6010	Name *string `json:"name,omitempty"`
6011	// Type - READ-ONLY; Resource type for API Management resource.
6012	Type *string `json:"type,omitempty"`
6013}
6014
6015// MarshalJSON is the custom marshaler for OperationEntityContract.
6016func (oec OperationEntityContract) MarshalJSON() ([]byte, error) {
6017	objectMap := make(map[string]interface{})
6018	if oec.OperationEntityContractProperties != nil {
6019		objectMap["properties"] = oec.OperationEntityContractProperties
6020	}
6021	return json.Marshal(objectMap)
6022}
6023
6024// UnmarshalJSON is the custom unmarshaler for OperationEntityContract struct.
6025func (oec *OperationEntityContract) 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 operationEntityContractProperties OperationEntityContractProperties
6036				err = json.Unmarshal(*v, &operationEntityContractProperties)
6037				if err != nil {
6038					return err
6039				}
6040				oec.OperationEntityContractProperties = &operationEntityContractProperties
6041			}
6042		case "id":
6043			if v != nil {
6044				var ID string
6045				err = json.Unmarshal(*v, &ID)
6046				if err != nil {
6047					return err
6048				}
6049				oec.ID = &ID
6050			}
6051		case "name":
6052			if v != nil {
6053				var name string
6054				err = json.Unmarshal(*v, &name)
6055				if err != nil {
6056					return err
6057				}
6058				oec.Name = &name
6059			}
6060		case "type":
6061			if v != nil {
6062				var typeVar string
6063				err = json.Unmarshal(*v, &typeVar)
6064				if err != nil {
6065					return err
6066				}
6067				oec.Type = &typeVar
6068			}
6069		}
6070	}
6071
6072	return nil
6073}
6074
6075// OperationEntityContractProperties operation Entity contract Properties.
6076type OperationEntityContractProperties struct {
6077	// DisplayName - READ-ONLY; Operation name.
6078	DisplayName *string `json:"displayName,omitempty"`
6079	// APIName - READ-ONLY; Api Name.
6080	APIName *string `json:"apiName,omitempty"`
6081	// APIRevision - READ-ONLY; Api Revision.
6082	APIRevision *string `json:"apiRevision,omitempty"`
6083	// APIVersion - READ-ONLY; Api Version.
6084	APIVersion *string `json:"apiVersion,omitempty"`
6085	// Description - READ-ONLY; Operation Description.
6086	Description *string `json:"description,omitempty"`
6087	// Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
6088	Method *string `json:"method,omitempty"`
6089	// URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
6090	URLTemplate *string `json:"urlTemplate,omitempty"`
6091}
6092
6093// MarshalJSON is the custom marshaler for OperationEntityContractProperties.
6094func (oecp OperationEntityContractProperties) MarshalJSON() ([]byte, error) {
6095	objectMap := make(map[string]interface{})
6096	return json.Marshal(objectMap)
6097}
6098
6099// OperationListResult result of the request to list REST API operations. It contains a list of operations
6100// and a URL nextLink to get the next set of results.
6101type OperationListResult struct {
6102	autorest.Response `json:"-"`
6103	// Value - List of operations supported by the resource provider.
6104	Value *[]Operation `json:"value,omitempty"`
6105	// NextLink - URL to get the next set of operation list results if there are any.
6106	NextLink *string `json:"nextLink,omitempty"`
6107}
6108
6109// OperationListResultIterator provides access to a complete listing of Operation values.
6110type OperationListResultIterator struct {
6111	i    int
6112	page OperationListResultPage
6113}
6114
6115// NextWithContext advances to the next value.  If there was an error making
6116// the request the iterator does not advance and the error is returned.
6117func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
6118	if tracing.IsEnabled() {
6119		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
6120		defer func() {
6121			sc := -1
6122			if iter.Response().Response.Response != nil {
6123				sc = iter.Response().Response.Response.StatusCode
6124			}
6125			tracing.EndSpan(ctx, sc, err)
6126		}()
6127	}
6128	iter.i++
6129	if iter.i < len(iter.page.Values()) {
6130		return nil
6131	}
6132	err = iter.page.NextWithContext(ctx)
6133	if err != nil {
6134		iter.i--
6135		return err
6136	}
6137	iter.i = 0
6138	return nil
6139}
6140
6141// Next advances to the next value.  If there was an error making
6142// the request the iterator does not advance and the error is returned.
6143// Deprecated: Use NextWithContext() instead.
6144func (iter *OperationListResultIterator) Next() error {
6145	return iter.NextWithContext(context.Background())
6146}
6147
6148// NotDone returns true if the enumeration should be started or is not yet complete.
6149func (iter OperationListResultIterator) NotDone() bool {
6150	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6151}
6152
6153// Response returns the raw server response from the last page request.
6154func (iter OperationListResultIterator) Response() OperationListResult {
6155	return iter.page.Response()
6156}
6157
6158// Value returns the current value or a zero-initialized value if the
6159// iterator has advanced beyond the end of the collection.
6160func (iter OperationListResultIterator) Value() Operation {
6161	if !iter.page.NotDone() {
6162		return Operation{}
6163	}
6164	return iter.page.Values()[iter.i]
6165}
6166
6167// Creates a new instance of the OperationListResultIterator type.
6168func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
6169	return OperationListResultIterator{page: page}
6170}
6171
6172// IsEmpty returns true if the ListResult contains no values.
6173func (olr OperationListResult) IsEmpty() bool {
6174	return olr.Value == nil || len(*olr.Value) == 0
6175}
6176
6177// hasNextLink returns true if the NextLink is not empty.
6178func (olr OperationListResult) hasNextLink() bool {
6179	return olr.NextLink != nil && len(*olr.NextLink) != 0
6180}
6181
6182// operationListResultPreparer prepares a request to retrieve the next set of results.
6183// It returns nil if no more results exist.
6184func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
6185	if !olr.hasNextLink() {
6186		return nil, nil
6187	}
6188	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6189		autorest.AsJSON(),
6190		autorest.AsGet(),
6191		autorest.WithBaseURL(to.String(olr.NextLink)))
6192}
6193
6194// OperationListResultPage contains a page of Operation values.
6195type OperationListResultPage struct {
6196	fn  func(context.Context, OperationListResult) (OperationListResult, error)
6197	olr OperationListResult
6198}
6199
6200// NextWithContext advances to the next page of values.  If there was an error making
6201// the request the page does not advance and the error is returned.
6202func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
6203	if tracing.IsEnabled() {
6204		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
6205		defer func() {
6206			sc := -1
6207			if page.Response().Response.Response != nil {
6208				sc = page.Response().Response.Response.StatusCode
6209			}
6210			tracing.EndSpan(ctx, sc, err)
6211		}()
6212	}
6213	for {
6214		next, err := page.fn(ctx, page.olr)
6215		if err != nil {
6216			return err
6217		}
6218		page.olr = next
6219		if !next.hasNextLink() || !next.IsEmpty() {
6220			break
6221		}
6222	}
6223	return nil
6224}
6225
6226// Next advances to the next page of values.  If there was an error making
6227// the request the page does not advance and the error is returned.
6228// Deprecated: Use NextWithContext() instead.
6229func (page *OperationListResultPage) Next() error {
6230	return page.NextWithContext(context.Background())
6231}
6232
6233// NotDone returns true if the page enumeration should be started or is not yet complete.
6234func (page OperationListResultPage) NotDone() bool {
6235	return !page.olr.IsEmpty()
6236}
6237
6238// Response returns the raw server response from the last page request.
6239func (page OperationListResultPage) Response() OperationListResult {
6240	return page.olr
6241}
6242
6243// Values returns the slice of values for the current page or nil if there are no values.
6244func (page OperationListResultPage) Values() []Operation {
6245	if page.olr.IsEmpty() {
6246		return nil
6247	}
6248	return *page.olr.Value
6249}
6250
6251// Creates a new instance of the OperationListResultPage type.
6252func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
6253	return OperationListResultPage{
6254		fn:  getNextPage,
6255		olr: cur,
6256	}
6257}
6258
6259// OperationResultContract operation Result.
6260type OperationResultContract struct {
6261	autorest.Response `json:"-"`
6262	// ID - Operation result identifier.
6263	ID *string `json:"id,omitempty"`
6264	// Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed'
6265	Status AsyncOperationStatus `json:"status,omitempty"`
6266	// Started - Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
6267	Started *date.Time `json:"started,omitempty"`
6268	// Updated - Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
6269	Updated *date.Time `json:"updated,omitempty"`
6270	// ResultInfo - Optional result info.
6271	ResultInfo *string `json:"resultInfo,omitempty"`
6272	// Error - Error Body Contract
6273	Error *ErrorResponse `json:"error,omitempty"`
6274	// ActionLog - READ-ONLY; This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation.
6275	ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"`
6276}
6277
6278// MarshalJSON is the custom marshaler for OperationResultContract.
6279func (orc OperationResultContract) MarshalJSON() ([]byte, error) {
6280	objectMap := make(map[string]interface{})
6281	if orc.ID != nil {
6282		objectMap["id"] = orc.ID
6283	}
6284	if orc.Status != "" {
6285		objectMap["status"] = orc.Status
6286	}
6287	if orc.Started != nil {
6288		objectMap["started"] = orc.Started
6289	}
6290	if orc.Updated != nil {
6291		objectMap["updated"] = orc.Updated
6292	}
6293	if orc.ResultInfo != nil {
6294		objectMap["resultInfo"] = orc.ResultInfo
6295	}
6296	if orc.Error != nil {
6297		objectMap["error"] = orc.Error
6298	}
6299	return json.Marshal(objectMap)
6300}
6301
6302// OperationResultLogItemContract log of the entity being created, updated or deleted.
6303type OperationResultLogItemContract struct {
6304	// ObjectType - The type of entity contract.
6305	ObjectType *string `json:"objectType,omitempty"`
6306	// Action - Action like create/update/delete.
6307	Action *string `json:"action,omitempty"`
6308	// ObjectKey - Identifier of the entity being created/updated/deleted.
6309	ObjectKey *string `json:"objectKey,omitempty"`
6310}
6311
6312// OperationUpdateContract api Operation Update Contract details.
6313type OperationUpdateContract struct {
6314	// OperationUpdateContractProperties - Properties of the API Operation entity that can be updated.
6315	*OperationUpdateContractProperties `json:"properties,omitempty"`
6316}
6317
6318// MarshalJSON is the custom marshaler for OperationUpdateContract.
6319func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) {
6320	objectMap := make(map[string]interface{})
6321	if ouc.OperationUpdateContractProperties != nil {
6322		objectMap["properties"] = ouc.OperationUpdateContractProperties
6323	}
6324	return json.Marshal(objectMap)
6325}
6326
6327// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct.
6328func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error {
6329	var m map[string]*json.RawMessage
6330	err := json.Unmarshal(body, &m)
6331	if err != nil {
6332		return err
6333	}
6334	for k, v := range m {
6335		switch k {
6336		case "properties":
6337			if v != nil {
6338				var operationUpdateContractProperties OperationUpdateContractProperties
6339				err = json.Unmarshal(*v, &operationUpdateContractProperties)
6340				if err != nil {
6341					return err
6342				}
6343				ouc.OperationUpdateContractProperties = &operationUpdateContractProperties
6344			}
6345		}
6346	}
6347
6348	return nil
6349}
6350
6351// OperationUpdateContractProperties operation Update Contract Properties.
6352type OperationUpdateContractProperties struct {
6353	// DisplayName - Operation Name.
6354	DisplayName *string `json:"displayName,omitempty"`
6355	// Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
6356	Method *string `json:"method,omitempty"`
6357	// URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
6358	URLTemplate *string `json:"urlTemplate,omitempty"`
6359	// TemplateParameters - Collection of URL template parameters.
6360	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
6361	// Description - Description of the operation. May include HTML formatting tags.
6362	Description *string `json:"description,omitempty"`
6363	// Request - An entity containing request details.
6364	Request *RequestContract `json:"request,omitempty"`
6365	// Responses - Array of Operation responses.
6366	Responses *[]ResponseContract `json:"responses,omitempty"`
6367	// Policies - Operation Policies
6368	Policies *string `json:"policies,omitempty"`
6369}
6370
6371// ParameterContract operation parameters details.
6372type ParameterContract struct {
6373	// Name - Parameter name.
6374	Name *string `json:"name,omitempty"`
6375	// Description - Parameter description.
6376	Description *string `json:"description,omitempty"`
6377	// Type - Parameter type.
6378	Type *string `json:"type,omitempty"`
6379	// DefaultValue - Default parameter value.
6380	DefaultValue *string `json:"defaultValue,omitempty"`
6381	// Required - whether parameter is required or not.
6382	Required *bool `json:"required,omitempty"`
6383	// Values - Parameter values.
6384	Values *[]string `json:"values,omitempty"`
6385}
6386
6387// PolicyCollection the response of the list policy operation.
6388type PolicyCollection struct {
6389	autorest.Response `json:"-"`
6390	// Value - Policy Contract value.
6391	Value *[]PolicyContract `json:"value,omitempty"`
6392	// NextLink - Next page link if any.
6393	NextLink *string `json:"nextLink,omitempty"`
6394}
6395
6396// PolicyContract policy Contract details.
6397type PolicyContract struct {
6398	autorest.Response `json:"-"`
6399	// PolicyContractProperties - Properties of the Policy.
6400	*PolicyContractProperties `json:"properties,omitempty"`
6401	// ID - READ-ONLY; Resource ID.
6402	ID *string `json:"id,omitempty"`
6403	// Name - READ-ONLY; Resource name.
6404	Name *string `json:"name,omitempty"`
6405	// Type - READ-ONLY; Resource type for API Management resource.
6406	Type *string `json:"type,omitempty"`
6407}
6408
6409// MarshalJSON is the custom marshaler for PolicyContract.
6410func (pc PolicyContract) MarshalJSON() ([]byte, error) {
6411	objectMap := make(map[string]interface{})
6412	if pc.PolicyContractProperties != nil {
6413		objectMap["properties"] = pc.PolicyContractProperties
6414	}
6415	return json.Marshal(objectMap)
6416}
6417
6418// UnmarshalJSON is the custom unmarshaler for PolicyContract struct.
6419func (pc *PolicyContract) UnmarshalJSON(body []byte) error {
6420	var m map[string]*json.RawMessage
6421	err := json.Unmarshal(body, &m)
6422	if err != nil {
6423		return err
6424	}
6425	for k, v := range m {
6426		switch k {
6427		case "properties":
6428			if v != nil {
6429				var policyContractProperties PolicyContractProperties
6430				err = json.Unmarshal(*v, &policyContractProperties)
6431				if err != nil {
6432					return err
6433				}
6434				pc.PolicyContractProperties = &policyContractProperties
6435			}
6436		case "id":
6437			if v != nil {
6438				var ID string
6439				err = json.Unmarshal(*v, &ID)
6440				if err != nil {
6441					return err
6442				}
6443				pc.ID = &ID
6444			}
6445		case "name":
6446			if v != nil {
6447				var name string
6448				err = json.Unmarshal(*v, &name)
6449				if err != nil {
6450					return err
6451				}
6452				pc.Name = &name
6453			}
6454		case "type":
6455			if v != nil {
6456				var typeVar string
6457				err = json.Unmarshal(*v, &typeVar)
6458				if err != nil {
6459					return err
6460				}
6461				pc.Type = &typeVar
6462			}
6463		}
6464	}
6465
6466	return nil
6467}
6468
6469// PolicyContractProperties policy contract Properties.
6470type PolicyContractProperties struct {
6471	// PolicyContent - Json escaped Xml Encoded contents of the Policy.
6472	PolicyContent *string `json:"policyContent,omitempty"`
6473}
6474
6475// PolicySnippetContract policy snippet.
6476type PolicySnippetContract struct {
6477	// Name - READ-ONLY; Snippet name.
6478	Name *string `json:"name,omitempty"`
6479	// Content - READ-ONLY; Snippet content.
6480	Content *string `json:"content,omitempty"`
6481	// ToolTip - READ-ONLY; Snippet toolTip.
6482	ToolTip *string `json:"toolTip,omitempty"`
6483	// Scope - READ-ONLY; Binary OR value of the Snippet scope.
6484	Scope *int32 `json:"scope,omitempty"`
6485}
6486
6487// MarshalJSON is the custom marshaler for PolicySnippetContract.
6488func (psc PolicySnippetContract) MarshalJSON() ([]byte, error) {
6489	objectMap := make(map[string]interface{})
6490	return json.Marshal(objectMap)
6491}
6492
6493// PolicySnippetsCollection the response of the list policy snippets operation.
6494type PolicySnippetsCollection struct {
6495	autorest.Response `json:"-"`
6496	// Value - Policy snippet value.
6497	Value *[]PolicySnippetContract `json:"value,omitempty"`
6498}
6499
6500// PortalDelegationSettings delegation settings for a developer portal.
6501type PortalDelegationSettings struct {
6502	autorest.Response `json:"-"`
6503	// PortalDelegationSettingsProperties - Delegation settings contract properties.
6504	*PortalDelegationSettingsProperties `json:"properties,omitempty"`
6505	// ID - READ-ONLY; Resource ID.
6506	ID *string `json:"id,omitempty"`
6507	// Name - READ-ONLY; Resource name.
6508	Name *string `json:"name,omitempty"`
6509	// Type - READ-ONLY; Resource type for API Management resource.
6510	Type *string `json:"type,omitempty"`
6511}
6512
6513// MarshalJSON is the custom marshaler for PortalDelegationSettings.
6514func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) {
6515	objectMap := make(map[string]interface{})
6516	if pds.PortalDelegationSettingsProperties != nil {
6517		objectMap["properties"] = pds.PortalDelegationSettingsProperties
6518	}
6519	return json.Marshal(objectMap)
6520}
6521
6522// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct.
6523func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error {
6524	var m map[string]*json.RawMessage
6525	err := json.Unmarshal(body, &m)
6526	if err != nil {
6527		return err
6528	}
6529	for k, v := range m {
6530		switch k {
6531		case "properties":
6532			if v != nil {
6533				var portalDelegationSettingsProperties PortalDelegationSettingsProperties
6534				err = json.Unmarshal(*v, &portalDelegationSettingsProperties)
6535				if err != nil {
6536					return err
6537				}
6538				pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties
6539			}
6540		case "id":
6541			if v != nil {
6542				var ID string
6543				err = json.Unmarshal(*v, &ID)
6544				if err != nil {
6545					return err
6546				}
6547				pds.ID = &ID
6548			}
6549		case "name":
6550			if v != nil {
6551				var name string
6552				err = json.Unmarshal(*v, &name)
6553				if err != nil {
6554					return err
6555				}
6556				pds.Name = &name
6557			}
6558		case "type":
6559			if v != nil {
6560				var typeVar string
6561				err = json.Unmarshal(*v, &typeVar)
6562				if err != nil {
6563					return err
6564				}
6565				pds.Type = &typeVar
6566			}
6567		}
6568	}
6569
6570	return nil
6571}
6572
6573// PortalDelegationSettingsProperties delegation settings contract properties.
6574type PortalDelegationSettingsProperties struct {
6575	// URL - A delegation Url.
6576	URL *string `json:"url,omitempty"`
6577	// ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management.
6578	ValidationKey *string `json:"validationKey,omitempty"`
6579	// Subscriptions - Subscriptions delegation settings.
6580	Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"`
6581	// UserRegistration - User registration delegation settings.
6582	UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"`
6583}
6584
6585// PortalSigninSettingProperties sign-in settings contract properties.
6586type PortalSigninSettingProperties struct {
6587	// Enabled - Redirect Anonymous users to the Sign-In page.
6588	Enabled *bool `json:"enabled,omitempty"`
6589}
6590
6591// PortalSigninSettings sign-In settings for the Developer Portal.
6592type PortalSigninSettings struct {
6593	autorest.Response `json:"-"`
6594	// PortalSigninSettingProperties - Sign-in settings contract properties.
6595	*PortalSigninSettingProperties `json:"properties,omitempty"`
6596	// ID - READ-ONLY; Resource ID.
6597	ID *string `json:"id,omitempty"`
6598	// Name - READ-ONLY; Resource name.
6599	Name *string `json:"name,omitempty"`
6600	// Type - READ-ONLY; Resource type for API Management resource.
6601	Type *string `json:"type,omitempty"`
6602}
6603
6604// MarshalJSON is the custom marshaler for PortalSigninSettings.
6605func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) {
6606	objectMap := make(map[string]interface{})
6607	if pss.PortalSigninSettingProperties != nil {
6608		objectMap["properties"] = pss.PortalSigninSettingProperties
6609	}
6610	return json.Marshal(objectMap)
6611}
6612
6613// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct.
6614func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error {
6615	var m map[string]*json.RawMessage
6616	err := json.Unmarshal(body, &m)
6617	if err != nil {
6618		return err
6619	}
6620	for k, v := range m {
6621		switch k {
6622		case "properties":
6623			if v != nil {
6624				var portalSigninSettingProperties PortalSigninSettingProperties
6625				err = json.Unmarshal(*v, &portalSigninSettingProperties)
6626				if err != nil {
6627					return err
6628				}
6629				pss.PortalSigninSettingProperties = &portalSigninSettingProperties
6630			}
6631		case "id":
6632			if v != nil {
6633				var ID string
6634				err = json.Unmarshal(*v, &ID)
6635				if err != nil {
6636					return err
6637				}
6638				pss.ID = &ID
6639			}
6640		case "name":
6641			if v != nil {
6642				var name string
6643				err = json.Unmarshal(*v, &name)
6644				if err != nil {
6645					return err
6646				}
6647				pss.Name = &name
6648			}
6649		case "type":
6650			if v != nil {
6651				var typeVar string
6652				err = json.Unmarshal(*v, &typeVar)
6653				if err != nil {
6654					return err
6655				}
6656				pss.Type = &typeVar
6657			}
6658		}
6659	}
6660
6661	return nil
6662}
6663
6664// PortalSignupSettings sign-Up settings for a developer portal.
6665type PortalSignupSettings struct {
6666	autorest.Response `json:"-"`
6667	// PortalSignupSettingsProperties - Sign-up settings contract properties.
6668	*PortalSignupSettingsProperties `json:"properties,omitempty"`
6669	// ID - READ-ONLY; Resource ID.
6670	ID *string `json:"id,omitempty"`
6671	// Name - READ-ONLY; Resource name.
6672	Name *string `json:"name,omitempty"`
6673	// Type - READ-ONLY; Resource type for API Management resource.
6674	Type *string `json:"type,omitempty"`
6675}
6676
6677// MarshalJSON is the custom marshaler for PortalSignupSettings.
6678func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) {
6679	objectMap := make(map[string]interface{})
6680	if pss.PortalSignupSettingsProperties != nil {
6681		objectMap["properties"] = pss.PortalSignupSettingsProperties
6682	}
6683	return json.Marshal(objectMap)
6684}
6685
6686// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct.
6687func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error {
6688	var m map[string]*json.RawMessage
6689	err := json.Unmarshal(body, &m)
6690	if err != nil {
6691		return err
6692	}
6693	for k, v := range m {
6694		switch k {
6695		case "properties":
6696			if v != nil {
6697				var portalSignupSettingsProperties PortalSignupSettingsProperties
6698				err = json.Unmarshal(*v, &portalSignupSettingsProperties)
6699				if err != nil {
6700					return err
6701				}
6702				pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties
6703			}
6704		case "id":
6705			if v != nil {
6706				var ID string
6707				err = json.Unmarshal(*v, &ID)
6708				if err != nil {
6709					return err
6710				}
6711				pss.ID = &ID
6712			}
6713		case "name":
6714			if v != nil {
6715				var name string
6716				err = json.Unmarshal(*v, &name)
6717				if err != nil {
6718					return err
6719				}
6720				pss.Name = &name
6721			}
6722		case "type":
6723			if v != nil {
6724				var typeVar string
6725				err = json.Unmarshal(*v, &typeVar)
6726				if err != nil {
6727					return err
6728				}
6729				pss.Type = &typeVar
6730			}
6731		}
6732	}
6733
6734	return nil
6735}
6736
6737// PortalSignupSettingsProperties sign-up settings contract properties.
6738type PortalSignupSettingsProperties struct {
6739	// Enabled - Allow users to sign up on a developer portal.
6740	Enabled *bool `json:"enabled,omitempty"`
6741	// TermsOfService - Terms of service contract properties.
6742	TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"`
6743}
6744
6745// ProductCollection paged Products list representation.
6746type ProductCollection struct {
6747	autorest.Response `json:"-"`
6748	// Value - Page values.
6749	Value *[]ProductContract `json:"value,omitempty"`
6750	// NextLink - Next page link if any.
6751	NextLink *string `json:"nextLink,omitempty"`
6752}
6753
6754// ProductCollectionIterator provides access to a complete listing of ProductContract values.
6755type ProductCollectionIterator struct {
6756	i    int
6757	page ProductCollectionPage
6758}
6759
6760// NextWithContext advances to the next value.  If there was an error making
6761// the request the iterator does not advance and the error is returned.
6762func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) {
6763	if tracing.IsEnabled() {
6764		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext")
6765		defer func() {
6766			sc := -1
6767			if iter.Response().Response.Response != nil {
6768				sc = iter.Response().Response.Response.StatusCode
6769			}
6770			tracing.EndSpan(ctx, sc, err)
6771		}()
6772	}
6773	iter.i++
6774	if iter.i < len(iter.page.Values()) {
6775		return nil
6776	}
6777	err = iter.page.NextWithContext(ctx)
6778	if err != nil {
6779		iter.i--
6780		return err
6781	}
6782	iter.i = 0
6783	return nil
6784}
6785
6786// Next advances to the next value.  If there was an error making
6787// the request the iterator does not advance and the error is returned.
6788// Deprecated: Use NextWithContext() instead.
6789func (iter *ProductCollectionIterator) Next() error {
6790	return iter.NextWithContext(context.Background())
6791}
6792
6793// NotDone returns true if the enumeration should be started or is not yet complete.
6794func (iter ProductCollectionIterator) NotDone() bool {
6795	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6796}
6797
6798// Response returns the raw server response from the last page request.
6799func (iter ProductCollectionIterator) Response() ProductCollection {
6800	return iter.page.Response()
6801}
6802
6803// Value returns the current value or a zero-initialized value if the
6804// iterator has advanced beyond the end of the collection.
6805func (iter ProductCollectionIterator) Value() ProductContract {
6806	if !iter.page.NotDone() {
6807		return ProductContract{}
6808	}
6809	return iter.page.Values()[iter.i]
6810}
6811
6812// Creates a new instance of the ProductCollectionIterator type.
6813func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator {
6814	return ProductCollectionIterator{page: page}
6815}
6816
6817// IsEmpty returns true if the ListResult contains no values.
6818func (pc ProductCollection) IsEmpty() bool {
6819	return pc.Value == nil || len(*pc.Value) == 0
6820}
6821
6822// hasNextLink returns true if the NextLink is not empty.
6823func (pc ProductCollection) hasNextLink() bool {
6824	return pc.NextLink != nil && len(*pc.NextLink) != 0
6825}
6826
6827// productCollectionPreparer prepares a request to retrieve the next set of results.
6828// It returns nil if no more results exist.
6829func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) {
6830	if !pc.hasNextLink() {
6831		return nil, nil
6832	}
6833	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6834		autorest.AsJSON(),
6835		autorest.AsGet(),
6836		autorest.WithBaseURL(to.String(pc.NextLink)))
6837}
6838
6839// ProductCollectionPage contains a page of ProductContract values.
6840type ProductCollectionPage struct {
6841	fn func(context.Context, ProductCollection) (ProductCollection, error)
6842	pc ProductCollection
6843}
6844
6845// NextWithContext advances to the next page of values.  If there was an error making
6846// the request the page does not advance and the error is returned.
6847func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) {
6848	if tracing.IsEnabled() {
6849		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext")
6850		defer func() {
6851			sc := -1
6852			if page.Response().Response.Response != nil {
6853				sc = page.Response().Response.Response.StatusCode
6854			}
6855			tracing.EndSpan(ctx, sc, err)
6856		}()
6857	}
6858	for {
6859		next, err := page.fn(ctx, page.pc)
6860		if err != nil {
6861			return err
6862		}
6863		page.pc = next
6864		if !next.hasNextLink() || !next.IsEmpty() {
6865			break
6866		}
6867	}
6868	return nil
6869}
6870
6871// Next advances to the next page of values.  If there was an error making
6872// the request the page does not advance and the error is returned.
6873// Deprecated: Use NextWithContext() instead.
6874func (page *ProductCollectionPage) Next() error {
6875	return page.NextWithContext(context.Background())
6876}
6877
6878// NotDone returns true if the page enumeration should be started or is not yet complete.
6879func (page ProductCollectionPage) NotDone() bool {
6880	return !page.pc.IsEmpty()
6881}
6882
6883// Response returns the raw server response from the last page request.
6884func (page ProductCollectionPage) Response() ProductCollection {
6885	return page.pc
6886}
6887
6888// Values returns the slice of values for the current page or nil if there are no values.
6889func (page ProductCollectionPage) Values() []ProductContract {
6890	if page.pc.IsEmpty() {
6891		return nil
6892	}
6893	return *page.pc.Value
6894}
6895
6896// Creates a new instance of the ProductCollectionPage type.
6897func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage {
6898	return ProductCollectionPage{
6899		fn: getNextPage,
6900		pc: cur,
6901	}
6902}
6903
6904// ProductContract product details.
6905type ProductContract struct {
6906	autorest.Response `json:"-"`
6907	// ProductContractProperties - Product entity contract properties.
6908	*ProductContractProperties `json:"properties,omitempty"`
6909	// ID - READ-ONLY; Resource ID.
6910	ID *string `json:"id,omitempty"`
6911	// Name - READ-ONLY; Resource name.
6912	Name *string `json:"name,omitempty"`
6913	// Type - READ-ONLY; Resource type for API Management resource.
6914	Type *string `json:"type,omitempty"`
6915}
6916
6917// MarshalJSON is the custom marshaler for ProductContract.
6918func (pc ProductContract) MarshalJSON() ([]byte, error) {
6919	objectMap := make(map[string]interface{})
6920	if pc.ProductContractProperties != nil {
6921		objectMap["properties"] = pc.ProductContractProperties
6922	}
6923	return json.Marshal(objectMap)
6924}
6925
6926// UnmarshalJSON is the custom unmarshaler for ProductContract struct.
6927func (pc *ProductContract) UnmarshalJSON(body []byte) error {
6928	var m map[string]*json.RawMessage
6929	err := json.Unmarshal(body, &m)
6930	if err != nil {
6931		return err
6932	}
6933	for k, v := range m {
6934		switch k {
6935		case "properties":
6936			if v != nil {
6937				var productContractProperties ProductContractProperties
6938				err = json.Unmarshal(*v, &productContractProperties)
6939				if err != nil {
6940					return err
6941				}
6942				pc.ProductContractProperties = &productContractProperties
6943			}
6944		case "id":
6945			if v != nil {
6946				var ID string
6947				err = json.Unmarshal(*v, &ID)
6948				if err != nil {
6949					return err
6950				}
6951				pc.ID = &ID
6952			}
6953		case "name":
6954			if v != nil {
6955				var name string
6956				err = json.Unmarshal(*v, &name)
6957				if err != nil {
6958					return err
6959				}
6960				pc.Name = &name
6961			}
6962		case "type":
6963			if v != nil {
6964				var typeVar string
6965				err = json.Unmarshal(*v, &typeVar)
6966				if err != nil {
6967					return err
6968				}
6969				pc.Type = &typeVar
6970			}
6971		}
6972	}
6973
6974	return nil
6975}
6976
6977// ProductContractProperties product profile.
6978type ProductContractProperties struct {
6979	// DisplayName - Product name.
6980	DisplayName *string `json:"displayName,omitempty"`
6981	// Description - Product description. May include HTML formatting tags.
6982	Description *string `json:"description,omitempty"`
6983	// Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process.
6984	Terms *string `json:"terms,omitempty"`
6985	// SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true.
6986	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
6987	// ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true.
6988	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
6989	// SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true.
6990	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
6991	// State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published'
6992	State ProductState `json:"state,omitempty"`
6993}
6994
6995// ProductEntityBaseParameters product Entity Base Parameters
6996type ProductEntityBaseParameters struct {
6997	// Description - Product description. May include HTML formatting tags.
6998	Description *string `json:"description,omitempty"`
6999	// Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process.
7000	Terms *string `json:"terms,omitempty"`
7001	// SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true.
7002	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
7003	// ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true.
7004	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
7005	// SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true.
7006	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
7007	// State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published'
7008	State ProductState `json:"state,omitempty"`
7009}
7010
7011// ProductUpdateParameters product Update parameters.
7012type ProductUpdateParameters struct {
7013	// ProductUpdateProperties - Product entity Update contract properties.
7014	*ProductUpdateProperties `json:"properties,omitempty"`
7015}
7016
7017// MarshalJSON is the custom marshaler for ProductUpdateParameters.
7018func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) {
7019	objectMap := make(map[string]interface{})
7020	if pup.ProductUpdateProperties != nil {
7021		objectMap["properties"] = pup.ProductUpdateProperties
7022	}
7023	return json.Marshal(objectMap)
7024}
7025
7026// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct.
7027func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error {
7028	var m map[string]*json.RawMessage
7029	err := json.Unmarshal(body, &m)
7030	if err != nil {
7031		return err
7032	}
7033	for k, v := range m {
7034		switch k {
7035		case "properties":
7036			if v != nil {
7037				var productUpdateProperties ProductUpdateProperties
7038				err = json.Unmarshal(*v, &productUpdateProperties)
7039				if err != nil {
7040					return err
7041				}
7042				pup.ProductUpdateProperties = &productUpdateProperties
7043			}
7044		}
7045	}
7046
7047	return nil
7048}
7049
7050// ProductUpdateProperties parameters supplied to the Update Product operation.
7051type ProductUpdateProperties struct {
7052	// DisplayName - Product name.
7053	DisplayName *string `json:"displayName,omitempty"`
7054	// Description - Product description. May include HTML formatting tags.
7055	Description *string `json:"description,omitempty"`
7056	// Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process.
7057	Terms *string `json:"terms,omitempty"`
7058	// SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true.
7059	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
7060	// ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true.
7061	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
7062	// SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true.
7063	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
7064	// State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published'
7065	State ProductState `json:"state,omitempty"`
7066}
7067
7068// PropertyCollection paged Property list representation.
7069type PropertyCollection struct {
7070	autorest.Response `json:"-"`
7071	// Value - Page values.
7072	Value *[]PropertyContract `json:"value,omitempty"`
7073	// NextLink - Next page link if any.
7074	NextLink *string `json:"nextLink,omitempty"`
7075}
7076
7077// PropertyCollectionIterator provides access to a complete listing of PropertyContract values.
7078type PropertyCollectionIterator struct {
7079	i    int
7080	page PropertyCollectionPage
7081}
7082
7083// NextWithContext advances to the next value.  If there was an error making
7084// the request the iterator does not advance and the error is returned.
7085func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7086	if tracing.IsEnabled() {
7087		ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext")
7088		defer func() {
7089			sc := -1
7090			if iter.Response().Response.Response != nil {
7091				sc = iter.Response().Response.Response.StatusCode
7092			}
7093			tracing.EndSpan(ctx, sc, err)
7094		}()
7095	}
7096	iter.i++
7097	if iter.i < len(iter.page.Values()) {
7098		return nil
7099	}
7100	err = iter.page.NextWithContext(ctx)
7101	if err != nil {
7102		iter.i--
7103		return err
7104	}
7105	iter.i = 0
7106	return nil
7107}
7108
7109// Next advances to the next value.  If there was an error making
7110// the request the iterator does not advance and the error is returned.
7111// Deprecated: Use NextWithContext() instead.
7112func (iter *PropertyCollectionIterator) Next() error {
7113	return iter.NextWithContext(context.Background())
7114}
7115
7116// NotDone returns true if the enumeration should be started or is not yet complete.
7117func (iter PropertyCollectionIterator) NotDone() bool {
7118	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7119}
7120
7121// Response returns the raw server response from the last page request.
7122func (iter PropertyCollectionIterator) Response() PropertyCollection {
7123	return iter.page.Response()
7124}
7125
7126// Value returns the current value or a zero-initialized value if the
7127// iterator has advanced beyond the end of the collection.
7128func (iter PropertyCollectionIterator) Value() PropertyContract {
7129	if !iter.page.NotDone() {
7130		return PropertyContract{}
7131	}
7132	return iter.page.Values()[iter.i]
7133}
7134
7135// Creates a new instance of the PropertyCollectionIterator type.
7136func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator {
7137	return PropertyCollectionIterator{page: page}
7138}
7139
7140// IsEmpty returns true if the ListResult contains no values.
7141func (pc PropertyCollection) IsEmpty() bool {
7142	return pc.Value == nil || len(*pc.Value) == 0
7143}
7144
7145// hasNextLink returns true if the NextLink is not empty.
7146func (pc PropertyCollection) hasNextLink() bool {
7147	return pc.NextLink != nil && len(*pc.NextLink) != 0
7148}
7149
7150// propertyCollectionPreparer prepares a request to retrieve the next set of results.
7151// It returns nil if no more results exist.
7152func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) {
7153	if !pc.hasNextLink() {
7154		return nil, nil
7155	}
7156	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7157		autorest.AsJSON(),
7158		autorest.AsGet(),
7159		autorest.WithBaseURL(to.String(pc.NextLink)))
7160}
7161
7162// PropertyCollectionPage contains a page of PropertyContract values.
7163type PropertyCollectionPage struct {
7164	fn func(context.Context, PropertyCollection) (PropertyCollection, error)
7165	pc PropertyCollection
7166}
7167
7168// NextWithContext advances to the next page of values.  If there was an error making
7169// the request the page does not advance and the error is returned.
7170func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) {
7171	if tracing.IsEnabled() {
7172		ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext")
7173		defer func() {
7174			sc := -1
7175			if page.Response().Response.Response != nil {
7176				sc = page.Response().Response.Response.StatusCode
7177			}
7178			tracing.EndSpan(ctx, sc, err)
7179		}()
7180	}
7181	for {
7182		next, err := page.fn(ctx, page.pc)
7183		if err != nil {
7184			return err
7185		}
7186		page.pc = next
7187		if !next.hasNextLink() || !next.IsEmpty() {
7188			break
7189		}
7190	}
7191	return nil
7192}
7193
7194// Next advances to the next page of values.  If there was an error making
7195// the request the page does not advance and the error is returned.
7196// Deprecated: Use NextWithContext() instead.
7197func (page *PropertyCollectionPage) Next() error {
7198	return page.NextWithContext(context.Background())
7199}
7200
7201// NotDone returns true if the page enumeration should be started or is not yet complete.
7202func (page PropertyCollectionPage) NotDone() bool {
7203	return !page.pc.IsEmpty()
7204}
7205
7206// Response returns the raw server response from the last page request.
7207func (page PropertyCollectionPage) Response() PropertyCollection {
7208	return page.pc
7209}
7210
7211// Values returns the slice of values for the current page or nil if there are no values.
7212func (page PropertyCollectionPage) Values() []PropertyContract {
7213	if page.pc.IsEmpty() {
7214		return nil
7215	}
7216	return *page.pc.Value
7217}
7218
7219// Creates a new instance of the PropertyCollectionPage type.
7220func NewPropertyCollectionPage(cur PropertyCollection, getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage {
7221	return PropertyCollectionPage{
7222		fn: getNextPage,
7223		pc: cur,
7224	}
7225}
7226
7227// PropertyContract property details.
7228type PropertyContract struct {
7229	autorest.Response `json:"-"`
7230	// PropertyContractProperties - Property entity contract properties.
7231	*PropertyContractProperties `json:"properties,omitempty"`
7232	// ID - READ-ONLY; Resource ID.
7233	ID *string `json:"id,omitempty"`
7234	// Name - READ-ONLY; Resource name.
7235	Name *string `json:"name,omitempty"`
7236	// Type - READ-ONLY; Resource type for API Management resource.
7237	Type *string `json:"type,omitempty"`
7238}
7239
7240// MarshalJSON is the custom marshaler for PropertyContract.
7241func (pc PropertyContract) MarshalJSON() ([]byte, error) {
7242	objectMap := make(map[string]interface{})
7243	if pc.PropertyContractProperties != nil {
7244		objectMap["properties"] = pc.PropertyContractProperties
7245	}
7246	return json.Marshal(objectMap)
7247}
7248
7249// UnmarshalJSON is the custom unmarshaler for PropertyContract struct.
7250func (pc *PropertyContract) UnmarshalJSON(body []byte) error {
7251	var m map[string]*json.RawMessage
7252	err := json.Unmarshal(body, &m)
7253	if err != nil {
7254		return err
7255	}
7256	for k, v := range m {
7257		switch k {
7258		case "properties":
7259			if v != nil {
7260				var propertyContractProperties PropertyContractProperties
7261				err = json.Unmarshal(*v, &propertyContractProperties)
7262				if err != nil {
7263					return err
7264				}
7265				pc.PropertyContractProperties = &propertyContractProperties
7266			}
7267		case "id":
7268			if v != nil {
7269				var ID string
7270				err = json.Unmarshal(*v, &ID)
7271				if err != nil {
7272					return err
7273				}
7274				pc.ID = &ID
7275			}
7276		case "name":
7277			if v != nil {
7278				var name string
7279				err = json.Unmarshal(*v, &name)
7280				if err != nil {
7281					return err
7282				}
7283				pc.Name = &name
7284			}
7285		case "type":
7286			if v != nil {
7287				var typeVar string
7288				err = json.Unmarshal(*v, &typeVar)
7289				if err != nil {
7290					return err
7291				}
7292				pc.Type = &typeVar
7293			}
7294		}
7295	}
7296
7297	return nil
7298}
7299
7300// PropertyContractProperties property Contract properties.
7301type PropertyContractProperties struct {
7302	// DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters.
7303	DisplayName *string `json:"displayName,omitempty"`
7304	// Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace.
7305	Value *string `json:"value,omitempty"`
7306	// Tags - Optional tags that when provided can be used to filter the property list.
7307	Tags *[]string `json:"tags,omitempty"`
7308	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
7309	Secret *bool `json:"secret,omitempty"`
7310}
7311
7312// PropertyEntityBaseParameters property Entity Base Parameters set.
7313type PropertyEntityBaseParameters struct {
7314	// Tags - Optional tags that when provided can be used to filter the property list.
7315	Tags *[]string `json:"tags,omitempty"`
7316	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
7317	Secret *bool `json:"secret,omitempty"`
7318}
7319
7320// PropertyUpdateParameterProperties property Contract properties.
7321type PropertyUpdateParameterProperties struct {
7322	// DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters.
7323	DisplayName *string `json:"displayName,omitempty"`
7324	// Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace.
7325	Value *string `json:"value,omitempty"`
7326	// Tags - Optional tags that when provided can be used to filter the property list.
7327	Tags *[]string `json:"tags,omitempty"`
7328	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
7329	Secret *bool `json:"secret,omitempty"`
7330}
7331
7332// PropertyUpdateParameters property update Parameters.
7333type PropertyUpdateParameters struct {
7334	// PropertyUpdateParameterProperties - Property entity Update contract properties.
7335	*PropertyUpdateParameterProperties `json:"properties,omitempty"`
7336}
7337
7338// MarshalJSON is the custom marshaler for PropertyUpdateParameters.
7339func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) {
7340	objectMap := make(map[string]interface{})
7341	if pup.PropertyUpdateParameterProperties != nil {
7342		objectMap["properties"] = pup.PropertyUpdateParameterProperties
7343	}
7344	return json.Marshal(objectMap)
7345}
7346
7347// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct.
7348func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error {
7349	var m map[string]*json.RawMessage
7350	err := json.Unmarshal(body, &m)
7351	if err != nil {
7352		return err
7353	}
7354	for k, v := range m {
7355		switch k {
7356		case "properties":
7357			if v != nil {
7358				var propertyUpdateParameterProperties PropertyUpdateParameterProperties
7359				err = json.Unmarshal(*v, &propertyUpdateParameterProperties)
7360				if err != nil {
7361					return err
7362				}
7363				pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties
7364			}
7365		}
7366	}
7367
7368	return nil
7369}
7370
7371// QuotaCounterCollection paged Quota Counter list representation.
7372type QuotaCounterCollection struct {
7373	autorest.Response `json:"-"`
7374	// Value - Quota counter values.
7375	Value *[]QuotaCounterContract `json:"value,omitempty"`
7376	// Count - Total record count number across all pages.
7377	Count *int64 `json:"count,omitempty"`
7378	// NextLink - Next page link if any.
7379	NextLink *string `json:"nextLink,omitempty"`
7380}
7381
7382// QuotaCounterContract quota counter details.
7383type QuotaCounterContract struct {
7384	autorest.Response `json:"-"`
7385	// CounterKey - The Key value of the Counter. Must not be empty.
7386	CounterKey *string `json:"counterKey,omitempty"`
7387	// PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty.
7388	PeriodKey *string `json:"periodKey,omitempty"`
7389	// PeriodStartTime - The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
7390	PeriodStartTime *date.Time `json:"periodStartTime,omitempty"`
7391	// PeriodEndTime - The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
7392	PeriodEndTime *date.Time `json:"periodEndTime,omitempty"`
7393	// Value - Quota Value Properties
7394	Value *QuotaCounterValueContractProperties `json:"Value,omitempty"`
7395}
7396
7397// QuotaCounterValueContract quota counter value details.
7398type QuotaCounterValueContract struct {
7399	// QuotaCounterValueContractProperties - Quota counter Value Properties.
7400	*QuotaCounterValueContractProperties `json:"value,omitempty"`
7401}
7402
7403// MarshalJSON is the custom marshaler for QuotaCounterValueContract.
7404func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) {
7405	objectMap := make(map[string]interface{})
7406	if qcvc.QuotaCounterValueContractProperties != nil {
7407		objectMap["value"] = qcvc.QuotaCounterValueContractProperties
7408	}
7409	return json.Marshal(objectMap)
7410}
7411
7412// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct.
7413func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error {
7414	var m map[string]*json.RawMessage
7415	err := json.Unmarshal(body, &m)
7416	if err != nil {
7417		return err
7418	}
7419	for k, v := range m {
7420		switch k {
7421		case "value":
7422			if v != nil {
7423				var quotaCounterValueContractProperties QuotaCounterValueContractProperties
7424				err = json.Unmarshal(*v, &quotaCounterValueContractProperties)
7425				if err != nil {
7426					return err
7427				}
7428				qcvc.QuotaCounterValueContractProperties = &quotaCounterValueContractProperties
7429			}
7430		}
7431	}
7432
7433	return nil
7434}
7435
7436// QuotaCounterValueContractProperties quota counter value details.
7437type QuotaCounterValueContractProperties struct {
7438	// CallsCount - Number of times Counter was called.
7439	CallsCount *int32 `json:"callsCount,omitempty"`
7440	// KbTransferred - Data Transferred in KiloBytes.
7441	KbTransferred *float64 `json:"kbTransferred,omitempty"`
7442}
7443
7444// RecipientEmailCollection paged Recipient User list representation.
7445type RecipientEmailCollection struct {
7446	autorest.Response `json:"-"`
7447	// Value - Page values.
7448	Value *[]RecipientEmailContract `json:"value,omitempty"`
7449	// NextLink - Next page link if any.
7450	NextLink *string `json:"nextLink,omitempty"`
7451}
7452
7453// RecipientEmailContract recipient Email details.
7454type RecipientEmailContract struct {
7455	autorest.Response `json:"-"`
7456	// RecipientEmailContractProperties - Recipient Email contract properties.
7457	*RecipientEmailContractProperties `json:"properties,omitempty"`
7458	// ID - READ-ONLY; Resource ID.
7459	ID *string `json:"id,omitempty"`
7460	// Name - READ-ONLY; Resource name.
7461	Name *string `json:"name,omitempty"`
7462	// Type - READ-ONLY; Resource type for API Management resource.
7463	Type *string `json:"type,omitempty"`
7464}
7465
7466// MarshalJSON is the custom marshaler for RecipientEmailContract.
7467func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) {
7468	objectMap := make(map[string]interface{})
7469	if rec.RecipientEmailContractProperties != nil {
7470		objectMap["properties"] = rec.RecipientEmailContractProperties
7471	}
7472	return json.Marshal(objectMap)
7473}
7474
7475// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct.
7476func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error {
7477	var m map[string]*json.RawMessage
7478	err := json.Unmarshal(body, &m)
7479	if err != nil {
7480		return err
7481	}
7482	for k, v := range m {
7483		switch k {
7484		case "properties":
7485			if v != nil {
7486				var recipientEmailContractProperties RecipientEmailContractProperties
7487				err = json.Unmarshal(*v, &recipientEmailContractProperties)
7488				if err != nil {
7489					return err
7490				}
7491				rec.RecipientEmailContractProperties = &recipientEmailContractProperties
7492			}
7493		case "id":
7494			if v != nil {
7495				var ID string
7496				err = json.Unmarshal(*v, &ID)
7497				if err != nil {
7498					return err
7499				}
7500				rec.ID = &ID
7501			}
7502		case "name":
7503			if v != nil {
7504				var name string
7505				err = json.Unmarshal(*v, &name)
7506				if err != nil {
7507					return err
7508				}
7509				rec.Name = &name
7510			}
7511		case "type":
7512			if v != nil {
7513				var typeVar string
7514				err = json.Unmarshal(*v, &typeVar)
7515				if err != nil {
7516					return err
7517				}
7518				rec.Type = &typeVar
7519			}
7520		}
7521	}
7522
7523	return nil
7524}
7525
7526// RecipientEmailContractProperties recipient Email Contract Properties.
7527type RecipientEmailContractProperties struct {
7528	// Email - User Email subscribed to notification.
7529	Email *string `json:"email,omitempty"`
7530}
7531
7532// RecipientsContractProperties notification Parameter contract.
7533type RecipientsContractProperties struct {
7534	// Emails - List of Emails subscribed for the notification.
7535	Emails *[]string `json:"emails,omitempty"`
7536	// Users - List of Users subscribed for the notification.
7537	Users *[]string `json:"users,omitempty"`
7538}
7539
7540// RecipientUserCollection paged Recipient User list representation.
7541type RecipientUserCollection struct {
7542	autorest.Response `json:"-"`
7543	// Value - Page values.
7544	Value *[]RecipientUserContract `json:"value,omitempty"`
7545	// NextLink - Next page link if any.
7546	NextLink *string `json:"nextLink,omitempty"`
7547}
7548
7549// RecipientUserContract recipient User details.
7550type RecipientUserContract struct {
7551	autorest.Response `json:"-"`
7552	// RecipientUsersContractProperties - Recipient User entity contract properties.
7553	*RecipientUsersContractProperties `json:"properties,omitempty"`
7554	// ID - READ-ONLY; Resource ID.
7555	ID *string `json:"id,omitempty"`
7556	// Name - READ-ONLY; Resource name.
7557	Name *string `json:"name,omitempty"`
7558	// Type - READ-ONLY; Resource type for API Management resource.
7559	Type *string `json:"type,omitempty"`
7560}
7561
7562// MarshalJSON is the custom marshaler for RecipientUserContract.
7563func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) {
7564	objectMap := make(map[string]interface{})
7565	if ruc.RecipientUsersContractProperties != nil {
7566		objectMap["properties"] = ruc.RecipientUsersContractProperties
7567	}
7568	return json.Marshal(objectMap)
7569}
7570
7571// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct.
7572func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error {
7573	var m map[string]*json.RawMessage
7574	err := json.Unmarshal(body, &m)
7575	if err != nil {
7576		return err
7577	}
7578	for k, v := range m {
7579		switch k {
7580		case "properties":
7581			if v != nil {
7582				var recipientUsersContractProperties RecipientUsersContractProperties
7583				err = json.Unmarshal(*v, &recipientUsersContractProperties)
7584				if err != nil {
7585					return err
7586				}
7587				ruc.RecipientUsersContractProperties = &recipientUsersContractProperties
7588			}
7589		case "id":
7590			if v != nil {
7591				var ID string
7592				err = json.Unmarshal(*v, &ID)
7593				if err != nil {
7594					return err
7595				}
7596				ruc.ID = &ID
7597			}
7598		case "name":
7599			if v != nil {
7600				var name string
7601				err = json.Unmarshal(*v, &name)
7602				if err != nil {
7603					return err
7604				}
7605				ruc.Name = &name
7606			}
7607		case "type":
7608			if v != nil {
7609				var typeVar string
7610				err = json.Unmarshal(*v, &typeVar)
7611				if err != nil {
7612					return err
7613				}
7614				ruc.Type = &typeVar
7615			}
7616		}
7617	}
7618
7619	return nil
7620}
7621
7622// RecipientUsersContractProperties recipient User Contract Properties.
7623type RecipientUsersContractProperties struct {
7624	// UserID - API Management UserId subscribed to notification.
7625	UserID *string `json:"userId,omitempty"`
7626}
7627
7628// RegionContract region profile.
7629type RegionContract struct {
7630	// Name - READ-ONLY; Region name.
7631	Name *string `json:"name,omitempty"`
7632	// IsMasterRegion - whether Region is the master region.
7633	IsMasterRegion *bool `json:"isMasterRegion,omitempty"`
7634	// IsDeleted - whether Region is deleted.
7635	IsDeleted *bool `json:"isDeleted,omitempty"`
7636}
7637
7638// MarshalJSON is the custom marshaler for RegionContract.
7639func (rc RegionContract) MarshalJSON() ([]byte, error) {
7640	objectMap := make(map[string]interface{})
7641	if rc.IsMasterRegion != nil {
7642		objectMap["isMasterRegion"] = rc.IsMasterRegion
7643	}
7644	if rc.IsDeleted != nil {
7645		objectMap["isDeleted"] = rc.IsDeleted
7646	}
7647	return json.Marshal(objectMap)
7648}
7649
7650// RegionListResult lists Regions operation response details.
7651type RegionListResult struct {
7652	autorest.Response `json:"-"`
7653	// Value - Lists of Regions.
7654	Value *[]RegionContract `json:"value,omitempty"`
7655	// Count - Total record count number across all pages.
7656	Count *int64 `json:"count,omitempty"`
7657	// NextLink - Next page link if any.
7658	NextLink *string `json:"nextLink,omitempty"`
7659}
7660
7661// RegistrationDelegationSettingsProperties user registration delegation settings properties.
7662type RegistrationDelegationSettingsProperties struct {
7663	// Enabled - Enable or disable delegation for user registration.
7664	Enabled *bool `json:"enabled,omitempty"`
7665}
7666
7667// ReportCollection paged Report records list representation.
7668type ReportCollection struct {
7669	autorest.Response `json:"-"`
7670	// Value - Page values.
7671	Value *[]ReportRecordContract `json:"value,omitempty"`
7672	// Count - Total record count number across all pages.
7673	Count *int64 `json:"count,omitempty"`
7674	// NextLink - Next page link if any.
7675	NextLink *string `json:"nextLink,omitempty"`
7676}
7677
7678// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values.
7679type ReportCollectionIterator struct {
7680	i    int
7681	page ReportCollectionPage
7682}
7683
7684// NextWithContext advances to the next value.  If there was an error making
7685// the request the iterator does not advance and the error is returned.
7686func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7687	if tracing.IsEnabled() {
7688		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext")
7689		defer func() {
7690			sc := -1
7691			if iter.Response().Response.Response != nil {
7692				sc = iter.Response().Response.Response.StatusCode
7693			}
7694			tracing.EndSpan(ctx, sc, err)
7695		}()
7696	}
7697	iter.i++
7698	if iter.i < len(iter.page.Values()) {
7699		return nil
7700	}
7701	err = iter.page.NextWithContext(ctx)
7702	if err != nil {
7703		iter.i--
7704		return err
7705	}
7706	iter.i = 0
7707	return nil
7708}
7709
7710// Next advances to the next value.  If there was an error making
7711// the request the iterator does not advance and the error is returned.
7712// Deprecated: Use NextWithContext() instead.
7713func (iter *ReportCollectionIterator) Next() error {
7714	return iter.NextWithContext(context.Background())
7715}
7716
7717// NotDone returns true if the enumeration should be started or is not yet complete.
7718func (iter ReportCollectionIterator) NotDone() bool {
7719	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7720}
7721
7722// Response returns the raw server response from the last page request.
7723func (iter ReportCollectionIterator) Response() ReportCollection {
7724	return iter.page.Response()
7725}
7726
7727// Value returns the current value or a zero-initialized value if the
7728// iterator has advanced beyond the end of the collection.
7729func (iter ReportCollectionIterator) Value() ReportRecordContract {
7730	if !iter.page.NotDone() {
7731		return ReportRecordContract{}
7732	}
7733	return iter.page.Values()[iter.i]
7734}
7735
7736// Creates a new instance of the ReportCollectionIterator type.
7737func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator {
7738	return ReportCollectionIterator{page: page}
7739}
7740
7741// IsEmpty returns true if the ListResult contains no values.
7742func (rc ReportCollection) IsEmpty() bool {
7743	return rc.Value == nil || len(*rc.Value) == 0
7744}
7745
7746// hasNextLink returns true if the NextLink is not empty.
7747func (rc ReportCollection) hasNextLink() bool {
7748	return rc.NextLink != nil && len(*rc.NextLink) != 0
7749}
7750
7751// reportCollectionPreparer prepares a request to retrieve the next set of results.
7752// It returns nil if no more results exist.
7753func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) {
7754	if !rc.hasNextLink() {
7755		return nil, nil
7756	}
7757	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7758		autorest.AsJSON(),
7759		autorest.AsGet(),
7760		autorest.WithBaseURL(to.String(rc.NextLink)))
7761}
7762
7763// ReportCollectionPage contains a page of ReportRecordContract values.
7764type ReportCollectionPage struct {
7765	fn func(context.Context, ReportCollection) (ReportCollection, error)
7766	rc ReportCollection
7767}
7768
7769// NextWithContext advances to the next page of values.  If there was an error making
7770// the request the page does not advance and the error is returned.
7771func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) {
7772	if tracing.IsEnabled() {
7773		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext")
7774		defer func() {
7775			sc := -1
7776			if page.Response().Response.Response != nil {
7777				sc = page.Response().Response.Response.StatusCode
7778			}
7779			tracing.EndSpan(ctx, sc, err)
7780		}()
7781	}
7782	for {
7783		next, err := page.fn(ctx, page.rc)
7784		if err != nil {
7785			return err
7786		}
7787		page.rc = next
7788		if !next.hasNextLink() || !next.IsEmpty() {
7789			break
7790		}
7791	}
7792	return nil
7793}
7794
7795// Next advances to the next page of values.  If there was an error making
7796// the request the page does not advance and the error is returned.
7797// Deprecated: Use NextWithContext() instead.
7798func (page *ReportCollectionPage) Next() error {
7799	return page.NextWithContext(context.Background())
7800}
7801
7802// NotDone returns true if the page enumeration should be started or is not yet complete.
7803func (page ReportCollectionPage) NotDone() bool {
7804	return !page.rc.IsEmpty()
7805}
7806
7807// Response returns the raw server response from the last page request.
7808func (page ReportCollectionPage) Response() ReportCollection {
7809	return page.rc
7810}
7811
7812// Values returns the slice of values for the current page or nil if there are no values.
7813func (page ReportCollectionPage) Values() []ReportRecordContract {
7814	if page.rc.IsEmpty() {
7815		return nil
7816	}
7817	return *page.rc.Value
7818}
7819
7820// Creates a new instance of the ReportCollectionPage type.
7821func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage {
7822	return ReportCollectionPage{
7823		fn: getNextPage,
7824		rc: cur,
7825	}
7826}
7827
7828// ReportRecordContract report data.
7829type ReportRecordContract struct {
7830	// Name - Name depending on report endpoint specifies product, API, operation or developer name.
7831	Name *string `json:"name,omitempty"`
7832	// Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
7833	Timestamp *date.Time `json:"timestamp,omitempty"`
7834	// Interval - Length of aggregation period.  Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).
7835	Interval *string `json:"interval,omitempty"`
7836	// Country - Country to which this record data is related.
7837	Country *string `json:"country,omitempty"`
7838	// Region - Country region to which this record data is related.
7839	Region *string `json:"region,omitempty"`
7840	// Zip - Zip code to which this record data is related.
7841	Zip *string `json:"zip,omitempty"`
7842	// UserID - READ-ONLY; User identifier path. /users/{userId}
7843	UserID *string `json:"userId,omitempty"`
7844	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
7845	ProductID *string `json:"productId,omitempty"`
7846	// APIID - API identifier path. /apis/{apiId}
7847	APIID *string `json:"apiId,omitempty"`
7848	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
7849	OperationID *string `json:"operationId,omitempty"`
7850	// APIRegion - API region identifier.
7851	APIRegion *string `json:"apiRegion,omitempty"`
7852	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
7853	SubscriptionID *string `json:"subscriptionId,omitempty"`
7854	// CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect
7855	CallCountSuccess *int32 `json:"callCountSuccess,omitempty"`
7856	// CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests
7857	CallCountBlocked *int32 `json:"callCountBlocked,omitempty"`
7858	// CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600
7859	CallCountFailed *int32 `json:"callCountFailed,omitempty"`
7860	// CallCountOther - Number of other calls.
7861	CallCountOther *int32 `json:"callCountOther,omitempty"`
7862	// CallCountTotal - Total number of calls.
7863	CallCountTotal *int32 `json:"callCountTotal,omitempty"`
7864	// Bandwidth - Bandwidth consumed.
7865	Bandwidth *int64 `json:"bandwidth,omitempty"`
7866	// CacheHitCount - Number of times when content was served from cache policy.
7867	CacheHitCount *int32 `json:"cacheHitCount,omitempty"`
7868	// CacheMissCount - Number of times content was fetched from backend.
7869	CacheMissCount *int32 `json:"cacheMissCount,omitempty"`
7870	// APITimeAvg - Average time it took to process request.
7871	APITimeAvg *float64 `json:"apiTimeAvg,omitempty"`
7872	// APITimeMin - Minimum time it took to process request.
7873	APITimeMin *float64 `json:"apiTimeMin,omitempty"`
7874	// APITimeMax - Maximum time it took to process request.
7875	APITimeMax *float64 `json:"apiTimeMax,omitempty"`
7876	// ServiceTimeAvg - Average time it took to process request on backend.
7877	ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"`
7878	// ServiceTimeMin - Minimum time it took to process request on backend.
7879	ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"`
7880	// ServiceTimeMax - Maximum time it took to process request on backend.
7881	ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"`
7882}
7883
7884// MarshalJSON is the custom marshaler for ReportRecordContract.
7885func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) {
7886	objectMap := make(map[string]interface{})
7887	if rrc.Name != nil {
7888		objectMap["name"] = rrc.Name
7889	}
7890	if rrc.Timestamp != nil {
7891		objectMap["timestamp"] = rrc.Timestamp
7892	}
7893	if rrc.Interval != nil {
7894		objectMap["interval"] = rrc.Interval
7895	}
7896	if rrc.Country != nil {
7897		objectMap["country"] = rrc.Country
7898	}
7899	if rrc.Region != nil {
7900		objectMap["region"] = rrc.Region
7901	}
7902	if rrc.Zip != nil {
7903		objectMap["zip"] = rrc.Zip
7904	}
7905	if rrc.APIID != nil {
7906		objectMap["apiId"] = rrc.APIID
7907	}
7908	if rrc.OperationID != nil {
7909		objectMap["operationId"] = rrc.OperationID
7910	}
7911	if rrc.APIRegion != nil {
7912		objectMap["apiRegion"] = rrc.APIRegion
7913	}
7914	if rrc.SubscriptionID != nil {
7915		objectMap["subscriptionId"] = rrc.SubscriptionID
7916	}
7917	if rrc.CallCountSuccess != nil {
7918		objectMap["callCountSuccess"] = rrc.CallCountSuccess
7919	}
7920	if rrc.CallCountBlocked != nil {
7921		objectMap["callCountBlocked"] = rrc.CallCountBlocked
7922	}
7923	if rrc.CallCountFailed != nil {
7924		objectMap["callCountFailed"] = rrc.CallCountFailed
7925	}
7926	if rrc.CallCountOther != nil {
7927		objectMap["callCountOther"] = rrc.CallCountOther
7928	}
7929	if rrc.CallCountTotal != nil {
7930		objectMap["callCountTotal"] = rrc.CallCountTotal
7931	}
7932	if rrc.Bandwidth != nil {
7933		objectMap["bandwidth"] = rrc.Bandwidth
7934	}
7935	if rrc.CacheHitCount != nil {
7936		objectMap["cacheHitCount"] = rrc.CacheHitCount
7937	}
7938	if rrc.CacheMissCount != nil {
7939		objectMap["cacheMissCount"] = rrc.CacheMissCount
7940	}
7941	if rrc.APITimeAvg != nil {
7942		objectMap["apiTimeAvg"] = rrc.APITimeAvg
7943	}
7944	if rrc.APITimeMin != nil {
7945		objectMap["apiTimeMin"] = rrc.APITimeMin
7946	}
7947	if rrc.APITimeMax != nil {
7948		objectMap["apiTimeMax"] = rrc.APITimeMax
7949	}
7950	if rrc.ServiceTimeAvg != nil {
7951		objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg
7952	}
7953	if rrc.ServiceTimeMin != nil {
7954		objectMap["serviceTimeMin"] = rrc.ServiceTimeMin
7955	}
7956	if rrc.ServiceTimeMax != nil {
7957		objectMap["serviceTimeMax"] = rrc.ServiceTimeMax
7958	}
7959	return json.Marshal(objectMap)
7960}
7961
7962// RepresentationContract operation request/response representation details.
7963type RepresentationContract struct {
7964	// ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml.
7965	ContentType *string `json:"contentType,omitempty"`
7966	// Sample - An example of the representation.
7967	Sample *string `json:"sample,omitempty"`
7968	// SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
7969	SchemaID *string `json:"schemaId,omitempty"`
7970	// TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
7971	TypeName *string `json:"typeName,omitempty"`
7972	// FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
7973	FormParameters *[]ParameterContract `json:"formParameters,omitempty"`
7974}
7975
7976// RequestContract operation request details.
7977type RequestContract struct {
7978	// Description - Operation request description.
7979	Description *string `json:"description,omitempty"`
7980	// QueryParameters - Collection of operation request query parameters.
7981	QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"`
7982	// Headers - Collection of operation request headers.
7983	Headers *[]ParameterContract `json:"headers,omitempty"`
7984	// Representations - Collection of operation request representations.
7985	Representations *[]RepresentationContract `json:"representations,omitempty"`
7986}
7987
7988// RequestReportCollection paged Report records list representation.
7989type RequestReportCollection struct {
7990	autorest.Response `json:"-"`
7991	// Value - Page values.
7992	Value *[]RequestReportRecordContract `json:"value,omitempty"`
7993	// Count - Total record count number across all pages.
7994	Count *int64 `json:"count,omitempty"`
7995}
7996
7997// RequestReportRecordContract request Report data.
7998type RequestReportRecordContract struct {
7999	// APIID - API identifier path. /apis/{apiId}
8000	APIID *string `json:"apiId,omitempty"`
8001	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
8002	OperationID *string `json:"operationId,omitempty"`
8003	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
8004	ProductID *string `json:"productId,omitempty"`
8005	// UserID - READ-ONLY; User identifier path. /users/{userId}
8006	UserID *string `json:"userId,omitempty"`
8007	// Method - The HTTP method associated with this request..
8008	Method *string `json:"method,omitempty"`
8009	// URL - The full URL associated with this request.
8010	URL *string `json:"url,omitempty"`
8011	// IPAddress - The client IP address associated with this request.
8012	IPAddress *string `json:"ipAddress,omitempty"`
8013	// BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend.
8014	BackendResponseCode *string `json:"backendResponseCode,omitempty"`
8015	// ResponseCode - The HTTP status code returned by the gateway.
8016	ResponseCode *int32 `json:"responseCode,omitempty"`
8017	// ResponseSize - The size of the response returned by the gateway.
8018	ResponseSize *int32 `json:"responseSize,omitempty"`
8019	// Timestamp - The date and time when this request was received by the gateway in ISO 8601 format.
8020	Timestamp *date.Time `json:"timestamp,omitempty"`
8021	// Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend.
8022	Cache *string `json:"cache,omitempty"`
8023	// APITime - The total time it took to process this request.
8024	APITime *float64 `json:"apiTime,omitempty"`
8025	// ServiceTime - he time it took to forward this request to the backend and get the response back.
8026	ServiceTime *float64 `json:"serviceTime,omitempty"`
8027	// APIRegion - Azure region where the gateway that processed this request is located.
8028	APIRegion *string `json:"apiRegion,omitempty"`
8029	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
8030	SubscriptionID *string `json:"subscriptionId,omitempty"`
8031	// RequestID - Request Identifier.
8032	RequestID *string `json:"requestId,omitempty"`
8033	// RequestSize - The size of this request..
8034	RequestSize *int32 `json:"requestSize,omitempty"`
8035}
8036
8037// MarshalJSON is the custom marshaler for RequestReportRecordContract.
8038func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) {
8039	objectMap := make(map[string]interface{})
8040	if rrrc.APIID != nil {
8041		objectMap["apiId"] = rrrc.APIID
8042	}
8043	if rrrc.OperationID != nil {
8044		objectMap["operationId"] = rrrc.OperationID
8045	}
8046	if rrrc.Method != nil {
8047		objectMap["method"] = rrrc.Method
8048	}
8049	if rrrc.URL != nil {
8050		objectMap["url"] = rrrc.URL
8051	}
8052	if rrrc.IPAddress != nil {
8053		objectMap["ipAddress"] = rrrc.IPAddress
8054	}
8055	if rrrc.BackendResponseCode != nil {
8056		objectMap["backendResponseCode"] = rrrc.BackendResponseCode
8057	}
8058	if rrrc.ResponseCode != nil {
8059		objectMap["responseCode"] = rrrc.ResponseCode
8060	}
8061	if rrrc.ResponseSize != nil {
8062		objectMap["responseSize"] = rrrc.ResponseSize
8063	}
8064	if rrrc.Timestamp != nil {
8065		objectMap["timestamp"] = rrrc.Timestamp
8066	}
8067	if rrrc.Cache != nil {
8068		objectMap["cache"] = rrrc.Cache
8069	}
8070	if rrrc.APITime != nil {
8071		objectMap["apiTime"] = rrrc.APITime
8072	}
8073	if rrrc.ServiceTime != nil {
8074		objectMap["serviceTime"] = rrrc.ServiceTime
8075	}
8076	if rrrc.APIRegion != nil {
8077		objectMap["apiRegion"] = rrrc.APIRegion
8078	}
8079	if rrrc.SubscriptionID != nil {
8080		objectMap["subscriptionId"] = rrrc.SubscriptionID
8081	}
8082	if rrrc.RequestID != nil {
8083		objectMap["requestId"] = rrrc.RequestID
8084	}
8085	if rrrc.RequestSize != nil {
8086		objectMap["requestSize"] = rrrc.RequestSize
8087	}
8088	return json.Marshal(objectMap)
8089}
8090
8091// Resource the Resource definition.
8092type Resource struct {
8093	// ID - READ-ONLY; Resource ID.
8094	ID *string `json:"id,omitempty"`
8095	// Name - READ-ONLY; Resource name.
8096	Name *string `json:"name,omitempty"`
8097	// Type - READ-ONLY; Resource type for API Management resource.
8098	Type *string `json:"type,omitempty"`
8099}
8100
8101// MarshalJSON is the custom marshaler for Resource.
8102func (r Resource) MarshalJSON() ([]byte, error) {
8103	objectMap := make(map[string]interface{})
8104	return json.Marshal(objectMap)
8105}
8106
8107// ResponseContract operation response details.
8108type ResponseContract struct {
8109	// StatusCode - Operation response HTTP status code.
8110	StatusCode *int32 `json:"statusCode,omitempty"`
8111	// Description - Operation response description.
8112	Description *string `json:"description,omitempty"`
8113	// Representations - Collection of operation response representations.
8114	Representations *[]RepresentationContract `json:"representations,omitempty"`
8115	// Headers - Collection of operation response headers.
8116	Headers *[]ParameterContract `json:"headers,omitempty"`
8117}
8118
8119// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation.
8120type SaveConfigurationParameter struct {
8121	// Branch - The name of the Git branch in which to commit the current configuration snapshot.
8122	Branch *string `json:"branch,omitempty"`
8123	// Force - The value if true, the current configuration database is committed to the Git repository, even if the Git repository has newer changes that would be overwritten.
8124	Force *bool `json:"force,omitempty"`
8125}
8126
8127// SchemaCollection the response of the list schema operation.
8128type SchemaCollection struct {
8129	autorest.Response `json:"-"`
8130	// Value - READ-ONLY; Api Schema Contract value.
8131	Value *[]SchemaContract `json:"value,omitempty"`
8132	// NextLink - READ-ONLY; Next page link if any.
8133	NextLink *string `json:"nextLink,omitempty"`
8134}
8135
8136// MarshalJSON is the custom marshaler for SchemaCollection.
8137func (sc SchemaCollection) MarshalJSON() ([]byte, error) {
8138	objectMap := make(map[string]interface{})
8139	return json.Marshal(objectMap)
8140}
8141
8142// SchemaCollectionIterator provides access to a complete listing of SchemaContract values.
8143type SchemaCollectionIterator struct {
8144	i    int
8145	page SchemaCollectionPage
8146}
8147
8148// NextWithContext advances to the next value.  If there was an error making
8149// the request the iterator does not advance and the error is returned.
8150func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) {
8151	if tracing.IsEnabled() {
8152		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext")
8153		defer func() {
8154			sc := -1
8155			if iter.Response().Response.Response != nil {
8156				sc = iter.Response().Response.Response.StatusCode
8157			}
8158			tracing.EndSpan(ctx, sc, err)
8159		}()
8160	}
8161	iter.i++
8162	if iter.i < len(iter.page.Values()) {
8163		return nil
8164	}
8165	err = iter.page.NextWithContext(ctx)
8166	if err != nil {
8167		iter.i--
8168		return err
8169	}
8170	iter.i = 0
8171	return nil
8172}
8173
8174// Next advances to the next value.  If there was an error making
8175// the request the iterator does not advance and the error is returned.
8176// Deprecated: Use NextWithContext() instead.
8177func (iter *SchemaCollectionIterator) Next() error {
8178	return iter.NextWithContext(context.Background())
8179}
8180
8181// NotDone returns true if the enumeration should be started or is not yet complete.
8182func (iter SchemaCollectionIterator) NotDone() bool {
8183	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8184}
8185
8186// Response returns the raw server response from the last page request.
8187func (iter SchemaCollectionIterator) Response() SchemaCollection {
8188	return iter.page.Response()
8189}
8190
8191// Value returns the current value or a zero-initialized value if the
8192// iterator has advanced beyond the end of the collection.
8193func (iter SchemaCollectionIterator) Value() SchemaContract {
8194	if !iter.page.NotDone() {
8195		return SchemaContract{}
8196	}
8197	return iter.page.Values()[iter.i]
8198}
8199
8200// Creates a new instance of the SchemaCollectionIterator type.
8201func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator {
8202	return SchemaCollectionIterator{page: page}
8203}
8204
8205// IsEmpty returns true if the ListResult contains no values.
8206func (sc SchemaCollection) IsEmpty() bool {
8207	return sc.Value == nil || len(*sc.Value) == 0
8208}
8209
8210// hasNextLink returns true if the NextLink is not empty.
8211func (sc SchemaCollection) hasNextLink() bool {
8212	return sc.NextLink != nil && len(*sc.NextLink) != 0
8213}
8214
8215// schemaCollectionPreparer prepares a request to retrieve the next set of results.
8216// It returns nil if no more results exist.
8217func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) {
8218	if !sc.hasNextLink() {
8219		return nil, nil
8220	}
8221	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8222		autorest.AsJSON(),
8223		autorest.AsGet(),
8224		autorest.WithBaseURL(to.String(sc.NextLink)))
8225}
8226
8227// SchemaCollectionPage contains a page of SchemaContract values.
8228type SchemaCollectionPage struct {
8229	fn func(context.Context, SchemaCollection) (SchemaCollection, error)
8230	sc SchemaCollection
8231}
8232
8233// NextWithContext advances to the next page of values.  If there was an error making
8234// the request the page does not advance and the error is returned.
8235func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) {
8236	if tracing.IsEnabled() {
8237		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext")
8238		defer func() {
8239			sc := -1
8240			if page.Response().Response.Response != nil {
8241				sc = page.Response().Response.Response.StatusCode
8242			}
8243			tracing.EndSpan(ctx, sc, err)
8244		}()
8245	}
8246	for {
8247		next, err := page.fn(ctx, page.sc)
8248		if err != nil {
8249			return err
8250		}
8251		page.sc = next
8252		if !next.hasNextLink() || !next.IsEmpty() {
8253			break
8254		}
8255	}
8256	return nil
8257}
8258
8259// Next advances to the next page of values.  If there was an error making
8260// the request the page does not advance and the error is returned.
8261// Deprecated: Use NextWithContext() instead.
8262func (page *SchemaCollectionPage) Next() error {
8263	return page.NextWithContext(context.Background())
8264}
8265
8266// NotDone returns true if the page enumeration should be started or is not yet complete.
8267func (page SchemaCollectionPage) NotDone() bool {
8268	return !page.sc.IsEmpty()
8269}
8270
8271// Response returns the raw server response from the last page request.
8272func (page SchemaCollectionPage) Response() SchemaCollection {
8273	return page.sc
8274}
8275
8276// Values returns the slice of values for the current page or nil if there are no values.
8277func (page SchemaCollectionPage) Values() []SchemaContract {
8278	if page.sc.IsEmpty() {
8279		return nil
8280	}
8281	return *page.sc.Value
8282}
8283
8284// Creates a new instance of the SchemaCollectionPage type.
8285func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage {
8286	return SchemaCollectionPage{
8287		fn: getNextPage,
8288		sc: cur,
8289	}
8290}
8291
8292// SchemaContract schema Contract details.
8293type SchemaContract struct {
8294	autorest.Response `json:"-"`
8295	// SchemaContractProperties - Properties of the Schema.
8296	*SchemaContractProperties `json:"properties,omitempty"`
8297	// ID - READ-ONLY; Resource ID.
8298	ID *string `json:"id,omitempty"`
8299	// Name - READ-ONLY; Resource name.
8300	Name *string `json:"name,omitempty"`
8301	// Type - READ-ONLY; Resource type for API Management resource.
8302	Type *string `json:"type,omitempty"`
8303}
8304
8305// MarshalJSON is the custom marshaler for SchemaContract.
8306func (sc SchemaContract) MarshalJSON() ([]byte, error) {
8307	objectMap := make(map[string]interface{})
8308	if sc.SchemaContractProperties != nil {
8309		objectMap["properties"] = sc.SchemaContractProperties
8310	}
8311	return json.Marshal(objectMap)
8312}
8313
8314// UnmarshalJSON is the custom unmarshaler for SchemaContract struct.
8315func (sc *SchemaContract) UnmarshalJSON(body []byte) error {
8316	var m map[string]*json.RawMessage
8317	err := json.Unmarshal(body, &m)
8318	if err != nil {
8319		return err
8320	}
8321	for k, v := range m {
8322		switch k {
8323		case "properties":
8324			if v != nil {
8325				var schemaContractProperties SchemaContractProperties
8326				err = json.Unmarshal(*v, &schemaContractProperties)
8327				if err != nil {
8328					return err
8329				}
8330				sc.SchemaContractProperties = &schemaContractProperties
8331			}
8332		case "id":
8333			if v != nil {
8334				var ID string
8335				err = json.Unmarshal(*v, &ID)
8336				if err != nil {
8337					return err
8338				}
8339				sc.ID = &ID
8340			}
8341		case "name":
8342			if v != nil {
8343				var name string
8344				err = json.Unmarshal(*v, &name)
8345				if err != nil {
8346					return err
8347				}
8348				sc.Name = &name
8349			}
8350		case "type":
8351			if v != nil {
8352				var typeVar string
8353				err = json.Unmarshal(*v, &typeVar)
8354				if err != nil {
8355					return err
8356				}
8357				sc.Type = &typeVar
8358			}
8359		}
8360	}
8361
8362	return nil
8363}
8364
8365// SchemaContractProperties schema contract Properties.
8366type SchemaContractProperties struct {
8367	// ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml).
8368	ContentType *string `json:"contentType,omitempty"`
8369	// SchemaDocumentProperties - Properties of the Schema Document.
8370	*SchemaDocumentProperties `json:"document,omitempty"`
8371}
8372
8373// MarshalJSON is the custom marshaler for SchemaContractProperties.
8374func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) {
8375	objectMap := make(map[string]interface{})
8376	if scp.ContentType != nil {
8377		objectMap["contentType"] = scp.ContentType
8378	}
8379	if scp.SchemaDocumentProperties != nil {
8380		objectMap["document"] = scp.SchemaDocumentProperties
8381	}
8382	return json.Marshal(objectMap)
8383}
8384
8385// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct.
8386func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error {
8387	var m map[string]*json.RawMessage
8388	err := json.Unmarshal(body, &m)
8389	if err != nil {
8390		return err
8391	}
8392	for k, v := range m {
8393		switch k {
8394		case "contentType":
8395			if v != nil {
8396				var contentType string
8397				err = json.Unmarshal(*v, &contentType)
8398				if err != nil {
8399					return err
8400				}
8401				scp.ContentType = &contentType
8402			}
8403		case "document":
8404			if v != nil {
8405				var schemaDocumentProperties SchemaDocumentProperties
8406				err = json.Unmarshal(*v, &schemaDocumentProperties)
8407				if err != nil {
8408					return err
8409				}
8410				scp.SchemaDocumentProperties = &schemaDocumentProperties
8411			}
8412		}
8413	}
8414
8415	return nil
8416}
8417
8418// SchemaDocumentProperties schema Document Properties.
8419type SchemaDocumentProperties struct {
8420	// Value - Json escaped string defining the document representing the Schema.
8421	Value *string `json:"value,omitempty"`
8422}
8423
8424// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration
8425// operation.
8426type ServiceApplyNetworkConfigurationParameters struct {
8427	// Location - Location of the Api Management service to update for a multi-region service. For a service deployed in a single region, this parameter is not required.
8428	Location *string `json:"location,omitempty"`
8429}
8430
8431// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results
8432// of a long-running operation.
8433type ServiceApplyNetworkConfigurationUpdatesFuture struct {
8434	azure.FutureAPI
8435	// Result returns the result of the asynchronous operation.
8436	// If the operation has not completed it will return an error.
8437	Result func(ServiceClient) (ServiceResource, error)
8438}
8439
8440// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8441func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error {
8442	var azFuture azure.Future
8443	if err := json.Unmarshal(body, &azFuture); err != nil {
8444		return err
8445	}
8446	future.FutureAPI = &azFuture
8447	future.Result = future.result
8448	return nil
8449}
8450
8451// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result.
8452func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) {
8453	var done bool
8454	done, err = future.DoneWithContext(context.Background(), client)
8455	if err != nil {
8456		err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure")
8457		return
8458	}
8459	if !done {
8460		sr.Response.Response = future.Response()
8461		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture")
8462		return
8463	}
8464	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8465	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
8466		sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response)
8467		if err != nil {
8468			err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request")
8469		}
8470	}
8471	return
8472}
8473
8474// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running
8475// operation.
8476type ServiceBackupFuture struct {
8477	azure.FutureAPI
8478	// Result returns the result of the asynchronous operation.
8479	// If the operation has not completed it will return an error.
8480	Result func(ServiceClient) (ServiceResource, error)
8481}
8482
8483// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8484func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error {
8485	var azFuture azure.Future
8486	if err := json.Unmarshal(body, &azFuture); err != nil {
8487		return err
8488	}
8489	future.FutureAPI = &azFuture
8490	future.Result = future.result
8491	return nil
8492}
8493
8494// result is the default implementation for ServiceBackupFuture.Result.
8495func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) {
8496	var done bool
8497	done, err = future.DoneWithContext(context.Background(), client)
8498	if err != nil {
8499		err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure")
8500		return
8501	}
8502	if !done {
8503		sr.Response.Response = future.Response()
8504		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture")
8505		return
8506	}
8507	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8508	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
8509		sr, err = client.BackupResponder(sr.Response.Response)
8510		if err != nil {
8511			err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request")
8512		}
8513	}
8514	return
8515}
8516
8517// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service
8518// operation.
8519type ServiceBackupRestoreParameters struct {
8520	// StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name.
8521	StorageAccount *string `json:"storageAccount,omitempty"`
8522	// AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key.
8523	AccessKey *string `json:"accessKey,omitempty"`
8524	// ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup.
8525	ContainerName *string `json:"containerName,omitempty"`
8526	// BackupName - The name of the backup file to create.
8527	BackupName *string `json:"backupName,omitempty"`
8528}
8529
8530// ServiceBaseProperties base Properties of an API Management service resource description.
8531type ServiceBaseProperties struct {
8532	// NotificationSenderEmail - Email address from which the notification will be sent.
8533	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
8534	// ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
8535	ProvisioningState *string `json:"provisioningState,omitempty"`
8536	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
8537	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
8538	// CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
8539	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
8540	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
8541	GatewayURL *string `json:"gatewayUrl,omitempty"`
8542	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
8543	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
8544	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
8545	PortalURL *string `json:"portalUrl,omitempty"`
8546	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
8547	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
8548	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
8549	ScmURL *string `json:"scmUrl,omitempty"`
8550	// HostnameConfigurations - Custom hostname configuration of the API Management service.
8551	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
8552	// StaticIps - READ-ONLY; Static IP addresses of the API Management service virtual machines. Available only for Standard and Premium SKU.
8553	StaticIps *[]string `json:"staticIps,omitempty"`
8554	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
8555	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
8556	// AdditionalLocations - Additional datacenter locations of the API Management service.
8557	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
8558	// CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
8559	CustomProperties map[string]*string `json:"customProperties"`
8560	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
8561	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
8562	// VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal'
8563	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
8564}
8565
8566// MarshalJSON is the custom marshaler for ServiceBaseProperties.
8567func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) {
8568	objectMap := make(map[string]interface{})
8569	if sbp.NotificationSenderEmail != nil {
8570		objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail
8571	}
8572	if sbp.HostnameConfigurations != nil {
8573		objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations
8574	}
8575	if sbp.VirtualNetworkConfiguration != nil {
8576		objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration
8577	}
8578	if sbp.AdditionalLocations != nil {
8579		objectMap["additionalLocations"] = sbp.AdditionalLocations
8580	}
8581	if sbp.CustomProperties != nil {
8582		objectMap["customProperties"] = sbp.CustomProperties
8583	}
8584	if sbp.Certificates != nil {
8585		objectMap["certificates"] = sbp.Certificates
8586	}
8587	if sbp.VirtualNetworkType != "" {
8588		objectMap["virtualNetworkType"] = sbp.VirtualNetworkType
8589	}
8590	return json.Marshal(objectMap)
8591}
8592
8593// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation.
8594type ServiceCheckNameAvailabilityParameters struct {
8595	// Name - The name to check for availability.
8596	Name *string `json:"name,omitempty"`
8597}
8598
8599// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8600// operation.
8601type ServiceCreateOrUpdateFuture struct {
8602	azure.FutureAPI
8603	// Result returns the result of the asynchronous operation.
8604	// If the operation has not completed it will return an error.
8605	Result func(ServiceClient) (ServiceResource, error)
8606}
8607
8608// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8609func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8610	var azFuture azure.Future
8611	if err := json.Unmarshal(body, &azFuture); err != nil {
8612		return err
8613	}
8614	future.FutureAPI = &azFuture
8615	future.Result = future.result
8616	return nil
8617}
8618
8619// result is the default implementation for ServiceCreateOrUpdateFuture.Result.
8620func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
8621	var done bool
8622	done, err = future.DoneWithContext(context.Background(), client)
8623	if err != nil {
8624		err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8625		return
8626	}
8627	if !done {
8628		sr.Response.Response = future.Response()
8629		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture")
8630		return
8631	}
8632	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8633	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
8634		sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
8635		if err != nil {
8636			err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
8637		}
8638	}
8639	return
8640}
8641
8642// ServiceGetSsoTokenResult the response of the GetSsoToken operation.
8643type ServiceGetSsoTokenResult struct {
8644	autorest.Response `json:"-"`
8645	// RedirectURI - Redirect URL to the Publisher Portal containing the SSO token.
8646	RedirectURI *string `json:"redirectUri,omitempty"`
8647}
8648
8649// ServiceIdentity identity properties of the Api Management service resource.
8650type ServiceIdentity struct {
8651	// Type - The identity type. Currently the only supported type is 'SystemAssigned'.
8652	Type *string `json:"type,omitempty"`
8653	// PrincipalID - READ-ONLY; The principal id of the identity.
8654	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
8655	// TenantID - READ-ONLY; The client tenant id of the identity.
8656	TenantID *uuid.UUID `json:"tenantId,omitempty"`
8657}
8658
8659// MarshalJSON is the custom marshaler for ServiceIdentity.
8660func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
8661	objectMap := make(map[string]interface{})
8662	if si.Type != nil {
8663		objectMap["type"] = si.Type
8664	}
8665	return json.Marshal(objectMap)
8666}
8667
8668// ServiceListResult the response of the List API Management services operation.
8669type ServiceListResult struct {
8670	autorest.Response `json:"-"`
8671	// Value - Result of the List API Management services operation.
8672	Value *[]ServiceResource `json:"value,omitempty"`
8673	// NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services.
8674	NextLink *string `json:"nextLink,omitempty"`
8675}
8676
8677// ServiceListResultIterator provides access to a complete listing of ServiceResource values.
8678type ServiceListResultIterator struct {
8679	i    int
8680	page ServiceListResultPage
8681}
8682
8683// NextWithContext advances to the next value.  If there was an error making
8684// the request the iterator does not advance and the error is returned.
8685func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
8686	if tracing.IsEnabled() {
8687		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext")
8688		defer func() {
8689			sc := -1
8690			if iter.Response().Response.Response != nil {
8691				sc = iter.Response().Response.Response.StatusCode
8692			}
8693			tracing.EndSpan(ctx, sc, err)
8694		}()
8695	}
8696	iter.i++
8697	if iter.i < len(iter.page.Values()) {
8698		return nil
8699	}
8700	err = iter.page.NextWithContext(ctx)
8701	if err != nil {
8702		iter.i--
8703		return err
8704	}
8705	iter.i = 0
8706	return nil
8707}
8708
8709// Next advances to the next value.  If there was an error making
8710// the request the iterator does not advance and the error is returned.
8711// Deprecated: Use NextWithContext() instead.
8712func (iter *ServiceListResultIterator) Next() error {
8713	return iter.NextWithContext(context.Background())
8714}
8715
8716// NotDone returns true if the enumeration should be started or is not yet complete.
8717func (iter ServiceListResultIterator) NotDone() bool {
8718	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8719}
8720
8721// Response returns the raw server response from the last page request.
8722func (iter ServiceListResultIterator) Response() ServiceListResult {
8723	return iter.page.Response()
8724}
8725
8726// Value returns the current value or a zero-initialized value if the
8727// iterator has advanced beyond the end of the collection.
8728func (iter ServiceListResultIterator) Value() ServiceResource {
8729	if !iter.page.NotDone() {
8730		return ServiceResource{}
8731	}
8732	return iter.page.Values()[iter.i]
8733}
8734
8735// Creates a new instance of the ServiceListResultIterator type.
8736func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator {
8737	return ServiceListResultIterator{page: page}
8738}
8739
8740// IsEmpty returns true if the ListResult contains no values.
8741func (slr ServiceListResult) IsEmpty() bool {
8742	return slr.Value == nil || len(*slr.Value) == 0
8743}
8744
8745// hasNextLink returns true if the NextLink is not empty.
8746func (slr ServiceListResult) hasNextLink() bool {
8747	return slr.NextLink != nil && len(*slr.NextLink) != 0
8748}
8749
8750// serviceListResultPreparer prepares a request to retrieve the next set of results.
8751// It returns nil if no more results exist.
8752func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) {
8753	if !slr.hasNextLink() {
8754		return nil, nil
8755	}
8756	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8757		autorest.AsJSON(),
8758		autorest.AsGet(),
8759		autorest.WithBaseURL(to.String(slr.NextLink)))
8760}
8761
8762// ServiceListResultPage contains a page of ServiceResource values.
8763type ServiceListResultPage struct {
8764	fn  func(context.Context, ServiceListResult) (ServiceListResult, error)
8765	slr ServiceListResult
8766}
8767
8768// NextWithContext advances to the next page of values.  If there was an error making
8769// the request the page does not advance and the error is returned.
8770func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
8771	if tracing.IsEnabled() {
8772		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext")
8773		defer func() {
8774			sc := -1
8775			if page.Response().Response.Response != nil {
8776				sc = page.Response().Response.Response.StatusCode
8777			}
8778			tracing.EndSpan(ctx, sc, err)
8779		}()
8780	}
8781	for {
8782		next, err := page.fn(ctx, page.slr)
8783		if err != nil {
8784			return err
8785		}
8786		page.slr = next
8787		if !next.hasNextLink() || !next.IsEmpty() {
8788			break
8789		}
8790	}
8791	return nil
8792}
8793
8794// Next advances to the next page of values.  If there was an error making
8795// the request the page does not advance and the error is returned.
8796// Deprecated: Use NextWithContext() instead.
8797func (page *ServiceListResultPage) Next() error {
8798	return page.NextWithContext(context.Background())
8799}
8800
8801// NotDone returns true if the page enumeration should be started or is not yet complete.
8802func (page ServiceListResultPage) NotDone() bool {
8803	return !page.slr.IsEmpty()
8804}
8805
8806// Response returns the raw server response from the last page request.
8807func (page ServiceListResultPage) Response() ServiceListResult {
8808	return page.slr
8809}
8810
8811// Values returns the slice of values for the current page or nil if there are no values.
8812func (page ServiceListResultPage) Values() []ServiceResource {
8813	if page.slr.IsEmpty() {
8814		return nil
8815	}
8816	return *page.slr.Value
8817}
8818
8819// Creates a new instance of the ServiceListResultPage type.
8820func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage {
8821	return ServiceListResultPage{
8822		fn:  getNextPage,
8823		slr: cur,
8824	}
8825}
8826
8827// ServiceNameAvailabilityResult response of the CheckNameAvailability operation.
8828type ServiceNameAvailabilityResult struct {
8829	autorest.Response `json:"-"`
8830	// NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false.
8831	NameAvailable *bool `json:"nameAvailable,omitempty"`
8832	// Message - READ-ONLY; If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that <resourceName> is already in use, and direct them to select a different name.
8833	Message *string `json:"message,omitempty"`
8834	// Reason - Invalid indicates the name provided does not match the resource provider’s naming requirements (incorrect length, unsupported characters, etc.)  AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'Valid', 'Invalid', 'AlreadyExists'
8835	Reason NameAvailabilityReason `json:"reason,omitempty"`
8836}
8837
8838// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult.
8839func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) {
8840	objectMap := make(map[string]interface{})
8841	if snar.Reason != "" {
8842		objectMap["reason"] = snar.Reason
8843	}
8844	return json.Marshal(objectMap)
8845}
8846
8847// ServiceProperties properties of an API Management service resource description.
8848type ServiceProperties struct {
8849	// PublisherEmail - Publisher email.
8850	PublisherEmail *string `json:"publisherEmail,omitempty"`
8851	// PublisherName - Publisher name.
8852	PublisherName *string `json:"publisherName,omitempty"`
8853	// NotificationSenderEmail - Email address from which the notification will be sent.
8854	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
8855	// ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
8856	ProvisioningState *string `json:"provisioningState,omitempty"`
8857	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
8858	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
8859	// CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
8860	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
8861	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
8862	GatewayURL *string `json:"gatewayUrl,omitempty"`
8863	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
8864	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
8865	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
8866	PortalURL *string `json:"portalUrl,omitempty"`
8867	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
8868	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
8869	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
8870	ScmURL *string `json:"scmUrl,omitempty"`
8871	// HostnameConfigurations - Custom hostname configuration of the API Management service.
8872	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
8873	// StaticIps - READ-ONLY; Static IP addresses of the API Management service virtual machines. Available only for Standard and Premium SKU.
8874	StaticIps *[]string `json:"staticIps,omitempty"`
8875	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
8876	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
8877	// AdditionalLocations - Additional datacenter locations of the API Management service.
8878	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
8879	// CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
8880	CustomProperties map[string]*string `json:"customProperties"`
8881	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
8882	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
8883	// VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal'
8884	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
8885}
8886
8887// MarshalJSON is the custom marshaler for ServiceProperties.
8888func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
8889	objectMap := make(map[string]interface{})
8890	if sp.PublisherEmail != nil {
8891		objectMap["publisherEmail"] = sp.PublisherEmail
8892	}
8893	if sp.PublisherName != nil {
8894		objectMap["publisherName"] = sp.PublisherName
8895	}
8896	if sp.NotificationSenderEmail != nil {
8897		objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail
8898	}
8899	if sp.HostnameConfigurations != nil {
8900		objectMap["hostnameConfigurations"] = sp.HostnameConfigurations
8901	}
8902	if sp.VirtualNetworkConfiguration != nil {
8903		objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration
8904	}
8905	if sp.AdditionalLocations != nil {
8906		objectMap["additionalLocations"] = sp.AdditionalLocations
8907	}
8908	if sp.CustomProperties != nil {
8909		objectMap["customProperties"] = sp.CustomProperties
8910	}
8911	if sp.Certificates != nil {
8912		objectMap["certificates"] = sp.Certificates
8913	}
8914	if sp.VirtualNetworkType != "" {
8915		objectMap["virtualNetworkType"] = sp.VirtualNetworkType
8916	}
8917	return json.Marshal(objectMap)
8918}
8919
8920// ServiceResource a single API Management service resource in List or Get response.
8921type ServiceResource struct {
8922	autorest.Response `json:"-"`
8923	// ServiceProperties - Properties of the API Management service.
8924	*ServiceProperties `json:"properties,omitempty"`
8925	// Sku - SKU properties of the API Management service.
8926	Sku *ServiceSkuProperties `json:"sku,omitempty"`
8927	// Identity - Managed service identity of the Api Management service.
8928	Identity *ServiceIdentity `json:"identity,omitempty"`
8929	// Location - Resource location.
8930	Location *string `json:"location,omitempty"`
8931	// Etag - READ-ONLY; ETag of the resource.
8932	Etag *string `json:"etag,omitempty"`
8933	// ID - READ-ONLY; Resource ID.
8934	ID *string `json:"id,omitempty"`
8935	// Name - READ-ONLY; Resource name.
8936	Name *string `json:"name,omitempty"`
8937	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
8938	Type *string `json:"type,omitempty"`
8939	// Tags - Resource tags.
8940	Tags map[string]*string `json:"tags"`
8941}
8942
8943// MarshalJSON is the custom marshaler for ServiceResource.
8944func (sr ServiceResource) MarshalJSON() ([]byte, error) {
8945	objectMap := make(map[string]interface{})
8946	if sr.ServiceProperties != nil {
8947		objectMap["properties"] = sr.ServiceProperties
8948	}
8949	if sr.Sku != nil {
8950		objectMap["sku"] = sr.Sku
8951	}
8952	if sr.Identity != nil {
8953		objectMap["identity"] = sr.Identity
8954	}
8955	if sr.Location != nil {
8956		objectMap["location"] = sr.Location
8957	}
8958	if sr.Tags != nil {
8959		objectMap["tags"] = sr.Tags
8960	}
8961	return json.Marshal(objectMap)
8962}
8963
8964// UnmarshalJSON is the custom unmarshaler for ServiceResource struct.
8965func (sr *ServiceResource) UnmarshalJSON(body []byte) error {
8966	var m map[string]*json.RawMessage
8967	err := json.Unmarshal(body, &m)
8968	if err != nil {
8969		return err
8970	}
8971	for k, v := range m {
8972		switch k {
8973		case "properties":
8974			if v != nil {
8975				var serviceProperties ServiceProperties
8976				err = json.Unmarshal(*v, &serviceProperties)
8977				if err != nil {
8978					return err
8979				}
8980				sr.ServiceProperties = &serviceProperties
8981			}
8982		case "sku":
8983			if v != nil {
8984				var sku ServiceSkuProperties
8985				err = json.Unmarshal(*v, &sku)
8986				if err != nil {
8987					return err
8988				}
8989				sr.Sku = &sku
8990			}
8991		case "identity":
8992			if v != nil {
8993				var identity ServiceIdentity
8994				err = json.Unmarshal(*v, &identity)
8995				if err != nil {
8996					return err
8997				}
8998				sr.Identity = &identity
8999			}
9000		case "location":
9001			if v != nil {
9002				var location string
9003				err = json.Unmarshal(*v, &location)
9004				if err != nil {
9005					return err
9006				}
9007				sr.Location = &location
9008			}
9009		case "etag":
9010			if v != nil {
9011				var etag string
9012				err = json.Unmarshal(*v, &etag)
9013				if err != nil {
9014					return err
9015				}
9016				sr.Etag = &etag
9017			}
9018		case "id":
9019			if v != nil {
9020				var ID string
9021				err = json.Unmarshal(*v, &ID)
9022				if err != nil {
9023					return err
9024				}
9025				sr.ID = &ID
9026			}
9027		case "name":
9028			if v != nil {
9029				var name string
9030				err = json.Unmarshal(*v, &name)
9031				if err != nil {
9032					return err
9033				}
9034				sr.Name = &name
9035			}
9036		case "type":
9037			if v != nil {
9038				var typeVar string
9039				err = json.Unmarshal(*v, &typeVar)
9040				if err != nil {
9041					return err
9042				}
9043				sr.Type = &typeVar
9044			}
9045		case "tags":
9046			if v != nil {
9047				var tags map[string]*string
9048				err = json.Unmarshal(*v, &tags)
9049				if err != nil {
9050					return err
9051				}
9052				sr.Tags = tags
9053			}
9054		}
9055	}
9056
9057	return nil
9058}
9059
9060// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running
9061// operation.
9062type ServiceRestoreFuture struct {
9063	azure.FutureAPI
9064	// Result returns the result of the asynchronous operation.
9065	// If the operation has not completed it will return an error.
9066	Result func(ServiceClient) (ServiceResource, error)
9067}
9068
9069// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9070func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error {
9071	var azFuture azure.Future
9072	if err := json.Unmarshal(body, &azFuture); err != nil {
9073		return err
9074	}
9075	future.FutureAPI = &azFuture
9076	future.Result = future.result
9077	return nil
9078}
9079
9080// result is the default implementation for ServiceRestoreFuture.Result.
9081func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) {
9082	var done bool
9083	done, err = future.DoneWithContext(context.Background(), client)
9084	if err != nil {
9085		err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure")
9086		return
9087	}
9088	if !done {
9089		sr.Response.Response = future.Response()
9090		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture")
9091		return
9092	}
9093	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9094	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
9095		sr, err = client.RestoreResponder(sr.Response.Response)
9096		if err != nil {
9097			err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request")
9098		}
9099	}
9100	return
9101}
9102
9103// ServiceSkuProperties API Management service resource SKU properties.
9104type ServiceSkuProperties struct {
9105	// Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic'
9106	Name SkuType `json:"name,omitempty"`
9107	// Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1.
9108	Capacity *int32 `json:"capacity,omitempty"`
9109}
9110
9111// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
9112// operation.
9113type ServiceUpdateFuture struct {
9114	azure.FutureAPI
9115	// Result returns the result of the asynchronous operation.
9116	// If the operation has not completed it will return an error.
9117	Result func(ServiceClient) (ServiceResource, error)
9118}
9119
9120// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9121func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error {
9122	var azFuture azure.Future
9123	if err := json.Unmarshal(body, &azFuture); err != nil {
9124		return err
9125	}
9126	future.FutureAPI = &azFuture
9127	future.Result = future.result
9128	return nil
9129}
9130
9131// result is the default implementation for ServiceUpdateFuture.Result.
9132func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
9133	var done bool
9134	done, err = future.DoneWithContext(context.Background(), client)
9135	if err != nil {
9136		err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure")
9137		return
9138	}
9139	if !done {
9140		sr.Response.Response = future.Response()
9141		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture")
9142		return
9143	}
9144	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9145	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
9146		sr, err = client.UpdateResponder(sr.Response.Response)
9147		if err != nil {
9148			err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
9149		}
9150	}
9151	return
9152}
9153
9154// ServiceUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running
9155// operation.
9156type ServiceUpdateHostnameFuture struct {
9157	azure.FutureAPI
9158	// Result returns the result of the asynchronous operation.
9159	// If the operation has not completed it will return an error.
9160	Result func(ServiceClient) (ServiceResource, error)
9161}
9162
9163// UnmarshalJSON is the custom unmarshaller for CreateFuture.
9164func (future *ServiceUpdateHostnameFuture) UnmarshalJSON(body []byte) error {
9165	var azFuture azure.Future
9166	if err := json.Unmarshal(body, &azFuture); err != nil {
9167		return err
9168	}
9169	future.FutureAPI = &azFuture
9170	future.Result = future.result
9171	return nil
9172}
9173
9174// result is the default implementation for ServiceUpdateHostnameFuture.Result.
9175func (future *ServiceUpdateHostnameFuture) result(client ServiceClient) (sr ServiceResource, err error) {
9176	var done bool
9177	done, err = future.DoneWithContext(context.Background(), client)
9178	if err != nil {
9179		err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", future.Response(), "Polling failure")
9180		return
9181	}
9182	if !done {
9183		sr.Response.Response = future.Response()
9184		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateHostnameFuture")
9185		return
9186	}
9187	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
9188	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
9189		sr, err = client.UpdateHostnameResponder(sr.Response.Response)
9190		if err != nil {
9191			err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request")
9192		}
9193	}
9194	return
9195}
9196
9197// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation.
9198type ServiceUpdateHostnameParameters struct {
9199	// Update - Hostnames to create or update.
9200	Update *[]HostnameConfigurationOld `json:"update,omitempty"`
9201	// Delete - Hostnames types to delete.
9202	Delete *[]HostnameType `json:"delete,omitempty"`
9203}
9204
9205// ServiceUpdateParameters parameter supplied to Update Api Management Service.
9206type ServiceUpdateParameters struct {
9207	// ServiceUpdateProperties - Properties of the API Management service.
9208	*ServiceUpdateProperties `json:"properties,omitempty"`
9209	// Sku - SKU properties of the API Management service.
9210	Sku *ServiceSkuProperties `json:"sku,omitempty"`
9211	// Identity - Managed service identity of the Api Management service.
9212	Identity *ServiceIdentity `json:"identity,omitempty"`
9213	// Etag - READ-ONLY; ETag of the resource.
9214	Etag *string `json:"etag,omitempty"`
9215	// ID - READ-ONLY; Resource ID.
9216	ID *string `json:"id,omitempty"`
9217	// Name - READ-ONLY; Resource name.
9218	Name *string `json:"name,omitempty"`
9219	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
9220	Type *string `json:"type,omitempty"`
9221	// Tags - Resource tags.
9222	Tags map[string]*string `json:"tags"`
9223}
9224
9225// MarshalJSON is the custom marshaler for ServiceUpdateParameters.
9226func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) {
9227	objectMap := make(map[string]interface{})
9228	if sup.ServiceUpdateProperties != nil {
9229		objectMap["properties"] = sup.ServiceUpdateProperties
9230	}
9231	if sup.Sku != nil {
9232		objectMap["sku"] = sup.Sku
9233	}
9234	if sup.Identity != nil {
9235		objectMap["identity"] = sup.Identity
9236	}
9237	if sup.Tags != nil {
9238		objectMap["tags"] = sup.Tags
9239	}
9240	return json.Marshal(objectMap)
9241}
9242
9243// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct.
9244func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error {
9245	var m map[string]*json.RawMessage
9246	err := json.Unmarshal(body, &m)
9247	if err != nil {
9248		return err
9249	}
9250	for k, v := range m {
9251		switch k {
9252		case "properties":
9253			if v != nil {
9254				var serviceUpdateProperties ServiceUpdateProperties
9255				err = json.Unmarshal(*v, &serviceUpdateProperties)
9256				if err != nil {
9257					return err
9258				}
9259				sup.ServiceUpdateProperties = &serviceUpdateProperties
9260			}
9261		case "sku":
9262			if v != nil {
9263				var sku ServiceSkuProperties
9264				err = json.Unmarshal(*v, &sku)
9265				if err != nil {
9266					return err
9267				}
9268				sup.Sku = &sku
9269			}
9270		case "identity":
9271			if v != nil {
9272				var identity ServiceIdentity
9273				err = json.Unmarshal(*v, &identity)
9274				if err != nil {
9275					return err
9276				}
9277				sup.Identity = &identity
9278			}
9279		case "etag":
9280			if v != nil {
9281				var etag string
9282				err = json.Unmarshal(*v, &etag)
9283				if err != nil {
9284					return err
9285				}
9286				sup.Etag = &etag
9287			}
9288		case "id":
9289			if v != nil {
9290				var ID string
9291				err = json.Unmarshal(*v, &ID)
9292				if err != nil {
9293					return err
9294				}
9295				sup.ID = &ID
9296			}
9297		case "name":
9298			if v != nil {
9299				var name string
9300				err = json.Unmarshal(*v, &name)
9301				if err != nil {
9302					return err
9303				}
9304				sup.Name = &name
9305			}
9306		case "type":
9307			if v != nil {
9308				var typeVar string
9309				err = json.Unmarshal(*v, &typeVar)
9310				if err != nil {
9311					return err
9312				}
9313				sup.Type = &typeVar
9314			}
9315		case "tags":
9316			if v != nil {
9317				var tags map[string]*string
9318				err = json.Unmarshal(*v, &tags)
9319				if err != nil {
9320					return err
9321				}
9322				sup.Tags = tags
9323			}
9324		}
9325	}
9326
9327	return nil
9328}
9329
9330// ServiceUpdateProperties properties of an API Management service resource description.
9331type ServiceUpdateProperties struct {
9332	// PublisherEmail - Publisher email.
9333	PublisherEmail *string `json:"publisherEmail,omitempty"`
9334	// PublisherName - Publisher name.
9335	PublisherName *string `json:"publisherName,omitempty"`
9336	// NotificationSenderEmail - Email address from which the notification will be sent.
9337	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
9338	// ProvisioningState - READ-ONLY; The current provisioning state of the API Management service which can be one of the following: Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted.
9339	ProvisioningState *string `json:"provisioningState,omitempty"`
9340	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
9341	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
9342	// CreatedAtUtc - READ-ONLY; Creation UTC date of the API Management service.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9343	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
9344	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
9345	GatewayURL *string `json:"gatewayUrl,omitempty"`
9346	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
9347	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
9348	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
9349	PortalURL *string `json:"portalUrl,omitempty"`
9350	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
9351	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
9352	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
9353	ScmURL *string `json:"scmUrl,omitempty"`
9354	// HostnameConfigurations - Custom hostname configuration of the API Management service.
9355	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
9356	// StaticIps - READ-ONLY; Static IP addresses of the API Management service virtual machines. Available only for Standard and Premium SKU.
9357	StaticIps *[]string `json:"staticIps,omitempty"`
9358	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
9359	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
9360	// AdditionalLocations - Additional datacenter locations of the API Management service.
9361	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
9362	// CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
9363	CustomProperties map[string]*string `json:"customProperties"`
9364	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
9365	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
9366	// VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal'
9367	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
9368}
9369
9370// MarshalJSON is the custom marshaler for ServiceUpdateProperties.
9371func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) {
9372	objectMap := make(map[string]interface{})
9373	if sup.PublisherEmail != nil {
9374		objectMap["publisherEmail"] = sup.PublisherEmail
9375	}
9376	if sup.PublisherName != nil {
9377		objectMap["publisherName"] = sup.PublisherName
9378	}
9379	if sup.NotificationSenderEmail != nil {
9380		objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail
9381	}
9382	if sup.HostnameConfigurations != nil {
9383		objectMap["hostnameConfigurations"] = sup.HostnameConfigurations
9384	}
9385	if sup.VirtualNetworkConfiguration != nil {
9386		objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration
9387	}
9388	if sup.AdditionalLocations != nil {
9389		objectMap["additionalLocations"] = sup.AdditionalLocations
9390	}
9391	if sup.CustomProperties != nil {
9392		objectMap["customProperties"] = sup.CustomProperties
9393	}
9394	if sup.Certificates != nil {
9395		objectMap["certificates"] = sup.Certificates
9396	}
9397	if sup.VirtualNetworkType != "" {
9398		objectMap["virtualNetworkType"] = sup.VirtualNetworkType
9399	}
9400	return json.Marshal(objectMap)
9401}
9402
9403// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API
9404// Management service operation.
9405type ServiceUploadCertificateParameters struct {
9406	// Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm'
9407	Type HostnameType `json:"type,omitempty"`
9408	// Certificate - Base64 Encoded certificate.
9409	Certificate *string `json:"certificate,omitempty"`
9410	// CertificatePassword - Certificate password.
9411	CertificatePassword *string `json:"certificate_password,omitempty"`
9412}
9413
9414// SubscriptionCollection paged Subscriptions list representation.
9415type SubscriptionCollection struct {
9416	autorest.Response `json:"-"`
9417	// Value - Page values.
9418	Value *[]SubscriptionContract `json:"value,omitempty"`
9419	// NextLink - Next page link if any.
9420	NextLink *string `json:"nextLink,omitempty"`
9421}
9422
9423// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values.
9424type SubscriptionCollectionIterator struct {
9425	i    int
9426	page SubscriptionCollectionPage
9427}
9428
9429// NextWithContext advances to the next value.  If there was an error making
9430// the request the iterator does not advance and the error is returned.
9431func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
9432	if tracing.IsEnabled() {
9433		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext")
9434		defer func() {
9435			sc := -1
9436			if iter.Response().Response.Response != nil {
9437				sc = iter.Response().Response.Response.StatusCode
9438			}
9439			tracing.EndSpan(ctx, sc, err)
9440		}()
9441	}
9442	iter.i++
9443	if iter.i < len(iter.page.Values()) {
9444		return nil
9445	}
9446	err = iter.page.NextWithContext(ctx)
9447	if err != nil {
9448		iter.i--
9449		return err
9450	}
9451	iter.i = 0
9452	return nil
9453}
9454
9455// Next advances to the next value.  If there was an error making
9456// the request the iterator does not advance and the error is returned.
9457// Deprecated: Use NextWithContext() instead.
9458func (iter *SubscriptionCollectionIterator) Next() error {
9459	return iter.NextWithContext(context.Background())
9460}
9461
9462// NotDone returns true if the enumeration should be started or is not yet complete.
9463func (iter SubscriptionCollectionIterator) NotDone() bool {
9464	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9465}
9466
9467// Response returns the raw server response from the last page request.
9468func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection {
9469	return iter.page.Response()
9470}
9471
9472// Value returns the current value or a zero-initialized value if the
9473// iterator has advanced beyond the end of the collection.
9474func (iter SubscriptionCollectionIterator) Value() SubscriptionContract {
9475	if !iter.page.NotDone() {
9476		return SubscriptionContract{}
9477	}
9478	return iter.page.Values()[iter.i]
9479}
9480
9481// Creates a new instance of the SubscriptionCollectionIterator type.
9482func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator {
9483	return SubscriptionCollectionIterator{page: page}
9484}
9485
9486// IsEmpty returns true if the ListResult contains no values.
9487func (sc SubscriptionCollection) IsEmpty() bool {
9488	return sc.Value == nil || len(*sc.Value) == 0
9489}
9490
9491// hasNextLink returns true if the NextLink is not empty.
9492func (sc SubscriptionCollection) hasNextLink() bool {
9493	return sc.NextLink != nil && len(*sc.NextLink) != 0
9494}
9495
9496// subscriptionCollectionPreparer prepares a request to retrieve the next set of results.
9497// It returns nil if no more results exist.
9498func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
9499	if !sc.hasNextLink() {
9500		return nil, nil
9501	}
9502	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9503		autorest.AsJSON(),
9504		autorest.AsGet(),
9505		autorest.WithBaseURL(to.String(sc.NextLink)))
9506}
9507
9508// SubscriptionCollectionPage contains a page of SubscriptionContract values.
9509type SubscriptionCollectionPage struct {
9510	fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)
9511	sc SubscriptionCollection
9512}
9513
9514// NextWithContext advances to the next page of values.  If there was an error making
9515// the request the page does not advance and the error is returned.
9516func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
9517	if tracing.IsEnabled() {
9518		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext")
9519		defer func() {
9520			sc := -1
9521			if page.Response().Response.Response != nil {
9522				sc = page.Response().Response.Response.StatusCode
9523			}
9524			tracing.EndSpan(ctx, sc, err)
9525		}()
9526	}
9527	for {
9528		next, err := page.fn(ctx, page.sc)
9529		if err != nil {
9530			return err
9531		}
9532		page.sc = next
9533		if !next.hasNextLink() || !next.IsEmpty() {
9534			break
9535		}
9536	}
9537	return nil
9538}
9539
9540// Next advances to the next page of values.  If there was an error making
9541// the request the page does not advance and the error is returned.
9542// Deprecated: Use NextWithContext() instead.
9543func (page *SubscriptionCollectionPage) Next() error {
9544	return page.NextWithContext(context.Background())
9545}
9546
9547// NotDone returns true if the page enumeration should be started or is not yet complete.
9548func (page SubscriptionCollectionPage) NotDone() bool {
9549	return !page.sc.IsEmpty()
9550}
9551
9552// Response returns the raw server response from the last page request.
9553func (page SubscriptionCollectionPage) Response() SubscriptionCollection {
9554	return page.sc
9555}
9556
9557// Values returns the slice of values for the current page or nil if there are no values.
9558func (page SubscriptionCollectionPage) Values() []SubscriptionContract {
9559	if page.sc.IsEmpty() {
9560		return nil
9561	}
9562	return *page.sc.Value
9563}
9564
9565// Creates a new instance of the SubscriptionCollectionPage type.
9566func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage {
9567	return SubscriptionCollectionPage{
9568		fn: getNextPage,
9569		sc: cur,
9570	}
9571}
9572
9573// SubscriptionContract subscription details.
9574type SubscriptionContract struct {
9575	autorest.Response `json:"-"`
9576	// SubscriptionContractProperties - Subscription contract properties.
9577	*SubscriptionContractProperties `json:"properties,omitempty"`
9578	// ID - READ-ONLY; Resource ID.
9579	ID *string `json:"id,omitempty"`
9580	// Name - READ-ONLY; Resource name.
9581	Name *string `json:"name,omitempty"`
9582	// Type - READ-ONLY; Resource type for API Management resource.
9583	Type *string `json:"type,omitempty"`
9584}
9585
9586// MarshalJSON is the custom marshaler for SubscriptionContract.
9587func (sc SubscriptionContract) MarshalJSON() ([]byte, error) {
9588	objectMap := make(map[string]interface{})
9589	if sc.SubscriptionContractProperties != nil {
9590		objectMap["properties"] = sc.SubscriptionContractProperties
9591	}
9592	return json.Marshal(objectMap)
9593}
9594
9595// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct.
9596func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error {
9597	var m map[string]*json.RawMessage
9598	err := json.Unmarshal(body, &m)
9599	if err != nil {
9600		return err
9601	}
9602	for k, v := range m {
9603		switch k {
9604		case "properties":
9605			if v != nil {
9606				var subscriptionContractProperties SubscriptionContractProperties
9607				err = json.Unmarshal(*v, &subscriptionContractProperties)
9608				if err != nil {
9609					return err
9610				}
9611				sc.SubscriptionContractProperties = &subscriptionContractProperties
9612			}
9613		case "id":
9614			if v != nil {
9615				var ID string
9616				err = json.Unmarshal(*v, &ID)
9617				if err != nil {
9618					return err
9619				}
9620				sc.ID = &ID
9621			}
9622		case "name":
9623			if v != nil {
9624				var name string
9625				err = json.Unmarshal(*v, &name)
9626				if err != nil {
9627					return err
9628				}
9629				sc.Name = &name
9630			}
9631		case "type":
9632			if v != nil {
9633				var typeVar string
9634				err = json.Unmarshal(*v, &typeVar)
9635				if err != nil {
9636					return err
9637				}
9638				sc.Type = &typeVar
9639			}
9640		}
9641	}
9642
9643	return nil
9644}
9645
9646// SubscriptionContractProperties subscription details.
9647type SubscriptionContractProperties struct {
9648	// UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier.
9649	UserID *string `json:"userId,omitempty"`
9650	// ProductID - The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier.
9651	ProductID *string `json:"productId,omitempty"`
9652	// DisplayName - The name of the subscription, or null if the subscription has no name.
9653	DisplayName *string `json:"displayName,omitempty"`
9654	// State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled'
9655	State SubscriptionState `json:"state,omitempty"`
9656	// CreatedDate - READ-ONLY; Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9657	CreatedDate *date.Time `json:"createdDate,omitempty"`
9658	// StartDate - Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9659	StartDate *date.Time `json:"startDate,omitempty"`
9660	// ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9661	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
9662	// EndDate - Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9663	EndDate *date.Time `json:"endDate,omitempty"`
9664	// NotificationDate - Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9665	NotificationDate *date.Time `json:"notificationDate,omitempty"`
9666	// PrimaryKey - Subscription primary key.
9667	PrimaryKey *string `json:"primaryKey,omitempty"`
9668	// SecondaryKey - Subscription secondary key.
9669	SecondaryKey *string `json:"secondaryKey,omitempty"`
9670	// StateComment - Optional subscription comment added by an administrator.
9671	StateComment *string `json:"stateComment,omitempty"`
9672}
9673
9674// MarshalJSON is the custom marshaler for SubscriptionContractProperties.
9675func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) {
9676	objectMap := make(map[string]interface{})
9677	if scp.UserID != nil {
9678		objectMap["userId"] = scp.UserID
9679	}
9680	if scp.ProductID != nil {
9681		objectMap["productId"] = scp.ProductID
9682	}
9683	if scp.DisplayName != nil {
9684		objectMap["displayName"] = scp.DisplayName
9685	}
9686	if scp.State != "" {
9687		objectMap["state"] = scp.State
9688	}
9689	if scp.StartDate != nil {
9690		objectMap["startDate"] = scp.StartDate
9691	}
9692	if scp.ExpirationDate != nil {
9693		objectMap["expirationDate"] = scp.ExpirationDate
9694	}
9695	if scp.EndDate != nil {
9696		objectMap["endDate"] = scp.EndDate
9697	}
9698	if scp.NotificationDate != nil {
9699		objectMap["notificationDate"] = scp.NotificationDate
9700	}
9701	if scp.PrimaryKey != nil {
9702		objectMap["primaryKey"] = scp.PrimaryKey
9703	}
9704	if scp.SecondaryKey != nil {
9705		objectMap["secondaryKey"] = scp.SecondaryKey
9706	}
9707	if scp.StateComment != nil {
9708		objectMap["stateComment"] = scp.StateComment
9709	}
9710	return json.Marshal(objectMap)
9711}
9712
9713// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation.
9714type SubscriptionCreateParameterProperties struct {
9715	// UserID - User (user id path) for whom subscription is being created in form /users/{uid}
9716	UserID *string `json:"userId,omitempty"`
9717	// ProductID - Product (product id path) for which subscription is being created in form /products/{productId}
9718	ProductID *string `json:"productId,omitempty"`
9719	// DisplayName - Subscription name.
9720	DisplayName *string `json:"displayName,omitempty"`
9721	// PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically.
9722	PrimaryKey *string `json:"primaryKey,omitempty"`
9723	// SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically.
9724	SecondaryKey *string `json:"secondaryKey,omitempty"`
9725	// State - Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled'
9726	State SubscriptionState `json:"state,omitempty"`
9727}
9728
9729// SubscriptionCreateParameters subscription create details.
9730type SubscriptionCreateParameters struct {
9731	// SubscriptionCreateParameterProperties - Subscription contract properties.
9732	*SubscriptionCreateParameterProperties `json:"properties,omitempty"`
9733}
9734
9735// MarshalJSON is the custom marshaler for SubscriptionCreateParameters.
9736func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) {
9737	objectMap := make(map[string]interface{})
9738	if scp.SubscriptionCreateParameterProperties != nil {
9739		objectMap["properties"] = scp.SubscriptionCreateParameterProperties
9740	}
9741	return json.Marshal(objectMap)
9742}
9743
9744// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct.
9745func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error {
9746	var m map[string]*json.RawMessage
9747	err := json.Unmarshal(body, &m)
9748	if err != nil {
9749		return err
9750	}
9751	for k, v := range m {
9752		switch k {
9753		case "properties":
9754			if v != nil {
9755				var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties
9756				err = json.Unmarshal(*v, &subscriptionCreateParameterProperties)
9757				if err != nil {
9758					return err
9759				}
9760				scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties
9761			}
9762		}
9763	}
9764
9765	return nil
9766}
9767
9768// SubscriptionKeyParameterNamesContract subscription key parameter names details.
9769type SubscriptionKeyParameterNamesContract struct {
9770	// Header - Subscription key header name.
9771	Header *string `json:"header,omitempty"`
9772	// Query - Subscription key query string parameter name.
9773	Query *string `json:"query,omitempty"`
9774}
9775
9776// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties.
9777type SubscriptionsDelegationSettingsProperties struct {
9778	// Enabled - Enable or disable delegation for subscriptions.
9779	Enabled *bool `json:"enabled,omitempty"`
9780}
9781
9782// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation.
9783type SubscriptionUpdateParameterProperties struct {
9784	// UserID - User identifier path: /users/{uid}
9785	UserID *string `json:"userId,omitempty"`
9786	// ProductID - Product identifier path: /products/{productId}
9787	ProductID *string `json:"productId,omitempty"`
9788	// ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9789	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
9790	// DisplayName - Subscription name.
9791	DisplayName *string `json:"displayName,omitempty"`
9792	// PrimaryKey - Primary subscription key.
9793	PrimaryKey *string `json:"primaryKey,omitempty"`
9794	// SecondaryKey - Secondary subscription key.
9795	SecondaryKey *string `json:"secondaryKey,omitempty"`
9796	// State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled'
9797	State SubscriptionState `json:"state,omitempty"`
9798	// StateComment - Comments describing subscription state change by the administrator.
9799	StateComment *string `json:"stateComment,omitempty"`
9800}
9801
9802// SubscriptionUpdateParameters subscription update details.
9803type SubscriptionUpdateParameters struct {
9804	// SubscriptionUpdateParameterProperties - Subscription Update contract properties.
9805	*SubscriptionUpdateParameterProperties `json:"properties,omitempty"`
9806}
9807
9808// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters.
9809func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) {
9810	objectMap := make(map[string]interface{})
9811	if sup.SubscriptionUpdateParameterProperties != nil {
9812		objectMap["properties"] = sup.SubscriptionUpdateParameterProperties
9813	}
9814	return json.Marshal(objectMap)
9815}
9816
9817// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct.
9818func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error {
9819	var m map[string]*json.RawMessage
9820	err := json.Unmarshal(body, &m)
9821	if err != nil {
9822		return err
9823	}
9824	for k, v := range m {
9825		switch k {
9826		case "properties":
9827			if v != nil {
9828				var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties
9829				err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties)
9830				if err != nil {
9831					return err
9832				}
9833				sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties
9834			}
9835		}
9836	}
9837
9838	return nil
9839}
9840
9841// TagCollection paged Tag list representation.
9842type TagCollection struct {
9843	autorest.Response `json:"-"`
9844	// Value - Page values.
9845	Value *[]TagContract `json:"value,omitempty"`
9846	// NextLink - Next page link if any.
9847	NextLink *string `json:"nextLink,omitempty"`
9848}
9849
9850// TagCollectionIterator provides access to a complete listing of TagContract values.
9851type TagCollectionIterator struct {
9852	i    int
9853	page TagCollectionPage
9854}
9855
9856// NextWithContext advances to the next value.  If there was an error making
9857// the request the iterator does not advance and the error is returned.
9858func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) {
9859	if tracing.IsEnabled() {
9860		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext")
9861		defer func() {
9862			sc := -1
9863			if iter.Response().Response.Response != nil {
9864				sc = iter.Response().Response.Response.StatusCode
9865			}
9866			tracing.EndSpan(ctx, sc, err)
9867		}()
9868	}
9869	iter.i++
9870	if iter.i < len(iter.page.Values()) {
9871		return nil
9872	}
9873	err = iter.page.NextWithContext(ctx)
9874	if err != nil {
9875		iter.i--
9876		return err
9877	}
9878	iter.i = 0
9879	return nil
9880}
9881
9882// Next advances to the next value.  If there was an error making
9883// the request the iterator does not advance and the error is returned.
9884// Deprecated: Use NextWithContext() instead.
9885func (iter *TagCollectionIterator) Next() error {
9886	return iter.NextWithContext(context.Background())
9887}
9888
9889// NotDone returns true if the enumeration should be started or is not yet complete.
9890func (iter TagCollectionIterator) NotDone() bool {
9891	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9892}
9893
9894// Response returns the raw server response from the last page request.
9895func (iter TagCollectionIterator) Response() TagCollection {
9896	return iter.page.Response()
9897}
9898
9899// Value returns the current value or a zero-initialized value if the
9900// iterator has advanced beyond the end of the collection.
9901func (iter TagCollectionIterator) Value() TagContract {
9902	if !iter.page.NotDone() {
9903		return TagContract{}
9904	}
9905	return iter.page.Values()[iter.i]
9906}
9907
9908// Creates a new instance of the TagCollectionIterator type.
9909func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator {
9910	return TagCollectionIterator{page: page}
9911}
9912
9913// IsEmpty returns true if the ListResult contains no values.
9914func (tc TagCollection) IsEmpty() bool {
9915	return tc.Value == nil || len(*tc.Value) == 0
9916}
9917
9918// hasNextLink returns true if the NextLink is not empty.
9919func (tc TagCollection) hasNextLink() bool {
9920	return tc.NextLink != nil && len(*tc.NextLink) != 0
9921}
9922
9923// tagCollectionPreparer prepares a request to retrieve the next set of results.
9924// It returns nil if no more results exist.
9925func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) {
9926	if !tc.hasNextLink() {
9927		return nil, nil
9928	}
9929	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9930		autorest.AsJSON(),
9931		autorest.AsGet(),
9932		autorest.WithBaseURL(to.String(tc.NextLink)))
9933}
9934
9935// TagCollectionPage contains a page of TagContract values.
9936type TagCollectionPage struct {
9937	fn func(context.Context, TagCollection) (TagCollection, error)
9938	tc TagCollection
9939}
9940
9941// NextWithContext advances to the next page of values.  If there was an error making
9942// the request the page does not advance and the error is returned.
9943func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) {
9944	if tracing.IsEnabled() {
9945		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext")
9946		defer func() {
9947			sc := -1
9948			if page.Response().Response.Response != nil {
9949				sc = page.Response().Response.Response.StatusCode
9950			}
9951			tracing.EndSpan(ctx, sc, err)
9952		}()
9953	}
9954	for {
9955		next, err := page.fn(ctx, page.tc)
9956		if err != nil {
9957			return err
9958		}
9959		page.tc = next
9960		if !next.hasNextLink() || !next.IsEmpty() {
9961			break
9962		}
9963	}
9964	return nil
9965}
9966
9967// Next advances to the next page of values.  If there was an error making
9968// the request the page does not advance and the error is returned.
9969// Deprecated: Use NextWithContext() instead.
9970func (page *TagCollectionPage) Next() error {
9971	return page.NextWithContext(context.Background())
9972}
9973
9974// NotDone returns true if the page enumeration should be started or is not yet complete.
9975func (page TagCollectionPage) NotDone() bool {
9976	return !page.tc.IsEmpty()
9977}
9978
9979// Response returns the raw server response from the last page request.
9980func (page TagCollectionPage) Response() TagCollection {
9981	return page.tc
9982}
9983
9984// Values returns the slice of values for the current page or nil if there are no values.
9985func (page TagCollectionPage) Values() []TagContract {
9986	if page.tc.IsEmpty() {
9987		return nil
9988	}
9989	return *page.tc.Value
9990}
9991
9992// Creates a new instance of the TagCollectionPage type.
9993func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage {
9994	return TagCollectionPage{
9995		fn: getNextPage,
9996		tc: cur,
9997	}
9998}
9999
10000// TagContract tag Contract details.
10001type TagContract struct {
10002	autorest.Response `json:"-"`
10003	// TagContractProperties - Tag entity contract properties.
10004	*TagContractProperties `json:"properties,omitempty"`
10005	// ID - READ-ONLY; Resource ID.
10006	ID *string `json:"id,omitempty"`
10007	// Name - READ-ONLY; Resource name.
10008	Name *string `json:"name,omitempty"`
10009	// Type - READ-ONLY; Resource type for API Management resource.
10010	Type *string `json:"type,omitempty"`
10011}
10012
10013// MarshalJSON is the custom marshaler for TagContract.
10014func (tc TagContract) MarshalJSON() ([]byte, error) {
10015	objectMap := make(map[string]interface{})
10016	if tc.TagContractProperties != nil {
10017		objectMap["properties"] = tc.TagContractProperties
10018	}
10019	return json.Marshal(objectMap)
10020}
10021
10022// UnmarshalJSON is the custom unmarshaler for TagContract struct.
10023func (tc *TagContract) UnmarshalJSON(body []byte) error {
10024	var m map[string]*json.RawMessage
10025	err := json.Unmarshal(body, &m)
10026	if err != nil {
10027		return err
10028	}
10029	for k, v := range m {
10030		switch k {
10031		case "properties":
10032			if v != nil {
10033				var tagContractProperties TagContractProperties
10034				err = json.Unmarshal(*v, &tagContractProperties)
10035				if err != nil {
10036					return err
10037				}
10038				tc.TagContractProperties = &tagContractProperties
10039			}
10040		case "id":
10041			if v != nil {
10042				var ID string
10043				err = json.Unmarshal(*v, &ID)
10044				if err != nil {
10045					return err
10046				}
10047				tc.ID = &ID
10048			}
10049		case "name":
10050			if v != nil {
10051				var name string
10052				err = json.Unmarshal(*v, &name)
10053				if err != nil {
10054					return err
10055				}
10056				tc.Name = &name
10057			}
10058		case "type":
10059			if v != nil {
10060				var typeVar string
10061				err = json.Unmarshal(*v, &typeVar)
10062				if err != nil {
10063					return err
10064				}
10065				tc.Type = &typeVar
10066			}
10067		}
10068	}
10069
10070	return nil
10071}
10072
10073// TagContractProperties tag contract Properties.
10074type TagContractProperties struct {
10075	// DisplayName - Tag name.
10076	DisplayName *string `json:"displayName,omitempty"`
10077}
10078
10079// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations.
10080type TagCreateUpdateParameters struct {
10081	// TagContractProperties - Properties supplied to Create Tag operation.
10082	*TagContractProperties `json:"properties,omitempty"`
10083}
10084
10085// MarshalJSON is the custom marshaler for TagCreateUpdateParameters.
10086func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) {
10087	objectMap := make(map[string]interface{})
10088	if tcup.TagContractProperties != nil {
10089		objectMap["properties"] = tcup.TagContractProperties
10090	}
10091	return json.Marshal(objectMap)
10092}
10093
10094// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct.
10095func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error {
10096	var m map[string]*json.RawMessage
10097	err := json.Unmarshal(body, &m)
10098	if err != nil {
10099		return err
10100	}
10101	for k, v := range m {
10102		switch k {
10103		case "properties":
10104			if v != nil {
10105				var tagContractProperties TagContractProperties
10106				err = json.Unmarshal(*v, &tagContractProperties)
10107				if err != nil {
10108					return err
10109				}
10110				tcup.TagContractProperties = &tagContractProperties
10111			}
10112		}
10113	}
10114
10115	return nil
10116}
10117
10118// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation.
10119type TagDescriptionBaseProperties struct {
10120	// Description - Description of the Tag.
10121	Description *string `json:"description,omitempty"`
10122	// ExternalDocsURL - Absolute URL of external resources describing the tag.
10123	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
10124	// ExternalDocsDescription - Description of the external resources describing the tag.
10125	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
10126}
10127
10128// TagDescriptionCollection paged TagDescription list representation.
10129type TagDescriptionCollection struct {
10130	autorest.Response `json:"-"`
10131	// Value - Page values.
10132	Value *[]TagDescriptionContract `json:"value,omitempty"`
10133	// NextLink - Next page link if any.
10134	NextLink *string `json:"nextLink,omitempty"`
10135}
10136
10137// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values.
10138type TagDescriptionCollectionIterator struct {
10139	i    int
10140	page TagDescriptionCollectionPage
10141}
10142
10143// NextWithContext advances to the next value.  If there was an error making
10144// the request the iterator does not advance and the error is returned.
10145func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10146	if tracing.IsEnabled() {
10147		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext")
10148		defer func() {
10149			sc := -1
10150			if iter.Response().Response.Response != nil {
10151				sc = iter.Response().Response.Response.StatusCode
10152			}
10153			tracing.EndSpan(ctx, sc, err)
10154		}()
10155	}
10156	iter.i++
10157	if iter.i < len(iter.page.Values()) {
10158		return nil
10159	}
10160	err = iter.page.NextWithContext(ctx)
10161	if err != nil {
10162		iter.i--
10163		return err
10164	}
10165	iter.i = 0
10166	return nil
10167}
10168
10169// Next advances to the next value.  If there was an error making
10170// the request the iterator does not advance and the error is returned.
10171// Deprecated: Use NextWithContext() instead.
10172func (iter *TagDescriptionCollectionIterator) Next() error {
10173	return iter.NextWithContext(context.Background())
10174}
10175
10176// NotDone returns true if the enumeration should be started or is not yet complete.
10177func (iter TagDescriptionCollectionIterator) NotDone() bool {
10178	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10179}
10180
10181// Response returns the raw server response from the last page request.
10182func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection {
10183	return iter.page.Response()
10184}
10185
10186// Value returns the current value or a zero-initialized value if the
10187// iterator has advanced beyond the end of the collection.
10188func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract {
10189	if !iter.page.NotDone() {
10190		return TagDescriptionContract{}
10191	}
10192	return iter.page.Values()[iter.i]
10193}
10194
10195// Creates a new instance of the TagDescriptionCollectionIterator type.
10196func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator {
10197	return TagDescriptionCollectionIterator{page: page}
10198}
10199
10200// IsEmpty returns true if the ListResult contains no values.
10201func (tdc TagDescriptionCollection) IsEmpty() bool {
10202	return tdc.Value == nil || len(*tdc.Value) == 0
10203}
10204
10205// hasNextLink returns true if the NextLink is not empty.
10206func (tdc TagDescriptionCollection) hasNextLink() bool {
10207	return tdc.NextLink != nil && len(*tdc.NextLink) != 0
10208}
10209
10210// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results.
10211// It returns nil if no more results exist.
10212func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
10213	if !tdc.hasNextLink() {
10214		return nil, nil
10215	}
10216	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10217		autorest.AsJSON(),
10218		autorest.AsGet(),
10219		autorest.WithBaseURL(to.String(tdc.NextLink)))
10220}
10221
10222// TagDescriptionCollectionPage contains a page of TagDescriptionContract values.
10223type TagDescriptionCollectionPage struct {
10224	fn  func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)
10225	tdc TagDescriptionCollection
10226}
10227
10228// NextWithContext advances to the next page of values.  If there was an error making
10229// the request the page does not advance and the error is returned.
10230func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
10231	if tracing.IsEnabled() {
10232		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext")
10233		defer func() {
10234			sc := -1
10235			if page.Response().Response.Response != nil {
10236				sc = page.Response().Response.Response.StatusCode
10237			}
10238			tracing.EndSpan(ctx, sc, err)
10239		}()
10240	}
10241	for {
10242		next, err := page.fn(ctx, page.tdc)
10243		if err != nil {
10244			return err
10245		}
10246		page.tdc = next
10247		if !next.hasNextLink() || !next.IsEmpty() {
10248			break
10249		}
10250	}
10251	return nil
10252}
10253
10254// Next advances to the next page of values.  If there was an error making
10255// the request the page does not advance and the error is returned.
10256// Deprecated: Use NextWithContext() instead.
10257func (page *TagDescriptionCollectionPage) Next() error {
10258	return page.NextWithContext(context.Background())
10259}
10260
10261// NotDone returns true if the page enumeration should be started or is not yet complete.
10262func (page TagDescriptionCollectionPage) NotDone() bool {
10263	return !page.tdc.IsEmpty()
10264}
10265
10266// Response returns the raw server response from the last page request.
10267func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection {
10268	return page.tdc
10269}
10270
10271// Values returns the slice of values for the current page or nil if there are no values.
10272func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract {
10273	if page.tdc.IsEmpty() {
10274		return nil
10275	}
10276	return *page.tdc.Value
10277}
10278
10279// Creates a new instance of the TagDescriptionCollectionPage type.
10280func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage {
10281	return TagDescriptionCollectionPage{
10282		fn:  getNextPage,
10283		tdc: cur,
10284	}
10285}
10286
10287// TagDescriptionContract contract details.
10288type TagDescriptionContract struct {
10289	autorest.Response `json:"-"`
10290	// TagDescriptionContractProperties - TagDescription entity contract properties.
10291	*TagDescriptionContractProperties `json:"properties,omitempty"`
10292	// ID - READ-ONLY; Resource ID.
10293	ID *string `json:"id,omitempty"`
10294	// Name - READ-ONLY; Resource name.
10295	Name *string `json:"name,omitempty"`
10296	// Type - READ-ONLY; Resource type for API Management resource.
10297	Type *string `json:"type,omitempty"`
10298}
10299
10300// MarshalJSON is the custom marshaler for TagDescriptionContract.
10301func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) {
10302	objectMap := make(map[string]interface{})
10303	if tdc.TagDescriptionContractProperties != nil {
10304		objectMap["properties"] = tdc.TagDescriptionContractProperties
10305	}
10306	return json.Marshal(objectMap)
10307}
10308
10309// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct.
10310func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error {
10311	var m map[string]*json.RawMessage
10312	err := json.Unmarshal(body, &m)
10313	if err != nil {
10314		return err
10315	}
10316	for k, v := range m {
10317		switch k {
10318		case "properties":
10319			if v != nil {
10320				var tagDescriptionContractProperties TagDescriptionContractProperties
10321				err = json.Unmarshal(*v, &tagDescriptionContractProperties)
10322				if err != nil {
10323					return err
10324				}
10325				tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties
10326			}
10327		case "id":
10328			if v != nil {
10329				var ID string
10330				err = json.Unmarshal(*v, &ID)
10331				if err != nil {
10332					return err
10333				}
10334				tdc.ID = &ID
10335			}
10336		case "name":
10337			if v != nil {
10338				var name string
10339				err = json.Unmarshal(*v, &name)
10340				if err != nil {
10341					return err
10342				}
10343				tdc.Name = &name
10344			}
10345		case "type":
10346			if v != nil {
10347				var typeVar string
10348				err = json.Unmarshal(*v, &typeVar)
10349				if err != nil {
10350					return err
10351				}
10352				tdc.Type = &typeVar
10353			}
10354		}
10355	}
10356
10357	return nil
10358}
10359
10360// TagDescriptionContractProperties tagDescription contract Properties.
10361type TagDescriptionContractProperties struct {
10362	// DisplayName - Tag name.
10363	DisplayName *string `json:"displayName,omitempty"`
10364	// Description - Description of the Tag.
10365	Description *string `json:"description,omitempty"`
10366	// ExternalDocsURL - Absolute URL of external resources describing the tag.
10367	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
10368	// ExternalDocsDescription - Description of the external resources describing the tag.
10369	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
10370}
10371
10372// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation.
10373type TagDescriptionCreateParameters struct {
10374	// TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation.
10375	*TagDescriptionBaseProperties `json:"properties,omitempty"`
10376}
10377
10378// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters.
10379func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) {
10380	objectMap := make(map[string]interface{})
10381	if tdcp.TagDescriptionBaseProperties != nil {
10382		objectMap["properties"] = tdcp.TagDescriptionBaseProperties
10383	}
10384	return json.Marshal(objectMap)
10385}
10386
10387// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct.
10388func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error {
10389	var m map[string]*json.RawMessage
10390	err := json.Unmarshal(body, &m)
10391	if err != nil {
10392		return err
10393	}
10394	for k, v := range m {
10395		switch k {
10396		case "properties":
10397			if v != nil {
10398				var tagDescriptionBaseProperties TagDescriptionBaseProperties
10399				err = json.Unmarshal(*v, &tagDescriptionBaseProperties)
10400				if err != nil {
10401					return err
10402				}
10403				tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties
10404			}
10405		}
10406	}
10407
10408	return nil
10409}
10410
10411// TagResourceCollection paged Tag list representation.
10412type TagResourceCollection struct {
10413	autorest.Response `json:"-"`
10414	// Value - Page values.
10415	Value *[]TagResourceContract `json:"value,omitempty"`
10416	// NextLink - Next page link if any.
10417	NextLink *string `json:"nextLink,omitempty"`
10418}
10419
10420// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values.
10421type TagResourceCollectionIterator struct {
10422	i    int
10423	page TagResourceCollectionPage
10424}
10425
10426// NextWithContext advances to the next value.  If there was an error making
10427// the request the iterator does not advance and the error is returned.
10428func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10429	if tracing.IsEnabled() {
10430		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext")
10431		defer func() {
10432			sc := -1
10433			if iter.Response().Response.Response != nil {
10434				sc = iter.Response().Response.Response.StatusCode
10435			}
10436			tracing.EndSpan(ctx, sc, err)
10437		}()
10438	}
10439	iter.i++
10440	if iter.i < len(iter.page.Values()) {
10441		return nil
10442	}
10443	err = iter.page.NextWithContext(ctx)
10444	if err != nil {
10445		iter.i--
10446		return err
10447	}
10448	iter.i = 0
10449	return nil
10450}
10451
10452// Next advances to the next value.  If there was an error making
10453// the request the iterator does not advance and the error is returned.
10454// Deprecated: Use NextWithContext() instead.
10455func (iter *TagResourceCollectionIterator) Next() error {
10456	return iter.NextWithContext(context.Background())
10457}
10458
10459// NotDone returns true if the enumeration should be started or is not yet complete.
10460func (iter TagResourceCollectionIterator) NotDone() bool {
10461	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10462}
10463
10464// Response returns the raw server response from the last page request.
10465func (iter TagResourceCollectionIterator) Response() TagResourceCollection {
10466	return iter.page.Response()
10467}
10468
10469// Value returns the current value or a zero-initialized value if the
10470// iterator has advanced beyond the end of the collection.
10471func (iter TagResourceCollectionIterator) Value() TagResourceContract {
10472	if !iter.page.NotDone() {
10473		return TagResourceContract{}
10474	}
10475	return iter.page.Values()[iter.i]
10476}
10477
10478// Creates a new instance of the TagResourceCollectionIterator type.
10479func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator {
10480	return TagResourceCollectionIterator{page: page}
10481}
10482
10483// IsEmpty returns true if the ListResult contains no values.
10484func (trc TagResourceCollection) IsEmpty() bool {
10485	return trc.Value == nil || len(*trc.Value) == 0
10486}
10487
10488// hasNextLink returns true if the NextLink is not empty.
10489func (trc TagResourceCollection) hasNextLink() bool {
10490	return trc.NextLink != nil && len(*trc.NextLink) != 0
10491}
10492
10493// tagResourceCollectionPreparer prepares a request to retrieve the next set of results.
10494// It returns nil if no more results exist.
10495func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
10496	if !trc.hasNextLink() {
10497		return nil, nil
10498	}
10499	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10500		autorest.AsJSON(),
10501		autorest.AsGet(),
10502		autorest.WithBaseURL(to.String(trc.NextLink)))
10503}
10504
10505// TagResourceCollectionPage contains a page of TagResourceContract values.
10506type TagResourceCollectionPage struct {
10507	fn  func(context.Context, TagResourceCollection) (TagResourceCollection, error)
10508	trc TagResourceCollection
10509}
10510
10511// NextWithContext advances to the next page of values.  If there was an error making
10512// the request the page does not advance and the error is returned.
10513func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
10514	if tracing.IsEnabled() {
10515		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext")
10516		defer func() {
10517			sc := -1
10518			if page.Response().Response.Response != nil {
10519				sc = page.Response().Response.Response.StatusCode
10520			}
10521			tracing.EndSpan(ctx, sc, err)
10522		}()
10523	}
10524	for {
10525		next, err := page.fn(ctx, page.trc)
10526		if err != nil {
10527			return err
10528		}
10529		page.trc = next
10530		if !next.hasNextLink() || !next.IsEmpty() {
10531			break
10532		}
10533	}
10534	return nil
10535}
10536
10537// Next advances to the next page of values.  If there was an error making
10538// the request the page does not advance and the error is returned.
10539// Deprecated: Use NextWithContext() instead.
10540func (page *TagResourceCollectionPage) Next() error {
10541	return page.NextWithContext(context.Background())
10542}
10543
10544// NotDone returns true if the page enumeration should be started or is not yet complete.
10545func (page TagResourceCollectionPage) NotDone() bool {
10546	return !page.trc.IsEmpty()
10547}
10548
10549// Response returns the raw server response from the last page request.
10550func (page TagResourceCollectionPage) Response() TagResourceCollection {
10551	return page.trc
10552}
10553
10554// Values returns the slice of values for the current page or nil if there are no values.
10555func (page TagResourceCollectionPage) Values() []TagResourceContract {
10556	if page.trc.IsEmpty() {
10557		return nil
10558	}
10559	return *page.trc.Value
10560}
10561
10562// Creates a new instance of the TagResourceCollectionPage type.
10563func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage {
10564	return TagResourceCollectionPage{
10565		fn:  getNextPage,
10566		trc: cur,
10567	}
10568}
10569
10570// TagResourceContract contract details.
10571type TagResourceContract struct {
10572	// TagResourceContractProperties - TagResource entity contract properties.
10573	*TagResourceContractProperties `json:"properties,omitempty"`
10574	// ID - READ-ONLY; Resource ID.
10575	ID *string `json:"id,omitempty"`
10576	// Name - READ-ONLY; Resource name.
10577	Name *string `json:"name,omitempty"`
10578	// Type - READ-ONLY; Resource type for API Management resource.
10579	Type *string `json:"type,omitempty"`
10580}
10581
10582// MarshalJSON is the custom marshaler for TagResourceContract.
10583func (trc TagResourceContract) MarshalJSON() ([]byte, error) {
10584	objectMap := make(map[string]interface{})
10585	if trc.TagResourceContractProperties != nil {
10586		objectMap["properties"] = trc.TagResourceContractProperties
10587	}
10588	return json.Marshal(objectMap)
10589}
10590
10591// UnmarshalJSON is the custom unmarshaler for TagResourceContract struct.
10592func (trc *TagResourceContract) UnmarshalJSON(body []byte) error {
10593	var m map[string]*json.RawMessage
10594	err := json.Unmarshal(body, &m)
10595	if err != nil {
10596		return err
10597	}
10598	for k, v := range m {
10599		switch k {
10600		case "properties":
10601			if v != nil {
10602				var tagResourceContractProperties TagResourceContractProperties
10603				err = json.Unmarshal(*v, &tagResourceContractProperties)
10604				if err != nil {
10605					return err
10606				}
10607				trc.TagResourceContractProperties = &tagResourceContractProperties
10608			}
10609		case "id":
10610			if v != nil {
10611				var ID string
10612				err = json.Unmarshal(*v, &ID)
10613				if err != nil {
10614					return err
10615				}
10616				trc.ID = &ID
10617			}
10618		case "name":
10619			if v != nil {
10620				var name string
10621				err = json.Unmarshal(*v, &name)
10622				if err != nil {
10623					return err
10624				}
10625				trc.Name = &name
10626			}
10627		case "type":
10628			if v != nil {
10629				var typeVar string
10630				err = json.Unmarshal(*v, &typeVar)
10631				if err != nil {
10632					return err
10633				}
10634				trc.Type = &typeVar
10635			}
10636		}
10637	}
10638
10639	return nil
10640}
10641
10642// TagResourceContractProperties tagResource contract properties.
10643type TagResourceContractProperties struct {
10644	// Tag - Tag associated with the resource.
10645	Tag *TagContract `json:"tag,omitempty"`
10646	// API - Api associated with the tag.
10647	API *APIContract `json:"api,omitempty"`
10648	// Operation - Api associated with the tag.
10649	Operation *OperationEntityContract `json:"operation,omitempty"`
10650	// Product - Product associated with the tag.
10651	Product *ProductContract `json:"product,omitempty"`
10652}
10653
10654// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a
10655// long-running operation.
10656type TenantConfigurationDeployFuture struct {
10657	azure.FutureAPI
10658	// Result returns the result of the asynchronous operation.
10659	// If the operation has not completed it will return an error.
10660	Result func(TenantConfigurationClient) (OperationResultContract, error)
10661}
10662
10663// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10664func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error {
10665	var azFuture azure.Future
10666	if err := json.Unmarshal(body, &azFuture); err != nil {
10667		return err
10668	}
10669	future.FutureAPI = &azFuture
10670	future.Result = future.result
10671	return nil
10672}
10673
10674// result is the default implementation for TenantConfigurationDeployFuture.Result.
10675func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
10676	var done bool
10677	done, err = future.DoneWithContext(context.Background(), client)
10678	if err != nil {
10679		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure")
10680		return
10681	}
10682	if !done {
10683		orc.Response.Response = future.Response()
10684		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture")
10685		return
10686	}
10687	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10688	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
10689		orc, err = client.DeployResponder(orc.Response.Response)
10690		if err != nil {
10691			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request")
10692		}
10693	}
10694	return
10695}
10696
10697// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running
10698// operation.
10699type TenantConfigurationSaveFuture struct {
10700	azure.FutureAPI
10701	// Result returns the result of the asynchronous operation.
10702	// If the operation has not completed it will return an error.
10703	Result func(TenantConfigurationClient) (OperationResultContract, error)
10704}
10705
10706// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10707func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error {
10708	var azFuture azure.Future
10709	if err := json.Unmarshal(body, &azFuture); err != nil {
10710		return err
10711	}
10712	future.FutureAPI = &azFuture
10713	future.Result = future.result
10714	return nil
10715}
10716
10717// result is the default implementation for TenantConfigurationSaveFuture.Result.
10718func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
10719	var done bool
10720	done, err = future.DoneWithContext(context.Background(), client)
10721	if err != nil {
10722		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure")
10723		return
10724	}
10725	if !done {
10726		orc.Response.Response = future.Response()
10727		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture")
10728		return
10729	}
10730	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10731	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
10732		orc, err = client.SaveResponder(orc.Response.Response)
10733		if err != nil {
10734			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request")
10735		}
10736	}
10737	return
10738}
10739
10740// TenantConfigurationSyncStateContract tenant Configuration Synchronization State.
10741type TenantConfigurationSyncStateContract struct {
10742	autorest.Response `json:"-"`
10743	// Branch - The name of Git branch.
10744	Branch *string `json:"branch,omitempty"`
10745	// CommitID - The latest commit Id.
10746	CommitID *string `json:"commitId,omitempty"`
10747	// IsExport - value indicating if last sync was save (true) or deploy (false) operation.
10748	IsExport *bool `json:"isExport,omitempty"`
10749	// IsSynced - value indicating if last synchronization was later than the configuration change.
10750	IsSynced *bool `json:"isSynced,omitempty"`
10751	// IsGitEnabled - value indicating whether Git configuration access is enabled.
10752	IsGitEnabled *bool `json:"isGitEnabled,omitempty"`
10753	// SyncDate - The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
10754	SyncDate *date.Time `json:"syncDate,omitempty"`
10755	// ConfigurationChangeDate - The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
10756	ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"`
10757}
10758
10759// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a
10760// long-running operation.
10761type TenantConfigurationValidateFuture struct {
10762	azure.FutureAPI
10763	// Result returns the result of the asynchronous operation.
10764	// If the operation has not completed it will return an error.
10765	Result func(TenantConfigurationClient) (OperationResultContract, error)
10766}
10767
10768// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10769func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error {
10770	var azFuture azure.Future
10771	if err := json.Unmarshal(body, &azFuture); err != nil {
10772		return err
10773	}
10774	future.FutureAPI = &azFuture
10775	future.Result = future.result
10776	return nil
10777}
10778
10779// result is the default implementation for TenantConfigurationValidateFuture.Result.
10780func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
10781	var done bool
10782	done, err = future.DoneWithContext(context.Background(), client)
10783	if err != nil {
10784		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure")
10785		return
10786	}
10787	if !done {
10788		orc.Response.Response = future.Response()
10789		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture")
10790		return
10791	}
10792	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10793	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
10794		orc, err = client.ValidateResponder(orc.Response.Response)
10795		if err != nil {
10796			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request")
10797		}
10798	}
10799	return
10800}
10801
10802// TermsOfServiceProperties terms of service contract properties.
10803type TermsOfServiceProperties struct {
10804	// Text - A terms of service text.
10805	Text *string `json:"text,omitempty"`
10806	// Enabled - Display terms of service during a sign-up process.
10807	Enabled *bool `json:"enabled,omitempty"`
10808	// ConsentRequired - Ask user for consent.
10809	ConsentRequired *bool `json:"consentRequired,omitempty"`
10810}
10811
10812// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded).
10813type TokenBodyParameterContract struct {
10814	// Name - body parameter name.
10815	Name *string `json:"name,omitempty"`
10816	// Value - body parameter value.
10817	Value *string `json:"value,omitempty"`
10818}
10819
10820// UserCollection paged Users list representation.
10821type UserCollection struct {
10822	autorest.Response `json:"-"`
10823	// Value - Page values.
10824	Value *[]UserContract `json:"value,omitempty"`
10825	// NextLink - Next page link if any.
10826	NextLink *string `json:"nextLink,omitempty"`
10827}
10828
10829// UserCollectionIterator provides access to a complete listing of UserContract values.
10830type UserCollectionIterator struct {
10831	i    int
10832	page UserCollectionPage
10833}
10834
10835// NextWithContext advances to the next value.  If there was an error making
10836// the request the iterator does not advance and the error is returned.
10837func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10838	if tracing.IsEnabled() {
10839		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext")
10840		defer func() {
10841			sc := -1
10842			if iter.Response().Response.Response != nil {
10843				sc = iter.Response().Response.Response.StatusCode
10844			}
10845			tracing.EndSpan(ctx, sc, err)
10846		}()
10847	}
10848	iter.i++
10849	if iter.i < len(iter.page.Values()) {
10850		return nil
10851	}
10852	err = iter.page.NextWithContext(ctx)
10853	if err != nil {
10854		iter.i--
10855		return err
10856	}
10857	iter.i = 0
10858	return nil
10859}
10860
10861// Next advances to the next value.  If there was an error making
10862// the request the iterator does not advance and the error is returned.
10863// Deprecated: Use NextWithContext() instead.
10864func (iter *UserCollectionIterator) Next() error {
10865	return iter.NextWithContext(context.Background())
10866}
10867
10868// NotDone returns true if the enumeration should be started or is not yet complete.
10869func (iter UserCollectionIterator) NotDone() bool {
10870	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10871}
10872
10873// Response returns the raw server response from the last page request.
10874func (iter UserCollectionIterator) Response() UserCollection {
10875	return iter.page.Response()
10876}
10877
10878// Value returns the current value or a zero-initialized value if the
10879// iterator has advanced beyond the end of the collection.
10880func (iter UserCollectionIterator) Value() UserContract {
10881	if !iter.page.NotDone() {
10882		return UserContract{}
10883	}
10884	return iter.page.Values()[iter.i]
10885}
10886
10887// Creates a new instance of the UserCollectionIterator type.
10888func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator {
10889	return UserCollectionIterator{page: page}
10890}
10891
10892// IsEmpty returns true if the ListResult contains no values.
10893func (uc UserCollection) IsEmpty() bool {
10894	return uc.Value == nil || len(*uc.Value) == 0
10895}
10896
10897// hasNextLink returns true if the NextLink is not empty.
10898func (uc UserCollection) hasNextLink() bool {
10899	return uc.NextLink != nil && len(*uc.NextLink) != 0
10900}
10901
10902// userCollectionPreparer prepares a request to retrieve the next set of results.
10903// It returns nil if no more results exist.
10904func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) {
10905	if !uc.hasNextLink() {
10906		return nil, nil
10907	}
10908	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10909		autorest.AsJSON(),
10910		autorest.AsGet(),
10911		autorest.WithBaseURL(to.String(uc.NextLink)))
10912}
10913
10914// UserCollectionPage contains a page of UserContract values.
10915type UserCollectionPage struct {
10916	fn func(context.Context, UserCollection) (UserCollection, error)
10917	uc UserCollection
10918}
10919
10920// NextWithContext advances to the next page of values.  If there was an error making
10921// the request the page does not advance and the error is returned.
10922func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) {
10923	if tracing.IsEnabled() {
10924		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext")
10925		defer func() {
10926			sc := -1
10927			if page.Response().Response.Response != nil {
10928				sc = page.Response().Response.Response.StatusCode
10929			}
10930			tracing.EndSpan(ctx, sc, err)
10931		}()
10932	}
10933	for {
10934		next, err := page.fn(ctx, page.uc)
10935		if err != nil {
10936			return err
10937		}
10938		page.uc = next
10939		if !next.hasNextLink() || !next.IsEmpty() {
10940			break
10941		}
10942	}
10943	return nil
10944}
10945
10946// Next advances to the next page of values.  If there was an error making
10947// the request the page does not advance and the error is returned.
10948// Deprecated: Use NextWithContext() instead.
10949func (page *UserCollectionPage) Next() error {
10950	return page.NextWithContext(context.Background())
10951}
10952
10953// NotDone returns true if the page enumeration should be started or is not yet complete.
10954func (page UserCollectionPage) NotDone() bool {
10955	return !page.uc.IsEmpty()
10956}
10957
10958// Response returns the raw server response from the last page request.
10959func (page UserCollectionPage) Response() UserCollection {
10960	return page.uc
10961}
10962
10963// Values returns the slice of values for the current page or nil if there are no values.
10964func (page UserCollectionPage) Values() []UserContract {
10965	if page.uc.IsEmpty() {
10966		return nil
10967	}
10968	return *page.uc.Value
10969}
10970
10971// Creates a new instance of the UserCollectionPage type.
10972func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage {
10973	return UserCollectionPage{
10974		fn: getNextPage,
10975		uc: cur,
10976	}
10977}
10978
10979// UserContract user details.
10980type UserContract struct {
10981	autorest.Response `json:"-"`
10982	// UserContractProperties - User entity contract properties.
10983	*UserContractProperties `json:"properties,omitempty"`
10984	// ID - READ-ONLY; Resource ID.
10985	ID *string `json:"id,omitempty"`
10986	// Name - READ-ONLY; Resource name.
10987	Name *string `json:"name,omitempty"`
10988	// Type - READ-ONLY; Resource type for API Management resource.
10989	Type *string `json:"type,omitempty"`
10990}
10991
10992// MarshalJSON is the custom marshaler for UserContract.
10993func (uc UserContract) MarshalJSON() ([]byte, error) {
10994	objectMap := make(map[string]interface{})
10995	if uc.UserContractProperties != nil {
10996		objectMap["properties"] = uc.UserContractProperties
10997	}
10998	return json.Marshal(objectMap)
10999}
11000
11001// UnmarshalJSON is the custom unmarshaler for UserContract struct.
11002func (uc *UserContract) UnmarshalJSON(body []byte) error {
11003	var m map[string]*json.RawMessage
11004	err := json.Unmarshal(body, &m)
11005	if err != nil {
11006		return err
11007	}
11008	for k, v := range m {
11009		switch k {
11010		case "properties":
11011			if v != nil {
11012				var userContractProperties UserContractProperties
11013				err = json.Unmarshal(*v, &userContractProperties)
11014				if err != nil {
11015					return err
11016				}
11017				uc.UserContractProperties = &userContractProperties
11018			}
11019		case "id":
11020			if v != nil {
11021				var ID string
11022				err = json.Unmarshal(*v, &ID)
11023				if err != nil {
11024					return err
11025				}
11026				uc.ID = &ID
11027			}
11028		case "name":
11029			if v != nil {
11030				var name string
11031				err = json.Unmarshal(*v, &name)
11032				if err != nil {
11033					return err
11034				}
11035				uc.Name = &name
11036			}
11037		case "type":
11038			if v != nil {
11039				var typeVar string
11040				err = json.Unmarshal(*v, &typeVar)
11041				if err != nil {
11042					return err
11043				}
11044				uc.Type = &typeVar
11045			}
11046		}
11047	}
11048
11049	return nil
11050}
11051
11052// UserContractProperties user profile.
11053type UserContractProperties struct {
11054	// FirstName - First name.
11055	FirstName *string `json:"firstName,omitempty"`
11056	// LastName - Last name.
11057	LastName *string `json:"lastName,omitempty"`
11058	// Email - Email address.
11059	Email *string `json:"email,omitempty"`
11060	// RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
11061	RegistrationDate *date.Time `json:"registrationDate,omitempty"`
11062	// Groups - READ-ONLY; Collection of groups user is part of.
11063	Groups *[]GroupContract `json:"groups,omitempty"`
11064	// State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted'
11065	State UserState `json:"state,omitempty"`
11066	// Note - Optional note about a user set by the administrator.
11067	Note *string `json:"note,omitempty"`
11068	// Identities - READ-ONLY; Collection of user identities.
11069	Identities *[]UserIdentityContract `json:"identities,omitempty"`
11070}
11071
11072// MarshalJSON is the custom marshaler for UserContractProperties.
11073func (ucp UserContractProperties) MarshalJSON() ([]byte, error) {
11074	objectMap := make(map[string]interface{})
11075	if ucp.FirstName != nil {
11076		objectMap["firstName"] = ucp.FirstName
11077	}
11078	if ucp.LastName != nil {
11079		objectMap["lastName"] = ucp.LastName
11080	}
11081	if ucp.Email != nil {
11082		objectMap["email"] = ucp.Email
11083	}
11084	if ucp.RegistrationDate != nil {
11085		objectMap["registrationDate"] = ucp.RegistrationDate
11086	}
11087	if ucp.State != "" {
11088		objectMap["state"] = ucp.State
11089	}
11090	if ucp.Note != nil {
11091		objectMap["note"] = ucp.Note
11092	}
11093	return json.Marshal(objectMap)
11094}
11095
11096// UserCreateParameterProperties parameters supplied to the Create User operation.
11097type UserCreateParameterProperties struct {
11098	// Email - Email address. Must not be empty and must be unique within the service instance.
11099	Email *string `json:"email,omitempty"`
11100	// FirstName - First name.
11101	FirstName *string `json:"firstName,omitempty"`
11102	// LastName - Last name.
11103	LastName *string `json:"lastName,omitempty"`
11104	// Password - User Password. If no value is provided, a default password is generated.
11105	Password *string `json:"password,omitempty"`
11106	// Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite'
11107	Confirmation Confirmation `json:"confirmation,omitempty"`
11108	// State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted'
11109	State UserState `json:"state,omitempty"`
11110	// Note - Optional note about a user set by the administrator.
11111	Note *string `json:"note,omitempty"`
11112	// Identities - READ-ONLY; Collection of user identities.
11113	Identities *[]UserIdentityContract `json:"identities,omitempty"`
11114}
11115
11116// MarshalJSON is the custom marshaler for UserCreateParameterProperties.
11117func (ucpp UserCreateParameterProperties) MarshalJSON() ([]byte, error) {
11118	objectMap := make(map[string]interface{})
11119	if ucpp.Email != nil {
11120		objectMap["email"] = ucpp.Email
11121	}
11122	if ucpp.FirstName != nil {
11123		objectMap["firstName"] = ucpp.FirstName
11124	}
11125	if ucpp.LastName != nil {
11126		objectMap["lastName"] = ucpp.LastName
11127	}
11128	if ucpp.Password != nil {
11129		objectMap["password"] = ucpp.Password
11130	}
11131	if ucpp.Confirmation != "" {
11132		objectMap["confirmation"] = ucpp.Confirmation
11133	}
11134	if ucpp.State != "" {
11135		objectMap["state"] = ucpp.State
11136	}
11137	if ucpp.Note != nil {
11138		objectMap["note"] = ucpp.Note
11139	}
11140	return json.Marshal(objectMap)
11141}
11142
11143// UserCreateParameters user create details.
11144type UserCreateParameters struct {
11145	// UserCreateParameterProperties - User entity create contract properties.
11146	*UserCreateParameterProperties `json:"properties,omitempty"`
11147}
11148
11149// MarshalJSON is the custom marshaler for UserCreateParameters.
11150func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) {
11151	objectMap := make(map[string]interface{})
11152	if ucp.UserCreateParameterProperties != nil {
11153		objectMap["properties"] = ucp.UserCreateParameterProperties
11154	}
11155	return json.Marshal(objectMap)
11156}
11157
11158// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct.
11159func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error {
11160	var m map[string]*json.RawMessage
11161	err := json.Unmarshal(body, &m)
11162	if err != nil {
11163		return err
11164	}
11165	for k, v := range m {
11166		switch k {
11167		case "properties":
11168			if v != nil {
11169				var userCreateParameterProperties UserCreateParameterProperties
11170				err = json.Unmarshal(*v, &userCreateParameterProperties)
11171				if err != nil {
11172					return err
11173				}
11174				ucp.UserCreateParameterProperties = &userCreateParameterProperties
11175			}
11176		}
11177	}
11178
11179	return nil
11180}
11181
11182// UserEntityBaseParameters user Entity Base Parameters set.
11183type UserEntityBaseParameters struct {
11184	// State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted'
11185	State UserState `json:"state,omitempty"`
11186	// Note - Optional note about a user set by the administrator.
11187	Note *string `json:"note,omitempty"`
11188	// Identities - READ-ONLY; Collection of user identities.
11189	Identities *[]UserIdentityContract `json:"identities,omitempty"`
11190}
11191
11192// MarshalJSON is the custom marshaler for UserEntityBaseParameters.
11193func (uebp UserEntityBaseParameters) MarshalJSON() ([]byte, error) {
11194	objectMap := make(map[string]interface{})
11195	if uebp.State != "" {
11196		objectMap["state"] = uebp.State
11197	}
11198	if uebp.Note != nil {
11199		objectMap["note"] = uebp.Note
11200	}
11201	return json.Marshal(objectMap)
11202}
11203
11204// UserIdentityCollection list of Users Identity list representation.
11205type UserIdentityCollection struct {
11206	autorest.Response `json:"-"`
11207	// Value - User Identity values.
11208	Value *[]UserIdentityContract `json:"value,omitempty"`
11209	// Count - Total record count number across all pages.
11210	Count *int64 `json:"count,omitempty"`
11211	// NextLink - Next page link if any.
11212	NextLink *string `json:"nextLink,omitempty"`
11213}
11214
11215// UserIdentityContract user identity details.
11216type UserIdentityContract struct {
11217	// Provider - Identity provider name.
11218	Provider *string `json:"provider,omitempty"`
11219	// ID - Identifier value within provider.
11220	ID *string `json:"id,omitempty"`
11221}
11222
11223// UserTokenParameters parameters supplied to the Get User Token operation.
11224type UserTokenParameters struct {
11225	// KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary'
11226	KeyType KeyType `json:"keyType,omitempty"`
11227	// Expiry - The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
11228	Expiry *date.Time `json:"expiry,omitempty"`
11229}
11230
11231// UserTokenResult get User Token response details.
11232type UserTokenResult struct {
11233	autorest.Response `json:"-"`
11234	// Value - Shared Access Authorization token for the User.
11235	Value *string `json:"value,omitempty"`
11236}
11237
11238// UserUpdateParameters user update parameters.
11239type UserUpdateParameters struct {
11240	// UserUpdateParametersProperties - User entity update contract properties.
11241	*UserUpdateParametersProperties `json:"properties,omitempty"`
11242}
11243
11244// MarshalJSON is the custom marshaler for UserUpdateParameters.
11245func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) {
11246	objectMap := make(map[string]interface{})
11247	if uup.UserUpdateParametersProperties != nil {
11248		objectMap["properties"] = uup.UserUpdateParametersProperties
11249	}
11250	return json.Marshal(objectMap)
11251}
11252
11253// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct.
11254func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error {
11255	var m map[string]*json.RawMessage
11256	err := json.Unmarshal(body, &m)
11257	if err != nil {
11258		return err
11259	}
11260	for k, v := range m {
11261		switch k {
11262		case "properties":
11263			if v != nil {
11264				var userUpdateParametersProperties UserUpdateParametersProperties
11265				err = json.Unmarshal(*v, &userUpdateParametersProperties)
11266				if err != nil {
11267					return err
11268				}
11269				uup.UserUpdateParametersProperties = &userUpdateParametersProperties
11270			}
11271		}
11272	}
11273
11274	return nil
11275}
11276
11277// UserUpdateParametersProperties parameters supplied to the Update User operation.
11278type UserUpdateParametersProperties struct {
11279	// Email - Email address. Must not be empty and must be unique within the service instance.
11280	Email *string `json:"email,omitempty"`
11281	// Password - User Password.
11282	Password *string `json:"password,omitempty"`
11283	// FirstName - First name.
11284	FirstName *string `json:"firstName,omitempty"`
11285	// LastName - Last name.
11286	LastName *string `json:"lastName,omitempty"`
11287	// State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted'
11288	State UserState `json:"state,omitempty"`
11289	// Note - Optional note about a user set by the administrator.
11290	Note *string `json:"note,omitempty"`
11291	// Identities - READ-ONLY; Collection of user identities.
11292	Identities *[]UserIdentityContract `json:"identities,omitempty"`
11293}
11294
11295// MarshalJSON is the custom marshaler for UserUpdateParametersProperties.
11296func (uupp UserUpdateParametersProperties) MarshalJSON() ([]byte, error) {
11297	objectMap := make(map[string]interface{})
11298	if uupp.Email != nil {
11299		objectMap["email"] = uupp.Email
11300	}
11301	if uupp.Password != nil {
11302		objectMap["password"] = uupp.Password
11303	}
11304	if uupp.FirstName != nil {
11305		objectMap["firstName"] = uupp.FirstName
11306	}
11307	if uupp.LastName != nil {
11308		objectMap["lastName"] = uupp.LastName
11309	}
11310	if uupp.State != "" {
11311		objectMap["state"] = uupp.State
11312	}
11313	if uupp.Note != nil {
11314		objectMap["note"] = uupp.Note
11315	}
11316	return json.Marshal(objectMap)
11317}
11318
11319// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is
11320// deployed.
11321type VirtualNetworkConfiguration struct {
11322	// Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default.
11323	Vnetid *string `json:"vnetid,omitempty"`
11324	// Subnetname - READ-ONLY; The name of the subnet.
11325	Subnetname *string `json:"subnetname,omitempty"`
11326	// SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in.
11327	SubnetResourceID *string `json:"subnetResourceId,omitempty"`
11328}
11329
11330// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration.
11331func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) {
11332	objectMap := make(map[string]interface{})
11333	if vnc.SubnetResourceID != nil {
11334		objectMap["subnetResourceId"] = vnc.SubnetResourceID
11335	}
11336	return json.Marshal(objectMap)
11337}
11338
11339// X509CertificateName properties of server X509Names.
11340type X509CertificateName struct {
11341	// Name - Common Name of the Certificate.
11342	Name *string `json:"name,omitempty"`
11343	// IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate.
11344	IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"`
11345}
11346