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