1package apimanagement
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"github.com/gofrs/uuid"
18	"net/http"
19)
20
21// The package's fully qualified name.
22const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/mgmt/2019-12-01-preview/apimanagement"
23
24// AccessInformationContract tenant access information contract of the API Management service.
25type AccessInformationContract struct {
26	autorest.Response `json:"-"`
27	// ID - Identifier.
28	ID *string `json:"id,omitempty"`
29	// PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
30	PrimaryKey *string `json:"primaryKey,omitempty"`
31	// SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
32	SecondaryKey *string `json:"secondaryKey,omitempty"`
33	// Enabled - Determines whether direct access is enabled.
34	Enabled *bool `json:"enabled,omitempty"`
35}
36
37// AccessInformationUpdateParameterProperties tenant access information update parameters of the API
38// Management service
39type AccessInformationUpdateParameterProperties struct {
40	// Enabled - Determines whether direct access is enabled.
41	Enabled *bool `json:"enabled,omitempty"`
42}
43
44// AccessInformationUpdateParameters tenant access information update parameters.
45type AccessInformationUpdateParameters struct {
46	// AccessInformationUpdateParameterProperties - Tenant access information update parameter properties.
47	*AccessInformationUpdateParameterProperties `json:"properties,omitempty"`
48}
49
50// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters.
51func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) {
52	objectMap := make(map[string]interface{})
53	if aiup.AccessInformationUpdateParameterProperties != nil {
54		objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties
55	}
56	return json.Marshal(objectMap)
57}
58
59// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct.
60func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error {
61	var m map[string]*json.RawMessage
62	err := json.Unmarshal(body, &m)
63	if err != nil {
64		return err
65	}
66	for k, v := range m {
67		switch k {
68		case "properties":
69			if v != nil {
70				var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties
71				err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties)
72				if err != nil {
73					return err
74				}
75				aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties
76			}
77		}
78	}
79
80	return nil
81}
82
83// AdditionalLocation description of an additional API Management resource location.
84type AdditionalLocation struct {
85	// Location - The location name of the additional region among Azure Data center regions.
86	Location *string `json:"location,omitempty"`
87	// Sku - SKU properties of the API Management service.
88	Sku *ServiceSkuProperties `json:"sku,omitempty"`
89	// 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.
90	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
91	// 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.
92	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
93	// VirtualNetworkConfiguration - Virtual network configuration for the location.
94	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
95	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region.
96	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
97	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location.
98	DisableGateway *bool `json:"disableGateway,omitempty"`
99}
100
101// MarshalJSON is the custom marshaler for AdditionalLocation.
102func (al AdditionalLocation) MarshalJSON() ([]byte, error) {
103	objectMap := make(map[string]interface{})
104	if al.Location != nil {
105		objectMap["location"] = al.Location
106	}
107	if al.Sku != nil {
108		objectMap["sku"] = al.Sku
109	}
110	if al.VirtualNetworkConfiguration != nil {
111		objectMap["virtualNetworkConfiguration"] = al.VirtualNetworkConfiguration
112	}
113	if al.DisableGateway != nil {
114		objectMap["disableGateway"] = al.DisableGateway
115	}
116	return json.Marshal(objectMap)
117}
118
119// APICollection paged Api list representation.
120type APICollection struct {
121	autorest.Response `json:"-"`
122	// Value - READ-ONLY; Page values.
123	Value *[]APIContract `json:"value,omitempty"`
124	// NextLink - READ-ONLY; Next page link if any.
125	NextLink *string `json:"nextLink,omitempty"`
126}
127
128// MarshalJSON is the custom marshaler for APICollection.
129func (ac APICollection) MarshalJSON() ([]byte, error) {
130	objectMap := make(map[string]interface{})
131	return json.Marshal(objectMap)
132}
133
134// APICollectionIterator provides access to a complete listing of APIContract values.
135type APICollectionIterator struct {
136	i    int
137	page APICollectionPage
138}
139
140// NextWithContext advances to the next value.  If there was an error making
141// the request the iterator does not advance and the error is returned.
142func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) {
143	if tracing.IsEnabled() {
144		ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext")
145		defer func() {
146			sc := -1
147			if iter.Response().Response.Response != nil {
148				sc = iter.Response().Response.Response.StatusCode
149			}
150			tracing.EndSpan(ctx, sc, err)
151		}()
152	}
153	iter.i++
154	if iter.i < len(iter.page.Values()) {
155		return nil
156	}
157	err = iter.page.NextWithContext(ctx)
158	if err != nil {
159		iter.i--
160		return err
161	}
162	iter.i = 0
163	return nil
164}
165
166// Next advances to the next value.  If there was an error making
167// the request the iterator does not advance and the error is returned.
168// Deprecated: Use NextWithContext() instead.
169func (iter *APICollectionIterator) Next() error {
170	return iter.NextWithContext(context.Background())
171}
172
173// NotDone returns true if the enumeration should be started or is not yet complete.
174func (iter APICollectionIterator) NotDone() bool {
175	return iter.page.NotDone() && iter.i < len(iter.page.Values())
176}
177
178// Response returns the raw server response from the last page request.
179func (iter APICollectionIterator) Response() APICollection {
180	return iter.page.Response()
181}
182
183// Value returns the current value or a zero-initialized value if the
184// iterator has advanced beyond the end of the collection.
185func (iter APICollectionIterator) Value() APIContract {
186	if !iter.page.NotDone() {
187		return APIContract{}
188	}
189	return iter.page.Values()[iter.i]
190}
191
192// Creates a new instance of the APICollectionIterator type.
193func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator {
194	return APICollectionIterator{page: page}
195}
196
197// IsEmpty returns true if the ListResult contains no values.
198func (ac APICollection) IsEmpty() bool {
199	return ac.Value == nil || len(*ac.Value) == 0
200}
201
202// hasNextLink returns true if the NextLink is not empty.
203func (ac APICollection) hasNextLink() bool {
204	return ac.NextLink != nil && len(*ac.NextLink) != 0
205}
206
207// aPICollectionPreparer prepares a request to retrieve the next set of results.
208// It returns nil if no more results exist.
209func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) {
210	if !ac.hasNextLink() {
211		return nil, nil
212	}
213	return autorest.Prepare((&http.Request{}).WithContext(ctx),
214		autorest.AsJSON(),
215		autorest.AsGet(),
216		autorest.WithBaseURL(to.String(ac.NextLink)))
217}
218
219// APICollectionPage contains a page of APIContract values.
220type APICollectionPage struct {
221	fn func(context.Context, APICollection) (APICollection, error)
222	ac APICollection
223}
224
225// NextWithContext advances to the next page of values.  If there was an error making
226// the request the page does not advance and the error is returned.
227func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) {
228	if tracing.IsEnabled() {
229		ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext")
230		defer func() {
231			sc := -1
232			if page.Response().Response.Response != nil {
233				sc = page.Response().Response.Response.StatusCode
234			}
235			tracing.EndSpan(ctx, sc, err)
236		}()
237	}
238	for {
239		next, err := page.fn(ctx, page.ac)
240		if err != nil {
241			return err
242		}
243		page.ac = next
244		if !next.hasNextLink() || !next.IsEmpty() {
245			break
246		}
247	}
248	return nil
249}
250
251// Next advances to the next page of values.  If there was an error making
252// the request the page does not advance and the error is returned.
253// Deprecated: Use NextWithContext() instead.
254func (page *APICollectionPage) Next() error {
255	return page.NextWithContext(context.Background())
256}
257
258// NotDone returns true if the page enumeration should be started or is not yet complete.
259func (page APICollectionPage) NotDone() bool {
260	return !page.ac.IsEmpty()
261}
262
263// Response returns the raw server response from the last page request.
264func (page APICollectionPage) Response() APICollection {
265	return page.ac
266}
267
268// Values returns the slice of values for the current page or nil if there are no values.
269func (page APICollectionPage) Values() []APIContract {
270	if page.ac.IsEmpty() {
271		return nil
272	}
273	return *page.ac.Value
274}
275
276// Creates a new instance of the APICollectionPage type.
277func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage {
278	return APICollectionPage{
279		fn: getNextPage,
280		ac: cur,
281	}
282}
283
284// APIContract api details.
285type APIContract struct {
286	autorest.Response `json:"-"`
287	// APIContractProperties - Api entity contract properties.
288	*APIContractProperties `json:"properties,omitempty"`
289	// ID - READ-ONLY; Resource ID.
290	ID *string `json:"id,omitempty"`
291	// Name - READ-ONLY; Resource name.
292	Name *string `json:"name,omitempty"`
293	// Type - READ-ONLY; Resource type for API Management resource.
294	Type *string `json:"type,omitempty"`
295}
296
297// MarshalJSON is the custom marshaler for APIContract.
298func (ac APIContract) MarshalJSON() ([]byte, error) {
299	objectMap := make(map[string]interface{})
300	if ac.APIContractProperties != nil {
301		objectMap["properties"] = ac.APIContractProperties
302	}
303	return json.Marshal(objectMap)
304}
305
306// UnmarshalJSON is the custom unmarshaler for APIContract struct.
307func (ac *APIContract) UnmarshalJSON(body []byte) error {
308	var m map[string]*json.RawMessage
309	err := json.Unmarshal(body, &m)
310	if err != nil {
311		return err
312	}
313	for k, v := range m {
314		switch k {
315		case "properties":
316			if v != nil {
317				var APIContractProperties APIContractProperties
318				err = json.Unmarshal(*v, &APIContractProperties)
319				if err != nil {
320					return err
321				}
322				ac.APIContractProperties = &APIContractProperties
323			}
324		case "id":
325			if v != nil {
326				var ID string
327				err = json.Unmarshal(*v, &ID)
328				if err != nil {
329					return err
330				}
331				ac.ID = &ID
332			}
333		case "name":
334			if v != nil {
335				var name string
336				err = json.Unmarshal(*v, &name)
337				if err != nil {
338					return err
339				}
340				ac.Name = &name
341			}
342		case "type":
343			if v != nil {
344				var typeVar string
345				err = json.Unmarshal(*v, &typeVar)
346				if err != nil {
347					return err
348				}
349				ac.Type = &typeVar
350			}
351		}
352	}
353
354	return nil
355}
356
357// APIContractProperties api Entity Properties
358type APIContractProperties struct {
359	// SourceAPIID - API identifier of the source API.
360	SourceAPIID *string `json:"sourceApiId,omitempty"`
361	// DisplayName - API name. Must be 1 to 300 characters long.
362	DisplayName *string `json:"displayName,omitempty"`
363	// ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
364	ServiceURL *string `json:"serviceUrl,omitempty"`
365	// 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.
366	Path *string `json:"path,omitempty"`
367	// Protocols - Describes on which protocols the operations in this API can be invoked.
368	Protocols *[]Protocol `json:"protocols,omitempty"`
369	// APIVersionSet - Version set details
370	APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"`
371	// Description - Description of the API. May include HTML formatting tags.
372	Description *string `json:"description,omitempty"`
373	// AuthenticationSettings - Collection of authentication settings included into this API.
374	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
375	// SubscriptionKeyParameterNames - Protocols over which API is made available.
376	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
377	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
378	APIType APIType `json:"type,omitempty"`
379	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
380	APIRevision *string `json:"apiRevision,omitempty"`
381	// APIVersion - Indicates the Version identifier of the API if the API is versioned
382	APIVersion *string `json:"apiVersion,omitempty"`
383	// IsCurrent - Indicates if API revision is current api revision.
384	IsCurrent *bool `json:"isCurrent,omitempty"`
385	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
386	IsOnline *bool `json:"isOnline,omitempty"`
387	// APIRevisionDescription - Description of the Api Revision.
388	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
389	// APIVersionDescription - Description of the Api Version.
390	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
391	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
392	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
393	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
394	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
395}
396
397// MarshalJSON is the custom marshaler for APIContractProperties.
398func (acp APIContractProperties) MarshalJSON() ([]byte, error) {
399	objectMap := make(map[string]interface{})
400	if acp.SourceAPIID != nil {
401		objectMap["sourceApiId"] = acp.SourceAPIID
402	}
403	if acp.DisplayName != nil {
404		objectMap["displayName"] = acp.DisplayName
405	}
406	if acp.ServiceURL != nil {
407		objectMap["serviceUrl"] = acp.ServiceURL
408	}
409	if acp.Path != nil {
410		objectMap["path"] = acp.Path
411	}
412	if acp.Protocols != nil {
413		objectMap["protocols"] = acp.Protocols
414	}
415	if acp.APIVersionSet != nil {
416		objectMap["apiVersionSet"] = acp.APIVersionSet
417	}
418	if acp.Description != nil {
419		objectMap["description"] = acp.Description
420	}
421	if acp.AuthenticationSettings != nil {
422		objectMap["authenticationSettings"] = acp.AuthenticationSettings
423	}
424	if acp.SubscriptionKeyParameterNames != nil {
425		objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames
426	}
427	if acp.APIType != "" {
428		objectMap["type"] = acp.APIType
429	}
430	if acp.APIRevision != nil {
431		objectMap["apiRevision"] = acp.APIRevision
432	}
433	if acp.APIVersion != nil {
434		objectMap["apiVersion"] = acp.APIVersion
435	}
436	if acp.IsCurrent != nil {
437		objectMap["isCurrent"] = acp.IsCurrent
438	}
439	if acp.APIRevisionDescription != nil {
440		objectMap["apiRevisionDescription"] = acp.APIRevisionDescription
441	}
442	if acp.APIVersionDescription != nil {
443		objectMap["apiVersionDescription"] = acp.APIVersionDescription
444	}
445	if acp.APIVersionSetID != nil {
446		objectMap["apiVersionSetId"] = acp.APIVersionSetID
447	}
448	if acp.SubscriptionRequired != nil {
449		objectMap["subscriptionRequired"] = acp.SubscriptionRequired
450	}
451	return json.Marshal(objectMap)
452}
453
454// APIContractUpdateProperties API update contract properties.
455type APIContractUpdateProperties struct {
456	// DisplayName - API name.
457	DisplayName *string `json:"displayName,omitempty"`
458	// ServiceURL - Absolute URL of the backend service implementing this API.
459	ServiceURL *string `json:"serviceUrl,omitempty"`
460	// 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.
461	Path *string `json:"path,omitempty"`
462	// Protocols - Describes on which protocols the operations in this API can be invoked.
463	Protocols *[]Protocol `json:"protocols,omitempty"`
464	// Description - Description of the API. May include HTML formatting tags.
465	Description *string `json:"description,omitempty"`
466	// AuthenticationSettings - Collection of authentication settings included into this API.
467	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
468	// SubscriptionKeyParameterNames - Protocols over which API is made available.
469	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
470	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
471	APIType APIType `json:"type,omitempty"`
472	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
473	APIRevision *string `json:"apiRevision,omitempty"`
474	// APIVersion - Indicates the Version identifier of the API if the API is versioned
475	APIVersion *string `json:"apiVersion,omitempty"`
476	// IsCurrent - Indicates if API revision is current api revision.
477	IsCurrent *bool `json:"isCurrent,omitempty"`
478	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
479	IsOnline *bool `json:"isOnline,omitempty"`
480	// APIRevisionDescription - Description of the Api Revision.
481	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
482	// APIVersionDescription - Description of the Api Version.
483	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
484	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
485	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
486	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
487	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
488}
489
490// MarshalJSON is the custom marshaler for APIContractUpdateProperties.
491func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) {
492	objectMap := make(map[string]interface{})
493	if acup.DisplayName != nil {
494		objectMap["displayName"] = acup.DisplayName
495	}
496	if acup.ServiceURL != nil {
497		objectMap["serviceUrl"] = acup.ServiceURL
498	}
499	if acup.Path != nil {
500		objectMap["path"] = acup.Path
501	}
502	if acup.Protocols != nil {
503		objectMap["protocols"] = acup.Protocols
504	}
505	if acup.Description != nil {
506		objectMap["description"] = acup.Description
507	}
508	if acup.AuthenticationSettings != nil {
509		objectMap["authenticationSettings"] = acup.AuthenticationSettings
510	}
511	if acup.SubscriptionKeyParameterNames != nil {
512		objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames
513	}
514	if acup.APIType != "" {
515		objectMap["type"] = acup.APIType
516	}
517	if acup.APIRevision != nil {
518		objectMap["apiRevision"] = acup.APIRevision
519	}
520	if acup.APIVersion != nil {
521		objectMap["apiVersion"] = acup.APIVersion
522	}
523	if acup.IsCurrent != nil {
524		objectMap["isCurrent"] = acup.IsCurrent
525	}
526	if acup.APIRevisionDescription != nil {
527		objectMap["apiRevisionDescription"] = acup.APIRevisionDescription
528	}
529	if acup.APIVersionDescription != nil {
530		objectMap["apiVersionDescription"] = acup.APIVersionDescription
531	}
532	if acup.APIVersionSetID != nil {
533		objectMap["apiVersionSetId"] = acup.APIVersionSetID
534	}
535	if acup.SubscriptionRequired != nil {
536		objectMap["subscriptionRequired"] = acup.SubscriptionRequired
537	}
538	return json.Marshal(objectMap)
539}
540
541// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
542// operation.
543type APICreateOrUpdateFuture struct {
544	azure.FutureAPI
545	// Result returns the result of the asynchronous operation.
546	// If the operation has not completed it will return an error.
547	Result func(APIClient) (APIContract, error)
548}
549
550// UnmarshalJSON is the custom unmarshaller for CreateFuture.
551func (future *APICreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
552	var azFuture azure.Future
553	if err := json.Unmarshal(body, &azFuture); err != nil {
554		return err
555	}
556	future.FutureAPI = &azFuture
557	future.Result = future.result
558	return nil
559}
560
561// result is the default implementation for APICreateOrUpdateFuture.Result.
562func (future *APICreateOrUpdateFuture) result(client APIClient) (ac APIContract, err error) {
563	var done bool
564	done, err = future.DoneWithContext(context.Background(), client)
565	if err != nil {
566		err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
567		return
568	}
569	if !done {
570		ac.Response.Response = future.Response()
571		err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture")
572		return
573	}
574	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
575	if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent {
576		ac, err = client.CreateOrUpdateResponder(ac.Response.Response)
577		if err != nil {
578			err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request")
579		}
580	}
581	return
582}
583
584// APICreateOrUpdateParameter API Create or Update Parameters.
585type APICreateOrUpdateParameter struct {
586	// APICreateOrUpdateProperties - Api entity create of update properties.
587	*APICreateOrUpdateProperties `json:"properties,omitempty"`
588}
589
590// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter.
591func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) {
592	objectMap := make(map[string]interface{})
593	if acoup.APICreateOrUpdateProperties != nil {
594		objectMap["properties"] = acoup.APICreateOrUpdateProperties
595	}
596	return json.Marshal(objectMap)
597}
598
599// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct.
600func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error {
601	var m map[string]*json.RawMessage
602	err := json.Unmarshal(body, &m)
603	if err != nil {
604		return err
605	}
606	for k, v := range m {
607		switch k {
608		case "properties":
609			if v != nil {
610				var APICreateOrUpdateProperties APICreateOrUpdateProperties
611				err = json.Unmarshal(*v, &APICreateOrUpdateProperties)
612				if err != nil {
613					return err
614				}
615				acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties
616			}
617		}
618	}
619
620	return nil
621}
622
623// APICreateOrUpdateProperties api Create or Update Properties.
624type APICreateOrUpdateProperties struct {
625	// Value - Content value when Importing an API.
626	Value *string `json:"value,omitempty"`
627	// Format - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink', 'OpenapijsonLink'
628	Format ContentFormat `json:"format,omitempty"`
629	// WsdlSelector - Criteria to limit import of WSDL to a subset of the document.
630	WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"`
631	// SoapAPIType - Type of Api to create.
632	//  * `http` creates a SOAP to REST API
633	//  * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough'
634	SoapAPIType SoapAPIType `json:"apiType,omitempty"`
635	// SourceAPIID - API identifier of the source API.
636	SourceAPIID *string `json:"sourceApiId,omitempty"`
637	// DisplayName - API name. Must be 1 to 300 characters long.
638	DisplayName *string `json:"displayName,omitempty"`
639	// ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
640	ServiceURL *string `json:"serviceUrl,omitempty"`
641	// 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.
642	Path *string `json:"path,omitempty"`
643	// Protocols - Describes on which protocols the operations in this API can be invoked.
644	Protocols *[]Protocol `json:"protocols,omitempty"`
645	// APIVersionSet - Version set details
646	APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"`
647	// Description - Description of the API. May include HTML formatting tags.
648	Description *string `json:"description,omitempty"`
649	// AuthenticationSettings - Collection of authentication settings included into this API.
650	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
651	// SubscriptionKeyParameterNames - Protocols over which API is made available.
652	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
653	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
654	APIType APIType `json:"type,omitempty"`
655	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
656	APIRevision *string `json:"apiRevision,omitempty"`
657	// APIVersion - Indicates the Version identifier of the API if the API is versioned
658	APIVersion *string `json:"apiVersion,omitempty"`
659	// IsCurrent - Indicates if API revision is current api revision.
660	IsCurrent *bool `json:"isCurrent,omitempty"`
661	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
662	IsOnline *bool `json:"isOnline,omitempty"`
663	// APIRevisionDescription - Description of the Api Revision.
664	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
665	// APIVersionDescription - Description of the Api Version.
666	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
667	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
668	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
669	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
670	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
671}
672
673// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties.
674func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) {
675	objectMap := make(map[string]interface{})
676	if acoup.Value != nil {
677		objectMap["value"] = acoup.Value
678	}
679	if acoup.Format != "" {
680		objectMap["format"] = acoup.Format
681	}
682	if acoup.WsdlSelector != nil {
683		objectMap["wsdlSelector"] = acoup.WsdlSelector
684	}
685	if acoup.SoapAPIType != "" {
686		objectMap["apiType"] = acoup.SoapAPIType
687	}
688	if acoup.SourceAPIID != nil {
689		objectMap["sourceApiId"] = acoup.SourceAPIID
690	}
691	if acoup.DisplayName != nil {
692		objectMap["displayName"] = acoup.DisplayName
693	}
694	if acoup.ServiceURL != nil {
695		objectMap["serviceUrl"] = acoup.ServiceURL
696	}
697	if acoup.Path != nil {
698		objectMap["path"] = acoup.Path
699	}
700	if acoup.Protocols != nil {
701		objectMap["protocols"] = acoup.Protocols
702	}
703	if acoup.APIVersionSet != nil {
704		objectMap["apiVersionSet"] = acoup.APIVersionSet
705	}
706	if acoup.Description != nil {
707		objectMap["description"] = acoup.Description
708	}
709	if acoup.AuthenticationSettings != nil {
710		objectMap["authenticationSettings"] = acoup.AuthenticationSettings
711	}
712	if acoup.SubscriptionKeyParameterNames != nil {
713		objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames
714	}
715	if acoup.APIType != "" {
716		objectMap["type"] = acoup.APIType
717	}
718	if acoup.APIRevision != nil {
719		objectMap["apiRevision"] = acoup.APIRevision
720	}
721	if acoup.APIVersion != nil {
722		objectMap["apiVersion"] = acoup.APIVersion
723	}
724	if acoup.IsCurrent != nil {
725		objectMap["isCurrent"] = acoup.IsCurrent
726	}
727	if acoup.APIRevisionDescription != nil {
728		objectMap["apiRevisionDescription"] = acoup.APIRevisionDescription
729	}
730	if acoup.APIVersionDescription != nil {
731		objectMap["apiVersionDescription"] = acoup.APIVersionDescription
732	}
733	if acoup.APIVersionSetID != nil {
734		objectMap["apiVersionSetId"] = acoup.APIVersionSetID
735	}
736	if acoup.SubscriptionRequired != nil {
737		objectMap["subscriptionRequired"] = acoup.SubscriptionRequired
738	}
739	return json.Marshal(objectMap)
740}
741
742// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document.
743type APICreateOrUpdatePropertiesWsdlSelector struct {
744	// WsdlServiceName - Name of service to import from WSDL
745	WsdlServiceName *string `json:"wsdlServiceName,omitempty"`
746	// WsdlEndpointName - Name of endpoint(port) to import from WSDL
747	WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"`
748}
749
750// APIEntityBaseContract API base contract details.
751type APIEntityBaseContract struct {
752	// Description - Description of the API. May include HTML formatting tags.
753	Description *string `json:"description,omitempty"`
754	// AuthenticationSettings - Collection of authentication settings included into this API.
755	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
756	// SubscriptionKeyParameterNames - Protocols over which API is made available.
757	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
758	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
759	APIType APIType `json:"type,omitempty"`
760	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
761	APIRevision *string `json:"apiRevision,omitempty"`
762	// APIVersion - Indicates the Version identifier of the API if the API is versioned
763	APIVersion *string `json:"apiVersion,omitempty"`
764	// IsCurrent - Indicates if API revision is current api revision.
765	IsCurrent *bool `json:"isCurrent,omitempty"`
766	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
767	IsOnline *bool `json:"isOnline,omitempty"`
768	// APIRevisionDescription - Description of the Api Revision.
769	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
770	// APIVersionDescription - Description of the Api Version.
771	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
772	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
773	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
774	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
775	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
776}
777
778// MarshalJSON is the custom marshaler for APIEntityBaseContract.
779func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) {
780	objectMap := make(map[string]interface{})
781	if aebc.Description != nil {
782		objectMap["description"] = aebc.Description
783	}
784	if aebc.AuthenticationSettings != nil {
785		objectMap["authenticationSettings"] = aebc.AuthenticationSettings
786	}
787	if aebc.SubscriptionKeyParameterNames != nil {
788		objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames
789	}
790	if aebc.APIType != "" {
791		objectMap["type"] = aebc.APIType
792	}
793	if aebc.APIRevision != nil {
794		objectMap["apiRevision"] = aebc.APIRevision
795	}
796	if aebc.APIVersion != nil {
797		objectMap["apiVersion"] = aebc.APIVersion
798	}
799	if aebc.IsCurrent != nil {
800		objectMap["isCurrent"] = aebc.IsCurrent
801	}
802	if aebc.APIRevisionDescription != nil {
803		objectMap["apiRevisionDescription"] = aebc.APIRevisionDescription
804	}
805	if aebc.APIVersionDescription != nil {
806		objectMap["apiVersionDescription"] = aebc.APIVersionDescription
807	}
808	if aebc.APIVersionSetID != nil {
809		objectMap["apiVersionSetId"] = aebc.APIVersionSetID
810	}
811	if aebc.SubscriptionRequired != nil {
812		objectMap["subscriptionRequired"] = aebc.SubscriptionRequired
813	}
814	return json.Marshal(objectMap)
815}
816
817// APIExportResult API Export result.
818type APIExportResult struct {
819	autorest.Response `json:"-"`
820	// ID - ResourceId of the API which was exported.
821	ID *string `json:"id,omitempty"`
822	// ExportResultFormat - Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: 'ExportResultFormatSwagger', 'ExportResultFormatWsdl', 'ExportResultFormatWadl', 'ExportResultFormatOpenAPI'
823	ExportResultFormat ExportResultFormat `json:"format,omitempty"`
824	// Value - The object defining the schema of the exported Api Detail
825	Value *APIExportResultValue `json:"value,omitempty"`
826}
827
828// APIExportResultValue the object defining the schema of the exported Api Detail
829type APIExportResultValue struct {
830	// Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes.
831	Link *string `json:"link,omitempty"`
832}
833
834// ApimResource the Resource definition.
835type ApimResource struct {
836	// ID - READ-ONLY; Resource ID.
837	ID *string `json:"id,omitempty"`
838	// Name - READ-ONLY; Resource name.
839	Name *string `json:"name,omitempty"`
840	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
841	Type *string `json:"type,omitempty"`
842	// Tags - Resource tags.
843	Tags map[string]*string `json:"tags"`
844}
845
846// MarshalJSON is the custom marshaler for ApimResource.
847func (ar ApimResource) MarshalJSON() ([]byte, error) {
848	objectMap := make(map[string]interface{})
849	if ar.Tags != nil {
850		objectMap["tags"] = ar.Tags
851	}
852	return json.Marshal(objectMap)
853}
854
855// APIReleaseCollection paged ApiRelease list representation.
856type APIReleaseCollection struct {
857	autorest.Response `json:"-"`
858	// Value - READ-ONLY; Page values.
859	Value *[]APIReleaseContract `json:"value,omitempty"`
860	// NextLink - READ-ONLY; Next page link if any.
861	NextLink *string `json:"nextLink,omitempty"`
862}
863
864// MarshalJSON is the custom marshaler for APIReleaseCollection.
865func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) {
866	objectMap := make(map[string]interface{})
867	return json.Marshal(objectMap)
868}
869
870// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values.
871type APIReleaseCollectionIterator struct {
872	i    int
873	page APIReleaseCollectionPage
874}
875
876// NextWithContext advances to the next value.  If there was an error making
877// the request the iterator does not advance and the error is returned.
878func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) {
879	if tracing.IsEnabled() {
880		ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext")
881		defer func() {
882			sc := -1
883			if iter.Response().Response.Response != nil {
884				sc = iter.Response().Response.Response.StatusCode
885			}
886			tracing.EndSpan(ctx, sc, err)
887		}()
888	}
889	iter.i++
890	if iter.i < len(iter.page.Values()) {
891		return nil
892	}
893	err = iter.page.NextWithContext(ctx)
894	if err != nil {
895		iter.i--
896		return err
897	}
898	iter.i = 0
899	return nil
900}
901
902// Next advances to the next value.  If there was an error making
903// the request the iterator does not advance and the error is returned.
904// Deprecated: Use NextWithContext() instead.
905func (iter *APIReleaseCollectionIterator) Next() error {
906	return iter.NextWithContext(context.Background())
907}
908
909// NotDone returns true if the enumeration should be started or is not yet complete.
910func (iter APIReleaseCollectionIterator) NotDone() bool {
911	return iter.page.NotDone() && iter.i < len(iter.page.Values())
912}
913
914// Response returns the raw server response from the last page request.
915func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection {
916	return iter.page.Response()
917}
918
919// Value returns the current value or a zero-initialized value if the
920// iterator has advanced beyond the end of the collection.
921func (iter APIReleaseCollectionIterator) Value() APIReleaseContract {
922	if !iter.page.NotDone() {
923		return APIReleaseContract{}
924	}
925	return iter.page.Values()[iter.i]
926}
927
928// Creates a new instance of the APIReleaseCollectionIterator type.
929func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator {
930	return APIReleaseCollectionIterator{page: page}
931}
932
933// IsEmpty returns true if the ListResult contains no values.
934func (arc APIReleaseCollection) IsEmpty() bool {
935	return arc.Value == nil || len(*arc.Value) == 0
936}
937
938// hasNextLink returns true if the NextLink is not empty.
939func (arc APIReleaseCollection) hasNextLink() bool {
940	return arc.NextLink != nil && len(*arc.NextLink) != 0
941}
942
943// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results.
944// It returns nil if no more results exist.
945func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) {
946	if !arc.hasNextLink() {
947		return nil, nil
948	}
949	return autorest.Prepare((&http.Request{}).WithContext(ctx),
950		autorest.AsJSON(),
951		autorest.AsGet(),
952		autorest.WithBaseURL(to.String(arc.NextLink)))
953}
954
955// APIReleaseCollectionPage contains a page of APIReleaseContract values.
956type APIReleaseCollectionPage struct {
957	fn  func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)
958	arc APIReleaseCollection
959}
960
961// NextWithContext advances to the next page of values.  If there was an error making
962// the request the page does not advance and the error is returned.
963func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) {
964	if tracing.IsEnabled() {
965		ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext")
966		defer func() {
967			sc := -1
968			if page.Response().Response.Response != nil {
969				sc = page.Response().Response.Response.StatusCode
970			}
971			tracing.EndSpan(ctx, sc, err)
972		}()
973	}
974	for {
975		next, err := page.fn(ctx, page.arc)
976		if err != nil {
977			return err
978		}
979		page.arc = next
980		if !next.hasNextLink() || !next.IsEmpty() {
981			break
982		}
983	}
984	return nil
985}
986
987// Next advances to the next page of values.  If there was an error making
988// the request the page does not advance and the error is returned.
989// Deprecated: Use NextWithContext() instead.
990func (page *APIReleaseCollectionPage) Next() error {
991	return page.NextWithContext(context.Background())
992}
993
994// NotDone returns true if the page enumeration should be started or is not yet complete.
995func (page APIReleaseCollectionPage) NotDone() bool {
996	return !page.arc.IsEmpty()
997}
998
999// Response returns the raw server response from the last page request.
1000func (page APIReleaseCollectionPage) Response() APIReleaseCollection {
1001	return page.arc
1002}
1003
1004// Values returns the slice of values for the current page or nil if there are no values.
1005func (page APIReleaseCollectionPage) Values() []APIReleaseContract {
1006	if page.arc.IsEmpty() {
1007		return nil
1008	}
1009	return *page.arc.Value
1010}
1011
1012// Creates a new instance of the APIReleaseCollectionPage type.
1013func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage {
1014	return APIReleaseCollectionPage{
1015		fn:  getNextPage,
1016		arc: cur,
1017	}
1018}
1019
1020// APIReleaseContract apiRelease details.
1021type APIReleaseContract struct {
1022	autorest.Response `json:"-"`
1023	// APIReleaseContractProperties - ApiRelease entity contract properties.
1024	*APIReleaseContractProperties `json:"properties,omitempty"`
1025	// ID - READ-ONLY; Resource ID.
1026	ID *string `json:"id,omitempty"`
1027	// Name - READ-ONLY; Resource name.
1028	Name *string `json:"name,omitempty"`
1029	// Type - READ-ONLY; Resource type for API Management resource.
1030	Type *string `json:"type,omitempty"`
1031}
1032
1033// MarshalJSON is the custom marshaler for APIReleaseContract.
1034func (arc APIReleaseContract) MarshalJSON() ([]byte, error) {
1035	objectMap := make(map[string]interface{})
1036	if arc.APIReleaseContractProperties != nil {
1037		objectMap["properties"] = arc.APIReleaseContractProperties
1038	}
1039	return json.Marshal(objectMap)
1040}
1041
1042// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct.
1043func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error {
1044	var m map[string]*json.RawMessage
1045	err := json.Unmarshal(body, &m)
1046	if err != nil {
1047		return err
1048	}
1049	for k, v := range m {
1050		switch k {
1051		case "properties":
1052			if v != nil {
1053				var APIReleaseContractProperties APIReleaseContractProperties
1054				err = json.Unmarshal(*v, &APIReleaseContractProperties)
1055				if err != nil {
1056					return err
1057				}
1058				arc.APIReleaseContractProperties = &APIReleaseContractProperties
1059			}
1060		case "id":
1061			if v != nil {
1062				var ID string
1063				err = json.Unmarshal(*v, &ID)
1064				if err != nil {
1065					return err
1066				}
1067				arc.ID = &ID
1068			}
1069		case "name":
1070			if v != nil {
1071				var name string
1072				err = json.Unmarshal(*v, &name)
1073				if err != nil {
1074					return err
1075				}
1076				arc.Name = &name
1077			}
1078		case "type":
1079			if v != nil {
1080				var typeVar string
1081				err = json.Unmarshal(*v, &typeVar)
1082				if err != nil {
1083					return err
1084				}
1085				arc.Type = &typeVar
1086			}
1087		}
1088	}
1089
1090	return nil
1091}
1092
1093// APIReleaseContractProperties API Release details
1094type APIReleaseContractProperties struct {
1095	// APIID - Identifier of the API the release belongs to.
1096	APIID *string `json:"apiId,omitempty"`
1097	// 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.
1098	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
1099	// UpdatedDateTime - READ-ONLY; The time the API release was updated.
1100	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
1101	// Notes - Release Notes
1102	Notes *string `json:"notes,omitempty"`
1103}
1104
1105// MarshalJSON is the custom marshaler for APIReleaseContractProperties.
1106func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) {
1107	objectMap := make(map[string]interface{})
1108	if arcp.APIID != nil {
1109		objectMap["apiId"] = arcp.APIID
1110	}
1111	if arcp.Notes != nil {
1112		objectMap["notes"] = arcp.Notes
1113	}
1114	return json.Marshal(objectMap)
1115}
1116
1117// APIRevisionCollection paged Api Revision list representation.
1118type APIRevisionCollection struct {
1119	autorest.Response `json:"-"`
1120	// Value - READ-ONLY; Page values.
1121	Value *[]APIRevisionContract `json:"value,omitempty"`
1122	// NextLink - READ-ONLY; Next page link if any.
1123	NextLink *string `json:"nextLink,omitempty"`
1124}
1125
1126// MarshalJSON is the custom marshaler for APIRevisionCollection.
1127func (arc APIRevisionCollection) MarshalJSON() ([]byte, error) {
1128	objectMap := make(map[string]interface{})
1129	return json.Marshal(objectMap)
1130}
1131
1132// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values.
1133type APIRevisionCollectionIterator struct {
1134	i    int
1135	page APIRevisionCollectionPage
1136}
1137
1138// NextWithContext advances to the next value.  If there was an error making
1139// the request the iterator does not advance and the error is returned.
1140func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1141	if tracing.IsEnabled() {
1142		ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext")
1143		defer func() {
1144			sc := -1
1145			if iter.Response().Response.Response != nil {
1146				sc = iter.Response().Response.Response.StatusCode
1147			}
1148			tracing.EndSpan(ctx, sc, err)
1149		}()
1150	}
1151	iter.i++
1152	if iter.i < len(iter.page.Values()) {
1153		return nil
1154	}
1155	err = iter.page.NextWithContext(ctx)
1156	if err != nil {
1157		iter.i--
1158		return err
1159	}
1160	iter.i = 0
1161	return nil
1162}
1163
1164// Next advances to the next value.  If there was an error making
1165// the request the iterator does not advance and the error is returned.
1166// Deprecated: Use NextWithContext() instead.
1167func (iter *APIRevisionCollectionIterator) Next() error {
1168	return iter.NextWithContext(context.Background())
1169}
1170
1171// NotDone returns true if the enumeration should be started or is not yet complete.
1172func (iter APIRevisionCollectionIterator) NotDone() bool {
1173	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1174}
1175
1176// Response returns the raw server response from the last page request.
1177func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection {
1178	return iter.page.Response()
1179}
1180
1181// Value returns the current value or a zero-initialized value if the
1182// iterator has advanced beyond the end of the collection.
1183func (iter APIRevisionCollectionIterator) Value() APIRevisionContract {
1184	if !iter.page.NotDone() {
1185		return APIRevisionContract{}
1186	}
1187	return iter.page.Values()[iter.i]
1188}
1189
1190// Creates a new instance of the APIRevisionCollectionIterator type.
1191func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator {
1192	return APIRevisionCollectionIterator{page: page}
1193}
1194
1195// IsEmpty returns true if the ListResult contains no values.
1196func (arc APIRevisionCollection) IsEmpty() bool {
1197	return arc.Value == nil || len(*arc.Value) == 0
1198}
1199
1200// hasNextLink returns true if the NextLink is not empty.
1201func (arc APIRevisionCollection) hasNextLink() bool {
1202	return arc.NextLink != nil && len(*arc.NextLink) != 0
1203}
1204
1205// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results.
1206// It returns nil if no more results exist.
1207func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) {
1208	if !arc.hasNextLink() {
1209		return nil, nil
1210	}
1211	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1212		autorest.AsJSON(),
1213		autorest.AsGet(),
1214		autorest.WithBaseURL(to.String(arc.NextLink)))
1215}
1216
1217// APIRevisionCollectionPage contains a page of APIRevisionContract values.
1218type APIRevisionCollectionPage struct {
1219	fn  func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)
1220	arc APIRevisionCollection
1221}
1222
1223// NextWithContext advances to the next page of values.  If there was an error making
1224// the request the page does not advance and the error is returned.
1225func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) {
1226	if tracing.IsEnabled() {
1227		ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext")
1228		defer func() {
1229			sc := -1
1230			if page.Response().Response.Response != nil {
1231				sc = page.Response().Response.Response.StatusCode
1232			}
1233			tracing.EndSpan(ctx, sc, err)
1234		}()
1235	}
1236	for {
1237		next, err := page.fn(ctx, page.arc)
1238		if err != nil {
1239			return err
1240		}
1241		page.arc = next
1242		if !next.hasNextLink() || !next.IsEmpty() {
1243			break
1244		}
1245	}
1246	return nil
1247}
1248
1249// Next advances to the next page of values.  If there was an error making
1250// the request the page does not advance and the error is returned.
1251// Deprecated: Use NextWithContext() instead.
1252func (page *APIRevisionCollectionPage) Next() error {
1253	return page.NextWithContext(context.Background())
1254}
1255
1256// NotDone returns true if the page enumeration should be started or is not yet complete.
1257func (page APIRevisionCollectionPage) NotDone() bool {
1258	return !page.arc.IsEmpty()
1259}
1260
1261// Response returns the raw server response from the last page request.
1262func (page APIRevisionCollectionPage) Response() APIRevisionCollection {
1263	return page.arc
1264}
1265
1266// Values returns the slice of values for the current page or nil if there are no values.
1267func (page APIRevisionCollectionPage) Values() []APIRevisionContract {
1268	if page.arc.IsEmpty() {
1269		return nil
1270	}
1271	return *page.arc.Value
1272}
1273
1274// Creates a new instance of the APIRevisionCollectionPage type.
1275func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage {
1276	return APIRevisionCollectionPage{
1277		fn:  getNextPage,
1278		arc: cur,
1279	}
1280}
1281
1282// APIRevisionContract summary of revision metadata.
1283type APIRevisionContract struct {
1284	// APIID - READ-ONLY; Identifier of the API Revision.
1285	APIID *string `json:"apiId,omitempty"`
1286	// APIRevision - READ-ONLY; Revision number of API.
1287	APIRevision *string `json:"apiRevision,omitempty"`
1288	// 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.
1289	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
1290	// 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.
1291	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
1292	// Description - READ-ONLY; Description of the API Revision.
1293	Description *string `json:"description,omitempty"`
1294	// PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision.
1295	PrivateURL *string `json:"privateUrl,omitempty"`
1296	// IsOnline - READ-ONLY; Indicates if API revision is the current api revision.
1297	IsOnline *bool `json:"isOnline,omitempty"`
1298	// IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway.
1299	IsCurrent *bool `json:"isCurrent,omitempty"`
1300}
1301
1302// MarshalJSON is the custom marshaler for APIRevisionContract.
1303func (arc APIRevisionContract) MarshalJSON() ([]byte, error) {
1304	objectMap := make(map[string]interface{})
1305	return json.Marshal(objectMap)
1306}
1307
1308// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API
1309// Revision
1310type APIRevisionInfoContract struct {
1311	// SourceAPIID - Resource identifier of API to be used to create the revision from.
1312	SourceAPIID *string `json:"sourceApiId,omitempty"`
1313	// APIVersionName - Version identifier for the new API Version.
1314	APIVersionName *string `json:"apiVersionName,omitempty"`
1315	// APIRevisionDescription - Description of new API Revision.
1316	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
1317	// APIVersionSet - Version set details
1318	APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"`
1319}
1320
1321// APISchemaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1322// operation.
1323type APISchemaCreateOrUpdateFuture struct {
1324	azure.FutureAPI
1325	// Result returns the result of the asynchronous operation.
1326	// If the operation has not completed it will return an error.
1327	Result func(APISchemaClient) (SchemaContract, error)
1328}
1329
1330// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1331func (future *APISchemaCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1332	var azFuture azure.Future
1333	if err := json.Unmarshal(body, &azFuture); err != nil {
1334		return err
1335	}
1336	future.FutureAPI = &azFuture
1337	future.Result = future.result
1338	return nil
1339}
1340
1341// result is the default implementation for APISchemaCreateOrUpdateFuture.Result.
1342func (future *APISchemaCreateOrUpdateFuture) result(client APISchemaClient) (sc SchemaContract, err error) {
1343	var done bool
1344	done, err = future.DoneWithContext(context.Background(), client)
1345	if err != nil {
1346		err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1347		return
1348	}
1349	if !done {
1350		sc.Response.Response = future.Response()
1351		err = azure.NewAsyncOpIncompleteError("apimanagement.APISchemaCreateOrUpdateFuture")
1352		return
1353	}
1354	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1355	if sc.Response.Response, err = future.GetResult(sender); err == nil && sc.Response.Response.StatusCode != http.StatusNoContent {
1356		sc, err = client.CreateOrUpdateResponder(sc.Response.Response)
1357		if err != nil {
1358			err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", sc.Response.Response, "Failure responding to request")
1359		}
1360	}
1361	return
1362}
1363
1364// APITagResourceContractProperties API contract properties for the Tag Resources.
1365type APITagResourceContractProperties struct {
1366	// ID - API identifier in the form /apis/{apiId}.
1367	ID *string `json:"id,omitempty"`
1368	// Name - API name.
1369	Name *string `json:"name,omitempty"`
1370	// ServiceURL - Absolute URL of the backend service implementing this API.
1371	ServiceURL *string `json:"serviceUrl,omitempty"`
1372	// 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.
1373	Path *string `json:"path,omitempty"`
1374	// Protocols - Describes on which protocols the operations in this API can be invoked.
1375	Protocols *[]Protocol `json:"protocols,omitempty"`
1376	// Description - Description of the API. May include HTML formatting tags.
1377	Description *string `json:"description,omitempty"`
1378	// AuthenticationSettings - Collection of authentication settings included into this API.
1379	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
1380	// SubscriptionKeyParameterNames - Protocols over which API is made available.
1381	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
1382	// APIType - Type of API. Possible values include: 'HTTP', 'Soap'
1383	APIType APIType `json:"type,omitempty"`
1384	// APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created
1385	APIRevision *string `json:"apiRevision,omitempty"`
1386	// APIVersion - Indicates the Version identifier of the API if the API is versioned
1387	APIVersion *string `json:"apiVersion,omitempty"`
1388	// IsCurrent - Indicates if API revision is current api revision.
1389	IsCurrent *bool `json:"isCurrent,omitempty"`
1390	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
1391	IsOnline *bool `json:"isOnline,omitempty"`
1392	// APIRevisionDescription - Description of the Api Revision.
1393	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
1394	// APIVersionDescription - Description of the Api Version.
1395	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
1396	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
1397	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
1398	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
1399	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
1400}
1401
1402// MarshalJSON is the custom marshaler for APITagResourceContractProperties.
1403func (atrcp APITagResourceContractProperties) MarshalJSON() ([]byte, error) {
1404	objectMap := make(map[string]interface{})
1405	if atrcp.ID != nil {
1406		objectMap["id"] = atrcp.ID
1407	}
1408	if atrcp.Name != nil {
1409		objectMap["name"] = atrcp.Name
1410	}
1411	if atrcp.ServiceURL != nil {
1412		objectMap["serviceUrl"] = atrcp.ServiceURL
1413	}
1414	if atrcp.Path != nil {
1415		objectMap["path"] = atrcp.Path
1416	}
1417	if atrcp.Protocols != nil {
1418		objectMap["protocols"] = atrcp.Protocols
1419	}
1420	if atrcp.Description != nil {
1421		objectMap["description"] = atrcp.Description
1422	}
1423	if atrcp.AuthenticationSettings != nil {
1424		objectMap["authenticationSettings"] = atrcp.AuthenticationSettings
1425	}
1426	if atrcp.SubscriptionKeyParameterNames != nil {
1427		objectMap["subscriptionKeyParameterNames"] = atrcp.SubscriptionKeyParameterNames
1428	}
1429	if atrcp.APIType != "" {
1430		objectMap["type"] = atrcp.APIType
1431	}
1432	if atrcp.APIRevision != nil {
1433		objectMap["apiRevision"] = atrcp.APIRevision
1434	}
1435	if atrcp.APIVersion != nil {
1436		objectMap["apiVersion"] = atrcp.APIVersion
1437	}
1438	if atrcp.IsCurrent != nil {
1439		objectMap["isCurrent"] = atrcp.IsCurrent
1440	}
1441	if atrcp.APIRevisionDescription != nil {
1442		objectMap["apiRevisionDescription"] = atrcp.APIRevisionDescription
1443	}
1444	if atrcp.APIVersionDescription != nil {
1445		objectMap["apiVersionDescription"] = atrcp.APIVersionDescription
1446	}
1447	if atrcp.APIVersionSetID != nil {
1448		objectMap["apiVersionSetId"] = atrcp.APIVersionSetID
1449	}
1450	if atrcp.SubscriptionRequired != nil {
1451		objectMap["subscriptionRequired"] = atrcp.SubscriptionRequired
1452	}
1453	return json.Marshal(objectMap)
1454}
1455
1456// APIUpdateContract API update contract details.
1457type APIUpdateContract struct {
1458	// APIContractUpdateProperties - Properties of the API entity that can be updated.
1459	*APIContractUpdateProperties `json:"properties,omitempty"`
1460}
1461
1462// MarshalJSON is the custom marshaler for APIUpdateContract.
1463func (auc APIUpdateContract) MarshalJSON() ([]byte, error) {
1464	objectMap := make(map[string]interface{})
1465	if auc.APIContractUpdateProperties != nil {
1466		objectMap["properties"] = auc.APIContractUpdateProperties
1467	}
1468	return json.Marshal(objectMap)
1469}
1470
1471// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct.
1472func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error {
1473	var m map[string]*json.RawMessage
1474	err := json.Unmarshal(body, &m)
1475	if err != nil {
1476		return err
1477	}
1478	for k, v := range m {
1479		switch k {
1480		case "properties":
1481			if v != nil {
1482				var APIContractUpdateProperties APIContractUpdateProperties
1483				err = json.Unmarshal(*v, &APIContractUpdateProperties)
1484				if err != nil {
1485					return err
1486				}
1487				auc.APIContractUpdateProperties = &APIContractUpdateProperties
1488			}
1489		}
1490	}
1491
1492	return nil
1493}
1494
1495// APIVersionConstraint control Plane Apis version constraint for the API Management service.
1496type APIVersionConstraint struct {
1497	// MinAPIVersion - Limit control plane API calls to API Management service with version equal to or newer than this value.
1498	MinAPIVersion *string `json:"minApiVersion,omitempty"`
1499}
1500
1501// APIVersionSetCollection paged Api Version Set list representation.
1502type APIVersionSetCollection struct {
1503	autorest.Response `json:"-"`
1504	// Value - Page values.
1505	Value *[]APIVersionSetContract `json:"value,omitempty"`
1506	// NextLink - Next page link if any.
1507	NextLink *string `json:"nextLink,omitempty"`
1508}
1509
1510// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values.
1511type APIVersionSetCollectionIterator struct {
1512	i    int
1513	page APIVersionSetCollectionPage
1514}
1515
1516// NextWithContext advances to the next value.  If there was an error making
1517// the request the iterator does not advance and the error is returned.
1518func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1519	if tracing.IsEnabled() {
1520		ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext")
1521		defer func() {
1522			sc := -1
1523			if iter.Response().Response.Response != nil {
1524				sc = iter.Response().Response.Response.StatusCode
1525			}
1526			tracing.EndSpan(ctx, sc, err)
1527		}()
1528	}
1529	iter.i++
1530	if iter.i < len(iter.page.Values()) {
1531		return nil
1532	}
1533	err = iter.page.NextWithContext(ctx)
1534	if err != nil {
1535		iter.i--
1536		return err
1537	}
1538	iter.i = 0
1539	return nil
1540}
1541
1542// Next advances to the next value.  If there was an error making
1543// the request the iterator does not advance and the error is returned.
1544// Deprecated: Use NextWithContext() instead.
1545func (iter *APIVersionSetCollectionIterator) Next() error {
1546	return iter.NextWithContext(context.Background())
1547}
1548
1549// NotDone returns true if the enumeration should be started or is not yet complete.
1550func (iter APIVersionSetCollectionIterator) NotDone() bool {
1551	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1552}
1553
1554// Response returns the raw server response from the last page request.
1555func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection {
1556	return iter.page.Response()
1557}
1558
1559// Value returns the current value or a zero-initialized value if the
1560// iterator has advanced beyond the end of the collection.
1561func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract {
1562	if !iter.page.NotDone() {
1563		return APIVersionSetContract{}
1564	}
1565	return iter.page.Values()[iter.i]
1566}
1567
1568// Creates a new instance of the APIVersionSetCollectionIterator type.
1569func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator {
1570	return APIVersionSetCollectionIterator{page: page}
1571}
1572
1573// IsEmpty returns true if the ListResult contains no values.
1574func (avsc APIVersionSetCollection) IsEmpty() bool {
1575	return avsc.Value == nil || len(*avsc.Value) == 0
1576}
1577
1578// hasNextLink returns true if the NextLink is not empty.
1579func (avsc APIVersionSetCollection) hasNextLink() bool {
1580	return avsc.NextLink != nil && len(*avsc.NextLink) != 0
1581}
1582
1583// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results.
1584// It returns nil if no more results exist.
1585func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) {
1586	if !avsc.hasNextLink() {
1587		return nil, nil
1588	}
1589	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1590		autorest.AsJSON(),
1591		autorest.AsGet(),
1592		autorest.WithBaseURL(to.String(avsc.NextLink)))
1593}
1594
1595// APIVersionSetCollectionPage contains a page of APIVersionSetContract values.
1596type APIVersionSetCollectionPage struct {
1597	fn   func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)
1598	avsc APIVersionSetCollection
1599}
1600
1601// NextWithContext advances to the next page of values.  If there was an error making
1602// the request the page does not advance and the error is returned.
1603func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) {
1604	if tracing.IsEnabled() {
1605		ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext")
1606		defer func() {
1607			sc := -1
1608			if page.Response().Response.Response != nil {
1609				sc = page.Response().Response.Response.StatusCode
1610			}
1611			tracing.EndSpan(ctx, sc, err)
1612		}()
1613	}
1614	for {
1615		next, err := page.fn(ctx, page.avsc)
1616		if err != nil {
1617			return err
1618		}
1619		page.avsc = next
1620		if !next.hasNextLink() || !next.IsEmpty() {
1621			break
1622		}
1623	}
1624	return nil
1625}
1626
1627// Next advances to the next page of values.  If there was an error making
1628// the request the page does not advance and the error is returned.
1629// Deprecated: Use NextWithContext() instead.
1630func (page *APIVersionSetCollectionPage) Next() error {
1631	return page.NextWithContext(context.Background())
1632}
1633
1634// NotDone returns true if the page enumeration should be started or is not yet complete.
1635func (page APIVersionSetCollectionPage) NotDone() bool {
1636	return !page.avsc.IsEmpty()
1637}
1638
1639// Response returns the raw server response from the last page request.
1640func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection {
1641	return page.avsc
1642}
1643
1644// Values returns the slice of values for the current page or nil if there are no values.
1645func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract {
1646	if page.avsc.IsEmpty() {
1647		return nil
1648	}
1649	return *page.avsc.Value
1650}
1651
1652// Creates a new instance of the APIVersionSetCollectionPage type.
1653func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage {
1654	return APIVersionSetCollectionPage{
1655		fn:   getNextPage,
1656		avsc: cur,
1657	}
1658}
1659
1660// APIVersionSetContract api Version Set Contract details.
1661type APIVersionSetContract struct {
1662	autorest.Response `json:"-"`
1663	// APIVersionSetContractProperties - Api VersionSet contract properties.
1664	*APIVersionSetContractProperties `json:"properties,omitempty"`
1665	// ID - READ-ONLY; Resource ID.
1666	ID *string `json:"id,omitempty"`
1667	// Name - READ-ONLY; Resource name.
1668	Name *string `json:"name,omitempty"`
1669	// Type - READ-ONLY; Resource type for API Management resource.
1670	Type *string `json:"type,omitempty"`
1671}
1672
1673// MarshalJSON is the custom marshaler for APIVersionSetContract.
1674func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) {
1675	objectMap := make(map[string]interface{})
1676	if avsc.APIVersionSetContractProperties != nil {
1677		objectMap["properties"] = avsc.APIVersionSetContractProperties
1678	}
1679	return json.Marshal(objectMap)
1680}
1681
1682// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct.
1683func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error {
1684	var m map[string]*json.RawMessage
1685	err := json.Unmarshal(body, &m)
1686	if err != nil {
1687		return err
1688	}
1689	for k, v := range m {
1690		switch k {
1691		case "properties":
1692			if v != nil {
1693				var APIVersionSetContractProperties APIVersionSetContractProperties
1694				err = json.Unmarshal(*v, &APIVersionSetContractProperties)
1695				if err != nil {
1696					return err
1697				}
1698				avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties
1699			}
1700		case "id":
1701			if v != nil {
1702				var ID string
1703				err = json.Unmarshal(*v, &ID)
1704				if err != nil {
1705					return err
1706				}
1707				avsc.ID = &ID
1708			}
1709		case "name":
1710			if v != nil {
1711				var name string
1712				err = json.Unmarshal(*v, &name)
1713				if err != nil {
1714					return err
1715				}
1716				avsc.Name = &name
1717			}
1718		case "type":
1719			if v != nil {
1720				var typeVar string
1721				err = json.Unmarshal(*v, &typeVar)
1722				if err != nil {
1723					return err
1724				}
1725				avsc.Type = &typeVar
1726			}
1727		}
1728	}
1729
1730	return nil
1731}
1732
1733// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API
1734// Versions relating
1735type APIVersionSetContractDetails struct {
1736	// ID - Identifier for existing API Version Set. Omit this value to create a new Version Set.
1737	ID *string `json:"id,omitempty"`
1738	// Name - The display Name of the API Version Set.
1739	Name *string `json:"name,omitempty"`
1740	// Description - Description of API Version Set.
1741	Description *string `json:"description,omitempty"`
1742	// VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header'
1743	VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"`
1744	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
1745	VersionQueryName *string `json:"versionQueryName,omitempty"`
1746	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
1747	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
1748}
1749
1750// APIVersionSetContractProperties properties of an API Version Set.
1751type APIVersionSetContractProperties struct {
1752	// DisplayName - Name of API Version Set
1753	DisplayName *string `json:"displayName,omitempty"`
1754	// VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader'
1755	VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"`
1756	// Description - Description of API Version Set.
1757	Description *string `json:"description,omitempty"`
1758	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
1759	VersionQueryName *string `json:"versionQueryName,omitempty"`
1760	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
1761	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
1762}
1763
1764// APIVersionSetEntityBase api Version set base parameters
1765type APIVersionSetEntityBase struct {
1766	// Description - Description of API Version Set.
1767	Description *string `json:"description,omitempty"`
1768	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
1769	VersionQueryName *string `json:"versionQueryName,omitempty"`
1770	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
1771	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
1772}
1773
1774// APIVersionSetUpdateParameters parameters to update or create an Api Version Set Contract.
1775type APIVersionSetUpdateParameters struct {
1776	// APIVersionSetUpdateParametersProperties - Parameters to update or create an Api Version Set Contract.
1777	*APIVersionSetUpdateParametersProperties `json:"properties,omitempty"`
1778}
1779
1780// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters.
1781func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) {
1782	objectMap := make(map[string]interface{})
1783	if avsup.APIVersionSetUpdateParametersProperties != nil {
1784		objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties
1785	}
1786	return json.Marshal(objectMap)
1787}
1788
1789// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct.
1790func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error {
1791	var m map[string]*json.RawMessage
1792	err := json.Unmarshal(body, &m)
1793	if err != nil {
1794		return err
1795	}
1796	for k, v := range m {
1797		switch k {
1798		case "properties":
1799			if v != nil {
1800				var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties
1801				err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties)
1802				if err != nil {
1803					return err
1804				}
1805				avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties
1806			}
1807		}
1808	}
1809
1810	return nil
1811}
1812
1813// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set.
1814type APIVersionSetUpdateParametersProperties struct {
1815	// DisplayName - Name of API Version Set
1816	DisplayName *string `json:"displayName,omitempty"`
1817	// VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader'
1818	VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"`
1819	// Description - Description of API Version Set.
1820	Description *string `json:"description,omitempty"`
1821	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
1822	VersionQueryName *string `json:"versionQueryName,omitempty"`
1823	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
1824	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
1825}
1826
1827// AssociationContract association entity details.
1828type AssociationContract struct {
1829	// AssociationContractProperties - Association entity contract properties.
1830	*AssociationContractProperties `json:"properties,omitempty"`
1831	// ID - READ-ONLY; Resource ID.
1832	ID *string `json:"id,omitempty"`
1833	// Name - READ-ONLY; Resource name.
1834	Name *string `json:"name,omitempty"`
1835	// Type - READ-ONLY; Resource type for API Management resource.
1836	Type *string `json:"type,omitempty"`
1837}
1838
1839// MarshalJSON is the custom marshaler for AssociationContract.
1840func (ac AssociationContract) MarshalJSON() ([]byte, error) {
1841	objectMap := make(map[string]interface{})
1842	if ac.AssociationContractProperties != nil {
1843		objectMap["properties"] = ac.AssociationContractProperties
1844	}
1845	return json.Marshal(objectMap)
1846}
1847
1848// UnmarshalJSON is the custom unmarshaler for AssociationContract struct.
1849func (ac *AssociationContract) UnmarshalJSON(body []byte) error {
1850	var m map[string]*json.RawMessage
1851	err := json.Unmarshal(body, &m)
1852	if err != nil {
1853		return err
1854	}
1855	for k, v := range m {
1856		switch k {
1857		case "properties":
1858			if v != nil {
1859				var associationContractProperties AssociationContractProperties
1860				err = json.Unmarshal(*v, &associationContractProperties)
1861				if err != nil {
1862					return err
1863				}
1864				ac.AssociationContractProperties = &associationContractProperties
1865			}
1866		case "id":
1867			if v != nil {
1868				var ID string
1869				err = json.Unmarshal(*v, &ID)
1870				if err != nil {
1871					return err
1872				}
1873				ac.ID = &ID
1874			}
1875		case "name":
1876			if v != nil {
1877				var name string
1878				err = json.Unmarshal(*v, &name)
1879				if err != nil {
1880					return err
1881				}
1882				ac.Name = &name
1883			}
1884		case "type":
1885			if v != nil {
1886				var typeVar string
1887				err = json.Unmarshal(*v, &typeVar)
1888				if err != nil {
1889					return err
1890				}
1891				ac.Type = &typeVar
1892			}
1893		}
1894	}
1895
1896	return nil
1897}
1898
1899// AssociationContractProperties association entity contract properties.
1900type AssociationContractProperties struct {
1901	// ProvisioningState - Provisioning state. Possible values include: 'Created'
1902	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1903}
1904
1905// AuthenticationSettingsContract API Authentication Settings.
1906type AuthenticationSettingsContract struct {
1907	// OAuth2 - OAuth2 Authentication settings
1908	OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"`
1909	// Openid - OpenID Connect Authentication Settings
1910	Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"`
1911}
1912
1913// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation.
1914type AuthorizationServerCollection struct {
1915	autorest.Response `json:"-"`
1916	// Value - Page values.
1917	Value *[]AuthorizationServerContract `json:"value,omitempty"`
1918	// Count - Total record count number across all pages.
1919	Count *int64 `json:"count,omitempty"`
1920	// NextLink - Next page link if any.
1921	NextLink *string `json:"nextLink,omitempty"`
1922}
1923
1924// AuthorizationServerCollectionIterator provides access to a complete listing of
1925// AuthorizationServerContract values.
1926type AuthorizationServerCollectionIterator struct {
1927	i    int
1928	page AuthorizationServerCollectionPage
1929}
1930
1931// NextWithContext advances to the next value.  If there was an error making
1932// the request the iterator does not advance and the error is returned.
1933func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1934	if tracing.IsEnabled() {
1935		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext")
1936		defer func() {
1937			sc := -1
1938			if iter.Response().Response.Response != nil {
1939				sc = iter.Response().Response.Response.StatusCode
1940			}
1941			tracing.EndSpan(ctx, sc, err)
1942		}()
1943	}
1944	iter.i++
1945	if iter.i < len(iter.page.Values()) {
1946		return nil
1947	}
1948	err = iter.page.NextWithContext(ctx)
1949	if err != nil {
1950		iter.i--
1951		return err
1952	}
1953	iter.i = 0
1954	return nil
1955}
1956
1957// Next advances to the next value.  If there was an error making
1958// the request the iterator does not advance and the error is returned.
1959// Deprecated: Use NextWithContext() instead.
1960func (iter *AuthorizationServerCollectionIterator) Next() error {
1961	return iter.NextWithContext(context.Background())
1962}
1963
1964// NotDone returns true if the enumeration should be started or is not yet complete.
1965func (iter AuthorizationServerCollectionIterator) NotDone() bool {
1966	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1967}
1968
1969// Response returns the raw server response from the last page request.
1970func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection {
1971	return iter.page.Response()
1972}
1973
1974// Value returns the current value or a zero-initialized value if the
1975// iterator has advanced beyond the end of the collection.
1976func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract {
1977	if !iter.page.NotDone() {
1978		return AuthorizationServerContract{}
1979	}
1980	return iter.page.Values()[iter.i]
1981}
1982
1983// Creates a new instance of the AuthorizationServerCollectionIterator type.
1984func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator {
1985	return AuthorizationServerCollectionIterator{page: page}
1986}
1987
1988// IsEmpty returns true if the ListResult contains no values.
1989func (asc AuthorizationServerCollection) IsEmpty() bool {
1990	return asc.Value == nil || len(*asc.Value) == 0
1991}
1992
1993// hasNextLink returns true if the NextLink is not empty.
1994func (asc AuthorizationServerCollection) hasNextLink() bool {
1995	return asc.NextLink != nil && len(*asc.NextLink) != 0
1996}
1997
1998// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results.
1999// It returns nil if no more results exist.
2000func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) {
2001	if !asc.hasNextLink() {
2002		return nil, nil
2003	}
2004	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2005		autorest.AsJSON(),
2006		autorest.AsGet(),
2007		autorest.WithBaseURL(to.String(asc.NextLink)))
2008}
2009
2010// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values.
2011type AuthorizationServerCollectionPage struct {
2012	fn  func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)
2013	asc AuthorizationServerCollection
2014}
2015
2016// NextWithContext advances to the next page of values.  If there was an error making
2017// the request the page does not advance and the error is returned.
2018func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) {
2019	if tracing.IsEnabled() {
2020		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext")
2021		defer func() {
2022			sc := -1
2023			if page.Response().Response.Response != nil {
2024				sc = page.Response().Response.Response.StatusCode
2025			}
2026			tracing.EndSpan(ctx, sc, err)
2027		}()
2028	}
2029	for {
2030		next, err := page.fn(ctx, page.asc)
2031		if err != nil {
2032			return err
2033		}
2034		page.asc = next
2035		if !next.hasNextLink() || !next.IsEmpty() {
2036			break
2037		}
2038	}
2039	return nil
2040}
2041
2042// Next advances to the next page of values.  If there was an error making
2043// the request the page does not advance and the error is returned.
2044// Deprecated: Use NextWithContext() instead.
2045func (page *AuthorizationServerCollectionPage) Next() error {
2046	return page.NextWithContext(context.Background())
2047}
2048
2049// NotDone returns true if the page enumeration should be started or is not yet complete.
2050func (page AuthorizationServerCollectionPage) NotDone() bool {
2051	return !page.asc.IsEmpty()
2052}
2053
2054// Response returns the raw server response from the last page request.
2055func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection {
2056	return page.asc
2057}
2058
2059// Values returns the slice of values for the current page or nil if there are no values.
2060func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract {
2061	if page.asc.IsEmpty() {
2062		return nil
2063	}
2064	return *page.asc.Value
2065}
2066
2067// Creates a new instance of the AuthorizationServerCollectionPage type.
2068func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage {
2069	return AuthorizationServerCollectionPage{
2070		fn:  getNextPage,
2071		asc: cur,
2072	}
2073}
2074
2075// AuthorizationServerContract external OAuth authorization server settings.
2076type AuthorizationServerContract struct {
2077	autorest.Response `json:"-"`
2078	// AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract.
2079	*AuthorizationServerContractProperties `json:"properties,omitempty"`
2080	// ID - READ-ONLY; Resource ID.
2081	ID *string `json:"id,omitempty"`
2082	// Name - READ-ONLY; Resource name.
2083	Name *string `json:"name,omitempty"`
2084	// Type - READ-ONLY; Resource type for API Management resource.
2085	Type *string `json:"type,omitempty"`
2086}
2087
2088// MarshalJSON is the custom marshaler for AuthorizationServerContract.
2089func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) {
2090	objectMap := make(map[string]interface{})
2091	if asc.AuthorizationServerContractProperties != nil {
2092		objectMap["properties"] = asc.AuthorizationServerContractProperties
2093	}
2094	return json.Marshal(objectMap)
2095}
2096
2097// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct.
2098func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error {
2099	var m map[string]*json.RawMessage
2100	err := json.Unmarshal(body, &m)
2101	if err != nil {
2102		return err
2103	}
2104	for k, v := range m {
2105		switch k {
2106		case "properties":
2107			if v != nil {
2108				var authorizationServerContractProperties AuthorizationServerContractProperties
2109				err = json.Unmarshal(*v, &authorizationServerContractProperties)
2110				if err != nil {
2111					return err
2112				}
2113				asc.AuthorizationServerContractProperties = &authorizationServerContractProperties
2114			}
2115		case "id":
2116			if v != nil {
2117				var ID string
2118				err = json.Unmarshal(*v, &ID)
2119				if err != nil {
2120					return err
2121				}
2122				asc.ID = &ID
2123			}
2124		case "name":
2125			if v != nil {
2126				var name string
2127				err = json.Unmarshal(*v, &name)
2128				if err != nil {
2129					return err
2130				}
2131				asc.Name = &name
2132			}
2133		case "type":
2134			if v != nil {
2135				var typeVar string
2136				err = json.Unmarshal(*v, &typeVar)
2137				if err != nil {
2138					return err
2139				}
2140				asc.Type = &typeVar
2141			}
2142		}
2143	}
2144
2145	return nil
2146}
2147
2148// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract.
2149type AuthorizationServerContractBaseProperties struct {
2150	// Description - Description of the authorization server. Can contain HTML formatting tags.
2151	Description *string `json:"description,omitempty"`
2152	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
2153	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
2154	// 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.
2155	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
2156	// 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"}.
2157	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
2158	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
2159	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
2160	// 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.
2161	SupportState *bool `json:"supportState,omitempty"`
2162	// 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.
2163	DefaultScope *string `json:"defaultScope,omitempty"`
2164	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
2165	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
2166	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
2167	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
2168	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
2169	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
2170}
2171
2172// AuthorizationServerContractProperties external OAuth authorization server settings Properties.
2173type AuthorizationServerContractProperties struct {
2174	// DisplayName - User-friendly authorization server name.
2175	DisplayName *string `json:"displayName,omitempty"`
2176	// ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.
2177	ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"`
2178	// AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
2179	AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"`
2180	// GrantTypes - Form of an authorization grant, which the client uses to request the access token.
2181	GrantTypes *[]GrantType `json:"grantTypes,omitempty"`
2182	// ClientID - Client or app id registered with this authorization server.
2183	ClientID *string `json:"clientId,omitempty"`
2184	// ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
2185	ClientSecret *string `json:"clientSecret,omitempty"`
2186	// Description - Description of the authorization server. Can contain HTML formatting tags.
2187	Description *string `json:"description,omitempty"`
2188	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
2189	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
2190	// 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.
2191	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
2192	// 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"}.
2193	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
2194	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
2195	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
2196	// 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.
2197	SupportState *bool `json:"supportState,omitempty"`
2198	// 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.
2199	DefaultScope *string `json:"defaultScope,omitempty"`
2200	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
2201	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
2202	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
2203	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
2204	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
2205	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
2206}
2207
2208// AuthorizationServerUpdateContract external OAuth authorization server settings.
2209type AuthorizationServerUpdateContract struct {
2210	// AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract.
2211	*AuthorizationServerUpdateContractProperties `json:"properties,omitempty"`
2212	// ID - READ-ONLY; Resource ID.
2213	ID *string `json:"id,omitempty"`
2214	// Name - READ-ONLY; Resource name.
2215	Name *string `json:"name,omitempty"`
2216	// Type - READ-ONLY; Resource type for API Management resource.
2217	Type *string `json:"type,omitempty"`
2218}
2219
2220// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract.
2221func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) {
2222	objectMap := make(map[string]interface{})
2223	if asuc.AuthorizationServerUpdateContractProperties != nil {
2224		objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties
2225	}
2226	return json.Marshal(objectMap)
2227}
2228
2229// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct.
2230func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error {
2231	var m map[string]*json.RawMessage
2232	err := json.Unmarshal(body, &m)
2233	if err != nil {
2234		return err
2235	}
2236	for k, v := range m {
2237		switch k {
2238		case "properties":
2239			if v != nil {
2240				var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties
2241				err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties)
2242				if err != nil {
2243					return err
2244				}
2245				asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties
2246			}
2247		case "id":
2248			if v != nil {
2249				var ID string
2250				err = json.Unmarshal(*v, &ID)
2251				if err != nil {
2252					return err
2253				}
2254				asuc.ID = &ID
2255			}
2256		case "name":
2257			if v != nil {
2258				var name string
2259				err = json.Unmarshal(*v, &name)
2260				if err != nil {
2261					return err
2262				}
2263				asuc.Name = &name
2264			}
2265		case "type":
2266			if v != nil {
2267				var typeVar string
2268				err = json.Unmarshal(*v, &typeVar)
2269				if err != nil {
2270					return err
2271				}
2272				asuc.Type = &typeVar
2273			}
2274		}
2275	}
2276
2277	return nil
2278}
2279
2280// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings
2281// contract.
2282type AuthorizationServerUpdateContractProperties struct {
2283	// DisplayName - User-friendly authorization server name.
2284	DisplayName *string `json:"displayName,omitempty"`
2285	// ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.
2286	ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"`
2287	// AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
2288	AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"`
2289	// GrantTypes - Form of an authorization grant, which the client uses to request the access token.
2290	GrantTypes *[]GrantType `json:"grantTypes,omitempty"`
2291	// ClientID - Client or app id registered with this authorization server.
2292	ClientID *string `json:"clientId,omitempty"`
2293	// ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
2294	ClientSecret *string `json:"clientSecret,omitempty"`
2295	// Description - Description of the authorization server. Can contain HTML formatting tags.
2296	Description *string `json:"description,omitempty"`
2297	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
2298	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
2299	// 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.
2300	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
2301	// 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"}.
2302	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
2303	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
2304	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
2305	// 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.
2306	SupportState *bool `json:"supportState,omitempty"`
2307	// 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.
2308	DefaultScope *string `json:"defaultScope,omitempty"`
2309	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
2310	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
2311	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
2312	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
2313	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
2314	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
2315}
2316
2317// BackendAuthorizationHeaderCredentials authorization header information.
2318type BackendAuthorizationHeaderCredentials struct {
2319	// Scheme - Authentication Scheme name.
2320	Scheme *string `json:"scheme,omitempty"`
2321	// Parameter - Authentication Parameter value.
2322	Parameter *string `json:"parameter,omitempty"`
2323}
2324
2325// BackendBaseParameters backend entity base Parameter set.
2326type BackendBaseParameters struct {
2327	// Title - Backend Title.
2328	Title *string `json:"title,omitempty"`
2329	// Description - Backend Description.
2330	Description *string `json:"description,omitempty"`
2331	// 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.
2332	ResourceID *string `json:"resourceId,omitempty"`
2333	// Properties - Backend Properties contract
2334	Properties *BackendProperties `json:"properties,omitempty"`
2335	// Credentials - Backend Credentials Contract Properties
2336	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
2337	// Proxy - Backend Proxy Contract Properties
2338	Proxy *BackendProxyContract `json:"proxy,omitempty"`
2339	// TLS - Backend TLS Properties
2340	TLS *BackendTLSProperties `json:"tls,omitempty"`
2341}
2342
2343// BackendCollection paged Backend list representation.
2344type BackendCollection struct {
2345	autorest.Response `json:"-"`
2346	// Value - Backend values.
2347	Value *[]BackendContract `json:"value,omitempty"`
2348	// NextLink - Next page link if any.
2349	NextLink *string `json:"nextLink,omitempty"`
2350}
2351
2352// BackendCollectionIterator provides access to a complete listing of BackendContract values.
2353type BackendCollectionIterator struct {
2354	i    int
2355	page BackendCollectionPage
2356}
2357
2358// NextWithContext advances to the next value.  If there was an error making
2359// the request the iterator does not advance and the error is returned.
2360func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2361	if tracing.IsEnabled() {
2362		ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext")
2363		defer func() {
2364			sc := -1
2365			if iter.Response().Response.Response != nil {
2366				sc = iter.Response().Response.Response.StatusCode
2367			}
2368			tracing.EndSpan(ctx, sc, err)
2369		}()
2370	}
2371	iter.i++
2372	if iter.i < len(iter.page.Values()) {
2373		return nil
2374	}
2375	err = iter.page.NextWithContext(ctx)
2376	if err != nil {
2377		iter.i--
2378		return err
2379	}
2380	iter.i = 0
2381	return nil
2382}
2383
2384// Next advances to the next value.  If there was an error making
2385// the request the iterator does not advance and the error is returned.
2386// Deprecated: Use NextWithContext() instead.
2387func (iter *BackendCollectionIterator) Next() error {
2388	return iter.NextWithContext(context.Background())
2389}
2390
2391// NotDone returns true if the enumeration should be started or is not yet complete.
2392func (iter BackendCollectionIterator) NotDone() bool {
2393	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2394}
2395
2396// Response returns the raw server response from the last page request.
2397func (iter BackendCollectionIterator) Response() BackendCollection {
2398	return iter.page.Response()
2399}
2400
2401// Value returns the current value or a zero-initialized value if the
2402// iterator has advanced beyond the end of the collection.
2403func (iter BackendCollectionIterator) Value() BackendContract {
2404	if !iter.page.NotDone() {
2405		return BackendContract{}
2406	}
2407	return iter.page.Values()[iter.i]
2408}
2409
2410// Creates a new instance of the BackendCollectionIterator type.
2411func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator {
2412	return BackendCollectionIterator{page: page}
2413}
2414
2415// IsEmpty returns true if the ListResult contains no values.
2416func (bc BackendCollection) IsEmpty() bool {
2417	return bc.Value == nil || len(*bc.Value) == 0
2418}
2419
2420// hasNextLink returns true if the NextLink is not empty.
2421func (bc BackendCollection) hasNextLink() bool {
2422	return bc.NextLink != nil && len(*bc.NextLink) != 0
2423}
2424
2425// backendCollectionPreparer prepares a request to retrieve the next set of results.
2426// It returns nil if no more results exist.
2427func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) {
2428	if !bc.hasNextLink() {
2429		return nil, nil
2430	}
2431	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2432		autorest.AsJSON(),
2433		autorest.AsGet(),
2434		autorest.WithBaseURL(to.String(bc.NextLink)))
2435}
2436
2437// BackendCollectionPage contains a page of BackendContract values.
2438type BackendCollectionPage struct {
2439	fn func(context.Context, BackendCollection) (BackendCollection, error)
2440	bc BackendCollection
2441}
2442
2443// NextWithContext advances to the next page of values.  If there was an error making
2444// the request the page does not advance and the error is returned.
2445func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) {
2446	if tracing.IsEnabled() {
2447		ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext")
2448		defer func() {
2449			sc := -1
2450			if page.Response().Response.Response != nil {
2451				sc = page.Response().Response.Response.StatusCode
2452			}
2453			tracing.EndSpan(ctx, sc, err)
2454		}()
2455	}
2456	for {
2457		next, err := page.fn(ctx, page.bc)
2458		if err != nil {
2459			return err
2460		}
2461		page.bc = next
2462		if !next.hasNextLink() || !next.IsEmpty() {
2463			break
2464		}
2465	}
2466	return nil
2467}
2468
2469// Next advances to the next page of values.  If there was an error making
2470// the request the page does not advance and the error is returned.
2471// Deprecated: Use NextWithContext() instead.
2472func (page *BackendCollectionPage) Next() error {
2473	return page.NextWithContext(context.Background())
2474}
2475
2476// NotDone returns true if the page enumeration should be started or is not yet complete.
2477func (page BackendCollectionPage) NotDone() bool {
2478	return !page.bc.IsEmpty()
2479}
2480
2481// Response returns the raw server response from the last page request.
2482func (page BackendCollectionPage) Response() BackendCollection {
2483	return page.bc
2484}
2485
2486// Values returns the slice of values for the current page or nil if there are no values.
2487func (page BackendCollectionPage) Values() []BackendContract {
2488	if page.bc.IsEmpty() {
2489		return nil
2490	}
2491	return *page.bc.Value
2492}
2493
2494// Creates a new instance of the BackendCollectionPage type.
2495func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage {
2496	return BackendCollectionPage{
2497		fn: getNextPage,
2498		bc: cur,
2499	}
2500}
2501
2502// BackendContract backend details.
2503type BackendContract struct {
2504	autorest.Response `json:"-"`
2505	// BackendContractProperties - Backend entity contract properties.
2506	*BackendContractProperties `json:"properties,omitempty"`
2507	// ID - READ-ONLY; Resource ID.
2508	ID *string `json:"id,omitempty"`
2509	// Name - READ-ONLY; Resource name.
2510	Name *string `json:"name,omitempty"`
2511	// Type - READ-ONLY; Resource type for API Management resource.
2512	Type *string `json:"type,omitempty"`
2513}
2514
2515// MarshalJSON is the custom marshaler for BackendContract.
2516func (bc BackendContract) MarshalJSON() ([]byte, error) {
2517	objectMap := make(map[string]interface{})
2518	if bc.BackendContractProperties != nil {
2519		objectMap["properties"] = bc.BackendContractProperties
2520	}
2521	return json.Marshal(objectMap)
2522}
2523
2524// UnmarshalJSON is the custom unmarshaler for BackendContract struct.
2525func (bc *BackendContract) UnmarshalJSON(body []byte) error {
2526	var m map[string]*json.RawMessage
2527	err := json.Unmarshal(body, &m)
2528	if err != nil {
2529		return err
2530	}
2531	for k, v := range m {
2532		switch k {
2533		case "properties":
2534			if v != nil {
2535				var backendContractProperties BackendContractProperties
2536				err = json.Unmarshal(*v, &backendContractProperties)
2537				if err != nil {
2538					return err
2539				}
2540				bc.BackendContractProperties = &backendContractProperties
2541			}
2542		case "id":
2543			if v != nil {
2544				var ID string
2545				err = json.Unmarshal(*v, &ID)
2546				if err != nil {
2547					return err
2548				}
2549				bc.ID = &ID
2550			}
2551		case "name":
2552			if v != nil {
2553				var name string
2554				err = json.Unmarshal(*v, &name)
2555				if err != nil {
2556					return err
2557				}
2558				bc.Name = &name
2559			}
2560		case "type":
2561			if v != nil {
2562				var typeVar string
2563				err = json.Unmarshal(*v, &typeVar)
2564				if err != nil {
2565					return err
2566				}
2567				bc.Type = &typeVar
2568			}
2569		}
2570	}
2571
2572	return nil
2573}
2574
2575// BackendContractProperties parameters supplied to the Create Backend operation.
2576type BackendContractProperties struct {
2577	// URL - Runtime Url of the Backend.
2578	URL *string `json:"url,omitempty"`
2579	// Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap'
2580	Protocol BackendProtocol `json:"protocol,omitempty"`
2581	// Title - Backend Title.
2582	Title *string `json:"title,omitempty"`
2583	// Description - Backend Description.
2584	Description *string `json:"description,omitempty"`
2585	// 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.
2586	ResourceID *string `json:"resourceId,omitempty"`
2587	// Properties - Backend Properties contract
2588	Properties *BackendProperties `json:"properties,omitempty"`
2589	// Credentials - Backend Credentials Contract Properties
2590	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
2591	// Proxy - Backend Proxy Contract Properties
2592	Proxy *BackendProxyContract `json:"proxy,omitempty"`
2593	// TLS - Backend TLS Properties
2594	TLS *BackendTLSProperties `json:"tls,omitempty"`
2595}
2596
2597// BackendCredentialsContract details of the Credentials used to connect to Backend.
2598type BackendCredentialsContract struct {
2599	// Certificate - List of Client Certificate Thumbprint.
2600	Certificate *[]string `json:"certificate,omitempty"`
2601	// Query - Query Parameter description.
2602	Query map[string][]string `json:"query"`
2603	// Header - Header Parameter description.
2604	Header map[string][]string `json:"header"`
2605	// Authorization - Authorization header authentication
2606	Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"`
2607}
2608
2609// MarshalJSON is the custom marshaler for BackendCredentialsContract.
2610func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) {
2611	objectMap := make(map[string]interface{})
2612	if bcc.Certificate != nil {
2613		objectMap["certificate"] = bcc.Certificate
2614	}
2615	if bcc.Query != nil {
2616		objectMap["query"] = bcc.Query
2617	}
2618	if bcc.Header != nil {
2619		objectMap["header"] = bcc.Header
2620	}
2621	if bcc.Authorization != nil {
2622		objectMap["authorization"] = bcc.Authorization
2623	}
2624	return json.Marshal(objectMap)
2625}
2626
2627// BackendProperties properties specific to the Backend Type.
2628type BackendProperties struct {
2629	// ServiceFabricCluster - Backend Service Fabric Cluster Properties
2630	ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"`
2631}
2632
2633// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend.
2634type BackendProxyContract struct {
2635	// URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.
2636	URL *string `json:"url,omitempty"`
2637	// Username - Username to connect to the WebProxy server
2638	Username *string `json:"username,omitempty"`
2639	// Password - Password to connect to the WebProxy Server
2640	Password *string `json:"password,omitempty"`
2641}
2642
2643// BackendReconnectContract reconnect request parameters.
2644type BackendReconnectContract struct {
2645	// BackendReconnectProperties - Reconnect request properties.
2646	*BackendReconnectProperties `json:"properties,omitempty"`
2647	// ID - READ-ONLY; Resource ID.
2648	ID *string `json:"id,omitempty"`
2649	// Name - READ-ONLY; Resource name.
2650	Name *string `json:"name,omitempty"`
2651	// Type - READ-ONLY; Resource type for API Management resource.
2652	Type *string `json:"type,omitempty"`
2653}
2654
2655// MarshalJSON is the custom marshaler for BackendReconnectContract.
2656func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) {
2657	objectMap := make(map[string]interface{})
2658	if brc.BackendReconnectProperties != nil {
2659		objectMap["properties"] = brc.BackendReconnectProperties
2660	}
2661	return json.Marshal(objectMap)
2662}
2663
2664// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct.
2665func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error {
2666	var m map[string]*json.RawMessage
2667	err := json.Unmarshal(body, &m)
2668	if err != nil {
2669		return err
2670	}
2671	for k, v := range m {
2672		switch k {
2673		case "properties":
2674			if v != nil {
2675				var backendReconnectProperties BackendReconnectProperties
2676				err = json.Unmarshal(*v, &backendReconnectProperties)
2677				if err != nil {
2678					return err
2679				}
2680				brc.BackendReconnectProperties = &backendReconnectProperties
2681			}
2682		case "id":
2683			if v != nil {
2684				var ID string
2685				err = json.Unmarshal(*v, &ID)
2686				if err != nil {
2687					return err
2688				}
2689				brc.ID = &ID
2690			}
2691		case "name":
2692			if v != nil {
2693				var name string
2694				err = json.Unmarshal(*v, &name)
2695				if err != nil {
2696					return err
2697				}
2698				brc.Name = &name
2699			}
2700		case "type":
2701			if v != nil {
2702				var typeVar string
2703				err = json.Unmarshal(*v, &typeVar)
2704				if err != nil {
2705					return err
2706				}
2707				brc.Type = &typeVar
2708			}
2709		}
2710	}
2711
2712	return nil
2713}
2714
2715// BackendReconnectProperties properties to control reconnect requests.
2716type BackendReconnectProperties struct {
2717	// After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M.
2718	After *string `json:"after,omitempty"`
2719}
2720
2721// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend.
2722type BackendServiceFabricClusterProperties struct {
2723	// ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint.
2724	ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"`
2725	// MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition.
2726	MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"`
2727	// ManagementEndpoints - The cluster management endpoint.
2728	ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"`
2729	// ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication
2730	ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"`
2731	// ServerX509Names - Server X509 Certificate Names Collection
2732	ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"`
2733}
2734
2735// BackendTLSProperties properties controlling TLS Certificate Validation.
2736type BackendTLSProperties struct {
2737	// ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.
2738	ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"`
2739	// ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.
2740	ValidateCertificateName *bool `json:"validateCertificateName,omitempty"`
2741}
2742
2743// BackendUpdateParameterProperties parameters supplied to the Update Backend operation.
2744type BackendUpdateParameterProperties struct {
2745	// URL - Runtime Url of the Backend.
2746	URL *string `json:"url,omitempty"`
2747	// Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap'
2748	Protocol BackendProtocol `json:"protocol,omitempty"`
2749	// Title - Backend Title.
2750	Title *string `json:"title,omitempty"`
2751	// Description - Backend Description.
2752	Description *string `json:"description,omitempty"`
2753	// 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.
2754	ResourceID *string `json:"resourceId,omitempty"`
2755	// Properties - Backend Properties contract
2756	Properties *BackendProperties `json:"properties,omitempty"`
2757	// Credentials - Backend Credentials Contract Properties
2758	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
2759	// Proxy - Backend Proxy Contract Properties
2760	Proxy *BackendProxyContract `json:"proxy,omitempty"`
2761	// TLS - Backend TLS Properties
2762	TLS *BackendTLSProperties `json:"tls,omitempty"`
2763}
2764
2765// BackendUpdateParameters backend update parameters.
2766type BackendUpdateParameters struct {
2767	// BackendUpdateParameterProperties - Backend entity update contract properties.
2768	*BackendUpdateParameterProperties `json:"properties,omitempty"`
2769}
2770
2771// MarshalJSON is the custom marshaler for BackendUpdateParameters.
2772func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) {
2773	objectMap := make(map[string]interface{})
2774	if bup.BackendUpdateParameterProperties != nil {
2775		objectMap["properties"] = bup.BackendUpdateParameterProperties
2776	}
2777	return json.Marshal(objectMap)
2778}
2779
2780// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct.
2781func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error {
2782	var m map[string]*json.RawMessage
2783	err := json.Unmarshal(body, &m)
2784	if err != nil {
2785		return err
2786	}
2787	for k, v := range m {
2788		switch k {
2789		case "properties":
2790			if v != nil {
2791				var backendUpdateParameterProperties BackendUpdateParameterProperties
2792				err = json.Unmarshal(*v, &backendUpdateParameterProperties)
2793				if err != nil {
2794					return err
2795				}
2796				bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties
2797			}
2798		}
2799	}
2800
2801	return nil
2802}
2803
2804// BodyDiagnosticSettings body logging settings.
2805type BodyDiagnosticSettings struct {
2806	// Bytes - Number of request body bytes to log.
2807	Bytes *int32 `json:"bytes,omitempty"`
2808}
2809
2810// CacheCollection paged Caches list representation.
2811type CacheCollection struct {
2812	autorest.Response `json:"-"`
2813	// Value - Page values.
2814	Value *[]CacheContract `json:"value,omitempty"`
2815	// NextLink - Next page link if any.
2816	NextLink *string `json:"nextLink,omitempty"`
2817}
2818
2819// CacheCollectionIterator provides access to a complete listing of CacheContract values.
2820type CacheCollectionIterator struct {
2821	i    int
2822	page CacheCollectionPage
2823}
2824
2825// NextWithContext advances to the next value.  If there was an error making
2826// the request the iterator does not advance and the error is returned.
2827func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2828	if tracing.IsEnabled() {
2829		ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext")
2830		defer func() {
2831			sc := -1
2832			if iter.Response().Response.Response != nil {
2833				sc = iter.Response().Response.Response.StatusCode
2834			}
2835			tracing.EndSpan(ctx, sc, err)
2836		}()
2837	}
2838	iter.i++
2839	if iter.i < len(iter.page.Values()) {
2840		return nil
2841	}
2842	err = iter.page.NextWithContext(ctx)
2843	if err != nil {
2844		iter.i--
2845		return err
2846	}
2847	iter.i = 0
2848	return nil
2849}
2850
2851// Next advances to the next value.  If there was an error making
2852// the request the iterator does not advance and the error is returned.
2853// Deprecated: Use NextWithContext() instead.
2854func (iter *CacheCollectionIterator) Next() error {
2855	return iter.NextWithContext(context.Background())
2856}
2857
2858// NotDone returns true if the enumeration should be started or is not yet complete.
2859func (iter CacheCollectionIterator) NotDone() bool {
2860	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2861}
2862
2863// Response returns the raw server response from the last page request.
2864func (iter CacheCollectionIterator) Response() CacheCollection {
2865	return iter.page.Response()
2866}
2867
2868// Value returns the current value or a zero-initialized value if the
2869// iterator has advanced beyond the end of the collection.
2870func (iter CacheCollectionIterator) Value() CacheContract {
2871	if !iter.page.NotDone() {
2872		return CacheContract{}
2873	}
2874	return iter.page.Values()[iter.i]
2875}
2876
2877// Creates a new instance of the CacheCollectionIterator type.
2878func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator {
2879	return CacheCollectionIterator{page: page}
2880}
2881
2882// IsEmpty returns true if the ListResult contains no values.
2883func (cc CacheCollection) IsEmpty() bool {
2884	return cc.Value == nil || len(*cc.Value) == 0
2885}
2886
2887// hasNextLink returns true if the NextLink is not empty.
2888func (cc CacheCollection) hasNextLink() bool {
2889	return cc.NextLink != nil && len(*cc.NextLink) != 0
2890}
2891
2892// cacheCollectionPreparer prepares a request to retrieve the next set of results.
2893// It returns nil if no more results exist.
2894func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) {
2895	if !cc.hasNextLink() {
2896		return nil, nil
2897	}
2898	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2899		autorest.AsJSON(),
2900		autorest.AsGet(),
2901		autorest.WithBaseURL(to.String(cc.NextLink)))
2902}
2903
2904// CacheCollectionPage contains a page of CacheContract values.
2905type CacheCollectionPage struct {
2906	fn func(context.Context, CacheCollection) (CacheCollection, error)
2907	cc CacheCollection
2908}
2909
2910// NextWithContext advances to the next page of values.  If there was an error making
2911// the request the page does not advance and the error is returned.
2912func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) {
2913	if tracing.IsEnabled() {
2914		ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext")
2915		defer func() {
2916			sc := -1
2917			if page.Response().Response.Response != nil {
2918				sc = page.Response().Response.Response.StatusCode
2919			}
2920			tracing.EndSpan(ctx, sc, err)
2921		}()
2922	}
2923	for {
2924		next, err := page.fn(ctx, page.cc)
2925		if err != nil {
2926			return err
2927		}
2928		page.cc = next
2929		if !next.hasNextLink() || !next.IsEmpty() {
2930			break
2931		}
2932	}
2933	return nil
2934}
2935
2936// Next advances to the next page of values.  If there was an error making
2937// the request the page does not advance and the error is returned.
2938// Deprecated: Use NextWithContext() instead.
2939func (page *CacheCollectionPage) Next() error {
2940	return page.NextWithContext(context.Background())
2941}
2942
2943// NotDone returns true if the page enumeration should be started or is not yet complete.
2944func (page CacheCollectionPage) NotDone() bool {
2945	return !page.cc.IsEmpty()
2946}
2947
2948// Response returns the raw server response from the last page request.
2949func (page CacheCollectionPage) Response() CacheCollection {
2950	return page.cc
2951}
2952
2953// Values returns the slice of values for the current page or nil if there are no values.
2954func (page CacheCollectionPage) Values() []CacheContract {
2955	if page.cc.IsEmpty() {
2956		return nil
2957	}
2958	return *page.cc.Value
2959}
2960
2961// Creates a new instance of the CacheCollectionPage type.
2962func NewCacheCollectionPage(cur CacheCollection, getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage {
2963	return CacheCollectionPage{
2964		fn: getNextPage,
2965		cc: cur,
2966	}
2967}
2968
2969// CacheContract cache details.
2970type CacheContract struct {
2971	autorest.Response `json:"-"`
2972	// CacheContractProperties - Cache properties details.
2973	*CacheContractProperties `json:"properties,omitempty"`
2974	// ID - READ-ONLY; Resource ID.
2975	ID *string `json:"id,omitempty"`
2976	// Name - READ-ONLY; Resource name.
2977	Name *string `json:"name,omitempty"`
2978	// Type - READ-ONLY; Resource type for API Management resource.
2979	Type *string `json:"type,omitempty"`
2980}
2981
2982// MarshalJSON is the custom marshaler for CacheContract.
2983func (cc CacheContract) MarshalJSON() ([]byte, error) {
2984	objectMap := make(map[string]interface{})
2985	if cc.CacheContractProperties != nil {
2986		objectMap["properties"] = cc.CacheContractProperties
2987	}
2988	return json.Marshal(objectMap)
2989}
2990
2991// UnmarshalJSON is the custom unmarshaler for CacheContract struct.
2992func (cc *CacheContract) UnmarshalJSON(body []byte) error {
2993	var m map[string]*json.RawMessage
2994	err := json.Unmarshal(body, &m)
2995	if err != nil {
2996		return err
2997	}
2998	for k, v := range m {
2999		switch k {
3000		case "properties":
3001			if v != nil {
3002				var cacheContractProperties CacheContractProperties
3003				err = json.Unmarshal(*v, &cacheContractProperties)
3004				if err != nil {
3005					return err
3006				}
3007				cc.CacheContractProperties = &cacheContractProperties
3008			}
3009		case "id":
3010			if v != nil {
3011				var ID string
3012				err = json.Unmarshal(*v, &ID)
3013				if err != nil {
3014					return err
3015				}
3016				cc.ID = &ID
3017			}
3018		case "name":
3019			if v != nil {
3020				var name string
3021				err = json.Unmarshal(*v, &name)
3022				if err != nil {
3023					return err
3024				}
3025				cc.Name = &name
3026			}
3027		case "type":
3028			if v != nil {
3029				var typeVar string
3030				err = json.Unmarshal(*v, &typeVar)
3031				if err != nil {
3032					return err
3033				}
3034				cc.Type = &typeVar
3035			}
3036		}
3037	}
3038
3039	return nil
3040}
3041
3042// CacheContractProperties properties of the Cache contract.
3043type CacheContractProperties struct {
3044	// Description - Cache description
3045	Description *string `json:"description,omitempty"`
3046	// ConnectionString - Runtime connection string to cache
3047	ConnectionString *string `json:"connectionString,omitempty"`
3048	// ResourceID - Original uri of entity in external system cache points to
3049	ResourceID *string `json:"resourceId,omitempty"`
3050}
3051
3052// CacheUpdateParameters cache update details.
3053type CacheUpdateParameters struct {
3054	// CacheUpdateProperties - Cache update properties details.
3055	*CacheUpdateProperties `json:"properties,omitempty"`
3056}
3057
3058// MarshalJSON is the custom marshaler for CacheUpdateParameters.
3059func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) {
3060	objectMap := make(map[string]interface{})
3061	if cup.CacheUpdateProperties != nil {
3062		objectMap["properties"] = cup.CacheUpdateProperties
3063	}
3064	return json.Marshal(objectMap)
3065}
3066
3067// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct.
3068func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error {
3069	var m map[string]*json.RawMessage
3070	err := json.Unmarshal(body, &m)
3071	if err != nil {
3072		return err
3073	}
3074	for k, v := range m {
3075		switch k {
3076		case "properties":
3077			if v != nil {
3078				var cacheUpdateProperties CacheUpdateProperties
3079				err = json.Unmarshal(*v, &cacheUpdateProperties)
3080				if err != nil {
3081					return err
3082				}
3083				cup.CacheUpdateProperties = &cacheUpdateProperties
3084			}
3085		}
3086	}
3087
3088	return nil
3089}
3090
3091// CacheUpdateProperties parameters supplied to the Update Cache operation.
3092type CacheUpdateProperties struct {
3093	// Description - Cache description
3094	Description *string `json:"description,omitempty"`
3095	// ConnectionString - Runtime connection string to cache
3096	ConnectionString *string `json:"connectionString,omitempty"`
3097	// ResourceID - Original uri of entity in external system cache points to
3098	ResourceID *string `json:"resourceId,omitempty"`
3099}
3100
3101// CertificateCollection paged Certificates list representation.
3102type CertificateCollection struct {
3103	autorest.Response `json:"-"`
3104	// Value - Page values.
3105	Value *[]CertificateContract `json:"value,omitempty"`
3106	// NextLink - Next page link if any.
3107	NextLink *string `json:"nextLink,omitempty"`
3108}
3109
3110// CertificateCollectionIterator provides access to a complete listing of CertificateContract values.
3111type CertificateCollectionIterator struct {
3112	i    int
3113	page CertificateCollectionPage
3114}
3115
3116// NextWithContext advances to the next value.  If there was an error making
3117// the request the iterator does not advance and the error is returned.
3118func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3119	if tracing.IsEnabled() {
3120		ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext")
3121		defer func() {
3122			sc := -1
3123			if iter.Response().Response.Response != nil {
3124				sc = iter.Response().Response.Response.StatusCode
3125			}
3126			tracing.EndSpan(ctx, sc, err)
3127		}()
3128	}
3129	iter.i++
3130	if iter.i < len(iter.page.Values()) {
3131		return nil
3132	}
3133	err = iter.page.NextWithContext(ctx)
3134	if err != nil {
3135		iter.i--
3136		return err
3137	}
3138	iter.i = 0
3139	return nil
3140}
3141
3142// Next advances to the next value.  If there was an error making
3143// the request the iterator does not advance and the error is returned.
3144// Deprecated: Use NextWithContext() instead.
3145func (iter *CertificateCollectionIterator) Next() error {
3146	return iter.NextWithContext(context.Background())
3147}
3148
3149// NotDone returns true if the enumeration should be started or is not yet complete.
3150func (iter CertificateCollectionIterator) NotDone() bool {
3151	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3152}
3153
3154// Response returns the raw server response from the last page request.
3155func (iter CertificateCollectionIterator) Response() CertificateCollection {
3156	return iter.page.Response()
3157}
3158
3159// Value returns the current value or a zero-initialized value if the
3160// iterator has advanced beyond the end of the collection.
3161func (iter CertificateCollectionIterator) Value() CertificateContract {
3162	if !iter.page.NotDone() {
3163		return CertificateContract{}
3164	}
3165	return iter.page.Values()[iter.i]
3166}
3167
3168// Creates a new instance of the CertificateCollectionIterator type.
3169func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator {
3170	return CertificateCollectionIterator{page: page}
3171}
3172
3173// IsEmpty returns true if the ListResult contains no values.
3174func (cc CertificateCollection) IsEmpty() bool {
3175	return cc.Value == nil || len(*cc.Value) == 0
3176}
3177
3178// hasNextLink returns true if the NextLink is not empty.
3179func (cc CertificateCollection) hasNextLink() bool {
3180	return cc.NextLink != nil && len(*cc.NextLink) != 0
3181}
3182
3183// certificateCollectionPreparer prepares a request to retrieve the next set of results.
3184// It returns nil if no more results exist.
3185func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) {
3186	if !cc.hasNextLink() {
3187		return nil, nil
3188	}
3189	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3190		autorest.AsJSON(),
3191		autorest.AsGet(),
3192		autorest.WithBaseURL(to.String(cc.NextLink)))
3193}
3194
3195// CertificateCollectionPage contains a page of CertificateContract values.
3196type CertificateCollectionPage struct {
3197	fn func(context.Context, CertificateCollection) (CertificateCollection, error)
3198	cc CertificateCollection
3199}
3200
3201// NextWithContext advances to the next page of values.  If there was an error making
3202// the request the page does not advance and the error is returned.
3203func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) {
3204	if tracing.IsEnabled() {
3205		ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext")
3206		defer func() {
3207			sc := -1
3208			if page.Response().Response.Response != nil {
3209				sc = page.Response().Response.Response.StatusCode
3210			}
3211			tracing.EndSpan(ctx, sc, err)
3212		}()
3213	}
3214	for {
3215		next, err := page.fn(ctx, page.cc)
3216		if err != nil {
3217			return err
3218		}
3219		page.cc = next
3220		if !next.hasNextLink() || !next.IsEmpty() {
3221			break
3222		}
3223	}
3224	return nil
3225}
3226
3227// Next advances to the next page of values.  If there was an error making
3228// the request the page does not advance and the error is returned.
3229// Deprecated: Use NextWithContext() instead.
3230func (page *CertificateCollectionPage) Next() error {
3231	return page.NextWithContext(context.Background())
3232}
3233
3234// NotDone returns true if the page enumeration should be started or is not yet complete.
3235func (page CertificateCollectionPage) NotDone() bool {
3236	return !page.cc.IsEmpty()
3237}
3238
3239// Response returns the raw server response from the last page request.
3240func (page CertificateCollectionPage) Response() CertificateCollection {
3241	return page.cc
3242}
3243
3244// Values returns the slice of values for the current page or nil if there are no values.
3245func (page CertificateCollectionPage) Values() []CertificateContract {
3246	if page.cc.IsEmpty() {
3247		return nil
3248	}
3249	return *page.cc.Value
3250}
3251
3252// Creates a new instance of the CertificateCollectionPage type.
3253func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage {
3254	return CertificateCollectionPage{
3255		fn: getNextPage,
3256		cc: cur,
3257	}
3258}
3259
3260// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root
3261// certificates.
3262type CertificateConfiguration struct {
3263	// EncodedCertificate - Base64 Encoded certificate.
3264	EncodedCertificate *string `json:"encodedCertificate,omitempty"`
3265	// CertificatePassword - Certificate Password.
3266	CertificatePassword *string `json:"certificatePassword,omitempty"`
3267	// StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root'
3268	StoreName StoreName `json:"storeName,omitempty"`
3269	// Certificate - Certificate information.
3270	Certificate *CertificateInformation `json:"certificate,omitempty"`
3271}
3272
3273// CertificateContract certificate details.
3274type CertificateContract struct {
3275	autorest.Response `json:"-"`
3276	// CertificateContractProperties - Certificate properties details.
3277	*CertificateContractProperties `json:"properties,omitempty"`
3278	// ID - READ-ONLY; Resource ID.
3279	ID *string `json:"id,omitempty"`
3280	// Name - READ-ONLY; Resource name.
3281	Name *string `json:"name,omitempty"`
3282	// Type - READ-ONLY; Resource type for API Management resource.
3283	Type *string `json:"type,omitempty"`
3284}
3285
3286// MarshalJSON is the custom marshaler for CertificateContract.
3287func (cc CertificateContract) MarshalJSON() ([]byte, error) {
3288	objectMap := make(map[string]interface{})
3289	if cc.CertificateContractProperties != nil {
3290		objectMap["properties"] = cc.CertificateContractProperties
3291	}
3292	return json.Marshal(objectMap)
3293}
3294
3295// UnmarshalJSON is the custom unmarshaler for CertificateContract struct.
3296func (cc *CertificateContract) UnmarshalJSON(body []byte) error {
3297	var m map[string]*json.RawMessage
3298	err := json.Unmarshal(body, &m)
3299	if err != nil {
3300		return err
3301	}
3302	for k, v := range m {
3303		switch k {
3304		case "properties":
3305			if v != nil {
3306				var certificateContractProperties CertificateContractProperties
3307				err = json.Unmarshal(*v, &certificateContractProperties)
3308				if err != nil {
3309					return err
3310				}
3311				cc.CertificateContractProperties = &certificateContractProperties
3312			}
3313		case "id":
3314			if v != nil {
3315				var ID string
3316				err = json.Unmarshal(*v, &ID)
3317				if err != nil {
3318					return err
3319				}
3320				cc.ID = &ID
3321			}
3322		case "name":
3323			if v != nil {
3324				var name string
3325				err = json.Unmarshal(*v, &name)
3326				if err != nil {
3327					return err
3328				}
3329				cc.Name = &name
3330			}
3331		case "type":
3332			if v != nil {
3333				var typeVar string
3334				err = json.Unmarshal(*v, &typeVar)
3335				if err != nil {
3336					return err
3337				}
3338				cc.Type = &typeVar
3339			}
3340		}
3341	}
3342
3343	return nil
3344}
3345
3346// CertificateContractProperties properties of the Certificate contract.
3347type CertificateContractProperties struct {
3348	// Subject - Subject attribute of the certificate.
3349	Subject *string `json:"subject,omitempty"`
3350	// Thumbprint - Thumbprint of the certificate.
3351	Thumbprint *string `json:"thumbprint,omitempty"`
3352	// 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.
3353	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
3354}
3355
3356// CertificateCreateOrUpdateParameters certificate create or update details.
3357type CertificateCreateOrUpdateParameters struct {
3358	// CertificateCreateOrUpdateProperties - Certificate create or update properties details.
3359	*CertificateCreateOrUpdateProperties `json:"properties,omitempty"`
3360}
3361
3362// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters.
3363func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) {
3364	objectMap := make(map[string]interface{})
3365	if ccoup.CertificateCreateOrUpdateProperties != nil {
3366		objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties
3367	}
3368	return json.Marshal(objectMap)
3369}
3370
3371// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct.
3372func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error {
3373	var m map[string]*json.RawMessage
3374	err := json.Unmarshal(body, &m)
3375	if err != nil {
3376		return err
3377	}
3378	for k, v := range m {
3379		switch k {
3380		case "properties":
3381			if v != nil {
3382				var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties
3383				err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties)
3384				if err != nil {
3385					return err
3386				}
3387				ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties
3388			}
3389		}
3390	}
3391
3392	return nil
3393}
3394
3395// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation.
3396type CertificateCreateOrUpdateProperties struct {
3397	// Data - Base 64 encoded certificate using the application/x-pkcs12 representation.
3398	Data *string `json:"data,omitempty"`
3399	// Password - Password for the Certificate
3400	Password *string `json:"password,omitempty"`
3401}
3402
3403// CertificateInformation SSL certificate information.
3404type CertificateInformation struct {
3405	// 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.
3406	Expiry *date.Time `json:"expiry,omitempty"`
3407	// Thumbprint - Thumbprint of the certificate.
3408	Thumbprint *string `json:"thumbprint,omitempty"`
3409	// Subject - Subject of the certificate.
3410	Subject *string `json:"subject,omitempty"`
3411}
3412
3413// ClientSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
3414type ClientSecretContract struct {
3415	autorest.Response `json:"-"`
3416	// ClientSecret - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
3417	ClientSecret *string `json:"clientSecret,omitempty"`
3418}
3419
3420// ConnectivityStatusContract details about connectivity to a resource.
3421type ConnectivityStatusContract struct {
3422	// 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.
3423	Name *string `json:"name,omitempty"`
3424	// Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure'
3425	Status ConnectivityStatusType `json:"status,omitempty"`
3426	// Error - Error details of the connectivity to the resource.
3427	Error *string `json:"error,omitempty"`
3428	// 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.
3429	LastUpdated *date.Time `json:"lastUpdated,omitempty"`
3430	// 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.
3431	LastStatusChange *date.Time `json:"lastStatusChange,omitempty"`
3432}
3433
3434// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation.
3435type DeployConfigurationParameterProperties struct {
3436	// Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database.
3437	Branch *string `json:"branch,omitempty"`
3438	// Force - The value enforcing deleting subscriptions to products that are deleted in this update.
3439	Force *bool `json:"force,omitempty"`
3440}
3441
3442// DeployConfigurationParameters deploy Tenant Configuration Contract.
3443type DeployConfigurationParameters struct {
3444	// DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties.
3445	*DeployConfigurationParameterProperties `json:"properties,omitempty"`
3446}
3447
3448// MarshalJSON is the custom marshaler for DeployConfigurationParameters.
3449func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) {
3450	objectMap := make(map[string]interface{})
3451	if dcp.DeployConfigurationParameterProperties != nil {
3452		objectMap["properties"] = dcp.DeployConfigurationParameterProperties
3453	}
3454	return json.Marshal(objectMap)
3455}
3456
3457// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct.
3458func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error {
3459	var m map[string]*json.RawMessage
3460	err := json.Unmarshal(body, &m)
3461	if err != nil {
3462		return err
3463	}
3464	for k, v := range m {
3465		switch k {
3466		case "properties":
3467			if v != nil {
3468				var deployConfigurationParameterProperties DeployConfigurationParameterProperties
3469				err = json.Unmarshal(*v, &deployConfigurationParameterProperties)
3470				if err != nil {
3471					return err
3472				}
3473				dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties
3474			}
3475		}
3476	}
3477
3478	return nil
3479}
3480
3481// DiagnosticCollection paged Diagnostic list representation.
3482type DiagnosticCollection struct {
3483	autorest.Response `json:"-"`
3484	// Value - Page values.
3485	Value *[]DiagnosticContract `json:"value,omitempty"`
3486	// NextLink - Next page link if any.
3487	NextLink *string `json:"nextLink,omitempty"`
3488}
3489
3490// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values.
3491type DiagnosticCollectionIterator struct {
3492	i    int
3493	page DiagnosticCollectionPage
3494}
3495
3496// NextWithContext advances to the next value.  If there was an error making
3497// the request the iterator does not advance and the error is returned.
3498func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3499	if tracing.IsEnabled() {
3500		ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext")
3501		defer func() {
3502			sc := -1
3503			if iter.Response().Response.Response != nil {
3504				sc = iter.Response().Response.Response.StatusCode
3505			}
3506			tracing.EndSpan(ctx, sc, err)
3507		}()
3508	}
3509	iter.i++
3510	if iter.i < len(iter.page.Values()) {
3511		return nil
3512	}
3513	err = iter.page.NextWithContext(ctx)
3514	if err != nil {
3515		iter.i--
3516		return err
3517	}
3518	iter.i = 0
3519	return nil
3520}
3521
3522// Next advances to the next value.  If there was an error making
3523// the request the iterator does not advance and the error is returned.
3524// Deprecated: Use NextWithContext() instead.
3525func (iter *DiagnosticCollectionIterator) Next() error {
3526	return iter.NextWithContext(context.Background())
3527}
3528
3529// NotDone returns true if the enumeration should be started or is not yet complete.
3530func (iter DiagnosticCollectionIterator) NotDone() bool {
3531	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3532}
3533
3534// Response returns the raw server response from the last page request.
3535func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection {
3536	return iter.page.Response()
3537}
3538
3539// Value returns the current value or a zero-initialized value if the
3540// iterator has advanced beyond the end of the collection.
3541func (iter DiagnosticCollectionIterator) Value() DiagnosticContract {
3542	if !iter.page.NotDone() {
3543		return DiagnosticContract{}
3544	}
3545	return iter.page.Values()[iter.i]
3546}
3547
3548// Creates a new instance of the DiagnosticCollectionIterator type.
3549func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator {
3550	return DiagnosticCollectionIterator{page: page}
3551}
3552
3553// IsEmpty returns true if the ListResult contains no values.
3554func (dc DiagnosticCollection) IsEmpty() bool {
3555	return dc.Value == nil || len(*dc.Value) == 0
3556}
3557
3558// hasNextLink returns true if the NextLink is not empty.
3559func (dc DiagnosticCollection) hasNextLink() bool {
3560	return dc.NextLink != nil && len(*dc.NextLink) != 0
3561}
3562
3563// diagnosticCollectionPreparer prepares a request to retrieve the next set of results.
3564// It returns nil if no more results exist.
3565func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) {
3566	if !dc.hasNextLink() {
3567		return nil, nil
3568	}
3569	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3570		autorest.AsJSON(),
3571		autorest.AsGet(),
3572		autorest.WithBaseURL(to.String(dc.NextLink)))
3573}
3574
3575// DiagnosticCollectionPage contains a page of DiagnosticContract values.
3576type DiagnosticCollectionPage struct {
3577	fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)
3578	dc DiagnosticCollection
3579}
3580
3581// NextWithContext advances to the next page of values.  If there was an error making
3582// the request the page does not advance and the error is returned.
3583func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) {
3584	if tracing.IsEnabled() {
3585		ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext")
3586		defer func() {
3587			sc := -1
3588			if page.Response().Response.Response != nil {
3589				sc = page.Response().Response.Response.StatusCode
3590			}
3591			tracing.EndSpan(ctx, sc, err)
3592		}()
3593	}
3594	for {
3595		next, err := page.fn(ctx, page.dc)
3596		if err != nil {
3597			return err
3598		}
3599		page.dc = next
3600		if !next.hasNextLink() || !next.IsEmpty() {
3601			break
3602		}
3603	}
3604	return nil
3605}
3606
3607// Next advances to the next page of values.  If there was an error making
3608// the request the page does not advance and the error is returned.
3609// Deprecated: Use NextWithContext() instead.
3610func (page *DiagnosticCollectionPage) Next() error {
3611	return page.NextWithContext(context.Background())
3612}
3613
3614// NotDone returns true if the page enumeration should be started or is not yet complete.
3615func (page DiagnosticCollectionPage) NotDone() bool {
3616	return !page.dc.IsEmpty()
3617}
3618
3619// Response returns the raw server response from the last page request.
3620func (page DiagnosticCollectionPage) Response() DiagnosticCollection {
3621	return page.dc
3622}
3623
3624// Values returns the slice of values for the current page or nil if there are no values.
3625func (page DiagnosticCollectionPage) Values() []DiagnosticContract {
3626	if page.dc.IsEmpty() {
3627		return nil
3628	}
3629	return *page.dc.Value
3630}
3631
3632// Creates a new instance of the DiagnosticCollectionPage type.
3633func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage {
3634	return DiagnosticCollectionPage{
3635		fn: getNextPage,
3636		dc: cur,
3637	}
3638}
3639
3640// DiagnosticContract diagnostic details.
3641type DiagnosticContract struct {
3642	autorest.Response `json:"-"`
3643	// DiagnosticContractProperties - Diagnostic entity contract properties.
3644	*DiagnosticContractProperties `json:"properties,omitempty"`
3645	// ID - READ-ONLY; Resource ID.
3646	ID *string `json:"id,omitempty"`
3647	// Name - READ-ONLY; Resource name.
3648	Name *string `json:"name,omitempty"`
3649	// Type - READ-ONLY; Resource type for API Management resource.
3650	Type *string `json:"type,omitempty"`
3651}
3652
3653// MarshalJSON is the custom marshaler for DiagnosticContract.
3654func (dc DiagnosticContract) MarshalJSON() ([]byte, error) {
3655	objectMap := make(map[string]interface{})
3656	if dc.DiagnosticContractProperties != nil {
3657		objectMap["properties"] = dc.DiagnosticContractProperties
3658	}
3659	return json.Marshal(objectMap)
3660}
3661
3662// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct.
3663func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error {
3664	var m map[string]*json.RawMessage
3665	err := json.Unmarshal(body, &m)
3666	if err != nil {
3667		return err
3668	}
3669	for k, v := range m {
3670		switch k {
3671		case "properties":
3672			if v != nil {
3673				var diagnosticContractProperties DiagnosticContractProperties
3674				err = json.Unmarshal(*v, &diagnosticContractProperties)
3675				if err != nil {
3676					return err
3677				}
3678				dc.DiagnosticContractProperties = &diagnosticContractProperties
3679			}
3680		case "id":
3681			if v != nil {
3682				var ID string
3683				err = json.Unmarshal(*v, &ID)
3684				if err != nil {
3685					return err
3686				}
3687				dc.ID = &ID
3688			}
3689		case "name":
3690			if v != nil {
3691				var name string
3692				err = json.Unmarshal(*v, &name)
3693				if err != nil {
3694					return err
3695				}
3696				dc.Name = &name
3697			}
3698		case "type":
3699			if v != nil {
3700				var typeVar string
3701				err = json.Unmarshal(*v, &typeVar)
3702				if err != nil {
3703					return err
3704				}
3705				dc.Type = &typeVar
3706			}
3707		}
3708	}
3709
3710	return nil
3711}
3712
3713// DiagnosticContractProperties diagnostic Entity Properties
3714type DiagnosticContractProperties struct {
3715	// AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors'
3716	AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"`
3717	// LoggerID - Resource Id of a target logger.
3718	LoggerID *string `json:"loggerId,omitempty"`
3719	// Sampling - Sampling settings for Diagnostic.
3720	Sampling *SamplingSettings `json:"sampling,omitempty"`
3721	// Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
3722	Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"`
3723	// Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend
3724	Backend *PipelineDiagnosticSettings `json:"backend,omitempty"`
3725	// LogClientIP - Log the ClientIP. Default is false.
3726	LogClientIP *bool `json:"logClientIp,omitempty"`
3727	// HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'HTTPCorrelationProtocolNone', 'HTTPCorrelationProtocolLegacy', 'HTTPCorrelationProtocolW3C'
3728	HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"`
3729	// Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'Verbose', 'Information', 'Error'
3730	Verbosity Verbosity `json:"verbosity,omitempty"`
3731}
3732
3733// EmailTemplateCollection paged email template list representation.
3734type EmailTemplateCollection struct {
3735	autorest.Response `json:"-"`
3736	// Value - Page values.
3737	Value *[]EmailTemplateContract `json:"value,omitempty"`
3738	// NextLink - Next page link if any.
3739	NextLink *string `json:"nextLink,omitempty"`
3740}
3741
3742// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values.
3743type EmailTemplateCollectionIterator struct {
3744	i    int
3745	page EmailTemplateCollectionPage
3746}
3747
3748// NextWithContext advances to the next value.  If there was an error making
3749// the request the iterator does not advance and the error is returned.
3750func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3751	if tracing.IsEnabled() {
3752		ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext")
3753		defer func() {
3754			sc := -1
3755			if iter.Response().Response.Response != nil {
3756				sc = iter.Response().Response.Response.StatusCode
3757			}
3758			tracing.EndSpan(ctx, sc, err)
3759		}()
3760	}
3761	iter.i++
3762	if iter.i < len(iter.page.Values()) {
3763		return nil
3764	}
3765	err = iter.page.NextWithContext(ctx)
3766	if err != nil {
3767		iter.i--
3768		return err
3769	}
3770	iter.i = 0
3771	return nil
3772}
3773
3774// Next advances to the next value.  If there was an error making
3775// the request the iterator does not advance and the error is returned.
3776// Deprecated: Use NextWithContext() instead.
3777func (iter *EmailTemplateCollectionIterator) Next() error {
3778	return iter.NextWithContext(context.Background())
3779}
3780
3781// NotDone returns true if the enumeration should be started or is not yet complete.
3782func (iter EmailTemplateCollectionIterator) NotDone() bool {
3783	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3784}
3785
3786// Response returns the raw server response from the last page request.
3787func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection {
3788	return iter.page.Response()
3789}
3790
3791// Value returns the current value or a zero-initialized value if the
3792// iterator has advanced beyond the end of the collection.
3793func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract {
3794	if !iter.page.NotDone() {
3795		return EmailTemplateContract{}
3796	}
3797	return iter.page.Values()[iter.i]
3798}
3799
3800// Creates a new instance of the EmailTemplateCollectionIterator type.
3801func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator {
3802	return EmailTemplateCollectionIterator{page: page}
3803}
3804
3805// IsEmpty returns true if the ListResult contains no values.
3806func (etc EmailTemplateCollection) IsEmpty() bool {
3807	return etc.Value == nil || len(*etc.Value) == 0
3808}
3809
3810// hasNextLink returns true if the NextLink is not empty.
3811func (etc EmailTemplateCollection) hasNextLink() bool {
3812	return etc.NextLink != nil && len(*etc.NextLink) != 0
3813}
3814
3815// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results.
3816// It returns nil if no more results exist.
3817func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) {
3818	if !etc.hasNextLink() {
3819		return nil, nil
3820	}
3821	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3822		autorest.AsJSON(),
3823		autorest.AsGet(),
3824		autorest.WithBaseURL(to.String(etc.NextLink)))
3825}
3826
3827// EmailTemplateCollectionPage contains a page of EmailTemplateContract values.
3828type EmailTemplateCollectionPage struct {
3829	fn  func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)
3830	etc EmailTemplateCollection
3831}
3832
3833// NextWithContext advances to the next page of values.  If there was an error making
3834// the request the page does not advance and the error is returned.
3835func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) {
3836	if tracing.IsEnabled() {
3837		ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext")
3838		defer func() {
3839			sc := -1
3840			if page.Response().Response.Response != nil {
3841				sc = page.Response().Response.Response.StatusCode
3842			}
3843			tracing.EndSpan(ctx, sc, err)
3844		}()
3845	}
3846	for {
3847		next, err := page.fn(ctx, page.etc)
3848		if err != nil {
3849			return err
3850		}
3851		page.etc = next
3852		if !next.hasNextLink() || !next.IsEmpty() {
3853			break
3854		}
3855	}
3856	return nil
3857}
3858
3859// Next advances to the next page of values.  If there was an error making
3860// the request the page does not advance and the error is returned.
3861// Deprecated: Use NextWithContext() instead.
3862func (page *EmailTemplateCollectionPage) Next() error {
3863	return page.NextWithContext(context.Background())
3864}
3865
3866// NotDone returns true if the page enumeration should be started or is not yet complete.
3867func (page EmailTemplateCollectionPage) NotDone() bool {
3868	return !page.etc.IsEmpty()
3869}
3870
3871// Response returns the raw server response from the last page request.
3872func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection {
3873	return page.etc
3874}
3875
3876// Values returns the slice of values for the current page or nil if there are no values.
3877func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract {
3878	if page.etc.IsEmpty() {
3879		return nil
3880	}
3881	return *page.etc.Value
3882}
3883
3884// Creates a new instance of the EmailTemplateCollectionPage type.
3885func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage {
3886	return EmailTemplateCollectionPage{
3887		fn:  getNextPage,
3888		etc: cur,
3889	}
3890}
3891
3892// EmailTemplateContract email Template details.
3893type EmailTemplateContract struct {
3894	autorest.Response `json:"-"`
3895	// EmailTemplateContractProperties - Email Template entity contract properties.
3896	*EmailTemplateContractProperties `json:"properties,omitempty"`
3897	// ID - READ-ONLY; Resource ID.
3898	ID *string `json:"id,omitempty"`
3899	// Name - READ-ONLY; Resource name.
3900	Name *string `json:"name,omitempty"`
3901	// Type - READ-ONLY; Resource type for API Management resource.
3902	Type *string `json:"type,omitempty"`
3903}
3904
3905// MarshalJSON is the custom marshaler for EmailTemplateContract.
3906func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) {
3907	objectMap := make(map[string]interface{})
3908	if etc.EmailTemplateContractProperties != nil {
3909		objectMap["properties"] = etc.EmailTemplateContractProperties
3910	}
3911	return json.Marshal(objectMap)
3912}
3913
3914// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct.
3915func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error {
3916	var m map[string]*json.RawMessage
3917	err := json.Unmarshal(body, &m)
3918	if err != nil {
3919		return err
3920	}
3921	for k, v := range m {
3922		switch k {
3923		case "properties":
3924			if v != nil {
3925				var emailTemplateContractProperties EmailTemplateContractProperties
3926				err = json.Unmarshal(*v, &emailTemplateContractProperties)
3927				if err != nil {
3928					return err
3929				}
3930				etc.EmailTemplateContractProperties = &emailTemplateContractProperties
3931			}
3932		case "id":
3933			if v != nil {
3934				var ID string
3935				err = json.Unmarshal(*v, &ID)
3936				if err != nil {
3937					return err
3938				}
3939				etc.ID = &ID
3940			}
3941		case "name":
3942			if v != nil {
3943				var name string
3944				err = json.Unmarshal(*v, &name)
3945				if err != nil {
3946					return err
3947				}
3948				etc.Name = &name
3949			}
3950		case "type":
3951			if v != nil {
3952				var typeVar string
3953				err = json.Unmarshal(*v, &typeVar)
3954				if err != nil {
3955					return err
3956				}
3957				etc.Type = &typeVar
3958			}
3959		}
3960	}
3961
3962	return nil
3963}
3964
3965// EmailTemplateContractProperties email Template Contract properties.
3966type EmailTemplateContractProperties struct {
3967	// Subject - Subject of the Template.
3968	Subject *string `json:"subject,omitempty"`
3969	// Body - Email Template Body. This should be a valid XDocument
3970	Body *string `json:"body,omitempty"`
3971	// Title - Title of the Template.
3972	Title *string `json:"title,omitempty"`
3973	// Description - Description of the Email Template.
3974	Description *string `json:"description,omitempty"`
3975	// IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited.
3976	IsDefault *bool `json:"isDefault,omitempty"`
3977	// Parameters - Email Template Parameter values.
3978	Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"`
3979}
3980
3981// MarshalJSON is the custom marshaler for EmailTemplateContractProperties.
3982func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) {
3983	objectMap := make(map[string]interface{})
3984	if etcp.Subject != nil {
3985		objectMap["subject"] = etcp.Subject
3986	}
3987	if etcp.Body != nil {
3988		objectMap["body"] = etcp.Body
3989	}
3990	if etcp.Title != nil {
3991		objectMap["title"] = etcp.Title
3992	}
3993	if etcp.Description != nil {
3994		objectMap["description"] = etcp.Description
3995	}
3996	if etcp.Parameters != nil {
3997		objectMap["parameters"] = etcp.Parameters
3998	}
3999	return json.Marshal(objectMap)
4000}
4001
4002// EmailTemplateParametersContractProperties email Template Parameter contract.
4003type EmailTemplateParametersContractProperties struct {
4004	// Name - Template parameter name.
4005	Name *string `json:"name,omitempty"`
4006	// Title - Template parameter title.
4007	Title *string `json:"title,omitempty"`
4008	// Description - Template parameter description.
4009	Description *string `json:"description,omitempty"`
4010}
4011
4012// EmailTemplateUpdateParameterProperties email Template Update Contract properties.
4013type EmailTemplateUpdateParameterProperties struct {
4014	// Subject - Subject of the Template.
4015	Subject *string `json:"subject,omitempty"`
4016	// Title - Title of the Template.
4017	Title *string `json:"title,omitempty"`
4018	// Description - Description of the Email Template.
4019	Description *string `json:"description,omitempty"`
4020	// Body - Email Template Body. This should be a valid XDocument
4021	Body *string `json:"body,omitempty"`
4022	// Parameters - Email Template Parameter values.
4023	Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"`
4024}
4025
4026// EmailTemplateUpdateParameters email Template update Parameters.
4027type EmailTemplateUpdateParameters struct {
4028	// EmailTemplateUpdateParameterProperties - Email Template Update contract properties.
4029	*EmailTemplateUpdateParameterProperties `json:"properties,omitempty"`
4030}
4031
4032// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters.
4033func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) {
4034	objectMap := make(map[string]interface{})
4035	if etup.EmailTemplateUpdateParameterProperties != nil {
4036		objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties
4037	}
4038	return json.Marshal(objectMap)
4039}
4040
4041// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct.
4042func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error {
4043	var m map[string]*json.RawMessage
4044	err := json.Unmarshal(body, &m)
4045	if err != nil {
4046		return err
4047	}
4048	for k, v := range m {
4049		switch k {
4050		case "properties":
4051			if v != nil {
4052				var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties
4053				err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties)
4054				if err != nil {
4055					return err
4056				}
4057				etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties
4058			}
4059		}
4060	}
4061
4062	return nil
4063}
4064
4065// ErrorFieldContract error Field contract.
4066type ErrorFieldContract struct {
4067	// Code - Property level error code.
4068	Code *string `json:"code,omitempty"`
4069	// Message - Human-readable representation of property-level error.
4070	Message *string `json:"message,omitempty"`
4071	// Target - Property name.
4072	Target *string `json:"target,omitempty"`
4073}
4074
4075// ErrorResponse error Response.
4076type ErrorResponse struct {
4077	// ErrorResponseBody - Properties of the Error Response.
4078	*ErrorResponseBody `json:"error,omitempty"`
4079}
4080
4081// MarshalJSON is the custom marshaler for ErrorResponse.
4082func (er ErrorResponse) MarshalJSON() ([]byte, error) {
4083	objectMap := make(map[string]interface{})
4084	if er.ErrorResponseBody != nil {
4085		objectMap["error"] = er.ErrorResponseBody
4086	}
4087	return json.Marshal(objectMap)
4088}
4089
4090// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct.
4091func (er *ErrorResponse) UnmarshalJSON(body []byte) error {
4092	var m map[string]*json.RawMessage
4093	err := json.Unmarshal(body, &m)
4094	if err != nil {
4095		return err
4096	}
4097	for k, v := range m {
4098		switch k {
4099		case "error":
4100			if v != nil {
4101				var errorResponseBody ErrorResponseBody
4102				err = json.Unmarshal(*v, &errorResponseBody)
4103				if err != nil {
4104					return err
4105				}
4106				er.ErrorResponseBody = &errorResponseBody
4107			}
4108		}
4109	}
4110
4111	return nil
4112}
4113
4114// ErrorResponseBody error Body contract.
4115type ErrorResponseBody struct {
4116	// Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
4117	Code *string `json:"code,omitempty"`
4118	// Message - Human-readable representation of the error.
4119	Message *string `json:"message,omitempty"`
4120	// Details - The list of invalid fields send in request, in case of validation error.
4121	Details *[]ErrorFieldContract `json:"details,omitempty"`
4122}
4123
4124// GatewayCollection paged Gateway list representation.
4125type GatewayCollection struct {
4126	autorest.Response `json:"-"`
4127	// Value - READ-ONLY; Page values.
4128	Value *[]GatewayContract `json:"value,omitempty"`
4129	// NextLink - READ-ONLY; Next page link if any.
4130	NextLink *string `json:"nextLink,omitempty"`
4131}
4132
4133// MarshalJSON is the custom marshaler for GatewayCollection.
4134func (gc GatewayCollection) MarshalJSON() ([]byte, error) {
4135	objectMap := make(map[string]interface{})
4136	return json.Marshal(objectMap)
4137}
4138
4139// GatewayCollectionIterator provides access to a complete listing of GatewayContract values.
4140type GatewayCollectionIterator struct {
4141	i    int
4142	page GatewayCollectionPage
4143}
4144
4145// NextWithContext advances to the next value.  If there was an error making
4146// the request the iterator does not advance and the error is returned.
4147func (iter *GatewayCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4148	if tracing.IsEnabled() {
4149		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionIterator.NextWithContext")
4150		defer func() {
4151			sc := -1
4152			if iter.Response().Response.Response != nil {
4153				sc = iter.Response().Response.Response.StatusCode
4154			}
4155			tracing.EndSpan(ctx, sc, err)
4156		}()
4157	}
4158	iter.i++
4159	if iter.i < len(iter.page.Values()) {
4160		return nil
4161	}
4162	err = iter.page.NextWithContext(ctx)
4163	if err != nil {
4164		iter.i--
4165		return err
4166	}
4167	iter.i = 0
4168	return nil
4169}
4170
4171// Next advances to the next value.  If there was an error making
4172// the request the iterator does not advance and the error is returned.
4173// Deprecated: Use NextWithContext() instead.
4174func (iter *GatewayCollectionIterator) Next() error {
4175	return iter.NextWithContext(context.Background())
4176}
4177
4178// NotDone returns true if the enumeration should be started or is not yet complete.
4179func (iter GatewayCollectionIterator) NotDone() bool {
4180	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4181}
4182
4183// Response returns the raw server response from the last page request.
4184func (iter GatewayCollectionIterator) Response() GatewayCollection {
4185	return iter.page.Response()
4186}
4187
4188// Value returns the current value or a zero-initialized value if the
4189// iterator has advanced beyond the end of the collection.
4190func (iter GatewayCollectionIterator) Value() GatewayContract {
4191	if !iter.page.NotDone() {
4192		return GatewayContract{}
4193	}
4194	return iter.page.Values()[iter.i]
4195}
4196
4197// Creates a new instance of the GatewayCollectionIterator type.
4198func NewGatewayCollectionIterator(page GatewayCollectionPage) GatewayCollectionIterator {
4199	return GatewayCollectionIterator{page: page}
4200}
4201
4202// IsEmpty returns true if the ListResult contains no values.
4203func (gc GatewayCollection) IsEmpty() bool {
4204	return gc.Value == nil || len(*gc.Value) == 0
4205}
4206
4207// hasNextLink returns true if the NextLink is not empty.
4208func (gc GatewayCollection) hasNextLink() bool {
4209	return gc.NextLink != nil && len(*gc.NextLink) != 0
4210}
4211
4212// gatewayCollectionPreparer prepares a request to retrieve the next set of results.
4213// It returns nil if no more results exist.
4214func (gc GatewayCollection) gatewayCollectionPreparer(ctx context.Context) (*http.Request, error) {
4215	if !gc.hasNextLink() {
4216		return nil, nil
4217	}
4218	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4219		autorest.AsJSON(),
4220		autorest.AsGet(),
4221		autorest.WithBaseURL(to.String(gc.NextLink)))
4222}
4223
4224// GatewayCollectionPage contains a page of GatewayContract values.
4225type GatewayCollectionPage struct {
4226	fn func(context.Context, GatewayCollection) (GatewayCollection, error)
4227	gc GatewayCollection
4228}
4229
4230// NextWithContext advances to the next page of values.  If there was an error making
4231// the request the page does not advance and the error is returned.
4232func (page *GatewayCollectionPage) NextWithContext(ctx context.Context) (err error) {
4233	if tracing.IsEnabled() {
4234		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionPage.NextWithContext")
4235		defer func() {
4236			sc := -1
4237			if page.Response().Response.Response != nil {
4238				sc = page.Response().Response.Response.StatusCode
4239			}
4240			tracing.EndSpan(ctx, sc, err)
4241		}()
4242	}
4243	for {
4244		next, err := page.fn(ctx, page.gc)
4245		if err != nil {
4246			return err
4247		}
4248		page.gc = next
4249		if !next.hasNextLink() || !next.IsEmpty() {
4250			break
4251		}
4252	}
4253	return nil
4254}
4255
4256// Next advances to the next page of values.  If there was an error making
4257// the request the page does not advance and the error is returned.
4258// Deprecated: Use NextWithContext() instead.
4259func (page *GatewayCollectionPage) Next() error {
4260	return page.NextWithContext(context.Background())
4261}
4262
4263// NotDone returns true if the page enumeration should be started or is not yet complete.
4264func (page GatewayCollectionPage) NotDone() bool {
4265	return !page.gc.IsEmpty()
4266}
4267
4268// Response returns the raw server response from the last page request.
4269func (page GatewayCollectionPage) Response() GatewayCollection {
4270	return page.gc
4271}
4272
4273// Values returns the slice of values for the current page or nil if there are no values.
4274func (page GatewayCollectionPage) Values() []GatewayContract {
4275	if page.gc.IsEmpty() {
4276		return nil
4277	}
4278	return *page.gc.Value
4279}
4280
4281// Creates a new instance of the GatewayCollectionPage type.
4282func NewGatewayCollectionPage(cur GatewayCollection, getNextPage func(context.Context, GatewayCollection) (GatewayCollection, error)) GatewayCollectionPage {
4283	return GatewayCollectionPage{
4284		fn: getNextPage,
4285		gc: cur,
4286	}
4287}
4288
4289// GatewayContract gateway details.
4290type GatewayContract struct {
4291	autorest.Response `json:"-"`
4292	// GatewayContractProperties - Gateway details.
4293	*GatewayContractProperties `json:"properties,omitempty"`
4294	// ID - READ-ONLY; Resource ID.
4295	ID *string `json:"id,omitempty"`
4296	// Name - READ-ONLY; Resource name.
4297	Name *string `json:"name,omitempty"`
4298	// Type - READ-ONLY; Resource type for API Management resource.
4299	Type *string `json:"type,omitempty"`
4300}
4301
4302// MarshalJSON is the custom marshaler for GatewayContract.
4303func (gc GatewayContract) MarshalJSON() ([]byte, error) {
4304	objectMap := make(map[string]interface{})
4305	if gc.GatewayContractProperties != nil {
4306		objectMap["properties"] = gc.GatewayContractProperties
4307	}
4308	return json.Marshal(objectMap)
4309}
4310
4311// UnmarshalJSON is the custom unmarshaler for GatewayContract struct.
4312func (gc *GatewayContract) UnmarshalJSON(body []byte) error {
4313	var m map[string]*json.RawMessage
4314	err := json.Unmarshal(body, &m)
4315	if err != nil {
4316		return err
4317	}
4318	for k, v := range m {
4319		switch k {
4320		case "properties":
4321			if v != nil {
4322				var gatewayContractProperties GatewayContractProperties
4323				err = json.Unmarshal(*v, &gatewayContractProperties)
4324				if err != nil {
4325					return err
4326				}
4327				gc.GatewayContractProperties = &gatewayContractProperties
4328			}
4329		case "id":
4330			if v != nil {
4331				var ID string
4332				err = json.Unmarshal(*v, &ID)
4333				if err != nil {
4334					return err
4335				}
4336				gc.ID = &ID
4337			}
4338		case "name":
4339			if v != nil {
4340				var name string
4341				err = json.Unmarshal(*v, &name)
4342				if err != nil {
4343					return err
4344				}
4345				gc.Name = &name
4346			}
4347		case "type":
4348			if v != nil {
4349				var typeVar string
4350				err = json.Unmarshal(*v, &typeVar)
4351				if err != nil {
4352					return err
4353				}
4354				gc.Type = &typeVar
4355			}
4356		}
4357	}
4358
4359	return nil
4360}
4361
4362// GatewayContractProperties properties of the Gateway contract.
4363type GatewayContractProperties struct {
4364	// LocationData - Gateway location.
4365	LocationData *ResourceLocationDataContract `json:"locationData,omitempty"`
4366	// Description - Gateway description
4367	Description *string `json:"description,omitempty"`
4368}
4369
4370// GatewayHostnameConfigurationCollection paged Gateway hostname configuration list representation.
4371type GatewayHostnameConfigurationCollection struct {
4372	autorest.Response `json:"-"`
4373	// Value - READ-ONLY; Page values.
4374	Value *[]GatewayHostnameConfigurationContract `json:"value,omitempty"`
4375	// NextLink - READ-ONLY; Next page link if any.
4376	NextLink *string `json:"nextLink,omitempty"`
4377}
4378
4379// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationCollection.
4380func (ghcc GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error) {
4381	objectMap := make(map[string]interface{})
4382	return json.Marshal(objectMap)
4383}
4384
4385// GatewayHostnameConfigurationCollectionIterator provides access to a complete listing of
4386// GatewayHostnameConfigurationContract values.
4387type GatewayHostnameConfigurationCollectionIterator struct {
4388	i    int
4389	page GatewayHostnameConfigurationCollectionPage
4390}
4391
4392// NextWithContext advances to the next value.  If there was an error making
4393// the request the iterator does not advance and the error is returned.
4394func (iter *GatewayHostnameConfigurationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4395	if tracing.IsEnabled() {
4396		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionIterator.NextWithContext")
4397		defer func() {
4398			sc := -1
4399			if iter.Response().Response.Response != nil {
4400				sc = iter.Response().Response.Response.StatusCode
4401			}
4402			tracing.EndSpan(ctx, sc, err)
4403		}()
4404	}
4405	iter.i++
4406	if iter.i < len(iter.page.Values()) {
4407		return nil
4408	}
4409	err = iter.page.NextWithContext(ctx)
4410	if err != nil {
4411		iter.i--
4412		return err
4413	}
4414	iter.i = 0
4415	return nil
4416}
4417
4418// Next advances to the next value.  If there was an error making
4419// the request the iterator does not advance and the error is returned.
4420// Deprecated: Use NextWithContext() instead.
4421func (iter *GatewayHostnameConfigurationCollectionIterator) Next() error {
4422	return iter.NextWithContext(context.Background())
4423}
4424
4425// NotDone returns true if the enumeration should be started or is not yet complete.
4426func (iter GatewayHostnameConfigurationCollectionIterator) NotDone() bool {
4427	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4428}
4429
4430// Response returns the raw server response from the last page request.
4431func (iter GatewayHostnameConfigurationCollectionIterator) Response() GatewayHostnameConfigurationCollection {
4432	return iter.page.Response()
4433}
4434
4435// Value returns the current value or a zero-initialized value if the
4436// iterator has advanced beyond the end of the collection.
4437func (iter GatewayHostnameConfigurationCollectionIterator) Value() GatewayHostnameConfigurationContract {
4438	if !iter.page.NotDone() {
4439		return GatewayHostnameConfigurationContract{}
4440	}
4441	return iter.page.Values()[iter.i]
4442}
4443
4444// Creates a new instance of the GatewayHostnameConfigurationCollectionIterator type.
4445func NewGatewayHostnameConfigurationCollectionIterator(page GatewayHostnameConfigurationCollectionPage) GatewayHostnameConfigurationCollectionIterator {
4446	return GatewayHostnameConfigurationCollectionIterator{page: page}
4447}
4448
4449// IsEmpty returns true if the ListResult contains no values.
4450func (ghcc GatewayHostnameConfigurationCollection) IsEmpty() bool {
4451	return ghcc.Value == nil || len(*ghcc.Value) == 0
4452}
4453
4454// hasNextLink returns true if the NextLink is not empty.
4455func (ghcc GatewayHostnameConfigurationCollection) hasNextLink() bool {
4456	return ghcc.NextLink != nil && len(*ghcc.NextLink) != 0
4457}
4458
4459// gatewayHostnameConfigurationCollectionPreparer prepares a request to retrieve the next set of results.
4460// It returns nil if no more results exist.
4461func (ghcc GatewayHostnameConfigurationCollection) gatewayHostnameConfigurationCollectionPreparer(ctx context.Context) (*http.Request, error) {
4462	if !ghcc.hasNextLink() {
4463		return nil, nil
4464	}
4465	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4466		autorest.AsJSON(),
4467		autorest.AsGet(),
4468		autorest.WithBaseURL(to.String(ghcc.NextLink)))
4469}
4470
4471// GatewayHostnameConfigurationCollectionPage contains a page of GatewayHostnameConfigurationContract
4472// values.
4473type GatewayHostnameConfigurationCollectionPage struct {
4474	fn   func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)
4475	ghcc GatewayHostnameConfigurationCollection
4476}
4477
4478// NextWithContext advances to the next page of values.  If there was an error making
4479// the request the page does not advance and the error is returned.
4480func (page *GatewayHostnameConfigurationCollectionPage) NextWithContext(ctx context.Context) (err error) {
4481	if tracing.IsEnabled() {
4482		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionPage.NextWithContext")
4483		defer func() {
4484			sc := -1
4485			if page.Response().Response.Response != nil {
4486				sc = page.Response().Response.Response.StatusCode
4487			}
4488			tracing.EndSpan(ctx, sc, err)
4489		}()
4490	}
4491	for {
4492		next, err := page.fn(ctx, page.ghcc)
4493		if err != nil {
4494			return err
4495		}
4496		page.ghcc = next
4497		if !next.hasNextLink() || !next.IsEmpty() {
4498			break
4499		}
4500	}
4501	return nil
4502}
4503
4504// Next advances to the next page of values.  If there was an error making
4505// the request the page does not advance and the error is returned.
4506// Deprecated: Use NextWithContext() instead.
4507func (page *GatewayHostnameConfigurationCollectionPage) Next() error {
4508	return page.NextWithContext(context.Background())
4509}
4510
4511// NotDone returns true if the page enumeration should be started or is not yet complete.
4512func (page GatewayHostnameConfigurationCollectionPage) NotDone() bool {
4513	return !page.ghcc.IsEmpty()
4514}
4515
4516// Response returns the raw server response from the last page request.
4517func (page GatewayHostnameConfigurationCollectionPage) Response() GatewayHostnameConfigurationCollection {
4518	return page.ghcc
4519}
4520
4521// Values returns the slice of values for the current page or nil if there are no values.
4522func (page GatewayHostnameConfigurationCollectionPage) Values() []GatewayHostnameConfigurationContract {
4523	if page.ghcc.IsEmpty() {
4524		return nil
4525	}
4526	return *page.ghcc.Value
4527}
4528
4529// Creates a new instance of the GatewayHostnameConfigurationCollectionPage type.
4530func NewGatewayHostnameConfigurationCollectionPage(cur GatewayHostnameConfigurationCollection, getNextPage func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)) GatewayHostnameConfigurationCollectionPage {
4531	return GatewayHostnameConfigurationCollectionPage{
4532		fn:   getNextPage,
4533		ghcc: cur,
4534	}
4535}
4536
4537// GatewayHostnameConfigurationContract gateway hostname configuration details.
4538type GatewayHostnameConfigurationContract struct {
4539	autorest.Response `json:"-"`
4540	// GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details.
4541	*GatewayHostnameConfigurationContractProperties `json:"properties,omitempty"`
4542	// ID - READ-ONLY; Resource ID.
4543	ID *string `json:"id,omitempty"`
4544	// Name - READ-ONLY; Resource name.
4545	Name *string `json:"name,omitempty"`
4546	// Type - READ-ONLY; Resource type for API Management resource.
4547	Type *string `json:"type,omitempty"`
4548}
4549
4550// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationContract.
4551func (ghcc GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) {
4552	objectMap := make(map[string]interface{})
4553	if ghcc.GatewayHostnameConfigurationContractProperties != nil {
4554		objectMap["properties"] = ghcc.GatewayHostnameConfigurationContractProperties
4555	}
4556	return json.Marshal(objectMap)
4557}
4558
4559// UnmarshalJSON is the custom unmarshaler for GatewayHostnameConfigurationContract struct.
4560func (ghcc *GatewayHostnameConfigurationContract) UnmarshalJSON(body []byte) error {
4561	var m map[string]*json.RawMessage
4562	err := json.Unmarshal(body, &m)
4563	if err != nil {
4564		return err
4565	}
4566	for k, v := range m {
4567		switch k {
4568		case "properties":
4569			if v != nil {
4570				var gatewayHostnameConfigurationContractProperties GatewayHostnameConfigurationContractProperties
4571				err = json.Unmarshal(*v, &gatewayHostnameConfigurationContractProperties)
4572				if err != nil {
4573					return err
4574				}
4575				ghcc.GatewayHostnameConfigurationContractProperties = &gatewayHostnameConfigurationContractProperties
4576			}
4577		case "id":
4578			if v != nil {
4579				var ID string
4580				err = json.Unmarshal(*v, &ID)
4581				if err != nil {
4582					return err
4583				}
4584				ghcc.ID = &ID
4585			}
4586		case "name":
4587			if v != nil {
4588				var name string
4589				err = json.Unmarshal(*v, &name)
4590				if err != nil {
4591					return err
4592				}
4593				ghcc.Name = &name
4594			}
4595		case "type":
4596			if v != nil {
4597				var typeVar string
4598				err = json.Unmarshal(*v, &typeVar)
4599				if err != nil {
4600					return err
4601				}
4602				ghcc.Type = &typeVar
4603			}
4604		}
4605	}
4606
4607	return nil
4608}
4609
4610// GatewayHostnameConfigurationContractProperties gateway hostname configuration details.
4611type GatewayHostnameConfigurationContractProperties struct {
4612	// Hostname - Hostname value. Supports valid domain name, partial or full wildcard
4613	Hostname *string `json:"hostname,omitempty"`
4614	// CertificateID - Identifier of Certificate entity that will be used for TLS connection establishment
4615	CertificateID *string `json:"certificateId,omitempty"`
4616	// NegotiateClientCertificate - Determines whether gateway requests client certificate
4617	NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"`
4618}
4619
4620// GatewayKeyRegenerationRequestContract gateway key regeneration request contract properties.
4621type GatewayKeyRegenerationRequestContract struct {
4622	// KeyType - The Key being regenerated. Possible values include: 'Primary', 'Secondary'
4623	KeyType KeyType `json:"keyType,omitempty"`
4624}
4625
4626// GatewayKeysContract gateway authentication keys.
4627type GatewayKeysContract struct {
4628	autorest.Response `json:"-"`
4629	// Primary - Primary gateway key.
4630	Primary *string `json:"primary,omitempty"`
4631	// Secondary - Secondary gateway key.
4632	Secondary *string `json:"secondary,omitempty"`
4633}
4634
4635// GatewayTokenContract gateway access token.
4636type GatewayTokenContract struct {
4637	autorest.Response `json:"-"`
4638	// Value - Shared Access Authentication token value for the Gateway.
4639	Value *string `json:"value,omitempty"`
4640}
4641
4642// GatewayTokenRequestContract gateway token request contract properties.
4643type GatewayTokenRequestContract struct {
4644	// KeyType - The Key to be used to generate gateway token. Possible values include: 'Primary', 'Secondary'
4645	KeyType KeyType `json:"keyType,omitempty"`
4646	// 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.
4647	Expiry *date.Time `json:"expiry,omitempty"`
4648}
4649
4650// GenerateSsoURLResult generate SSO Url operations response details.
4651type GenerateSsoURLResult struct {
4652	autorest.Response `json:"-"`
4653	// Value - Redirect Url containing the SSO URL value.
4654	Value *string `json:"value,omitempty"`
4655}
4656
4657// GroupCollection paged Group list representation.
4658type GroupCollection struct {
4659	autorest.Response `json:"-"`
4660	// Value - Page values.
4661	Value *[]GroupContract `json:"value,omitempty"`
4662	// NextLink - Next page link if any.
4663	NextLink *string `json:"nextLink,omitempty"`
4664}
4665
4666// GroupCollectionIterator provides access to a complete listing of GroupContract values.
4667type GroupCollectionIterator struct {
4668	i    int
4669	page GroupCollectionPage
4670}
4671
4672// NextWithContext advances to the next value.  If there was an error making
4673// the request the iterator does not advance and the error is returned.
4674func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4675	if tracing.IsEnabled() {
4676		ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext")
4677		defer func() {
4678			sc := -1
4679			if iter.Response().Response.Response != nil {
4680				sc = iter.Response().Response.Response.StatusCode
4681			}
4682			tracing.EndSpan(ctx, sc, err)
4683		}()
4684	}
4685	iter.i++
4686	if iter.i < len(iter.page.Values()) {
4687		return nil
4688	}
4689	err = iter.page.NextWithContext(ctx)
4690	if err != nil {
4691		iter.i--
4692		return err
4693	}
4694	iter.i = 0
4695	return nil
4696}
4697
4698// Next advances to the next value.  If there was an error making
4699// the request the iterator does not advance and the error is returned.
4700// Deprecated: Use NextWithContext() instead.
4701func (iter *GroupCollectionIterator) Next() error {
4702	return iter.NextWithContext(context.Background())
4703}
4704
4705// NotDone returns true if the enumeration should be started or is not yet complete.
4706func (iter GroupCollectionIterator) NotDone() bool {
4707	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4708}
4709
4710// Response returns the raw server response from the last page request.
4711func (iter GroupCollectionIterator) Response() GroupCollection {
4712	return iter.page.Response()
4713}
4714
4715// Value returns the current value or a zero-initialized value if the
4716// iterator has advanced beyond the end of the collection.
4717func (iter GroupCollectionIterator) Value() GroupContract {
4718	if !iter.page.NotDone() {
4719		return GroupContract{}
4720	}
4721	return iter.page.Values()[iter.i]
4722}
4723
4724// Creates a new instance of the GroupCollectionIterator type.
4725func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator {
4726	return GroupCollectionIterator{page: page}
4727}
4728
4729// IsEmpty returns true if the ListResult contains no values.
4730func (gc GroupCollection) IsEmpty() bool {
4731	return gc.Value == nil || len(*gc.Value) == 0
4732}
4733
4734// hasNextLink returns true if the NextLink is not empty.
4735func (gc GroupCollection) hasNextLink() bool {
4736	return gc.NextLink != nil && len(*gc.NextLink) != 0
4737}
4738
4739// groupCollectionPreparer prepares a request to retrieve the next set of results.
4740// It returns nil if no more results exist.
4741func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) {
4742	if !gc.hasNextLink() {
4743		return nil, nil
4744	}
4745	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4746		autorest.AsJSON(),
4747		autorest.AsGet(),
4748		autorest.WithBaseURL(to.String(gc.NextLink)))
4749}
4750
4751// GroupCollectionPage contains a page of GroupContract values.
4752type GroupCollectionPage struct {
4753	fn func(context.Context, GroupCollection) (GroupCollection, error)
4754	gc GroupCollection
4755}
4756
4757// NextWithContext advances to the next page of values.  If there was an error making
4758// the request the page does not advance and the error is returned.
4759func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) {
4760	if tracing.IsEnabled() {
4761		ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext")
4762		defer func() {
4763			sc := -1
4764			if page.Response().Response.Response != nil {
4765				sc = page.Response().Response.Response.StatusCode
4766			}
4767			tracing.EndSpan(ctx, sc, err)
4768		}()
4769	}
4770	for {
4771		next, err := page.fn(ctx, page.gc)
4772		if err != nil {
4773			return err
4774		}
4775		page.gc = next
4776		if !next.hasNextLink() || !next.IsEmpty() {
4777			break
4778		}
4779	}
4780	return nil
4781}
4782
4783// Next advances to the next page of values.  If there was an error making
4784// the request the page does not advance and the error is returned.
4785// Deprecated: Use NextWithContext() instead.
4786func (page *GroupCollectionPage) Next() error {
4787	return page.NextWithContext(context.Background())
4788}
4789
4790// NotDone returns true if the page enumeration should be started or is not yet complete.
4791func (page GroupCollectionPage) NotDone() bool {
4792	return !page.gc.IsEmpty()
4793}
4794
4795// Response returns the raw server response from the last page request.
4796func (page GroupCollectionPage) Response() GroupCollection {
4797	return page.gc
4798}
4799
4800// Values returns the slice of values for the current page or nil if there are no values.
4801func (page GroupCollectionPage) Values() []GroupContract {
4802	if page.gc.IsEmpty() {
4803		return nil
4804	}
4805	return *page.gc.Value
4806}
4807
4808// Creates a new instance of the GroupCollectionPage type.
4809func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage {
4810	return GroupCollectionPage{
4811		fn: getNextPage,
4812		gc: cur,
4813	}
4814}
4815
4816// GroupContract contract details.
4817type GroupContract struct {
4818	autorest.Response `json:"-"`
4819	// GroupContractProperties - Group entity contract properties.
4820	*GroupContractProperties `json:"properties,omitempty"`
4821	// ID - READ-ONLY; Resource ID.
4822	ID *string `json:"id,omitempty"`
4823	// Name - READ-ONLY; Resource name.
4824	Name *string `json:"name,omitempty"`
4825	// Type - READ-ONLY; Resource type for API Management resource.
4826	Type *string `json:"type,omitempty"`
4827}
4828
4829// MarshalJSON is the custom marshaler for GroupContract.
4830func (gc GroupContract) MarshalJSON() ([]byte, error) {
4831	objectMap := make(map[string]interface{})
4832	if gc.GroupContractProperties != nil {
4833		objectMap["properties"] = gc.GroupContractProperties
4834	}
4835	return json.Marshal(objectMap)
4836}
4837
4838// UnmarshalJSON is the custom unmarshaler for GroupContract struct.
4839func (gc *GroupContract) UnmarshalJSON(body []byte) error {
4840	var m map[string]*json.RawMessage
4841	err := json.Unmarshal(body, &m)
4842	if err != nil {
4843		return err
4844	}
4845	for k, v := range m {
4846		switch k {
4847		case "properties":
4848			if v != nil {
4849				var groupContractProperties GroupContractProperties
4850				err = json.Unmarshal(*v, &groupContractProperties)
4851				if err != nil {
4852					return err
4853				}
4854				gc.GroupContractProperties = &groupContractProperties
4855			}
4856		case "id":
4857			if v != nil {
4858				var ID string
4859				err = json.Unmarshal(*v, &ID)
4860				if err != nil {
4861					return err
4862				}
4863				gc.ID = &ID
4864			}
4865		case "name":
4866			if v != nil {
4867				var name string
4868				err = json.Unmarshal(*v, &name)
4869				if err != nil {
4870					return err
4871				}
4872				gc.Name = &name
4873			}
4874		case "type":
4875			if v != nil {
4876				var typeVar string
4877				err = json.Unmarshal(*v, &typeVar)
4878				if err != nil {
4879					return err
4880				}
4881				gc.Type = &typeVar
4882			}
4883		}
4884	}
4885
4886	return nil
4887}
4888
4889// GroupContractProperties group contract Properties.
4890type GroupContractProperties struct {
4891	// DisplayName - Group name.
4892	DisplayName *string `json:"displayName,omitempty"`
4893	// Description - Group description. Can contain HTML formatting tags.
4894	Description *string `json:"description,omitempty"`
4895	// BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false.
4896	BuiltIn *bool `json:"builtIn,omitempty"`
4897	// Type - Group type. Possible values include: 'Custom', 'System', 'External'
4898	Type GroupType `json:"type,omitempty"`
4899	// 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.
4900	ExternalID *string `json:"externalId,omitempty"`
4901}
4902
4903// MarshalJSON is the custom marshaler for GroupContractProperties.
4904func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) {
4905	objectMap := make(map[string]interface{})
4906	if gcp.DisplayName != nil {
4907		objectMap["displayName"] = gcp.DisplayName
4908	}
4909	if gcp.Description != nil {
4910		objectMap["description"] = gcp.Description
4911	}
4912	if gcp.Type != "" {
4913		objectMap["type"] = gcp.Type
4914	}
4915	if gcp.ExternalID != nil {
4916		objectMap["externalId"] = gcp.ExternalID
4917	}
4918	return json.Marshal(objectMap)
4919}
4920
4921// GroupCreateParameters parameters supplied to the Create Group operation.
4922type GroupCreateParameters struct {
4923	// GroupCreateParametersProperties - Properties supplied to Create Group operation.
4924	*GroupCreateParametersProperties `json:"properties,omitempty"`
4925}
4926
4927// MarshalJSON is the custom marshaler for GroupCreateParameters.
4928func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) {
4929	objectMap := make(map[string]interface{})
4930	if gcp.GroupCreateParametersProperties != nil {
4931		objectMap["properties"] = gcp.GroupCreateParametersProperties
4932	}
4933	return json.Marshal(objectMap)
4934}
4935
4936// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct.
4937func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error {
4938	var m map[string]*json.RawMessage
4939	err := json.Unmarshal(body, &m)
4940	if err != nil {
4941		return err
4942	}
4943	for k, v := range m {
4944		switch k {
4945		case "properties":
4946			if v != nil {
4947				var groupCreateParametersProperties GroupCreateParametersProperties
4948				err = json.Unmarshal(*v, &groupCreateParametersProperties)
4949				if err != nil {
4950					return err
4951				}
4952				gcp.GroupCreateParametersProperties = &groupCreateParametersProperties
4953			}
4954		}
4955	}
4956
4957	return nil
4958}
4959
4960// GroupCreateParametersProperties parameters supplied to the Create Group operation.
4961type GroupCreateParametersProperties struct {
4962	// DisplayName - Group name.
4963	DisplayName *string `json:"displayName,omitempty"`
4964	// Description - Group description.
4965	Description *string `json:"description,omitempty"`
4966	// Type - Group type. Possible values include: 'Custom', 'System', 'External'
4967	Type GroupType `json:"type,omitempty"`
4968	// 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.
4969	ExternalID *string `json:"externalId,omitempty"`
4970}
4971
4972// GroupUpdateParameters parameters supplied to the Update Group operation.
4973type GroupUpdateParameters struct {
4974	// GroupUpdateParametersProperties - Group entity update contract properties.
4975	*GroupUpdateParametersProperties `json:"properties,omitempty"`
4976}
4977
4978// MarshalJSON is the custom marshaler for GroupUpdateParameters.
4979func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) {
4980	objectMap := make(map[string]interface{})
4981	if gup.GroupUpdateParametersProperties != nil {
4982		objectMap["properties"] = gup.GroupUpdateParametersProperties
4983	}
4984	return json.Marshal(objectMap)
4985}
4986
4987// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct.
4988func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error {
4989	var m map[string]*json.RawMessage
4990	err := json.Unmarshal(body, &m)
4991	if err != nil {
4992		return err
4993	}
4994	for k, v := range m {
4995		switch k {
4996		case "properties":
4997			if v != nil {
4998				var groupUpdateParametersProperties GroupUpdateParametersProperties
4999				err = json.Unmarshal(*v, &groupUpdateParametersProperties)
5000				if err != nil {
5001					return err
5002				}
5003				gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties
5004			}
5005		}
5006	}
5007
5008	return nil
5009}
5010
5011// GroupUpdateParametersProperties parameters supplied to the Update Group operation.
5012type GroupUpdateParametersProperties struct {
5013	// DisplayName - Group name.
5014	DisplayName *string `json:"displayName,omitempty"`
5015	// Description - Group description.
5016	Description *string `json:"description,omitempty"`
5017	// Type - Group type. Possible values include: 'Custom', 'System', 'External'
5018	Type GroupType `json:"type,omitempty"`
5019	// 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.
5020	ExternalID *string `json:"externalId,omitempty"`
5021}
5022
5023// HostnameConfiguration custom hostname configuration.
5024type HostnameConfiguration struct {
5025	// Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal'
5026	Type HostnameType `json:"type,omitempty"`
5027	// HostName - Hostname to configure on the Api Management service.
5028	HostName *string `json:"hostName,omitempty"`
5029	// 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*
5030	KeyVaultID *string `json:"keyVaultId,omitempty"`
5031	// EncodedCertificate - Base64 Encoded certificate.
5032	EncodedCertificate *string `json:"encodedCertificate,omitempty"`
5033	// CertificatePassword - Certificate Password.
5034	CertificatePassword *string `json:"certificatePassword,omitempty"`
5035	// 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.
5036	DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"`
5037	// NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false.
5038	NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"`
5039	// Certificate - Certificate information.
5040	Certificate *CertificateInformation `json:"certificate,omitempty"`
5041}
5042
5043// HTTPMessageDiagnostic http message diagnostic settings.
5044type HTTPMessageDiagnostic struct {
5045	// Headers - Array of HTTP Headers to log.
5046	Headers *[]string `json:"headers,omitempty"`
5047	// Body - Body logging settings.
5048	Body *BodyDiagnosticSettings `json:"body,omitempty"`
5049}
5050
5051// IdentityProviderBaseParameters identity Provider Base Parameter Properties.
5052type IdentityProviderBaseParameters struct {
5053	// Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C'
5054	Type IdentityProviderType `json:"type,omitempty"`
5055	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
5056	SigninTenant *string `json:"signinTenant,omitempty"`
5057	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
5058	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
5059	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
5060	Authority *string `json:"authority,omitempty"`
5061	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
5062	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
5063	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
5064	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
5065	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
5066	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
5067	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
5068	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
5069}
5070
5071// IdentityProviderContract identity Provider details.
5072type IdentityProviderContract struct {
5073	autorest.Response `json:"-"`
5074	// IdentityProviderContractProperties - Identity Provider contract properties.
5075	*IdentityProviderContractProperties `json:"properties,omitempty"`
5076	// ID - READ-ONLY; Resource ID.
5077	ID *string `json:"id,omitempty"`
5078	// Name - READ-ONLY; Resource name.
5079	Name *string `json:"name,omitempty"`
5080	// Type - READ-ONLY; Resource type for API Management resource.
5081	Type *string `json:"type,omitempty"`
5082}
5083
5084// MarshalJSON is the custom marshaler for IdentityProviderContract.
5085func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) {
5086	objectMap := make(map[string]interface{})
5087	if ipc.IdentityProviderContractProperties != nil {
5088		objectMap["properties"] = ipc.IdentityProviderContractProperties
5089	}
5090	return json.Marshal(objectMap)
5091}
5092
5093// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct.
5094func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error {
5095	var m map[string]*json.RawMessage
5096	err := json.Unmarshal(body, &m)
5097	if err != nil {
5098		return err
5099	}
5100	for k, v := range m {
5101		switch k {
5102		case "properties":
5103			if v != nil {
5104				var identityProviderContractProperties IdentityProviderContractProperties
5105				err = json.Unmarshal(*v, &identityProviderContractProperties)
5106				if err != nil {
5107					return err
5108				}
5109				ipc.IdentityProviderContractProperties = &identityProviderContractProperties
5110			}
5111		case "id":
5112			if v != nil {
5113				var ID string
5114				err = json.Unmarshal(*v, &ID)
5115				if err != nil {
5116					return err
5117				}
5118				ipc.ID = &ID
5119			}
5120		case "name":
5121			if v != nil {
5122				var name string
5123				err = json.Unmarshal(*v, &name)
5124				if err != nil {
5125					return err
5126				}
5127				ipc.Name = &name
5128			}
5129		case "type":
5130			if v != nil {
5131				var typeVar string
5132				err = json.Unmarshal(*v, &typeVar)
5133				if err != nil {
5134					return err
5135				}
5136				ipc.Type = &typeVar
5137			}
5138		}
5139	}
5140
5141	return nil
5142}
5143
5144// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft,
5145// Twitter or Azure Active Directory which can be used to enable access to the API Management service
5146// developer portal for all users.
5147type IdentityProviderContractProperties struct {
5148	// 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.
5149	ClientID *string `json:"clientId,omitempty"`
5150	// 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. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
5151	ClientSecret *string `json:"clientSecret,omitempty"`
5152	// Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C'
5153	Type IdentityProviderType `json:"type,omitempty"`
5154	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
5155	SigninTenant *string `json:"signinTenant,omitempty"`
5156	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
5157	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
5158	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
5159	Authority *string `json:"authority,omitempty"`
5160	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
5161	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
5162	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
5163	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
5164	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
5165	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
5166	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
5167	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
5168}
5169
5170// IdentityProviderCreateContract identity Provider details.
5171type IdentityProviderCreateContract struct {
5172	// IdentityProviderCreateContractProperties - Identity Provider contract properties.
5173	*IdentityProviderCreateContractProperties `json:"properties,omitempty"`
5174	// ID - READ-ONLY; Resource ID.
5175	ID *string `json:"id,omitempty"`
5176	// Name - READ-ONLY; Resource name.
5177	Name *string `json:"name,omitempty"`
5178	// Type - READ-ONLY; Resource type for API Management resource.
5179	Type *string `json:"type,omitempty"`
5180}
5181
5182// MarshalJSON is the custom marshaler for IdentityProviderCreateContract.
5183func (ipcc IdentityProviderCreateContract) MarshalJSON() ([]byte, error) {
5184	objectMap := make(map[string]interface{})
5185	if ipcc.IdentityProviderCreateContractProperties != nil {
5186		objectMap["properties"] = ipcc.IdentityProviderCreateContractProperties
5187	}
5188	return json.Marshal(objectMap)
5189}
5190
5191// UnmarshalJSON is the custom unmarshaler for IdentityProviderCreateContract struct.
5192func (ipcc *IdentityProviderCreateContract) UnmarshalJSON(body []byte) error {
5193	var m map[string]*json.RawMessage
5194	err := json.Unmarshal(body, &m)
5195	if err != nil {
5196		return err
5197	}
5198	for k, v := range m {
5199		switch k {
5200		case "properties":
5201			if v != nil {
5202				var identityProviderCreateContractProperties IdentityProviderCreateContractProperties
5203				err = json.Unmarshal(*v, &identityProviderCreateContractProperties)
5204				if err != nil {
5205					return err
5206				}
5207				ipcc.IdentityProviderCreateContractProperties = &identityProviderCreateContractProperties
5208			}
5209		case "id":
5210			if v != nil {
5211				var ID string
5212				err = json.Unmarshal(*v, &ID)
5213				if err != nil {
5214					return err
5215				}
5216				ipcc.ID = &ID
5217			}
5218		case "name":
5219			if v != nil {
5220				var name string
5221				err = json.Unmarshal(*v, &name)
5222				if err != nil {
5223					return err
5224				}
5225				ipcc.Name = &name
5226			}
5227		case "type":
5228			if v != nil {
5229				var typeVar string
5230				err = json.Unmarshal(*v, &typeVar)
5231				if err != nil {
5232					return err
5233				}
5234				ipcc.Type = &typeVar
5235			}
5236		}
5237	}
5238
5239	return nil
5240}
5241
5242// IdentityProviderCreateContractProperties the external Identity Providers like Facebook, Google,
5243// Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management
5244// service developer portal for all users.
5245type IdentityProviderCreateContractProperties struct {
5246	// 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.
5247	ClientID *string `json:"clientId,omitempty"`
5248	// 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. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
5249	ClientSecret *string `json:"clientSecret,omitempty"`
5250	// Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C'
5251	Type IdentityProviderType `json:"type,omitempty"`
5252	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
5253	SigninTenant *string `json:"signinTenant,omitempty"`
5254	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
5255	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
5256	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
5257	Authority *string `json:"authority,omitempty"`
5258	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
5259	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
5260	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
5261	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
5262	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
5263	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
5264	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
5265	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
5266}
5267
5268// IdentityProviderList list of all the Identity Providers configured on the service instance.
5269type IdentityProviderList struct {
5270	autorest.Response `json:"-"`
5271	// Value - Identity Provider configuration values.
5272	Value *[]IdentityProviderContract `json:"value,omitempty"`
5273	// NextLink - Next page link if any.
5274	NextLink *string `json:"nextLink,omitempty"`
5275}
5276
5277// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values.
5278type IdentityProviderListIterator struct {
5279	i    int
5280	page IdentityProviderListPage
5281}
5282
5283// NextWithContext advances to the next value.  If there was an error making
5284// the request the iterator does not advance and the error is returned.
5285func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) {
5286	if tracing.IsEnabled() {
5287		ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext")
5288		defer func() {
5289			sc := -1
5290			if iter.Response().Response.Response != nil {
5291				sc = iter.Response().Response.Response.StatusCode
5292			}
5293			tracing.EndSpan(ctx, sc, err)
5294		}()
5295	}
5296	iter.i++
5297	if iter.i < len(iter.page.Values()) {
5298		return nil
5299	}
5300	err = iter.page.NextWithContext(ctx)
5301	if err != nil {
5302		iter.i--
5303		return err
5304	}
5305	iter.i = 0
5306	return nil
5307}
5308
5309// Next advances to the next value.  If there was an error making
5310// the request the iterator does not advance and the error is returned.
5311// Deprecated: Use NextWithContext() instead.
5312func (iter *IdentityProviderListIterator) Next() error {
5313	return iter.NextWithContext(context.Background())
5314}
5315
5316// NotDone returns true if the enumeration should be started or is not yet complete.
5317func (iter IdentityProviderListIterator) NotDone() bool {
5318	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5319}
5320
5321// Response returns the raw server response from the last page request.
5322func (iter IdentityProviderListIterator) Response() IdentityProviderList {
5323	return iter.page.Response()
5324}
5325
5326// Value returns the current value or a zero-initialized value if the
5327// iterator has advanced beyond the end of the collection.
5328func (iter IdentityProviderListIterator) Value() IdentityProviderContract {
5329	if !iter.page.NotDone() {
5330		return IdentityProviderContract{}
5331	}
5332	return iter.page.Values()[iter.i]
5333}
5334
5335// Creates a new instance of the IdentityProviderListIterator type.
5336func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator {
5337	return IdentityProviderListIterator{page: page}
5338}
5339
5340// IsEmpty returns true if the ListResult contains no values.
5341func (ipl IdentityProviderList) IsEmpty() bool {
5342	return ipl.Value == nil || len(*ipl.Value) == 0
5343}
5344
5345// hasNextLink returns true if the NextLink is not empty.
5346func (ipl IdentityProviderList) hasNextLink() bool {
5347	return ipl.NextLink != nil && len(*ipl.NextLink) != 0
5348}
5349
5350// identityProviderListPreparer prepares a request to retrieve the next set of results.
5351// It returns nil if no more results exist.
5352func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) {
5353	if !ipl.hasNextLink() {
5354		return nil, nil
5355	}
5356	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5357		autorest.AsJSON(),
5358		autorest.AsGet(),
5359		autorest.WithBaseURL(to.String(ipl.NextLink)))
5360}
5361
5362// IdentityProviderListPage contains a page of IdentityProviderContract values.
5363type IdentityProviderListPage struct {
5364	fn  func(context.Context, IdentityProviderList) (IdentityProviderList, error)
5365	ipl IdentityProviderList
5366}
5367
5368// NextWithContext advances to the next page of values.  If there was an error making
5369// the request the page does not advance and the error is returned.
5370func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) {
5371	if tracing.IsEnabled() {
5372		ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext")
5373		defer func() {
5374			sc := -1
5375			if page.Response().Response.Response != nil {
5376				sc = page.Response().Response.Response.StatusCode
5377			}
5378			tracing.EndSpan(ctx, sc, err)
5379		}()
5380	}
5381	for {
5382		next, err := page.fn(ctx, page.ipl)
5383		if err != nil {
5384			return err
5385		}
5386		page.ipl = next
5387		if !next.hasNextLink() || !next.IsEmpty() {
5388			break
5389		}
5390	}
5391	return nil
5392}
5393
5394// Next advances to the next page of values.  If there was an error making
5395// the request the page does not advance and the error is returned.
5396// Deprecated: Use NextWithContext() instead.
5397func (page *IdentityProviderListPage) Next() error {
5398	return page.NextWithContext(context.Background())
5399}
5400
5401// NotDone returns true if the page enumeration should be started or is not yet complete.
5402func (page IdentityProviderListPage) NotDone() bool {
5403	return !page.ipl.IsEmpty()
5404}
5405
5406// Response returns the raw server response from the last page request.
5407func (page IdentityProviderListPage) Response() IdentityProviderList {
5408	return page.ipl
5409}
5410
5411// Values returns the slice of values for the current page or nil if there are no values.
5412func (page IdentityProviderListPage) Values() []IdentityProviderContract {
5413	if page.ipl.IsEmpty() {
5414		return nil
5415	}
5416	return *page.ipl.Value
5417}
5418
5419// Creates a new instance of the IdentityProviderListPage type.
5420func NewIdentityProviderListPage(cur IdentityProviderList, getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage {
5421	return IdentityProviderListPage{
5422		fn:  getNextPage,
5423		ipl: cur,
5424	}
5425}
5426
5427// IdentityProviderUpdateParameters parameters supplied to update Identity Provider
5428type IdentityProviderUpdateParameters struct {
5429	// IdentityProviderUpdateProperties - Identity Provider update properties.
5430	*IdentityProviderUpdateProperties `json:"properties,omitempty"`
5431}
5432
5433// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters.
5434func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) {
5435	objectMap := make(map[string]interface{})
5436	if ipup.IdentityProviderUpdateProperties != nil {
5437		objectMap["properties"] = ipup.IdentityProviderUpdateProperties
5438	}
5439	return json.Marshal(objectMap)
5440}
5441
5442// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct.
5443func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error {
5444	var m map[string]*json.RawMessage
5445	err := json.Unmarshal(body, &m)
5446	if err != nil {
5447		return err
5448	}
5449	for k, v := range m {
5450		switch k {
5451		case "properties":
5452			if v != nil {
5453				var identityProviderUpdateProperties IdentityProviderUpdateProperties
5454				err = json.Unmarshal(*v, &identityProviderUpdateProperties)
5455				if err != nil {
5456					return err
5457				}
5458				ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties
5459			}
5460		}
5461	}
5462
5463	return nil
5464}
5465
5466// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation.
5467type IdentityProviderUpdateProperties struct {
5468	// 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.
5469	ClientID *string `json:"clientId,omitempty"`
5470	// 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.
5471	ClientSecret *string `json:"clientSecret,omitempty"`
5472	// Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C'
5473	Type IdentityProviderType `json:"type,omitempty"`
5474	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
5475	SigninTenant *string `json:"signinTenant,omitempty"`
5476	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
5477	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
5478	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
5479	Authority *string `json:"authority,omitempty"`
5480	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
5481	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
5482	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
5483	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
5484	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
5485	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
5486	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
5487	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
5488}
5489
5490// IssueAttachmentCollection paged Issue Attachment list representation.
5491type IssueAttachmentCollection struct {
5492	autorest.Response `json:"-"`
5493	// Value - READ-ONLY; Issue Attachment values.
5494	Value *[]IssueAttachmentContract `json:"value,omitempty"`
5495	// NextLink - READ-ONLY; Next page link if any.
5496	NextLink *string `json:"nextLink,omitempty"`
5497}
5498
5499// MarshalJSON is the custom marshaler for IssueAttachmentCollection.
5500func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) {
5501	objectMap := make(map[string]interface{})
5502	return json.Marshal(objectMap)
5503}
5504
5505// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract
5506// values.
5507type IssueAttachmentCollectionIterator struct {
5508	i    int
5509	page IssueAttachmentCollectionPage
5510}
5511
5512// NextWithContext advances to the next value.  If there was an error making
5513// the request the iterator does not advance and the error is returned.
5514func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5515	if tracing.IsEnabled() {
5516		ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext")
5517		defer func() {
5518			sc := -1
5519			if iter.Response().Response.Response != nil {
5520				sc = iter.Response().Response.Response.StatusCode
5521			}
5522			tracing.EndSpan(ctx, sc, err)
5523		}()
5524	}
5525	iter.i++
5526	if iter.i < len(iter.page.Values()) {
5527		return nil
5528	}
5529	err = iter.page.NextWithContext(ctx)
5530	if err != nil {
5531		iter.i--
5532		return err
5533	}
5534	iter.i = 0
5535	return nil
5536}
5537
5538// Next advances to the next value.  If there was an error making
5539// the request the iterator does not advance and the error is returned.
5540// Deprecated: Use NextWithContext() instead.
5541func (iter *IssueAttachmentCollectionIterator) Next() error {
5542	return iter.NextWithContext(context.Background())
5543}
5544
5545// NotDone returns true if the enumeration should be started or is not yet complete.
5546func (iter IssueAttachmentCollectionIterator) NotDone() bool {
5547	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5548}
5549
5550// Response returns the raw server response from the last page request.
5551func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection {
5552	return iter.page.Response()
5553}
5554
5555// Value returns the current value or a zero-initialized value if the
5556// iterator has advanced beyond the end of the collection.
5557func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract {
5558	if !iter.page.NotDone() {
5559		return IssueAttachmentContract{}
5560	}
5561	return iter.page.Values()[iter.i]
5562}
5563
5564// Creates a new instance of the IssueAttachmentCollectionIterator type.
5565func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator {
5566	return IssueAttachmentCollectionIterator{page: page}
5567}
5568
5569// IsEmpty returns true if the ListResult contains no values.
5570func (iac IssueAttachmentCollection) IsEmpty() bool {
5571	return iac.Value == nil || len(*iac.Value) == 0
5572}
5573
5574// hasNextLink returns true if the NextLink is not empty.
5575func (iac IssueAttachmentCollection) hasNextLink() bool {
5576	return iac.NextLink != nil && len(*iac.NextLink) != 0
5577}
5578
5579// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results.
5580// It returns nil if no more results exist.
5581func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) {
5582	if !iac.hasNextLink() {
5583		return nil, nil
5584	}
5585	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5586		autorest.AsJSON(),
5587		autorest.AsGet(),
5588		autorest.WithBaseURL(to.String(iac.NextLink)))
5589}
5590
5591// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values.
5592type IssueAttachmentCollectionPage struct {
5593	fn  func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)
5594	iac IssueAttachmentCollection
5595}
5596
5597// NextWithContext advances to the next page of values.  If there was an error making
5598// the request the page does not advance and the error is returned.
5599func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) {
5600	if tracing.IsEnabled() {
5601		ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext")
5602		defer func() {
5603			sc := -1
5604			if page.Response().Response.Response != nil {
5605				sc = page.Response().Response.Response.StatusCode
5606			}
5607			tracing.EndSpan(ctx, sc, err)
5608		}()
5609	}
5610	for {
5611		next, err := page.fn(ctx, page.iac)
5612		if err != nil {
5613			return err
5614		}
5615		page.iac = next
5616		if !next.hasNextLink() || !next.IsEmpty() {
5617			break
5618		}
5619	}
5620	return nil
5621}
5622
5623// Next advances to the next page of values.  If there was an error making
5624// the request the page does not advance and the error is returned.
5625// Deprecated: Use NextWithContext() instead.
5626func (page *IssueAttachmentCollectionPage) Next() error {
5627	return page.NextWithContext(context.Background())
5628}
5629
5630// NotDone returns true if the page enumeration should be started or is not yet complete.
5631func (page IssueAttachmentCollectionPage) NotDone() bool {
5632	return !page.iac.IsEmpty()
5633}
5634
5635// Response returns the raw server response from the last page request.
5636func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection {
5637	return page.iac
5638}
5639
5640// Values returns the slice of values for the current page or nil if there are no values.
5641func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract {
5642	if page.iac.IsEmpty() {
5643		return nil
5644	}
5645	return *page.iac.Value
5646}
5647
5648// Creates a new instance of the IssueAttachmentCollectionPage type.
5649func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage {
5650	return IssueAttachmentCollectionPage{
5651		fn:  getNextPage,
5652		iac: cur,
5653	}
5654}
5655
5656// IssueAttachmentContract issue Attachment Contract details.
5657type IssueAttachmentContract struct {
5658	autorest.Response `json:"-"`
5659	// IssueAttachmentContractProperties - Properties of the Issue Attachment.
5660	*IssueAttachmentContractProperties `json:"properties,omitempty"`
5661	// ID - READ-ONLY; Resource ID.
5662	ID *string `json:"id,omitempty"`
5663	// Name - READ-ONLY; Resource name.
5664	Name *string `json:"name,omitempty"`
5665	// Type - READ-ONLY; Resource type for API Management resource.
5666	Type *string `json:"type,omitempty"`
5667}
5668
5669// MarshalJSON is the custom marshaler for IssueAttachmentContract.
5670func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) {
5671	objectMap := make(map[string]interface{})
5672	if iac.IssueAttachmentContractProperties != nil {
5673		objectMap["properties"] = iac.IssueAttachmentContractProperties
5674	}
5675	return json.Marshal(objectMap)
5676}
5677
5678// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct.
5679func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error {
5680	var m map[string]*json.RawMessage
5681	err := json.Unmarshal(body, &m)
5682	if err != nil {
5683		return err
5684	}
5685	for k, v := range m {
5686		switch k {
5687		case "properties":
5688			if v != nil {
5689				var issueAttachmentContractProperties IssueAttachmentContractProperties
5690				err = json.Unmarshal(*v, &issueAttachmentContractProperties)
5691				if err != nil {
5692					return err
5693				}
5694				iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties
5695			}
5696		case "id":
5697			if v != nil {
5698				var ID string
5699				err = json.Unmarshal(*v, &ID)
5700				if err != nil {
5701					return err
5702				}
5703				iac.ID = &ID
5704			}
5705		case "name":
5706			if v != nil {
5707				var name string
5708				err = json.Unmarshal(*v, &name)
5709				if err != nil {
5710					return err
5711				}
5712				iac.Name = &name
5713			}
5714		case "type":
5715			if v != nil {
5716				var typeVar string
5717				err = json.Unmarshal(*v, &typeVar)
5718				if err != nil {
5719					return err
5720				}
5721				iac.Type = &typeVar
5722			}
5723		}
5724	}
5725
5726	return nil
5727}
5728
5729// IssueAttachmentContractProperties issue Attachment contract Properties.
5730type IssueAttachmentContractProperties struct {
5731	// Title - Filename by which the binary data will be saved.
5732	Title *string `json:"title,omitempty"`
5733	// 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.
5734	ContentFormat *string `json:"contentFormat,omitempty"`
5735	// Content - An HTTP link or Base64-encoded binary data.
5736	Content *string `json:"content,omitempty"`
5737}
5738
5739// IssueCollection paged Issue list representation.
5740type IssueCollection struct {
5741	autorest.Response `json:"-"`
5742	// Value - READ-ONLY; Issue values.
5743	Value *[]IssueContract `json:"value,omitempty"`
5744	// NextLink - READ-ONLY; Next page link if any.
5745	NextLink *string `json:"nextLink,omitempty"`
5746}
5747
5748// MarshalJSON is the custom marshaler for IssueCollection.
5749func (ic IssueCollection) MarshalJSON() ([]byte, error) {
5750	objectMap := make(map[string]interface{})
5751	return json.Marshal(objectMap)
5752}
5753
5754// IssueCollectionIterator provides access to a complete listing of IssueContract values.
5755type IssueCollectionIterator struct {
5756	i    int
5757	page IssueCollectionPage
5758}
5759
5760// NextWithContext advances to the next value.  If there was an error making
5761// the request the iterator does not advance and the error is returned.
5762func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5763	if tracing.IsEnabled() {
5764		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext")
5765		defer func() {
5766			sc := -1
5767			if iter.Response().Response.Response != nil {
5768				sc = iter.Response().Response.Response.StatusCode
5769			}
5770			tracing.EndSpan(ctx, sc, err)
5771		}()
5772	}
5773	iter.i++
5774	if iter.i < len(iter.page.Values()) {
5775		return nil
5776	}
5777	err = iter.page.NextWithContext(ctx)
5778	if err != nil {
5779		iter.i--
5780		return err
5781	}
5782	iter.i = 0
5783	return nil
5784}
5785
5786// Next advances to the next value.  If there was an error making
5787// the request the iterator does not advance and the error is returned.
5788// Deprecated: Use NextWithContext() instead.
5789func (iter *IssueCollectionIterator) Next() error {
5790	return iter.NextWithContext(context.Background())
5791}
5792
5793// NotDone returns true if the enumeration should be started or is not yet complete.
5794func (iter IssueCollectionIterator) NotDone() bool {
5795	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5796}
5797
5798// Response returns the raw server response from the last page request.
5799func (iter IssueCollectionIterator) Response() IssueCollection {
5800	return iter.page.Response()
5801}
5802
5803// Value returns the current value or a zero-initialized value if the
5804// iterator has advanced beyond the end of the collection.
5805func (iter IssueCollectionIterator) Value() IssueContract {
5806	if !iter.page.NotDone() {
5807		return IssueContract{}
5808	}
5809	return iter.page.Values()[iter.i]
5810}
5811
5812// Creates a new instance of the IssueCollectionIterator type.
5813func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator {
5814	return IssueCollectionIterator{page: page}
5815}
5816
5817// IsEmpty returns true if the ListResult contains no values.
5818func (ic IssueCollection) IsEmpty() bool {
5819	return ic.Value == nil || len(*ic.Value) == 0
5820}
5821
5822// hasNextLink returns true if the NextLink is not empty.
5823func (ic IssueCollection) hasNextLink() bool {
5824	return ic.NextLink != nil && len(*ic.NextLink) != 0
5825}
5826
5827// issueCollectionPreparer prepares a request to retrieve the next set of results.
5828// It returns nil if no more results exist.
5829func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) {
5830	if !ic.hasNextLink() {
5831		return nil, nil
5832	}
5833	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5834		autorest.AsJSON(),
5835		autorest.AsGet(),
5836		autorest.WithBaseURL(to.String(ic.NextLink)))
5837}
5838
5839// IssueCollectionPage contains a page of IssueContract values.
5840type IssueCollectionPage struct {
5841	fn func(context.Context, IssueCollection) (IssueCollection, error)
5842	ic IssueCollection
5843}
5844
5845// NextWithContext advances to the next page of values.  If there was an error making
5846// the request the page does not advance and the error is returned.
5847func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) {
5848	if tracing.IsEnabled() {
5849		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext")
5850		defer func() {
5851			sc := -1
5852			if page.Response().Response.Response != nil {
5853				sc = page.Response().Response.Response.StatusCode
5854			}
5855			tracing.EndSpan(ctx, sc, err)
5856		}()
5857	}
5858	for {
5859		next, err := page.fn(ctx, page.ic)
5860		if err != nil {
5861			return err
5862		}
5863		page.ic = next
5864		if !next.hasNextLink() || !next.IsEmpty() {
5865			break
5866		}
5867	}
5868	return nil
5869}
5870
5871// Next advances to the next page of values.  If there was an error making
5872// the request the page does not advance and the error is returned.
5873// Deprecated: Use NextWithContext() instead.
5874func (page *IssueCollectionPage) Next() error {
5875	return page.NextWithContext(context.Background())
5876}
5877
5878// NotDone returns true if the page enumeration should be started or is not yet complete.
5879func (page IssueCollectionPage) NotDone() bool {
5880	return !page.ic.IsEmpty()
5881}
5882
5883// Response returns the raw server response from the last page request.
5884func (page IssueCollectionPage) Response() IssueCollection {
5885	return page.ic
5886}
5887
5888// Values returns the slice of values for the current page or nil if there are no values.
5889func (page IssueCollectionPage) Values() []IssueContract {
5890	if page.ic.IsEmpty() {
5891		return nil
5892	}
5893	return *page.ic.Value
5894}
5895
5896// Creates a new instance of the IssueCollectionPage type.
5897func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage {
5898	return IssueCollectionPage{
5899		fn: getNextPage,
5900		ic: cur,
5901	}
5902}
5903
5904// IssueCommentCollection paged Issue Comment list representation.
5905type IssueCommentCollection struct {
5906	autorest.Response `json:"-"`
5907	// Value - READ-ONLY; Issue Comment values.
5908	Value *[]IssueCommentContract `json:"value,omitempty"`
5909	// NextLink - READ-ONLY; Next page link if any.
5910	NextLink *string `json:"nextLink,omitempty"`
5911}
5912
5913// MarshalJSON is the custom marshaler for IssueCommentCollection.
5914func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) {
5915	objectMap := make(map[string]interface{})
5916	return json.Marshal(objectMap)
5917}
5918
5919// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values.
5920type IssueCommentCollectionIterator struct {
5921	i    int
5922	page IssueCommentCollectionPage
5923}
5924
5925// NextWithContext advances to the next value.  If there was an error making
5926// the request the iterator does not advance and the error is returned.
5927func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5928	if tracing.IsEnabled() {
5929		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext")
5930		defer func() {
5931			sc := -1
5932			if iter.Response().Response.Response != nil {
5933				sc = iter.Response().Response.Response.StatusCode
5934			}
5935			tracing.EndSpan(ctx, sc, err)
5936		}()
5937	}
5938	iter.i++
5939	if iter.i < len(iter.page.Values()) {
5940		return nil
5941	}
5942	err = iter.page.NextWithContext(ctx)
5943	if err != nil {
5944		iter.i--
5945		return err
5946	}
5947	iter.i = 0
5948	return nil
5949}
5950
5951// Next advances to the next value.  If there was an error making
5952// the request the iterator does not advance and the error is returned.
5953// Deprecated: Use NextWithContext() instead.
5954func (iter *IssueCommentCollectionIterator) Next() error {
5955	return iter.NextWithContext(context.Background())
5956}
5957
5958// NotDone returns true if the enumeration should be started or is not yet complete.
5959func (iter IssueCommentCollectionIterator) NotDone() bool {
5960	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5961}
5962
5963// Response returns the raw server response from the last page request.
5964func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection {
5965	return iter.page.Response()
5966}
5967
5968// Value returns the current value or a zero-initialized value if the
5969// iterator has advanced beyond the end of the collection.
5970func (iter IssueCommentCollectionIterator) Value() IssueCommentContract {
5971	if !iter.page.NotDone() {
5972		return IssueCommentContract{}
5973	}
5974	return iter.page.Values()[iter.i]
5975}
5976
5977// Creates a new instance of the IssueCommentCollectionIterator type.
5978func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator {
5979	return IssueCommentCollectionIterator{page: page}
5980}
5981
5982// IsEmpty returns true if the ListResult contains no values.
5983func (icc IssueCommentCollection) IsEmpty() bool {
5984	return icc.Value == nil || len(*icc.Value) == 0
5985}
5986
5987// hasNextLink returns true if the NextLink is not empty.
5988func (icc IssueCommentCollection) hasNextLink() bool {
5989	return icc.NextLink != nil && len(*icc.NextLink) != 0
5990}
5991
5992// issueCommentCollectionPreparer prepares a request to retrieve the next set of results.
5993// It returns nil if no more results exist.
5994func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) {
5995	if !icc.hasNextLink() {
5996		return nil, nil
5997	}
5998	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5999		autorest.AsJSON(),
6000		autorest.AsGet(),
6001		autorest.WithBaseURL(to.String(icc.NextLink)))
6002}
6003
6004// IssueCommentCollectionPage contains a page of IssueCommentContract values.
6005type IssueCommentCollectionPage struct {
6006	fn  func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)
6007	icc IssueCommentCollection
6008}
6009
6010// NextWithContext advances to the next page of values.  If there was an error making
6011// the request the page does not advance and the error is returned.
6012func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) {
6013	if tracing.IsEnabled() {
6014		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext")
6015		defer func() {
6016			sc := -1
6017			if page.Response().Response.Response != nil {
6018				sc = page.Response().Response.Response.StatusCode
6019			}
6020			tracing.EndSpan(ctx, sc, err)
6021		}()
6022	}
6023	for {
6024		next, err := page.fn(ctx, page.icc)
6025		if err != nil {
6026			return err
6027		}
6028		page.icc = next
6029		if !next.hasNextLink() || !next.IsEmpty() {
6030			break
6031		}
6032	}
6033	return nil
6034}
6035
6036// Next advances to the next page of values.  If there was an error making
6037// the request the page does not advance and the error is returned.
6038// Deprecated: Use NextWithContext() instead.
6039func (page *IssueCommentCollectionPage) Next() error {
6040	return page.NextWithContext(context.Background())
6041}
6042
6043// NotDone returns true if the page enumeration should be started or is not yet complete.
6044func (page IssueCommentCollectionPage) NotDone() bool {
6045	return !page.icc.IsEmpty()
6046}
6047
6048// Response returns the raw server response from the last page request.
6049func (page IssueCommentCollectionPage) Response() IssueCommentCollection {
6050	return page.icc
6051}
6052
6053// Values returns the slice of values for the current page or nil if there are no values.
6054func (page IssueCommentCollectionPage) Values() []IssueCommentContract {
6055	if page.icc.IsEmpty() {
6056		return nil
6057	}
6058	return *page.icc.Value
6059}
6060
6061// Creates a new instance of the IssueCommentCollectionPage type.
6062func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage {
6063	return IssueCommentCollectionPage{
6064		fn:  getNextPage,
6065		icc: cur,
6066	}
6067}
6068
6069// IssueCommentContract issue Comment Contract details.
6070type IssueCommentContract struct {
6071	autorest.Response `json:"-"`
6072	// IssueCommentContractProperties - Properties of the Issue Comment.
6073	*IssueCommentContractProperties `json:"properties,omitempty"`
6074	// ID - READ-ONLY; Resource ID.
6075	ID *string `json:"id,omitempty"`
6076	// Name - READ-ONLY; Resource name.
6077	Name *string `json:"name,omitempty"`
6078	// Type - READ-ONLY; Resource type for API Management resource.
6079	Type *string `json:"type,omitempty"`
6080}
6081
6082// MarshalJSON is the custom marshaler for IssueCommentContract.
6083func (icc IssueCommentContract) MarshalJSON() ([]byte, error) {
6084	objectMap := make(map[string]interface{})
6085	if icc.IssueCommentContractProperties != nil {
6086		objectMap["properties"] = icc.IssueCommentContractProperties
6087	}
6088	return json.Marshal(objectMap)
6089}
6090
6091// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct.
6092func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error {
6093	var m map[string]*json.RawMessage
6094	err := json.Unmarshal(body, &m)
6095	if err != nil {
6096		return err
6097	}
6098	for k, v := range m {
6099		switch k {
6100		case "properties":
6101			if v != nil {
6102				var issueCommentContractProperties IssueCommentContractProperties
6103				err = json.Unmarshal(*v, &issueCommentContractProperties)
6104				if err != nil {
6105					return err
6106				}
6107				icc.IssueCommentContractProperties = &issueCommentContractProperties
6108			}
6109		case "id":
6110			if v != nil {
6111				var ID string
6112				err = json.Unmarshal(*v, &ID)
6113				if err != nil {
6114					return err
6115				}
6116				icc.ID = &ID
6117			}
6118		case "name":
6119			if v != nil {
6120				var name string
6121				err = json.Unmarshal(*v, &name)
6122				if err != nil {
6123					return err
6124				}
6125				icc.Name = &name
6126			}
6127		case "type":
6128			if v != nil {
6129				var typeVar string
6130				err = json.Unmarshal(*v, &typeVar)
6131				if err != nil {
6132					return err
6133				}
6134				icc.Type = &typeVar
6135			}
6136		}
6137	}
6138
6139	return nil
6140}
6141
6142// IssueCommentContractProperties issue Comment contract Properties.
6143type IssueCommentContractProperties struct {
6144	// Text - Comment text.
6145	Text *string `json:"text,omitempty"`
6146	// CreatedDate - Date and time when the comment was created.
6147	CreatedDate *date.Time `json:"createdDate,omitempty"`
6148	// UserID - A resource identifier for the user who left the comment.
6149	UserID *string `json:"userId,omitempty"`
6150}
6151
6152// IssueContract issue Contract details.
6153type IssueContract struct {
6154	autorest.Response `json:"-"`
6155	// IssueContractProperties - Properties of the Issue.
6156	*IssueContractProperties `json:"properties,omitempty"`
6157	// ID - READ-ONLY; Resource ID.
6158	ID *string `json:"id,omitempty"`
6159	// Name - READ-ONLY; Resource name.
6160	Name *string `json:"name,omitempty"`
6161	// Type - READ-ONLY; Resource type for API Management resource.
6162	Type *string `json:"type,omitempty"`
6163}
6164
6165// MarshalJSON is the custom marshaler for IssueContract.
6166func (ic IssueContract) MarshalJSON() ([]byte, error) {
6167	objectMap := make(map[string]interface{})
6168	if ic.IssueContractProperties != nil {
6169		objectMap["properties"] = ic.IssueContractProperties
6170	}
6171	return json.Marshal(objectMap)
6172}
6173
6174// UnmarshalJSON is the custom unmarshaler for IssueContract struct.
6175func (ic *IssueContract) UnmarshalJSON(body []byte) error {
6176	var m map[string]*json.RawMessage
6177	err := json.Unmarshal(body, &m)
6178	if err != nil {
6179		return err
6180	}
6181	for k, v := range m {
6182		switch k {
6183		case "properties":
6184			if v != nil {
6185				var issueContractProperties IssueContractProperties
6186				err = json.Unmarshal(*v, &issueContractProperties)
6187				if err != nil {
6188					return err
6189				}
6190				ic.IssueContractProperties = &issueContractProperties
6191			}
6192		case "id":
6193			if v != nil {
6194				var ID string
6195				err = json.Unmarshal(*v, &ID)
6196				if err != nil {
6197					return err
6198				}
6199				ic.ID = &ID
6200			}
6201		case "name":
6202			if v != nil {
6203				var name string
6204				err = json.Unmarshal(*v, &name)
6205				if err != nil {
6206					return err
6207				}
6208				ic.Name = &name
6209			}
6210		case "type":
6211			if v != nil {
6212				var typeVar string
6213				err = json.Unmarshal(*v, &typeVar)
6214				if err != nil {
6215					return err
6216				}
6217				ic.Type = &typeVar
6218			}
6219		}
6220	}
6221
6222	return nil
6223}
6224
6225// IssueContractBaseProperties issue contract Base Properties.
6226type IssueContractBaseProperties struct {
6227	// CreatedDate - Date and time when the issue was created.
6228	CreatedDate *date.Time `json:"createdDate,omitempty"`
6229	// State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed'
6230	State State `json:"state,omitempty"`
6231	// APIID - A resource identifier for the API the issue was created for.
6232	APIID *string `json:"apiId,omitempty"`
6233}
6234
6235// IssueContractProperties issue contract Properties.
6236type IssueContractProperties struct {
6237	// Title - The issue title.
6238	Title *string `json:"title,omitempty"`
6239	// Description - Text describing the issue.
6240	Description *string `json:"description,omitempty"`
6241	// UserID - A resource identifier for the user created the issue.
6242	UserID *string `json:"userId,omitempty"`
6243	// CreatedDate - Date and time when the issue was created.
6244	CreatedDate *date.Time `json:"createdDate,omitempty"`
6245	// State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed'
6246	State State `json:"state,omitempty"`
6247	// APIID - A resource identifier for the API the issue was created for.
6248	APIID *string `json:"apiId,omitempty"`
6249}
6250
6251// IssueUpdateContract issue update Parameters.
6252type IssueUpdateContract struct {
6253	// IssueUpdateContractProperties - Issue entity Update contract properties.
6254	*IssueUpdateContractProperties `json:"properties,omitempty"`
6255}
6256
6257// MarshalJSON is the custom marshaler for IssueUpdateContract.
6258func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) {
6259	objectMap := make(map[string]interface{})
6260	if iuc.IssueUpdateContractProperties != nil {
6261		objectMap["properties"] = iuc.IssueUpdateContractProperties
6262	}
6263	return json.Marshal(objectMap)
6264}
6265
6266// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct.
6267func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error {
6268	var m map[string]*json.RawMessage
6269	err := json.Unmarshal(body, &m)
6270	if err != nil {
6271		return err
6272	}
6273	for k, v := range m {
6274		switch k {
6275		case "properties":
6276			if v != nil {
6277				var issueUpdateContractProperties IssueUpdateContractProperties
6278				err = json.Unmarshal(*v, &issueUpdateContractProperties)
6279				if err != nil {
6280					return err
6281				}
6282				iuc.IssueUpdateContractProperties = &issueUpdateContractProperties
6283			}
6284		}
6285	}
6286
6287	return nil
6288}
6289
6290// IssueUpdateContractProperties issue contract Update Properties.
6291type IssueUpdateContractProperties struct {
6292	// Title - The issue title.
6293	Title *string `json:"title,omitempty"`
6294	// Description - Text describing the issue.
6295	Description *string `json:"description,omitempty"`
6296	// UserID - A resource identifier for the user created the issue.
6297	UserID *string `json:"userId,omitempty"`
6298	// CreatedDate - Date and time when the issue was created.
6299	CreatedDate *date.Time `json:"createdDate,omitempty"`
6300	// State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed'
6301	State State `json:"state,omitempty"`
6302	// APIID - A resource identifier for the API the issue was created for.
6303	APIID *string `json:"apiId,omitempty"`
6304}
6305
6306// ListNetworkStatusContractByLocation ...
6307type ListNetworkStatusContractByLocation struct {
6308	autorest.Response `json:"-"`
6309	Value             *[]NetworkStatusContractByLocation `json:"value,omitempty"`
6310}
6311
6312// LoggerCollection paged Logger list representation.
6313type LoggerCollection struct {
6314	autorest.Response `json:"-"`
6315	// Value - Logger values.
6316	Value *[]LoggerContract `json:"value,omitempty"`
6317	// Count - Total record count number across all pages.
6318	Count *int64 `json:"count,omitempty"`
6319	// NextLink - Next page link if any.
6320	NextLink *string `json:"nextLink,omitempty"`
6321}
6322
6323// LoggerCollectionIterator provides access to a complete listing of LoggerContract values.
6324type LoggerCollectionIterator struct {
6325	i    int
6326	page LoggerCollectionPage
6327}
6328
6329// NextWithContext advances to the next value.  If there was an error making
6330// the request the iterator does not advance and the error is returned.
6331func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) {
6332	if tracing.IsEnabled() {
6333		ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext")
6334		defer func() {
6335			sc := -1
6336			if iter.Response().Response.Response != nil {
6337				sc = iter.Response().Response.Response.StatusCode
6338			}
6339			tracing.EndSpan(ctx, sc, err)
6340		}()
6341	}
6342	iter.i++
6343	if iter.i < len(iter.page.Values()) {
6344		return nil
6345	}
6346	err = iter.page.NextWithContext(ctx)
6347	if err != nil {
6348		iter.i--
6349		return err
6350	}
6351	iter.i = 0
6352	return nil
6353}
6354
6355// Next advances to the next value.  If there was an error making
6356// the request the iterator does not advance and the error is returned.
6357// Deprecated: Use NextWithContext() instead.
6358func (iter *LoggerCollectionIterator) Next() error {
6359	return iter.NextWithContext(context.Background())
6360}
6361
6362// NotDone returns true if the enumeration should be started or is not yet complete.
6363func (iter LoggerCollectionIterator) NotDone() bool {
6364	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6365}
6366
6367// Response returns the raw server response from the last page request.
6368func (iter LoggerCollectionIterator) Response() LoggerCollection {
6369	return iter.page.Response()
6370}
6371
6372// Value returns the current value or a zero-initialized value if the
6373// iterator has advanced beyond the end of the collection.
6374func (iter LoggerCollectionIterator) Value() LoggerContract {
6375	if !iter.page.NotDone() {
6376		return LoggerContract{}
6377	}
6378	return iter.page.Values()[iter.i]
6379}
6380
6381// Creates a new instance of the LoggerCollectionIterator type.
6382func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator {
6383	return LoggerCollectionIterator{page: page}
6384}
6385
6386// IsEmpty returns true if the ListResult contains no values.
6387func (lc LoggerCollection) IsEmpty() bool {
6388	return lc.Value == nil || len(*lc.Value) == 0
6389}
6390
6391// hasNextLink returns true if the NextLink is not empty.
6392func (lc LoggerCollection) hasNextLink() bool {
6393	return lc.NextLink != nil && len(*lc.NextLink) != 0
6394}
6395
6396// loggerCollectionPreparer prepares a request to retrieve the next set of results.
6397// It returns nil if no more results exist.
6398func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) {
6399	if !lc.hasNextLink() {
6400		return nil, nil
6401	}
6402	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6403		autorest.AsJSON(),
6404		autorest.AsGet(),
6405		autorest.WithBaseURL(to.String(lc.NextLink)))
6406}
6407
6408// LoggerCollectionPage contains a page of LoggerContract values.
6409type LoggerCollectionPage struct {
6410	fn func(context.Context, LoggerCollection) (LoggerCollection, error)
6411	lc LoggerCollection
6412}
6413
6414// NextWithContext advances to the next page of values.  If there was an error making
6415// the request the page does not advance and the error is returned.
6416func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) {
6417	if tracing.IsEnabled() {
6418		ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext")
6419		defer func() {
6420			sc := -1
6421			if page.Response().Response.Response != nil {
6422				sc = page.Response().Response.Response.StatusCode
6423			}
6424			tracing.EndSpan(ctx, sc, err)
6425		}()
6426	}
6427	for {
6428		next, err := page.fn(ctx, page.lc)
6429		if err != nil {
6430			return err
6431		}
6432		page.lc = next
6433		if !next.hasNextLink() || !next.IsEmpty() {
6434			break
6435		}
6436	}
6437	return nil
6438}
6439
6440// Next advances to the next page of values.  If there was an error making
6441// the request the page does not advance and the error is returned.
6442// Deprecated: Use NextWithContext() instead.
6443func (page *LoggerCollectionPage) Next() error {
6444	return page.NextWithContext(context.Background())
6445}
6446
6447// NotDone returns true if the page enumeration should be started or is not yet complete.
6448func (page LoggerCollectionPage) NotDone() bool {
6449	return !page.lc.IsEmpty()
6450}
6451
6452// Response returns the raw server response from the last page request.
6453func (page LoggerCollectionPage) Response() LoggerCollection {
6454	return page.lc
6455}
6456
6457// Values returns the slice of values for the current page or nil if there are no values.
6458func (page LoggerCollectionPage) Values() []LoggerContract {
6459	if page.lc.IsEmpty() {
6460		return nil
6461	}
6462	return *page.lc.Value
6463}
6464
6465// Creates a new instance of the LoggerCollectionPage type.
6466func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage {
6467	return LoggerCollectionPage{
6468		fn: getNextPage,
6469		lc: cur,
6470	}
6471}
6472
6473// LoggerContract logger details.
6474type LoggerContract struct {
6475	autorest.Response `json:"-"`
6476	// LoggerContractProperties - Logger entity contract properties.
6477	*LoggerContractProperties `json:"properties,omitempty"`
6478	// ID - READ-ONLY; Resource ID.
6479	ID *string `json:"id,omitempty"`
6480	// Name - READ-ONLY; Resource name.
6481	Name *string `json:"name,omitempty"`
6482	// Type - READ-ONLY; Resource type for API Management resource.
6483	Type *string `json:"type,omitempty"`
6484}
6485
6486// MarshalJSON is the custom marshaler for LoggerContract.
6487func (lc LoggerContract) MarshalJSON() ([]byte, error) {
6488	objectMap := make(map[string]interface{})
6489	if lc.LoggerContractProperties != nil {
6490		objectMap["properties"] = lc.LoggerContractProperties
6491	}
6492	return json.Marshal(objectMap)
6493}
6494
6495// UnmarshalJSON is the custom unmarshaler for LoggerContract struct.
6496func (lc *LoggerContract) UnmarshalJSON(body []byte) error {
6497	var m map[string]*json.RawMessage
6498	err := json.Unmarshal(body, &m)
6499	if err != nil {
6500		return err
6501	}
6502	for k, v := range m {
6503		switch k {
6504		case "properties":
6505			if v != nil {
6506				var loggerContractProperties LoggerContractProperties
6507				err = json.Unmarshal(*v, &loggerContractProperties)
6508				if err != nil {
6509					return err
6510				}
6511				lc.LoggerContractProperties = &loggerContractProperties
6512			}
6513		case "id":
6514			if v != nil {
6515				var ID string
6516				err = json.Unmarshal(*v, &ID)
6517				if err != nil {
6518					return err
6519				}
6520				lc.ID = &ID
6521			}
6522		case "name":
6523			if v != nil {
6524				var name string
6525				err = json.Unmarshal(*v, &name)
6526				if err != nil {
6527					return err
6528				}
6529				lc.Name = &name
6530			}
6531		case "type":
6532			if v != nil {
6533				var typeVar string
6534				err = json.Unmarshal(*v, &typeVar)
6535				if err != nil {
6536					return err
6537				}
6538				lc.Type = &typeVar
6539			}
6540		}
6541	}
6542
6543	return nil
6544}
6545
6546// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use
6547// to log API Management events. Currently the Logger entity supports logging API Management events to
6548// Azure Event Hubs.
6549type LoggerContractProperties struct {
6550	// LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights'
6551	LoggerType LoggerType `json:"loggerType,omitempty"`
6552	// Description - Logger description.
6553	Description *string `json:"description,omitempty"`
6554	// Credentials - The name and SendRule connection string of the event hub for azureEventHub logger.
6555	// Instrumentation key for applicationInsights logger.
6556	Credentials map[string]*string `json:"credentials"`
6557	// IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true.
6558	IsBuffered *bool `json:"isBuffered,omitempty"`
6559	// ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
6560	ResourceID *string `json:"resourceId,omitempty"`
6561}
6562
6563// MarshalJSON is the custom marshaler for LoggerContractProperties.
6564func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) {
6565	objectMap := make(map[string]interface{})
6566	if lcp.LoggerType != "" {
6567		objectMap["loggerType"] = lcp.LoggerType
6568	}
6569	if lcp.Description != nil {
6570		objectMap["description"] = lcp.Description
6571	}
6572	if lcp.Credentials != nil {
6573		objectMap["credentials"] = lcp.Credentials
6574	}
6575	if lcp.IsBuffered != nil {
6576		objectMap["isBuffered"] = lcp.IsBuffered
6577	}
6578	if lcp.ResourceID != nil {
6579		objectMap["resourceId"] = lcp.ResourceID
6580	}
6581	return json.Marshal(objectMap)
6582}
6583
6584// LoggerUpdateContract logger update contract.
6585type LoggerUpdateContract struct {
6586	// LoggerUpdateParameters - Logger entity update contract properties.
6587	*LoggerUpdateParameters `json:"properties,omitempty"`
6588}
6589
6590// MarshalJSON is the custom marshaler for LoggerUpdateContract.
6591func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) {
6592	objectMap := make(map[string]interface{})
6593	if luc.LoggerUpdateParameters != nil {
6594		objectMap["properties"] = luc.LoggerUpdateParameters
6595	}
6596	return json.Marshal(objectMap)
6597}
6598
6599// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct.
6600func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error {
6601	var m map[string]*json.RawMessage
6602	err := json.Unmarshal(body, &m)
6603	if err != nil {
6604		return err
6605	}
6606	for k, v := range m {
6607		switch k {
6608		case "properties":
6609			if v != nil {
6610				var loggerUpdateParameters LoggerUpdateParameters
6611				err = json.Unmarshal(*v, &loggerUpdateParameters)
6612				if err != nil {
6613					return err
6614				}
6615				luc.LoggerUpdateParameters = &loggerUpdateParameters
6616			}
6617		}
6618	}
6619
6620	return nil
6621}
6622
6623// LoggerUpdateParameters parameters supplied to the Update Logger operation.
6624type LoggerUpdateParameters struct {
6625	// LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights'
6626	LoggerType LoggerType `json:"loggerType,omitempty"`
6627	// Description - Logger description.
6628	Description *string `json:"description,omitempty"`
6629	// Credentials - Logger credentials.
6630	Credentials map[string]*string `json:"credentials"`
6631	// IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true.
6632	IsBuffered *bool `json:"isBuffered,omitempty"`
6633}
6634
6635// MarshalJSON is the custom marshaler for LoggerUpdateParameters.
6636func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) {
6637	objectMap := make(map[string]interface{})
6638	if lup.LoggerType != "" {
6639		objectMap["loggerType"] = lup.LoggerType
6640	}
6641	if lup.Description != nil {
6642		objectMap["description"] = lup.Description
6643	}
6644	if lup.Credentials != nil {
6645		objectMap["credentials"] = lup.Credentials
6646	}
6647	if lup.IsBuffered != nil {
6648		objectMap["isBuffered"] = lup.IsBuffered
6649	}
6650	return json.Marshal(objectMap)
6651}
6652
6653// NamedValueCollection paged NamedValue list representation.
6654type NamedValueCollection struct {
6655	autorest.Response `json:"-"`
6656	// Value - Page values.
6657	Value *[]NamedValueContract `json:"value,omitempty"`
6658	// NextLink - Next page link if any.
6659	NextLink *string `json:"nextLink,omitempty"`
6660}
6661
6662// NamedValueCollectionIterator provides access to a complete listing of NamedValueContract values.
6663type NamedValueCollectionIterator struct {
6664	i    int
6665	page NamedValueCollectionPage
6666}
6667
6668// NextWithContext advances to the next value.  If there was an error making
6669// the request the iterator does not advance and the error is returned.
6670func (iter *NamedValueCollectionIterator) NextWithContext(ctx context.Context) (err error) {
6671	if tracing.IsEnabled() {
6672		ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionIterator.NextWithContext")
6673		defer func() {
6674			sc := -1
6675			if iter.Response().Response.Response != nil {
6676				sc = iter.Response().Response.Response.StatusCode
6677			}
6678			tracing.EndSpan(ctx, sc, err)
6679		}()
6680	}
6681	iter.i++
6682	if iter.i < len(iter.page.Values()) {
6683		return nil
6684	}
6685	err = iter.page.NextWithContext(ctx)
6686	if err != nil {
6687		iter.i--
6688		return err
6689	}
6690	iter.i = 0
6691	return nil
6692}
6693
6694// Next advances to the next value.  If there was an error making
6695// the request the iterator does not advance and the error is returned.
6696// Deprecated: Use NextWithContext() instead.
6697func (iter *NamedValueCollectionIterator) Next() error {
6698	return iter.NextWithContext(context.Background())
6699}
6700
6701// NotDone returns true if the enumeration should be started or is not yet complete.
6702func (iter NamedValueCollectionIterator) NotDone() bool {
6703	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6704}
6705
6706// Response returns the raw server response from the last page request.
6707func (iter NamedValueCollectionIterator) Response() NamedValueCollection {
6708	return iter.page.Response()
6709}
6710
6711// Value returns the current value or a zero-initialized value if the
6712// iterator has advanced beyond the end of the collection.
6713func (iter NamedValueCollectionIterator) Value() NamedValueContract {
6714	if !iter.page.NotDone() {
6715		return NamedValueContract{}
6716	}
6717	return iter.page.Values()[iter.i]
6718}
6719
6720// Creates a new instance of the NamedValueCollectionIterator type.
6721func NewNamedValueCollectionIterator(page NamedValueCollectionPage) NamedValueCollectionIterator {
6722	return NamedValueCollectionIterator{page: page}
6723}
6724
6725// IsEmpty returns true if the ListResult contains no values.
6726func (nvc NamedValueCollection) IsEmpty() bool {
6727	return nvc.Value == nil || len(*nvc.Value) == 0
6728}
6729
6730// hasNextLink returns true if the NextLink is not empty.
6731func (nvc NamedValueCollection) hasNextLink() bool {
6732	return nvc.NextLink != nil && len(*nvc.NextLink) != 0
6733}
6734
6735// namedValueCollectionPreparer prepares a request to retrieve the next set of results.
6736// It returns nil if no more results exist.
6737func (nvc NamedValueCollection) namedValueCollectionPreparer(ctx context.Context) (*http.Request, error) {
6738	if !nvc.hasNextLink() {
6739		return nil, nil
6740	}
6741	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6742		autorest.AsJSON(),
6743		autorest.AsGet(),
6744		autorest.WithBaseURL(to.String(nvc.NextLink)))
6745}
6746
6747// NamedValueCollectionPage contains a page of NamedValueContract values.
6748type NamedValueCollectionPage struct {
6749	fn  func(context.Context, NamedValueCollection) (NamedValueCollection, error)
6750	nvc NamedValueCollection
6751}
6752
6753// NextWithContext advances to the next page of values.  If there was an error making
6754// the request the page does not advance and the error is returned.
6755func (page *NamedValueCollectionPage) NextWithContext(ctx context.Context) (err error) {
6756	if tracing.IsEnabled() {
6757		ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionPage.NextWithContext")
6758		defer func() {
6759			sc := -1
6760			if page.Response().Response.Response != nil {
6761				sc = page.Response().Response.Response.StatusCode
6762			}
6763			tracing.EndSpan(ctx, sc, err)
6764		}()
6765	}
6766	for {
6767		next, err := page.fn(ctx, page.nvc)
6768		if err != nil {
6769			return err
6770		}
6771		page.nvc = next
6772		if !next.hasNextLink() || !next.IsEmpty() {
6773			break
6774		}
6775	}
6776	return nil
6777}
6778
6779// Next advances to the next page of values.  If there was an error making
6780// the request the page does not advance and the error is returned.
6781// Deprecated: Use NextWithContext() instead.
6782func (page *NamedValueCollectionPage) Next() error {
6783	return page.NextWithContext(context.Background())
6784}
6785
6786// NotDone returns true if the page enumeration should be started or is not yet complete.
6787func (page NamedValueCollectionPage) NotDone() bool {
6788	return !page.nvc.IsEmpty()
6789}
6790
6791// Response returns the raw server response from the last page request.
6792func (page NamedValueCollectionPage) Response() NamedValueCollection {
6793	return page.nvc
6794}
6795
6796// Values returns the slice of values for the current page or nil if there are no values.
6797func (page NamedValueCollectionPage) Values() []NamedValueContract {
6798	if page.nvc.IsEmpty() {
6799		return nil
6800	}
6801	return *page.nvc.Value
6802}
6803
6804// Creates a new instance of the NamedValueCollectionPage type.
6805func NewNamedValueCollectionPage(cur NamedValueCollection, getNextPage func(context.Context, NamedValueCollection) (NamedValueCollection, error)) NamedValueCollectionPage {
6806	return NamedValueCollectionPage{
6807		fn:  getNextPage,
6808		nvc: cur,
6809	}
6810}
6811
6812// NamedValueContract namedValue details.
6813type NamedValueContract struct {
6814	autorest.Response `json:"-"`
6815	// NamedValueContractProperties - NamedValue entity contract properties.
6816	*NamedValueContractProperties `json:"properties,omitempty"`
6817	// ID - READ-ONLY; Resource ID.
6818	ID *string `json:"id,omitempty"`
6819	// Name - READ-ONLY; Resource name.
6820	Name *string `json:"name,omitempty"`
6821	// Type - READ-ONLY; Resource type for API Management resource.
6822	Type *string `json:"type,omitempty"`
6823}
6824
6825// MarshalJSON is the custom marshaler for NamedValueContract.
6826func (nvc NamedValueContract) MarshalJSON() ([]byte, error) {
6827	objectMap := make(map[string]interface{})
6828	if nvc.NamedValueContractProperties != nil {
6829		objectMap["properties"] = nvc.NamedValueContractProperties
6830	}
6831	return json.Marshal(objectMap)
6832}
6833
6834// UnmarshalJSON is the custom unmarshaler for NamedValueContract struct.
6835func (nvc *NamedValueContract) UnmarshalJSON(body []byte) error {
6836	var m map[string]*json.RawMessage
6837	err := json.Unmarshal(body, &m)
6838	if err != nil {
6839		return err
6840	}
6841	for k, v := range m {
6842		switch k {
6843		case "properties":
6844			if v != nil {
6845				var namedValueContractProperties NamedValueContractProperties
6846				err = json.Unmarshal(*v, &namedValueContractProperties)
6847				if err != nil {
6848					return err
6849				}
6850				nvc.NamedValueContractProperties = &namedValueContractProperties
6851			}
6852		case "id":
6853			if v != nil {
6854				var ID string
6855				err = json.Unmarshal(*v, &ID)
6856				if err != nil {
6857					return err
6858				}
6859				nvc.ID = &ID
6860			}
6861		case "name":
6862			if v != nil {
6863				var name string
6864				err = json.Unmarshal(*v, &name)
6865				if err != nil {
6866					return err
6867				}
6868				nvc.Name = &name
6869			}
6870		case "type":
6871			if v != nil {
6872				var typeVar string
6873				err = json.Unmarshal(*v, &typeVar)
6874				if err != nil {
6875					return err
6876				}
6877				nvc.Type = &typeVar
6878			}
6879		}
6880	}
6881
6882	return nil
6883}
6884
6885// NamedValueContractProperties namedValue Contract properties.
6886type NamedValueContractProperties struct {
6887	// DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
6888	DisplayName *string `json:"displayName,omitempty"`
6889	// Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
6890	Value *string `json:"value,omitempty"`
6891	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
6892	Tags *[]string `json:"tags,omitempty"`
6893	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
6894	Secret *bool `json:"secret,omitempty"`
6895}
6896
6897// NamedValueCreateContract namedValue details.
6898type NamedValueCreateContract struct {
6899	// NamedValueCreateContractProperties - NamedValue entity contract properties for PUT operation.
6900	*NamedValueCreateContractProperties `json:"properties,omitempty"`
6901	// ID - READ-ONLY; Resource ID.
6902	ID *string `json:"id,omitempty"`
6903	// Name - READ-ONLY; Resource name.
6904	Name *string `json:"name,omitempty"`
6905	// Type - READ-ONLY; Resource type for API Management resource.
6906	Type *string `json:"type,omitempty"`
6907}
6908
6909// MarshalJSON is the custom marshaler for NamedValueCreateContract.
6910func (nvcc NamedValueCreateContract) MarshalJSON() ([]byte, error) {
6911	objectMap := make(map[string]interface{})
6912	if nvcc.NamedValueCreateContractProperties != nil {
6913		objectMap["properties"] = nvcc.NamedValueCreateContractProperties
6914	}
6915	return json.Marshal(objectMap)
6916}
6917
6918// UnmarshalJSON is the custom unmarshaler for NamedValueCreateContract struct.
6919func (nvcc *NamedValueCreateContract) UnmarshalJSON(body []byte) error {
6920	var m map[string]*json.RawMessage
6921	err := json.Unmarshal(body, &m)
6922	if err != nil {
6923		return err
6924	}
6925	for k, v := range m {
6926		switch k {
6927		case "properties":
6928			if v != nil {
6929				var namedValueCreateContractProperties NamedValueCreateContractProperties
6930				err = json.Unmarshal(*v, &namedValueCreateContractProperties)
6931				if err != nil {
6932					return err
6933				}
6934				nvcc.NamedValueCreateContractProperties = &namedValueCreateContractProperties
6935			}
6936		case "id":
6937			if v != nil {
6938				var ID string
6939				err = json.Unmarshal(*v, &ID)
6940				if err != nil {
6941					return err
6942				}
6943				nvcc.ID = &ID
6944			}
6945		case "name":
6946			if v != nil {
6947				var name string
6948				err = json.Unmarshal(*v, &name)
6949				if err != nil {
6950					return err
6951				}
6952				nvcc.Name = &name
6953			}
6954		case "type":
6955			if v != nil {
6956				var typeVar string
6957				err = json.Unmarshal(*v, &typeVar)
6958				if err != nil {
6959					return err
6960				}
6961				nvcc.Type = &typeVar
6962			}
6963		}
6964	}
6965
6966	return nil
6967}
6968
6969// NamedValueCreateContractProperties namedValue Contract properties.
6970type NamedValueCreateContractProperties struct {
6971	// DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
6972	DisplayName *string `json:"displayName,omitempty"`
6973	// Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
6974	Value *string `json:"value,omitempty"`
6975	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
6976	Tags *[]string `json:"tags,omitempty"`
6977	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
6978	Secret *bool `json:"secret,omitempty"`
6979}
6980
6981// NamedValueCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
6982// long-running operation.
6983type NamedValueCreateOrUpdateFuture struct {
6984	azure.FutureAPI
6985	// Result returns the result of the asynchronous operation.
6986	// If the operation has not completed it will return an error.
6987	Result func(NamedValueClient) (NamedValueContract, error)
6988}
6989
6990// UnmarshalJSON is the custom unmarshaller for CreateFuture.
6991func (future *NamedValueCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
6992	var azFuture azure.Future
6993	if err := json.Unmarshal(body, &azFuture); err != nil {
6994		return err
6995	}
6996	future.FutureAPI = &azFuture
6997	future.Result = future.result
6998	return nil
6999}
7000
7001// result is the default implementation for NamedValueCreateOrUpdateFuture.Result.
7002func (future *NamedValueCreateOrUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) {
7003	var done bool
7004	done, err = future.DoneWithContext(context.Background(), client)
7005	if err != nil {
7006		err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
7007		return
7008	}
7009	if !done {
7010		nvc.Response.Response = future.Response()
7011		err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueCreateOrUpdateFuture")
7012		return
7013	}
7014	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7015	if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent {
7016		nvc, err = client.CreateOrUpdateResponder(nvc.Response.Response)
7017		if err != nil {
7018			err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request")
7019		}
7020	}
7021	return
7022}
7023
7024// NamedValueEntityBaseParameters namedValue Entity Base Parameters set.
7025type NamedValueEntityBaseParameters struct {
7026	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
7027	Tags *[]string `json:"tags,omitempty"`
7028	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
7029	Secret *bool `json:"secret,omitempty"`
7030}
7031
7032// NamedValueUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
7033// operation.
7034type NamedValueUpdateFuture struct {
7035	azure.FutureAPI
7036	// Result returns the result of the asynchronous operation.
7037	// If the operation has not completed it will return an error.
7038	Result func(NamedValueClient) (NamedValueContract, error)
7039}
7040
7041// UnmarshalJSON is the custom unmarshaller for CreateFuture.
7042func (future *NamedValueUpdateFuture) UnmarshalJSON(body []byte) error {
7043	var azFuture azure.Future
7044	if err := json.Unmarshal(body, &azFuture); err != nil {
7045		return err
7046	}
7047	future.FutureAPI = &azFuture
7048	future.Result = future.result
7049	return nil
7050}
7051
7052// result is the default implementation for NamedValueUpdateFuture.Result.
7053func (future *NamedValueUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) {
7054	var done bool
7055	done, err = future.DoneWithContext(context.Background(), client)
7056	if err != nil {
7057		err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", future.Response(), "Polling failure")
7058		return
7059	}
7060	if !done {
7061		nvc.Response.Response = future.Response()
7062		err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueUpdateFuture")
7063		return
7064	}
7065	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
7066	if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent {
7067		nvc, err = client.UpdateResponder(nvc.Response.Response)
7068		if err != nil {
7069			err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request")
7070		}
7071	}
7072	return
7073}
7074
7075// NamedValueUpdateParameterProperties namedValue Contract properties.
7076type NamedValueUpdateParameterProperties struct {
7077	// DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
7078	DisplayName *string `json:"displayName,omitempty"`
7079	// Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace.
7080	Value *string `json:"value,omitempty"`
7081	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
7082	Tags *[]string `json:"tags,omitempty"`
7083	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
7084	Secret *bool `json:"secret,omitempty"`
7085}
7086
7087// NamedValueUpdateParameters namedValue update Parameters.
7088type NamedValueUpdateParameters struct {
7089	// NamedValueUpdateParameterProperties - NamedValue entity Update contract properties.
7090	*NamedValueUpdateParameterProperties `json:"properties,omitempty"`
7091}
7092
7093// MarshalJSON is the custom marshaler for NamedValueUpdateParameters.
7094func (nvup NamedValueUpdateParameters) MarshalJSON() ([]byte, error) {
7095	objectMap := make(map[string]interface{})
7096	if nvup.NamedValueUpdateParameterProperties != nil {
7097		objectMap["properties"] = nvup.NamedValueUpdateParameterProperties
7098	}
7099	return json.Marshal(objectMap)
7100}
7101
7102// UnmarshalJSON is the custom unmarshaler for NamedValueUpdateParameters struct.
7103func (nvup *NamedValueUpdateParameters) UnmarshalJSON(body []byte) error {
7104	var m map[string]*json.RawMessage
7105	err := json.Unmarshal(body, &m)
7106	if err != nil {
7107		return err
7108	}
7109	for k, v := range m {
7110		switch k {
7111		case "properties":
7112			if v != nil {
7113				var namedValueUpdateParameterProperties NamedValueUpdateParameterProperties
7114				err = json.Unmarshal(*v, &namedValueUpdateParameterProperties)
7115				if err != nil {
7116					return err
7117				}
7118				nvup.NamedValueUpdateParameterProperties = &namedValueUpdateParameterProperties
7119			}
7120		}
7121	}
7122
7123	return nil
7124}
7125
7126// NetworkStatusContract network Status details.
7127type NetworkStatusContract struct {
7128	autorest.Response `json:"-"`
7129	// DNSServers - Gets the list of DNS servers IPV4 addresses.
7130	DNSServers *[]string `json:"dnsServers,omitempty"`
7131	// ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon.
7132	ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"`
7133}
7134
7135// NetworkStatusContractByLocation network Status in the Location
7136type NetworkStatusContractByLocation struct {
7137	// Location - Location of service
7138	Location *string `json:"location,omitempty"`
7139	// NetworkStatus - Network status in Location
7140	NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"`
7141}
7142
7143// NotificationCollection paged Notification list representation.
7144type NotificationCollection struct {
7145	autorest.Response `json:"-"`
7146	// Value - Page values.
7147	Value *[]NotificationContract `json:"value,omitempty"`
7148	// NextLink - Next page link if any.
7149	NextLink *string `json:"nextLink,omitempty"`
7150}
7151
7152// NotificationCollectionIterator provides access to a complete listing of NotificationContract values.
7153type NotificationCollectionIterator struct {
7154	i    int
7155	page NotificationCollectionPage
7156}
7157
7158// NextWithContext advances to the next value.  If there was an error making
7159// the request the iterator does not advance and the error is returned.
7160func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7161	if tracing.IsEnabled() {
7162		ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext")
7163		defer func() {
7164			sc := -1
7165			if iter.Response().Response.Response != nil {
7166				sc = iter.Response().Response.Response.StatusCode
7167			}
7168			tracing.EndSpan(ctx, sc, err)
7169		}()
7170	}
7171	iter.i++
7172	if iter.i < len(iter.page.Values()) {
7173		return nil
7174	}
7175	err = iter.page.NextWithContext(ctx)
7176	if err != nil {
7177		iter.i--
7178		return err
7179	}
7180	iter.i = 0
7181	return nil
7182}
7183
7184// Next advances to the next value.  If there was an error making
7185// the request the iterator does not advance and the error is returned.
7186// Deprecated: Use NextWithContext() instead.
7187func (iter *NotificationCollectionIterator) Next() error {
7188	return iter.NextWithContext(context.Background())
7189}
7190
7191// NotDone returns true if the enumeration should be started or is not yet complete.
7192func (iter NotificationCollectionIterator) NotDone() bool {
7193	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7194}
7195
7196// Response returns the raw server response from the last page request.
7197func (iter NotificationCollectionIterator) Response() NotificationCollection {
7198	return iter.page.Response()
7199}
7200
7201// Value returns the current value or a zero-initialized value if the
7202// iterator has advanced beyond the end of the collection.
7203func (iter NotificationCollectionIterator) Value() NotificationContract {
7204	if !iter.page.NotDone() {
7205		return NotificationContract{}
7206	}
7207	return iter.page.Values()[iter.i]
7208}
7209
7210// Creates a new instance of the NotificationCollectionIterator type.
7211func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator {
7212	return NotificationCollectionIterator{page: page}
7213}
7214
7215// IsEmpty returns true if the ListResult contains no values.
7216func (nc NotificationCollection) IsEmpty() bool {
7217	return nc.Value == nil || len(*nc.Value) == 0
7218}
7219
7220// hasNextLink returns true if the NextLink is not empty.
7221func (nc NotificationCollection) hasNextLink() bool {
7222	return nc.NextLink != nil && len(*nc.NextLink) != 0
7223}
7224
7225// notificationCollectionPreparer prepares a request to retrieve the next set of results.
7226// It returns nil if no more results exist.
7227func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) {
7228	if !nc.hasNextLink() {
7229		return nil, nil
7230	}
7231	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7232		autorest.AsJSON(),
7233		autorest.AsGet(),
7234		autorest.WithBaseURL(to.String(nc.NextLink)))
7235}
7236
7237// NotificationCollectionPage contains a page of NotificationContract values.
7238type NotificationCollectionPage struct {
7239	fn func(context.Context, NotificationCollection) (NotificationCollection, error)
7240	nc NotificationCollection
7241}
7242
7243// NextWithContext advances to the next page of values.  If there was an error making
7244// the request the page does not advance and the error is returned.
7245func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) {
7246	if tracing.IsEnabled() {
7247		ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext")
7248		defer func() {
7249			sc := -1
7250			if page.Response().Response.Response != nil {
7251				sc = page.Response().Response.Response.StatusCode
7252			}
7253			tracing.EndSpan(ctx, sc, err)
7254		}()
7255	}
7256	for {
7257		next, err := page.fn(ctx, page.nc)
7258		if err != nil {
7259			return err
7260		}
7261		page.nc = next
7262		if !next.hasNextLink() || !next.IsEmpty() {
7263			break
7264		}
7265	}
7266	return nil
7267}
7268
7269// Next advances to the next page of values.  If there was an error making
7270// the request the page does not advance and the error is returned.
7271// Deprecated: Use NextWithContext() instead.
7272func (page *NotificationCollectionPage) Next() error {
7273	return page.NextWithContext(context.Background())
7274}
7275
7276// NotDone returns true if the page enumeration should be started or is not yet complete.
7277func (page NotificationCollectionPage) NotDone() bool {
7278	return !page.nc.IsEmpty()
7279}
7280
7281// Response returns the raw server response from the last page request.
7282func (page NotificationCollectionPage) Response() NotificationCollection {
7283	return page.nc
7284}
7285
7286// Values returns the slice of values for the current page or nil if there are no values.
7287func (page NotificationCollectionPage) Values() []NotificationContract {
7288	if page.nc.IsEmpty() {
7289		return nil
7290	}
7291	return *page.nc.Value
7292}
7293
7294// Creates a new instance of the NotificationCollectionPage type.
7295func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage {
7296	return NotificationCollectionPage{
7297		fn: getNextPage,
7298		nc: cur,
7299	}
7300}
7301
7302// NotificationContract notification details.
7303type NotificationContract struct {
7304	autorest.Response `json:"-"`
7305	// NotificationContractProperties - Notification entity contract properties.
7306	*NotificationContractProperties `json:"properties,omitempty"`
7307	// ID - READ-ONLY; Resource ID.
7308	ID *string `json:"id,omitempty"`
7309	// Name - READ-ONLY; Resource name.
7310	Name *string `json:"name,omitempty"`
7311	// Type - READ-ONLY; Resource type for API Management resource.
7312	Type *string `json:"type,omitempty"`
7313}
7314
7315// MarshalJSON is the custom marshaler for NotificationContract.
7316func (nc NotificationContract) MarshalJSON() ([]byte, error) {
7317	objectMap := make(map[string]interface{})
7318	if nc.NotificationContractProperties != nil {
7319		objectMap["properties"] = nc.NotificationContractProperties
7320	}
7321	return json.Marshal(objectMap)
7322}
7323
7324// UnmarshalJSON is the custom unmarshaler for NotificationContract struct.
7325func (nc *NotificationContract) UnmarshalJSON(body []byte) error {
7326	var m map[string]*json.RawMessage
7327	err := json.Unmarshal(body, &m)
7328	if err != nil {
7329		return err
7330	}
7331	for k, v := range m {
7332		switch k {
7333		case "properties":
7334			if v != nil {
7335				var notificationContractProperties NotificationContractProperties
7336				err = json.Unmarshal(*v, &notificationContractProperties)
7337				if err != nil {
7338					return err
7339				}
7340				nc.NotificationContractProperties = &notificationContractProperties
7341			}
7342		case "id":
7343			if v != nil {
7344				var ID string
7345				err = json.Unmarshal(*v, &ID)
7346				if err != nil {
7347					return err
7348				}
7349				nc.ID = &ID
7350			}
7351		case "name":
7352			if v != nil {
7353				var name string
7354				err = json.Unmarshal(*v, &name)
7355				if err != nil {
7356					return err
7357				}
7358				nc.Name = &name
7359			}
7360		case "type":
7361			if v != nil {
7362				var typeVar string
7363				err = json.Unmarshal(*v, &typeVar)
7364				if err != nil {
7365					return err
7366				}
7367				nc.Type = &typeVar
7368			}
7369		}
7370	}
7371
7372	return nil
7373}
7374
7375// NotificationContractProperties notification Contract properties.
7376type NotificationContractProperties struct {
7377	// Title - Title of the Notification.
7378	Title *string `json:"title,omitempty"`
7379	// Description - Description of the Notification.
7380	Description *string `json:"description,omitempty"`
7381	// Recipients - Recipient Parameter values.
7382	Recipients *RecipientsContractProperties `json:"recipients,omitempty"`
7383}
7384
7385// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details.
7386type OAuth2AuthenticationSettingsContract struct {
7387	// AuthorizationServerID - OAuth authorization server identifier.
7388	AuthorizationServerID *string `json:"authorizationServerId,omitempty"`
7389	// Scope - operations scope.
7390	Scope *string `json:"scope,omitempty"`
7391}
7392
7393// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details.
7394type OpenIDAuthenticationSettingsContract struct {
7395	// OpenidProviderID - OAuth authorization server identifier.
7396	OpenidProviderID *string `json:"openidProviderId,omitempty"`
7397	// BearerTokenSendingMethods - How to send token to the server.
7398	BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"`
7399}
7400
7401// OpenIDConnectProviderCollection paged OpenIdProviders list representation.
7402type OpenIDConnectProviderCollection struct {
7403	autorest.Response `json:"-"`
7404	// Value - Page values.
7405	Value *[]OpenidConnectProviderContract `json:"value,omitempty"`
7406	// NextLink - Next page link if any.
7407	NextLink *string `json:"nextLink,omitempty"`
7408}
7409
7410// OpenIDConnectProviderCollectionIterator provides access to a complete listing of
7411// OpenidConnectProviderContract values.
7412type OpenIDConnectProviderCollectionIterator struct {
7413	i    int
7414	page OpenIDConnectProviderCollectionPage
7415}
7416
7417// NextWithContext advances to the next value.  If there was an error making
7418// the request the iterator does not advance and the error is returned.
7419func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7420	if tracing.IsEnabled() {
7421		ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext")
7422		defer func() {
7423			sc := -1
7424			if iter.Response().Response.Response != nil {
7425				sc = iter.Response().Response.Response.StatusCode
7426			}
7427			tracing.EndSpan(ctx, sc, err)
7428		}()
7429	}
7430	iter.i++
7431	if iter.i < len(iter.page.Values()) {
7432		return nil
7433	}
7434	err = iter.page.NextWithContext(ctx)
7435	if err != nil {
7436		iter.i--
7437		return err
7438	}
7439	iter.i = 0
7440	return nil
7441}
7442
7443// Next advances to the next value.  If there was an error making
7444// the request the iterator does not advance and the error is returned.
7445// Deprecated: Use NextWithContext() instead.
7446func (iter *OpenIDConnectProviderCollectionIterator) Next() error {
7447	return iter.NextWithContext(context.Background())
7448}
7449
7450// NotDone returns true if the enumeration should be started or is not yet complete.
7451func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool {
7452	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7453}
7454
7455// Response returns the raw server response from the last page request.
7456func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection {
7457	return iter.page.Response()
7458}
7459
7460// Value returns the current value or a zero-initialized value if the
7461// iterator has advanced beyond the end of the collection.
7462func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract {
7463	if !iter.page.NotDone() {
7464		return OpenidConnectProviderContract{}
7465	}
7466	return iter.page.Values()[iter.i]
7467}
7468
7469// Creates a new instance of the OpenIDConnectProviderCollectionIterator type.
7470func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator {
7471	return OpenIDConnectProviderCollectionIterator{page: page}
7472}
7473
7474// IsEmpty returns true if the ListResult contains no values.
7475func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool {
7476	return oicpc.Value == nil || len(*oicpc.Value) == 0
7477}
7478
7479// hasNextLink returns true if the NextLink is not empty.
7480func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool {
7481	return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0
7482}
7483
7484// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results.
7485// It returns nil if no more results exist.
7486func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) {
7487	if !oicpc.hasNextLink() {
7488		return nil, nil
7489	}
7490	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7491		autorest.AsJSON(),
7492		autorest.AsGet(),
7493		autorest.WithBaseURL(to.String(oicpc.NextLink)))
7494}
7495
7496// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values.
7497type OpenIDConnectProviderCollectionPage struct {
7498	fn    func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)
7499	oicpc OpenIDConnectProviderCollection
7500}
7501
7502// NextWithContext advances to the next page of values.  If there was an error making
7503// the request the page does not advance and the error is returned.
7504func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) {
7505	if tracing.IsEnabled() {
7506		ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext")
7507		defer func() {
7508			sc := -1
7509			if page.Response().Response.Response != nil {
7510				sc = page.Response().Response.Response.StatusCode
7511			}
7512			tracing.EndSpan(ctx, sc, err)
7513		}()
7514	}
7515	for {
7516		next, err := page.fn(ctx, page.oicpc)
7517		if err != nil {
7518			return err
7519		}
7520		page.oicpc = next
7521		if !next.hasNextLink() || !next.IsEmpty() {
7522			break
7523		}
7524	}
7525	return nil
7526}
7527
7528// Next advances to the next page of values.  If there was an error making
7529// the request the page does not advance and the error is returned.
7530// Deprecated: Use NextWithContext() instead.
7531func (page *OpenIDConnectProviderCollectionPage) Next() error {
7532	return page.NextWithContext(context.Background())
7533}
7534
7535// NotDone returns true if the page enumeration should be started or is not yet complete.
7536func (page OpenIDConnectProviderCollectionPage) NotDone() bool {
7537	return !page.oicpc.IsEmpty()
7538}
7539
7540// Response returns the raw server response from the last page request.
7541func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection {
7542	return page.oicpc
7543}
7544
7545// Values returns the slice of values for the current page or nil if there are no values.
7546func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract {
7547	if page.oicpc.IsEmpty() {
7548		return nil
7549	}
7550	return *page.oicpc.Value
7551}
7552
7553// Creates a new instance of the OpenIDConnectProviderCollectionPage type.
7554func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage {
7555	return OpenIDConnectProviderCollectionPage{
7556		fn:    getNextPage,
7557		oicpc: cur,
7558	}
7559}
7560
7561// OpenidConnectProviderContract openId Connect Provider details.
7562type OpenidConnectProviderContract struct {
7563	autorest.Response `json:"-"`
7564	// OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties.
7565	*OpenidConnectProviderContractProperties `json:"properties,omitempty"`
7566	// ID - READ-ONLY; Resource ID.
7567	ID *string `json:"id,omitempty"`
7568	// Name - READ-ONLY; Resource name.
7569	Name *string `json:"name,omitempty"`
7570	// Type - READ-ONLY; Resource type for API Management resource.
7571	Type *string `json:"type,omitempty"`
7572}
7573
7574// MarshalJSON is the custom marshaler for OpenidConnectProviderContract.
7575func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) {
7576	objectMap := make(map[string]interface{})
7577	if ocpc.OpenidConnectProviderContractProperties != nil {
7578		objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties
7579	}
7580	return json.Marshal(objectMap)
7581}
7582
7583// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct.
7584func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error {
7585	var m map[string]*json.RawMessage
7586	err := json.Unmarshal(body, &m)
7587	if err != nil {
7588		return err
7589	}
7590	for k, v := range m {
7591		switch k {
7592		case "properties":
7593			if v != nil {
7594				var openidConnectProviderContractProperties OpenidConnectProviderContractProperties
7595				err = json.Unmarshal(*v, &openidConnectProviderContractProperties)
7596				if err != nil {
7597					return err
7598				}
7599				ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties
7600			}
7601		case "id":
7602			if v != nil {
7603				var ID string
7604				err = json.Unmarshal(*v, &ID)
7605				if err != nil {
7606					return err
7607				}
7608				ocpc.ID = &ID
7609			}
7610		case "name":
7611			if v != nil {
7612				var name string
7613				err = json.Unmarshal(*v, &name)
7614				if err != nil {
7615					return err
7616				}
7617				ocpc.Name = &name
7618			}
7619		case "type":
7620			if v != nil {
7621				var typeVar string
7622				err = json.Unmarshal(*v, &typeVar)
7623				if err != nil {
7624					return err
7625				}
7626				ocpc.Type = &typeVar
7627			}
7628		}
7629	}
7630
7631	return nil
7632}
7633
7634// OpenidConnectProviderContractProperties openID Connect Providers Contract.
7635type OpenidConnectProviderContractProperties struct {
7636	// DisplayName - User-friendly OpenID Connect Provider name.
7637	DisplayName *string `json:"displayName,omitempty"`
7638	// Description - User-friendly description of OpenID Connect Provider.
7639	Description *string `json:"description,omitempty"`
7640	// MetadataEndpoint - Metadata endpoint URI.
7641	MetadataEndpoint *string `json:"metadataEndpoint,omitempty"`
7642	// ClientID - Client ID of developer console which is the client application.
7643	ClientID *string `json:"clientId,omitempty"`
7644	// ClientSecret - Client Secret of developer console which is the client application.
7645	ClientSecret *string `json:"clientSecret,omitempty"`
7646}
7647
7648// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation.
7649type OpenidConnectProviderUpdateContract struct {
7650	// OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties.
7651	*OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"`
7652}
7653
7654// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract.
7655func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) {
7656	objectMap := make(map[string]interface{})
7657	if ocpuc.OpenidConnectProviderUpdateContractProperties != nil {
7658		objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties
7659	}
7660	return json.Marshal(objectMap)
7661}
7662
7663// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct.
7664func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error {
7665	var m map[string]*json.RawMessage
7666	err := json.Unmarshal(body, &m)
7667	if err != nil {
7668		return err
7669	}
7670	for k, v := range m {
7671		switch k {
7672		case "properties":
7673			if v != nil {
7674				var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties
7675				err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties)
7676				if err != nil {
7677					return err
7678				}
7679				ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties
7680			}
7681		}
7682	}
7683
7684	return nil
7685}
7686
7687// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider
7688// operation.
7689type OpenidConnectProviderUpdateContractProperties struct {
7690	// DisplayName - User-friendly OpenID Connect Provider name.
7691	DisplayName *string `json:"displayName,omitempty"`
7692	// Description - User-friendly description of OpenID Connect Provider.
7693	Description *string `json:"description,omitempty"`
7694	// MetadataEndpoint - Metadata endpoint URI.
7695	MetadataEndpoint *string `json:"metadataEndpoint,omitempty"`
7696	// ClientID - Client ID of developer console which is the client application.
7697	ClientID *string `json:"clientId,omitempty"`
7698	// ClientSecret - Client Secret of developer console which is the client application.
7699	ClientSecret *string `json:"clientSecret,omitempty"`
7700}
7701
7702// Operation REST API operation
7703type Operation struct {
7704	// Name - Operation name: {provider}/{resource}/{operation}
7705	Name *string `json:"name,omitempty"`
7706	// Display - The object that describes the operation.
7707	Display *OperationDisplay `json:"display,omitempty"`
7708	// Origin - The operation origin.
7709	Origin *string `json:"origin,omitempty"`
7710	// Properties - The operation properties.
7711	Properties interface{} `json:"properties,omitempty"`
7712}
7713
7714// OperationCollection paged Operation list representation.
7715type OperationCollection struct {
7716	autorest.Response `json:"-"`
7717	// Value - READ-ONLY; Page values.
7718	Value *[]OperationContract `json:"value,omitempty"`
7719	// NextLink - READ-ONLY; Next page link if any.
7720	NextLink *string `json:"nextLink,omitempty"`
7721}
7722
7723// MarshalJSON is the custom marshaler for OperationCollection.
7724func (oc OperationCollection) MarshalJSON() ([]byte, error) {
7725	objectMap := make(map[string]interface{})
7726	return json.Marshal(objectMap)
7727}
7728
7729// OperationCollectionIterator provides access to a complete listing of OperationContract values.
7730type OperationCollectionIterator struct {
7731	i    int
7732	page OperationCollectionPage
7733}
7734
7735// NextWithContext advances to the next value.  If there was an error making
7736// the request the iterator does not advance and the error is returned.
7737func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7738	if tracing.IsEnabled() {
7739		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext")
7740		defer func() {
7741			sc := -1
7742			if iter.Response().Response.Response != nil {
7743				sc = iter.Response().Response.Response.StatusCode
7744			}
7745			tracing.EndSpan(ctx, sc, err)
7746		}()
7747	}
7748	iter.i++
7749	if iter.i < len(iter.page.Values()) {
7750		return nil
7751	}
7752	err = iter.page.NextWithContext(ctx)
7753	if err != nil {
7754		iter.i--
7755		return err
7756	}
7757	iter.i = 0
7758	return nil
7759}
7760
7761// Next advances to the next value.  If there was an error making
7762// the request the iterator does not advance and the error is returned.
7763// Deprecated: Use NextWithContext() instead.
7764func (iter *OperationCollectionIterator) Next() error {
7765	return iter.NextWithContext(context.Background())
7766}
7767
7768// NotDone returns true if the enumeration should be started or is not yet complete.
7769func (iter OperationCollectionIterator) NotDone() bool {
7770	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7771}
7772
7773// Response returns the raw server response from the last page request.
7774func (iter OperationCollectionIterator) Response() OperationCollection {
7775	return iter.page.Response()
7776}
7777
7778// Value returns the current value or a zero-initialized value if the
7779// iterator has advanced beyond the end of the collection.
7780func (iter OperationCollectionIterator) Value() OperationContract {
7781	if !iter.page.NotDone() {
7782		return OperationContract{}
7783	}
7784	return iter.page.Values()[iter.i]
7785}
7786
7787// Creates a new instance of the OperationCollectionIterator type.
7788func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator {
7789	return OperationCollectionIterator{page: page}
7790}
7791
7792// IsEmpty returns true if the ListResult contains no values.
7793func (oc OperationCollection) IsEmpty() bool {
7794	return oc.Value == nil || len(*oc.Value) == 0
7795}
7796
7797// hasNextLink returns true if the NextLink is not empty.
7798func (oc OperationCollection) hasNextLink() bool {
7799	return oc.NextLink != nil && len(*oc.NextLink) != 0
7800}
7801
7802// operationCollectionPreparer prepares a request to retrieve the next set of results.
7803// It returns nil if no more results exist.
7804func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) {
7805	if !oc.hasNextLink() {
7806		return nil, nil
7807	}
7808	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7809		autorest.AsJSON(),
7810		autorest.AsGet(),
7811		autorest.WithBaseURL(to.String(oc.NextLink)))
7812}
7813
7814// OperationCollectionPage contains a page of OperationContract values.
7815type OperationCollectionPage struct {
7816	fn func(context.Context, OperationCollection) (OperationCollection, error)
7817	oc OperationCollection
7818}
7819
7820// NextWithContext advances to the next page of values.  If there was an error making
7821// the request the page does not advance and the error is returned.
7822func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) {
7823	if tracing.IsEnabled() {
7824		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext")
7825		defer func() {
7826			sc := -1
7827			if page.Response().Response.Response != nil {
7828				sc = page.Response().Response.Response.StatusCode
7829			}
7830			tracing.EndSpan(ctx, sc, err)
7831		}()
7832	}
7833	for {
7834		next, err := page.fn(ctx, page.oc)
7835		if err != nil {
7836			return err
7837		}
7838		page.oc = next
7839		if !next.hasNextLink() || !next.IsEmpty() {
7840			break
7841		}
7842	}
7843	return nil
7844}
7845
7846// Next advances to the next page of values.  If there was an error making
7847// the request the page does not advance and the error is returned.
7848// Deprecated: Use NextWithContext() instead.
7849func (page *OperationCollectionPage) Next() error {
7850	return page.NextWithContext(context.Background())
7851}
7852
7853// NotDone returns true if the page enumeration should be started or is not yet complete.
7854func (page OperationCollectionPage) NotDone() bool {
7855	return !page.oc.IsEmpty()
7856}
7857
7858// Response returns the raw server response from the last page request.
7859func (page OperationCollectionPage) Response() OperationCollection {
7860	return page.oc
7861}
7862
7863// Values returns the slice of values for the current page or nil if there are no values.
7864func (page OperationCollectionPage) Values() []OperationContract {
7865	if page.oc.IsEmpty() {
7866		return nil
7867	}
7868	return *page.oc.Value
7869}
7870
7871// Creates a new instance of the OperationCollectionPage type.
7872func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage {
7873	return OperationCollectionPage{
7874		fn: getNextPage,
7875		oc: cur,
7876	}
7877}
7878
7879// OperationContract api Operation details.
7880type OperationContract struct {
7881	autorest.Response `json:"-"`
7882	// OperationContractProperties - Properties of the Operation Contract.
7883	*OperationContractProperties `json:"properties,omitempty"`
7884	// ID - READ-ONLY; Resource ID.
7885	ID *string `json:"id,omitempty"`
7886	// Name - READ-ONLY; Resource name.
7887	Name *string `json:"name,omitempty"`
7888	// Type - READ-ONLY; Resource type for API Management resource.
7889	Type *string `json:"type,omitempty"`
7890}
7891
7892// MarshalJSON is the custom marshaler for OperationContract.
7893func (oc OperationContract) MarshalJSON() ([]byte, error) {
7894	objectMap := make(map[string]interface{})
7895	if oc.OperationContractProperties != nil {
7896		objectMap["properties"] = oc.OperationContractProperties
7897	}
7898	return json.Marshal(objectMap)
7899}
7900
7901// UnmarshalJSON is the custom unmarshaler for OperationContract struct.
7902func (oc *OperationContract) UnmarshalJSON(body []byte) error {
7903	var m map[string]*json.RawMessage
7904	err := json.Unmarshal(body, &m)
7905	if err != nil {
7906		return err
7907	}
7908	for k, v := range m {
7909		switch k {
7910		case "properties":
7911			if v != nil {
7912				var operationContractProperties OperationContractProperties
7913				err = json.Unmarshal(*v, &operationContractProperties)
7914				if err != nil {
7915					return err
7916				}
7917				oc.OperationContractProperties = &operationContractProperties
7918			}
7919		case "id":
7920			if v != nil {
7921				var ID string
7922				err = json.Unmarshal(*v, &ID)
7923				if err != nil {
7924					return err
7925				}
7926				oc.ID = &ID
7927			}
7928		case "name":
7929			if v != nil {
7930				var name string
7931				err = json.Unmarshal(*v, &name)
7932				if err != nil {
7933					return err
7934				}
7935				oc.Name = &name
7936			}
7937		case "type":
7938			if v != nil {
7939				var typeVar string
7940				err = json.Unmarshal(*v, &typeVar)
7941				if err != nil {
7942					return err
7943				}
7944				oc.Type = &typeVar
7945			}
7946		}
7947	}
7948
7949	return nil
7950}
7951
7952// OperationContractProperties operation Contract Properties
7953type OperationContractProperties struct {
7954	// DisplayName - Operation Name.
7955	DisplayName *string `json:"displayName,omitempty"`
7956	// Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
7957	Method *string `json:"method,omitempty"`
7958	// URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
7959	URLTemplate *string `json:"urlTemplate,omitempty"`
7960	// TemplateParameters - Collection of URL template parameters.
7961	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
7962	// Description - Description of the operation. May include HTML formatting tags.
7963	Description *string `json:"description,omitempty"`
7964	// Request - An entity containing request details.
7965	Request *RequestContract `json:"request,omitempty"`
7966	// Responses - Array of Operation responses.
7967	Responses *[]ResponseContract `json:"responses,omitempty"`
7968	// Policies - Operation Policies
7969	Policies *string `json:"policies,omitempty"`
7970}
7971
7972// OperationDisplay the object that describes the operation.
7973type OperationDisplay struct {
7974	// Provider - Friendly name of the resource provider
7975	Provider *string `json:"provider,omitempty"`
7976	// Operation - Operation type: read, write, delete, listKeys/action, etc.
7977	Operation *string `json:"operation,omitempty"`
7978	// Resource - Resource type on which the operation is performed.
7979	Resource *string `json:"resource,omitempty"`
7980	// Description - Friendly name of the operation
7981	Description *string `json:"description,omitempty"`
7982}
7983
7984// OperationEntityBaseContract api Operation Entity Base Contract details.
7985type OperationEntityBaseContract struct {
7986	// TemplateParameters - Collection of URL template parameters.
7987	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
7988	// Description - Description of the operation. May include HTML formatting tags.
7989	Description *string `json:"description,omitempty"`
7990	// Request - An entity containing request details.
7991	Request *RequestContract `json:"request,omitempty"`
7992	// Responses - Array of Operation responses.
7993	Responses *[]ResponseContract `json:"responses,omitempty"`
7994	// Policies - Operation Policies
7995	Policies *string `json:"policies,omitempty"`
7996}
7997
7998// OperationListResult result of the request to list REST API operations. It contains a list of operations
7999// and a URL nextLink to get the next set of results.
8000type OperationListResult struct {
8001	autorest.Response `json:"-"`
8002	// Value - List of operations supported by the resource provider.
8003	Value *[]Operation `json:"value,omitempty"`
8004	// NextLink - URL to get the next set of operation list results if there are any.
8005	NextLink *string `json:"nextLink,omitempty"`
8006}
8007
8008// OperationListResultIterator provides access to a complete listing of Operation values.
8009type OperationListResultIterator struct {
8010	i    int
8011	page OperationListResultPage
8012}
8013
8014// NextWithContext advances to the next value.  If there was an error making
8015// the request the iterator does not advance and the error is returned.
8016func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
8017	if tracing.IsEnabled() {
8018		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
8019		defer func() {
8020			sc := -1
8021			if iter.Response().Response.Response != nil {
8022				sc = iter.Response().Response.Response.StatusCode
8023			}
8024			tracing.EndSpan(ctx, sc, err)
8025		}()
8026	}
8027	iter.i++
8028	if iter.i < len(iter.page.Values()) {
8029		return nil
8030	}
8031	err = iter.page.NextWithContext(ctx)
8032	if err != nil {
8033		iter.i--
8034		return err
8035	}
8036	iter.i = 0
8037	return nil
8038}
8039
8040// Next advances to the next value.  If there was an error making
8041// the request the iterator does not advance and the error is returned.
8042// Deprecated: Use NextWithContext() instead.
8043func (iter *OperationListResultIterator) Next() error {
8044	return iter.NextWithContext(context.Background())
8045}
8046
8047// NotDone returns true if the enumeration should be started or is not yet complete.
8048func (iter OperationListResultIterator) NotDone() bool {
8049	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8050}
8051
8052// Response returns the raw server response from the last page request.
8053func (iter OperationListResultIterator) Response() OperationListResult {
8054	return iter.page.Response()
8055}
8056
8057// Value returns the current value or a zero-initialized value if the
8058// iterator has advanced beyond the end of the collection.
8059func (iter OperationListResultIterator) Value() Operation {
8060	if !iter.page.NotDone() {
8061		return Operation{}
8062	}
8063	return iter.page.Values()[iter.i]
8064}
8065
8066// Creates a new instance of the OperationListResultIterator type.
8067func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
8068	return OperationListResultIterator{page: page}
8069}
8070
8071// IsEmpty returns true if the ListResult contains no values.
8072func (olr OperationListResult) IsEmpty() bool {
8073	return olr.Value == nil || len(*olr.Value) == 0
8074}
8075
8076// hasNextLink returns true if the NextLink is not empty.
8077func (olr OperationListResult) hasNextLink() bool {
8078	return olr.NextLink != nil && len(*olr.NextLink) != 0
8079}
8080
8081// operationListResultPreparer prepares a request to retrieve the next set of results.
8082// It returns nil if no more results exist.
8083func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
8084	if !olr.hasNextLink() {
8085		return nil, nil
8086	}
8087	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8088		autorest.AsJSON(),
8089		autorest.AsGet(),
8090		autorest.WithBaseURL(to.String(olr.NextLink)))
8091}
8092
8093// OperationListResultPage contains a page of Operation values.
8094type OperationListResultPage struct {
8095	fn  func(context.Context, OperationListResult) (OperationListResult, error)
8096	olr OperationListResult
8097}
8098
8099// NextWithContext advances to the next page of values.  If there was an error making
8100// the request the page does not advance and the error is returned.
8101func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
8102	if tracing.IsEnabled() {
8103		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
8104		defer func() {
8105			sc := -1
8106			if page.Response().Response.Response != nil {
8107				sc = page.Response().Response.Response.StatusCode
8108			}
8109			tracing.EndSpan(ctx, sc, err)
8110		}()
8111	}
8112	for {
8113		next, err := page.fn(ctx, page.olr)
8114		if err != nil {
8115			return err
8116		}
8117		page.olr = next
8118		if !next.hasNextLink() || !next.IsEmpty() {
8119			break
8120		}
8121	}
8122	return nil
8123}
8124
8125// Next advances to the next page of values.  If there was an error making
8126// the request the page does not advance and the error is returned.
8127// Deprecated: Use NextWithContext() instead.
8128func (page *OperationListResultPage) Next() error {
8129	return page.NextWithContext(context.Background())
8130}
8131
8132// NotDone returns true if the page enumeration should be started or is not yet complete.
8133func (page OperationListResultPage) NotDone() bool {
8134	return !page.olr.IsEmpty()
8135}
8136
8137// Response returns the raw server response from the last page request.
8138func (page OperationListResultPage) Response() OperationListResult {
8139	return page.olr
8140}
8141
8142// Values returns the slice of values for the current page or nil if there are no values.
8143func (page OperationListResultPage) Values() []Operation {
8144	if page.olr.IsEmpty() {
8145		return nil
8146	}
8147	return *page.olr.Value
8148}
8149
8150// Creates a new instance of the OperationListResultPage type.
8151func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
8152	return OperationListResultPage{
8153		fn:  getNextPage,
8154		olr: cur,
8155	}
8156}
8157
8158// OperationResultContract operation Result.
8159type OperationResultContract struct {
8160	autorest.Response `json:"-"`
8161	// ID - Operation result identifier.
8162	ID *string `json:"id,omitempty"`
8163	// Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed'
8164	Status AsyncOperationStatus `json:"status,omitempty"`
8165	// 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.
8166	Started *date.Time `json:"started,omitempty"`
8167	// 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.
8168	Updated *date.Time `json:"updated,omitempty"`
8169	// ResultInfo - Optional result info.
8170	ResultInfo *string `json:"resultInfo,omitempty"`
8171	// Error - Error Body Contract
8172	Error *ErrorResponseBody `json:"error,omitempty"`
8173	// 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.
8174	ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"`
8175}
8176
8177// MarshalJSON is the custom marshaler for OperationResultContract.
8178func (orc OperationResultContract) MarshalJSON() ([]byte, error) {
8179	objectMap := make(map[string]interface{})
8180	if orc.ID != nil {
8181		objectMap["id"] = orc.ID
8182	}
8183	if orc.Status != "" {
8184		objectMap["status"] = orc.Status
8185	}
8186	if orc.Started != nil {
8187		objectMap["started"] = orc.Started
8188	}
8189	if orc.Updated != nil {
8190		objectMap["updated"] = orc.Updated
8191	}
8192	if orc.ResultInfo != nil {
8193		objectMap["resultInfo"] = orc.ResultInfo
8194	}
8195	if orc.Error != nil {
8196		objectMap["error"] = orc.Error
8197	}
8198	return json.Marshal(objectMap)
8199}
8200
8201// OperationResultLogItemContract log of the entity being created, updated or deleted.
8202type OperationResultLogItemContract struct {
8203	// ObjectType - The type of entity contract.
8204	ObjectType *string `json:"objectType,omitempty"`
8205	// Action - Action like create/update/delete.
8206	Action *string `json:"action,omitempty"`
8207	// ObjectKey - Identifier of the entity being created/updated/deleted.
8208	ObjectKey *string `json:"objectKey,omitempty"`
8209}
8210
8211// OperationTagResourceContractProperties operation Entity contract Properties.
8212type OperationTagResourceContractProperties struct {
8213	// ID - Identifier of the operation in form /operations/{operationId}.
8214	ID *string `json:"id,omitempty"`
8215	// Name - READ-ONLY; Operation name.
8216	Name *string `json:"name,omitempty"`
8217	// APIName - READ-ONLY; Api Name.
8218	APIName *string `json:"apiName,omitempty"`
8219	// APIRevision - READ-ONLY; Api Revision.
8220	APIRevision *string `json:"apiRevision,omitempty"`
8221	// APIVersion - READ-ONLY; Api Version.
8222	APIVersion *string `json:"apiVersion,omitempty"`
8223	// Description - READ-ONLY; Operation Description.
8224	Description *string `json:"description,omitempty"`
8225	// Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
8226	Method *string `json:"method,omitempty"`
8227	// URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
8228	URLTemplate *string `json:"urlTemplate,omitempty"`
8229}
8230
8231// MarshalJSON is the custom marshaler for OperationTagResourceContractProperties.
8232func (otrcp OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) {
8233	objectMap := make(map[string]interface{})
8234	if otrcp.ID != nil {
8235		objectMap["id"] = otrcp.ID
8236	}
8237	return json.Marshal(objectMap)
8238}
8239
8240// OperationUpdateContract api Operation Update Contract details.
8241type OperationUpdateContract struct {
8242	// OperationUpdateContractProperties - Properties of the API Operation entity that can be updated.
8243	*OperationUpdateContractProperties `json:"properties,omitempty"`
8244}
8245
8246// MarshalJSON is the custom marshaler for OperationUpdateContract.
8247func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) {
8248	objectMap := make(map[string]interface{})
8249	if ouc.OperationUpdateContractProperties != nil {
8250		objectMap["properties"] = ouc.OperationUpdateContractProperties
8251	}
8252	return json.Marshal(objectMap)
8253}
8254
8255// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct.
8256func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error {
8257	var m map[string]*json.RawMessage
8258	err := json.Unmarshal(body, &m)
8259	if err != nil {
8260		return err
8261	}
8262	for k, v := range m {
8263		switch k {
8264		case "properties":
8265			if v != nil {
8266				var operationUpdateContractProperties OperationUpdateContractProperties
8267				err = json.Unmarshal(*v, &operationUpdateContractProperties)
8268				if err != nil {
8269					return err
8270				}
8271				ouc.OperationUpdateContractProperties = &operationUpdateContractProperties
8272			}
8273		}
8274	}
8275
8276	return nil
8277}
8278
8279// OperationUpdateContractProperties operation Update Contract Properties.
8280type OperationUpdateContractProperties struct {
8281	// DisplayName - Operation Name.
8282	DisplayName *string `json:"displayName,omitempty"`
8283	// Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
8284	Method *string `json:"method,omitempty"`
8285	// URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
8286	URLTemplate *string `json:"urlTemplate,omitempty"`
8287	// TemplateParameters - Collection of URL template parameters.
8288	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
8289	// Description - Description of the operation. May include HTML formatting tags.
8290	Description *string `json:"description,omitempty"`
8291	// Request - An entity containing request details.
8292	Request *RequestContract `json:"request,omitempty"`
8293	// Responses - Array of Operation responses.
8294	Responses *[]ResponseContract `json:"responses,omitempty"`
8295	// Policies - Operation Policies
8296	Policies *string `json:"policies,omitempty"`
8297}
8298
8299// ParameterContract operation parameters details.
8300type ParameterContract struct {
8301	// Name - Parameter name.
8302	Name *string `json:"name,omitempty"`
8303	// Description - Parameter description.
8304	Description *string `json:"description,omitempty"`
8305	// Type - Parameter type.
8306	Type *string `json:"type,omitempty"`
8307	// DefaultValue - Default parameter value.
8308	DefaultValue *string `json:"defaultValue,omitempty"`
8309	// Required - Specifies whether parameter is required or not.
8310	Required *bool `json:"required,omitempty"`
8311	// Values - Parameter values.
8312	Values *[]string `json:"values,omitempty"`
8313}
8314
8315// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
8316type PipelineDiagnosticSettings struct {
8317	// Request - Diagnostic settings for request.
8318	Request *HTTPMessageDiagnostic `json:"request,omitempty"`
8319	// Response - Diagnostic settings for response.
8320	Response *HTTPMessageDiagnostic `json:"response,omitempty"`
8321}
8322
8323// PolicyCollection the response of the list policy operation.
8324type PolicyCollection struct {
8325	autorest.Response `json:"-"`
8326	// Value - Policy Contract value.
8327	Value *[]PolicyContract `json:"value,omitempty"`
8328	// NextLink - Next page link if any.
8329	NextLink *string `json:"nextLink,omitempty"`
8330}
8331
8332// PolicyContract policy Contract details.
8333type PolicyContract struct {
8334	autorest.Response `json:"-"`
8335	// PolicyContractProperties - Properties of the Policy.
8336	*PolicyContractProperties `json:"properties,omitempty"`
8337	// ID - READ-ONLY; Resource ID.
8338	ID *string `json:"id,omitempty"`
8339	// Name - READ-ONLY; Resource name.
8340	Name *string `json:"name,omitempty"`
8341	// Type - READ-ONLY; Resource type for API Management resource.
8342	Type *string `json:"type,omitempty"`
8343}
8344
8345// MarshalJSON is the custom marshaler for PolicyContract.
8346func (pc PolicyContract) MarshalJSON() ([]byte, error) {
8347	objectMap := make(map[string]interface{})
8348	if pc.PolicyContractProperties != nil {
8349		objectMap["properties"] = pc.PolicyContractProperties
8350	}
8351	return json.Marshal(objectMap)
8352}
8353
8354// UnmarshalJSON is the custom unmarshaler for PolicyContract struct.
8355func (pc *PolicyContract) UnmarshalJSON(body []byte) error {
8356	var m map[string]*json.RawMessage
8357	err := json.Unmarshal(body, &m)
8358	if err != nil {
8359		return err
8360	}
8361	for k, v := range m {
8362		switch k {
8363		case "properties":
8364			if v != nil {
8365				var policyContractProperties PolicyContractProperties
8366				err = json.Unmarshal(*v, &policyContractProperties)
8367				if err != nil {
8368					return err
8369				}
8370				pc.PolicyContractProperties = &policyContractProperties
8371			}
8372		case "id":
8373			if v != nil {
8374				var ID string
8375				err = json.Unmarshal(*v, &ID)
8376				if err != nil {
8377					return err
8378				}
8379				pc.ID = &ID
8380			}
8381		case "name":
8382			if v != nil {
8383				var name string
8384				err = json.Unmarshal(*v, &name)
8385				if err != nil {
8386					return err
8387				}
8388				pc.Name = &name
8389			}
8390		case "type":
8391			if v != nil {
8392				var typeVar string
8393				err = json.Unmarshal(*v, &typeVar)
8394				if err != nil {
8395					return err
8396				}
8397				pc.Type = &typeVar
8398			}
8399		}
8400	}
8401
8402	return nil
8403}
8404
8405// PolicyContractProperties policy contract Properties.
8406type PolicyContractProperties struct {
8407	// Value - Contents of the Policy as defined by the format.
8408	Value *string `json:"value,omitempty"`
8409	// Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink'
8410	Format PolicyContentFormat `json:"format,omitempty"`
8411}
8412
8413// PolicyDescriptionCollection descriptions of APIM policies.
8414type PolicyDescriptionCollection struct {
8415	autorest.Response `json:"-"`
8416	// Value - Descriptions of APIM policies.
8417	Value *[]PolicyDescriptionContract `json:"value,omitempty"`
8418	// Count - Total record count number.
8419	Count *int64 `json:"count,omitempty"`
8420}
8421
8422// PolicyDescriptionContract policy description details.
8423type PolicyDescriptionContract struct {
8424	// PolicyDescriptionContractProperties - Policy description contract properties.
8425	*PolicyDescriptionContractProperties `json:"properties,omitempty"`
8426	// ID - READ-ONLY; Resource ID.
8427	ID *string `json:"id,omitempty"`
8428	// Name - READ-ONLY; Resource name.
8429	Name *string `json:"name,omitempty"`
8430	// Type - READ-ONLY; Resource type for API Management resource.
8431	Type *string `json:"type,omitempty"`
8432}
8433
8434// MarshalJSON is the custom marshaler for PolicyDescriptionContract.
8435func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) {
8436	objectMap := make(map[string]interface{})
8437	if pdc.PolicyDescriptionContractProperties != nil {
8438		objectMap["properties"] = pdc.PolicyDescriptionContractProperties
8439	}
8440	return json.Marshal(objectMap)
8441}
8442
8443// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct.
8444func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error {
8445	var m map[string]*json.RawMessage
8446	err := json.Unmarshal(body, &m)
8447	if err != nil {
8448		return err
8449	}
8450	for k, v := range m {
8451		switch k {
8452		case "properties":
8453			if v != nil {
8454				var policyDescriptionContractProperties PolicyDescriptionContractProperties
8455				err = json.Unmarshal(*v, &policyDescriptionContractProperties)
8456				if err != nil {
8457					return err
8458				}
8459				pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties
8460			}
8461		case "id":
8462			if v != nil {
8463				var ID string
8464				err = json.Unmarshal(*v, &ID)
8465				if err != nil {
8466					return err
8467				}
8468				pdc.ID = &ID
8469			}
8470		case "name":
8471			if v != nil {
8472				var name string
8473				err = json.Unmarshal(*v, &name)
8474				if err != nil {
8475					return err
8476				}
8477				pdc.Name = &name
8478			}
8479		case "type":
8480			if v != nil {
8481				var typeVar string
8482				err = json.Unmarshal(*v, &typeVar)
8483				if err != nil {
8484					return err
8485				}
8486				pdc.Type = &typeVar
8487			}
8488		}
8489	}
8490
8491	return nil
8492}
8493
8494// PolicyDescriptionContractProperties policy description properties.
8495type PolicyDescriptionContractProperties struct {
8496	// Description - READ-ONLY; Policy description.
8497	Description *string `json:"description,omitempty"`
8498	// Scope - READ-ONLY; Binary OR value of the Snippet scope.
8499	Scope *int32 `json:"scope,omitempty"`
8500}
8501
8502// MarshalJSON is the custom marshaler for PolicyDescriptionContractProperties.
8503func (pdcp PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) {
8504	objectMap := make(map[string]interface{})
8505	return json.Marshal(objectMap)
8506}
8507
8508// PortalDelegationSettings delegation settings for a developer portal.
8509type PortalDelegationSettings struct {
8510	autorest.Response `json:"-"`
8511	// PortalDelegationSettingsProperties - Delegation settings contract properties.
8512	*PortalDelegationSettingsProperties `json:"properties,omitempty"`
8513	// ID - READ-ONLY; Resource ID.
8514	ID *string `json:"id,omitempty"`
8515	// Name - READ-ONLY; Resource name.
8516	Name *string `json:"name,omitempty"`
8517	// Type - READ-ONLY; Resource type for API Management resource.
8518	Type *string `json:"type,omitempty"`
8519}
8520
8521// MarshalJSON is the custom marshaler for PortalDelegationSettings.
8522func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) {
8523	objectMap := make(map[string]interface{})
8524	if pds.PortalDelegationSettingsProperties != nil {
8525		objectMap["properties"] = pds.PortalDelegationSettingsProperties
8526	}
8527	return json.Marshal(objectMap)
8528}
8529
8530// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct.
8531func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error {
8532	var m map[string]*json.RawMessage
8533	err := json.Unmarshal(body, &m)
8534	if err != nil {
8535		return err
8536	}
8537	for k, v := range m {
8538		switch k {
8539		case "properties":
8540			if v != nil {
8541				var portalDelegationSettingsProperties PortalDelegationSettingsProperties
8542				err = json.Unmarshal(*v, &portalDelegationSettingsProperties)
8543				if err != nil {
8544					return err
8545				}
8546				pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties
8547			}
8548		case "id":
8549			if v != nil {
8550				var ID string
8551				err = json.Unmarshal(*v, &ID)
8552				if err != nil {
8553					return err
8554				}
8555				pds.ID = &ID
8556			}
8557		case "name":
8558			if v != nil {
8559				var name string
8560				err = json.Unmarshal(*v, &name)
8561				if err != nil {
8562					return err
8563				}
8564				pds.Name = &name
8565			}
8566		case "type":
8567			if v != nil {
8568				var typeVar string
8569				err = json.Unmarshal(*v, &typeVar)
8570				if err != nil {
8571					return err
8572				}
8573				pds.Type = &typeVar
8574			}
8575		}
8576	}
8577
8578	return nil
8579}
8580
8581// PortalDelegationSettingsProperties delegation settings contract properties.
8582type PortalDelegationSettingsProperties struct {
8583	// URL - A delegation Url.
8584	URL *string `json:"url,omitempty"`
8585	// ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management.
8586	ValidationKey *string `json:"validationKey,omitempty"`
8587	// Subscriptions - Subscriptions delegation settings.
8588	Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"`
8589	// UserRegistration - User registration delegation settings.
8590	UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"`
8591}
8592
8593// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
8594type PortalSettingValidationKeyContract struct {
8595	autorest.Response `json:"-"`
8596	// ValidationKey - This is secret value of the validation key in portal settings.
8597	ValidationKey *string `json:"validationKey,omitempty"`
8598}
8599
8600// PortalSigninSettingProperties sign-in settings contract properties.
8601type PortalSigninSettingProperties struct {
8602	// Enabled - Redirect Anonymous users to the Sign-In page.
8603	Enabled *bool `json:"enabled,omitempty"`
8604}
8605
8606// PortalSigninSettings sign-In settings for the Developer Portal.
8607type PortalSigninSettings struct {
8608	autorest.Response `json:"-"`
8609	// PortalSigninSettingProperties - Sign-in settings contract properties.
8610	*PortalSigninSettingProperties `json:"properties,omitempty"`
8611	// ID - READ-ONLY; Resource ID.
8612	ID *string `json:"id,omitempty"`
8613	// Name - READ-ONLY; Resource name.
8614	Name *string `json:"name,omitempty"`
8615	// Type - READ-ONLY; Resource type for API Management resource.
8616	Type *string `json:"type,omitempty"`
8617}
8618
8619// MarshalJSON is the custom marshaler for PortalSigninSettings.
8620func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) {
8621	objectMap := make(map[string]interface{})
8622	if pss.PortalSigninSettingProperties != nil {
8623		objectMap["properties"] = pss.PortalSigninSettingProperties
8624	}
8625	return json.Marshal(objectMap)
8626}
8627
8628// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct.
8629func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error {
8630	var m map[string]*json.RawMessage
8631	err := json.Unmarshal(body, &m)
8632	if err != nil {
8633		return err
8634	}
8635	for k, v := range m {
8636		switch k {
8637		case "properties":
8638			if v != nil {
8639				var portalSigninSettingProperties PortalSigninSettingProperties
8640				err = json.Unmarshal(*v, &portalSigninSettingProperties)
8641				if err != nil {
8642					return err
8643				}
8644				pss.PortalSigninSettingProperties = &portalSigninSettingProperties
8645			}
8646		case "id":
8647			if v != nil {
8648				var ID string
8649				err = json.Unmarshal(*v, &ID)
8650				if err != nil {
8651					return err
8652				}
8653				pss.ID = &ID
8654			}
8655		case "name":
8656			if v != nil {
8657				var name string
8658				err = json.Unmarshal(*v, &name)
8659				if err != nil {
8660					return err
8661				}
8662				pss.Name = &name
8663			}
8664		case "type":
8665			if v != nil {
8666				var typeVar string
8667				err = json.Unmarshal(*v, &typeVar)
8668				if err != nil {
8669					return err
8670				}
8671				pss.Type = &typeVar
8672			}
8673		}
8674	}
8675
8676	return nil
8677}
8678
8679// PortalSignupSettings sign-Up settings for a developer portal.
8680type PortalSignupSettings struct {
8681	autorest.Response `json:"-"`
8682	// PortalSignupSettingsProperties - Sign-up settings contract properties.
8683	*PortalSignupSettingsProperties `json:"properties,omitempty"`
8684	// ID - READ-ONLY; Resource ID.
8685	ID *string `json:"id,omitempty"`
8686	// Name - READ-ONLY; Resource name.
8687	Name *string `json:"name,omitempty"`
8688	// Type - READ-ONLY; Resource type for API Management resource.
8689	Type *string `json:"type,omitempty"`
8690}
8691
8692// MarshalJSON is the custom marshaler for PortalSignupSettings.
8693func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) {
8694	objectMap := make(map[string]interface{})
8695	if pss.PortalSignupSettingsProperties != nil {
8696		objectMap["properties"] = pss.PortalSignupSettingsProperties
8697	}
8698	return json.Marshal(objectMap)
8699}
8700
8701// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct.
8702func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error {
8703	var m map[string]*json.RawMessage
8704	err := json.Unmarshal(body, &m)
8705	if err != nil {
8706		return err
8707	}
8708	for k, v := range m {
8709		switch k {
8710		case "properties":
8711			if v != nil {
8712				var portalSignupSettingsProperties PortalSignupSettingsProperties
8713				err = json.Unmarshal(*v, &portalSignupSettingsProperties)
8714				if err != nil {
8715					return err
8716				}
8717				pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties
8718			}
8719		case "id":
8720			if v != nil {
8721				var ID string
8722				err = json.Unmarshal(*v, &ID)
8723				if err != nil {
8724					return err
8725				}
8726				pss.ID = &ID
8727			}
8728		case "name":
8729			if v != nil {
8730				var name string
8731				err = json.Unmarshal(*v, &name)
8732				if err != nil {
8733					return err
8734				}
8735				pss.Name = &name
8736			}
8737		case "type":
8738			if v != nil {
8739				var typeVar string
8740				err = json.Unmarshal(*v, &typeVar)
8741				if err != nil {
8742					return err
8743				}
8744				pss.Type = &typeVar
8745			}
8746		}
8747	}
8748
8749	return nil
8750}
8751
8752// PortalSignupSettingsProperties sign-up settings contract properties.
8753type PortalSignupSettingsProperties struct {
8754	// Enabled - Allow users to sign up on a developer portal.
8755	Enabled *bool `json:"enabled,omitempty"`
8756	// TermsOfService - Terms of service contract properties.
8757	TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"`
8758}
8759
8760// ProductCollection paged Products list representation.
8761type ProductCollection struct {
8762	autorest.Response `json:"-"`
8763	// Value - Page values.
8764	Value *[]ProductContract `json:"value,omitempty"`
8765	// NextLink - Next page link if any.
8766	NextLink *string `json:"nextLink,omitempty"`
8767}
8768
8769// ProductCollectionIterator provides access to a complete listing of ProductContract values.
8770type ProductCollectionIterator struct {
8771	i    int
8772	page ProductCollectionPage
8773}
8774
8775// NextWithContext advances to the next value.  If there was an error making
8776// the request the iterator does not advance and the error is returned.
8777func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) {
8778	if tracing.IsEnabled() {
8779		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext")
8780		defer func() {
8781			sc := -1
8782			if iter.Response().Response.Response != nil {
8783				sc = iter.Response().Response.Response.StatusCode
8784			}
8785			tracing.EndSpan(ctx, sc, err)
8786		}()
8787	}
8788	iter.i++
8789	if iter.i < len(iter.page.Values()) {
8790		return nil
8791	}
8792	err = iter.page.NextWithContext(ctx)
8793	if err != nil {
8794		iter.i--
8795		return err
8796	}
8797	iter.i = 0
8798	return nil
8799}
8800
8801// Next advances to the next value.  If there was an error making
8802// the request the iterator does not advance and the error is returned.
8803// Deprecated: Use NextWithContext() instead.
8804func (iter *ProductCollectionIterator) Next() error {
8805	return iter.NextWithContext(context.Background())
8806}
8807
8808// NotDone returns true if the enumeration should be started or is not yet complete.
8809func (iter ProductCollectionIterator) NotDone() bool {
8810	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8811}
8812
8813// Response returns the raw server response from the last page request.
8814func (iter ProductCollectionIterator) Response() ProductCollection {
8815	return iter.page.Response()
8816}
8817
8818// Value returns the current value or a zero-initialized value if the
8819// iterator has advanced beyond the end of the collection.
8820func (iter ProductCollectionIterator) Value() ProductContract {
8821	if !iter.page.NotDone() {
8822		return ProductContract{}
8823	}
8824	return iter.page.Values()[iter.i]
8825}
8826
8827// Creates a new instance of the ProductCollectionIterator type.
8828func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator {
8829	return ProductCollectionIterator{page: page}
8830}
8831
8832// IsEmpty returns true if the ListResult contains no values.
8833func (pc ProductCollection) IsEmpty() bool {
8834	return pc.Value == nil || len(*pc.Value) == 0
8835}
8836
8837// hasNextLink returns true if the NextLink is not empty.
8838func (pc ProductCollection) hasNextLink() bool {
8839	return pc.NextLink != nil && len(*pc.NextLink) != 0
8840}
8841
8842// productCollectionPreparer prepares a request to retrieve the next set of results.
8843// It returns nil if no more results exist.
8844func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) {
8845	if !pc.hasNextLink() {
8846		return nil, nil
8847	}
8848	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8849		autorest.AsJSON(),
8850		autorest.AsGet(),
8851		autorest.WithBaseURL(to.String(pc.NextLink)))
8852}
8853
8854// ProductCollectionPage contains a page of ProductContract values.
8855type ProductCollectionPage struct {
8856	fn func(context.Context, ProductCollection) (ProductCollection, error)
8857	pc ProductCollection
8858}
8859
8860// NextWithContext advances to the next page of values.  If there was an error making
8861// the request the page does not advance and the error is returned.
8862func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) {
8863	if tracing.IsEnabled() {
8864		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext")
8865		defer func() {
8866			sc := -1
8867			if page.Response().Response.Response != nil {
8868				sc = page.Response().Response.Response.StatusCode
8869			}
8870			tracing.EndSpan(ctx, sc, err)
8871		}()
8872	}
8873	for {
8874		next, err := page.fn(ctx, page.pc)
8875		if err != nil {
8876			return err
8877		}
8878		page.pc = next
8879		if !next.hasNextLink() || !next.IsEmpty() {
8880			break
8881		}
8882	}
8883	return nil
8884}
8885
8886// Next advances to the next page of values.  If there was an error making
8887// the request the page does not advance and the error is returned.
8888// Deprecated: Use NextWithContext() instead.
8889func (page *ProductCollectionPage) Next() error {
8890	return page.NextWithContext(context.Background())
8891}
8892
8893// NotDone returns true if the page enumeration should be started or is not yet complete.
8894func (page ProductCollectionPage) NotDone() bool {
8895	return !page.pc.IsEmpty()
8896}
8897
8898// Response returns the raw server response from the last page request.
8899func (page ProductCollectionPage) Response() ProductCollection {
8900	return page.pc
8901}
8902
8903// Values returns the slice of values for the current page or nil if there are no values.
8904func (page ProductCollectionPage) Values() []ProductContract {
8905	if page.pc.IsEmpty() {
8906		return nil
8907	}
8908	return *page.pc.Value
8909}
8910
8911// Creates a new instance of the ProductCollectionPage type.
8912func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage {
8913	return ProductCollectionPage{
8914		fn: getNextPage,
8915		pc: cur,
8916	}
8917}
8918
8919// ProductContract product details.
8920type ProductContract struct {
8921	autorest.Response `json:"-"`
8922	// ProductContractProperties - Product entity contract properties.
8923	*ProductContractProperties `json:"properties,omitempty"`
8924	// ID - READ-ONLY; Resource ID.
8925	ID *string `json:"id,omitempty"`
8926	// Name - READ-ONLY; Resource name.
8927	Name *string `json:"name,omitempty"`
8928	// Type - READ-ONLY; Resource type for API Management resource.
8929	Type *string `json:"type,omitempty"`
8930}
8931
8932// MarshalJSON is the custom marshaler for ProductContract.
8933func (pc ProductContract) MarshalJSON() ([]byte, error) {
8934	objectMap := make(map[string]interface{})
8935	if pc.ProductContractProperties != nil {
8936		objectMap["properties"] = pc.ProductContractProperties
8937	}
8938	return json.Marshal(objectMap)
8939}
8940
8941// UnmarshalJSON is the custom unmarshaler for ProductContract struct.
8942func (pc *ProductContract) UnmarshalJSON(body []byte) error {
8943	var m map[string]*json.RawMessage
8944	err := json.Unmarshal(body, &m)
8945	if err != nil {
8946		return err
8947	}
8948	for k, v := range m {
8949		switch k {
8950		case "properties":
8951			if v != nil {
8952				var productContractProperties ProductContractProperties
8953				err = json.Unmarshal(*v, &productContractProperties)
8954				if err != nil {
8955					return err
8956				}
8957				pc.ProductContractProperties = &productContractProperties
8958			}
8959		case "id":
8960			if v != nil {
8961				var ID string
8962				err = json.Unmarshal(*v, &ID)
8963				if err != nil {
8964					return err
8965				}
8966				pc.ID = &ID
8967			}
8968		case "name":
8969			if v != nil {
8970				var name string
8971				err = json.Unmarshal(*v, &name)
8972				if err != nil {
8973					return err
8974				}
8975				pc.Name = &name
8976			}
8977		case "type":
8978			if v != nil {
8979				var typeVar string
8980				err = json.Unmarshal(*v, &typeVar)
8981				if err != nil {
8982					return err
8983				}
8984				pc.Type = &typeVar
8985			}
8986		}
8987	}
8988
8989	return nil
8990}
8991
8992// ProductContractProperties product profile.
8993type ProductContractProperties struct {
8994	// DisplayName - Product name.
8995	DisplayName *string `json:"displayName,omitempty"`
8996	// Description - Product description. May include HTML formatting tags.
8997	Description *string `json:"description,omitempty"`
8998	// 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.
8999	Terms *string `json:"terms,omitempty"`
9000	// 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.
9001	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
9002	// 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.
9003	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
9004	// 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.
9005	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
9006	// 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'
9007	State ProductState `json:"state,omitempty"`
9008}
9009
9010// ProductEntityBaseParameters product Entity Base Parameters
9011type ProductEntityBaseParameters struct {
9012	// Description - Product description. May include HTML formatting tags.
9013	Description *string `json:"description,omitempty"`
9014	// 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.
9015	Terms *string `json:"terms,omitempty"`
9016	// 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.
9017	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
9018	// 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.
9019	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
9020	// 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.
9021	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
9022	// 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'
9023	State ProductState `json:"state,omitempty"`
9024}
9025
9026// ProductTagResourceContractProperties product profile.
9027type ProductTagResourceContractProperties struct {
9028	// ID - Identifier of the product in the form of /products/{productId}
9029	ID *string `json:"id,omitempty"`
9030	// Name - Product name.
9031	Name *string `json:"name,omitempty"`
9032	// Description - Product description. May include HTML formatting tags.
9033	Description *string `json:"description,omitempty"`
9034	// 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.
9035	Terms *string `json:"terms,omitempty"`
9036	// 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.
9037	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
9038	// 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.
9039	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
9040	// 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.
9041	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
9042	// 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'
9043	State ProductState `json:"state,omitempty"`
9044}
9045
9046// ProductUpdateParameters product Update parameters.
9047type ProductUpdateParameters struct {
9048	// ProductUpdateProperties - Product entity Update contract properties.
9049	*ProductUpdateProperties `json:"properties,omitempty"`
9050}
9051
9052// MarshalJSON is the custom marshaler for ProductUpdateParameters.
9053func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) {
9054	objectMap := make(map[string]interface{})
9055	if pup.ProductUpdateProperties != nil {
9056		objectMap["properties"] = pup.ProductUpdateProperties
9057	}
9058	return json.Marshal(objectMap)
9059}
9060
9061// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct.
9062func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error {
9063	var m map[string]*json.RawMessage
9064	err := json.Unmarshal(body, &m)
9065	if err != nil {
9066		return err
9067	}
9068	for k, v := range m {
9069		switch k {
9070		case "properties":
9071			if v != nil {
9072				var productUpdateProperties ProductUpdateProperties
9073				err = json.Unmarshal(*v, &productUpdateProperties)
9074				if err != nil {
9075					return err
9076				}
9077				pup.ProductUpdateProperties = &productUpdateProperties
9078			}
9079		}
9080	}
9081
9082	return nil
9083}
9084
9085// ProductUpdateProperties parameters supplied to the Update Product operation.
9086type ProductUpdateProperties struct {
9087	// DisplayName - Product name.
9088	DisplayName *string `json:"displayName,omitempty"`
9089	// Description - Product description. May include HTML formatting tags.
9090	Description *string `json:"description,omitempty"`
9091	// 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.
9092	Terms *string `json:"terms,omitempty"`
9093	// 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.
9094	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
9095	// 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.
9096	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
9097	// 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.
9098	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
9099	// 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'
9100	State ProductState `json:"state,omitempty"`
9101}
9102
9103// PropertyValueContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
9104type PropertyValueContract struct {
9105	autorest.Response `json:"-"`
9106	// Value - This is secret value of the NamedValue entity.
9107	Value *string `json:"value,omitempty"`
9108}
9109
9110// QuotaCounterCollection paged Quota Counter list representation.
9111type QuotaCounterCollection struct {
9112	autorest.Response `json:"-"`
9113	// Value - Quota counter values.
9114	Value *[]QuotaCounterContract `json:"value,omitempty"`
9115	// Count - Total record count number across all pages.
9116	Count *int64 `json:"count,omitempty"`
9117	// NextLink - Next page link if any.
9118	NextLink *string `json:"nextLink,omitempty"`
9119}
9120
9121// QuotaCounterContract quota counter details.
9122type QuotaCounterContract struct {
9123	autorest.Response `json:"-"`
9124	// CounterKey - The Key value of the Counter. Must not be empty.
9125	CounterKey *string `json:"counterKey,omitempty"`
9126	// PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty.
9127	PeriodKey *string `json:"periodKey,omitempty"`
9128	// 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.
9129	PeriodStartTime *date.Time `json:"periodStartTime,omitempty"`
9130	// 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.
9131	PeriodEndTime *date.Time `json:"periodEndTime,omitempty"`
9132	// Value - Quota Value Properties
9133	Value *QuotaCounterValueContractProperties `json:"value,omitempty"`
9134}
9135
9136// QuotaCounterValueContract quota counter value details.
9137type QuotaCounterValueContract struct {
9138	// QuotaCounterValueContractProperties - Quota counter Value Properties.
9139	*QuotaCounterValueContractProperties `json:"value,omitempty"`
9140}
9141
9142// MarshalJSON is the custom marshaler for QuotaCounterValueContract.
9143func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) {
9144	objectMap := make(map[string]interface{})
9145	if qcvc.QuotaCounterValueContractProperties != nil {
9146		objectMap["value"] = qcvc.QuotaCounterValueContractProperties
9147	}
9148	return json.Marshal(objectMap)
9149}
9150
9151// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct.
9152func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error {
9153	var m map[string]*json.RawMessage
9154	err := json.Unmarshal(body, &m)
9155	if err != nil {
9156		return err
9157	}
9158	for k, v := range m {
9159		switch k {
9160		case "value":
9161			if v != nil {
9162				var quotaCounterValueContractProperties QuotaCounterValueContractProperties
9163				err = json.Unmarshal(*v, &quotaCounterValueContractProperties)
9164				if err != nil {
9165					return err
9166				}
9167				qcvc.QuotaCounterValueContractProperties = &quotaCounterValueContractProperties
9168			}
9169		}
9170	}
9171
9172	return nil
9173}
9174
9175// QuotaCounterValueContractProperties quota counter value details.
9176type QuotaCounterValueContractProperties struct {
9177	// CallsCount - Number of times Counter was called.
9178	CallsCount *int32 `json:"callsCount,omitempty"`
9179	// KbTransferred - Data Transferred in KiloBytes.
9180	KbTransferred *float64 `json:"kbTransferred,omitempty"`
9181}
9182
9183// RecipientEmailCollection paged Recipient User list representation.
9184type RecipientEmailCollection struct {
9185	autorest.Response `json:"-"`
9186	// Value - Page values.
9187	Value *[]RecipientEmailContract `json:"value,omitempty"`
9188	// NextLink - Next page link if any.
9189	NextLink *string `json:"nextLink,omitempty"`
9190}
9191
9192// RecipientEmailContract recipient Email details.
9193type RecipientEmailContract struct {
9194	autorest.Response `json:"-"`
9195	// RecipientEmailContractProperties - Recipient Email contract properties.
9196	*RecipientEmailContractProperties `json:"properties,omitempty"`
9197	// ID - READ-ONLY; Resource ID.
9198	ID *string `json:"id,omitempty"`
9199	// Name - READ-ONLY; Resource name.
9200	Name *string `json:"name,omitempty"`
9201	// Type - READ-ONLY; Resource type for API Management resource.
9202	Type *string `json:"type,omitempty"`
9203}
9204
9205// MarshalJSON is the custom marshaler for RecipientEmailContract.
9206func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) {
9207	objectMap := make(map[string]interface{})
9208	if rec.RecipientEmailContractProperties != nil {
9209		objectMap["properties"] = rec.RecipientEmailContractProperties
9210	}
9211	return json.Marshal(objectMap)
9212}
9213
9214// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct.
9215func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error {
9216	var m map[string]*json.RawMessage
9217	err := json.Unmarshal(body, &m)
9218	if err != nil {
9219		return err
9220	}
9221	for k, v := range m {
9222		switch k {
9223		case "properties":
9224			if v != nil {
9225				var recipientEmailContractProperties RecipientEmailContractProperties
9226				err = json.Unmarshal(*v, &recipientEmailContractProperties)
9227				if err != nil {
9228					return err
9229				}
9230				rec.RecipientEmailContractProperties = &recipientEmailContractProperties
9231			}
9232		case "id":
9233			if v != nil {
9234				var ID string
9235				err = json.Unmarshal(*v, &ID)
9236				if err != nil {
9237					return err
9238				}
9239				rec.ID = &ID
9240			}
9241		case "name":
9242			if v != nil {
9243				var name string
9244				err = json.Unmarshal(*v, &name)
9245				if err != nil {
9246					return err
9247				}
9248				rec.Name = &name
9249			}
9250		case "type":
9251			if v != nil {
9252				var typeVar string
9253				err = json.Unmarshal(*v, &typeVar)
9254				if err != nil {
9255					return err
9256				}
9257				rec.Type = &typeVar
9258			}
9259		}
9260	}
9261
9262	return nil
9263}
9264
9265// RecipientEmailContractProperties recipient Email Contract Properties.
9266type RecipientEmailContractProperties struct {
9267	// Email - User Email subscribed to notification.
9268	Email *string `json:"email,omitempty"`
9269}
9270
9271// RecipientsContractProperties notification Parameter contract.
9272type RecipientsContractProperties struct {
9273	// Emails - List of Emails subscribed for the notification.
9274	Emails *[]string `json:"emails,omitempty"`
9275	// Users - List of Users subscribed for the notification.
9276	Users *[]string `json:"users,omitempty"`
9277}
9278
9279// RecipientUserCollection paged Recipient User list representation.
9280type RecipientUserCollection struct {
9281	autorest.Response `json:"-"`
9282	// Value - Page values.
9283	Value *[]RecipientUserContract `json:"value,omitempty"`
9284	// NextLink - Next page link if any.
9285	NextLink *string `json:"nextLink,omitempty"`
9286}
9287
9288// RecipientUserContract recipient User details.
9289type RecipientUserContract struct {
9290	autorest.Response `json:"-"`
9291	// RecipientUsersContractProperties - Recipient User entity contract properties.
9292	*RecipientUsersContractProperties `json:"properties,omitempty"`
9293	// ID - READ-ONLY; Resource ID.
9294	ID *string `json:"id,omitempty"`
9295	// Name - READ-ONLY; Resource name.
9296	Name *string `json:"name,omitempty"`
9297	// Type - READ-ONLY; Resource type for API Management resource.
9298	Type *string `json:"type,omitempty"`
9299}
9300
9301// MarshalJSON is the custom marshaler for RecipientUserContract.
9302func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) {
9303	objectMap := make(map[string]interface{})
9304	if ruc.RecipientUsersContractProperties != nil {
9305		objectMap["properties"] = ruc.RecipientUsersContractProperties
9306	}
9307	return json.Marshal(objectMap)
9308}
9309
9310// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct.
9311func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error {
9312	var m map[string]*json.RawMessage
9313	err := json.Unmarshal(body, &m)
9314	if err != nil {
9315		return err
9316	}
9317	for k, v := range m {
9318		switch k {
9319		case "properties":
9320			if v != nil {
9321				var recipientUsersContractProperties RecipientUsersContractProperties
9322				err = json.Unmarshal(*v, &recipientUsersContractProperties)
9323				if err != nil {
9324					return err
9325				}
9326				ruc.RecipientUsersContractProperties = &recipientUsersContractProperties
9327			}
9328		case "id":
9329			if v != nil {
9330				var ID string
9331				err = json.Unmarshal(*v, &ID)
9332				if err != nil {
9333					return err
9334				}
9335				ruc.ID = &ID
9336			}
9337		case "name":
9338			if v != nil {
9339				var name string
9340				err = json.Unmarshal(*v, &name)
9341				if err != nil {
9342					return err
9343				}
9344				ruc.Name = &name
9345			}
9346		case "type":
9347			if v != nil {
9348				var typeVar string
9349				err = json.Unmarshal(*v, &typeVar)
9350				if err != nil {
9351					return err
9352				}
9353				ruc.Type = &typeVar
9354			}
9355		}
9356	}
9357
9358	return nil
9359}
9360
9361// RecipientUsersContractProperties recipient User Contract Properties.
9362type RecipientUsersContractProperties struct {
9363	// UserID - API Management UserId subscribed to notification.
9364	UserID *string `json:"userId,omitempty"`
9365}
9366
9367// RegionContract region profile.
9368type RegionContract struct {
9369	// Name - READ-ONLY; Region name.
9370	Name *string `json:"name,omitempty"`
9371	// IsMasterRegion - whether Region is the master region.
9372	IsMasterRegion *bool `json:"isMasterRegion,omitempty"`
9373	// IsDeleted - whether Region is deleted.
9374	IsDeleted *bool `json:"isDeleted,omitempty"`
9375}
9376
9377// MarshalJSON is the custom marshaler for RegionContract.
9378func (rc RegionContract) MarshalJSON() ([]byte, error) {
9379	objectMap := make(map[string]interface{})
9380	if rc.IsMasterRegion != nil {
9381		objectMap["isMasterRegion"] = rc.IsMasterRegion
9382	}
9383	if rc.IsDeleted != nil {
9384		objectMap["isDeleted"] = rc.IsDeleted
9385	}
9386	return json.Marshal(objectMap)
9387}
9388
9389// RegionListResult lists Regions operation response details.
9390type RegionListResult struct {
9391	autorest.Response `json:"-"`
9392	// Value - Lists of Regions.
9393	Value *[]RegionContract `json:"value,omitempty"`
9394	// Count - Total record count number across all pages.
9395	Count *int64 `json:"count,omitempty"`
9396	// NextLink - Next page link if any.
9397	NextLink *string `json:"nextLink,omitempty"`
9398}
9399
9400// RegionListResultIterator provides access to a complete listing of RegionContract values.
9401type RegionListResultIterator struct {
9402	i    int
9403	page RegionListResultPage
9404}
9405
9406// NextWithContext advances to the next value.  If there was an error making
9407// the request the iterator does not advance and the error is returned.
9408func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) {
9409	if tracing.IsEnabled() {
9410		ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext")
9411		defer func() {
9412			sc := -1
9413			if iter.Response().Response.Response != nil {
9414				sc = iter.Response().Response.Response.StatusCode
9415			}
9416			tracing.EndSpan(ctx, sc, err)
9417		}()
9418	}
9419	iter.i++
9420	if iter.i < len(iter.page.Values()) {
9421		return nil
9422	}
9423	err = iter.page.NextWithContext(ctx)
9424	if err != nil {
9425		iter.i--
9426		return err
9427	}
9428	iter.i = 0
9429	return nil
9430}
9431
9432// Next advances to the next value.  If there was an error making
9433// the request the iterator does not advance and the error is returned.
9434// Deprecated: Use NextWithContext() instead.
9435func (iter *RegionListResultIterator) Next() error {
9436	return iter.NextWithContext(context.Background())
9437}
9438
9439// NotDone returns true if the enumeration should be started or is not yet complete.
9440func (iter RegionListResultIterator) NotDone() bool {
9441	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9442}
9443
9444// Response returns the raw server response from the last page request.
9445func (iter RegionListResultIterator) Response() RegionListResult {
9446	return iter.page.Response()
9447}
9448
9449// Value returns the current value or a zero-initialized value if the
9450// iterator has advanced beyond the end of the collection.
9451func (iter RegionListResultIterator) Value() RegionContract {
9452	if !iter.page.NotDone() {
9453		return RegionContract{}
9454	}
9455	return iter.page.Values()[iter.i]
9456}
9457
9458// Creates a new instance of the RegionListResultIterator type.
9459func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator {
9460	return RegionListResultIterator{page: page}
9461}
9462
9463// IsEmpty returns true if the ListResult contains no values.
9464func (rlr RegionListResult) IsEmpty() bool {
9465	return rlr.Value == nil || len(*rlr.Value) == 0
9466}
9467
9468// hasNextLink returns true if the NextLink is not empty.
9469func (rlr RegionListResult) hasNextLink() bool {
9470	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
9471}
9472
9473// regionListResultPreparer prepares a request to retrieve the next set of results.
9474// It returns nil if no more results exist.
9475func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) {
9476	if !rlr.hasNextLink() {
9477		return nil, nil
9478	}
9479	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9480		autorest.AsJSON(),
9481		autorest.AsGet(),
9482		autorest.WithBaseURL(to.String(rlr.NextLink)))
9483}
9484
9485// RegionListResultPage contains a page of RegionContract values.
9486type RegionListResultPage struct {
9487	fn  func(context.Context, RegionListResult) (RegionListResult, error)
9488	rlr RegionListResult
9489}
9490
9491// NextWithContext advances to the next page of values.  If there was an error making
9492// the request the page does not advance and the error is returned.
9493func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) {
9494	if tracing.IsEnabled() {
9495		ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext")
9496		defer func() {
9497			sc := -1
9498			if page.Response().Response.Response != nil {
9499				sc = page.Response().Response.Response.StatusCode
9500			}
9501			tracing.EndSpan(ctx, sc, err)
9502		}()
9503	}
9504	for {
9505		next, err := page.fn(ctx, page.rlr)
9506		if err != nil {
9507			return err
9508		}
9509		page.rlr = next
9510		if !next.hasNextLink() || !next.IsEmpty() {
9511			break
9512		}
9513	}
9514	return nil
9515}
9516
9517// Next advances to the next page of values.  If there was an error making
9518// the request the page does not advance and the error is returned.
9519// Deprecated: Use NextWithContext() instead.
9520func (page *RegionListResultPage) Next() error {
9521	return page.NextWithContext(context.Background())
9522}
9523
9524// NotDone returns true if the page enumeration should be started or is not yet complete.
9525func (page RegionListResultPage) NotDone() bool {
9526	return !page.rlr.IsEmpty()
9527}
9528
9529// Response returns the raw server response from the last page request.
9530func (page RegionListResultPage) Response() RegionListResult {
9531	return page.rlr
9532}
9533
9534// Values returns the slice of values for the current page or nil if there are no values.
9535func (page RegionListResultPage) Values() []RegionContract {
9536	if page.rlr.IsEmpty() {
9537		return nil
9538	}
9539	return *page.rlr.Value
9540}
9541
9542// Creates a new instance of the RegionListResultPage type.
9543func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage {
9544	return RegionListResultPage{
9545		fn:  getNextPage,
9546		rlr: cur,
9547	}
9548}
9549
9550// RegistrationDelegationSettingsProperties user registration delegation settings properties.
9551type RegistrationDelegationSettingsProperties struct {
9552	// Enabled - Enable or disable delegation for user registration.
9553	Enabled *bool `json:"enabled,omitempty"`
9554}
9555
9556// ReportCollection paged Report records list representation.
9557type ReportCollection struct {
9558	autorest.Response `json:"-"`
9559	// Value - Page values.
9560	Value *[]ReportRecordContract `json:"value,omitempty"`
9561	// Count - Total record count number across all pages.
9562	Count *int64 `json:"count,omitempty"`
9563	// NextLink - Next page link if any.
9564	NextLink *string `json:"nextLink,omitempty"`
9565}
9566
9567// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values.
9568type ReportCollectionIterator struct {
9569	i    int
9570	page ReportCollectionPage
9571}
9572
9573// NextWithContext advances to the next value.  If there was an error making
9574// the request the iterator does not advance and the error is returned.
9575func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) {
9576	if tracing.IsEnabled() {
9577		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext")
9578		defer func() {
9579			sc := -1
9580			if iter.Response().Response.Response != nil {
9581				sc = iter.Response().Response.Response.StatusCode
9582			}
9583			tracing.EndSpan(ctx, sc, err)
9584		}()
9585	}
9586	iter.i++
9587	if iter.i < len(iter.page.Values()) {
9588		return nil
9589	}
9590	err = iter.page.NextWithContext(ctx)
9591	if err != nil {
9592		iter.i--
9593		return err
9594	}
9595	iter.i = 0
9596	return nil
9597}
9598
9599// Next advances to the next value.  If there was an error making
9600// the request the iterator does not advance and the error is returned.
9601// Deprecated: Use NextWithContext() instead.
9602func (iter *ReportCollectionIterator) Next() error {
9603	return iter.NextWithContext(context.Background())
9604}
9605
9606// NotDone returns true if the enumeration should be started or is not yet complete.
9607func (iter ReportCollectionIterator) NotDone() bool {
9608	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9609}
9610
9611// Response returns the raw server response from the last page request.
9612func (iter ReportCollectionIterator) Response() ReportCollection {
9613	return iter.page.Response()
9614}
9615
9616// Value returns the current value or a zero-initialized value if the
9617// iterator has advanced beyond the end of the collection.
9618func (iter ReportCollectionIterator) Value() ReportRecordContract {
9619	if !iter.page.NotDone() {
9620		return ReportRecordContract{}
9621	}
9622	return iter.page.Values()[iter.i]
9623}
9624
9625// Creates a new instance of the ReportCollectionIterator type.
9626func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator {
9627	return ReportCollectionIterator{page: page}
9628}
9629
9630// IsEmpty returns true if the ListResult contains no values.
9631func (rc ReportCollection) IsEmpty() bool {
9632	return rc.Value == nil || len(*rc.Value) == 0
9633}
9634
9635// hasNextLink returns true if the NextLink is not empty.
9636func (rc ReportCollection) hasNextLink() bool {
9637	return rc.NextLink != nil && len(*rc.NextLink) != 0
9638}
9639
9640// reportCollectionPreparer prepares a request to retrieve the next set of results.
9641// It returns nil if no more results exist.
9642func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) {
9643	if !rc.hasNextLink() {
9644		return nil, nil
9645	}
9646	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9647		autorest.AsJSON(),
9648		autorest.AsGet(),
9649		autorest.WithBaseURL(to.String(rc.NextLink)))
9650}
9651
9652// ReportCollectionPage contains a page of ReportRecordContract values.
9653type ReportCollectionPage struct {
9654	fn func(context.Context, ReportCollection) (ReportCollection, error)
9655	rc ReportCollection
9656}
9657
9658// NextWithContext advances to the next page of values.  If there was an error making
9659// the request the page does not advance and the error is returned.
9660func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) {
9661	if tracing.IsEnabled() {
9662		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext")
9663		defer func() {
9664			sc := -1
9665			if page.Response().Response.Response != nil {
9666				sc = page.Response().Response.Response.StatusCode
9667			}
9668			tracing.EndSpan(ctx, sc, err)
9669		}()
9670	}
9671	for {
9672		next, err := page.fn(ctx, page.rc)
9673		if err != nil {
9674			return err
9675		}
9676		page.rc = next
9677		if !next.hasNextLink() || !next.IsEmpty() {
9678			break
9679		}
9680	}
9681	return nil
9682}
9683
9684// Next advances to the next page of values.  If there was an error making
9685// the request the page does not advance and the error is returned.
9686// Deprecated: Use NextWithContext() instead.
9687func (page *ReportCollectionPage) Next() error {
9688	return page.NextWithContext(context.Background())
9689}
9690
9691// NotDone returns true if the page enumeration should be started or is not yet complete.
9692func (page ReportCollectionPage) NotDone() bool {
9693	return !page.rc.IsEmpty()
9694}
9695
9696// Response returns the raw server response from the last page request.
9697func (page ReportCollectionPage) Response() ReportCollection {
9698	return page.rc
9699}
9700
9701// Values returns the slice of values for the current page or nil if there are no values.
9702func (page ReportCollectionPage) Values() []ReportRecordContract {
9703	if page.rc.IsEmpty() {
9704		return nil
9705	}
9706	return *page.rc.Value
9707}
9708
9709// Creates a new instance of the ReportCollectionPage type.
9710func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage {
9711	return ReportCollectionPage{
9712		fn: getNextPage,
9713		rc: cur,
9714	}
9715}
9716
9717// ReportRecordContract report data.
9718type ReportRecordContract struct {
9719	// Name - Name depending on report endpoint specifies product, API, operation or developer name.
9720	Name *string `json:"name,omitempty"`
9721	// Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
9722	Timestamp *date.Time `json:"timestamp,omitempty"`
9723	// 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).
9724	Interval *string `json:"interval,omitempty"`
9725	// Country - Country to which this record data is related.
9726	Country *string `json:"country,omitempty"`
9727	// Region - Country region to which this record data is related.
9728	Region *string `json:"region,omitempty"`
9729	// Zip - Zip code to which this record data is related.
9730	Zip *string `json:"zip,omitempty"`
9731	// UserID - READ-ONLY; User identifier path. /users/{userId}
9732	UserID *string `json:"userId,omitempty"`
9733	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
9734	ProductID *string `json:"productId,omitempty"`
9735	// APIID - API identifier path. /apis/{apiId}
9736	APIID *string `json:"apiId,omitempty"`
9737	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
9738	OperationID *string `json:"operationId,omitempty"`
9739	// APIRegion - API region identifier.
9740	APIRegion *string `json:"apiRegion,omitempty"`
9741	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
9742	SubscriptionID *string `json:"subscriptionId,omitempty"`
9743	// CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect
9744	CallCountSuccess *int32 `json:"callCountSuccess,omitempty"`
9745	// CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests
9746	CallCountBlocked *int32 `json:"callCountBlocked,omitempty"`
9747	// 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
9748	CallCountFailed *int32 `json:"callCountFailed,omitempty"`
9749	// CallCountOther - Number of other calls.
9750	CallCountOther *int32 `json:"callCountOther,omitempty"`
9751	// CallCountTotal - Total number of calls.
9752	CallCountTotal *int32 `json:"callCountTotal,omitempty"`
9753	// Bandwidth - Bandwidth consumed.
9754	Bandwidth *int64 `json:"bandwidth,omitempty"`
9755	// CacheHitCount - Number of times when content was served from cache policy.
9756	CacheHitCount *int32 `json:"cacheHitCount,omitempty"`
9757	// CacheMissCount - Number of times content was fetched from backend.
9758	CacheMissCount *int32 `json:"cacheMissCount,omitempty"`
9759	// APITimeAvg - Average time it took to process request.
9760	APITimeAvg *float64 `json:"apiTimeAvg,omitempty"`
9761	// APITimeMin - Minimum time it took to process request.
9762	APITimeMin *float64 `json:"apiTimeMin,omitempty"`
9763	// APITimeMax - Maximum time it took to process request.
9764	APITimeMax *float64 `json:"apiTimeMax,omitempty"`
9765	// ServiceTimeAvg - Average time it took to process request on backend.
9766	ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"`
9767	// ServiceTimeMin - Minimum time it took to process request on backend.
9768	ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"`
9769	// ServiceTimeMax - Maximum time it took to process request on backend.
9770	ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"`
9771}
9772
9773// MarshalJSON is the custom marshaler for ReportRecordContract.
9774func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) {
9775	objectMap := make(map[string]interface{})
9776	if rrc.Name != nil {
9777		objectMap["name"] = rrc.Name
9778	}
9779	if rrc.Timestamp != nil {
9780		objectMap["timestamp"] = rrc.Timestamp
9781	}
9782	if rrc.Interval != nil {
9783		objectMap["interval"] = rrc.Interval
9784	}
9785	if rrc.Country != nil {
9786		objectMap["country"] = rrc.Country
9787	}
9788	if rrc.Region != nil {
9789		objectMap["region"] = rrc.Region
9790	}
9791	if rrc.Zip != nil {
9792		objectMap["zip"] = rrc.Zip
9793	}
9794	if rrc.APIID != nil {
9795		objectMap["apiId"] = rrc.APIID
9796	}
9797	if rrc.OperationID != nil {
9798		objectMap["operationId"] = rrc.OperationID
9799	}
9800	if rrc.APIRegion != nil {
9801		objectMap["apiRegion"] = rrc.APIRegion
9802	}
9803	if rrc.SubscriptionID != nil {
9804		objectMap["subscriptionId"] = rrc.SubscriptionID
9805	}
9806	if rrc.CallCountSuccess != nil {
9807		objectMap["callCountSuccess"] = rrc.CallCountSuccess
9808	}
9809	if rrc.CallCountBlocked != nil {
9810		objectMap["callCountBlocked"] = rrc.CallCountBlocked
9811	}
9812	if rrc.CallCountFailed != nil {
9813		objectMap["callCountFailed"] = rrc.CallCountFailed
9814	}
9815	if rrc.CallCountOther != nil {
9816		objectMap["callCountOther"] = rrc.CallCountOther
9817	}
9818	if rrc.CallCountTotal != nil {
9819		objectMap["callCountTotal"] = rrc.CallCountTotal
9820	}
9821	if rrc.Bandwidth != nil {
9822		objectMap["bandwidth"] = rrc.Bandwidth
9823	}
9824	if rrc.CacheHitCount != nil {
9825		objectMap["cacheHitCount"] = rrc.CacheHitCount
9826	}
9827	if rrc.CacheMissCount != nil {
9828		objectMap["cacheMissCount"] = rrc.CacheMissCount
9829	}
9830	if rrc.APITimeAvg != nil {
9831		objectMap["apiTimeAvg"] = rrc.APITimeAvg
9832	}
9833	if rrc.APITimeMin != nil {
9834		objectMap["apiTimeMin"] = rrc.APITimeMin
9835	}
9836	if rrc.APITimeMax != nil {
9837		objectMap["apiTimeMax"] = rrc.APITimeMax
9838	}
9839	if rrc.ServiceTimeAvg != nil {
9840		objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg
9841	}
9842	if rrc.ServiceTimeMin != nil {
9843		objectMap["serviceTimeMin"] = rrc.ServiceTimeMin
9844	}
9845	if rrc.ServiceTimeMax != nil {
9846		objectMap["serviceTimeMax"] = rrc.ServiceTimeMax
9847	}
9848	return json.Marshal(objectMap)
9849}
9850
9851// RepresentationContract operation request/response representation details.
9852type RepresentationContract struct {
9853	// ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml.
9854	ContentType *string `json:"contentType,omitempty"`
9855	// Sample - An example of the representation.
9856	Sample *string `json:"sample,omitempty"`
9857	// SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
9858	SchemaID *string `json:"schemaId,omitempty"`
9859	// TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
9860	TypeName *string `json:"typeName,omitempty"`
9861	// FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
9862	FormParameters *[]ParameterContract `json:"formParameters,omitempty"`
9863}
9864
9865// RequestContract operation request details.
9866type RequestContract struct {
9867	// Description - Operation request description.
9868	Description *string `json:"description,omitempty"`
9869	// QueryParameters - Collection of operation request query parameters.
9870	QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"`
9871	// Headers - Collection of operation request headers.
9872	Headers *[]ParameterContract `json:"headers,omitempty"`
9873	// Representations - Collection of operation request representations.
9874	Representations *[]RepresentationContract `json:"representations,omitempty"`
9875}
9876
9877// RequestReportCollection paged Report records list representation.
9878type RequestReportCollection struct {
9879	autorest.Response `json:"-"`
9880	// Value - Page values.
9881	Value *[]RequestReportRecordContract `json:"value,omitempty"`
9882	// Count - Total record count number across all pages.
9883	Count *int64 `json:"count,omitempty"`
9884}
9885
9886// RequestReportRecordContract request Report data.
9887type RequestReportRecordContract struct {
9888	// APIID - API identifier path. /apis/{apiId}
9889	APIID *string `json:"apiId,omitempty"`
9890	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
9891	OperationID *string `json:"operationId,omitempty"`
9892	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
9893	ProductID *string `json:"productId,omitempty"`
9894	// UserID - READ-ONLY; User identifier path. /users/{userId}
9895	UserID *string `json:"userId,omitempty"`
9896	// Method - The HTTP method associated with this request..
9897	Method *string `json:"method,omitempty"`
9898	// URL - The full URL associated with this request.
9899	URL *string `json:"url,omitempty"`
9900	// IPAddress - The client IP address associated with this request.
9901	IPAddress *string `json:"ipAddress,omitempty"`
9902	// BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend.
9903	BackendResponseCode *string `json:"backendResponseCode,omitempty"`
9904	// ResponseCode - The HTTP status code returned by the gateway.
9905	ResponseCode *int32 `json:"responseCode,omitempty"`
9906	// ResponseSize - The size of the response returned by the gateway.
9907	ResponseSize *int32 `json:"responseSize,omitempty"`
9908	// Timestamp - The date and time when this request was received by the gateway in ISO 8601 format.
9909	Timestamp *date.Time `json:"timestamp,omitempty"`
9910	// 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.
9911	Cache *string `json:"cache,omitempty"`
9912	// APITime - The total time it took to process this request.
9913	APITime *float64 `json:"apiTime,omitempty"`
9914	// ServiceTime - he time it took to forward this request to the backend and get the response back.
9915	ServiceTime *float64 `json:"serviceTime,omitempty"`
9916	// APIRegion - Azure region where the gateway that processed this request is located.
9917	APIRegion *string `json:"apiRegion,omitempty"`
9918	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
9919	SubscriptionID *string `json:"subscriptionId,omitempty"`
9920	// RequestID - Request Identifier.
9921	RequestID *string `json:"requestId,omitempty"`
9922	// RequestSize - The size of this request..
9923	RequestSize *int32 `json:"requestSize,omitempty"`
9924}
9925
9926// MarshalJSON is the custom marshaler for RequestReportRecordContract.
9927func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) {
9928	objectMap := make(map[string]interface{})
9929	if rrrc.APIID != nil {
9930		objectMap["apiId"] = rrrc.APIID
9931	}
9932	if rrrc.OperationID != nil {
9933		objectMap["operationId"] = rrrc.OperationID
9934	}
9935	if rrrc.Method != nil {
9936		objectMap["method"] = rrrc.Method
9937	}
9938	if rrrc.URL != nil {
9939		objectMap["url"] = rrrc.URL
9940	}
9941	if rrrc.IPAddress != nil {
9942		objectMap["ipAddress"] = rrrc.IPAddress
9943	}
9944	if rrrc.BackendResponseCode != nil {
9945		objectMap["backendResponseCode"] = rrrc.BackendResponseCode
9946	}
9947	if rrrc.ResponseCode != nil {
9948		objectMap["responseCode"] = rrrc.ResponseCode
9949	}
9950	if rrrc.ResponseSize != nil {
9951		objectMap["responseSize"] = rrrc.ResponseSize
9952	}
9953	if rrrc.Timestamp != nil {
9954		objectMap["timestamp"] = rrrc.Timestamp
9955	}
9956	if rrrc.Cache != nil {
9957		objectMap["cache"] = rrrc.Cache
9958	}
9959	if rrrc.APITime != nil {
9960		objectMap["apiTime"] = rrrc.APITime
9961	}
9962	if rrrc.ServiceTime != nil {
9963		objectMap["serviceTime"] = rrrc.ServiceTime
9964	}
9965	if rrrc.APIRegion != nil {
9966		objectMap["apiRegion"] = rrrc.APIRegion
9967	}
9968	if rrrc.SubscriptionID != nil {
9969		objectMap["subscriptionId"] = rrrc.SubscriptionID
9970	}
9971	if rrrc.RequestID != nil {
9972		objectMap["requestId"] = rrrc.RequestID
9973	}
9974	if rrrc.RequestSize != nil {
9975		objectMap["requestSize"] = rrrc.RequestSize
9976	}
9977	return json.Marshal(objectMap)
9978}
9979
9980// Resource the Resource definition.
9981type Resource struct {
9982	// ID - READ-ONLY; Resource ID.
9983	ID *string `json:"id,omitempty"`
9984	// Name - READ-ONLY; Resource name.
9985	Name *string `json:"name,omitempty"`
9986	// Type - READ-ONLY; Resource type for API Management resource.
9987	Type *string `json:"type,omitempty"`
9988}
9989
9990// MarshalJSON is the custom marshaler for Resource.
9991func (r Resource) MarshalJSON() ([]byte, error) {
9992	objectMap := make(map[string]interface{})
9993	return json.Marshal(objectMap)
9994}
9995
9996// ResourceLocationDataContract resource location data properties.
9997type ResourceLocationDataContract struct {
9998	// Name - A canonical name for the geographic or physical location.
9999	Name *string `json:"name,omitempty"`
10000	// City - The city or locality where the resource is located.
10001	City *string `json:"city,omitempty"`
10002	// District - The district, state, or province where the resource is located.
10003	District *string `json:"district,omitempty"`
10004	// CountryOrRegion - The country or region where the resource is located.
10005	CountryOrRegion *string `json:"countryOrRegion,omitempty"`
10006}
10007
10008// ResourceSku describes an available API Management SKU.
10009type ResourceSku struct {
10010	// Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption'
10011	Name SkuType `json:"name,omitempty"`
10012}
10013
10014// ResourceSkuCapacity describes scaling information of a SKU.
10015type ResourceSkuCapacity struct {
10016	// Minimum - READ-ONLY; The minimum capacity.
10017	Minimum *int32 `json:"minimum,omitempty"`
10018	// Maximum - READ-ONLY; The maximum capacity that can be set.
10019	Maximum *int32 `json:"maximum,omitempty"`
10020	// Default - READ-ONLY; The default capacity.
10021	Default *int32 `json:"default,omitempty"`
10022	// ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone'
10023	ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"`
10024}
10025
10026// MarshalJSON is the custom marshaler for ResourceSkuCapacity.
10027func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) {
10028	objectMap := make(map[string]interface{})
10029	return json.Marshal(objectMap)
10030}
10031
10032// ResourceSkuResult describes an available API Management service SKU.
10033type ResourceSkuResult struct {
10034	// ResourceType - READ-ONLY; The type of resource the SKU applies to.
10035	ResourceType *string `json:"resourceType,omitempty"`
10036	// Sku - READ-ONLY; Specifies API Management SKU.
10037	Sku *ResourceSku `json:"sku,omitempty"`
10038	// Capacity - READ-ONLY; Specifies the number of API Management units.
10039	Capacity *ResourceSkuCapacity `json:"capacity,omitempty"`
10040}
10041
10042// MarshalJSON is the custom marshaler for ResourceSkuResult.
10043func (rsr ResourceSkuResult) MarshalJSON() ([]byte, error) {
10044	objectMap := make(map[string]interface{})
10045	return json.Marshal(objectMap)
10046}
10047
10048// ResourceSkuResults the API Management service SKUs operation response.
10049type ResourceSkuResults struct {
10050	autorest.Response `json:"-"`
10051	// Value - The list of skus available for the service.
10052	Value *[]ResourceSkuResult `json:"value,omitempty"`
10053	// NextLink - The uri to fetch the next page of API Management service Skus.
10054	NextLink *string `json:"nextLink,omitempty"`
10055}
10056
10057// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values.
10058type ResourceSkuResultsIterator struct {
10059	i    int
10060	page ResourceSkuResultsPage
10061}
10062
10063// NextWithContext advances to the next value.  If there was an error making
10064// the request the iterator does not advance and the error is returned.
10065func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) {
10066	if tracing.IsEnabled() {
10067		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext")
10068		defer func() {
10069			sc := -1
10070			if iter.Response().Response.Response != nil {
10071				sc = iter.Response().Response.Response.StatusCode
10072			}
10073			tracing.EndSpan(ctx, sc, err)
10074		}()
10075	}
10076	iter.i++
10077	if iter.i < len(iter.page.Values()) {
10078		return nil
10079	}
10080	err = iter.page.NextWithContext(ctx)
10081	if err != nil {
10082		iter.i--
10083		return err
10084	}
10085	iter.i = 0
10086	return nil
10087}
10088
10089// Next advances to the next value.  If there was an error making
10090// the request the iterator does not advance and the error is returned.
10091// Deprecated: Use NextWithContext() instead.
10092func (iter *ResourceSkuResultsIterator) Next() error {
10093	return iter.NextWithContext(context.Background())
10094}
10095
10096// NotDone returns true if the enumeration should be started or is not yet complete.
10097func (iter ResourceSkuResultsIterator) NotDone() bool {
10098	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10099}
10100
10101// Response returns the raw server response from the last page request.
10102func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults {
10103	return iter.page.Response()
10104}
10105
10106// Value returns the current value or a zero-initialized value if the
10107// iterator has advanced beyond the end of the collection.
10108func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult {
10109	if !iter.page.NotDone() {
10110		return ResourceSkuResult{}
10111	}
10112	return iter.page.Values()[iter.i]
10113}
10114
10115// Creates a new instance of the ResourceSkuResultsIterator type.
10116func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator {
10117	return ResourceSkuResultsIterator{page: page}
10118}
10119
10120// IsEmpty returns true if the ListResult contains no values.
10121func (rsr ResourceSkuResults) IsEmpty() bool {
10122	return rsr.Value == nil || len(*rsr.Value) == 0
10123}
10124
10125// hasNextLink returns true if the NextLink is not empty.
10126func (rsr ResourceSkuResults) hasNextLink() bool {
10127	return rsr.NextLink != nil && len(*rsr.NextLink) != 0
10128}
10129
10130// resourceSkuResultsPreparer prepares a request to retrieve the next set of results.
10131// It returns nil if no more results exist.
10132func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) {
10133	if !rsr.hasNextLink() {
10134		return nil, nil
10135	}
10136	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10137		autorest.AsJSON(),
10138		autorest.AsGet(),
10139		autorest.WithBaseURL(to.String(rsr.NextLink)))
10140}
10141
10142// ResourceSkuResultsPage contains a page of ResourceSkuResult values.
10143type ResourceSkuResultsPage struct {
10144	fn  func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)
10145	rsr ResourceSkuResults
10146}
10147
10148// NextWithContext advances to the next page of values.  If there was an error making
10149// the request the page does not advance and the error is returned.
10150func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) {
10151	if tracing.IsEnabled() {
10152		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext")
10153		defer func() {
10154			sc := -1
10155			if page.Response().Response.Response != nil {
10156				sc = page.Response().Response.Response.StatusCode
10157			}
10158			tracing.EndSpan(ctx, sc, err)
10159		}()
10160	}
10161	for {
10162		next, err := page.fn(ctx, page.rsr)
10163		if err != nil {
10164			return err
10165		}
10166		page.rsr = next
10167		if !next.hasNextLink() || !next.IsEmpty() {
10168			break
10169		}
10170	}
10171	return nil
10172}
10173
10174// Next advances to the next page of values.  If there was an error making
10175// the request the page does not advance and the error is returned.
10176// Deprecated: Use NextWithContext() instead.
10177func (page *ResourceSkuResultsPage) Next() error {
10178	return page.NextWithContext(context.Background())
10179}
10180
10181// NotDone returns true if the page enumeration should be started or is not yet complete.
10182func (page ResourceSkuResultsPage) NotDone() bool {
10183	return !page.rsr.IsEmpty()
10184}
10185
10186// Response returns the raw server response from the last page request.
10187func (page ResourceSkuResultsPage) Response() ResourceSkuResults {
10188	return page.rsr
10189}
10190
10191// Values returns the slice of values for the current page or nil if there are no values.
10192func (page ResourceSkuResultsPage) Values() []ResourceSkuResult {
10193	if page.rsr.IsEmpty() {
10194		return nil
10195	}
10196	return *page.rsr.Value
10197}
10198
10199// Creates a new instance of the ResourceSkuResultsPage type.
10200func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage {
10201	return ResourceSkuResultsPage{
10202		fn:  getNextPage,
10203		rsr: cur,
10204	}
10205}
10206
10207// ResponseContract operation response details.
10208type ResponseContract struct {
10209	// StatusCode - Operation response HTTP status code.
10210	StatusCode *int32 `json:"statusCode,omitempty"`
10211	// Description - Operation response description.
10212	Description *string `json:"description,omitempty"`
10213	// Representations - Collection of operation response representations.
10214	Representations *[]RepresentationContract `json:"representations,omitempty"`
10215	// Headers - Collection of operation response headers.
10216	Headers *[]ParameterContract `json:"headers,omitempty"`
10217}
10218
10219// SamplingSettings sampling settings for Diagnostic.
10220type SamplingSettings struct {
10221	// SamplingType - Sampling type. Possible values include: 'Fixed'
10222	SamplingType SamplingType `json:"samplingType,omitempty"`
10223	// Percentage - Rate of sampling for fixed-rate sampling.
10224	Percentage *float64 `json:"percentage,omitempty"`
10225}
10226
10227// SaveConfigurationParameter save Tenant Configuration Contract details.
10228type SaveConfigurationParameter struct {
10229	// SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters.
10230	*SaveConfigurationParameterProperties `json:"properties,omitempty"`
10231}
10232
10233// MarshalJSON is the custom marshaler for SaveConfigurationParameter.
10234func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) {
10235	objectMap := make(map[string]interface{})
10236	if scp.SaveConfigurationParameterProperties != nil {
10237		objectMap["properties"] = scp.SaveConfigurationParameterProperties
10238	}
10239	return json.Marshal(objectMap)
10240}
10241
10242// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct.
10243func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error {
10244	var m map[string]*json.RawMessage
10245	err := json.Unmarshal(body, &m)
10246	if err != nil {
10247		return err
10248	}
10249	for k, v := range m {
10250		switch k {
10251		case "properties":
10252			if v != nil {
10253				var saveConfigurationParameterProperties SaveConfigurationParameterProperties
10254				err = json.Unmarshal(*v, &saveConfigurationParameterProperties)
10255				if err != nil {
10256					return err
10257				}
10258				scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties
10259			}
10260		}
10261	}
10262
10263	return nil
10264}
10265
10266// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation.
10267type SaveConfigurationParameterProperties struct {
10268	// Branch - The name of the Git branch in which to commit the current configuration snapshot.
10269	Branch *string `json:"branch,omitempty"`
10270	// 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.
10271	Force *bool `json:"force,omitempty"`
10272}
10273
10274// SchemaCollection the response of the list schema operation.
10275type SchemaCollection struct {
10276	autorest.Response `json:"-"`
10277	// Value - READ-ONLY; Api Schema Contract value.
10278	Value *[]SchemaContract `json:"value,omitempty"`
10279	// NextLink - READ-ONLY; Next page link if any.
10280	NextLink *string `json:"nextLink,omitempty"`
10281}
10282
10283// MarshalJSON is the custom marshaler for SchemaCollection.
10284func (sc SchemaCollection) MarshalJSON() ([]byte, error) {
10285	objectMap := make(map[string]interface{})
10286	return json.Marshal(objectMap)
10287}
10288
10289// SchemaCollectionIterator provides access to a complete listing of SchemaContract values.
10290type SchemaCollectionIterator struct {
10291	i    int
10292	page SchemaCollectionPage
10293}
10294
10295// NextWithContext advances to the next value.  If there was an error making
10296// the request the iterator does not advance and the error is returned.
10297func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10298	if tracing.IsEnabled() {
10299		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext")
10300		defer func() {
10301			sc := -1
10302			if iter.Response().Response.Response != nil {
10303				sc = iter.Response().Response.Response.StatusCode
10304			}
10305			tracing.EndSpan(ctx, sc, err)
10306		}()
10307	}
10308	iter.i++
10309	if iter.i < len(iter.page.Values()) {
10310		return nil
10311	}
10312	err = iter.page.NextWithContext(ctx)
10313	if err != nil {
10314		iter.i--
10315		return err
10316	}
10317	iter.i = 0
10318	return nil
10319}
10320
10321// Next advances to the next value.  If there was an error making
10322// the request the iterator does not advance and the error is returned.
10323// Deprecated: Use NextWithContext() instead.
10324func (iter *SchemaCollectionIterator) Next() error {
10325	return iter.NextWithContext(context.Background())
10326}
10327
10328// NotDone returns true if the enumeration should be started or is not yet complete.
10329func (iter SchemaCollectionIterator) NotDone() bool {
10330	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10331}
10332
10333// Response returns the raw server response from the last page request.
10334func (iter SchemaCollectionIterator) Response() SchemaCollection {
10335	return iter.page.Response()
10336}
10337
10338// Value returns the current value or a zero-initialized value if the
10339// iterator has advanced beyond the end of the collection.
10340func (iter SchemaCollectionIterator) Value() SchemaContract {
10341	if !iter.page.NotDone() {
10342		return SchemaContract{}
10343	}
10344	return iter.page.Values()[iter.i]
10345}
10346
10347// Creates a new instance of the SchemaCollectionIterator type.
10348func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator {
10349	return SchemaCollectionIterator{page: page}
10350}
10351
10352// IsEmpty returns true if the ListResult contains no values.
10353func (sc SchemaCollection) IsEmpty() bool {
10354	return sc.Value == nil || len(*sc.Value) == 0
10355}
10356
10357// hasNextLink returns true if the NextLink is not empty.
10358func (sc SchemaCollection) hasNextLink() bool {
10359	return sc.NextLink != nil && len(*sc.NextLink) != 0
10360}
10361
10362// schemaCollectionPreparer prepares a request to retrieve the next set of results.
10363// It returns nil if no more results exist.
10364func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) {
10365	if !sc.hasNextLink() {
10366		return nil, nil
10367	}
10368	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10369		autorest.AsJSON(),
10370		autorest.AsGet(),
10371		autorest.WithBaseURL(to.String(sc.NextLink)))
10372}
10373
10374// SchemaCollectionPage contains a page of SchemaContract values.
10375type SchemaCollectionPage struct {
10376	fn func(context.Context, SchemaCollection) (SchemaCollection, error)
10377	sc SchemaCollection
10378}
10379
10380// NextWithContext advances to the next page of values.  If there was an error making
10381// the request the page does not advance and the error is returned.
10382func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) {
10383	if tracing.IsEnabled() {
10384		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext")
10385		defer func() {
10386			sc := -1
10387			if page.Response().Response.Response != nil {
10388				sc = page.Response().Response.Response.StatusCode
10389			}
10390			tracing.EndSpan(ctx, sc, err)
10391		}()
10392	}
10393	for {
10394		next, err := page.fn(ctx, page.sc)
10395		if err != nil {
10396			return err
10397		}
10398		page.sc = next
10399		if !next.hasNextLink() || !next.IsEmpty() {
10400			break
10401		}
10402	}
10403	return nil
10404}
10405
10406// Next advances to the next page of values.  If there was an error making
10407// the request the page does not advance and the error is returned.
10408// Deprecated: Use NextWithContext() instead.
10409func (page *SchemaCollectionPage) Next() error {
10410	return page.NextWithContext(context.Background())
10411}
10412
10413// NotDone returns true if the page enumeration should be started or is not yet complete.
10414func (page SchemaCollectionPage) NotDone() bool {
10415	return !page.sc.IsEmpty()
10416}
10417
10418// Response returns the raw server response from the last page request.
10419func (page SchemaCollectionPage) Response() SchemaCollection {
10420	return page.sc
10421}
10422
10423// Values returns the slice of values for the current page or nil if there are no values.
10424func (page SchemaCollectionPage) Values() []SchemaContract {
10425	if page.sc.IsEmpty() {
10426		return nil
10427	}
10428	return *page.sc.Value
10429}
10430
10431// Creates a new instance of the SchemaCollectionPage type.
10432func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage {
10433	return SchemaCollectionPage{
10434		fn: getNextPage,
10435		sc: cur,
10436	}
10437}
10438
10439// SchemaContract schema Contract details.
10440type SchemaContract struct {
10441	autorest.Response `json:"-"`
10442	// SchemaContractProperties - Properties of the Schema.
10443	*SchemaContractProperties `json:"properties,omitempty"`
10444	// ID - READ-ONLY; Resource ID.
10445	ID *string `json:"id,omitempty"`
10446	// Name - READ-ONLY; Resource name.
10447	Name *string `json:"name,omitempty"`
10448	// Type - READ-ONLY; Resource type for API Management resource.
10449	Type *string `json:"type,omitempty"`
10450}
10451
10452// MarshalJSON is the custom marshaler for SchemaContract.
10453func (sc SchemaContract) MarshalJSON() ([]byte, error) {
10454	objectMap := make(map[string]interface{})
10455	if sc.SchemaContractProperties != nil {
10456		objectMap["properties"] = sc.SchemaContractProperties
10457	}
10458	return json.Marshal(objectMap)
10459}
10460
10461// UnmarshalJSON is the custom unmarshaler for SchemaContract struct.
10462func (sc *SchemaContract) UnmarshalJSON(body []byte) error {
10463	var m map[string]*json.RawMessage
10464	err := json.Unmarshal(body, &m)
10465	if err != nil {
10466		return err
10467	}
10468	for k, v := range m {
10469		switch k {
10470		case "properties":
10471			if v != nil {
10472				var schemaContractProperties SchemaContractProperties
10473				err = json.Unmarshal(*v, &schemaContractProperties)
10474				if err != nil {
10475					return err
10476				}
10477				sc.SchemaContractProperties = &schemaContractProperties
10478			}
10479		case "id":
10480			if v != nil {
10481				var ID string
10482				err = json.Unmarshal(*v, &ID)
10483				if err != nil {
10484					return err
10485				}
10486				sc.ID = &ID
10487			}
10488		case "name":
10489			if v != nil {
10490				var name string
10491				err = json.Unmarshal(*v, &name)
10492				if err != nil {
10493					return err
10494				}
10495				sc.Name = &name
10496			}
10497		case "type":
10498			if v != nil {
10499				var typeVar string
10500				err = json.Unmarshal(*v, &typeVar)
10501				if err != nil {
10502					return err
10503				}
10504				sc.Type = &typeVar
10505			}
10506		}
10507	}
10508
10509	return nil
10510}
10511
10512// SchemaContractProperties API Schema create or update contract Properties.
10513type SchemaContractProperties struct {
10514	// 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). </br> - `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json` </br> - `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml` </br> - `OpenApi` Schema use `application/vnd.oai.openapi.components+json` </br> - `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`.
10515	ContentType *string `json:"contentType,omitempty"`
10516	// SchemaDocumentProperties - Create or update Properties of the Schema Document.
10517	*SchemaDocumentProperties `json:"document,omitempty"`
10518}
10519
10520// MarshalJSON is the custom marshaler for SchemaContractProperties.
10521func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) {
10522	objectMap := make(map[string]interface{})
10523	if scp.ContentType != nil {
10524		objectMap["contentType"] = scp.ContentType
10525	}
10526	if scp.SchemaDocumentProperties != nil {
10527		objectMap["document"] = scp.SchemaDocumentProperties
10528	}
10529	return json.Marshal(objectMap)
10530}
10531
10532// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct.
10533func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error {
10534	var m map[string]*json.RawMessage
10535	err := json.Unmarshal(body, &m)
10536	if err != nil {
10537		return err
10538	}
10539	for k, v := range m {
10540		switch k {
10541		case "contentType":
10542			if v != nil {
10543				var contentType string
10544				err = json.Unmarshal(*v, &contentType)
10545				if err != nil {
10546					return err
10547				}
10548				scp.ContentType = &contentType
10549			}
10550		case "document":
10551			if v != nil {
10552				var schemaDocumentProperties SchemaDocumentProperties
10553				err = json.Unmarshal(*v, &schemaDocumentProperties)
10554				if err != nil {
10555					return err
10556				}
10557				scp.SchemaDocumentProperties = &schemaDocumentProperties
10558			}
10559		}
10560	}
10561
10562	return nil
10563}
10564
10565// SchemaDocumentProperties schema Document Properties.
10566type SchemaDocumentProperties struct {
10567	// Value - Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI.
10568	Value *string `json:"value,omitempty"`
10569	// Definitions - Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise.
10570	Definitions interface{} `json:"definitions,omitempty"`
10571}
10572
10573// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration
10574// operation.
10575type ServiceApplyNetworkConfigurationParameters struct {
10576	// 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.
10577	Location *string `json:"location,omitempty"`
10578}
10579
10580// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results
10581// of a long-running operation.
10582type ServiceApplyNetworkConfigurationUpdatesFuture struct {
10583	azure.FutureAPI
10584	// Result returns the result of the asynchronous operation.
10585	// If the operation has not completed it will return an error.
10586	Result func(ServiceClient) (ServiceResource, error)
10587}
10588
10589// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10590func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error {
10591	var azFuture azure.Future
10592	if err := json.Unmarshal(body, &azFuture); err != nil {
10593		return err
10594	}
10595	future.FutureAPI = &azFuture
10596	future.Result = future.result
10597	return nil
10598}
10599
10600// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result.
10601func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) {
10602	var done bool
10603	done, err = future.DoneWithContext(context.Background(), client)
10604	if err != nil {
10605		err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure")
10606		return
10607	}
10608	if !done {
10609		sr.Response.Response = future.Response()
10610		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture")
10611		return
10612	}
10613	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10614	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
10615		sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response)
10616		if err != nil {
10617			err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request")
10618		}
10619	}
10620	return
10621}
10622
10623// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running
10624// operation.
10625type ServiceBackupFuture struct {
10626	azure.FutureAPI
10627	// Result returns the result of the asynchronous operation.
10628	// If the operation has not completed it will return an error.
10629	Result func(ServiceClient) (ServiceResource, error)
10630}
10631
10632// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10633func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error {
10634	var azFuture azure.Future
10635	if err := json.Unmarshal(body, &azFuture); err != nil {
10636		return err
10637	}
10638	future.FutureAPI = &azFuture
10639	future.Result = future.result
10640	return nil
10641}
10642
10643// result is the default implementation for ServiceBackupFuture.Result.
10644func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) {
10645	var done bool
10646	done, err = future.DoneWithContext(context.Background(), client)
10647	if err != nil {
10648		err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure")
10649		return
10650	}
10651	if !done {
10652		sr.Response.Response = future.Response()
10653		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture")
10654		return
10655	}
10656	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10657	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
10658		sr, err = client.BackupResponder(sr.Response.Response)
10659		if err != nil {
10660			err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request")
10661		}
10662	}
10663	return
10664}
10665
10666// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service
10667// operation.
10668type ServiceBackupRestoreParameters struct {
10669	// StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name.
10670	StorageAccount *string `json:"storageAccount,omitempty"`
10671	// AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key.
10672	AccessKey *string `json:"accessKey,omitempty"`
10673	// ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup.
10674	ContainerName *string `json:"containerName,omitempty"`
10675	// BackupName - The name of the backup file to create.
10676	BackupName *string `json:"backupName,omitempty"`
10677}
10678
10679// ServiceBaseProperties base Properties of an API Management service resource description.
10680type ServiceBaseProperties struct {
10681	// NotificationSenderEmail - Email address from which the notification will be sent.
10682	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
10683	// 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.
10684	ProvisioningState *string `json:"provisioningState,omitempty"`
10685	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
10686	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
10687	// 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.
10688	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
10689	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
10690	GatewayURL *string `json:"gatewayUrl,omitempty"`
10691	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
10692	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
10693	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
10694	PortalURL *string `json:"portalUrl,omitempty"`
10695	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
10696	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
10697	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
10698	ScmURL *string `json:"scmUrl,omitempty"`
10699	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
10700	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
10701	// HostnameConfigurations - Custom hostname configuration of the API Management service.
10702	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
10703	// 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.
10704	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
10705	// 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.
10706	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
10707	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
10708	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
10709	// AdditionalLocations - Additional datacenter locations of the API Management service.
10710	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
10711	// CustomProperties - Custom properties of the API Management service.</br>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).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them.  Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384
10712	CustomProperties map[string]*string `json:"customProperties"`
10713	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
10714	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
10715	// EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway.
10716	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
10717	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
10718	DisableGateway *bool `json:"disableGateway,omitempty"`
10719	// 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'
10720	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
10721	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
10722	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
10723}
10724
10725// MarshalJSON is the custom marshaler for ServiceBaseProperties.
10726func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) {
10727	objectMap := make(map[string]interface{})
10728	if sbp.NotificationSenderEmail != nil {
10729		objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail
10730	}
10731	if sbp.HostnameConfigurations != nil {
10732		objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations
10733	}
10734	if sbp.VirtualNetworkConfiguration != nil {
10735		objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration
10736	}
10737	if sbp.AdditionalLocations != nil {
10738		objectMap["additionalLocations"] = sbp.AdditionalLocations
10739	}
10740	if sbp.CustomProperties != nil {
10741		objectMap["customProperties"] = sbp.CustomProperties
10742	}
10743	if sbp.Certificates != nil {
10744		objectMap["certificates"] = sbp.Certificates
10745	}
10746	if sbp.EnableClientCertificate != nil {
10747		objectMap["enableClientCertificate"] = sbp.EnableClientCertificate
10748	}
10749	if sbp.DisableGateway != nil {
10750		objectMap["disableGateway"] = sbp.DisableGateway
10751	}
10752	if sbp.VirtualNetworkType != "" {
10753		objectMap["virtualNetworkType"] = sbp.VirtualNetworkType
10754	}
10755	if sbp.APIVersionConstraint != nil {
10756		objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint
10757	}
10758	return json.Marshal(objectMap)
10759}
10760
10761// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation.
10762type ServiceCheckNameAvailabilityParameters struct {
10763	// Name - The name to check for availability.
10764	Name *string `json:"name,omitempty"`
10765}
10766
10767// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
10768// operation.
10769type ServiceCreateOrUpdateFuture struct {
10770	azure.FutureAPI
10771	// Result returns the result of the asynchronous operation.
10772	// If the operation has not completed it will return an error.
10773	Result func(ServiceClient) (ServiceResource, error)
10774}
10775
10776// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10777func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10778	var azFuture azure.Future
10779	if err := json.Unmarshal(body, &azFuture); err != nil {
10780		return err
10781	}
10782	future.FutureAPI = &azFuture
10783	future.Result = future.result
10784	return nil
10785}
10786
10787// result is the default implementation for ServiceCreateOrUpdateFuture.Result.
10788func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
10789	var done bool
10790	done, err = future.DoneWithContext(context.Background(), client)
10791	if err != nil {
10792		err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10793		return
10794	}
10795	if !done {
10796		sr.Response.Response = future.Response()
10797		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture")
10798		return
10799	}
10800	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10801	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
10802		sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
10803		if err != nil {
10804			err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
10805		}
10806	}
10807	return
10808}
10809
10810// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
10811// operation.
10812type ServiceDeleteFuture struct {
10813	azure.FutureAPI
10814	// Result returns the result of the asynchronous operation.
10815	// If the operation has not completed it will return an error.
10816	Result func(ServiceClient) (ServiceResource, error)
10817}
10818
10819// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10820func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error {
10821	var azFuture azure.Future
10822	if err := json.Unmarshal(body, &azFuture); err != nil {
10823		return err
10824	}
10825	future.FutureAPI = &azFuture
10826	future.Result = future.result
10827	return nil
10828}
10829
10830// result is the default implementation for ServiceDeleteFuture.Result.
10831func (future *ServiceDeleteFuture) result(client ServiceClient) (sr ServiceResource, err error) {
10832	var done bool
10833	done, err = future.DoneWithContext(context.Background(), client)
10834	if err != nil {
10835		err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure")
10836		return
10837	}
10838	if !done {
10839		sr.Response.Response = future.Response()
10840		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture")
10841		return
10842	}
10843	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10844	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
10845		sr, err = client.DeleteResponder(sr.Response.Response)
10846		if err != nil {
10847			err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request")
10848		}
10849	}
10850	return
10851}
10852
10853// ServiceGetSsoTokenResult the response of the GetSsoToken operation.
10854type ServiceGetSsoTokenResult struct {
10855	autorest.Response `json:"-"`
10856	// RedirectURI - Redirect URL to the Publisher Portal containing the SSO token.
10857	RedirectURI *string `json:"redirectUri,omitempty"`
10858}
10859
10860// ServiceIdentity identity properties of the Api Management service resource.
10861type ServiceIdentity struct {
10862	// Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None'
10863	Type ApimIdentityType `json:"type,omitempty"`
10864	// PrincipalID - READ-ONLY; The principal id of the identity.
10865	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
10866	// TenantID - READ-ONLY; The client tenant id of the identity.
10867	TenantID *uuid.UUID `json:"tenantId,omitempty"`
10868	// UserAssignedIdentities - The list of user identities associated with the resource. The user identity
10869	// dictionary key references will be ARM resource ids in the form:
10870	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
10871	//     providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
10872	UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"`
10873}
10874
10875// MarshalJSON is the custom marshaler for ServiceIdentity.
10876func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
10877	objectMap := make(map[string]interface{})
10878	if si.Type != "" {
10879		objectMap["type"] = si.Type
10880	}
10881	if si.UserAssignedIdentities != nil {
10882		objectMap["userAssignedIdentities"] = si.UserAssignedIdentities
10883	}
10884	return json.Marshal(objectMap)
10885}
10886
10887// ServiceListResult the response of the List API Management services operation.
10888type ServiceListResult struct {
10889	autorest.Response `json:"-"`
10890	// Value - Result of the List API Management services operation.
10891	Value *[]ServiceResource `json:"value,omitempty"`
10892	// NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services.
10893	NextLink *string `json:"nextLink,omitempty"`
10894}
10895
10896// ServiceListResultIterator provides access to a complete listing of ServiceResource values.
10897type ServiceListResultIterator struct {
10898	i    int
10899	page ServiceListResultPage
10900}
10901
10902// NextWithContext advances to the next value.  If there was an error making
10903// the request the iterator does not advance and the error is returned.
10904func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
10905	if tracing.IsEnabled() {
10906		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext")
10907		defer func() {
10908			sc := -1
10909			if iter.Response().Response.Response != nil {
10910				sc = iter.Response().Response.Response.StatusCode
10911			}
10912			tracing.EndSpan(ctx, sc, err)
10913		}()
10914	}
10915	iter.i++
10916	if iter.i < len(iter.page.Values()) {
10917		return nil
10918	}
10919	err = iter.page.NextWithContext(ctx)
10920	if err != nil {
10921		iter.i--
10922		return err
10923	}
10924	iter.i = 0
10925	return nil
10926}
10927
10928// Next advances to the next value.  If there was an error making
10929// the request the iterator does not advance and the error is returned.
10930// Deprecated: Use NextWithContext() instead.
10931func (iter *ServiceListResultIterator) Next() error {
10932	return iter.NextWithContext(context.Background())
10933}
10934
10935// NotDone returns true if the enumeration should be started or is not yet complete.
10936func (iter ServiceListResultIterator) NotDone() bool {
10937	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10938}
10939
10940// Response returns the raw server response from the last page request.
10941func (iter ServiceListResultIterator) Response() ServiceListResult {
10942	return iter.page.Response()
10943}
10944
10945// Value returns the current value or a zero-initialized value if the
10946// iterator has advanced beyond the end of the collection.
10947func (iter ServiceListResultIterator) Value() ServiceResource {
10948	if !iter.page.NotDone() {
10949		return ServiceResource{}
10950	}
10951	return iter.page.Values()[iter.i]
10952}
10953
10954// Creates a new instance of the ServiceListResultIterator type.
10955func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator {
10956	return ServiceListResultIterator{page: page}
10957}
10958
10959// IsEmpty returns true if the ListResult contains no values.
10960func (slr ServiceListResult) IsEmpty() bool {
10961	return slr.Value == nil || len(*slr.Value) == 0
10962}
10963
10964// hasNextLink returns true if the NextLink is not empty.
10965func (slr ServiceListResult) hasNextLink() bool {
10966	return slr.NextLink != nil && len(*slr.NextLink) != 0
10967}
10968
10969// serviceListResultPreparer prepares a request to retrieve the next set of results.
10970// It returns nil if no more results exist.
10971func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) {
10972	if !slr.hasNextLink() {
10973		return nil, nil
10974	}
10975	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10976		autorest.AsJSON(),
10977		autorest.AsGet(),
10978		autorest.WithBaseURL(to.String(slr.NextLink)))
10979}
10980
10981// ServiceListResultPage contains a page of ServiceResource values.
10982type ServiceListResultPage struct {
10983	fn  func(context.Context, ServiceListResult) (ServiceListResult, error)
10984	slr ServiceListResult
10985}
10986
10987// NextWithContext advances to the next page of values.  If there was an error making
10988// the request the page does not advance and the error is returned.
10989func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
10990	if tracing.IsEnabled() {
10991		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext")
10992		defer func() {
10993			sc := -1
10994			if page.Response().Response.Response != nil {
10995				sc = page.Response().Response.Response.StatusCode
10996			}
10997			tracing.EndSpan(ctx, sc, err)
10998		}()
10999	}
11000	for {
11001		next, err := page.fn(ctx, page.slr)
11002		if err != nil {
11003			return err
11004		}
11005		page.slr = next
11006		if !next.hasNextLink() || !next.IsEmpty() {
11007			break
11008		}
11009	}
11010	return nil
11011}
11012
11013// Next advances to the next page of values.  If there was an error making
11014// the request the page does not advance and the error is returned.
11015// Deprecated: Use NextWithContext() instead.
11016func (page *ServiceListResultPage) Next() error {
11017	return page.NextWithContext(context.Background())
11018}
11019
11020// NotDone returns true if the page enumeration should be started or is not yet complete.
11021func (page ServiceListResultPage) NotDone() bool {
11022	return !page.slr.IsEmpty()
11023}
11024
11025// Response returns the raw server response from the last page request.
11026func (page ServiceListResultPage) Response() ServiceListResult {
11027	return page.slr
11028}
11029
11030// Values returns the slice of values for the current page or nil if there are no values.
11031func (page ServiceListResultPage) Values() []ServiceResource {
11032	if page.slr.IsEmpty() {
11033		return nil
11034	}
11035	return *page.slr.Value
11036}
11037
11038// Creates a new instance of the ServiceListResultPage type.
11039func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage {
11040	return ServiceListResultPage{
11041		fn:  getNextPage,
11042		slr: cur,
11043	}
11044}
11045
11046// ServiceNameAvailabilityResult response of the CheckNameAvailability operation.
11047type ServiceNameAvailabilityResult struct {
11048	autorest.Response `json:"-"`
11049	// NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false.
11050	NameAvailable *bool `json:"nameAvailable,omitempty"`
11051	// 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.
11052	Message *string `json:"message,omitempty"`
11053	// 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'
11054	Reason NameAvailabilityReason `json:"reason,omitempty"`
11055}
11056
11057// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult.
11058func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) {
11059	objectMap := make(map[string]interface{})
11060	if snar.Reason != "" {
11061		objectMap["reason"] = snar.Reason
11062	}
11063	return json.Marshal(objectMap)
11064}
11065
11066// ServiceProperties properties of an API Management service resource description.
11067type ServiceProperties struct {
11068	// PublisherEmail - Publisher email.
11069	PublisherEmail *string `json:"publisherEmail,omitempty"`
11070	// PublisherName - Publisher name.
11071	PublisherName *string `json:"publisherName,omitempty"`
11072	// NotificationSenderEmail - Email address from which the notification will be sent.
11073	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
11074	// 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.
11075	ProvisioningState *string `json:"provisioningState,omitempty"`
11076	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
11077	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
11078	// 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.
11079	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
11080	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
11081	GatewayURL *string `json:"gatewayUrl,omitempty"`
11082	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
11083	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
11084	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
11085	PortalURL *string `json:"portalUrl,omitempty"`
11086	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
11087	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
11088	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
11089	ScmURL *string `json:"scmUrl,omitempty"`
11090	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
11091	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
11092	// HostnameConfigurations - Custom hostname configuration of the API Management service.
11093	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
11094	// 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.
11095	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
11096	// 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.
11097	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
11098	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
11099	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
11100	// AdditionalLocations - Additional datacenter locations of the API Management service.
11101	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
11102	// CustomProperties - Custom properties of the API Management service.</br>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).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them.  Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384
11103	CustomProperties map[string]*string `json:"customProperties"`
11104	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
11105	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
11106	// EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway.
11107	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
11108	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
11109	DisableGateway *bool `json:"disableGateway,omitempty"`
11110	// 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'
11111	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
11112	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
11113	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
11114}
11115
11116// MarshalJSON is the custom marshaler for ServiceProperties.
11117func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
11118	objectMap := make(map[string]interface{})
11119	if sp.PublisherEmail != nil {
11120		objectMap["publisherEmail"] = sp.PublisherEmail
11121	}
11122	if sp.PublisherName != nil {
11123		objectMap["publisherName"] = sp.PublisherName
11124	}
11125	if sp.NotificationSenderEmail != nil {
11126		objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail
11127	}
11128	if sp.HostnameConfigurations != nil {
11129		objectMap["hostnameConfigurations"] = sp.HostnameConfigurations
11130	}
11131	if sp.VirtualNetworkConfiguration != nil {
11132		objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration
11133	}
11134	if sp.AdditionalLocations != nil {
11135		objectMap["additionalLocations"] = sp.AdditionalLocations
11136	}
11137	if sp.CustomProperties != nil {
11138		objectMap["customProperties"] = sp.CustomProperties
11139	}
11140	if sp.Certificates != nil {
11141		objectMap["certificates"] = sp.Certificates
11142	}
11143	if sp.EnableClientCertificate != nil {
11144		objectMap["enableClientCertificate"] = sp.EnableClientCertificate
11145	}
11146	if sp.DisableGateway != nil {
11147		objectMap["disableGateway"] = sp.DisableGateway
11148	}
11149	if sp.VirtualNetworkType != "" {
11150		objectMap["virtualNetworkType"] = sp.VirtualNetworkType
11151	}
11152	if sp.APIVersionConstraint != nil {
11153		objectMap["apiVersionConstraint"] = sp.APIVersionConstraint
11154	}
11155	return json.Marshal(objectMap)
11156}
11157
11158// ServiceResource a single API Management service resource in List or Get response.
11159type ServiceResource struct {
11160	autorest.Response `json:"-"`
11161	// ServiceProperties - Properties of the API Management service.
11162	*ServiceProperties `json:"properties,omitempty"`
11163	// Sku - SKU properties of the API Management service.
11164	Sku *ServiceSkuProperties `json:"sku,omitempty"`
11165	// Identity - Managed service identity of the Api Management service.
11166	Identity *ServiceIdentity `json:"identity,omitempty"`
11167	// Location - Resource location.
11168	Location *string `json:"location,omitempty"`
11169	// Etag - READ-ONLY; ETag of the resource.
11170	Etag *string `json:"etag,omitempty"`
11171	// ID - READ-ONLY; Resource ID.
11172	ID *string `json:"id,omitempty"`
11173	// Name - READ-ONLY; Resource name.
11174	Name *string `json:"name,omitempty"`
11175	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
11176	Type *string `json:"type,omitempty"`
11177	// Tags - Resource tags.
11178	Tags map[string]*string `json:"tags"`
11179}
11180
11181// MarshalJSON is the custom marshaler for ServiceResource.
11182func (sr ServiceResource) MarshalJSON() ([]byte, error) {
11183	objectMap := make(map[string]interface{})
11184	if sr.ServiceProperties != nil {
11185		objectMap["properties"] = sr.ServiceProperties
11186	}
11187	if sr.Sku != nil {
11188		objectMap["sku"] = sr.Sku
11189	}
11190	if sr.Identity != nil {
11191		objectMap["identity"] = sr.Identity
11192	}
11193	if sr.Location != nil {
11194		objectMap["location"] = sr.Location
11195	}
11196	if sr.Tags != nil {
11197		objectMap["tags"] = sr.Tags
11198	}
11199	return json.Marshal(objectMap)
11200}
11201
11202// UnmarshalJSON is the custom unmarshaler for ServiceResource struct.
11203func (sr *ServiceResource) UnmarshalJSON(body []byte) error {
11204	var m map[string]*json.RawMessage
11205	err := json.Unmarshal(body, &m)
11206	if err != nil {
11207		return err
11208	}
11209	for k, v := range m {
11210		switch k {
11211		case "properties":
11212			if v != nil {
11213				var serviceProperties ServiceProperties
11214				err = json.Unmarshal(*v, &serviceProperties)
11215				if err != nil {
11216					return err
11217				}
11218				sr.ServiceProperties = &serviceProperties
11219			}
11220		case "sku":
11221			if v != nil {
11222				var sku ServiceSkuProperties
11223				err = json.Unmarshal(*v, &sku)
11224				if err != nil {
11225					return err
11226				}
11227				sr.Sku = &sku
11228			}
11229		case "identity":
11230			if v != nil {
11231				var identity ServiceIdentity
11232				err = json.Unmarshal(*v, &identity)
11233				if err != nil {
11234					return err
11235				}
11236				sr.Identity = &identity
11237			}
11238		case "location":
11239			if v != nil {
11240				var location string
11241				err = json.Unmarshal(*v, &location)
11242				if err != nil {
11243					return err
11244				}
11245				sr.Location = &location
11246			}
11247		case "etag":
11248			if v != nil {
11249				var etag string
11250				err = json.Unmarshal(*v, &etag)
11251				if err != nil {
11252					return err
11253				}
11254				sr.Etag = &etag
11255			}
11256		case "id":
11257			if v != nil {
11258				var ID string
11259				err = json.Unmarshal(*v, &ID)
11260				if err != nil {
11261					return err
11262				}
11263				sr.ID = &ID
11264			}
11265		case "name":
11266			if v != nil {
11267				var name string
11268				err = json.Unmarshal(*v, &name)
11269				if err != nil {
11270					return err
11271				}
11272				sr.Name = &name
11273			}
11274		case "type":
11275			if v != nil {
11276				var typeVar string
11277				err = json.Unmarshal(*v, &typeVar)
11278				if err != nil {
11279					return err
11280				}
11281				sr.Type = &typeVar
11282			}
11283		case "tags":
11284			if v != nil {
11285				var tags map[string]*string
11286				err = json.Unmarshal(*v, &tags)
11287				if err != nil {
11288					return err
11289				}
11290				sr.Tags = tags
11291			}
11292		}
11293	}
11294
11295	return nil
11296}
11297
11298// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running
11299// operation.
11300type ServiceRestoreFuture struct {
11301	azure.FutureAPI
11302	// Result returns the result of the asynchronous operation.
11303	// If the operation has not completed it will return an error.
11304	Result func(ServiceClient) (ServiceResource, error)
11305}
11306
11307// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11308func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error {
11309	var azFuture azure.Future
11310	if err := json.Unmarshal(body, &azFuture); err != nil {
11311		return err
11312	}
11313	future.FutureAPI = &azFuture
11314	future.Result = future.result
11315	return nil
11316}
11317
11318// result is the default implementation for ServiceRestoreFuture.Result.
11319func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) {
11320	var done bool
11321	done, err = future.DoneWithContext(context.Background(), client)
11322	if err != nil {
11323		err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure")
11324		return
11325	}
11326	if !done {
11327		sr.Response.Response = future.Response()
11328		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture")
11329		return
11330	}
11331	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11332	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
11333		sr, err = client.RestoreResponder(sr.Response.Response)
11334		if err != nil {
11335			err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request")
11336		}
11337	}
11338	return
11339}
11340
11341// ServiceSkuProperties API Management service resource SKU properties.
11342type ServiceSkuProperties struct {
11343	// Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption'
11344	Name SkuType `json:"name,omitempty"`
11345	// Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.
11346	Capacity *int32 `json:"capacity,omitempty"`
11347}
11348
11349// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
11350// operation.
11351type ServiceUpdateFuture struct {
11352	azure.FutureAPI
11353	// Result returns the result of the asynchronous operation.
11354	// If the operation has not completed it will return an error.
11355	Result func(ServiceClient) (ServiceResource, error)
11356}
11357
11358// UnmarshalJSON is the custom unmarshaller for CreateFuture.
11359func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error {
11360	var azFuture azure.Future
11361	if err := json.Unmarshal(body, &azFuture); err != nil {
11362		return err
11363	}
11364	future.FutureAPI = &azFuture
11365	future.Result = future.result
11366	return nil
11367}
11368
11369// result is the default implementation for ServiceUpdateFuture.Result.
11370func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
11371	var done bool
11372	done, err = future.DoneWithContext(context.Background(), client)
11373	if err != nil {
11374		err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure")
11375		return
11376	}
11377	if !done {
11378		sr.Response.Response = future.Response()
11379		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture")
11380		return
11381	}
11382	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
11383	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
11384		sr, err = client.UpdateResponder(sr.Response.Response)
11385		if err != nil {
11386			err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
11387		}
11388	}
11389	return
11390}
11391
11392// ServiceUpdateParameters parameter supplied to Update Api Management Service.
11393type ServiceUpdateParameters struct {
11394	// ServiceUpdateProperties - Properties of the API Management service.
11395	*ServiceUpdateProperties `json:"properties,omitempty"`
11396	// Sku - SKU properties of the API Management service.
11397	Sku *ServiceSkuProperties `json:"sku,omitempty"`
11398	// Identity - Managed service identity of the Api Management service.
11399	Identity *ServiceIdentity `json:"identity,omitempty"`
11400	// Etag - READ-ONLY; ETag of the resource.
11401	Etag *string `json:"etag,omitempty"`
11402	// ID - READ-ONLY; Resource ID.
11403	ID *string `json:"id,omitempty"`
11404	// Name - READ-ONLY; Resource name.
11405	Name *string `json:"name,omitempty"`
11406	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
11407	Type *string `json:"type,omitempty"`
11408	// Tags - Resource tags.
11409	Tags map[string]*string `json:"tags"`
11410}
11411
11412// MarshalJSON is the custom marshaler for ServiceUpdateParameters.
11413func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) {
11414	objectMap := make(map[string]interface{})
11415	if sup.ServiceUpdateProperties != nil {
11416		objectMap["properties"] = sup.ServiceUpdateProperties
11417	}
11418	if sup.Sku != nil {
11419		objectMap["sku"] = sup.Sku
11420	}
11421	if sup.Identity != nil {
11422		objectMap["identity"] = sup.Identity
11423	}
11424	if sup.Tags != nil {
11425		objectMap["tags"] = sup.Tags
11426	}
11427	return json.Marshal(objectMap)
11428}
11429
11430// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct.
11431func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error {
11432	var m map[string]*json.RawMessage
11433	err := json.Unmarshal(body, &m)
11434	if err != nil {
11435		return err
11436	}
11437	for k, v := range m {
11438		switch k {
11439		case "properties":
11440			if v != nil {
11441				var serviceUpdateProperties ServiceUpdateProperties
11442				err = json.Unmarshal(*v, &serviceUpdateProperties)
11443				if err != nil {
11444					return err
11445				}
11446				sup.ServiceUpdateProperties = &serviceUpdateProperties
11447			}
11448		case "sku":
11449			if v != nil {
11450				var sku ServiceSkuProperties
11451				err = json.Unmarshal(*v, &sku)
11452				if err != nil {
11453					return err
11454				}
11455				sup.Sku = &sku
11456			}
11457		case "identity":
11458			if v != nil {
11459				var identity ServiceIdentity
11460				err = json.Unmarshal(*v, &identity)
11461				if err != nil {
11462					return err
11463				}
11464				sup.Identity = &identity
11465			}
11466		case "etag":
11467			if v != nil {
11468				var etag string
11469				err = json.Unmarshal(*v, &etag)
11470				if err != nil {
11471					return err
11472				}
11473				sup.Etag = &etag
11474			}
11475		case "id":
11476			if v != nil {
11477				var ID string
11478				err = json.Unmarshal(*v, &ID)
11479				if err != nil {
11480					return err
11481				}
11482				sup.ID = &ID
11483			}
11484		case "name":
11485			if v != nil {
11486				var name string
11487				err = json.Unmarshal(*v, &name)
11488				if err != nil {
11489					return err
11490				}
11491				sup.Name = &name
11492			}
11493		case "type":
11494			if v != nil {
11495				var typeVar string
11496				err = json.Unmarshal(*v, &typeVar)
11497				if err != nil {
11498					return err
11499				}
11500				sup.Type = &typeVar
11501			}
11502		case "tags":
11503			if v != nil {
11504				var tags map[string]*string
11505				err = json.Unmarshal(*v, &tags)
11506				if err != nil {
11507					return err
11508				}
11509				sup.Tags = tags
11510			}
11511		}
11512	}
11513
11514	return nil
11515}
11516
11517// ServiceUpdateProperties properties of an API Management service resource description.
11518type ServiceUpdateProperties struct {
11519	// PublisherEmail - Publisher email.
11520	PublisherEmail *string `json:"publisherEmail,omitempty"`
11521	// PublisherName - Publisher name.
11522	PublisherName *string `json:"publisherName,omitempty"`
11523	// NotificationSenderEmail - Email address from which the notification will be sent.
11524	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
11525	// 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.
11526	ProvisioningState *string `json:"provisioningState,omitempty"`
11527	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
11528	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
11529	// 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.
11530	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
11531	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
11532	GatewayURL *string `json:"gatewayUrl,omitempty"`
11533	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
11534	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
11535	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
11536	PortalURL *string `json:"portalUrl,omitempty"`
11537	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
11538	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
11539	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
11540	ScmURL *string `json:"scmUrl,omitempty"`
11541	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
11542	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
11543	// HostnameConfigurations - Custom hostname configuration of the API Management service.
11544	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
11545	// 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.
11546	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
11547	// 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.
11548	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
11549	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
11550	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
11551	// AdditionalLocations - Additional datacenter locations of the API Management service.
11552	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
11553	// CustomProperties - Custom properties of the API Management service.</br>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).</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.</br>Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.</br>Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.</br></br>You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them.  Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384
11554	CustomProperties map[string]*string `json:"customProperties"`
11555	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
11556	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
11557	// EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway.
11558	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
11559	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
11560	DisableGateway *bool `json:"disableGateway,omitempty"`
11561	// 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'
11562	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
11563	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
11564	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
11565}
11566
11567// MarshalJSON is the custom marshaler for ServiceUpdateProperties.
11568func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) {
11569	objectMap := make(map[string]interface{})
11570	if sup.PublisherEmail != nil {
11571		objectMap["publisherEmail"] = sup.PublisherEmail
11572	}
11573	if sup.PublisherName != nil {
11574		objectMap["publisherName"] = sup.PublisherName
11575	}
11576	if sup.NotificationSenderEmail != nil {
11577		objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail
11578	}
11579	if sup.HostnameConfigurations != nil {
11580		objectMap["hostnameConfigurations"] = sup.HostnameConfigurations
11581	}
11582	if sup.VirtualNetworkConfiguration != nil {
11583		objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration
11584	}
11585	if sup.AdditionalLocations != nil {
11586		objectMap["additionalLocations"] = sup.AdditionalLocations
11587	}
11588	if sup.CustomProperties != nil {
11589		objectMap["customProperties"] = sup.CustomProperties
11590	}
11591	if sup.Certificates != nil {
11592		objectMap["certificates"] = sup.Certificates
11593	}
11594	if sup.EnableClientCertificate != nil {
11595		objectMap["enableClientCertificate"] = sup.EnableClientCertificate
11596	}
11597	if sup.DisableGateway != nil {
11598		objectMap["disableGateway"] = sup.DisableGateway
11599	}
11600	if sup.VirtualNetworkType != "" {
11601		objectMap["virtualNetworkType"] = sup.VirtualNetworkType
11602	}
11603	if sup.APIVersionConstraint != nil {
11604		objectMap["apiVersionConstraint"] = sup.APIVersionConstraint
11605	}
11606	return json.Marshal(objectMap)
11607}
11608
11609// SubscriptionCollection paged Subscriptions list representation.
11610type SubscriptionCollection struct {
11611	autorest.Response `json:"-"`
11612	// Value - Page values.
11613	Value *[]SubscriptionContract `json:"value,omitempty"`
11614	// NextLink - Next page link if any.
11615	NextLink *string `json:"nextLink,omitempty"`
11616}
11617
11618// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values.
11619type SubscriptionCollectionIterator struct {
11620	i    int
11621	page SubscriptionCollectionPage
11622}
11623
11624// NextWithContext advances to the next value.  If there was an error making
11625// the request the iterator does not advance and the error is returned.
11626func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
11627	if tracing.IsEnabled() {
11628		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext")
11629		defer func() {
11630			sc := -1
11631			if iter.Response().Response.Response != nil {
11632				sc = iter.Response().Response.Response.StatusCode
11633			}
11634			tracing.EndSpan(ctx, sc, err)
11635		}()
11636	}
11637	iter.i++
11638	if iter.i < len(iter.page.Values()) {
11639		return nil
11640	}
11641	err = iter.page.NextWithContext(ctx)
11642	if err != nil {
11643		iter.i--
11644		return err
11645	}
11646	iter.i = 0
11647	return nil
11648}
11649
11650// Next advances to the next value.  If there was an error making
11651// the request the iterator does not advance and the error is returned.
11652// Deprecated: Use NextWithContext() instead.
11653func (iter *SubscriptionCollectionIterator) Next() error {
11654	return iter.NextWithContext(context.Background())
11655}
11656
11657// NotDone returns true if the enumeration should be started or is not yet complete.
11658func (iter SubscriptionCollectionIterator) NotDone() bool {
11659	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11660}
11661
11662// Response returns the raw server response from the last page request.
11663func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection {
11664	return iter.page.Response()
11665}
11666
11667// Value returns the current value or a zero-initialized value if the
11668// iterator has advanced beyond the end of the collection.
11669func (iter SubscriptionCollectionIterator) Value() SubscriptionContract {
11670	if !iter.page.NotDone() {
11671		return SubscriptionContract{}
11672	}
11673	return iter.page.Values()[iter.i]
11674}
11675
11676// Creates a new instance of the SubscriptionCollectionIterator type.
11677func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator {
11678	return SubscriptionCollectionIterator{page: page}
11679}
11680
11681// IsEmpty returns true if the ListResult contains no values.
11682func (sc SubscriptionCollection) IsEmpty() bool {
11683	return sc.Value == nil || len(*sc.Value) == 0
11684}
11685
11686// hasNextLink returns true if the NextLink is not empty.
11687func (sc SubscriptionCollection) hasNextLink() bool {
11688	return sc.NextLink != nil && len(*sc.NextLink) != 0
11689}
11690
11691// subscriptionCollectionPreparer prepares a request to retrieve the next set of results.
11692// It returns nil if no more results exist.
11693func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
11694	if !sc.hasNextLink() {
11695		return nil, nil
11696	}
11697	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11698		autorest.AsJSON(),
11699		autorest.AsGet(),
11700		autorest.WithBaseURL(to.String(sc.NextLink)))
11701}
11702
11703// SubscriptionCollectionPage contains a page of SubscriptionContract values.
11704type SubscriptionCollectionPage struct {
11705	fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)
11706	sc SubscriptionCollection
11707}
11708
11709// NextWithContext advances to the next page of values.  If there was an error making
11710// the request the page does not advance and the error is returned.
11711func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
11712	if tracing.IsEnabled() {
11713		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext")
11714		defer func() {
11715			sc := -1
11716			if page.Response().Response.Response != nil {
11717				sc = page.Response().Response.Response.StatusCode
11718			}
11719			tracing.EndSpan(ctx, sc, err)
11720		}()
11721	}
11722	for {
11723		next, err := page.fn(ctx, page.sc)
11724		if err != nil {
11725			return err
11726		}
11727		page.sc = next
11728		if !next.hasNextLink() || !next.IsEmpty() {
11729			break
11730		}
11731	}
11732	return nil
11733}
11734
11735// Next advances to the next page of values.  If there was an error making
11736// the request the page does not advance and the error is returned.
11737// Deprecated: Use NextWithContext() instead.
11738func (page *SubscriptionCollectionPage) Next() error {
11739	return page.NextWithContext(context.Background())
11740}
11741
11742// NotDone returns true if the page enumeration should be started or is not yet complete.
11743func (page SubscriptionCollectionPage) NotDone() bool {
11744	return !page.sc.IsEmpty()
11745}
11746
11747// Response returns the raw server response from the last page request.
11748func (page SubscriptionCollectionPage) Response() SubscriptionCollection {
11749	return page.sc
11750}
11751
11752// Values returns the slice of values for the current page or nil if there are no values.
11753func (page SubscriptionCollectionPage) Values() []SubscriptionContract {
11754	if page.sc.IsEmpty() {
11755		return nil
11756	}
11757	return *page.sc.Value
11758}
11759
11760// Creates a new instance of the SubscriptionCollectionPage type.
11761func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage {
11762	return SubscriptionCollectionPage{
11763		fn: getNextPage,
11764		sc: cur,
11765	}
11766}
11767
11768// SubscriptionContract subscription details.
11769type SubscriptionContract struct {
11770	autorest.Response `json:"-"`
11771	// SubscriptionContractProperties - Subscription contract properties.
11772	*SubscriptionContractProperties `json:"properties,omitempty"`
11773	// ID - READ-ONLY; Resource ID.
11774	ID *string `json:"id,omitempty"`
11775	// Name - READ-ONLY; Resource name.
11776	Name *string `json:"name,omitempty"`
11777	// Type - READ-ONLY; Resource type for API Management resource.
11778	Type *string `json:"type,omitempty"`
11779}
11780
11781// MarshalJSON is the custom marshaler for SubscriptionContract.
11782func (sc SubscriptionContract) MarshalJSON() ([]byte, error) {
11783	objectMap := make(map[string]interface{})
11784	if sc.SubscriptionContractProperties != nil {
11785		objectMap["properties"] = sc.SubscriptionContractProperties
11786	}
11787	return json.Marshal(objectMap)
11788}
11789
11790// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct.
11791func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error {
11792	var m map[string]*json.RawMessage
11793	err := json.Unmarshal(body, &m)
11794	if err != nil {
11795		return err
11796	}
11797	for k, v := range m {
11798		switch k {
11799		case "properties":
11800			if v != nil {
11801				var subscriptionContractProperties SubscriptionContractProperties
11802				err = json.Unmarshal(*v, &subscriptionContractProperties)
11803				if err != nil {
11804					return err
11805				}
11806				sc.SubscriptionContractProperties = &subscriptionContractProperties
11807			}
11808		case "id":
11809			if v != nil {
11810				var ID string
11811				err = json.Unmarshal(*v, &ID)
11812				if err != nil {
11813					return err
11814				}
11815				sc.ID = &ID
11816			}
11817		case "name":
11818			if v != nil {
11819				var name string
11820				err = json.Unmarshal(*v, &name)
11821				if err != nil {
11822					return err
11823				}
11824				sc.Name = &name
11825			}
11826		case "type":
11827			if v != nil {
11828				var typeVar string
11829				err = json.Unmarshal(*v, &typeVar)
11830				if err != nil {
11831					return err
11832				}
11833				sc.Type = &typeVar
11834			}
11835		}
11836	}
11837
11838	return nil
11839}
11840
11841// SubscriptionContractProperties subscription details.
11842type SubscriptionContractProperties struct {
11843	// 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.
11844	OwnerID *string `json:"ownerId,omitempty"`
11845	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}.
11846	Scope *string `json:"scope,omitempty"`
11847	// DisplayName - The name of the subscription, or null if the subscription has no name.
11848	DisplayName *string `json:"displayName,omitempty"`
11849	// 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'
11850	State SubscriptionState `json:"state,omitempty"`
11851	// 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.
11852	CreatedDate *date.Time `json:"createdDate,omitempty"`
11853	// 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.
11854	StartDate *date.Time `json:"startDate,omitempty"`
11855	// 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.
11856	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
11857	// 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.
11858	EndDate *date.Time `json:"endDate,omitempty"`
11859	// 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.
11860	NotificationDate *date.Time `json:"notificationDate,omitempty"`
11861	// PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
11862	PrimaryKey *string `json:"primaryKey,omitempty"`
11863	// SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
11864	SecondaryKey *string `json:"secondaryKey,omitempty"`
11865	// StateComment - Optional subscription comment added by an administrator.
11866	StateComment *string `json:"stateComment,omitempty"`
11867	// AllowTracing - Determines whether tracing is enabled
11868	AllowTracing *bool `json:"allowTracing,omitempty"`
11869}
11870
11871// MarshalJSON is the custom marshaler for SubscriptionContractProperties.
11872func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) {
11873	objectMap := make(map[string]interface{})
11874	if scp.OwnerID != nil {
11875		objectMap["ownerId"] = scp.OwnerID
11876	}
11877	if scp.Scope != nil {
11878		objectMap["scope"] = scp.Scope
11879	}
11880	if scp.DisplayName != nil {
11881		objectMap["displayName"] = scp.DisplayName
11882	}
11883	if scp.State != "" {
11884		objectMap["state"] = scp.State
11885	}
11886	if scp.StartDate != nil {
11887		objectMap["startDate"] = scp.StartDate
11888	}
11889	if scp.ExpirationDate != nil {
11890		objectMap["expirationDate"] = scp.ExpirationDate
11891	}
11892	if scp.EndDate != nil {
11893		objectMap["endDate"] = scp.EndDate
11894	}
11895	if scp.NotificationDate != nil {
11896		objectMap["notificationDate"] = scp.NotificationDate
11897	}
11898	if scp.PrimaryKey != nil {
11899		objectMap["primaryKey"] = scp.PrimaryKey
11900	}
11901	if scp.SecondaryKey != nil {
11902		objectMap["secondaryKey"] = scp.SecondaryKey
11903	}
11904	if scp.StateComment != nil {
11905		objectMap["stateComment"] = scp.StateComment
11906	}
11907	if scp.AllowTracing != nil {
11908		objectMap["allowTracing"] = scp.AllowTracing
11909	}
11910	return json.Marshal(objectMap)
11911}
11912
11913// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation.
11914type SubscriptionCreateParameterProperties struct {
11915	// OwnerID - User (user id path) for whom subscription is being created in form /users/{userId}
11916	OwnerID *string `json:"ownerId,omitempty"`
11917	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}.
11918	Scope *string `json:"scope,omitempty"`
11919	// DisplayName - Subscription name.
11920	DisplayName *string `json:"displayName,omitempty"`
11921	// PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically.
11922	PrimaryKey *string `json:"primaryKey,omitempty"`
11923	// SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically.
11924	SecondaryKey *string `json:"secondaryKey,omitempty"`
11925	// 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'
11926	State SubscriptionState `json:"state,omitempty"`
11927	// AllowTracing - Determines whether tracing can be enabled
11928	AllowTracing *bool `json:"allowTracing,omitempty"`
11929}
11930
11931// SubscriptionCreateParameters subscription create details.
11932type SubscriptionCreateParameters struct {
11933	// SubscriptionCreateParameterProperties - Subscription contract properties.
11934	*SubscriptionCreateParameterProperties `json:"properties,omitempty"`
11935}
11936
11937// MarshalJSON is the custom marshaler for SubscriptionCreateParameters.
11938func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) {
11939	objectMap := make(map[string]interface{})
11940	if scp.SubscriptionCreateParameterProperties != nil {
11941		objectMap["properties"] = scp.SubscriptionCreateParameterProperties
11942	}
11943	return json.Marshal(objectMap)
11944}
11945
11946// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct.
11947func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error {
11948	var m map[string]*json.RawMessage
11949	err := json.Unmarshal(body, &m)
11950	if err != nil {
11951		return err
11952	}
11953	for k, v := range m {
11954		switch k {
11955		case "properties":
11956			if v != nil {
11957				var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties
11958				err = json.Unmarshal(*v, &subscriptionCreateParameterProperties)
11959				if err != nil {
11960					return err
11961				}
11962				scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties
11963			}
11964		}
11965	}
11966
11967	return nil
11968}
11969
11970// SubscriptionKeyParameterNamesContract subscription key parameter names details.
11971type SubscriptionKeyParameterNamesContract struct {
11972	// Header - Subscription key header name.
11973	Header *string `json:"header,omitempty"`
11974	// Query - Subscription key query string parameter name.
11975	Query *string `json:"query,omitempty"`
11976}
11977
11978// SubscriptionKeysContract subscription keys.
11979type SubscriptionKeysContract struct {
11980	autorest.Response `json:"-"`
11981	// PrimaryKey - Subscription primary key.
11982	PrimaryKey *string `json:"primaryKey,omitempty"`
11983	// SecondaryKey - Subscription secondary key.
11984	SecondaryKey *string `json:"secondaryKey,omitempty"`
11985}
11986
11987// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties.
11988type SubscriptionsDelegationSettingsProperties struct {
11989	// Enabled - Enable or disable delegation for subscriptions.
11990	Enabled *bool `json:"enabled,omitempty"`
11991}
11992
11993// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation.
11994type SubscriptionUpdateParameterProperties struct {
11995	// OwnerID - User identifier path: /users/{userId}
11996	OwnerID *string `json:"ownerId,omitempty"`
11997	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}
11998	Scope *string `json:"scope,omitempty"`
11999	// 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.
12000	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
12001	// DisplayName - Subscription name.
12002	DisplayName *string `json:"displayName,omitempty"`
12003	// PrimaryKey - Primary subscription key.
12004	PrimaryKey *string `json:"primaryKey,omitempty"`
12005	// SecondaryKey - Secondary subscription key.
12006	SecondaryKey *string `json:"secondaryKey,omitempty"`
12007	// 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'
12008	State SubscriptionState `json:"state,omitempty"`
12009	// StateComment - Comments describing subscription state change by the administrator.
12010	StateComment *string `json:"stateComment,omitempty"`
12011	// AllowTracing - Determines whether tracing can be enabled
12012	AllowTracing *bool `json:"allowTracing,omitempty"`
12013}
12014
12015// SubscriptionUpdateParameters subscription update details.
12016type SubscriptionUpdateParameters struct {
12017	// SubscriptionUpdateParameterProperties - Subscription Update contract properties.
12018	*SubscriptionUpdateParameterProperties `json:"properties,omitempty"`
12019}
12020
12021// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters.
12022func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) {
12023	objectMap := make(map[string]interface{})
12024	if sup.SubscriptionUpdateParameterProperties != nil {
12025		objectMap["properties"] = sup.SubscriptionUpdateParameterProperties
12026	}
12027	return json.Marshal(objectMap)
12028}
12029
12030// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct.
12031func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error {
12032	var m map[string]*json.RawMessage
12033	err := json.Unmarshal(body, &m)
12034	if err != nil {
12035		return err
12036	}
12037	for k, v := range m {
12038		switch k {
12039		case "properties":
12040			if v != nil {
12041				var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties
12042				err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties)
12043				if err != nil {
12044					return err
12045				}
12046				sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties
12047			}
12048		}
12049	}
12050
12051	return nil
12052}
12053
12054// TagCollection paged Tag list representation.
12055type TagCollection struct {
12056	autorest.Response `json:"-"`
12057	// Value - Page values.
12058	Value *[]TagContract `json:"value,omitempty"`
12059	// NextLink - Next page link if any.
12060	NextLink *string `json:"nextLink,omitempty"`
12061}
12062
12063// TagCollectionIterator provides access to a complete listing of TagContract values.
12064type TagCollectionIterator struct {
12065	i    int
12066	page TagCollectionPage
12067}
12068
12069// NextWithContext advances to the next value.  If there was an error making
12070// the request the iterator does not advance and the error is returned.
12071func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12072	if tracing.IsEnabled() {
12073		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext")
12074		defer func() {
12075			sc := -1
12076			if iter.Response().Response.Response != nil {
12077				sc = iter.Response().Response.Response.StatusCode
12078			}
12079			tracing.EndSpan(ctx, sc, err)
12080		}()
12081	}
12082	iter.i++
12083	if iter.i < len(iter.page.Values()) {
12084		return nil
12085	}
12086	err = iter.page.NextWithContext(ctx)
12087	if err != nil {
12088		iter.i--
12089		return err
12090	}
12091	iter.i = 0
12092	return nil
12093}
12094
12095// Next advances to the next value.  If there was an error making
12096// the request the iterator does not advance and the error is returned.
12097// Deprecated: Use NextWithContext() instead.
12098func (iter *TagCollectionIterator) Next() error {
12099	return iter.NextWithContext(context.Background())
12100}
12101
12102// NotDone returns true if the enumeration should be started or is not yet complete.
12103func (iter TagCollectionIterator) NotDone() bool {
12104	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12105}
12106
12107// Response returns the raw server response from the last page request.
12108func (iter TagCollectionIterator) Response() TagCollection {
12109	return iter.page.Response()
12110}
12111
12112// Value returns the current value or a zero-initialized value if the
12113// iterator has advanced beyond the end of the collection.
12114func (iter TagCollectionIterator) Value() TagContract {
12115	if !iter.page.NotDone() {
12116		return TagContract{}
12117	}
12118	return iter.page.Values()[iter.i]
12119}
12120
12121// Creates a new instance of the TagCollectionIterator type.
12122func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator {
12123	return TagCollectionIterator{page: page}
12124}
12125
12126// IsEmpty returns true if the ListResult contains no values.
12127func (tc TagCollection) IsEmpty() bool {
12128	return tc.Value == nil || len(*tc.Value) == 0
12129}
12130
12131// hasNextLink returns true if the NextLink is not empty.
12132func (tc TagCollection) hasNextLink() bool {
12133	return tc.NextLink != nil && len(*tc.NextLink) != 0
12134}
12135
12136// tagCollectionPreparer prepares a request to retrieve the next set of results.
12137// It returns nil if no more results exist.
12138func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) {
12139	if !tc.hasNextLink() {
12140		return nil, nil
12141	}
12142	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12143		autorest.AsJSON(),
12144		autorest.AsGet(),
12145		autorest.WithBaseURL(to.String(tc.NextLink)))
12146}
12147
12148// TagCollectionPage contains a page of TagContract values.
12149type TagCollectionPage struct {
12150	fn func(context.Context, TagCollection) (TagCollection, error)
12151	tc TagCollection
12152}
12153
12154// NextWithContext advances to the next page of values.  If there was an error making
12155// the request the page does not advance and the error is returned.
12156func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) {
12157	if tracing.IsEnabled() {
12158		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext")
12159		defer func() {
12160			sc := -1
12161			if page.Response().Response.Response != nil {
12162				sc = page.Response().Response.Response.StatusCode
12163			}
12164			tracing.EndSpan(ctx, sc, err)
12165		}()
12166	}
12167	for {
12168		next, err := page.fn(ctx, page.tc)
12169		if err != nil {
12170			return err
12171		}
12172		page.tc = next
12173		if !next.hasNextLink() || !next.IsEmpty() {
12174			break
12175		}
12176	}
12177	return nil
12178}
12179
12180// Next advances to the next page of values.  If there was an error making
12181// the request the page does not advance and the error is returned.
12182// Deprecated: Use NextWithContext() instead.
12183func (page *TagCollectionPage) Next() error {
12184	return page.NextWithContext(context.Background())
12185}
12186
12187// NotDone returns true if the page enumeration should be started or is not yet complete.
12188func (page TagCollectionPage) NotDone() bool {
12189	return !page.tc.IsEmpty()
12190}
12191
12192// Response returns the raw server response from the last page request.
12193func (page TagCollectionPage) Response() TagCollection {
12194	return page.tc
12195}
12196
12197// Values returns the slice of values for the current page or nil if there are no values.
12198func (page TagCollectionPage) Values() []TagContract {
12199	if page.tc.IsEmpty() {
12200		return nil
12201	}
12202	return *page.tc.Value
12203}
12204
12205// Creates a new instance of the TagCollectionPage type.
12206func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage {
12207	return TagCollectionPage{
12208		fn: getNextPage,
12209		tc: cur,
12210	}
12211}
12212
12213// TagContract tag Contract details.
12214type TagContract struct {
12215	autorest.Response `json:"-"`
12216	// TagContractProperties - Tag entity contract properties.
12217	*TagContractProperties `json:"properties,omitempty"`
12218	// ID - READ-ONLY; Resource ID.
12219	ID *string `json:"id,omitempty"`
12220	// Name - READ-ONLY; Resource name.
12221	Name *string `json:"name,omitempty"`
12222	// Type - READ-ONLY; Resource type for API Management resource.
12223	Type *string `json:"type,omitempty"`
12224}
12225
12226// MarshalJSON is the custom marshaler for TagContract.
12227func (tc TagContract) MarshalJSON() ([]byte, error) {
12228	objectMap := make(map[string]interface{})
12229	if tc.TagContractProperties != nil {
12230		objectMap["properties"] = tc.TagContractProperties
12231	}
12232	return json.Marshal(objectMap)
12233}
12234
12235// UnmarshalJSON is the custom unmarshaler for TagContract struct.
12236func (tc *TagContract) UnmarshalJSON(body []byte) error {
12237	var m map[string]*json.RawMessage
12238	err := json.Unmarshal(body, &m)
12239	if err != nil {
12240		return err
12241	}
12242	for k, v := range m {
12243		switch k {
12244		case "properties":
12245			if v != nil {
12246				var tagContractProperties TagContractProperties
12247				err = json.Unmarshal(*v, &tagContractProperties)
12248				if err != nil {
12249					return err
12250				}
12251				tc.TagContractProperties = &tagContractProperties
12252			}
12253		case "id":
12254			if v != nil {
12255				var ID string
12256				err = json.Unmarshal(*v, &ID)
12257				if err != nil {
12258					return err
12259				}
12260				tc.ID = &ID
12261			}
12262		case "name":
12263			if v != nil {
12264				var name string
12265				err = json.Unmarshal(*v, &name)
12266				if err != nil {
12267					return err
12268				}
12269				tc.Name = &name
12270			}
12271		case "type":
12272			if v != nil {
12273				var typeVar string
12274				err = json.Unmarshal(*v, &typeVar)
12275				if err != nil {
12276					return err
12277				}
12278				tc.Type = &typeVar
12279			}
12280		}
12281	}
12282
12283	return nil
12284}
12285
12286// TagContractProperties tag contract Properties.
12287type TagContractProperties struct {
12288	// DisplayName - Tag name.
12289	DisplayName *string `json:"displayName,omitempty"`
12290}
12291
12292// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations.
12293type TagCreateUpdateParameters struct {
12294	// TagContractProperties - Properties supplied to Create Tag operation.
12295	*TagContractProperties `json:"properties,omitempty"`
12296}
12297
12298// MarshalJSON is the custom marshaler for TagCreateUpdateParameters.
12299func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) {
12300	objectMap := make(map[string]interface{})
12301	if tcup.TagContractProperties != nil {
12302		objectMap["properties"] = tcup.TagContractProperties
12303	}
12304	return json.Marshal(objectMap)
12305}
12306
12307// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct.
12308func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error {
12309	var m map[string]*json.RawMessage
12310	err := json.Unmarshal(body, &m)
12311	if err != nil {
12312		return err
12313	}
12314	for k, v := range m {
12315		switch k {
12316		case "properties":
12317			if v != nil {
12318				var tagContractProperties TagContractProperties
12319				err = json.Unmarshal(*v, &tagContractProperties)
12320				if err != nil {
12321					return err
12322				}
12323				tcup.TagContractProperties = &tagContractProperties
12324			}
12325		}
12326	}
12327
12328	return nil
12329}
12330
12331// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation.
12332type TagDescriptionBaseProperties struct {
12333	// Description - Description of the Tag.
12334	Description *string `json:"description,omitempty"`
12335	// ExternalDocsURL - Absolute URL of external resources describing the tag.
12336	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
12337	// ExternalDocsDescription - Description of the external resources describing the tag.
12338	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
12339}
12340
12341// TagDescriptionCollection paged TagDescription list representation.
12342type TagDescriptionCollection struct {
12343	autorest.Response `json:"-"`
12344	// Value - Page values.
12345	Value *[]TagDescriptionContract `json:"value,omitempty"`
12346	// NextLink - Next page link if any.
12347	NextLink *string `json:"nextLink,omitempty"`
12348}
12349
12350// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values.
12351type TagDescriptionCollectionIterator struct {
12352	i    int
12353	page TagDescriptionCollectionPage
12354}
12355
12356// NextWithContext advances to the next value.  If there was an error making
12357// the request the iterator does not advance and the error is returned.
12358func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12359	if tracing.IsEnabled() {
12360		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext")
12361		defer func() {
12362			sc := -1
12363			if iter.Response().Response.Response != nil {
12364				sc = iter.Response().Response.Response.StatusCode
12365			}
12366			tracing.EndSpan(ctx, sc, err)
12367		}()
12368	}
12369	iter.i++
12370	if iter.i < len(iter.page.Values()) {
12371		return nil
12372	}
12373	err = iter.page.NextWithContext(ctx)
12374	if err != nil {
12375		iter.i--
12376		return err
12377	}
12378	iter.i = 0
12379	return nil
12380}
12381
12382// Next advances to the next value.  If there was an error making
12383// the request the iterator does not advance and the error is returned.
12384// Deprecated: Use NextWithContext() instead.
12385func (iter *TagDescriptionCollectionIterator) Next() error {
12386	return iter.NextWithContext(context.Background())
12387}
12388
12389// NotDone returns true if the enumeration should be started or is not yet complete.
12390func (iter TagDescriptionCollectionIterator) NotDone() bool {
12391	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12392}
12393
12394// Response returns the raw server response from the last page request.
12395func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection {
12396	return iter.page.Response()
12397}
12398
12399// Value returns the current value or a zero-initialized value if the
12400// iterator has advanced beyond the end of the collection.
12401func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract {
12402	if !iter.page.NotDone() {
12403		return TagDescriptionContract{}
12404	}
12405	return iter.page.Values()[iter.i]
12406}
12407
12408// Creates a new instance of the TagDescriptionCollectionIterator type.
12409func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator {
12410	return TagDescriptionCollectionIterator{page: page}
12411}
12412
12413// IsEmpty returns true if the ListResult contains no values.
12414func (tdc TagDescriptionCollection) IsEmpty() bool {
12415	return tdc.Value == nil || len(*tdc.Value) == 0
12416}
12417
12418// hasNextLink returns true if the NextLink is not empty.
12419func (tdc TagDescriptionCollection) hasNextLink() bool {
12420	return tdc.NextLink != nil && len(*tdc.NextLink) != 0
12421}
12422
12423// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results.
12424// It returns nil if no more results exist.
12425func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
12426	if !tdc.hasNextLink() {
12427		return nil, nil
12428	}
12429	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12430		autorest.AsJSON(),
12431		autorest.AsGet(),
12432		autorest.WithBaseURL(to.String(tdc.NextLink)))
12433}
12434
12435// TagDescriptionCollectionPage contains a page of TagDescriptionContract values.
12436type TagDescriptionCollectionPage struct {
12437	fn  func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)
12438	tdc TagDescriptionCollection
12439}
12440
12441// NextWithContext advances to the next page of values.  If there was an error making
12442// the request the page does not advance and the error is returned.
12443func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
12444	if tracing.IsEnabled() {
12445		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext")
12446		defer func() {
12447			sc := -1
12448			if page.Response().Response.Response != nil {
12449				sc = page.Response().Response.Response.StatusCode
12450			}
12451			tracing.EndSpan(ctx, sc, err)
12452		}()
12453	}
12454	for {
12455		next, err := page.fn(ctx, page.tdc)
12456		if err != nil {
12457			return err
12458		}
12459		page.tdc = next
12460		if !next.hasNextLink() || !next.IsEmpty() {
12461			break
12462		}
12463	}
12464	return nil
12465}
12466
12467// Next advances to the next page of values.  If there was an error making
12468// the request the page does not advance and the error is returned.
12469// Deprecated: Use NextWithContext() instead.
12470func (page *TagDescriptionCollectionPage) Next() error {
12471	return page.NextWithContext(context.Background())
12472}
12473
12474// NotDone returns true if the page enumeration should be started or is not yet complete.
12475func (page TagDescriptionCollectionPage) NotDone() bool {
12476	return !page.tdc.IsEmpty()
12477}
12478
12479// Response returns the raw server response from the last page request.
12480func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection {
12481	return page.tdc
12482}
12483
12484// Values returns the slice of values for the current page or nil if there are no values.
12485func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract {
12486	if page.tdc.IsEmpty() {
12487		return nil
12488	}
12489	return *page.tdc.Value
12490}
12491
12492// Creates a new instance of the TagDescriptionCollectionPage type.
12493func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage {
12494	return TagDescriptionCollectionPage{
12495		fn:  getNextPage,
12496		tdc: cur,
12497	}
12498}
12499
12500// TagDescriptionContract contract details.
12501type TagDescriptionContract struct {
12502	autorest.Response `json:"-"`
12503	// TagDescriptionContractProperties - TagDescription entity contract properties.
12504	*TagDescriptionContractProperties `json:"properties,omitempty"`
12505	// ID - READ-ONLY; Resource ID.
12506	ID *string `json:"id,omitempty"`
12507	// Name - READ-ONLY; Resource name.
12508	Name *string `json:"name,omitempty"`
12509	// Type - READ-ONLY; Resource type for API Management resource.
12510	Type *string `json:"type,omitempty"`
12511}
12512
12513// MarshalJSON is the custom marshaler for TagDescriptionContract.
12514func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) {
12515	objectMap := make(map[string]interface{})
12516	if tdc.TagDescriptionContractProperties != nil {
12517		objectMap["properties"] = tdc.TagDescriptionContractProperties
12518	}
12519	return json.Marshal(objectMap)
12520}
12521
12522// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct.
12523func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error {
12524	var m map[string]*json.RawMessage
12525	err := json.Unmarshal(body, &m)
12526	if err != nil {
12527		return err
12528	}
12529	for k, v := range m {
12530		switch k {
12531		case "properties":
12532			if v != nil {
12533				var tagDescriptionContractProperties TagDescriptionContractProperties
12534				err = json.Unmarshal(*v, &tagDescriptionContractProperties)
12535				if err != nil {
12536					return err
12537				}
12538				tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties
12539			}
12540		case "id":
12541			if v != nil {
12542				var ID string
12543				err = json.Unmarshal(*v, &ID)
12544				if err != nil {
12545					return err
12546				}
12547				tdc.ID = &ID
12548			}
12549		case "name":
12550			if v != nil {
12551				var name string
12552				err = json.Unmarshal(*v, &name)
12553				if err != nil {
12554					return err
12555				}
12556				tdc.Name = &name
12557			}
12558		case "type":
12559			if v != nil {
12560				var typeVar string
12561				err = json.Unmarshal(*v, &typeVar)
12562				if err != nil {
12563					return err
12564				}
12565				tdc.Type = &typeVar
12566			}
12567		}
12568	}
12569
12570	return nil
12571}
12572
12573// TagDescriptionContractProperties tagDescription contract Properties.
12574type TagDescriptionContractProperties struct {
12575	// TagID - Identifier of the tag in the form of /tags/{tagId}
12576	TagID *string `json:"tagId,omitempty"`
12577	// DisplayName - Tag name.
12578	DisplayName *string `json:"displayName,omitempty"`
12579	// Description - Description of the Tag.
12580	Description *string `json:"description,omitempty"`
12581	// ExternalDocsURL - Absolute URL of external resources describing the tag.
12582	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
12583	// ExternalDocsDescription - Description of the external resources describing the tag.
12584	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
12585}
12586
12587// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation.
12588type TagDescriptionCreateParameters struct {
12589	// TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation.
12590	*TagDescriptionBaseProperties `json:"properties,omitempty"`
12591}
12592
12593// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters.
12594func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) {
12595	objectMap := make(map[string]interface{})
12596	if tdcp.TagDescriptionBaseProperties != nil {
12597		objectMap["properties"] = tdcp.TagDescriptionBaseProperties
12598	}
12599	return json.Marshal(objectMap)
12600}
12601
12602// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct.
12603func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error {
12604	var m map[string]*json.RawMessage
12605	err := json.Unmarshal(body, &m)
12606	if err != nil {
12607		return err
12608	}
12609	for k, v := range m {
12610		switch k {
12611		case "properties":
12612			if v != nil {
12613				var tagDescriptionBaseProperties TagDescriptionBaseProperties
12614				err = json.Unmarshal(*v, &tagDescriptionBaseProperties)
12615				if err != nil {
12616					return err
12617				}
12618				tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties
12619			}
12620		}
12621	}
12622
12623	return nil
12624}
12625
12626// TagResourceCollection paged Tag list representation.
12627type TagResourceCollection struct {
12628	autorest.Response `json:"-"`
12629	// Value - Page values.
12630	Value *[]TagResourceContract `json:"value,omitempty"`
12631	// NextLink - Next page link if any.
12632	NextLink *string `json:"nextLink,omitempty"`
12633}
12634
12635// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values.
12636type TagResourceCollectionIterator struct {
12637	i    int
12638	page TagResourceCollectionPage
12639}
12640
12641// NextWithContext advances to the next value.  If there was an error making
12642// the request the iterator does not advance and the error is returned.
12643func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12644	if tracing.IsEnabled() {
12645		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext")
12646		defer func() {
12647			sc := -1
12648			if iter.Response().Response.Response != nil {
12649				sc = iter.Response().Response.Response.StatusCode
12650			}
12651			tracing.EndSpan(ctx, sc, err)
12652		}()
12653	}
12654	iter.i++
12655	if iter.i < len(iter.page.Values()) {
12656		return nil
12657	}
12658	err = iter.page.NextWithContext(ctx)
12659	if err != nil {
12660		iter.i--
12661		return err
12662	}
12663	iter.i = 0
12664	return nil
12665}
12666
12667// Next advances to the next value.  If there was an error making
12668// the request the iterator does not advance and the error is returned.
12669// Deprecated: Use NextWithContext() instead.
12670func (iter *TagResourceCollectionIterator) Next() error {
12671	return iter.NextWithContext(context.Background())
12672}
12673
12674// NotDone returns true if the enumeration should be started or is not yet complete.
12675func (iter TagResourceCollectionIterator) NotDone() bool {
12676	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12677}
12678
12679// Response returns the raw server response from the last page request.
12680func (iter TagResourceCollectionIterator) Response() TagResourceCollection {
12681	return iter.page.Response()
12682}
12683
12684// Value returns the current value or a zero-initialized value if the
12685// iterator has advanced beyond the end of the collection.
12686func (iter TagResourceCollectionIterator) Value() TagResourceContract {
12687	if !iter.page.NotDone() {
12688		return TagResourceContract{}
12689	}
12690	return iter.page.Values()[iter.i]
12691}
12692
12693// Creates a new instance of the TagResourceCollectionIterator type.
12694func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator {
12695	return TagResourceCollectionIterator{page: page}
12696}
12697
12698// IsEmpty returns true if the ListResult contains no values.
12699func (trc TagResourceCollection) IsEmpty() bool {
12700	return trc.Value == nil || len(*trc.Value) == 0
12701}
12702
12703// hasNextLink returns true if the NextLink is not empty.
12704func (trc TagResourceCollection) hasNextLink() bool {
12705	return trc.NextLink != nil && len(*trc.NextLink) != 0
12706}
12707
12708// tagResourceCollectionPreparer prepares a request to retrieve the next set of results.
12709// It returns nil if no more results exist.
12710func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
12711	if !trc.hasNextLink() {
12712		return nil, nil
12713	}
12714	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12715		autorest.AsJSON(),
12716		autorest.AsGet(),
12717		autorest.WithBaseURL(to.String(trc.NextLink)))
12718}
12719
12720// TagResourceCollectionPage contains a page of TagResourceContract values.
12721type TagResourceCollectionPage struct {
12722	fn  func(context.Context, TagResourceCollection) (TagResourceCollection, error)
12723	trc TagResourceCollection
12724}
12725
12726// NextWithContext advances to the next page of values.  If there was an error making
12727// the request the page does not advance and the error is returned.
12728func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
12729	if tracing.IsEnabled() {
12730		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext")
12731		defer func() {
12732			sc := -1
12733			if page.Response().Response.Response != nil {
12734				sc = page.Response().Response.Response.StatusCode
12735			}
12736			tracing.EndSpan(ctx, sc, err)
12737		}()
12738	}
12739	for {
12740		next, err := page.fn(ctx, page.trc)
12741		if err != nil {
12742			return err
12743		}
12744		page.trc = next
12745		if !next.hasNextLink() || !next.IsEmpty() {
12746			break
12747		}
12748	}
12749	return nil
12750}
12751
12752// Next advances to the next page of values.  If there was an error making
12753// the request the page does not advance and the error is returned.
12754// Deprecated: Use NextWithContext() instead.
12755func (page *TagResourceCollectionPage) Next() error {
12756	return page.NextWithContext(context.Background())
12757}
12758
12759// NotDone returns true if the page enumeration should be started or is not yet complete.
12760func (page TagResourceCollectionPage) NotDone() bool {
12761	return !page.trc.IsEmpty()
12762}
12763
12764// Response returns the raw server response from the last page request.
12765func (page TagResourceCollectionPage) Response() TagResourceCollection {
12766	return page.trc
12767}
12768
12769// Values returns the slice of values for the current page or nil if there are no values.
12770func (page TagResourceCollectionPage) Values() []TagResourceContract {
12771	if page.trc.IsEmpty() {
12772		return nil
12773	}
12774	return *page.trc.Value
12775}
12776
12777// Creates a new instance of the TagResourceCollectionPage type.
12778func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage {
12779	return TagResourceCollectionPage{
12780		fn:  getNextPage,
12781		trc: cur,
12782	}
12783}
12784
12785// TagResourceContract tagResource contract properties.
12786type TagResourceContract struct {
12787	// Tag - Tag associated with the resource.
12788	Tag *TagTagResourceContractProperties `json:"tag,omitempty"`
12789	// API - Api associated with the tag.
12790	API *APITagResourceContractProperties `json:"api,omitempty"`
12791	// Operation - Operation associated with the tag.
12792	Operation *OperationTagResourceContractProperties `json:"operation,omitempty"`
12793	// Product - Product associated with the tag.
12794	Product *ProductTagResourceContractProperties `json:"product,omitempty"`
12795}
12796
12797// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract
12798type TagTagResourceContractProperties struct {
12799	// ID - Tag identifier
12800	ID *string `json:"id,omitempty"`
12801	// Name - Tag Name
12802	Name *string `json:"name,omitempty"`
12803}
12804
12805// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a
12806// long-running operation.
12807type TenantConfigurationDeployFuture struct {
12808	azure.FutureAPI
12809	// Result returns the result of the asynchronous operation.
12810	// If the operation has not completed it will return an error.
12811	Result func(TenantConfigurationClient) (OperationResultContract, error)
12812}
12813
12814// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12815func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error {
12816	var azFuture azure.Future
12817	if err := json.Unmarshal(body, &azFuture); err != nil {
12818		return err
12819	}
12820	future.FutureAPI = &azFuture
12821	future.Result = future.result
12822	return nil
12823}
12824
12825// result is the default implementation for TenantConfigurationDeployFuture.Result.
12826func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
12827	var done bool
12828	done, err = future.DoneWithContext(context.Background(), client)
12829	if err != nil {
12830		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure")
12831		return
12832	}
12833	if !done {
12834		orc.Response.Response = future.Response()
12835		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture")
12836		return
12837	}
12838	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12839	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
12840		orc, err = client.DeployResponder(orc.Response.Response)
12841		if err != nil {
12842			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request")
12843		}
12844	}
12845	return
12846}
12847
12848// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running
12849// operation.
12850type TenantConfigurationSaveFuture struct {
12851	azure.FutureAPI
12852	// Result returns the result of the asynchronous operation.
12853	// If the operation has not completed it will return an error.
12854	Result func(TenantConfigurationClient) (OperationResultContract, error)
12855}
12856
12857// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12858func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error {
12859	var azFuture azure.Future
12860	if err := json.Unmarshal(body, &azFuture); err != nil {
12861		return err
12862	}
12863	future.FutureAPI = &azFuture
12864	future.Result = future.result
12865	return nil
12866}
12867
12868// result is the default implementation for TenantConfigurationSaveFuture.Result.
12869func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
12870	var done bool
12871	done, err = future.DoneWithContext(context.Background(), client)
12872	if err != nil {
12873		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure")
12874		return
12875	}
12876	if !done {
12877		orc.Response.Response = future.Response()
12878		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture")
12879		return
12880	}
12881	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12882	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
12883		orc, err = client.SaveResponder(orc.Response.Response)
12884		if err != nil {
12885			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request")
12886		}
12887	}
12888	return
12889}
12890
12891// TenantConfigurationSyncStateContract tenant Configuration Synchronization State.
12892type TenantConfigurationSyncStateContract struct {
12893	autorest.Response `json:"-"`
12894	// Branch - The name of Git branch.
12895	Branch *string `json:"branch,omitempty"`
12896	// CommitID - The latest commit Id.
12897	CommitID *string `json:"commitId,omitempty"`
12898	// IsExport - value indicating if last sync was save (true) or deploy (false) operation.
12899	IsExport *bool `json:"isExport,omitempty"`
12900	// IsSynced - value indicating if last synchronization was later than the configuration change.
12901	IsSynced *bool `json:"isSynced,omitempty"`
12902	// IsGitEnabled - value indicating whether Git configuration access is enabled.
12903	IsGitEnabled *bool `json:"isGitEnabled,omitempty"`
12904	// 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.
12905	SyncDate *date.Time `json:"syncDate,omitempty"`
12906	// 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.
12907	ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"`
12908}
12909
12910// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a
12911// long-running operation.
12912type TenantConfigurationValidateFuture struct {
12913	azure.FutureAPI
12914	// Result returns the result of the asynchronous operation.
12915	// If the operation has not completed it will return an error.
12916	Result func(TenantConfigurationClient) (OperationResultContract, error)
12917}
12918
12919// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12920func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error {
12921	var azFuture azure.Future
12922	if err := json.Unmarshal(body, &azFuture); err != nil {
12923		return err
12924	}
12925	future.FutureAPI = &azFuture
12926	future.Result = future.result
12927	return nil
12928}
12929
12930// result is the default implementation for TenantConfigurationValidateFuture.Result.
12931func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
12932	var done bool
12933	done, err = future.DoneWithContext(context.Background(), client)
12934	if err != nil {
12935		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure")
12936		return
12937	}
12938	if !done {
12939		orc.Response.Response = future.Response()
12940		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture")
12941		return
12942	}
12943	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12944	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
12945		orc, err = client.ValidateResponder(orc.Response.Response)
12946		if err != nil {
12947			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request")
12948		}
12949	}
12950	return
12951}
12952
12953// TermsOfServiceProperties terms of service contract properties.
12954type TermsOfServiceProperties struct {
12955	// Text - A terms of service text.
12956	Text *string `json:"text,omitempty"`
12957	// Enabled - Display terms of service during a sign-up process.
12958	Enabled *bool `json:"enabled,omitempty"`
12959	// ConsentRequired - Ask user for consent to the terms of service.
12960	ConsentRequired *bool `json:"consentRequired,omitempty"`
12961}
12962
12963// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded).
12964type TokenBodyParameterContract struct {
12965	// Name - body parameter name.
12966	Name *string `json:"name,omitempty"`
12967	// Value - body parameter value.
12968	Value *string `json:"value,omitempty"`
12969}
12970
12971// UserCollection paged Users list representation.
12972type UserCollection struct {
12973	autorest.Response `json:"-"`
12974	// Value - Page values.
12975	Value *[]UserContract `json:"value,omitempty"`
12976	// NextLink - Next page link if any.
12977	NextLink *string `json:"nextLink,omitempty"`
12978}
12979
12980// UserCollectionIterator provides access to a complete listing of UserContract values.
12981type UserCollectionIterator struct {
12982	i    int
12983	page UserCollectionPage
12984}
12985
12986// NextWithContext advances to the next value.  If there was an error making
12987// the request the iterator does not advance and the error is returned.
12988func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12989	if tracing.IsEnabled() {
12990		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext")
12991		defer func() {
12992			sc := -1
12993			if iter.Response().Response.Response != nil {
12994				sc = iter.Response().Response.Response.StatusCode
12995			}
12996			tracing.EndSpan(ctx, sc, err)
12997		}()
12998	}
12999	iter.i++
13000	if iter.i < len(iter.page.Values()) {
13001		return nil
13002	}
13003	err = iter.page.NextWithContext(ctx)
13004	if err != nil {
13005		iter.i--
13006		return err
13007	}
13008	iter.i = 0
13009	return nil
13010}
13011
13012// Next advances to the next value.  If there was an error making
13013// the request the iterator does not advance and the error is returned.
13014// Deprecated: Use NextWithContext() instead.
13015func (iter *UserCollectionIterator) Next() error {
13016	return iter.NextWithContext(context.Background())
13017}
13018
13019// NotDone returns true if the enumeration should be started or is not yet complete.
13020func (iter UserCollectionIterator) NotDone() bool {
13021	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13022}
13023
13024// Response returns the raw server response from the last page request.
13025func (iter UserCollectionIterator) Response() UserCollection {
13026	return iter.page.Response()
13027}
13028
13029// Value returns the current value or a zero-initialized value if the
13030// iterator has advanced beyond the end of the collection.
13031func (iter UserCollectionIterator) Value() UserContract {
13032	if !iter.page.NotDone() {
13033		return UserContract{}
13034	}
13035	return iter.page.Values()[iter.i]
13036}
13037
13038// Creates a new instance of the UserCollectionIterator type.
13039func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator {
13040	return UserCollectionIterator{page: page}
13041}
13042
13043// IsEmpty returns true if the ListResult contains no values.
13044func (uc UserCollection) IsEmpty() bool {
13045	return uc.Value == nil || len(*uc.Value) == 0
13046}
13047
13048// hasNextLink returns true if the NextLink is not empty.
13049func (uc UserCollection) hasNextLink() bool {
13050	return uc.NextLink != nil && len(*uc.NextLink) != 0
13051}
13052
13053// userCollectionPreparer prepares a request to retrieve the next set of results.
13054// It returns nil if no more results exist.
13055func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) {
13056	if !uc.hasNextLink() {
13057		return nil, nil
13058	}
13059	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13060		autorest.AsJSON(),
13061		autorest.AsGet(),
13062		autorest.WithBaseURL(to.String(uc.NextLink)))
13063}
13064
13065// UserCollectionPage contains a page of UserContract values.
13066type UserCollectionPage struct {
13067	fn func(context.Context, UserCollection) (UserCollection, error)
13068	uc UserCollection
13069}
13070
13071// NextWithContext advances to the next page of values.  If there was an error making
13072// the request the page does not advance and the error is returned.
13073func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) {
13074	if tracing.IsEnabled() {
13075		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext")
13076		defer func() {
13077			sc := -1
13078			if page.Response().Response.Response != nil {
13079				sc = page.Response().Response.Response.StatusCode
13080			}
13081			tracing.EndSpan(ctx, sc, err)
13082		}()
13083	}
13084	for {
13085		next, err := page.fn(ctx, page.uc)
13086		if err != nil {
13087			return err
13088		}
13089		page.uc = next
13090		if !next.hasNextLink() || !next.IsEmpty() {
13091			break
13092		}
13093	}
13094	return nil
13095}
13096
13097// Next advances to the next page of values.  If there was an error making
13098// the request the page does not advance and the error is returned.
13099// Deprecated: Use NextWithContext() instead.
13100func (page *UserCollectionPage) Next() error {
13101	return page.NextWithContext(context.Background())
13102}
13103
13104// NotDone returns true if the page enumeration should be started or is not yet complete.
13105func (page UserCollectionPage) NotDone() bool {
13106	return !page.uc.IsEmpty()
13107}
13108
13109// Response returns the raw server response from the last page request.
13110func (page UserCollectionPage) Response() UserCollection {
13111	return page.uc
13112}
13113
13114// Values returns the slice of values for the current page or nil if there are no values.
13115func (page UserCollectionPage) Values() []UserContract {
13116	if page.uc.IsEmpty() {
13117		return nil
13118	}
13119	return *page.uc.Value
13120}
13121
13122// Creates a new instance of the UserCollectionPage type.
13123func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage {
13124	return UserCollectionPage{
13125		fn: getNextPage,
13126		uc: cur,
13127	}
13128}
13129
13130// UserContract user details.
13131type UserContract struct {
13132	autorest.Response `json:"-"`
13133	// UserContractProperties - User entity contract properties.
13134	*UserContractProperties `json:"properties,omitempty"`
13135	// ID - READ-ONLY; Resource ID.
13136	ID *string `json:"id,omitempty"`
13137	// Name - READ-ONLY; Resource name.
13138	Name *string `json:"name,omitempty"`
13139	// Type - READ-ONLY; Resource type for API Management resource.
13140	Type *string `json:"type,omitempty"`
13141}
13142
13143// MarshalJSON is the custom marshaler for UserContract.
13144func (uc UserContract) MarshalJSON() ([]byte, error) {
13145	objectMap := make(map[string]interface{})
13146	if uc.UserContractProperties != nil {
13147		objectMap["properties"] = uc.UserContractProperties
13148	}
13149	return json.Marshal(objectMap)
13150}
13151
13152// UnmarshalJSON is the custom unmarshaler for UserContract struct.
13153func (uc *UserContract) UnmarshalJSON(body []byte) error {
13154	var m map[string]*json.RawMessage
13155	err := json.Unmarshal(body, &m)
13156	if err != nil {
13157		return err
13158	}
13159	for k, v := range m {
13160		switch k {
13161		case "properties":
13162			if v != nil {
13163				var userContractProperties UserContractProperties
13164				err = json.Unmarshal(*v, &userContractProperties)
13165				if err != nil {
13166					return err
13167				}
13168				uc.UserContractProperties = &userContractProperties
13169			}
13170		case "id":
13171			if v != nil {
13172				var ID string
13173				err = json.Unmarshal(*v, &ID)
13174				if err != nil {
13175					return err
13176				}
13177				uc.ID = &ID
13178			}
13179		case "name":
13180			if v != nil {
13181				var name string
13182				err = json.Unmarshal(*v, &name)
13183				if err != nil {
13184					return err
13185				}
13186				uc.Name = &name
13187			}
13188		case "type":
13189			if v != nil {
13190				var typeVar string
13191				err = json.Unmarshal(*v, &typeVar)
13192				if err != nil {
13193					return err
13194				}
13195				uc.Type = &typeVar
13196			}
13197		}
13198	}
13199
13200	return nil
13201}
13202
13203// UserContractProperties user profile.
13204type UserContractProperties struct {
13205	// FirstName - First name.
13206	FirstName *string `json:"firstName,omitempty"`
13207	// LastName - Last name.
13208	LastName *string `json:"lastName,omitempty"`
13209	// Email - Email address.
13210	Email *string `json:"email,omitempty"`
13211	// RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
13212	RegistrationDate *date.Time `json:"registrationDate,omitempty"`
13213	// Groups - READ-ONLY; Collection of groups user is part of.
13214	Groups *[]GroupContractProperties `json:"groups,omitempty"`
13215	// 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'
13216	State UserState `json:"state,omitempty"`
13217	// Note - Optional note about a user set by the administrator.
13218	Note *string `json:"note,omitempty"`
13219	// Identities - Collection of user identities.
13220	Identities *[]UserIdentityContract `json:"identities,omitempty"`
13221}
13222
13223// MarshalJSON is the custom marshaler for UserContractProperties.
13224func (ucp UserContractProperties) MarshalJSON() ([]byte, error) {
13225	objectMap := make(map[string]interface{})
13226	if ucp.FirstName != nil {
13227		objectMap["firstName"] = ucp.FirstName
13228	}
13229	if ucp.LastName != nil {
13230		objectMap["lastName"] = ucp.LastName
13231	}
13232	if ucp.Email != nil {
13233		objectMap["email"] = ucp.Email
13234	}
13235	if ucp.RegistrationDate != nil {
13236		objectMap["registrationDate"] = ucp.RegistrationDate
13237	}
13238	if ucp.State != "" {
13239		objectMap["state"] = ucp.State
13240	}
13241	if ucp.Note != nil {
13242		objectMap["note"] = ucp.Note
13243	}
13244	if ucp.Identities != nil {
13245		objectMap["identities"] = ucp.Identities
13246	}
13247	return json.Marshal(objectMap)
13248}
13249
13250// UserCreateParameterProperties parameters supplied to the Create User operation.
13251type UserCreateParameterProperties struct {
13252	// Email - Email address. Must not be empty and must be unique within the service instance.
13253	Email *string `json:"email,omitempty"`
13254	// FirstName - First name.
13255	FirstName *string `json:"firstName,omitempty"`
13256	// LastName - Last name.
13257	LastName *string `json:"lastName,omitempty"`
13258	// Password - User Password. If no value is provided, a default password is generated.
13259	Password *string `json:"password,omitempty"`
13260	// AppType - Determines the type of application which send the create user request. Default is old publisher portal. Possible values include: 'DeveloperPortal'
13261	AppType AppType `json:"appType,omitempty"`
13262	// Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite'
13263	Confirmation Confirmation `json:"confirmation,omitempty"`
13264	// 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'
13265	State UserState `json:"state,omitempty"`
13266	// Note - Optional note about a user set by the administrator.
13267	Note *string `json:"note,omitempty"`
13268	// Identities - Collection of user identities.
13269	Identities *[]UserIdentityContract `json:"identities,omitempty"`
13270}
13271
13272// UserCreateParameters user create details.
13273type UserCreateParameters struct {
13274	// UserCreateParameterProperties - User entity create contract properties.
13275	*UserCreateParameterProperties `json:"properties,omitempty"`
13276}
13277
13278// MarshalJSON is the custom marshaler for UserCreateParameters.
13279func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) {
13280	objectMap := make(map[string]interface{})
13281	if ucp.UserCreateParameterProperties != nil {
13282		objectMap["properties"] = ucp.UserCreateParameterProperties
13283	}
13284	return json.Marshal(objectMap)
13285}
13286
13287// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct.
13288func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error {
13289	var m map[string]*json.RawMessage
13290	err := json.Unmarshal(body, &m)
13291	if err != nil {
13292		return err
13293	}
13294	for k, v := range m {
13295		switch k {
13296		case "properties":
13297			if v != nil {
13298				var userCreateParameterProperties UserCreateParameterProperties
13299				err = json.Unmarshal(*v, &userCreateParameterProperties)
13300				if err != nil {
13301					return err
13302				}
13303				ucp.UserCreateParameterProperties = &userCreateParameterProperties
13304			}
13305		}
13306	}
13307
13308	return nil
13309}
13310
13311// UserEntityBaseParameters user Entity Base Parameters set.
13312type UserEntityBaseParameters struct {
13313	// 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'
13314	State UserState `json:"state,omitempty"`
13315	// Note - Optional note about a user set by the administrator.
13316	Note *string `json:"note,omitempty"`
13317	// Identities - Collection of user identities.
13318	Identities *[]UserIdentityContract `json:"identities,omitempty"`
13319}
13320
13321// UserIdentityCollection list of Users Identity list representation.
13322type UserIdentityCollection struct {
13323	autorest.Response `json:"-"`
13324	// Value - User Identity values.
13325	Value *[]UserIdentityContract `json:"value,omitempty"`
13326	// Count - Total record count number across all pages.
13327	Count *int64 `json:"count,omitempty"`
13328	// NextLink - Next page link if any.
13329	NextLink *string `json:"nextLink,omitempty"`
13330}
13331
13332// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values.
13333type UserIdentityCollectionIterator struct {
13334	i    int
13335	page UserIdentityCollectionPage
13336}
13337
13338// NextWithContext advances to the next value.  If there was an error making
13339// the request the iterator does not advance and the error is returned.
13340func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) {
13341	if tracing.IsEnabled() {
13342		ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext")
13343		defer func() {
13344			sc := -1
13345			if iter.Response().Response.Response != nil {
13346				sc = iter.Response().Response.Response.StatusCode
13347			}
13348			tracing.EndSpan(ctx, sc, err)
13349		}()
13350	}
13351	iter.i++
13352	if iter.i < len(iter.page.Values()) {
13353		return nil
13354	}
13355	err = iter.page.NextWithContext(ctx)
13356	if err != nil {
13357		iter.i--
13358		return err
13359	}
13360	iter.i = 0
13361	return nil
13362}
13363
13364// Next advances to the next value.  If there was an error making
13365// the request the iterator does not advance and the error is returned.
13366// Deprecated: Use NextWithContext() instead.
13367func (iter *UserIdentityCollectionIterator) Next() error {
13368	return iter.NextWithContext(context.Background())
13369}
13370
13371// NotDone returns true if the enumeration should be started or is not yet complete.
13372func (iter UserIdentityCollectionIterator) NotDone() bool {
13373	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13374}
13375
13376// Response returns the raw server response from the last page request.
13377func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection {
13378	return iter.page.Response()
13379}
13380
13381// Value returns the current value or a zero-initialized value if the
13382// iterator has advanced beyond the end of the collection.
13383func (iter UserIdentityCollectionIterator) Value() UserIdentityContract {
13384	if !iter.page.NotDone() {
13385		return UserIdentityContract{}
13386	}
13387	return iter.page.Values()[iter.i]
13388}
13389
13390// Creates a new instance of the UserIdentityCollectionIterator type.
13391func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator {
13392	return UserIdentityCollectionIterator{page: page}
13393}
13394
13395// IsEmpty returns true if the ListResult contains no values.
13396func (uic UserIdentityCollection) IsEmpty() bool {
13397	return uic.Value == nil || len(*uic.Value) == 0
13398}
13399
13400// hasNextLink returns true if the NextLink is not empty.
13401func (uic UserIdentityCollection) hasNextLink() bool {
13402	return uic.NextLink != nil && len(*uic.NextLink) != 0
13403}
13404
13405// userIdentityCollectionPreparer prepares a request to retrieve the next set of results.
13406// It returns nil if no more results exist.
13407func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) {
13408	if !uic.hasNextLink() {
13409		return nil, nil
13410	}
13411	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13412		autorest.AsJSON(),
13413		autorest.AsGet(),
13414		autorest.WithBaseURL(to.String(uic.NextLink)))
13415}
13416
13417// UserIdentityCollectionPage contains a page of UserIdentityContract values.
13418type UserIdentityCollectionPage struct {
13419	fn  func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)
13420	uic UserIdentityCollection
13421}
13422
13423// NextWithContext advances to the next page of values.  If there was an error making
13424// the request the page does not advance and the error is returned.
13425func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) {
13426	if tracing.IsEnabled() {
13427		ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext")
13428		defer func() {
13429			sc := -1
13430			if page.Response().Response.Response != nil {
13431				sc = page.Response().Response.Response.StatusCode
13432			}
13433			tracing.EndSpan(ctx, sc, err)
13434		}()
13435	}
13436	for {
13437		next, err := page.fn(ctx, page.uic)
13438		if err != nil {
13439			return err
13440		}
13441		page.uic = next
13442		if !next.hasNextLink() || !next.IsEmpty() {
13443			break
13444		}
13445	}
13446	return nil
13447}
13448
13449// Next advances to the next page of values.  If there was an error making
13450// the request the page does not advance and the error is returned.
13451// Deprecated: Use NextWithContext() instead.
13452func (page *UserIdentityCollectionPage) Next() error {
13453	return page.NextWithContext(context.Background())
13454}
13455
13456// NotDone returns true if the page enumeration should be started or is not yet complete.
13457func (page UserIdentityCollectionPage) NotDone() bool {
13458	return !page.uic.IsEmpty()
13459}
13460
13461// Response returns the raw server response from the last page request.
13462func (page UserIdentityCollectionPage) Response() UserIdentityCollection {
13463	return page.uic
13464}
13465
13466// Values returns the slice of values for the current page or nil if there are no values.
13467func (page UserIdentityCollectionPage) Values() []UserIdentityContract {
13468	if page.uic.IsEmpty() {
13469		return nil
13470	}
13471	return *page.uic.Value
13472}
13473
13474// Creates a new instance of the UserIdentityCollectionPage type.
13475func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage {
13476	return UserIdentityCollectionPage{
13477		fn:  getNextPage,
13478		uic: cur,
13479	}
13480}
13481
13482// UserIdentityContract user identity details.
13483type UserIdentityContract struct {
13484	// Provider - Identity provider name.
13485	Provider *string `json:"provider,omitempty"`
13486	// ID - Identifier value within provider.
13487	ID *string `json:"id,omitempty"`
13488}
13489
13490// UserIdentityProperties ...
13491type UserIdentityProperties struct {
13492	// PrincipalID - The principal id of user assigned identity.
13493	PrincipalID *string `json:"principalId,omitempty"`
13494	// ClientID - The client id of user assigned identity.
13495	ClientID *string `json:"clientId,omitempty"`
13496}
13497
13498// UserTokenParameterProperties parameters supplied to the Get User Token operation.
13499type UserTokenParameterProperties struct {
13500	// KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary'
13501	KeyType KeyType `json:"keyType,omitempty"`
13502	// 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.
13503	Expiry *date.Time `json:"expiry,omitempty"`
13504}
13505
13506// UserTokenParameters get User Token parameters.
13507type UserTokenParameters struct {
13508	// UserTokenParameterProperties - User Token Parameter contract properties.
13509	*UserTokenParameterProperties `json:"properties,omitempty"`
13510}
13511
13512// MarshalJSON is the custom marshaler for UserTokenParameters.
13513func (utp UserTokenParameters) MarshalJSON() ([]byte, error) {
13514	objectMap := make(map[string]interface{})
13515	if utp.UserTokenParameterProperties != nil {
13516		objectMap["properties"] = utp.UserTokenParameterProperties
13517	}
13518	return json.Marshal(objectMap)
13519}
13520
13521// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct.
13522func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error {
13523	var m map[string]*json.RawMessage
13524	err := json.Unmarshal(body, &m)
13525	if err != nil {
13526		return err
13527	}
13528	for k, v := range m {
13529		switch k {
13530		case "properties":
13531			if v != nil {
13532				var userTokenParameterProperties UserTokenParameterProperties
13533				err = json.Unmarshal(*v, &userTokenParameterProperties)
13534				if err != nil {
13535					return err
13536				}
13537				utp.UserTokenParameterProperties = &userTokenParameterProperties
13538			}
13539		}
13540	}
13541
13542	return nil
13543}
13544
13545// UserTokenResult get User Token response details.
13546type UserTokenResult struct {
13547	autorest.Response `json:"-"`
13548	// Value - Shared Access Authorization token for the User.
13549	Value *string `json:"value,omitempty"`
13550}
13551
13552// UserUpdateParameters user update parameters.
13553type UserUpdateParameters struct {
13554	// UserUpdateParametersProperties - User entity update contract properties.
13555	*UserUpdateParametersProperties `json:"properties,omitempty"`
13556}
13557
13558// MarshalJSON is the custom marshaler for UserUpdateParameters.
13559func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) {
13560	objectMap := make(map[string]interface{})
13561	if uup.UserUpdateParametersProperties != nil {
13562		objectMap["properties"] = uup.UserUpdateParametersProperties
13563	}
13564	return json.Marshal(objectMap)
13565}
13566
13567// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct.
13568func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error {
13569	var m map[string]*json.RawMessage
13570	err := json.Unmarshal(body, &m)
13571	if err != nil {
13572		return err
13573	}
13574	for k, v := range m {
13575		switch k {
13576		case "properties":
13577			if v != nil {
13578				var userUpdateParametersProperties UserUpdateParametersProperties
13579				err = json.Unmarshal(*v, &userUpdateParametersProperties)
13580				if err != nil {
13581					return err
13582				}
13583				uup.UserUpdateParametersProperties = &userUpdateParametersProperties
13584			}
13585		}
13586	}
13587
13588	return nil
13589}
13590
13591// UserUpdateParametersProperties parameters supplied to the Update User operation.
13592type UserUpdateParametersProperties struct {
13593	// Email - Email address. Must not be empty and must be unique within the service instance.
13594	Email *string `json:"email,omitempty"`
13595	// Password - User Password.
13596	Password *string `json:"password,omitempty"`
13597	// FirstName - First name.
13598	FirstName *string `json:"firstName,omitempty"`
13599	// LastName - Last name.
13600	LastName *string `json:"lastName,omitempty"`
13601	// 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'
13602	State UserState `json:"state,omitempty"`
13603	// Note - Optional note about a user set by the administrator.
13604	Note *string `json:"note,omitempty"`
13605	// Identities - Collection of user identities.
13606	Identities *[]UserIdentityContract `json:"identities,omitempty"`
13607}
13608
13609// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is
13610// deployed.
13611type VirtualNetworkConfiguration struct {
13612	// Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default.
13613	Vnetid *string `json:"vnetid,omitempty"`
13614	// Subnetname - READ-ONLY; The name of the subnet.
13615	Subnetname *string `json:"subnetname,omitempty"`
13616	// SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in.
13617	SubnetResourceID *string `json:"subnetResourceId,omitempty"`
13618}
13619
13620// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration.
13621func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) {
13622	objectMap := make(map[string]interface{})
13623	if vnc.SubnetResourceID != nil {
13624		objectMap["subnetResourceId"] = vnc.SubnetResourceID
13625	}
13626	return json.Marshal(objectMap)
13627}
13628
13629// X509CertificateName properties of server X509Names.
13630type X509CertificateName struct {
13631	// Name - Common Name of the Certificate.
13632	Name *string `json:"name,omitempty"`
13633	// IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate.
13634	IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"`
13635}
13636