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/2021-01-01-preview/apimanagement"
23
24// AccessInformationCollection paged AccessInformation list representation.
25type AccessInformationCollection struct {
26	autorest.Response `json:"-"`
27	// Value - READ-ONLY; Page values.
28	Value *[]AccessInformationContract `json:"value,omitempty"`
29	// Count - Total record count number across all pages.
30	Count *int64 `json:"count,omitempty"`
31	// NextLink - READ-ONLY; Next page link if any.
32	NextLink *string `json:"nextLink,omitempty"`
33}
34
35// MarshalJSON is the custom marshaler for AccessInformationCollection.
36func (aic AccessInformationCollection) MarshalJSON() ([]byte, error) {
37	objectMap := make(map[string]interface{})
38	if aic.Count != nil {
39		objectMap["count"] = aic.Count
40	}
41	return json.Marshal(objectMap)
42}
43
44// AccessInformationCollectionIterator provides access to a complete listing of AccessInformationContract
45// values.
46type AccessInformationCollectionIterator struct {
47	i    int
48	page AccessInformationCollectionPage
49}
50
51// NextWithContext advances to the next value.  If there was an error making
52// the request the iterator does not advance and the error is returned.
53func (iter *AccessInformationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
54	if tracing.IsEnabled() {
55		ctx = tracing.StartSpan(ctx, fqdn+"/AccessInformationCollectionIterator.NextWithContext")
56		defer func() {
57			sc := -1
58			if iter.Response().Response.Response != nil {
59				sc = iter.Response().Response.Response.StatusCode
60			}
61			tracing.EndSpan(ctx, sc, err)
62		}()
63	}
64	iter.i++
65	if iter.i < len(iter.page.Values()) {
66		return nil
67	}
68	err = iter.page.NextWithContext(ctx)
69	if err != nil {
70		iter.i--
71		return err
72	}
73	iter.i = 0
74	return nil
75}
76
77// Next advances to the next value.  If there was an error making
78// the request the iterator does not advance and the error is returned.
79// Deprecated: Use NextWithContext() instead.
80func (iter *AccessInformationCollectionIterator) Next() error {
81	return iter.NextWithContext(context.Background())
82}
83
84// NotDone returns true if the enumeration should be started or is not yet complete.
85func (iter AccessInformationCollectionIterator) NotDone() bool {
86	return iter.page.NotDone() && iter.i < len(iter.page.Values())
87}
88
89// Response returns the raw server response from the last page request.
90func (iter AccessInformationCollectionIterator) Response() AccessInformationCollection {
91	return iter.page.Response()
92}
93
94// Value returns the current value or a zero-initialized value if the
95// iterator has advanced beyond the end of the collection.
96func (iter AccessInformationCollectionIterator) Value() AccessInformationContract {
97	if !iter.page.NotDone() {
98		return AccessInformationContract{}
99	}
100	return iter.page.Values()[iter.i]
101}
102
103// Creates a new instance of the AccessInformationCollectionIterator type.
104func NewAccessInformationCollectionIterator(page AccessInformationCollectionPage) AccessInformationCollectionIterator {
105	return AccessInformationCollectionIterator{page: page}
106}
107
108// IsEmpty returns true if the ListResult contains no values.
109func (aic AccessInformationCollection) IsEmpty() bool {
110	return aic.Value == nil || len(*aic.Value) == 0
111}
112
113// hasNextLink returns true if the NextLink is not empty.
114func (aic AccessInformationCollection) hasNextLink() bool {
115	return aic.NextLink != nil && len(*aic.NextLink) != 0
116}
117
118// accessInformationCollectionPreparer prepares a request to retrieve the next set of results.
119// It returns nil if no more results exist.
120func (aic AccessInformationCollection) accessInformationCollectionPreparer(ctx context.Context) (*http.Request, error) {
121	if !aic.hasNextLink() {
122		return nil, nil
123	}
124	return autorest.Prepare((&http.Request{}).WithContext(ctx),
125		autorest.AsJSON(),
126		autorest.AsGet(),
127		autorest.WithBaseURL(to.String(aic.NextLink)))
128}
129
130// AccessInformationCollectionPage contains a page of AccessInformationContract values.
131type AccessInformationCollectionPage struct {
132	fn  func(context.Context, AccessInformationCollection) (AccessInformationCollection, error)
133	aic AccessInformationCollection
134}
135
136// NextWithContext advances to the next page of values.  If there was an error making
137// the request the page does not advance and the error is returned.
138func (page *AccessInformationCollectionPage) NextWithContext(ctx context.Context) (err error) {
139	if tracing.IsEnabled() {
140		ctx = tracing.StartSpan(ctx, fqdn+"/AccessInformationCollectionPage.NextWithContext")
141		defer func() {
142			sc := -1
143			if page.Response().Response.Response != nil {
144				sc = page.Response().Response.Response.StatusCode
145			}
146			tracing.EndSpan(ctx, sc, err)
147		}()
148	}
149	for {
150		next, err := page.fn(ctx, page.aic)
151		if err != nil {
152			return err
153		}
154		page.aic = next
155		if !next.hasNextLink() || !next.IsEmpty() {
156			break
157		}
158	}
159	return nil
160}
161
162// Next advances to the next page of values.  If there was an error making
163// the request the page does not advance and the error is returned.
164// Deprecated: Use NextWithContext() instead.
165func (page *AccessInformationCollectionPage) Next() error {
166	return page.NextWithContext(context.Background())
167}
168
169// NotDone returns true if the page enumeration should be started or is not yet complete.
170func (page AccessInformationCollectionPage) NotDone() bool {
171	return !page.aic.IsEmpty()
172}
173
174// Response returns the raw server response from the last page request.
175func (page AccessInformationCollectionPage) Response() AccessInformationCollection {
176	return page.aic
177}
178
179// Values returns the slice of values for the current page or nil if there are no values.
180func (page AccessInformationCollectionPage) Values() []AccessInformationContract {
181	if page.aic.IsEmpty() {
182		return nil
183	}
184	return *page.aic.Value
185}
186
187// Creates a new instance of the AccessInformationCollectionPage type.
188func NewAccessInformationCollectionPage(cur AccessInformationCollection, getNextPage func(context.Context, AccessInformationCollection) (AccessInformationCollection, error)) AccessInformationCollectionPage {
189	return AccessInformationCollectionPage{
190		fn:  getNextPage,
191		aic: cur,
192	}
193}
194
195// AccessInformationContract tenant Settings.
196type AccessInformationContract struct {
197	autorest.Response `json:"-"`
198	// AccessInformationContractProperties - AccessInformation entity contract properties.
199	*AccessInformationContractProperties `json:"properties,omitempty"`
200	// ID - READ-ONLY; Resource ID.
201	ID *string `json:"id,omitempty"`
202	// Name - READ-ONLY; Resource name.
203	Name *string `json:"name,omitempty"`
204	// Type - READ-ONLY; Resource type for API Management resource.
205	Type *string `json:"type,omitempty"`
206}
207
208// MarshalJSON is the custom marshaler for AccessInformationContract.
209func (aic AccessInformationContract) MarshalJSON() ([]byte, error) {
210	objectMap := make(map[string]interface{})
211	if aic.AccessInformationContractProperties != nil {
212		objectMap["properties"] = aic.AccessInformationContractProperties
213	}
214	return json.Marshal(objectMap)
215}
216
217// UnmarshalJSON is the custom unmarshaler for AccessInformationContract struct.
218func (aic *AccessInformationContract) UnmarshalJSON(body []byte) error {
219	var m map[string]*json.RawMessage
220	err := json.Unmarshal(body, &m)
221	if err != nil {
222		return err
223	}
224	for k, v := range m {
225		switch k {
226		case "properties":
227			if v != nil {
228				var accessInformationContractProperties AccessInformationContractProperties
229				err = json.Unmarshal(*v, &accessInformationContractProperties)
230				if err != nil {
231					return err
232				}
233				aic.AccessInformationContractProperties = &accessInformationContractProperties
234			}
235		case "id":
236			if v != nil {
237				var ID string
238				err = json.Unmarshal(*v, &ID)
239				if err != nil {
240					return err
241				}
242				aic.ID = &ID
243			}
244		case "name":
245			if v != nil {
246				var name string
247				err = json.Unmarshal(*v, &name)
248				if err != nil {
249					return err
250				}
251				aic.Name = &name
252			}
253		case "type":
254			if v != nil {
255				var typeVar string
256				err = json.Unmarshal(*v, &typeVar)
257				if err != nil {
258					return err
259				}
260				aic.Type = &typeVar
261			}
262		}
263	}
264
265	return nil
266}
267
268// AccessInformationContractProperties tenant access information contract of the API Management service.
269type AccessInformationContractProperties struct {
270	// ID - Access Information type ('access' or 'gitAccess')
271	ID *string `json:"id,omitempty"`
272	// PrincipalID - Principal (User) Identifier.
273	PrincipalID *string `json:"principalId,omitempty"`
274	// Enabled - Determines whether direct access is enabled.
275	Enabled *bool `json:"enabled,omitempty"`
276}
277
278// AccessInformationCreateParameterProperties tenant access information update parameters of the API
279// Management service
280type AccessInformationCreateParameterProperties struct {
281	// PrincipalID - Principal (User) Identifier.
282	PrincipalID *string `json:"principalId,omitempty"`
283	// PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
284	PrimaryKey *string `json:"primaryKey,omitempty"`
285	// SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
286	SecondaryKey *string `json:"secondaryKey,omitempty"`
287	// Enabled - Determines whether direct access is enabled.
288	Enabled *bool `json:"enabled,omitempty"`
289}
290
291// AccessInformationCreateParameters tenant access information update parameters.
292type AccessInformationCreateParameters struct {
293	// AccessInformationCreateParameterProperties - Tenant access information update parameter properties.
294	*AccessInformationCreateParameterProperties `json:"properties,omitempty"`
295}
296
297// MarshalJSON is the custom marshaler for AccessInformationCreateParameters.
298func (aicp AccessInformationCreateParameters) MarshalJSON() ([]byte, error) {
299	objectMap := make(map[string]interface{})
300	if aicp.AccessInformationCreateParameterProperties != nil {
301		objectMap["properties"] = aicp.AccessInformationCreateParameterProperties
302	}
303	return json.Marshal(objectMap)
304}
305
306// UnmarshalJSON is the custom unmarshaler for AccessInformationCreateParameters struct.
307func (aicp *AccessInformationCreateParameters) 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 accessInformationCreateParameterProperties AccessInformationCreateParameterProperties
318				err = json.Unmarshal(*v, &accessInformationCreateParameterProperties)
319				if err != nil {
320					return err
321				}
322				aicp.AccessInformationCreateParameterProperties = &accessInformationCreateParameterProperties
323			}
324		}
325	}
326
327	return nil
328}
329
330// AccessInformationSecretsContract tenant access information contract of the API Management service.
331type AccessInformationSecretsContract struct {
332	autorest.Response `json:"-"`
333	// ID - Access Information type ('access' or 'gitAccess')
334	ID *string `json:"id,omitempty"`
335	// PrincipalID - Principal (User) Identifier.
336	PrincipalID *string `json:"principalId,omitempty"`
337	// PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
338	PrimaryKey *string `json:"primaryKey,omitempty"`
339	// SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
340	SecondaryKey *string `json:"secondaryKey,omitempty"`
341	// Enabled - Determines whether direct access is enabled.
342	Enabled *bool `json:"enabled,omitempty"`
343}
344
345// AccessInformationUpdateParameterProperties tenant access information update parameters of the API
346// Management service
347type AccessInformationUpdateParameterProperties struct {
348	// Enabled - Determines whether direct access is enabled.
349	Enabled *bool `json:"enabled,omitempty"`
350}
351
352// AccessInformationUpdateParameters tenant access information update parameters.
353type AccessInformationUpdateParameters struct {
354	// AccessInformationUpdateParameterProperties - Tenant access information update parameter properties.
355	*AccessInformationUpdateParameterProperties `json:"properties,omitempty"`
356}
357
358// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters.
359func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) {
360	objectMap := make(map[string]interface{})
361	if aiup.AccessInformationUpdateParameterProperties != nil {
362		objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties
363	}
364	return json.Marshal(objectMap)
365}
366
367// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct.
368func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error {
369	var m map[string]*json.RawMessage
370	err := json.Unmarshal(body, &m)
371	if err != nil {
372		return err
373	}
374	for k, v := range m {
375		switch k {
376		case "properties":
377			if v != nil {
378				var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties
379				err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties)
380				if err != nil {
381					return err
382				}
383				aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties
384			}
385		}
386	}
387
388	return nil
389}
390
391// AdditionalLocation description of an additional API Management resource location.
392type AdditionalLocation struct {
393	// Location - The location name of the additional region among Azure Data center regions.
394	Location *string `json:"location,omitempty"`
395	// Sku - SKU properties of the API Management service.
396	Sku *ServiceSkuProperties `json:"sku,omitempty"`
397	// Zones - A list of availability zones denoting where the resource needs to come from.
398	Zones *[]string `json:"zones,omitempty"`
399	// PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for Basic, Standard, Premium and Isolated SKU.
400	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
401	// 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, Premium and Isolated SKU.
402	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
403	// PublicIPAddressID - Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported only for Premium SKU being deployed in Virtual Network.
404	PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
405	// VirtualNetworkConfiguration - Virtual network configuration for the location.
406	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
407	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region.
408	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
409	// 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.
410	DisableGateway *bool `json:"disableGateway,omitempty"`
411}
412
413// MarshalJSON is the custom marshaler for AdditionalLocation.
414func (al AdditionalLocation) MarshalJSON() ([]byte, error) {
415	objectMap := make(map[string]interface{})
416	if al.Location != nil {
417		objectMap["location"] = al.Location
418	}
419	if al.Sku != nil {
420		objectMap["sku"] = al.Sku
421	}
422	if al.Zones != nil {
423		objectMap["zones"] = al.Zones
424	}
425	if al.PublicIPAddressID != nil {
426		objectMap["publicIpAddressId"] = al.PublicIPAddressID
427	}
428	if al.VirtualNetworkConfiguration != nil {
429		objectMap["virtualNetworkConfiguration"] = al.VirtualNetworkConfiguration
430	}
431	if al.DisableGateway != nil {
432		objectMap["disableGateway"] = al.DisableGateway
433	}
434	return json.Marshal(objectMap)
435}
436
437// APICollection paged API list representation.
438type APICollection struct {
439	autorest.Response `json:"-"`
440	// Value - READ-ONLY; Page values.
441	Value *[]APIContract `json:"value,omitempty"`
442	// Count - Total record count number across all pages.
443	Count *int64 `json:"count,omitempty"`
444	// NextLink - READ-ONLY; Next page link if any.
445	NextLink *string `json:"nextLink,omitempty"`
446}
447
448// MarshalJSON is the custom marshaler for APICollection.
449func (ac APICollection) MarshalJSON() ([]byte, error) {
450	objectMap := make(map[string]interface{})
451	if ac.Count != nil {
452		objectMap["count"] = ac.Count
453	}
454	return json.Marshal(objectMap)
455}
456
457// APICollectionIterator provides access to a complete listing of APIContract values.
458type APICollectionIterator struct {
459	i    int
460	page APICollectionPage
461}
462
463// NextWithContext advances to the next value.  If there was an error making
464// the request the iterator does not advance and the error is returned.
465func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) {
466	if tracing.IsEnabled() {
467		ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext")
468		defer func() {
469			sc := -1
470			if iter.Response().Response.Response != nil {
471				sc = iter.Response().Response.Response.StatusCode
472			}
473			tracing.EndSpan(ctx, sc, err)
474		}()
475	}
476	iter.i++
477	if iter.i < len(iter.page.Values()) {
478		return nil
479	}
480	err = iter.page.NextWithContext(ctx)
481	if err != nil {
482		iter.i--
483		return err
484	}
485	iter.i = 0
486	return nil
487}
488
489// Next advances to the next value.  If there was an error making
490// the request the iterator does not advance and the error is returned.
491// Deprecated: Use NextWithContext() instead.
492func (iter *APICollectionIterator) Next() error {
493	return iter.NextWithContext(context.Background())
494}
495
496// NotDone returns true if the enumeration should be started or is not yet complete.
497func (iter APICollectionIterator) NotDone() bool {
498	return iter.page.NotDone() && iter.i < len(iter.page.Values())
499}
500
501// Response returns the raw server response from the last page request.
502func (iter APICollectionIterator) Response() APICollection {
503	return iter.page.Response()
504}
505
506// Value returns the current value or a zero-initialized value if the
507// iterator has advanced beyond the end of the collection.
508func (iter APICollectionIterator) Value() APIContract {
509	if !iter.page.NotDone() {
510		return APIContract{}
511	}
512	return iter.page.Values()[iter.i]
513}
514
515// Creates a new instance of the APICollectionIterator type.
516func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator {
517	return APICollectionIterator{page: page}
518}
519
520// IsEmpty returns true if the ListResult contains no values.
521func (ac APICollection) IsEmpty() bool {
522	return ac.Value == nil || len(*ac.Value) == 0
523}
524
525// hasNextLink returns true if the NextLink is not empty.
526func (ac APICollection) hasNextLink() bool {
527	return ac.NextLink != nil && len(*ac.NextLink) != 0
528}
529
530// aPICollectionPreparer prepares a request to retrieve the next set of results.
531// It returns nil if no more results exist.
532func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) {
533	if !ac.hasNextLink() {
534		return nil, nil
535	}
536	return autorest.Prepare((&http.Request{}).WithContext(ctx),
537		autorest.AsJSON(),
538		autorest.AsGet(),
539		autorest.WithBaseURL(to.String(ac.NextLink)))
540}
541
542// APICollectionPage contains a page of APIContract values.
543type APICollectionPage struct {
544	fn func(context.Context, APICollection) (APICollection, error)
545	ac APICollection
546}
547
548// NextWithContext advances to the next page of values.  If there was an error making
549// the request the page does not advance and the error is returned.
550func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) {
551	if tracing.IsEnabled() {
552		ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext")
553		defer func() {
554			sc := -1
555			if page.Response().Response.Response != nil {
556				sc = page.Response().Response.Response.StatusCode
557			}
558			tracing.EndSpan(ctx, sc, err)
559		}()
560	}
561	for {
562		next, err := page.fn(ctx, page.ac)
563		if err != nil {
564			return err
565		}
566		page.ac = next
567		if !next.hasNextLink() || !next.IsEmpty() {
568			break
569		}
570	}
571	return nil
572}
573
574// Next advances to the next page of values.  If there was an error making
575// the request the page does not advance and the error is returned.
576// Deprecated: Use NextWithContext() instead.
577func (page *APICollectionPage) Next() error {
578	return page.NextWithContext(context.Background())
579}
580
581// NotDone returns true if the page enumeration should be started or is not yet complete.
582func (page APICollectionPage) NotDone() bool {
583	return !page.ac.IsEmpty()
584}
585
586// Response returns the raw server response from the last page request.
587func (page APICollectionPage) Response() APICollection {
588	return page.ac
589}
590
591// Values returns the slice of values for the current page or nil if there are no values.
592func (page APICollectionPage) Values() []APIContract {
593	if page.ac.IsEmpty() {
594		return nil
595	}
596	return *page.ac.Value
597}
598
599// Creates a new instance of the APICollectionPage type.
600func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage {
601	return APICollectionPage{
602		fn: getNextPage,
603		ac: cur,
604	}
605}
606
607// APIContactInformation API contact information
608type APIContactInformation struct {
609	// Name - The identifying name of the contact person/organization
610	Name *string `json:"name,omitempty"`
611	// URL - The URL pointing to the contact information. MUST be in the format of a URL
612	URL *string `json:"url,omitempty"`
613	// Email - The email address of the contact person/organization. MUST be in the format of an email address
614	Email *string `json:"email,omitempty"`
615}
616
617// APIContract API details.
618type APIContract struct {
619	autorest.Response `json:"-"`
620	// APIContractProperties - API entity contract properties.
621	*APIContractProperties `json:"properties,omitempty"`
622	// ID - READ-ONLY; Resource ID.
623	ID *string `json:"id,omitempty"`
624	// Name - READ-ONLY; Resource name.
625	Name *string `json:"name,omitempty"`
626	// Type - READ-ONLY; Resource type for API Management resource.
627	Type *string `json:"type,omitempty"`
628}
629
630// MarshalJSON is the custom marshaler for APIContract.
631func (ac APIContract) MarshalJSON() ([]byte, error) {
632	objectMap := make(map[string]interface{})
633	if ac.APIContractProperties != nil {
634		objectMap["properties"] = ac.APIContractProperties
635	}
636	return json.Marshal(objectMap)
637}
638
639// UnmarshalJSON is the custom unmarshaler for APIContract struct.
640func (ac *APIContract) UnmarshalJSON(body []byte) error {
641	var m map[string]*json.RawMessage
642	err := json.Unmarshal(body, &m)
643	if err != nil {
644		return err
645	}
646	for k, v := range m {
647		switch k {
648		case "properties":
649			if v != nil {
650				var APIContractProperties APIContractProperties
651				err = json.Unmarshal(*v, &APIContractProperties)
652				if err != nil {
653					return err
654				}
655				ac.APIContractProperties = &APIContractProperties
656			}
657		case "id":
658			if v != nil {
659				var ID string
660				err = json.Unmarshal(*v, &ID)
661				if err != nil {
662					return err
663				}
664				ac.ID = &ID
665			}
666		case "name":
667			if v != nil {
668				var name string
669				err = json.Unmarshal(*v, &name)
670				if err != nil {
671					return err
672				}
673				ac.Name = &name
674			}
675		case "type":
676			if v != nil {
677				var typeVar string
678				err = json.Unmarshal(*v, &typeVar)
679				if err != nil {
680					return err
681				}
682				ac.Type = &typeVar
683			}
684		}
685	}
686
687	return nil
688}
689
690// APIContractProperties API Entity Properties
691type APIContractProperties struct {
692	// SourceAPIID - API identifier of the source API.
693	SourceAPIID *string `json:"sourceApiId,omitempty"`
694	// DisplayName - API name. Must be 1 to 300 characters long.
695	DisplayName *string `json:"displayName,omitempty"`
696	// ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
697	ServiceURL *string `json:"serviceUrl,omitempty"`
698	// 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.
699	Path *string `json:"path,omitempty"`
700	// Protocols - Describes on which protocols the operations in this API can be invoked.
701	Protocols *[]Protocol `json:"protocols,omitempty"`
702	// APIVersionSet - Version set details
703	APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"`
704	// Description - Description of the API. May include HTML formatting tags.
705	Description *string `json:"description,omitempty"`
706	// AuthenticationSettings - Collection of authentication settings included into this API.
707	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
708	// SubscriptionKeyParameterNames - Protocols over which API is made available.
709	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
710	// APIType - Type of API. Possible values include: 'APITypeHTTP', 'APITypeSoap', 'APITypeWebsocket'
711	APIType APIType `json:"type,omitempty"`
712	// APIRevision - Describes the revision of the API. If no value is provided, default revision 1 is created
713	APIRevision *string `json:"apiRevision,omitempty"`
714	// APIVersion - Indicates the version identifier of the API if the API is versioned
715	APIVersion *string `json:"apiVersion,omitempty"`
716	// IsCurrent - Indicates if API revision is current api revision.
717	IsCurrent *bool `json:"isCurrent,omitempty"`
718	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
719	IsOnline *bool `json:"isOnline,omitempty"`
720	// APIRevisionDescription - Description of the API Revision.
721	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
722	// APIVersionDescription - Description of the API Version.
723	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
724	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
725	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
726	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
727	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
728	// TermsOfServiceURL -  A URL to the Terms of Service for the API. MUST be in the format of a URL.
729	TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
730	// Contact - Contact information for the API.
731	Contact *APIContactInformation `json:"contact,omitempty"`
732	// License - License information for the API.
733	License *APILicenseInformation `json:"license,omitempty"`
734}
735
736// MarshalJSON is the custom marshaler for APIContractProperties.
737func (acp APIContractProperties) MarshalJSON() ([]byte, error) {
738	objectMap := make(map[string]interface{})
739	if acp.SourceAPIID != nil {
740		objectMap["sourceApiId"] = acp.SourceAPIID
741	}
742	if acp.DisplayName != nil {
743		objectMap["displayName"] = acp.DisplayName
744	}
745	if acp.ServiceURL != nil {
746		objectMap["serviceUrl"] = acp.ServiceURL
747	}
748	if acp.Path != nil {
749		objectMap["path"] = acp.Path
750	}
751	if acp.Protocols != nil {
752		objectMap["protocols"] = acp.Protocols
753	}
754	if acp.APIVersionSet != nil {
755		objectMap["apiVersionSet"] = acp.APIVersionSet
756	}
757	if acp.Description != nil {
758		objectMap["description"] = acp.Description
759	}
760	if acp.AuthenticationSettings != nil {
761		objectMap["authenticationSettings"] = acp.AuthenticationSettings
762	}
763	if acp.SubscriptionKeyParameterNames != nil {
764		objectMap["subscriptionKeyParameterNames"] = acp.SubscriptionKeyParameterNames
765	}
766	if acp.APIType != "" {
767		objectMap["type"] = acp.APIType
768	}
769	if acp.APIRevision != nil {
770		objectMap["apiRevision"] = acp.APIRevision
771	}
772	if acp.APIVersion != nil {
773		objectMap["apiVersion"] = acp.APIVersion
774	}
775	if acp.IsCurrent != nil {
776		objectMap["isCurrent"] = acp.IsCurrent
777	}
778	if acp.APIRevisionDescription != nil {
779		objectMap["apiRevisionDescription"] = acp.APIRevisionDescription
780	}
781	if acp.APIVersionDescription != nil {
782		objectMap["apiVersionDescription"] = acp.APIVersionDescription
783	}
784	if acp.APIVersionSetID != nil {
785		objectMap["apiVersionSetId"] = acp.APIVersionSetID
786	}
787	if acp.SubscriptionRequired != nil {
788		objectMap["subscriptionRequired"] = acp.SubscriptionRequired
789	}
790	if acp.TermsOfServiceURL != nil {
791		objectMap["termsOfServiceUrl"] = acp.TermsOfServiceURL
792	}
793	if acp.Contact != nil {
794		objectMap["contact"] = acp.Contact
795	}
796	if acp.License != nil {
797		objectMap["license"] = acp.License
798	}
799	return json.Marshal(objectMap)
800}
801
802// APIContractUpdateProperties API update contract properties.
803type APIContractUpdateProperties struct {
804	// DisplayName - API name.
805	DisplayName *string `json:"displayName,omitempty"`
806	// ServiceURL - Absolute URL of the backend service implementing this API.
807	ServiceURL *string `json:"serviceUrl,omitempty"`
808	// 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.
809	Path *string `json:"path,omitempty"`
810	// Protocols - Describes on which protocols the operations in this API can be invoked.
811	Protocols *[]Protocol `json:"protocols,omitempty"`
812	// Description - Description of the API. May include HTML formatting tags.
813	Description *string `json:"description,omitempty"`
814	// AuthenticationSettings - Collection of authentication settings included into this API.
815	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
816	// SubscriptionKeyParameterNames - Protocols over which API is made available.
817	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
818	// APIType - Type of API. Possible values include: 'APITypeHTTP', 'APITypeSoap', 'APITypeWebsocket'
819	APIType APIType `json:"type,omitempty"`
820	// APIRevision - Describes the revision of the API. If no value is provided, default revision 1 is created
821	APIRevision *string `json:"apiRevision,omitempty"`
822	// APIVersion - Indicates the version identifier of the API if the API is versioned
823	APIVersion *string `json:"apiVersion,omitempty"`
824	// IsCurrent - Indicates if API revision is current api revision.
825	IsCurrent *bool `json:"isCurrent,omitempty"`
826	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
827	IsOnline *bool `json:"isOnline,omitempty"`
828	// APIRevisionDescription - Description of the API Revision.
829	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
830	// APIVersionDescription - Description of the API Version.
831	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
832	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
833	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
834	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
835	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
836	// TermsOfServiceURL -  A URL to the Terms of Service for the API. MUST be in the format of a URL.
837	TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
838	// Contact - Contact information for the API.
839	Contact *APIContactInformation `json:"contact,omitempty"`
840	// License - License information for the API.
841	License *APILicenseInformation `json:"license,omitempty"`
842}
843
844// MarshalJSON is the custom marshaler for APIContractUpdateProperties.
845func (acup APIContractUpdateProperties) MarshalJSON() ([]byte, error) {
846	objectMap := make(map[string]interface{})
847	if acup.DisplayName != nil {
848		objectMap["displayName"] = acup.DisplayName
849	}
850	if acup.ServiceURL != nil {
851		objectMap["serviceUrl"] = acup.ServiceURL
852	}
853	if acup.Path != nil {
854		objectMap["path"] = acup.Path
855	}
856	if acup.Protocols != nil {
857		objectMap["protocols"] = acup.Protocols
858	}
859	if acup.Description != nil {
860		objectMap["description"] = acup.Description
861	}
862	if acup.AuthenticationSettings != nil {
863		objectMap["authenticationSettings"] = acup.AuthenticationSettings
864	}
865	if acup.SubscriptionKeyParameterNames != nil {
866		objectMap["subscriptionKeyParameterNames"] = acup.SubscriptionKeyParameterNames
867	}
868	if acup.APIType != "" {
869		objectMap["type"] = acup.APIType
870	}
871	if acup.APIRevision != nil {
872		objectMap["apiRevision"] = acup.APIRevision
873	}
874	if acup.APIVersion != nil {
875		objectMap["apiVersion"] = acup.APIVersion
876	}
877	if acup.IsCurrent != nil {
878		objectMap["isCurrent"] = acup.IsCurrent
879	}
880	if acup.APIRevisionDescription != nil {
881		objectMap["apiRevisionDescription"] = acup.APIRevisionDescription
882	}
883	if acup.APIVersionDescription != nil {
884		objectMap["apiVersionDescription"] = acup.APIVersionDescription
885	}
886	if acup.APIVersionSetID != nil {
887		objectMap["apiVersionSetId"] = acup.APIVersionSetID
888	}
889	if acup.SubscriptionRequired != nil {
890		objectMap["subscriptionRequired"] = acup.SubscriptionRequired
891	}
892	if acup.TermsOfServiceURL != nil {
893		objectMap["termsOfServiceUrl"] = acup.TermsOfServiceURL
894	}
895	if acup.Contact != nil {
896		objectMap["contact"] = acup.Contact
897	}
898	if acup.License != nil {
899		objectMap["license"] = acup.License
900	}
901	return json.Marshal(objectMap)
902}
903
904// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
905// operation.
906type APICreateOrUpdateFuture struct {
907	azure.FutureAPI
908	// Result returns the result of the asynchronous operation.
909	// If the operation has not completed it will return an error.
910	Result func(APIClient) (APIContract, error)
911}
912
913// UnmarshalJSON is the custom unmarshaller for CreateFuture.
914func (future *APICreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
915	var azFuture azure.Future
916	if err := json.Unmarshal(body, &azFuture); err != nil {
917		return err
918	}
919	future.FutureAPI = &azFuture
920	future.Result = future.result
921	return nil
922}
923
924// result is the default implementation for APICreateOrUpdateFuture.Result.
925func (future *APICreateOrUpdateFuture) result(client APIClient) (ac APIContract, err error) {
926	var done bool
927	done, err = future.DoneWithContext(context.Background(), client)
928	if err != nil {
929		err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
930		return
931	}
932	if !done {
933		ac.Response.Response = future.Response()
934		err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture")
935		return
936	}
937	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
938	if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent {
939		ac, err = client.CreateOrUpdateResponder(ac.Response.Response)
940		if err != nil {
941			err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request")
942		}
943	}
944	return
945}
946
947// APICreateOrUpdateParameter API Create or Update Parameters.
948type APICreateOrUpdateParameter struct {
949	// APICreateOrUpdateProperties - API entity create of update properties.
950	*APICreateOrUpdateProperties `json:"properties,omitempty"`
951}
952
953// MarshalJSON is the custom marshaler for APICreateOrUpdateParameter.
954func (acoup APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) {
955	objectMap := make(map[string]interface{})
956	if acoup.APICreateOrUpdateProperties != nil {
957		objectMap["properties"] = acoup.APICreateOrUpdateProperties
958	}
959	return json.Marshal(objectMap)
960}
961
962// UnmarshalJSON is the custom unmarshaler for APICreateOrUpdateParameter struct.
963func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error {
964	var m map[string]*json.RawMessage
965	err := json.Unmarshal(body, &m)
966	if err != nil {
967		return err
968	}
969	for k, v := range m {
970		switch k {
971		case "properties":
972			if v != nil {
973				var APICreateOrUpdateProperties APICreateOrUpdateProperties
974				err = json.Unmarshal(*v, &APICreateOrUpdateProperties)
975				if err != nil {
976					return err
977				}
978				acoup.APICreateOrUpdateProperties = &APICreateOrUpdateProperties
979			}
980		}
981	}
982
983	return nil
984}
985
986// APICreateOrUpdateProperties API Create or Update Properties.
987type APICreateOrUpdateProperties struct {
988	// Value - Content value when Importing an API.
989	Value *string `json:"value,omitempty"`
990	// Format - Format of the Content in which the API is getting imported. Possible values include: 'ContentFormatWadlXML', 'ContentFormatWadlLinkJSON', 'ContentFormatSwaggerJSON', 'ContentFormatSwaggerLinkJSON', 'ContentFormatWsdl', 'ContentFormatWsdlLink', 'ContentFormatOpenapi', 'ContentFormatOpenapijson', 'ContentFormatOpenapiLink', 'ContentFormatOpenapijsonLink'
991	Format ContentFormat `json:"format,omitempty"`
992	// WsdlSelector - Criteria to limit import of WSDL to a subset of the document.
993	WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"`
994	// SoapAPIType - Type of API to create.
995	//  * `http` creates a REST API
996	//  * `soap` creates a SOAP pass-through API
997	//  * `websocket` creates websocket API. Possible values include: 'SoapAPITypeSoapToRest', 'SoapAPITypeSoapPassThrough', 'SoapAPITypeWebSocket'
998	SoapAPIType SoapAPIType `json:"apiType,omitempty"`
999	// SourceAPIID - API identifier of the source API.
1000	SourceAPIID *string `json:"sourceApiId,omitempty"`
1001	// DisplayName - API name. Must be 1 to 300 characters long.
1002	DisplayName *string `json:"displayName,omitempty"`
1003	// ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long.
1004	ServiceURL *string `json:"serviceUrl,omitempty"`
1005	// 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.
1006	Path *string `json:"path,omitempty"`
1007	// Protocols - Describes on which protocols the operations in this API can be invoked.
1008	Protocols *[]Protocol `json:"protocols,omitempty"`
1009	// APIVersionSet - Version set details
1010	APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"`
1011	// Description - Description of the API. May include HTML formatting tags.
1012	Description *string `json:"description,omitempty"`
1013	// AuthenticationSettings - Collection of authentication settings included into this API.
1014	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
1015	// SubscriptionKeyParameterNames - Protocols over which API is made available.
1016	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
1017	// APIType - Type of API. Possible values include: 'APITypeHTTP', 'APITypeSoap', 'APITypeWebsocket'
1018	APIType APIType `json:"type,omitempty"`
1019	// APIRevision - Describes the revision of the API. If no value is provided, default revision 1 is created
1020	APIRevision *string `json:"apiRevision,omitempty"`
1021	// APIVersion - Indicates the version identifier of the API if the API is versioned
1022	APIVersion *string `json:"apiVersion,omitempty"`
1023	// IsCurrent - Indicates if API revision is current api revision.
1024	IsCurrent *bool `json:"isCurrent,omitempty"`
1025	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
1026	IsOnline *bool `json:"isOnline,omitempty"`
1027	// APIRevisionDescription - Description of the API Revision.
1028	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
1029	// APIVersionDescription - Description of the API Version.
1030	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
1031	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
1032	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
1033	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
1034	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
1035	// TermsOfServiceURL -  A URL to the Terms of Service for the API. MUST be in the format of a URL.
1036	TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
1037	// Contact - Contact information for the API.
1038	Contact *APIContactInformation `json:"contact,omitempty"`
1039	// License - License information for the API.
1040	License *APILicenseInformation `json:"license,omitempty"`
1041}
1042
1043// MarshalJSON is the custom marshaler for APICreateOrUpdateProperties.
1044func (acoup APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) {
1045	objectMap := make(map[string]interface{})
1046	if acoup.Value != nil {
1047		objectMap["value"] = acoup.Value
1048	}
1049	if acoup.Format != "" {
1050		objectMap["format"] = acoup.Format
1051	}
1052	if acoup.WsdlSelector != nil {
1053		objectMap["wsdlSelector"] = acoup.WsdlSelector
1054	}
1055	if acoup.SoapAPIType != "" {
1056		objectMap["apiType"] = acoup.SoapAPIType
1057	}
1058	if acoup.SourceAPIID != nil {
1059		objectMap["sourceApiId"] = acoup.SourceAPIID
1060	}
1061	if acoup.DisplayName != nil {
1062		objectMap["displayName"] = acoup.DisplayName
1063	}
1064	if acoup.ServiceURL != nil {
1065		objectMap["serviceUrl"] = acoup.ServiceURL
1066	}
1067	if acoup.Path != nil {
1068		objectMap["path"] = acoup.Path
1069	}
1070	if acoup.Protocols != nil {
1071		objectMap["protocols"] = acoup.Protocols
1072	}
1073	if acoup.APIVersionSet != nil {
1074		objectMap["apiVersionSet"] = acoup.APIVersionSet
1075	}
1076	if acoup.Description != nil {
1077		objectMap["description"] = acoup.Description
1078	}
1079	if acoup.AuthenticationSettings != nil {
1080		objectMap["authenticationSettings"] = acoup.AuthenticationSettings
1081	}
1082	if acoup.SubscriptionKeyParameterNames != nil {
1083		objectMap["subscriptionKeyParameterNames"] = acoup.SubscriptionKeyParameterNames
1084	}
1085	if acoup.APIType != "" {
1086		objectMap["type"] = acoup.APIType
1087	}
1088	if acoup.APIRevision != nil {
1089		objectMap["apiRevision"] = acoup.APIRevision
1090	}
1091	if acoup.APIVersion != nil {
1092		objectMap["apiVersion"] = acoup.APIVersion
1093	}
1094	if acoup.IsCurrent != nil {
1095		objectMap["isCurrent"] = acoup.IsCurrent
1096	}
1097	if acoup.APIRevisionDescription != nil {
1098		objectMap["apiRevisionDescription"] = acoup.APIRevisionDescription
1099	}
1100	if acoup.APIVersionDescription != nil {
1101		objectMap["apiVersionDescription"] = acoup.APIVersionDescription
1102	}
1103	if acoup.APIVersionSetID != nil {
1104		objectMap["apiVersionSetId"] = acoup.APIVersionSetID
1105	}
1106	if acoup.SubscriptionRequired != nil {
1107		objectMap["subscriptionRequired"] = acoup.SubscriptionRequired
1108	}
1109	if acoup.TermsOfServiceURL != nil {
1110		objectMap["termsOfServiceUrl"] = acoup.TermsOfServiceURL
1111	}
1112	if acoup.Contact != nil {
1113		objectMap["contact"] = acoup.Contact
1114	}
1115	if acoup.License != nil {
1116		objectMap["license"] = acoup.License
1117	}
1118	return json.Marshal(objectMap)
1119}
1120
1121// APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document.
1122type APICreateOrUpdatePropertiesWsdlSelector struct {
1123	// WsdlServiceName - Name of service to import from WSDL
1124	WsdlServiceName *string `json:"wsdlServiceName,omitempty"`
1125	// WsdlEndpointName - Name of endpoint(port) to import from WSDL
1126	WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"`
1127}
1128
1129// APIEntityBaseContract API base contract details.
1130type APIEntityBaseContract struct {
1131	// Description - Description of the API. May include HTML formatting tags.
1132	Description *string `json:"description,omitempty"`
1133	// AuthenticationSettings - Collection of authentication settings included into this API.
1134	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
1135	// SubscriptionKeyParameterNames - Protocols over which API is made available.
1136	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
1137	// APIType - Type of API. Possible values include: 'APITypeHTTP', 'APITypeSoap', 'APITypeWebsocket'
1138	APIType APIType `json:"type,omitempty"`
1139	// APIRevision - Describes the revision of the API. If no value is provided, default revision 1 is created
1140	APIRevision *string `json:"apiRevision,omitempty"`
1141	// APIVersion - Indicates the version identifier of the API if the API is versioned
1142	APIVersion *string `json:"apiVersion,omitempty"`
1143	// IsCurrent - Indicates if API revision is current api revision.
1144	IsCurrent *bool `json:"isCurrent,omitempty"`
1145	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
1146	IsOnline *bool `json:"isOnline,omitempty"`
1147	// APIRevisionDescription - Description of the API Revision.
1148	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
1149	// APIVersionDescription - Description of the API Version.
1150	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
1151	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
1152	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
1153	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
1154	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
1155	// TermsOfServiceURL -  A URL to the Terms of Service for the API. MUST be in the format of a URL.
1156	TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
1157	// Contact - Contact information for the API.
1158	Contact *APIContactInformation `json:"contact,omitempty"`
1159	// License - License information for the API.
1160	License *APILicenseInformation `json:"license,omitempty"`
1161}
1162
1163// MarshalJSON is the custom marshaler for APIEntityBaseContract.
1164func (aebc APIEntityBaseContract) MarshalJSON() ([]byte, error) {
1165	objectMap := make(map[string]interface{})
1166	if aebc.Description != nil {
1167		objectMap["description"] = aebc.Description
1168	}
1169	if aebc.AuthenticationSettings != nil {
1170		objectMap["authenticationSettings"] = aebc.AuthenticationSettings
1171	}
1172	if aebc.SubscriptionKeyParameterNames != nil {
1173		objectMap["subscriptionKeyParameterNames"] = aebc.SubscriptionKeyParameterNames
1174	}
1175	if aebc.APIType != "" {
1176		objectMap["type"] = aebc.APIType
1177	}
1178	if aebc.APIRevision != nil {
1179		objectMap["apiRevision"] = aebc.APIRevision
1180	}
1181	if aebc.APIVersion != nil {
1182		objectMap["apiVersion"] = aebc.APIVersion
1183	}
1184	if aebc.IsCurrent != nil {
1185		objectMap["isCurrent"] = aebc.IsCurrent
1186	}
1187	if aebc.APIRevisionDescription != nil {
1188		objectMap["apiRevisionDescription"] = aebc.APIRevisionDescription
1189	}
1190	if aebc.APIVersionDescription != nil {
1191		objectMap["apiVersionDescription"] = aebc.APIVersionDescription
1192	}
1193	if aebc.APIVersionSetID != nil {
1194		objectMap["apiVersionSetId"] = aebc.APIVersionSetID
1195	}
1196	if aebc.SubscriptionRequired != nil {
1197		objectMap["subscriptionRequired"] = aebc.SubscriptionRequired
1198	}
1199	if aebc.TermsOfServiceURL != nil {
1200		objectMap["termsOfServiceUrl"] = aebc.TermsOfServiceURL
1201	}
1202	if aebc.Contact != nil {
1203		objectMap["contact"] = aebc.Contact
1204	}
1205	if aebc.License != nil {
1206		objectMap["license"] = aebc.License
1207	}
1208	return json.Marshal(objectMap)
1209}
1210
1211// APIExportResult API Export result.
1212type APIExportResult struct {
1213	autorest.Response `json:"-"`
1214	// ID - ResourceId of the API which was exported.
1215	ID *string `json:"id,omitempty"`
1216	// 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'
1217	ExportResultFormat ExportResultFormat `json:"format,omitempty"`
1218	// Value - The object defining the schema of the exported API Detail
1219	Value *APIExportResultValue `json:"value,omitempty"`
1220}
1221
1222// APIExportResultValue the object defining the schema of the exported API Detail
1223type APIExportResultValue struct {
1224	// Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes.
1225	Link *string `json:"link,omitempty"`
1226}
1227
1228// APILicenseInformation API license information
1229type APILicenseInformation struct {
1230	// Name - The license name used for the API
1231	Name *string `json:"name,omitempty"`
1232	// URL - A URL to the license used for the API. MUST be in the format of a URL
1233	URL *string `json:"url,omitempty"`
1234}
1235
1236// ApimResource the Resource definition.
1237type ApimResource struct {
1238	// ID - READ-ONLY; Resource ID.
1239	ID *string `json:"id,omitempty"`
1240	// Name - READ-ONLY; Resource name.
1241	Name *string `json:"name,omitempty"`
1242	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
1243	Type *string `json:"type,omitempty"`
1244	// Tags - Resource tags.
1245	Tags map[string]*string `json:"tags"`
1246}
1247
1248// MarshalJSON is the custom marshaler for ApimResource.
1249func (ar ApimResource) MarshalJSON() ([]byte, error) {
1250	objectMap := make(map[string]interface{})
1251	if ar.Tags != nil {
1252		objectMap["tags"] = ar.Tags
1253	}
1254	return json.Marshal(objectMap)
1255}
1256
1257// APIReleaseCollection paged ApiRelease list representation.
1258type APIReleaseCollection struct {
1259	autorest.Response `json:"-"`
1260	// Value - READ-ONLY; Page values.
1261	Value *[]APIReleaseContract `json:"value,omitempty"`
1262	// Count - Total record count number across all pages.
1263	Count *int64 `json:"count,omitempty"`
1264	// NextLink - READ-ONLY; Next page link if any.
1265	NextLink *string `json:"nextLink,omitempty"`
1266}
1267
1268// MarshalJSON is the custom marshaler for APIReleaseCollection.
1269func (arc APIReleaseCollection) MarshalJSON() ([]byte, error) {
1270	objectMap := make(map[string]interface{})
1271	if arc.Count != nil {
1272		objectMap["count"] = arc.Count
1273	}
1274	return json.Marshal(objectMap)
1275}
1276
1277// APIReleaseCollectionIterator provides access to a complete listing of APIReleaseContract values.
1278type APIReleaseCollectionIterator struct {
1279	i    int
1280	page APIReleaseCollectionPage
1281}
1282
1283// NextWithContext advances to the next value.  If there was an error making
1284// the request the iterator does not advance and the error is returned.
1285func (iter *APIReleaseCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1286	if tracing.IsEnabled() {
1287		ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionIterator.NextWithContext")
1288		defer func() {
1289			sc := -1
1290			if iter.Response().Response.Response != nil {
1291				sc = iter.Response().Response.Response.StatusCode
1292			}
1293			tracing.EndSpan(ctx, sc, err)
1294		}()
1295	}
1296	iter.i++
1297	if iter.i < len(iter.page.Values()) {
1298		return nil
1299	}
1300	err = iter.page.NextWithContext(ctx)
1301	if err != nil {
1302		iter.i--
1303		return err
1304	}
1305	iter.i = 0
1306	return nil
1307}
1308
1309// Next advances to the next value.  If there was an error making
1310// the request the iterator does not advance and the error is returned.
1311// Deprecated: Use NextWithContext() instead.
1312func (iter *APIReleaseCollectionIterator) Next() error {
1313	return iter.NextWithContext(context.Background())
1314}
1315
1316// NotDone returns true if the enumeration should be started or is not yet complete.
1317func (iter APIReleaseCollectionIterator) NotDone() bool {
1318	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1319}
1320
1321// Response returns the raw server response from the last page request.
1322func (iter APIReleaseCollectionIterator) Response() APIReleaseCollection {
1323	return iter.page.Response()
1324}
1325
1326// Value returns the current value or a zero-initialized value if the
1327// iterator has advanced beyond the end of the collection.
1328func (iter APIReleaseCollectionIterator) Value() APIReleaseContract {
1329	if !iter.page.NotDone() {
1330		return APIReleaseContract{}
1331	}
1332	return iter.page.Values()[iter.i]
1333}
1334
1335// Creates a new instance of the APIReleaseCollectionIterator type.
1336func NewAPIReleaseCollectionIterator(page APIReleaseCollectionPage) APIReleaseCollectionIterator {
1337	return APIReleaseCollectionIterator{page: page}
1338}
1339
1340// IsEmpty returns true if the ListResult contains no values.
1341func (arc APIReleaseCollection) IsEmpty() bool {
1342	return arc.Value == nil || len(*arc.Value) == 0
1343}
1344
1345// hasNextLink returns true if the NextLink is not empty.
1346func (arc APIReleaseCollection) hasNextLink() bool {
1347	return arc.NextLink != nil && len(*arc.NextLink) != 0
1348}
1349
1350// aPIReleaseCollectionPreparer prepares a request to retrieve the next set of results.
1351// It returns nil if no more results exist.
1352func (arc APIReleaseCollection) aPIReleaseCollectionPreparer(ctx context.Context) (*http.Request, error) {
1353	if !arc.hasNextLink() {
1354		return nil, nil
1355	}
1356	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1357		autorest.AsJSON(),
1358		autorest.AsGet(),
1359		autorest.WithBaseURL(to.String(arc.NextLink)))
1360}
1361
1362// APIReleaseCollectionPage contains a page of APIReleaseContract values.
1363type APIReleaseCollectionPage struct {
1364	fn  func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)
1365	arc APIReleaseCollection
1366}
1367
1368// NextWithContext advances to the next page of values.  If there was an error making
1369// the request the page does not advance and the error is returned.
1370func (page *APIReleaseCollectionPage) NextWithContext(ctx context.Context) (err error) {
1371	if tracing.IsEnabled() {
1372		ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseCollectionPage.NextWithContext")
1373		defer func() {
1374			sc := -1
1375			if page.Response().Response.Response != nil {
1376				sc = page.Response().Response.Response.StatusCode
1377			}
1378			tracing.EndSpan(ctx, sc, err)
1379		}()
1380	}
1381	for {
1382		next, err := page.fn(ctx, page.arc)
1383		if err != nil {
1384			return err
1385		}
1386		page.arc = next
1387		if !next.hasNextLink() || !next.IsEmpty() {
1388			break
1389		}
1390	}
1391	return nil
1392}
1393
1394// Next advances to the next page of values.  If there was an error making
1395// the request the page does not advance and the error is returned.
1396// Deprecated: Use NextWithContext() instead.
1397func (page *APIReleaseCollectionPage) Next() error {
1398	return page.NextWithContext(context.Background())
1399}
1400
1401// NotDone returns true if the page enumeration should be started or is not yet complete.
1402func (page APIReleaseCollectionPage) NotDone() bool {
1403	return !page.arc.IsEmpty()
1404}
1405
1406// Response returns the raw server response from the last page request.
1407func (page APIReleaseCollectionPage) Response() APIReleaseCollection {
1408	return page.arc
1409}
1410
1411// Values returns the slice of values for the current page or nil if there are no values.
1412func (page APIReleaseCollectionPage) Values() []APIReleaseContract {
1413	if page.arc.IsEmpty() {
1414		return nil
1415	}
1416	return *page.arc.Value
1417}
1418
1419// Creates a new instance of the APIReleaseCollectionPage type.
1420func NewAPIReleaseCollectionPage(cur APIReleaseCollection, getNextPage func(context.Context, APIReleaseCollection) (APIReleaseCollection, error)) APIReleaseCollectionPage {
1421	return APIReleaseCollectionPage{
1422		fn:  getNextPage,
1423		arc: cur,
1424	}
1425}
1426
1427// APIReleaseContract apiRelease details.
1428type APIReleaseContract struct {
1429	autorest.Response `json:"-"`
1430	// APIReleaseContractProperties - ApiRelease entity contract properties.
1431	*APIReleaseContractProperties `json:"properties,omitempty"`
1432	// ID - READ-ONLY; Resource ID.
1433	ID *string `json:"id,omitempty"`
1434	// Name - READ-ONLY; Resource name.
1435	Name *string `json:"name,omitempty"`
1436	// Type - READ-ONLY; Resource type for API Management resource.
1437	Type *string `json:"type,omitempty"`
1438}
1439
1440// MarshalJSON is the custom marshaler for APIReleaseContract.
1441func (arc APIReleaseContract) MarshalJSON() ([]byte, error) {
1442	objectMap := make(map[string]interface{})
1443	if arc.APIReleaseContractProperties != nil {
1444		objectMap["properties"] = arc.APIReleaseContractProperties
1445	}
1446	return json.Marshal(objectMap)
1447}
1448
1449// UnmarshalJSON is the custom unmarshaler for APIReleaseContract struct.
1450func (arc *APIReleaseContract) UnmarshalJSON(body []byte) error {
1451	var m map[string]*json.RawMessage
1452	err := json.Unmarshal(body, &m)
1453	if err != nil {
1454		return err
1455	}
1456	for k, v := range m {
1457		switch k {
1458		case "properties":
1459			if v != nil {
1460				var APIReleaseContractProperties APIReleaseContractProperties
1461				err = json.Unmarshal(*v, &APIReleaseContractProperties)
1462				if err != nil {
1463					return err
1464				}
1465				arc.APIReleaseContractProperties = &APIReleaseContractProperties
1466			}
1467		case "id":
1468			if v != nil {
1469				var ID string
1470				err = json.Unmarshal(*v, &ID)
1471				if err != nil {
1472					return err
1473				}
1474				arc.ID = &ID
1475			}
1476		case "name":
1477			if v != nil {
1478				var name string
1479				err = json.Unmarshal(*v, &name)
1480				if err != nil {
1481					return err
1482				}
1483				arc.Name = &name
1484			}
1485		case "type":
1486			if v != nil {
1487				var typeVar string
1488				err = json.Unmarshal(*v, &typeVar)
1489				if err != nil {
1490					return err
1491				}
1492				arc.Type = &typeVar
1493			}
1494		}
1495	}
1496
1497	return nil
1498}
1499
1500// APIReleaseContractProperties API Release details
1501type APIReleaseContractProperties struct {
1502	// APIID - Identifier of the API the release belongs to.
1503	APIID *string `json:"apiId,omitempty"`
1504	// 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.
1505	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
1506	// UpdatedDateTime - READ-ONLY; The time the API release was updated.
1507	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
1508	// Notes - Release Notes
1509	Notes *string `json:"notes,omitempty"`
1510}
1511
1512// MarshalJSON is the custom marshaler for APIReleaseContractProperties.
1513func (arcp APIReleaseContractProperties) MarshalJSON() ([]byte, error) {
1514	objectMap := make(map[string]interface{})
1515	if arcp.APIID != nil {
1516		objectMap["apiId"] = arcp.APIID
1517	}
1518	if arcp.Notes != nil {
1519		objectMap["notes"] = arcp.Notes
1520	}
1521	return json.Marshal(objectMap)
1522}
1523
1524// APIRevisionCollection paged API Revision list representation.
1525type APIRevisionCollection struct {
1526	autorest.Response `json:"-"`
1527	// Value - READ-ONLY; Page values.
1528	Value *[]APIRevisionContract `json:"value,omitempty"`
1529	// Count - Total record count number across all pages.
1530	Count *int64 `json:"count,omitempty"`
1531	// NextLink - READ-ONLY; Next page link if any.
1532	NextLink *string `json:"nextLink,omitempty"`
1533}
1534
1535// MarshalJSON is the custom marshaler for APIRevisionCollection.
1536func (arc APIRevisionCollection) MarshalJSON() ([]byte, error) {
1537	objectMap := make(map[string]interface{})
1538	if arc.Count != nil {
1539		objectMap["count"] = arc.Count
1540	}
1541	return json.Marshal(objectMap)
1542}
1543
1544// APIRevisionCollectionIterator provides access to a complete listing of APIRevisionContract values.
1545type APIRevisionCollectionIterator struct {
1546	i    int
1547	page APIRevisionCollectionPage
1548}
1549
1550// NextWithContext advances to the next value.  If there was an error making
1551// the request the iterator does not advance and the error is returned.
1552func (iter *APIRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1553	if tracing.IsEnabled() {
1554		ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionIterator.NextWithContext")
1555		defer func() {
1556			sc := -1
1557			if iter.Response().Response.Response != nil {
1558				sc = iter.Response().Response.Response.StatusCode
1559			}
1560			tracing.EndSpan(ctx, sc, err)
1561		}()
1562	}
1563	iter.i++
1564	if iter.i < len(iter.page.Values()) {
1565		return nil
1566	}
1567	err = iter.page.NextWithContext(ctx)
1568	if err != nil {
1569		iter.i--
1570		return err
1571	}
1572	iter.i = 0
1573	return nil
1574}
1575
1576// Next advances to the next value.  If there was an error making
1577// the request the iterator does not advance and the error is returned.
1578// Deprecated: Use NextWithContext() instead.
1579func (iter *APIRevisionCollectionIterator) Next() error {
1580	return iter.NextWithContext(context.Background())
1581}
1582
1583// NotDone returns true if the enumeration should be started or is not yet complete.
1584func (iter APIRevisionCollectionIterator) NotDone() bool {
1585	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1586}
1587
1588// Response returns the raw server response from the last page request.
1589func (iter APIRevisionCollectionIterator) Response() APIRevisionCollection {
1590	return iter.page.Response()
1591}
1592
1593// Value returns the current value or a zero-initialized value if the
1594// iterator has advanced beyond the end of the collection.
1595func (iter APIRevisionCollectionIterator) Value() APIRevisionContract {
1596	if !iter.page.NotDone() {
1597		return APIRevisionContract{}
1598	}
1599	return iter.page.Values()[iter.i]
1600}
1601
1602// Creates a new instance of the APIRevisionCollectionIterator type.
1603func NewAPIRevisionCollectionIterator(page APIRevisionCollectionPage) APIRevisionCollectionIterator {
1604	return APIRevisionCollectionIterator{page: page}
1605}
1606
1607// IsEmpty returns true if the ListResult contains no values.
1608func (arc APIRevisionCollection) IsEmpty() bool {
1609	return arc.Value == nil || len(*arc.Value) == 0
1610}
1611
1612// hasNextLink returns true if the NextLink is not empty.
1613func (arc APIRevisionCollection) hasNextLink() bool {
1614	return arc.NextLink != nil && len(*arc.NextLink) != 0
1615}
1616
1617// aPIRevisionCollectionPreparer prepares a request to retrieve the next set of results.
1618// It returns nil if no more results exist.
1619func (arc APIRevisionCollection) aPIRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) {
1620	if !arc.hasNextLink() {
1621		return nil, nil
1622	}
1623	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1624		autorest.AsJSON(),
1625		autorest.AsGet(),
1626		autorest.WithBaseURL(to.String(arc.NextLink)))
1627}
1628
1629// APIRevisionCollectionPage contains a page of APIRevisionContract values.
1630type APIRevisionCollectionPage struct {
1631	fn  func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)
1632	arc APIRevisionCollection
1633}
1634
1635// NextWithContext advances to the next page of values.  If there was an error making
1636// the request the page does not advance and the error is returned.
1637func (page *APIRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) {
1638	if tracing.IsEnabled() {
1639		ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionCollectionPage.NextWithContext")
1640		defer func() {
1641			sc := -1
1642			if page.Response().Response.Response != nil {
1643				sc = page.Response().Response.Response.StatusCode
1644			}
1645			tracing.EndSpan(ctx, sc, err)
1646		}()
1647	}
1648	for {
1649		next, err := page.fn(ctx, page.arc)
1650		if err != nil {
1651			return err
1652		}
1653		page.arc = next
1654		if !next.hasNextLink() || !next.IsEmpty() {
1655			break
1656		}
1657	}
1658	return nil
1659}
1660
1661// Next advances to the next page of values.  If there was an error making
1662// the request the page does not advance and the error is returned.
1663// Deprecated: Use NextWithContext() instead.
1664func (page *APIRevisionCollectionPage) Next() error {
1665	return page.NextWithContext(context.Background())
1666}
1667
1668// NotDone returns true if the page enumeration should be started or is not yet complete.
1669func (page APIRevisionCollectionPage) NotDone() bool {
1670	return !page.arc.IsEmpty()
1671}
1672
1673// Response returns the raw server response from the last page request.
1674func (page APIRevisionCollectionPage) Response() APIRevisionCollection {
1675	return page.arc
1676}
1677
1678// Values returns the slice of values for the current page or nil if there are no values.
1679func (page APIRevisionCollectionPage) Values() []APIRevisionContract {
1680	if page.arc.IsEmpty() {
1681		return nil
1682	}
1683	return *page.arc.Value
1684}
1685
1686// Creates a new instance of the APIRevisionCollectionPage type.
1687func NewAPIRevisionCollectionPage(cur APIRevisionCollection, getNextPage func(context.Context, APIRevisionCollection) (APIRevisionCollection, error)) APIRevisionCollectionPage {
1688	return APIRevisionCollectionPage{
1689		fn:  getNextPage,
1690		arc: cur,
1691	}
1692}
1693
1694// APIRevisionContract summary of revision metadata.
1695type APIRevisionContract struct {
1696	// APIID - READ-ONLY; Identifier of the API Revision.
1697	APIID *string `json:"apiId,omitempty"`
1698	// APIRevision - READ-ONLY; Revision number of API.
1699	APIRevision *string `json:"apiRevision,omitempty"`
1700	// 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.
1701	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
1702	// 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.
1703	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
1704	// Description - READ-ONLY; Description of the API Revision.
1705	Description *string `json:"description,omitempty"`
1706	// PrivateURL - READ-ONLY; Gateway URL for accessing the non-current API Revision.
1707	PrivateURL *string `json:"privateUrl,omitempty"`
1708	// IsOnline - READ-ONLY; Indicates if API revision is the current api revision.
1709	IsOnline *bool `json:"isOnline,omitempty"`
1710	// IsCurrent - READ-ONLY; Indicates if API revision is accessible via the gateway.
1711	IsCurrent *bool `json:"isCurrent,omitempty"`
1712}
1713
1714// MarshalJSON is the custom marshaler for APIRevisionContract.
1715func (arc APIRevisionContract) MarshalJSON() ([]byte, error) {
1716	objectMap := make(map[string]interface{})
1717	return json.Marshal(objectMap)
1718}
1719
1720// APIRevisionInfoContract object used to create an API Revision or Version based on an existing API
1721// Revision
1722type APIRevisionInfoContract struct {
1723	// SourceAPIID - Resource identifier of API to be used to create the revision from.
1724	SourceAPIID *string `json:"sourceApiId,omitempty"`
1725	// APIVersionName - Version identifier for the new API Version.
1726	APIVersionName *string `json:"apiVersionName,omitempty"`
1727	// APIRevisionDescription - Description of new API Revision.
1728	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
1729	// APIVersionSet - Version set details
1730	APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"`
1731}
1732
1733// APISchemaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1734// operation.
1735type APISchemaCreateOrUpdateFuture struct {
1736	azure.FutureAPI
1737	// Result returns the result of the asynchronous operation.
1738	// If the operation has not completed it will return an error.
1739	Result func(APISchemaClient) (SchemaContract, error)
1740}
1741
1742// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1743func (future *APISchemaCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1744	var azFuture azure.Future
1745	if err := json.Unmarshal(body, &azFuture); err != nil {
1746		return err
1747	}
1748	future.FutureAPI = &azFuture
1749	future.Result = future.result
1750	return nil
1751}
1752
1753// result is the default implementation for APISchemaCreateOrUpdateFuture.Result.
1754func (future *APISchemaCreateOrUpdateFuture) result(client APISchemaClient) (sc SchemaContract, err error) {
1755	var done bool
1756	done, err = future.DoneWithContext(context.Background(), client)
1757	if err != nil {
1758		err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1759		return
1760	}
1761	if !done {
1762		sc.Response.Response = future.Response()
1763		err = azure.NewAsyncOpIncompleteError("apimanagement.APISchemaCreateOrUpdateFuture")
1764		return
1765	}
1766	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1767	if sc.Response.Response, err = future.GetResult(sender); err == nil && sc.Response.Response.StatusCode != http.StatusNoContent {
1768		sc, err = client.CreateOrUpdateResponder(sc.Response.Response)
1769		if err != nil {
1770			err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", sc.Response.Response, "Failure responding to request")
1771		}
1772	}
1773	return
1774}
1775
1776// APITagResourceContractProperties API contract properties for the Tag Resources.
1777type APITagResourceContractProperties struct {
1778	// ID - API identifier in the form /apis/{apiId}.
1779	ID *string `json:"id,omitempty"`
1780	// Name - API name.
1781	Name *string `json:"name,omitempty"`
1782	// ServiceURL - Absolute URL of the backend service implementing this API.
1783	ServiceURL *string `json:"serviceUrl,omitempty"`
1784	// 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.
1785	Path *string `json:"path,omitempty"`
1786	// Protocols - Describes on which protocols the operations in this API can be invoked.
1787	Protocols *[]Protocol `json:"protocols,omitempty"`
1788	// Description - Description of the API. May include HTML formatting tags.
1789	Description *string `json:"description,omitempty"`
1790	// AuthenticationSettings - Collection of authentication settings included into this API.
1791	AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"`
1792	// SubscriptionKeyParameterNames - Protocols over which API is made available.
1793	SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"`
1794	// APIType - Type of API. Possible values include: 'APITypeHTTP', 'APITypeSoap', 'APITypeWebsocket'
1795	APIType APIType `json:"type,omitempty"`
1796	// APIRevision - Describes the revision of the API. If no value is provided, default revision 1 is created
1797	APIRevision *string `json:"apiRevision,omitempty"`
1798	// APIVersion - Indicates the version identifier of the API if the API is versioned
1799	APIVersion *string `json:"apiVersion,omitempty"`
1800	// IsCurrent - Indicates if API revision is current api revision.
1801	IsCurrent *bool `json:"isCurrent,omitempty"`
1802	// IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway.
1803	IsOnline *bool `json:"isOnline,omitempty"`
1804	// APIRevisionDescription - Description of the API Revision.
1805	APIRevisionDescription *string `json:"apiRevisionDescription,omitempty"`
1806	// APIVersionDescription - Description of the API Version.
1807	APIVersionDescription *string `json:"apiVersionDescription,omitempty"`
1808	// APIVersionSetID - A resource identifier for the related ApiVersionSet.
1809	APIVersionSetID *string `json:"apiVersionSetId,omitempty"`
1810	// SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API.
1811	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
1812	// TermsOfServiceURL -  A URL to the Terms of Service for the API. MUST be in the format of a URL.
1813	TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"`
1814	// Contact - Contact information for the API.
1815	Contact *APIContactInformation `json:"contact,omitempty"`
1816	// License - License information for the API.
1817	License *APILicenseInformation `json:"license,omitempty"`
1818}
1819
1820// MarshalJSON is the custom marshaler for APITagResourceContractProperties.
1821func (atrcp APITagResourceContractProperties) MarshalJSON() ([]byte, error) {
1822	objectMap := make(map[string]interface{})
1823	if atrcp.ID != nil {
1824		objectMap["id"] = atrcp.ID
1825	}
1826	if atrcp.Name != nil {
1827		objectMap["name"] = atrcp.Name
1828	}
1829	if atrcp.ServiceURL != nil {
1830		objectMap["serviceUrl"] = atrcp.ServiceURL
1831	}
1832	if atrcp.Path != nil {
1833		objectMap["path"] = atrcp.Path
1834	}
1835	if atrcp.Protocols != nil {
1836		objectMap["protocols"] = atrcp.Protocols
1837	}
1838	if atrcp.Description != nil {
1839		objectMap["description"] = atrcp.Description
1840	}
1841	if atrcp.AuthenticationSettings != nil {
1842		objectMap["authenticationSettings"] = atrcp.AuthenticationSettings
1843	}
1844	if atrcp.SubscriptionKeyParameterNames != nil {
1845		objectMap["subscriptionKeyParameterNames"] = atrcp.SubscriptionKeyParameterNames
1846	}
1847	if atrcp.APIType != "" {
1848		objectMap["type"] = atrcp.APIType
1849	}
1850	if atrcp.APIRevision != nil {
1851		objectMap["apiRevision"] = atrcp.APIRevision
1852	}
1853	if atrcp.APIVersion != nil {
1854		objectMap["apiVersion"] = atrcp.APIVersion
1855	}
1856	if atrcp.IsCurrent != nil {
1857		objectMap["isCurrent"] = atrcp.IsCurrent
1858	}
1859	if atrcp.APIRevisionDescription != nil {
1860		objectMap["apiRevisionDescription"] = atrcp.APIRevisionDescription
1861	}
1862	if atrcp.APIVersionDescription != nil {
1863		objectMap["apiVersionDescription"] = atrcp.APIVersionDescription
1864	}
1865	if atrcp.APIVersionSetID != nil {
1866		objectMap["apiVersionSetId"] = atrcp.APIVersionSetID
1867	}
1868	if atrcp.SubscriptionRequired != nil {
1869		objectMap["subscriptionRequired"] = atrcp.SubscriptionRequired
1870	}
1871	if atrcp.TermsOfServiceURL != nil {
1872		objectMap["termsOfServiceUrl"] = atrcp.TermsOfServiceURL
1873	}
1874	if atrcp.Contact != nil {
1875		objectMap["contact"] = atrcp.Contact
1876	}
1877	if atrcp.License != nil {
1878		objectMap["license"] = atrcp.License
1879	}
1880	return json.Marshal(objectMap)
1881}
1882
1883// APIUpdateContract API update contract details.
1884type APIUpdateContract struct {
1885	// APIContractUpdateProperties - Properties of the API entity that can be updated.
1886	*APIContractUpdateProperties `json:"properties,omitempty"`
1887}
1888
1889// MarshalJSON is the custom marshaler for APIUpdateContract.
1890func (auc APIUpdateContract) MarshalJSON() ([]byte, error) {
1891	objectMap := make(map[string]interface{})
1892	if auc.APIContractUpdateProperties != nil {
1893		objectMap["properties"] = auc.APIContractUpdateProperties
1894	}
1895	return json.Marshal(objectMap)
1896}
1897
1898// UnmarshalJSON is the custom unmarshaler for APIUpdateContract struct.
1899func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error {
1900	var m map[string]*json.RawMessage
1901	err := json.Unmarshal(body, &m)
1902	if err != nil {
1903		return err
1904	}
1905	for k, v := range m {
1906		switch k {
1907		case "properties":
1908			if v != nil {
1909				var APIContractUpdateProperties APIContractUpdateProperties
1910				err = json.Unmarshal(*v, &APIContractUpdateProperties)
1911				if err != nil {
1912					return err
1913				}
1914				auc.APIContractUpdateProperties = &APIContractUpdateProperties
1915			}
1916		}
1917	}
1918
1919	return nil
1920}
1921
1922// APIVersionConstraint control Plane Apis version constraint for the API Management service.
1923type APIVersionConstraint struct {
1924	// MinAPIVersion - Limit control plane API calls to API Management service with version equal to or newer than this value.
1925	MinAPIVersion *string `json:"minApiVersion,omitempty"`
1926}
1927
1928// APIVersionSetCollection paged API Version Set list representation.
1929type APIVersionSetCollection struct {
1930	autorest.Response `json:"-"`
1931	// Value - Page values.
1932	Value *[]APIVersionSetContract `json:"value,omitempty"`
1933	// Count - Total record count number across all pages.
1934	Count *int64 `json:"count,omitempty"`
1935	// NextLink - Next page link if any.
1936	NextLink *string `json:"nextLink,omitempty"`
1937}
1938
1939// APIVersionSetCollectionIterator provides access to a complete listing of APIVersionSetContract values.
1940type APIVersionSetCollectionIterator struct {
1941	i    int
1942	page APIVersionSetCollectionPage
1943}
1944
1945// NextWithContext advances to the next value.  If there was an error making
1946// the request the iterator does not advance and the error is returned.
1947func (iter *APIVersionSetCollectionIterator) NextWithContext(ctx context.Context) (err error) {
1948	if tracing.IsEnabled() {
1949		ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionIterator.NextWithContext")
1950		defer func() {
1951			sc := -1
1952			if iter.Response().Response.Response != nil {
1953				sc = iter.Response().Response.Response.StatusCode
1954			}
1955			tracing.EndSpan(ctx, sc, err)
1956		}()
1957	}
1958	iter.i++
1959	if iter.i < len(iter.page.Values()) {
1960		return nil
1961	}
1962	err = iter.page.NextWithContext(ctx)
1963	if err != nil {
1964		iter.i--
1965		return err
1966	}
1967	iter.i = 0
1968	return nil
1969}
1970
1971// Next advances to the next value.  If there was an error making
1972// the request the iterator does not advance and the error is returned.
1973// Deprecated: Use NextWithContext() instead.
1974func (iter *APIVersionSetCollectionIterator) Next() error {
1975	return iter.NextWithContext(context.Background())
1976}
1977
1978// NotDone returns true if the enumeration should be started or is not yet complete.
1979func (iter APIVersionSetCollectionIterator) NotDone() bool {
1980	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1981}
1982
1983// Response returns the raw server response from the last page request.
1984func (iter APIVersionSetCollectionIterator) Response() APIVersionSetCollection {
1985	return iter.page.Response()
1986}
1987
1988// Value returns the current value or a zero-initialized value if the
1989// iterator has advanced beyond the end of the collection.
1990func (iter APIVersionSetCollectionIterator) Value() APIVersionSetContract {
1991	if !iter.page.NotDone() {
1992		return APIVersionSetContract{}
1993	}
1994	return iter.page.Values()[iter.i]
1995}
1996
1997// Creates a new instance of the APIVersionSetCollectionIterator type.
1998func NewAPIVersionSetCollectionIterator(page APIVersionSetCollectionPage) APIVersionSetCollectionIterator {
1999	return APIVersionSetCollectionIterator{page: page}
2000}
2001
2002// IsEmpty returns true if the ListResult contains no values.
2003func (avsc APIVersionSetCollection) IsEmpty() bool {
2004	return avsc.Value == nil || len(*avsc.Value) == 0
2005}
2006
2007// hasNextLink returns true if the NextLink is not empty.
2008func (avsc APIVersionSetCollection) hasNextLink() bool {
2009	return avsc.NextLink != nil && len(*avsc.NextLink) != 0
2010}
2011
2012// aPIVersionSetCollectionPreparer prepares a request to retrieve the next set of results.
2013// It returns nil if no more results exist.
2014func (avsc APIVersionSetCollection) aPIVersionSetCollectionPreparer(ctx context.Context) (*http.Request, error) {
2015	if !avsc.hasNextLink() {
2016		return nil, nil
2017	}
2018	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2019		autorest.AsJSON(),
2020		autorest.AsGet(),
2021		autorest.WithBaseURL(to.String(avsc.NextLink)))
2022}
2023
2024// APIVersionSetCollectionPage contains a page of APIVersionSetContract values.
2025type APIVersionSetCollectionPage struct {
2026	fn   func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)
2027	avsc APIVersionSetCollection
2028}
2029
2030// NextWithContext advances to the next page of values.  If there was an error making
2031// the request the page does not advance and the error is returned.
2032func (page *APIVersionSetCollectionPage) NextWithContext(ctx context.Context) (err error) {
2033	if tracing.IsEnabled() {
2034		ctx = tracing.StartSpan(ctx, fqdn+"/APIVersionSetCollectionPage.NextWithContext")
2035		defer func() {
2036			sc := -1
2037			if page.Response().Response.Response != nil {
2038				sc = page.Response().Response.Response.StatusCode
2039			}
2040			tracing.EndSpan(ctx, sc, err)
2041		}()
2042	}
2043	for {
2044		next, err := page.fn(ctx, page.avsc)
2045		if err != nil {
2046			return err
2047		}
2048		page.avsc = next
2049		if !next.hasNextLink() || !next.IsEmpty() {
2050			break
2051		}
2052	}
2053	return nil
2054}
2055
2056// Next advances to the next page of values.  If there was an error making
2057// the request the page does not advance and the error is returned.
2058// Deprecated: Use NextWithContext() instead.
2059func (page *APIVersionSetCollectionPage) Next() error {
2060	return page.NextWithContext(context.Background())
2061}
2062
2063// NotDone returns true if the page enumeration should be started or is not yet complete.
2064func (page APIVersionSetCollectionPage) NotDone() bool {
2065	return !page.avsc.IsEmpty()
2066}
2067
2068// Response returns the raw server response from the last page request.
2069func (page APIVersionSetCollectionPage) Response() APIVersionSetCollection {
2070	return page.avsc
2071}
2072
2073// Values returns the slice of values for the current page or nil if there are no values.
2074func (page APIVersionSetCollectionPage) Values() []APIVersionSetContract {
2075	if page.avsc.IsEmpty() {
2076		return nil
2077	}
2078	return *page.avsc.Value
2079}
2080
2081// Creates a new instance of the APIVersionSetCollectionPage type.
2082func NewAPIVersionSetCollectionPage(cur APIVersionSetCollection, getNextPage func(context.Context, APIVersionSetCollection) (APIVersionSetCollection, error)) APIVersionSetCollectionPage {
2083	return APIVersionSetCollectionPage{
2084		fn:   getNextPage,
2085		avsc: cur,
2086	}
2087}
2088
2089// APIVersionSetContract API Version Set Contract details.
2090type APIVersionSetContract struct {
2091	autorest.Response `json:"-"`
2092	// APIVersionSetContractProperties - API VersionSet contract properties.
2093	*APIVersionSetContractProperties `json:"properties,omitempty"`
2094	// ID - READ-ONLY; Resource ID.
2095	ID *string `json:"id,omitempty"`
2096	// Name - READ-ONLY; Resource name.
2097	Name *string `json:"name,omitempty"`
2098	// Type - READ-ONLY; Resource type for API Management resource.
2099	Type *string `json:"type,omitempty"`
2100}
2101
2102// MarshalJSON is the custom marshaler for APIVersionSetContract.
2103func (avsc APIVersionSetContract) MarshalJSON() ([]byte, error) {
2104	objectMap := make(map[string]interface{})
2105	if avsc.APIVersionSetContractProperties != nil {
2106		objectMap["properties"] = avsc.APIVersionSetContractProperties
2107	}
2108	return json.Marshal(objectMap)
2109}
2110
2111// UnmarshalJSON is the custom unmarshaler for APIVersionSetContract struct.
2112func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error {
2113	var m map[string]*json.RawMessage
2114	err := json.Unmarshal(body, &m)
2115	if err != nil {
2116		return err
2117	}
2118	for k, v := range m {
2119		switch k {
2120		case "properties":
2121			if v != nil {
2122				var APIVersionSetContractProperties APIVersionSetContractProperties
2123				err = json.Unmarshal(*v, &APIVersionSetContractProperties)
2124				if err != nil {
2125					return err
2126				}
2127				avsc.APIVersionSetContractProperties = &APIVersionSetContractProperties
2128			}
2129		case "id":
2130			if v != nil {
2131				var ID string
2132				err = json.Unmarshal(*v, &ID)
2133				if err != nil {
2134					return err
2135				}
2136				avsc.ID = &ID
2137			}
2138		case "name":
2139			if v != nil {
2140				var name string
2141				err = json.Unmarshal(*v, &name)
2142				if err != nil {
2143					return err
2144				}
2145				avsc.Name = &name
2146			}
2147		case "type":
2148			if v != nil {
2149				var typeVar string
2150				err = json.Unmarshal(*v, &typeVar)
2151				if err != nil {
2152					return err
2153				}
2154				avsc.Type = &typeVar
2155			}
2156		}
2157	}
2158
2159	return nil
2160}
2161
2162// APIVersionSetContractDetails an API Version Set contains the common configuration for a set of API
2163// Versions relating
2164type APIVersionSetContractDetails struct {
2165	// ID - Identifier for existing API Version Set. Omit this value to create a new Version Set.
2166	ID *string `json:"id,omitempty"`
2167	// Name - The display Name of the API Version Set.
2168	Name *string `json:"name,omitempty"`
2169	// Description - Description of API Version Set.
2170	Description *string `json:"description,omitempty"`
2171	// VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header'
2172	VersioningScheme VersioningScheme1 `json:"versioningScheme,omitempty"`
2173	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
2174	VersionQueryName *string `json:"versionQueryName,omitempty"`
2175	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
2176	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
2177}
2178
2179// APIVersionSetContractProperties properties of an API Version Set.
2180type APIVersionSetContractProperties struct {
2181	// DisplayName - Name of API Version Set
2182	DisplayName *string `json:"displayName,omitempty"`
2183	// VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader'
2184	VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"`
2185	// Description - Description of API Version Set.
2186	Description *string `json:"description,omitempty"`
2187	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
2188	VersionQueryName *string `json:"versionQueryName,omitempty"`
2189	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
2190	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
2191}
2192
2193// APIVersionSetEntityBase API Version set base parameters
2194type APIVersionSetEntityBase struct {
2195	// Description - Description of API Version Set.
2196	Description *string `json:"description,omitempty"`
2197	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
2198	VersionQueryName *string `json:"versionQueryName,omitempty"`
2199	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
2200	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
2201}
2202
2203// APIVersionSetUpdateParameters parameters to update or create an API Version Set Contract.
2204type APIVersionSetUpdateParameters struct {
2205	// APIVersionSetUpdateParametersProperties - Parameters to update or create an API Version Set Contract.
2206	*APIVersionSetUpdateParametersProperties `json:"properties,omitempty"`
2207}
2208
2209// MarshalJSON is the custom marshaler for APIVersionSetUpdateParameters.
2210func (avsup APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) {
2211	objectMap := make(map[string]interface{})
2212	if avsup.APIVersionSetUpdateParametersProperties != nil {
2213		objectMap["properties"] = avsup.APIVersionSetUpdateParametersProperties
2214	}
2215	return json.Marshal(objectMap)
2216}
2217
2218// UnmarshalJSON is the custom unmarshaler for APIVersionSetUpdateParameters struct.
2219func (avsup *APIVersionSetUpdateParameters) UnmarshalJSON(body []byte) error {
2220	var m map[string]*json.RawMessage
2221	err := json.Unmarshal(body, &m)
2222	if err != nil {
2223		return err
2224	}
2225	for k, v := range m {
2226		switch k {
2227		case "properties":
2228			if v != nil {
2229				var APIVersionSetUpdateParametersProperties APIVersionSetUpdateParametersProperties
2230				err = json.Unmarshal(*v, &APIVersionSetUpdateParametersProperties)
2231				if err != nil {
2232					return err
2233				}
2234				avsup.APIVersionSetUpdateParametersProperties = &APIVersionSetUpdateParametersProperties
2235			}
2236		}
2237	}
2238
2239	return nil
2240}
2241
2242// APIVersionSetUpdateParametersProperties properties used to create or update an API Version Set.
2243type APIVersionSetUpdateParametersProperties struct {
2244	// DisplayName - Name of API Version Set
2245	DisplayName *string `json:"displayName,omitempty"`
2246	// VersioningScheme - An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: 'VersioningSchemeSegment', 'VersioningSchemeQuery', 'VersioningSchemeHeader'
2247	VersioningScheme VersioningScheme `json:"versioningScheme,omitempty"`
2248	// Description - Description of API Version Set.
2249	Description *string `json:"description,omitempty"`
2250	// VersionQueryName - Name of query parameter that indicates the API Version if versioningScheme is set to `query`.
2251	VersionQueryName *string `json:"versionQueryName,omitempty"`
2252	// VersionHeaderName - Name of HTTP header parameter that indicates the API Version if versioningScheme is set to `header`.
2253	VersionHeaderName *string `json:"versionHeaderName,omitempty"`
2254}
2255
2256// AssociationContract association entity details.
2257type AssociationContract struct {
2258	// AssociationContractProperties - Association entity contract properties.
2259	*AssociationContractProperties `json:"properties,omitempty"`
2260	// ID - READ-ONLY; Resource ID.
2261	ID *string `json:"id,omitempty"`
2262	// Name - READ-ONLY; Resource name.
2263	Name *string `json:"name,omitempty"`
2264	// Type - READ-ONLY; Resource type for API Management resource.
2265	Type *string `json:"type,omitempty"`
2266}
2267
2268// MarshalJSON is the custom marshaler for AssociationContract.
2269func (ac AssociationContract) MarshalJSON() ([]byte, error) {
2270	objectMap := make(map[string]interface{})
2271	if ac.AssociationContractProperties != nil {
2272		objectMap["properties"] = ac.AssociationContractProperties
2273	}
2274	return json.Marshal(objectMap)
2275}
2276
2277// UnmarshalJSON is the custom unmarshaler for AssociationContract struct.
2278func (ac *AssociationContract) UnmarshalJSON(body []byte) error {
2279	var m map[string]*json.RawMessage
2280	err := json.Unmarshal(body, &m)
2281	if err != nil {
2282		return err
2283	}
2284	for k, v := range m {
2285		switch k {
2286		case "properties":
2287			if v != nil {
2288				var associationContractProperties AssociationContractProperties
2289				err = json.Unmarshal(*v, &associationContractProperties)
2290				if err != nil {
2291					return err
2292				}
2293				ac.AssociationContractProperties = &associationContractProperties
2294			}
2295		case "id":
2296			if v != nil {
2297				var ID string
2298				err = json.Unmarshal(*v, &ID)
2299				if err != nil {
2300					return err
2301				}
2302				ac.ID = &ID
2303			}
2304		case "name":
2305			if v != nil {
2306				var name string
2307				err = json.Unmarshal(*v, &name)
2308				if err != nil {
2309					return err
2310				}
2311				ac.Name = &name
2312			}
2313		case "type":
2314			if v != nil {
2315				var typeVar string
2316				err = json.Unmarshal(*v, &typeVar)
2317				if err != nil {
2318					return err
2319				}
2320				ac.Type = &typeVar
2321			}
2322		}
2323	}
2324
2325	return nil
2326}
2327
2328// AssociationContractProperties association entity contract properties.
2329type AssociationContractProperties struct {
2330	// ProvisioningState - Provisioning state. Possible values include: 'ProvisioningStateCreated'
2331	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2332}
2333
2334// AuthenticationSettingsContract API Authentication Settings.
2335type AuthenticationSettingsContract struct {
2336	// OAuth2 - OAuth2 Authentication settings
2337	OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"`
2338	// Openid - OpenID Connect Authentication Settings
2339	Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"`
2340}
2341
2342// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation.
2343type AuthorizationServerCollection struct {
2344	autorest.Response `json:"-"`
2345	// Value - Page values.
2346	Value *[]AuthorizationServerContract `json:"value,omitempty"`
2347	// Count - Total record count number across all pages.
2348	Count *int64 `json:"count,omitempty"`
2349	// NextLink - Next page link if any.
2350	NextLink *string `json:"nextLink,omitempty"`
2351}
2352
2353// AuthorizationServerCollectionIterator provides access to a complete listing of
2354// AuthorizationServerContract values.
2355type AuthorizationServerCollectionIterator struct {
2356	i    int
2357	page AuthorizationServerCollectionPage
2358}
2359
2360// NextWithContext advances to the next value.  If there was an error making
2361// the request the iterator does not advance and the error is returned.
2362func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2363	if tracing.IsEnabled() {
2364		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext")
2365		defer func() {
2366			sc := -1
2367			if iter.Response().Response.Response != nil {
2368				sc = iter.Response().Response.Response.StatusCode
2369			}
2370			tracing.EndSpan(ctx, sc, err)
2371		}()
2372	}
2373	iter.i++
2374	if iter.i < len(iter.page.Values()) {
2375		return nil
2376	}
2377	err = iter.page.NextWithContext(ctx)
2378	if err != nil {
2379		iter.i--
2380		return err
2381	}
2382	iter.i = 0
2383	return nil
2384}
2385
2386// Next advances to the next value.  If there was an error making
2387// the request the iterator does not advance and the error is returned.
2388// Deprecated: Use NextWithContext() instead.
2389func (iter *AuthorizationServerCollectionIterator) Next() error {
2390	return iter.NextWithContext(context.Background())
2391}
2392
2393// NotDone returns true if the enumeration should be started or is not yet complete.
2394func (iter AuthorizationServerCollectionIterator) NotDone() bool {
2395	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2396}
2397
2398// Response returns the raw server response from the last page request.
2399func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection {
2400	return iter.page.Response()
2401}
2402
2403// Value returns the current value or a zero-initialized value if the
2404// iterator has advanced beyond the end of the collection.
2405func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract {
2406	if !iter.page.NotDone() {
2407		return AuthorizationServerContract{}
2408	}
2409	return iter.page.Values()[iter.i]
2410}
2411
2412// Creates a new instance of the AuthorizationServerCollectionIterator type.
2413func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator {
2414	return AuthorizationServerCollectionIterator{page: page}
2415}
2416
2417// IsEmpty returns true if the ListResult contains no values.
2418func (asc AuthorizationServerCollection) IsEmpty() bool {
2419	return asc.Value == nil || len(*asc.Value) == 0
2420}
2421
2422// hasNextLink returns true if the NextLink is not empty.
2423func (asc AuthorizationServerCollection) hasNextLink() bool {
2424	return asc.NextLink != nil && len(*asc.NextLink) != 0
2425}
2426
2427// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results.
2428// It returns nil if no more results exist.
2429func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) {
2430	if !asc.hasNextLink() {
2431		return nil, nil
2432	}
2433	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2434		autorest.AsJSON(),
2435		autorest.AsGet(),
2436		autorest.WithBaseURL(to.String(asc.NextLink)))
2437}
2438
2439// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values.
2440type AuthorizationServerCollectionPage struct {
2441	fn  func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)
2442	asc AuthorizationServerCollection
2443}
2444
2445// NextWithContext advances to the next page of values.  If there was an error making
2446// the request the page does not advance and the error is returned.
2447func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) {
2448	if tracing.IsEnabled() {
2449		ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext")
2450		defer func() {
2451			sc := -1
2452			if page.Response().Response.Response != nil {
2453				sc = page.Response().Response.Response.StatusCode
2454			}
2455			tracing.EndSpan(ctx, sc, err)
2456		}()
2457	}
2458	for {
2459		next, err := page.fn(ctx, page.asc)
2460		if err != nil {
2461			return err
2462		}
2463		page.asc = next
2464		if !next.hasNextLink() || !next.IsEmpty() {
2465			break
2466		}
2467	}
2468	return nil
2469}
2470
2471// Next advances to the next page of values.  If there was an error making
2472// the request the page does not advance and the error is returned.
2473// Deprecated: Use NextWithContext() instead.
2474func (page *AuthorizationServerCollectionPage) Next() error {
2475	return page.NextWithContext(context.Background())
2476}
2477
2478// NotDone returns true if the page enumeration should be started or is not yet complete.
2479func (page AuthorizationServerCollectionPage) NotDone() bool {
2480	return !page.asc.IsEmpty()
2481}
2482
2483// Response returns the raw server response from the last page request.
2484func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection {
2485	return page.asc
2486}
2487
2488// Values returns the slice of values for the current page or nil if there are no values.
2489func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract {
2490	if page.asc.IsEmpty() {
2491		return nil
2492	}
2493	return *page.asc.Value
2494}
2495
2496// Creates a new instance of the AuthorizationServerCollectionPage type.
2497func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage {
2498	return AuthorizationServerCollectionPage{
2499		fn:  getNextPage,
2500		asc: cur,
2501	}
2502}
2503
2504// AuthorizationServerContract external OAuth authorization server settings.
2505type AuthorizationServerContract struct {
2506	autorest.Response `json:"-"`
2507	// AuthorizationServerContractProperties - Properties of the External OAuth authorization server Contract.
2508	*AuthorizationServerContractProperties `json:"properties,omitempty"`
2509	// ID - READ-ONLY; Resource ID.
2510	ID *string `json:"id,omitempty"`
2511	// Name - READ-ONLY; Resource name.
2512	Name *string `json:"name,omitempty"`
2513	// Type - READ-ONLY; Resource type for API Management resource.
2514	Type *string `json:"type,omitempty"`
2515}
2516
2517// MarshalJSON is the custom marshaler for AuthorizationServerContract.
2518func (asc AuthorizationServerContract) MarshalJSON() ([]byte, error) {
2519	objectMap := make(map[string]interface{})
2520	if asc.AuthorizationServerContractProperties != nil {
2521		objectMap["properties"] = asc.AuthorizationServerContractProperties
2522	}
2523	return json.Marshal(objectMap)
2524}
2525
2526// UnmarshalJSON is the custom unmarshaler for AuthorizationServerContract struct.
2527func (asc *AuthorizationServerContract) UnmarshalJSON(body []byte) error {
2528	var m map[string]*json.RawMessage
2529	err := json.Unmarshal(body, &m)
2530	if err != nil {
2531		return err
2532	}
2533	for k, v := range m {
2534		switch k {
2535		case "properties":
2536			if v != nil {
2537				var authorizationServerContractProperties AuthorizationServerContractProperties
2538				err = json.Unmarshal(*v, &authorizationServerContractProperties)
2539				if err != nil {
2540					return err
2541				}
2542				asc.AuthorizationServerContractProperties = &authorizationServerContractProperties
2543			}
2544		case "id":
2545			if v != nil {
2546				var ID string
2547				err = json.Unmarshal(*v, &ID)
2548				if err != nil {
2549					return err
2550				}
2551				asc.ID = &ID
2552			}
2553		case "name":
2554			if v != nil {
2555				var name string
2556				err = json.Unmarshal(*v, &name)
2557				if err != nil {
2558					return err
2559				}
2560				asc.Name = &name
2561			}
2562		case "type":
2563			if v != nil {
2564				var typeVar string
2565				err = json.Unmarshal(*v, &typeVar)
2566				if err != nil {
2567					return err
2568				}
2569				asc.Type = &typeVar
2570			}
2571		}
2572	}
2573
2574	return nil
2575}
2576
2577// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract.
2578type AuthorizationServerContractBaseProperties struct {
2579	// Description - Description of the authorization server. Can contain HTML formatting tags.
2580	Description *string `json:"description,omitempty"`
2581	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
2582	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
2583	// 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.
2584	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
2585	// 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"}.
2586	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
2587	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
2588	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
2589	// 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.
2590	SupportState *bool `json:"supportState,omitempty"`
2591	// 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.
2592	DefaultScope *string `json:"defaultScope,omitempty"`
2593	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
2594	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
2595	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
2596	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
2597	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
2598	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
2599}
2600
2601// AuthorizationServerContractProperties external OAuth authorization server settings Properties.
2602type AuthorizationServerContractProperties struct {
2603	// DisplayName - User-friendly authorization server name.
2604	DisplayName *string `json:"displayName,omitempty"`
2605	// ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.
2606	ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"`
2607	// AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
2608	AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"`
2609	// GrantTypes - Form of an authorization grant, which the client uses to request the access token.
2610	GrantTypes *[]GrantType `json:"grantTypes,omitempty"`
2611	// ClientID - Client or app id registered with this authorization server.
2612	ClientID *string `json:"clientId,omitempty"`
2613	// 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.
2614	ClientSecret *string `json:"clientSecret,omitempty"`
2615	// Description - Description of the authorization server. Can contain HTML formatting tags.
2616	Description *string `json:"description,omitempty"`
2617	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
2618	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
2619	// 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.
2620	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
2621	// 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"}.
2622	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
2623	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
2624	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
2625	// 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.
2626	SupportState *bool `json:"supportState,omitempty"`
2627	// 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.
2628	DefaultScope *string `json:"defaultScope,omitempty"`
2629	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
2630	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
2631	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
2632	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
2633	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
2634	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
2635}
2636
2637// AuthorizationServerSecretsContract oAuth Server Secrets Contract.
2638type AuthorizationServerSecretsContract struct {
2639	autorest.Response `json:"-"`
2640	// ClientSecret - oAuth Authorization Server Secrets.
2641	ClientSecret *string `json:"clientSecret,omitempty"`
2642	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
2643	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
2644	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
2645	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
2646}
2647
2648// AuthorizationServerUpdateContract external OAuth authorization server settings.
2649type AuthorizationServerUpdateContract struct {
2650	// AuthorizationServerUpdateContractProperties - Properties of the External OAuth authorization server update Contract.
2651	*AuthorizationServerUpdateContractProperties `json:"properties,omitempty"`
2652	// ID - READ-ONLY; Resource ID.
2653	ID *string `json:"id,omitempty"`
2654	// Name - READ-ONLY; Resource name.
2655	Name *string `json:"name,omitempty"`
2656	// Type - READ-ONLY; Resource type for API Management resource.
2657	Type *string `json:"type,omitempty"`
2658}
2659
2660// MarshalJSON is the custom marshaler for AuthorizationServerUpdateContract.
2661func (asuc AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) {
2662	objectMap := make(map[string]interface{})
2663	if asuc.AuthorizationServerUpdateContractProperties != nil {
2664		objectMap["properties"] = asuc.AuthorizationServerUpdateContractProperties
2665	}
2666	return json.Marshal(objectMap)
2667}
2668
2669// UnmarshalJSON is the custom unmarshaler for AuthorizationServerUpdateContract struct.
2670func (asuc *AuthorizationServerUpdateContract) UnmarshalJSON(body []byte) error {
2671	var m map[string]*json.RawMessage
2672	err := json.Unmarshal(body, &m)
2673	if err != nil {
2674		return err
2675	}
2676	for k, v := range m {
2677		switch k {
2678		case "properties":
2679			if v != nil {
2680				var authorizationServerUpdateContractProperties AuthorizationServerUpdateContractProperties
2681				err = json.Unmarshal(*v, &authorizationServerUpdateContractProperties)
2682				if err != nil {
2683					return err
2684				}
2685				asuc.AuthorizationServerUpdateContractProperties = &authorizationServerUpdateContractProperties
2686			}
2687		case "id":
2688			if v != nil {
2689				var ID string
2690				err = json.Unmarshal(*v, &ID)
2691				if err != nil {
2692					return err
2693				}
2694				asuc.ID = &ID
2695			}
2696		case "name":
2697			if v != nil {
2698				var name string
2699				err = json.Unmarshal(*v, &name)
2700				if err != nil {
2701					return err
2702				}
2703				asuc.Name = &name
2704			}
2705		case "type":
2706			if v != nil {
2707				var typeVar string
2708				err = json.Unmarshal(*v, &typeVar)
2709				if err != nil {
2710					return err
2711				}
2712				asuc.Type = &typeVar
2713			}
2714		}
2715	}
2716
2717	return nil
2718}
2719
2720// AuthorizationServerUpdateContractProperties external OAuth authorization server Update settings
2721// contract.
2722type AuthorizationServerUpdateContractProperties struct {
2723	// DisplayName - User-friendly authorization server name.
2724	DisplayName *string `json:"displayName,omitempty"`
2725	// ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced.
2726	ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"`
2727	// AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2.
2728	AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"`
2729	// GrantTypes - Form of an authorization grant, which the client uses to request the access token.
2730	GrantTypes *[]GrantType `json:"grantTypes,omitempty"`
2731	// ClientID - Client or app id registered with this authorization server.
2732	ClientID *string `json:"clientId,omitempty"`
2733	// 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.
2734	ClientSecret *string `json:"clientSecret,omitempty"`
2735	// Description - Description of the authorization server. Can contain HTML formatting tags.
2736	Description *string `json:"description,omitempty"`
2737	// AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional.
2738	AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"`
2739	// 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.
2740	ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"`
2741	// 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"}.
2742	TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"`
2743	// TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced.
2744	TokenEndpoint *string `json:"tokenEndpoint,omitempty"`
2745	// 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.
2746	SupportState *bool `json:"supportState,omitempty"`
2747	// 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.
2748	DefaultScope *string `json:"defaultScope,omitempty"`
2749	// BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API.
2750	BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"`
2751	// ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username.
2752	ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"`
2753	// ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password.
2754	ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"`
2755}
2756
2757// BackendAuthorizationHeaderCredentials authorization header information.
2758type BackendAuthorizationHeaderCredentials struct {
2759	// Scheme - Authentication Scheme name.
2760	Scheme *string `json:"scheme,omitempty"`
2761	// Parameter - Authentication Parameter value.
2762	Parameter *string `json:"parameter,omitempty"`
2763}
2764
2765// BackendBaseParameters backend entity base Parameter set.
2766type BackendBaseParameters struct {
2767	// Title - Backend Title.
2768	Title *string `json:"title,omitempty"`
2769	// Description - Backend Description.
2770	Description *string `json:"description,omitempty"`
2771	// 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.
2772	ResourceID *string `json:"resourceId,omitempty"`
2773	// Properties - Backend Properties contract
2774	Properties *BackendProperties `json:"properties,omitempty"`
2775	// Credentials - Backend Credentials Contract Properties
2776	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
2777	// Proxy - Backend Proxy Contract Properties
2778	Proxy *BackendProxyContract `json:"proxy,omitempty"`
2779	// TLS - Backend TLS Properties
2780	TLS *BackendTLSProperties `json:"tls,omitempty"`
2781}
2782
2783// BackendCollection paged Backend list representation.
2784type BackendCollection struct {
2785	autorest.Response `json:"-"`
2786	// Value - Backend values.
2787	Value *[]BackendContract `json:"value,omitempty"`
2788	// Count - Total record count number across all pages.
2789	Count *int64 `json:"count,omitempty"`
2790	// NextLink - Next page link if any.
2791	NextLink *string `json:"nextLink,omitempty"`
2792}
2793
2794// BackendCollectionIterator provides access to a complete listing of BackendContract values.
2795type BackendCollectionIterator struct {
2796	i    int
2797	page BackendCollectionPage
2798}
2799
2800// NextWithContext advances to the next value.  If there was an error making
2801// the request the iterator does not advance and the error is returned.
2802func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) {
2803	if tracing.IsEnabled() {
2804		ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext")
2805		defer func() {
2806			sc := -1
2807			if iter.Response().Response.Response != nil {
2808				sc = iter.Response().Response.Response.StatusCode
2809			}
2810			tracing.EndSpan(ctx, sc, err)
2811		}()
2812	}
2813	iter.i++
2814	if iter.i < len(iter.page.Values()) {
2815		return nil
2816	}
2817	err = iter.page.NextWithContext(ctx)
2818	if err != nil {
2819		iter.i--
2820		return err
2821	}
2822	iter.i = 0
2823	return nil
2824}
2825
2826// Next advances to the next value.  If there was an error making
2827// the request the iterator does not advance and the error is returned.
2828// Deprecated: Use NextWithContext() instead.
2829func (iter *BackendCollectionIterator) Next() error {
2830	return iter.NextWithContext(context.Background())
2831}
2832
2833// NotDone returns true if the enumeration should be started or is not yet complete.
2834func (iter BackendCollectionIterator) NotDone() bool {
2835	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2836}
2837
2838// Response returns the raw server response from the last page request.
2839func (iter BackendCollectionIterator) Response() BackendCollection {
2840	return iter.page.Response()
2841}
2842
2843// Value returns the current value or a zero-initialized value if the
2844// iterator has advanced beyond the end of the collection.
2845func (iter BackendCollectionIterator) Value() BackendContract {
2846	if !iter.page.NotDone() {
2847		return BackendContract{}
2848	}
2849	return iter.page.Values()[iter.i]
2850}
2851
2852// Creates a new instance of the BackendCollectionIterator type.
2853func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator {
2854	return BackendCollectionIterator{page: page}
2855}
2856
2857// IsEmpty returns true if the ListResult contains no values.
2858func (bc BackendCollection) IsEmpty() bool {
2859	return bc.Value == nil || len(*bc.Value) == 0
2860}
2861
2862// hasNextLink returns true if the NextLink is not empty.
2863func (bc BackendCollection) hasNextLink() bool {
2864	return bc.NextLink != nil && len(*bc.NextLink) != 0
2865}
2866
2867// backendCollectionPreparer prepares a request to retrieve the next set of results.
2868// It returns nil if no more results exist.
2869func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) {
2870	if !bc.hasNextLink() {
2871		return nil, nil
2872	}
2873	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2874		autorest.AsJSON(),
2875		autorest.AsGet(),
2876		autorest.WithBaseURL(to.String(bc.NextLink)))
2877}
2878
2879// BackendCollectionPage contains a page of BackendContract values.
2880type BackendCollectionPage struct {
2881	fn func(context.Context, BackendCollection) (BackendCollection, error)
2882	bc BackendCollection
2883}
2884
2885// NextWithContext advances to the next page of values.  If there was an error making
2886// the request the page does not advance and the error is returned.
2887func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) {
2888	if tracing.IsEnabled() {
2889		ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext")
2890		defer func() {
2891			sc := -1
2892			if page.Response().Response.Response != nil {
2893				sc = page.Response().Response.Response.StatusCode
2894			}
2895			tracing.EndSpan(ctx, sc, err)
2896		}()
2897	}
2898	for {
2899		next, err := page.fn(ctx, page.bc)
2900		if err != nil {
2901			return err
2902		}
2903		page.bc = next
2904		if !next.hasNextLink() || !next.IsEmpty() {
2905			break
2906		}
2907	}
2908	return nil
2909}
2910
2911// Next advances to the next page of values.  If there was an error making
2912// the request the page does not advance and the error is returned.
2913// Deprecated: Use NextWithContext() instead.
2914func (page *BackendCollectionPage) Next() error {
2915	return page.NextWithContext(context.Background())
2916}
2917
2918// NotDone returns true if the page enumeration should be started or is not yet complete.
2919func (page BackendCollectionPage) NotDone() bool {
2920	return !page.bc.IsEmpty()
2921}
2922
2923// Response returns the raw server response from the last page request.
2924func (page BackendCollectionPage) Response() BackendCollection {
2925	return page.bc
2926}
2927
2928// Values returns the slice of values for the current page or nil if there are no values.
2929func (page BackendCollectionPage) Values() []BackendContract {
2930	if page.bc.IsEmpty() {
2931		return nil
2932	}
2933	return *page.bc.Value
2934}
2935
2936// Creates a new instance of the BackendCollectionPage type.
2937func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage {
2938	return BackendCollectionPage{
2939		fn: getNextPage,
2940		bc: cur,
2941	}
2942}
2943
2944// BackendContract backend details.
2945type BackendContract struct {
2946	autorest.Response `json:"-"`
2947	// BackendContractProperties - Backend entity contract properties.
2948	*BackendContractProperties `json:"properties,omitempty"`
2949	// ID - READ-ONLY; Resource ID.
2950	ID *string `json:"id,omitempty"`
2951	// Name - READ-ONLY; Resource name.
2952	Name *string `json:"name,omitempty"`
2953	// Type - READ-ONLY; Resource type for API Management resource.
2954	Type *string `json:"type,omitempty"`
2955}
2956
2957// MarshalJSON is the custom marshaler for BackendContract.
2958func (bc BackendContract) MarshalJSON() ([]byte, error) {
2959	objectMap := make(map[string]interface{})
2960	if bc.BackendContractProperties != nil {
2961		objectMap["properties"] = bc.BackendContractProperties
2962	}
2963	return json.Marshal(objectMap)
2964}
2965
2966// UnmarshalJSON is the custom unmarshaler for BackendContract struct.
2967func (bc *BackendContract) UnmarshalJSON(body []byte) error {
2968	var m map[string]*json.RawMessage
2969	err := json.Unmarshal(body, &m)
2970	if err != nil {
2971		return err
2972	}
2973	for k, v := range m {
2974		switch k {
2975		case "properties":
2976			if v != nil {
2977				var backendContractProperties BackendContractProperties
2978				err = json.Unmarshal(*v, &backendContractProperties)
2979				if err != nil {
2980					return err
2981				}
2982				bc.BackendContractProperties = &backendContractProperties
2983			}
2984		case "id":
2985			if v != nil {
2986				var ID string
2987				err = json.Unmarshal(*v, &ID)
2988				if err != nil {
2989					return err
2990				}
2991				bc.ID = &ID
2992			}
2993		case "name":
2994			if v != nil {
2995				var name string
2996				err = json.Unmarshal(*v, &name)
2997				if err != nil {
2998					return err
2999				}
3000				bc.Name = &name
3001			}
3002		case "type":
3003			if v != nil {
3004				var typeVar string
3005				err = json.Unmarshal(*v, &typeVar)
3006				if err != nil {
3007					return err
3008				}
3009				bc.Type = &typeVar
3010			}
3011		}
3012	}
3013
3014	return nil
3015}
3016
3017// BackendContractProperties parameters supplied to the Create Backend operation.
3018type BackendContractProperties struct {
3019	// URL - Runtime Url of the Backend.
3020	URL *string `json:"url,omitempty"`
3021	// Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap'
3022	Protocol BackendProtocol `json:"protocol,omitempty"`
3023	// Title - Backend Title.
3024	Title *string `json:"title,omitempty"`
3025	// Description - Backend Description.
3026	Description *string `json:"description,omitempty"`
3027	// 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.
3028	ResourceID *string `json:"resourceId,omitempty"`
3029	// Properties - Backend Properties contract
3030	Properties *BackendProperties `json:"properties,omitempty"`
3031	// Credentials - Backend Credentials Contract Properties
3032	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
3033	// Proxy - Backend Proxy Contract Properties
3034	Proxy *BackendProxyContract `json:"proxy,omitempty"`
3035	// TLS - Backend TLS Properties
3036	TLS *BackendTLSProperties `json:"tls,omitempty"`
3037}
3038
3039// BackendCredentialsContract details of the Credentials used to connect to Backend.
3040type BackendCredentialsContract struct {
3041	// CertificateIds - List of Client Certificate Ids.
3042	CertificateIds *[]string `json:"certificateIds,omitempty"`
3043	// Certificate - List of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided.
3044	Certificate *[]string `json:"certificate,omitempty"`
3045	// Query - Query Parameter description.
3046	Query map[string][]string `json:"query"`
3047	// Header - Header Parameter description.
3048	Header map[string][]string `json:"header"`
3049	// Authorization - Authorization header authentication
3050	Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"`
3051}
3052
3053// MarshalJSON is the custom marshaler for BackendCredentialsContract.
3054func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) {
3055	objectMap := make(map[string]interface{})
3056	if bcc.CertificateIds != nil {
3057		objectMap["certificateIds"] = bcc.CertificateIds
3058	}
3059	if bcc.Certificate != nil {
3060		objectMap["certificate"] = bcc.Certificate
3061	}
3062	if bcc.Query != nil {
3063		objectMap["query"] = bcc.Query
3064	}
3065	if bcc.Header != nil {
3066		objectMap["header"] = bcc.Header
3067	}
3068	if bcc.Authorization != nil {
3069		objectMap["authorization"] = bcc.Authorization
3070	}
3071	return json.Marshal(objectMap)
3072}
3073
3074// BackendProperties properties specific to the Backend Type.
3075type BackendProperties struct {
3076	// ServiceFabricCluster - Backend Service Fabric Cluster Properties
3077	ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"`
3078}
3079
3080// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend.
3081type BackendProxyContract struct {
3082	// URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.
3083	URL *string `json:"url,omitempty"`
3084	// Username - Username to connect to the WebProxy server
3085	Username *string `json:"username,omitempty"`
3086	// Password - Password to connect to the WebProxy Server
3087	Password *string `json:"password,omitempty"`
3088}
3089
3090// BackendReconnectContract reconnect request parameters.
3091type BackendReconnectContract struct {
3092	// BackendReconnectProperties - Reconnect request properties.
3093	*BackendReconnectProperties `json:"properties,omitempty"`
3094	// ID - READ-ONLY; Resource ID.
3095	ID *string `json:"id,omitempty"`
3096	// Name - READ-ONLY; Resource name.
3097	Name *string `json:"name,omitempty"`
3098	// Type - READ-ONLY; Resource type for API Management resource.
3099	Type *string `json:"type,omitempty"`
3100}
3101
3102// MarshalJSON is the custom marshaler for BackendReconnectContract.
3103func (brc BackendReconnectContract) MarshalJSON() ([]byte, error) {
3104	objectMap := make(map[string]interface{})
3105	if brc.BackendReconnectProperties != nil {
3106		objectMap["properties"] = brc.BackendReconnectProperties
3107	}
3108	return json.Marshal(objectMap)
3109}
3110
3111// UnmarshalJSON is the custom unmarshaler for BackendReconnectContract struct.
3112func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error {
3113	var m map[string]*json.RawMessage
3114	err := json.Unmarshal(body, &m)
3115	if err != nil {
3116		return err
3117	}
3118	for k, v := range m {
3119		switch k {
3120		case "properties":
3121			if v != nil {
3122				var backendReconnectProperties BackendReconnectProperties
3123				err = json.Unmarshal(*v, &backendReconnectProperties)
3124				if err != nil {
3125					return err
3126				}
3127				brc.BackendReconnectProperties = &backendReconnectProperties
3128			}
3129		case "id":
3130			if v != nil {
3131				var ID string
3132				err = json.Unmarshal(*v, &ID)
3133				if err != nil {
3134					return err
3135				}
3136				brc.ID = &ID
3137			}
3138		case "name":
3139			if v != nil {
3140				var name string
3141				err = json.Unmarshal(*v, &name)
3142				if err != nil {
3143					return err
3144				}
3145				brc.Name = &name
3146			}
3147		case "type":
3148			if v != nil {
3149				var typeVar string
3150				err = json.Unmarshal(*v, &typeVar)
3151				if err != nil {
3152					return err
3153				}
3154				brc.Type = &typeVar
3155			}
3156		}
3157	}
3158
3159	return nil
3160}
3161
3162// BackendReconnectProperties properties to control reconnect requests.
3163type BackendReconnectProperties struct {
3164	// After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M.
3165	After *string `json:"after,omitempty"`
3166}
3167
3168// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend.
3169type BackendServiceFabricClusterProperties struct {
3170	// ClientCertificateID - The client certificate id for the management endpoint.
3171	ClientCertificateID *string `json:"clientCertificateId,omitempty"`
3172	// ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided
3173	ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"`
3174	// MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition.
3175	MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"`
3176	// ManagementEndpoints - The cluster management endpoint.
3177	ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"`
3178	// ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication
3179	ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"`
3180	// ServerX509Names - Server X509 Certificate Names Collection
3181	ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"`
3182}
3183
3184// BackendTLSProperties properties controlling TLS Certificate Validation.
3185type BackendTLSProperties struct {
3186	// ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.
3187	ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"`
3188	// ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.
3189	ValidateCertificateName *bool `json:"validateCertificateName,omitempty"`
3190}
3191
3192// BackendUpdateParameterProperties parameters supplied to the Update Backend operation.
3193type BackendUpdateParameterProperties struct {
3194	// URL - Runtime Url of the Backend.
3195	URL *string `json:"url,omitempty"`
3196	// Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap'
3197	Protocol BackendProtocol `json:"protocol,omitempty"`
3198	// Title - Backend Title.
3199	Title *string `json:"title,omitempty"`
3200	// Description - Backend Description.
3201	Description *string `json:"description,omitempty"`
3202	// 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.
3203	ResourceID *string `json:"resourceId,omitempty"`
3204	// Properties - Backend Properties contract
3205	Properties *BackendProperties `json:"properties,omitempty"`
3206	// Credentials - Backend Credentials Contract Properties
3207	Credentials *BackendCredentialsContract `json:"credentials,omitempty"`
3208	// Proxy - Backend Proxy Contract Properties
3209	Proxy *BackendProxyContract `json:"proxy,omitempty"`
3210	// TLS - Backend TLS Properties
3211	TLS *BackendTLSProperties `json:"tls,omitempty"`
3212}
3213
3214// BackendUpdateParameters backend update parameters.
3215type BackendUpdateParameters struct {
3216	// BackendUpdateParameterProperties - Backend entity update contract properties.
3217	*BackendUpdateParameterProperties `json:"properties,omitempty"`
3218}
3219
3220// MarshalJSON is the custom marshaler for BackendUpdateParameters.
3221func (bup BackendUpdateParameters) MarshalJSON() ([]byte, error) {
3222	objectMap := make(map[string]interface{})
3223	if bup.BackendUpdateParameterProperties != nil {
3224		objectMap["properties"] = bup.BackendUpdateParameterProperties
3225	}
3226	return json.Marshal(objectMap)
3227}
3228
3229// UnmarshalJSON is the custom unmarshaler for BackendUpdateParameters struct.
3230func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error {
3231	var m map[string]*json.RawMessage
3232	err := json.Unmarshal(body, &m)
3233	if err != nil {
3234		return err
3235	}
3236	for k, v := range m {
3237		switch k {
3238		case "properties":
3239			if v != nil {
3240				var backendUpdateParameterProperties BackendUpdateParameterProperties
3241				err = json.Unmarshal(*v, &backendUpdateParameterProperties)
3242				if err != nil {
3243					return err
3244				}
3245				bup.BackendUpdateParameterProperties = &backendUpdateParameterProperties
3246			}
3247		}
3248	}
3249
3250	return nil
3251}
3252
3253// BodyDiagnosticSettings body logging settings.
3254type BodyDiagnosticSettings struct {
3255	// Bytes - Number of request body bytes to log.
3256	Bytes *int32 `json:"bytes,omitempty"`
3257}
3258
3259// CacheCollection paged Caches list representation.
3260type CacheCollection struct {
3261	autorest.Response `json:"-"`
3262	// Value - Page values.
3263	Value *[]CacheContract `json:"value,omitempty"`
3264	// Count - Total record count number across all pages.
3265	Count *int64 `json:"count,omitempty"`
3266	// NextLink - Next page link if any.
3267	NextLink *string `json:"nextLink,omitempty"`
3268}
3269
3270// CacheCollectionIterator provides access to a complete listing of CacheContract values.
3271type CacheCollectionIterator struct {
3272	i    int
3273	page CacheCollectionPage
3274}
3275
3276// NextWithContext advances to the next value.  If there was an error making
3277// the request the iterator does not advance and the error is returned.
3278func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3279	if tracing.IsEnabled() {
3280		ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext")
3281		defer func() {
3282			sc := -1
3283			if iter.Response().Response.Response != nil {
3284				sc = iter.Response().Response.Response.StatusCode
3285			}
3286			tracing.EndSpan(ctx, sc, err)
3287		}()
3288	}
3289	iter.i++
3290	if iter.i < len(iter.page.Values()) {
3291		return nil
3292	}
3293	err = iter.page.NextWithContext(ctx)
3294	if err != nil {
3295		iter.i--
3296		return err
3297	}
3298	iter.i = 0
3299	return nil
3300}
3301
3302// Next advances to the next value.  If there was an error making
3303// the request the iterator does not advance and the error is returned.
3304// Deprecated: Use NextWithContext() instead.
3305func (iter *CacheCollectionIterator) Next() error {
3306	return iter.NextWithContext(context.Background())
3307}
3308
3309// NotDone returns true if the enumeration should be started or is not yet complete.
3310func (iter CacheCollectionIterator) NotDone() bool {
3311	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3312}
3313
3314// Response returns the raw server response from the last page request.
3315func (iter CacheCollectionIterator) Response() CacheCollection {
3316	return iter.page.Response()
3317}
3318
3319// Value returns the current value or a zero-initialized value if the
3320// iterator has advanced beyond the end of the collection.
3321func (iter CacheCollectionIterator) Value() CacheContract {
3322	if !iter.page.NotDone() {
3323		return CacheContract{}
3324	}
3325	return iter.page.Values()[iter.i]
3326}
3327
3328// Creates a new instance of the CacheCollectionIterator type.
3329func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator {
3330	return CacheCollectionIterator{page: page}
3331}
3332
3333// IsEmpty returns true if the ListResult contains no values.
3334func (cc CacheCollection) IsEmpty() bool {
3335	return cc.Value == nil || len(*cc.Value) == 0
3336}
3337
3338// hasNextLink returns true if the NextLink is not empty.
3339func (cc CacheCollection) hasNextLink() bool {
3340	return cc.NextLink != nil && len(*cc.NextLink) != 0
3341}
3342
3343// cacheCollectionPreparer prepares a request to retrieve the next set of results.
3344// It returns nil if no more results exist.
3345func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) {
3346	if !cc.hasNextLink() {
3347		return nil, nil
3348	}
3349	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3350		autorest.AsJSON(),
3351		autorest.AsGet(),
3352		autorest.WithBaseURL(to.String(cc.NextLink)))
3353}
3354
3355// CacheCollectionPage contains a page of CacheContract values.
3356type CacheCollectionPage struct {
3357	fn func(context.Context, CacheCollection) (CacheCollection, error)
3358	cc CacheCollection
3359}
3360
3361// NextWithContext advances to the next page of values.  If there was an error making
3362// the request the page does not advance and the error is returned.
3363func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) {
3364	if tracing.IsEnabled() {
3365		ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext")
3366		defer func() {
3367			sc := -1
3368			if page.Response().Response.Response != nil {
3369				sc = page.Response().Response.Response.StatusCode
3370			}
3371			tracing.EndSpan(ctx, sc, err)
3372		}()
3373	}
3374	for {
3375		next, err := page.fn(ctx, page.cc)
3376		if err != nil {
3377			return err
3378		}
3379		page.cc = next
3380		if !next.hasNextLink() || !next.IsEmpty() {
3381			break
3382		}
3383	}
3384	return nil
3385}
3386
3387// Next advances to the next page of values.  If there was an error making
3388// the request the page does not advance and the error is returned.
3389// Deprecated: Use NextWithContext() instead.
3390func (page *CacheCollectionPage) Next() error {
3391	return page.NextWithContext(context.Background())
3392}
3393
3394// NotDone returns true if the page enumeration should be started or is not yet complete.
3395func (page CacheCollectionPage) NotDone() bool {
3396	return !page.cc.IsEmpty()
3397}
3398
3399// Response returns the raw server response from the last page request.
3400func (page CacheCollectionPage) Response() CacheCollection {
3401	return page.cc
3402}
3403
3404// Values returns the slice of values for the current page or nil if there are no values.
3405func (page CacheCollectionPage) Values() []CacheContract {
3406	if page.cc.IsEmpty() {
3407		return nil
3408	}
3409	return *page.cc.Value
3410}
3411
3412// Creates a new instance of the CacheCollectionPage type.
3413func NewCacheCollectionPage(cur CacheCollection, getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage {
3414	return CacheCollectionPage{
3415		fn: getNextPage,
3416		cc: cur,
3417	}
3418}
3419
3420// CacheContract cache details.
3421type CacheContract struct {
3422	autorest.Response `json:"-"`
3423	// CacheContractProperties - Cache properties details.
3424	*CacheContractProperties `json:"properties,omitempty"`
3425	// ID - READ-ONLY; Resource ID.
3426	ID *string `json:"id,omitempty"`
3427	// Name - READ-ONLY; Resource name.
3428	Name *string `json:"name,omitempty"`
3429	// Type - READ-ONLY; Resource type for API Management resource.
3430	Type *string `json:"type,omitempty"`
3431}
3432
3433// MarshalJSON is the custom marshaler for CacheContract.
3434func (cc CacheContract) MarshalJSON() ([]byte, error) {
3435	objectMap := make(map[string]interface{})
3436	if cc.CacheContractProperties != nil {
3437		objectMap["properties"] = cc.CacheContractProperties
3438	}
3439	return json.Marshal(objectMap)
3440}
3441
3442// UnmarshalJSON is the custom unmarshaler for CacheContract struct.
3443func (cc *CacheContract) UnmarshalJSON(body []byte) error {
3444	var m map[string]*json.RawMessage
3445	err := json.Unmarshal(body, &m)
3446	if err != nil {
3447		return err
3448	}
3449	for k, v := range m {
3450		switch k {
3451		case "properties":
3452			if v != nil {
3453				var cacheContractProperties CacheContractProperties
3454				err = json.Unmarshal(*v, &cacheContractProperties)
3455				if err != nil {
3456					return err
3457				}
3458				cc.CacheContractProperties = &cacheContractProperties
3459			}
3460		case "id":
3461			if v != nil {
3462				var ID string
3463				err = json.Unmarshal(*v, &ID)
3464				if err != nil {
3465					return err
3466				}
3467				cc.ID = &ID
3468			}
3469		case "name":
3470			if v != nil {
3471				var name string
3472				err = json.Unmarshal(*v, &name)
3473				if err != nil {
3474					return err
3475				}
3476				cc.Name = &name
3477			}
3478		case "type":
3479			if v != nil {
3480				var typeVar string
3481				err = json.Unmarshal(*v, &typeVar)
3482				if err != nil {
3483					return err
3484				}
3485				cc.Type = &typeVar
3486			}
3487		}
3488	}
3489
3490	return nil
3491}
3492
3493// CacheContractProperties properties of the Cache contract.
3494type CacheContractProperties struct {
3495	// Description - Cache description
3496	Description *string `json:"description,omitempty"`
3497	// ConnectionString - Runtime connection string to cache
3498	ConnectionString *string `json:"connectionString,omitempty"`
3499	// UseFromLocation - Location identifier to use cache from (should be either 'default' or valid Azure region identifier)
3500	UseFromLocation *string `json:"useFromLocation,omitempty"`
3501	// ResourceID - Original uri of entity in external system cache points to
3502	ResourceID *string `json:"resourceId,omitempty"`
3503}
3504
3505// CacheUpdateParameters cache update details.
3506type CacheUpdateParameters struct {
3507	// CacheUpdateProperties - Cache update properties details.
3508	*CacheUpdateProperties `json:"properties,omitempty"`
3509}
3510
3511// MarshalJSON is the custom marshaler for CacheUpdateParameters.
3512func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) {
3513	objectMap := make(map[string]interface{})
3514	if cup.CacheUpdateProperties != nil {
3515		objectMap["properties"] = cup.CacheUpdateProperties
3516	}
3517	return json.Marshal(objectMap)
3518}
3519
3520// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct.
3521func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error {
3522	var m map[string]*json.RawMessage
3523	err := json.Unmarshal(body, &m)
3524	if err != nil {
3525		return err
3526	}
3527	for k, v := range m {
3528		switch k {
3529		case "properties":
3530			if v != nil {
3531				var cacheUpdateProperties CacheUpdateProperties
3532				err = json.Unmarshal(*v, &cacheUpdateProperties)
3533				if err != nil {
3534					return err
3535				}
3536				cup.CacheUpdateProperties = &cacheUpdateProperties
3537			}
3538		}
3539	}
3540
3541	return nil
3542}
3543
3544// CacheUpdateProperties parameters supplied to the Update Cache operation.
3545type CacheUpdateProperties struct {
3546	// Description - Cache description
3547	Description *string `json:"description,omitempty"`
3548	// ConnectionString - Runtime connection string to cache
3549	ConnectionString *string `json:"connectionString,omitempty"`
3550	// UseFromLocation - Location identifier to use cache from (should be either 'default' or valid Azure region identifier)
3551	UseFromLocation *string `json:"useFromLocation,omitempty"`
3552	// ResourceID - Original uri of entity in external system cache points to
3553	ResourceID *string `json:"resourceId,omitempty"`
3554}
3555
3556// CertificateCollection paged Certificates list representation.
3557type CertificateCollection struct {
3558	autorest.Response `json:"-"`
3559	// Value - Page values.
3560	Value *[]CertificateContract `json:"value,omitempty"`
3561	// Count - Total record count number across all pages.
3562	Count *int64 `json:"count,omitempty"`
3563	// NextLink - Next page link if any.
3564	NextLink *string `json:"nextLink,omitempty"`
3565}
3566
3567// CertificateCollectionIterator provides access to a complete listing of CertificateContract values.
3568type CertificateCollectionIterator struct {
3569	i    int
3570	page CertificateCollectionPage
3571}
3572
3573// NextWithContext advances to the next value.  If there was an error making
3574// the request the iterator does not advance and the error is returned.
3575func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3576	if tracing.IsEnabled() {
3577		ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext")
3578		defer func() {
3579			sc := -1
3580			if iter.Response().Response.Response != nil {
3581				sc = iter.Response().Response.Response.StatusCode
3582			}
3583			tracing.EndSpan(ctx, sc, err)
3584		}()
3585	}
3586	iter.i++
3587	if iter.i < len(iter.page.Values()) {
3588		return nil
3589	}
3590	err = iter.page.NextWithContext(ctx)
3591	if err != nil {
3592		iter.i--
3593		return err
3594	}
3595	iter.i = 0
3596	return nil
3597}
3598
3599// Next advances to the next value.  If there was an error making
3600// the request the iterator does not advance and the error is returned.
3601// Deprecated: Use NextWithContext() instead.
3602func (iter *CertificateCollectionIterator) Next() error {
3603	return iter.NextWithContext(context.Background())
3604}
3605
3606// NotDone returns true if the enumeration should be started or is not yet complete.
3607func (iter CertificateCollectionIterator) NotDone() bool {
3608	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3609}
3610
3611// Response returns the raw server response from the last page request.
3612func (iter CertificateCollectionIterator) Response() CertificateCollection {
3613	return iter.page.Response()
3614}
3615
3616// Value returns the current value or a zero-initialized value if the
3617// iterator has advanced beyond the end of the collection.
3618func (iter CertificateCollectionIterator) Value() CertificateContract {
3619	if !iter.page.NotDone() {
3620		return CertificateContract{}
3621	}
3622	return iter.page.Values()[iter.i]
3623}
3624
3625// Creates a new instance of the CertificateCollectionIterator type.
3626func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator {
3627	return CertificateCollectionIterator{page: page}
3628}
3629
3630// IsEmpty returns true if the ListResult contains no values.
3631func (cc CertificateCollection) IsEmpty() bool {
3632	return cc.Value == nil || len(*cc.Value) == 0
3633}
3634
3635// hasNextLink returns true if the NextLink is not empty.
3636func (cc CertificateCollection) hasNextLink() bool {
3637	return cc.NextLink != nil && len(*cc.NextLink) != 0
3638}
3639
3640// certificateCollectionPreparer prepares a request to retrieve the next set of results.
3641// It returns nil if no more results exist.
3642func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) {
3643	if !cc.hasNextLink() {
3644		return nil, nil
3645	}
3646	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3647		autorest.AsJSON(),
3648		autorest.AsGet(),
3649		autorest.WithBaseURL(to.String(cc.NextLink)))
3650}
3651
3652// CertificateCollectionPage contains a page of CertificateContract values.
3653type CertificateCollectionPage struct {
3654	fn func(context.Context, CertificateCollection) (CertificateCollection, error)
3655	cc CertificateCollection
3656}
3657
3658// NextWithContext advances to the next page of values.  If there was an error making
3659// the request the page does not advance and the error is returned.
3660func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) {
3661	if tracing.IsEnabled() {
3662		ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext")
3663		defer func() {
3664			sc := -1
3665			if page.Response().Response.Response != nil {
3666				sc = page.Response().Response.Response.StatusCode
3667			}
3668			tracing.EndSpan(ctx, sc, err)
3669		}()
3670	}
3671	for {
3672		next, err := page.fn(ctx, page.cc)
3673		if err != nil {
3674			return err
3675		}
3676		page.cc = next
3677		if !next.hasNextLink() || !next.IsEmpty() {
3678			break
3679		}
3680	}
3681	return nil
3682}
3683
3684// Next advances to the next page of values.  If there was an error making
3685// the request the page does not advance and the error is returned.
3686// Deprecated: Use NextWithContext() instead.
3687func (page *CertificateCollectionPage) Next() error {
3688	return page.NextWithContext(context.Background())
3689}
3690
3691// NotDone returns true if the page enumeration should be started or is not yet complete.
3692func (page CertificateCollectionPage) NotDone() bool {
3693	return !page.cc.IsEmpty()
3694}
3695
3696// Response returns the raw server response from the last page request.
3697func (page CertificateCollectionPage) Response() CertificateCollection {
3698	return page.cc
3699}
3700
3701// Values returns the slice of values for the current page or nil if there are no values.
3702func (page CertificateCollectionPage) Values() []CertificateContract {
3703	if page.cc.IsEmpty() {
3704		return nil
3705	}
3706	return *page.cc.Value
3707}
3708
3709// Creates a new instance of the CertificateCollectionPage type.
3710func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage {
3711	return CertificateCollectionPage{
3712		fn: getNextPage,
3713		cc: cur,
3714	}
3715}
3716
3717// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root
3718// certificates.
3719type CertificateConfiguration struct {
3720	// EncodedCertificate - Base64 Encoded certificate.
3721	EncodedCertificate *string `json:"encodedCertificate,omitempty"`
3722	// CertificatePassword - Certificate Password.
3723	CertificatePassword *string `json:"certificatePassword,omitempty"`
3724	// StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'StoreNameCertificateAuthority', 'StoreNameRoot'
3725	StoreName StoreName `json:"storeName,omitempty"`
3726	// Certificate - Certificate information.
3727	Certificate *CertificateInformation `json:"certificate,omitempty"`
3728}
3729
3730// CertificateContract certificate details.
3731type CertificateContract struct {
3732	autorest.Response `json:"-"`
3733	// CertificateContractProperties - Certificate properties details.
3734	*CertificateContractProperties `json:"properties,omitempty"`
3735	// ID - READ-ONLY; Resource ID.
3736	ID *string `json:"id,omitempty"`
3737	// Name - READ-ONLY; Resource name.
3738	Name *string `json:"name,omitempty"`
3739	// Type - READ-ONLY; Resource type for API Management resource.
3740	Type *string `json:"type,omitempty"`
3741}
3742
3743// MarshalJSON is the custom marshaler for CertificateContract.
3744func (cc CertificateContract) MarshalJSON() ([]byte, error) {
3745	objectMap := make(map[string]interface{})
3746	if cc.CertificateContractProperties != nil {
3747		objectMap["properties"] = cc.CertificateContractProperties
3748	}
3749	return json.Marshal(objectMap)
3750}
3751
3752// UnmarshalJSON is the custom unmarshaler for CertificateContract struct.
3753func (cc *CertificateContract) UnmarshalJSON(body []byte) error {
3754	var m map[string]*json.RawMessage
3755	err := json.Unmarshal(body, &m)
3756	if err != nil {
3757		return err
3758	}
3759	for k, v := range m {
3760		switch k {
3761		case "properties":
3762			if v != nil {
3763				var certificateContractProperties CertificateContractProperties
3764				err = json.Unmarshal(*v, &certificateContractProperties)
3765				if err != nil {
3766					return err
3767				}
3768				cc.CertificateContractProperties = &certificateContractProperties
3769			}
3770		case "id":
3771			if v != nil {
3772				var ID string
3773				err = json.Unmarshal(*v, &ID)
3774				if err != nil {
3775					return err
3776				}
3777				cc.ID = &ID
3778			}
3779		case "name":
3780			if v != nil {
3781				var name string
3782				err = json.Unmarshal(*v, &name)
3783				if err != nil {
3784					return err
3785				}
3786				cc.Name = &name
3787			}
3788		case "type":
3789			if v != nil {
3790				var typeVar string
3791				err = json.Unmarshal(*v, &typeVar)
3792				if err != nil {
3793					return err
3794				}
3795				cc.Type = &typeVar
3796			}
3797		}
3798	}
3799
3800	return nil
3801}
3802
3803// CertificateContractProperties properties of the Certificate contract.
3804type CertificateContractProperties struct {
3805	// Subject - Subject attribute of the certificate.
3806	Subject *string `json:"subject,omitempty"`
3807	// Thumbprint - Thumbprint of the certificate.
3808	Thumbprint *string `json:"thumbprint,omitempty"`
3809	// 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.
3810	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
3811	// KeyVault - KeyVault location details of the certificate.
3812	KeyVault *KeyVaultContractProperties `json:"keyVault,omitempty"`
3813}
3814
3815// CertificateCreateOrUpdateParameters certificate create or update details.
3816type CertificateCreateOrUpdateParameters struct {
3817	// CertificateCreateOrUpdateProperties - Certificate create or update properties details.
3818	*CertificateCreateOrUpdateProperties `json:"properties,omitempty"`
3819}
3820
3821// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters.
3822func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) {
3823	objectMap := make(map[string]interface{})
3824	if ccoup.CertificateCreateOrUpdateProperties != nil {
3825		objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties
3826	}
3827	return json.Marshal(objectMap)
3828}
3829
3830// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct.
3831func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error {
3832	var m map[string]*json.RawMessage
3833	err := json.Unmarshal(body, &m)
3834	if err != nil {
3835		return err
3836	}
3837	for k, v := range m {
3838		switch k {
3839		case "properties":
3840			if v != nil {
3841				var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties
3842				err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties)
3843				if err != nil {
3844					return err
3845				}
3846				ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties
3847			}
3848		}
3849	}
3850
3851	return nil
3852}
3853
3854// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation.
3855type CertificateCreateOrUpdateProperties struct {
3856	// Data - Base 64 encoded certificate using the application/x-pkcs12 representation.
3857	Data *string `json:"data,omitempty"`
3858	// Password - Password for the Certificate
3859	Password *string `json:"password,omitempty"`
3860	// KeyVault - KeyVault location details of the certificate.
3861	KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"`
3862}
3863
3864// CertificateInformation SSL certificate information.
3865type CertificateInformation struct {
3866	// 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.
3867	Expiry *date.Time `json:"expiry,omitempty"`
3868	// Thumbprint - Thumbprint of the certificate.
3869	Thumbprint *string `json:"thumbprint,omitempty"`
3870	// Subject - Subject of the certificate.
3871	Subject *string `json:"subject,omitempty"`
3872}
3873
3874// ClientSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
3875type ClientSecretContract struct {
3876	autorest.Response `json:"-"`
3877	// ClientSecret - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
3878	ClientSecret *string `json:"clientSecret,omitempty"`
3879}
3880
3881// ConnectivityStatusContract details about connectivity to a resource.
3882type ConnectivityStatusContract struct {
3883	// 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.
3884	Name *string `json:"name,omitempty"`
3885	// Status - Resource Connectivity Status Type identifier. Possible values include: 'ConnectivityStatusTypeInitializing', 'ConnectivityStatusTypeSuccess', 'ConnectivityStatusTypeFailure'
3886	Status ConnectivityStatusType `json:"status,omitempty"`
3887	// Error - Error details of the connectivity to the resource.
3888	Error *string `json:"error,omitempty"`
3889	// 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.
3890	LastUpdated *date.Time `json:"lastUpdated,omitempty"`
3891	// 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.
3892	LastStatusChange *date.Time `json:"lastStatusChange,omitempty"`
3893	// ResourceType - Resource Type.
3894	ResourceType *string `json:"resourceType,omitempty"`
3895	// IsOptional - Whether this is optional.
3896	IsOptional *bool `json:"isOptional,omitempty"`
3897}
3898
3899// ContentItemCollection paged list of content items.
3900type ContentItemCollection struct {
3901	autorest.Response `json:"-"`
3902	// Value - READ-ONLY; Collection of content items.
3903	Value *[]ContentItemContract `json:"value,omitempty"`
3904	// NextLink - READ-ONLY; Next page link, if any.
3905	NextLink *string `json:"nextLink,omitempty"`
3906}
3907
3908// MarshalJSON is the custom marshaler for ContentItemCollection.
3909func (cic ContentItemCollection) MarshalJSON() ([]byte, error) {
3910	objectMap := make(map[string]interface{})
3911	return json.Marshal(objectMap)
3912}
3913
3914// ContentItemCollectionIterator provides access to a complete listing of ContentItemContract values.
3915type ContentItemCollectionIterator struct {
3916	i    int
3917	page ContentItemCollectionPage
3918}
3919
3920// NextWithContext advances to the next value.  If there was an error making
3921// the request the iterator does not advance and the error is returned.
3922func (iter *ContentItemCollectionIterator) NextWithContext(ctx context.Context) (err error) {
3923	if tracing.IsEnabled() {
3924		ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionIterator.NextWithContext")
3925		defer func() {
3926			sc := -1
3927			if iter.Response().Response.Response != nil {
3928				sc = iter.Response().Response.Response.StatusCode
3929			}
3930			tracing.EndSpan(ctx, sc, err)
3931		}()
3932	}
3933	iter.i++
3934	if iter.i < len(iter.page.Values()) {
3935		return nil
3936	}
3937	err = iter.page.NextWithContext(ctx)
3938	if err != nil {
3939		iter.i--
3940		return err
3941	}
3942	iter.i = 0
3943	return nil
3944}
3945
3946// Next advances to the next value.  If there was an error making
3947// the request the iterator does not advance and the error is returned.
3948// Deprecated: Use NextWithContext() instead.
3949func (iter *ContentItemCollectionIterator) Next() error {
3950	return iter.NextWithContext(context.Background())
3951}
3952
3953// NotDone returns true if the enumeration should be started or is not yet complete.
3954func (iter ContentItemCollectionIterator) NotDone() bool {
3955	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3956}
3957
3958// Response returns the raw server response from the last page request.
3959func (iter ContentItemCollectionIterator) Response() ContentItemCollection {
3960	return iter.page.Response()
3961}
3962
3963// Value returns the current value or a zero-initialized value if the
3964// iterator has advanced beyond the end of the collection.
3965func (iter ContentItemCollectionIterator) Value() ContentItemContract {
3966	if !iter.page.NotDone() {
3967		return ContentItemContract{}
3968	}
3969	return iter.page.Values()[iter.i]
3970}
3971
3972// Creates a new instance of the ContentItemCollectionIterator type.
3973func NewContentItemCollectionIterator(page ContentItemCollectionPage) ContentItemCollectionIterator {
3974	return ContentItemCollectionIterator{page: page}
3975}
3976
3977// IsEmpty returns true if the ListResult contains no values.
3978func (cic ContentItemCollection) IsEmpty() bool {
3979	return cic.Value == nil || len(*cic.Value) == 0
3980}
3981
3982// hasNextLink returns true if the NextLink is not empty.
3983func (cic ContentItemCollection) hasNextLink() bool {
3984	return cic.NextLink != nil && len(*cic.NextLink) != 0
3985}
3986
3987// contentItemCollectionPreparer prepares a request to retrieve the next set of results.
3988// It returns nil if no more results exist.
3989func (cic ContentItemCollection) contentItemCollectionPreparer(ctx context.Context) (*http.Request, error) {
3990	if !cic.hasNextLink() {
3991		return nil, nil
3992	}
3993	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3994		autorest.AsJSON(),
3995		autorest.AsGet(),
3996		autorest.WithBaseURL(to.String(cic.NextLink)))
3997}
3998
3999// ContentItemCollectionPage contains a page of ContentItemContract values.
4000type ContentItemCollectionPage struct {
4001	fn  func(context.Context, ContentItemCollection) (ContentItemCollection, error)
4002	cic ContentItemCollection
4003}
4004
4005// NextWithContext advances to the next page of values.  If there was an error making
4006// the request the page does not advance and the error is returned.
4007func (page *ContentItemCollectionPage) NextWithContext(ctx context.Context) (err error) {
4008	if tracing.IsEnabled() {
4009		ctx = tracing.StartSpan(ctx, fqdn+"/ContentItemCollectionPage.NextWithContext")
4010		defer func() {
4011			sc := -1
4012			if page.Response().Response.Response != nil {
4013				sc = page.Response().Response.Response.StatusCode
4014			}
4015			tracing.EndSpan(ctx, sc, err)
4016		}()
4017	}
4018	for {
4019		next, err := page.fn(ctx, page.cic)
4020		if err != nil {
4021			return err
4022		}
4023		page.cic = next
4024		if !next.hasNextLink() || !next.IsEmpty() {
4025			break
4026		}
4027	}
4028	return nil
4029}
4030
4031// Next advances to the next page of values.  If there was an error making
4032// the request the page does not advance and the error is returned.
4033// Deprecated: Use NextWithContext() instead.
4034func (page *ContentItemCollectionPage) Next() error {
4035	return page.NextWithContext(context.Background())
4036}
4037
4038// NotDone returns true if the page enumeration should be started or is not yet complete.
4039func (page ContentItemCollectionPage) NotDone() bool {
4040	return !page.cic.IsEmpty()
4041}
4042
4043// Response returns the raw server response from the last page request.
4044func (page ContentItemCollectionPage) Response() ContentItemCollection {
4045	return page.cic
4046}
4047
4048// Values returns the slice of values for the current page or nil if there are no values.
4049func (page ContentItemCollectionPage) Values() []ContentItemContract {
4050	if page.cic.IsEmpty() {
4051		return nil
4052	}
4053	return *page.cic.Value
4054}
4055
4056// Creates a new instance of the ContentItemCollectionPage type.
4057func NewContentItemCollectionPage(cur ContentItemCollection, getNextPage func(context.Context, ContentItemCollection) (ContentItemCollection, error)) ContentItemCollectionPage {
4058	return ContentItemCollectionPage{
4059		fn:  getNextPage,
4060		cic: cur,
4061	}
4062}
4063
4064// ContentItemContract content type contract details.
4065type ContentItemContract struct {
4066	autorest.Response `json:"-"`
4067	// Properties - Properties of the content item.
4068	Properties map[string]interface{} `json:"properties"`
4069	// ID - READ-ONLY; Resource ID.
4070	ID *string `json:"id,omitempty"`
4071	// Name - READ-ONLY; Resource name.
4072	Name *string `json:"name,omitempty"`
4073	// Type - READ-ONLY; Resource type for API Management resource.
4074	Type *string `json:"type,omitempty"`
4075}
4076
4077// MarshalJSON is the custom marshaler for ContentItemContract.
4078func (cic ContentItemContract) MarshalJSON() ([]byte, error) {
4079	objectMap := make(map[string]interface{})
4080	if cic.Properties != nil {
4081		objectMap["properties"] = cic.Properties
4082	}
4083	return json.Marshal(objectMap)
4084}
4085
4086// ContentTypeCollection paged list of content types.
4087type ContentTypeCollection struct {
4088	autorest.Response `json:"-"`
4089	// Value - READ-ONLY; Collection of content types.
4090	Value *[]ContentTypeContract `json:"value,omitempty"`
4091	// NextLink - READ-ONLY; Next page link, if any.
4092	NextLink *string `json:"nextLink,omitempty"`
4093}
4094
4095// MarshalJSON is the custom marshaler for ContentTypeCollection.
4096func (ctc ContentTypeCollection) MarshalJSON() ([]byte, error) {
4097	objectMap := make(map[string]interface{})
4098	return json.Marshal(objectMap)
4099}
4100
4101// ContentTypeCollectionIterator provides access to a complete listing of ContentTypeContract values.
4102type ContentTypeCollectionIterator struct {
4103	i    int
4104	page ContentTypeCollectionPage
4105}
4106
4107// NextWithContext advances to the next value.  If there was an error making
4108// the request the iterator does not advance and the error is returned.
4109func (iter *ContentTypeCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4110	if tracing.IsEnabled() {
4111		ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionIterator.NextWithContext")
4112		defer func() {
4113			sc := -1
4114			if iter.Response().Response.Response != nil {
4115				sc = iter.Response().Response.Response.StatusCode
4116			}
4117			tracing.EndSpan(ctx, sc, err)
4118		}()
4119	}
4120	iter.i++
4121	if iter.i < len(iter.page.Values()) {
4122		return nil
4123	}
4124	err = iter.page.NextWithContext(ctx)
4125	if err != nil {
4126		iter.i--
4127		return err
4128	}
4129	iter.i = 0
4130	return nil
4131}
4132
4133// Next advances to the next value.  If there was an error making
4134// the request the iterator does not advance and the error is returned.
4135// Deprecated: Use NextWithContext() instead.
4136func (iter *ContentTypeCollectionIterator) Next() error {
4137	return iter.NextWithContext(context.Background())
4138}
4139
4140// NotDone returns true if the enumeration should be started or is not yet complete.
4141func (iter ContentTypeCollectionIterator) NotDone() bool {
4142	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4143}
4144
4145// Response returns the raw server response from the last page request.
4146func (iter ContentTypeCollectionIterator) Response() ContentTypeCollection {
4147	return iter.page.Response()
4148}
4149
4150// Value returns the current value or a zero-initialized value if the
4151// iterator has advanced beyond the end of the collection.
4152func (iter ContentTypeCollectionIterator) Value() ContentTypeContract {
4153	if !iter.page.NotDone() {
4154		return ContentTypeContract{}
4155	}
4156	return iter.page.Values()[iter.i]
4157}
4158
4159// Creates a new instance of the ContentTypeCollectionIterator type.
4160func NewContentTypeCollectionIterator(page ContentTypeCollectionPage) ContentTypeCollectionIterator {
4161	return ContentTypeCollectionIterator{page: page}
4162}
4163
4164// IsEmpty returns true if the ListResult contains no values.
4165func (ctc ContentTypeCollection) IsEmpty() bool {
4166	return ctc.Value == nil || len(*ctc.Value) == 0
4167}
4168
4169// hasNextLink returns true if the NextLink is not empty.
4170func (ctc ContentTypeCollection) hasNextLink() bool {
4171	return ctc.NextLink != nil && len(*ctc.NextLink) != 0
4172}
4173
4174// contentTypeCollectionPreparer prepares a request to retrieve the next set of results.
4175// It returns nil if no more results exist.
4176func (ctc ContentTypeCollection) contentTypeCollectionPreparer(ctx context.Context) (*http.Request, error) {
4177	if !ctc.hasNextLink() {
4178		return nil, nil
4179	}
4180	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4181		autorest.AsJSON(),
4182		autorest.AsGet(),
4183		autorest.WithBaseURL(to.String(ctc.NextLink)))
4184}
4185
4186// ContentTypeCollectionPage contains a page of ContentTypeContract values.
4187type ContentTypeCollectionPage struct {
4188	fn  func(context.Context, ContentTypeCollection) (ContentTypeCollection, error)
4189	ctc ContentTypeCollection
4190}
4191
4192// NextWithContext advances to the next page of values.  If there was an error making
4193// the request the page does not advance and the error is returned.
4194func (page *ContentTypeCollectionPage) NextWithContext(ctx context.Context) (err error) {
4195	if tracing.IsEnabled() {
4196		ctx = tracing.StartSpan(ctx, fqdn+"/ContentTypeCollectionPage.NextWithContext")
4197		defer func() {
4198			sc := -1
4199			if page.Response().Response.Response != nil {
4200				sc = page.Response().Response.Response.StatusCode
4201			}
4202			tracing.EndSpan(ctx, sc, err)
4203		}()
4204	}
4205	for {
4206		next, err := page.fn(ctx, page.ctc)
4207		if err != nil {
4208			return err
4209		}
4210		page.ctc = next
4211		if !next.hasNextLink() || !next.IsEmpty() {
4212			break
4213		}
4214	}
4215	return nil
4216}
4217
4218// Next advances to the next page of values.  If there was an error making
4219// the request the page does not advance and the error is returned.
4220// Deprecated: Use NextWithContext() instead.
4221func (page *ContentTypeCollectionPage) Next() error {
4222	return page.NextWithContext(context.Background())
4223}
4224
4225// NotDone returns true if the page enumeration should be started or is not yet complete.
4226func (page ContentTypeCollectionPage) NotDone() bool {
4227	return !page.ctc.IsEmpty()
4228}
4229
4230// Response returns the raw server response from the last page request.
4231func (page ContentTypeCollectionPage) Response() ContentTypeCollection {
4232	return page.ctc
4233}
4234
4235// Values returns the slice of values for the current page or nil if there are no values.
4236func (page ContentTypeCollectionPage) Values() []ContentTypeContract {
4237	if page.ctc.IsEmpty() {
4238		return nil
4239	}
4240	return *page.ctc.Value
4241}
4242
4243// Creates a new instance of the ContentTypeCollectionPage type.
4244func NewContentTypeCollectionPage(cur ContentTypeCollection, getNextPage func(context.Context, ContentTypeCollection) (ContentTypeCollection, error)) ContentTypeCollectionPage {
4245	return ContentTypeCollectionPage{
4246		fn:  getNextPage,
4247		ctc: cur,
4248	}
4249}
4250
4251// ContentTypeContract content type contract details.
4252type ContentTypeContract struct {
4253	autorest.Response `json:"-"`
4254	// ContentTypeContractProperties - Properties of the content type.
4255	*ContentTypeContractProperties `json:"properties,omitempty"`
4256	// ID - READ-ONLY; Resource ID.
4257	ID *string `json:"id,omitempty"`
4258	// Name - READ-ONLY; Resource name.
4259	Name *string `json:"name,omitempty"`
4260	// Type - READ-ONLY; Resource type for API Management resource.
4261	Type *string `json:"type,omitempty"`
4262}
4263
4264// MarshalJSON is the custom marshaler for ContentTypeContract.
4265func (ctc ContentTypeContract) MarshalJSON() ([]byte, error) {
4266	objectMap := make(map[string]interface{})
4267	if ctc.ContentTypeContractProperties != nil {
4268		objectMap["properties"] = ctc.ContentTypeContractProperties
4269	}
4270	return json.Marshal(objectMap)
4271}
4272
4273// UnmarshalJSON is the custom unmarshaler for ContentTypeContract struct.
4274func (ctc *ContentTypeContract) UnmarshalJSON(body []byte) error {
4275	var m map[string]*json.RawMessage
4276	err := json.Unmarshal(body, &m)
4277	if err != nil {
4278		return err
4279	}
4280	for k, v := range m {
4281		switch k {
4282		case "properties":
4283			if v != nil {
4284				var contentTypeContractProperties ContentTypeContractProperties
4285				err = json.Unmarshal(*v, &contentTypeContractProperties)
4286				if err != nil {
4287					return err
4288				}
4289				ctc.ContentTypeContractProperties = &contentTypeContractProperties
4290			}
4291		case "id":
4292			if v != nil {
4293				var ID string
4294				err = json.Unmarshal(*v, &ID)
4295				if err != nil {
4296					return err
4297				}
4298				ctc.ID = &ID
4299			}
4300		case "name":
4301			if v != nil {
4302				var name string
4303				err = json.Unmarshal(*v, &name)
4304				if err != nil {
4305					return err
4306				}
4307				ctc.Name = &name
4308			}
4309		case "type":
4310			if v != nil {
4311				var typeVar string
4312				err = json.Unmarshal(*v, &typeVar)
4313				if err != nil {
4314					return err
4315				}
4316				ctc.Type = &typeVar
4317			}
4318		}
4319	}
4320
4321	return nil
4322}
4323
4324// ContentTypeContractProperties ...
4325type ContentTypeContractProperties struct {
4326	// ID - Content type identifier
4327	ID *string `json:"id,omitempty"`
4328	// Name - Content type name. Must be 1 to 250 characters long.
4329	Name *string `json:"name,omitempty"`
4330	// Description - Content type description.
4331	Description *string `json:"description,omitempty"`
4332	// Schema - Content type schema.
4333	Schema interface{} `json:"schema,omitempty"`
4334	// Version - Content type version.
4335	Version *string `json:"version,omitempty"`
4336}
4337
4338// DataMasking ...
4339type DataMasking struct {
4340	// QueryParams - Masking settings for Url query parameters
4341	QueryParams *[]DataMaskingEntity `json:"queryParams,omitempty"`
4342	// Headers - Masking settings for headers
4343	Headers *[]DataMaskingEntity `json:"headers,omitempty"`
4344}
4345
4346// DataMaskingEntity ...
4347type DataMaskingEntity struct {
4348	// Value - The name of an entity to mask (e.g. a name of a header or a query parameter).
4349	Value *string `json:"value,omitempty"`
4350	// Mode - Data masking mode. Possible values include: 'DataMaskingModeMask', 'DataMaskingModeHide'
4351	Mode DataMaskingMode `json:"mode,omitempty"`
4352}
4353
4354// DeletedServiceContract deleted API Management Service information.
4355type DeletedServiceContract struct {
4356	autorest.Response `json:"-"`
4357	// DeletedServiceContractProperties - Deleted API Management Service details.
4358	*DeletedServiceContractProperties `json:"properties,omitempty"`
4359	// Location - READ-ONLY; API Management Service Master Location.
4360	Location *string `json:"location,omitempty"`
4361	// ID - READ-ONLY; Resource ID.
4362	ID *string `json:"id,omitempty"`
4363	// Name - READ-ONLY; Resource name.
4364	Name *string `json:"name,omitempty"`
4365	// Type - READ-ONLY; Resource type for API Management resource.
4366	Type *string `json:"type,omitempty"`
4367}
4368
4369// MarshalJSON is the custom marshaler for DeletedServiceContract.
4370func (dsc DeletedServiceContract) MarshalJSON() ([]byte, error) {
4371	objectMap := make(map[string]interface{})
4372	if dsc.DeletedServiceContractProperties != nil {
4373		objectMap["properties"] = dsc.DeletedServiceContractProperties
4374	}
4375	return json.Marshal(objectMap)
4376}
4377
4378// UnmarshalJSON is the custom unmarshaler for DeletedServiceContract struct.
4379func (dsc *DeletedServiceContract) UnmarshalJSON(body []byte) error {
4380	var m map[string]*json.RawMessage
4381	err := json.Unmarshal(body, &m)
4382	if err != nil {
4383		return err
4384	}
4385	for k, v := range m {
4386		switch k {
4387		case "properties":
4388			if v != nil {
4389				var deletedServiceContractProperties DeletedServiceContractProperties
4390				err = json.Unmarshal(*v, &deletedServiceContractProperties)
4391				if err != nil {
4392					return err
4393				}
4394				dsc.DeletedServiceContractProperties = &deletedServiceContractProperties
4395			}
4396		case "location":
4397			if v != nil {
4398				var location string
4399				err = json.Unmarshal(*v, &location)
4400				if err != nil {
4401					return err
4402				}
4403				dsc.Location = &location
4404			}
4405		case "id":
4406			if v != nil {
4407				var ID string
4408				err = json.Unmarshal(*v, &ID)
4409				if err != nil {
4410					return err
4411				}
4412				dsc.ID = &ID
4413			}
4414		case "name":
4415			if v != nil {
4416				var name string
4417				err = json.Unmarshal(*v, &name)
4418				if err != nil {
4419					return err
4420				}
4421				dsc.Name = &name
4422			}
4423		case "type":
4424			if v != nil {
4425				var typeVar string
4426				err = json.Unmarshal(*v, &typeVar)
4427				if err != nil {
4428					return err
4429				}
4430				dsc.Type = &typeVar
4431			}
4432		}
4433	}
4434
4435	return nil
4436}
4437
4438// DeletedServiceContractProperties ...
4439type DeletedServiceContractProperties struct {
4440	// ServiceID - Fully-qualified API Management Service Resource ID
4441	ServiceID *string `json:"serviceId,omitempty"`
4442	// ScheduledPurgeDate - UTC Date and Time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
4443	ScheduledPurgeDate *date.Time `json:"scheduledPurgeDate,omitempty"`
4444	// DeletionDate - UTC Timestamp when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.
4445	DeletionDate *date.Time `json:"deletionDate,omitempty"`
4446}
4447
4448// DeletedServicesCollection paged deleted API Management Services List Representation.
4449type DeletedServicesCollection struct {
4450	autorest.Response `json:"-"`
4451	// Value - READ-ONLY; Page values.
4452	Value *[]DeletedServiceContract `json:"value,omitempty"`
4453	// NextLink - READ-ONLY; Next page link if any.
4454	NextLink *string `json:"nextLink,omitempty"`
4455}
4456
4457// MarshalJSON is the custom marshaler for DeletedServicesCollection.
4458func (dsc DeletedServicesCollection) MarshalJSON() ([]byte, error) {
4459	objectMap := make(map[string]interface{})
4460	return json.Marshal(objectMap)
4461}
4462
4463// DeletedServicesCollectionIterator provides access to a complete listing of DeletedServiceContract
4464// values.
4465type DeletedServicesCollectionIterator struct {
4466	i    int
4467	page DeletedServicesCollectionPage
4468}
4469
4470// NextWithContext advances to the next value.  If there was an error making
4471// the request the iterator does not advance and the error is returned.
4472func (iter *DeletedServicesCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4473	if tracing.IsEnabled() {
4474		ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServicesCollectionIterator.NextWithContext")
4475		defer func() {
4476			sc := -1
4477			if iter.Response().Response.Response != nil {
4478				sc = iter.Response().Response.Response.StatusCode
4479			}
4480			tracing.EndSpan(ctx, sc, err)
4481		}()
4482	}
4483	iter.i++
4484	if iter.i < len(iter.page.Values()) {
4485		return nil
4486	}
4487	err = iter.page.NextWithContext(ctx)
4488	if err != nil {
4489		iter.i--
4490		return err
4491	}
4492	iter.i = 0
4493	return nil
4494}
4495
4496// Next advances to the next value.  If there was an error making
4497// the request the iterator does not advance and the error is returned.
4498// Deprecated: Use NextWithContext() instead.
4499func (iter *DeletedServicesCollectionIterator) Next() error {
4500	return iter.NextWithContext(context.Background())
4501}
4502
4503// NotDone returns true if the enumeration should be started or is not yet complete.
4504func (iter DeletedServicesCollectionIterator) NotDone() bool {
4505	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4506}
4507
4508// Response returns the raw server response from the last page request.
4509func (iter DeletedServicesCollectionIterator) Response() DeletedServicesCollection {
4510	return iter.page.Response()
4511}
4512
4513// Value returns the current value or a zero-initialized value if the
4514// iterator has advanced beyond the end of the collection.
4515func (iter DeletedServicesCollectionIterator) Value() DeletedServiceContract {
4516	if !iter.page.NotDone() {
4517		return DeletedServiceContract{}
4518	}
4519	return iter.page.Values()[iter.i]
4520}
4521
4522// Creates a new instance of the DeletedServicesCollectionIterator type.
4523func NewDeletedServicesCollectionIterator(page DeletedServicesCollectionPage) DeletedServicesCollectionIterator {
4524	return DeletedServicesCollectionIterator{page: page}
4525}
4526
4527// IsEmpty returns true if the ListResult contains no values.
4528func (dsc DeletedServicesCollection) IsEmpty() bool {
4529	return dsc.Value == nil || len(*dsc.Value) == 0
4530}
4531
4532// hasNextLink returns true if the NextLink is not empty.
4533func (dsc DeletedServicesCollection) hasNextLink() bool {
4534	return dsc.NextLink != nil && len(*dsc.NextLink) != 0
4535}
4536
4537// deletedServicesCollectionPreparer prepares a request to retrieve the next set of results.
4538// It returns nil if no more results exist.
4539func (dsc DeletedServicesCollection) deletedServicesCollectionPreparer(ctx context.Context) (*http.Request, error) {
4540	if !dsc.hasNextLink() {
4541		return nil, nil
4542	}
4543	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4544		autorest.AsJSON(),
4545		autorest.AsGet(),
4546		autorest.WithBaseURL(to.String(dsc.NextLink)))
4547}
4548
4549// DeletedServicesCollectionPage contains a page of DeletedServiceContract values.
4550type DeletedServicesCollectionPage struct {
4551	fn  func(context.Context, DeletedServicesCollection) (DeletedServicesCollection, error)
4552	dsc DeletedServicesCollection
4553}
4554
4555// NextWithContext advances to the next page of values.  If there was an error making
4556// the request the page does not advance and the error is returned.
4557func (page *DeletedServicesCollectionPage) NextWithContext(ctx context.Context) (err error) {
4558	if tracing.IsEnabled() {
4559		ctx = tracing.StartSpan(ctx, fqdn+"/DeletedServicesCollectionPage.NextWithContext")
4560		defer func() {
4561			sc := -1
4562			if page.Response().Response.Response != nil {
4563				sc = page.Response().Response.Response.StatusCode
4564			}
4565			tracing.EndSpan(ctx, sc, err)
4566		}()
4567	}
4568	for {
4569		next, err := page.fn(ctx, page.dsc)
4570		if err != nil {
4571			return err
4572		}
4573		page.dsc = next
4574		if !next.hasNextLink() || !next.IsEmpty() {
4575			break
4576		}
4577	}
4578	return nil
4579}
4580
4581// Next advances to the next page of values.  If there was an error making
4582// the request the page does not advance and the error is returned.
4583// Deprecated: Use NextWithContext() instead.
4584func (page *DeletedServicesCollectionPage) Next() error {
4585	return page.NextWithContext(context.Background())
4586}
4587
4588// NotDone returns true if the page enumeration should be started or is not yet complete.
4589func (page DeletedServicesCollectionPage) NotDone() bool {
4590	return !page.dsc.IsEmpty()
4591}
4592
4593// Response returns the raw server response from the last page request.
4594func (page DeletedServicesCollectionPage) Response() DeletedServicesCollection {
4595	return page.dsc
4596}
4597
4598// Values returns the slice of values for the current page or nil if there are no values.
4599func (page DeletedServicesCollectionPage) Values() []DeletedServiceContract {
4600	if page.dsc.IsEmpty() {
4601		return nil
4602	}
4603	return *page.dsc.Value
4604}
4605
4606// Creates a new instance of the DeletedServicesCollectionPage type.
4607func NewDeletedServicesCollectionPage(cur DeletedServicesCollection, getNextPage func(context.Context, DeletedServicesCollection) (DeletedServicesCollection, error)) DeletedServicesCollectionPage {
4608	return DeletedServicesCollectionPage{
4609		fn:  getNextPage,
4610		dsc: cur,
4611	}
4612}
4613
4614// DeletedServicesPurgeFuture an abstraction for monitoring and retrieving the results of a long-running
4615// operation.
4616type DeletedServicesPurgeFuture struct {
4617	azure.FutureAPI
4618	// Result returns the result of the asynchronous operation.
4619	// If the operation has not completed it will return an error.
4620	Result func(DeletedServicesClient) (DeletedServiceContract, error)
4621}
4622
4623// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4624func (future *DeletedServicesPurgeFuture) UnmarshalJSON(body []byte) error {
4625	var azFuture azure.Future
4626	if err := json.Unmarshal(body, &azFuture); err != nil {
4627		return err
4628	}
4629	future.FutureAPI = &azFuture
4630	future.Result = future.result
4631	return nil
4632}
4633
4634// result is the default implementation for DeletedServicesPurgeFuture.Result.
4635func (future *DeletedServicesPurgeFuture) result(client DeletedServicesClient) (dsc DeletedServiceContract, err error) {
4636	var done bool
4637	done, err = future.DoneWithContext(context.Background(), client)
4638	if err != nil {
4639		err = autorest.NewErrorWithError(err, "apimanagement.DeletedServicesPurgeFuture", "Result", future.Response(), "Polling failure")
4640		return
4641	}
4642	if !done {
4643		dsc.Response.Response = future.Response()
4644		err = azure.NewAsyncOpIncompleteError("apimanagement.DeletedServicesPurgeFuture")
4645		return
4646	}
4647	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4648	if dsc.Response.Response, err = future.GetResult(sender); err == nil && dsc.Response.Response.StatusCode != http.StatusNoContent {
4649		dsc, err = client.PurgeResponder(dsc.Response.Response)
4650		if err != nil {
4651			err = autorest.NewErrorWithError(err, "apimanagement.DeletedServicesPurgeFuture", "Result", dsc.Response.Response, "Failure responding to request")
4652		}
4653	}
4654	return
4655}
4656
4657// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation.
4658type DeployConfigurationParameterProperties struct {
4659	// Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database.
4660	Branch *string `json:"branch,omitempty"`
4661	// Force - The value enforcing deleting subscriptions to products that are deleted in this update.
4662	Force *bool `json:"force,omitempty"`
4663}
4664
4665// DeployConfigurationParameters deploy Tenant Configuration Contract.
4666type DeployConfigurationParameters struct {
4667	// DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties.
4668	*DeployConfigurationParameterProperties `json:"properties,omitempty"`
4669}
4670
4671// MarshalJSON is the custom marshaler for DeployConfigurationParameters.
4672func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) {
4673	objectMap := make(map[string]interface{})
4674	if dcp.DeployConfigurationParameterProperties != nil {
4675		objectMap["properties"] = dcp.DeployConfigurationParameterProperties
4676	}
4677	return json.Marshal(objectMap)
4678}
4679
4680// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct.
4681func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error {
4682	var m map[string]*json.RawMessage
4683	err := json.Unmarshal(body, &m)
4684	if err != nil {
4685		return err
4686	}
4687	for k, v := range m {
4688		switch k {
4689		case "properties":
4690			if v != nil {
4691				var deployConfigurationParameterProperties DeployConfigurationParameterProperties
4692				err = json.Unmarshal(*v, &deployConfigurationParameterProperties)
4693				if err != nil {
4694					return err
4695				}
4696				dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties
4697			}
4698		}
4699	}
4700
4701	return nil
4702}
4703
4704// DiagnosticCollection paged Diagnostic list representation.
4705type DiagnosticCollection struct {
4706	autorest.Response `json:"-"`
4707	// Value - Page values.
4708	Value *[]DiagnosticContract `json:"value,omitempty"`
4709	// Count - Total record count number across all pages.
4710	Count *int64 `json:"count,omitempty"`
4711	// NextLink - Next page link if any.
4712	NextLink *string `json:"nextLink,omitempty"`
4713}
4714
4715// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values.
4716type DiagnosticCollectionIterator struct {
4717	i    int
4718	page DiagnosticCollectionPage
4719}
4720
4721// NextWithContext advances to the next value.  If there was an error making
4722// the request the iterator does not advance and the error is returned.
4723func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4724	if tracing.IsEnabled() {
4725		ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext")
4726		defer func() {
4727			sc := -1
4728			if iter.Response().Response.Response != nil {
4729				sc = iter.Response().Response.Response.StatusCode
4730			}
4731			tracing.EndSpan(ctx, sc, err)
4732		}()
4733	}
4734	iter.i++
4735	if iter.i < len(iter.page.Values()) {
4736		return nil
4737	}
4738	err = iter.page.NextWithContext(ctx)
4739	if err != nil {
4740		iter.i--
4741		return err
4742	}
4743	iter.i = 0
4744	return nil
4745}
4746
4747// Next advances to the next value.  If there was an error making
4748// the request the iterator does not advance and the error is returned.
4749// Deprecated: Use NextWithContext() instead.
4750func (iter *DiagnosticCollectionIterator) Next() error {
4751	return iter.NextWithContext(context.Background())
4752}
4753
4754// NotDone returns true if the enumeration should be started or is not yet complete.
4755func (iter DiagnosticCollectionIterator) NotDone() bool {
4756	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4757}
4758
4759// Response returns the raw server response from the last page request.
4760func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection {
4761	return iter.page.Response()
4762}
4763
4764// Value returns the current value or a zero-initialized value if the
4765// iterator has advanced beyond the end of the collection.
4766func (iter DiagnosticCollectionIterator) Value() DiagnosticContract {
4767	if !iter.page.NotDone() {
4768		return DiagnosticContract{}
4769	}
4770	return iter.page.Values()[iter.i]
4771}
4772
4773// Creates a new instance of the DiagnosticCollectionIterator type.
4774func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator {
4775	return DiagnosticCollectionIterator{page: page}
4776}
4777
4778// IsEmpty returns true if the ListResult contains no values.
4779func (dc DiagnosticCollection) IsEmpty() bool {
4780	return dc.Value == nil || len(*dc.Value) == 0
4781}
4782
4783// hasNextLink returns true if the NextLink is not empty.
4784func (dc DiagnosticCollection) hasNextLink() bool {
4785	return dc.NextLink != nil && len(*dc.NextLink) != 0
4786}
4787
4788// diagnosticCollectionPreparer prepares a request to retrieve the next set of results.
4789// It returns nil if no more results exist.
4790func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) {
4791	if !dc.hasNextLink() {
4792		return nil, nil
4793	}
4794	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4795		autorest.AsJSON(),
4796		autorest.AsGet(),
4797		autorest.WithBaseURL(to.String(dc.NextLink)))
4798}
4799
4800// DiagnosticCollectionPage contains a page of DiagnosticContract values.
4801type DiagnosticCollectionPage struct {
4802	fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)
4803	dc DiagnosticCollection
4804}
4805
4806// NextWithContext advances to the next page of values.  If there was an error making
4807// the request the page does not advance and the error is returned.
4808func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) {
4809	if tracing.IsEnabled() {
4810		ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext")
4811		defer func() {
4812			sc := -1
4813			if page.Response().Response.Response != nil {
4814				sc = page.Response().Response.Response.StatusCode
4815			}
4816			tracing.EndSpan(ctx, sc, err)
4817		}()
4818	}
4819	for {
4820		next, err := page.fn(ctx, page.dc)
4821		if err != nil {
4822			return err
4823		}
4824		page.dc = next
4825		if !next.hasNextLink() || !next.IsEmpty() {
4826			break
4827		}
4828	}
4829	return nil
4830}
4831
4832// Next advances to the next page of values.  If there was an error making
4833// the request the page does not advance and the error is returned.
4834// Deprecated: Use NextWithContext() instead.
4835func (page *DiagnosticCollectionPage) Next() error {
4836	return page.NextWithContext(context.Background())
4837}
4838
4839// NotDone returns true if the page enumeration should be started or is not yet complete.
4840func (page DiagnosticCollectionPage) NotDone() bool {
4841	return !page.dc.IsEmpty()
4842}
4843
4844// Response returns the raw server response from the last page request.
4845func (page DiagnosticCollectionPage) Response() DiagnosticCollection {
4846	return page.dc
4847}
4848
4849// Values returns the slice of values for the current page or nil if there are no values.
4850func (page DiagnosticCollectionPage) Values() []DiagnosticContract {
4851	if page.dc.IsEmpty() {
4852		return nil
4853	}
4854	return *page.dc.Value
4855}
4856
4857// Creates a new instance of the DiagnosticCollectionPage type.
4858func NewDiagnosticCollectionPage(cur DiagnosticCollection, getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage {
4859	return DiagnosticCollectionPage{
4860		fn: getNextPage,
4861		dc: cur,
4862	}
4863}
4864
4865// DiagnosticContract diagnostic details.
4866type DiagnosticContract struct {
4867	autorest.Response `json:"-"`
4868	// DiagnosticContractProperties - Diagnostic entity contract properties.
4869	*DiagnosticContractProperties `json:"properties,omitempty"`
4870	// ID - READ-ONLY; Resource ID.
4871	ID *string `json:"id,omitempty"`
4872	// Name - READ-ONLY; Resource name.
4873	Name *string `json:"name,omitempty"`
4874	// Type - READ-ONLY; Resource type for API Management resource.
4875	Type *string `json:"type,omitempty"`
4876}
4877
4878// MarshalJSON is the custom marshaler for DiagnosticContract.
4879func (dc DiagnosticContract) MarshalJSON() ([]byte, error) {
4880	objectMap := make(map[string]interface{})
4881	if dc.DiagnosticContractProperties != nil {
4882		objectMap["properties"] = dc.DiagnosticContractProperties
4883	}
4884	return json.Marshal(objectMap)
4885}
4886
4887// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct.
4888func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error {
4889	var m map[string]*json.RawMessage
4890	err := json.Unmarshal(body, &m)
4891	if err != nil {
4892		return err
4893	}
4894	for k, v := range m {
4895		switch k {
4896		case "properties":
4897			if v != nil {
4898				var diagnosticContractProperties DiagnosticContractProperties
4899				err = json.Unmarshal(*v, &diagnosticContractProperties)
4900				if err != nil {
4901					return err
4902				}
4903				dc.DiagnosticContractProperties = &diagnosticContractProperties
4904			}
4905		case "id":
4906			if v != nil {
4907				var ID string
4908				err = json.Unmarshal(*v, &ID)
4909				if err != nil {
4910					return err
4911				}
4912				dc.ID = &ID
4913			}
4914		case "name":
4915			if v != nil {
4916				var name string
4917				err = json.Unmarshal(*v, &name)
4918				if err != nil {
4919					return err
4920				}
4921				dc.Name = &name
4922			}
4923		case "type":
4924			if v != nil {
4925				var typeVar string
4926				err = json.Unmarshal(*v, &typeVar)
4927				if err != nil {
4928					return err
4929				}
4930				dc.Type = &typeVar
4931			}
4932		}
4933	}
4934
4935	return nil
4936}
4937
4938// DiagnosticContractProperties diagnostic Entity Properties
4939type DiagnosticContractProperties struct {
4940	// AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AlwaysLogAllErrors'
4941	AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"`
4942	// LoggerID - Resource Id of a target logger.
4943	LoggerID *string `json:"loggerId,omitempty"`
4944	// Sampling - Sampling settings for Diagnostic.
4945	Sampling *SamplingSettings `json:"sampling,omitempty"`
4946	// Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
4947	Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"`
4948	// Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend
4949	Backend *PipelineDiagnosticSettings `json:"backend,omitempty"`
4950	// LogClientIP - Log the ClientIP. Default is false.
4951	LogClientIP *bool `json:"logClientIp,omitempty"`
4952	// HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'HTTPCorrelationProtocolNone', 'HTTPCorrelationProtocolLegacy', 'HTTPCorrelationProtocolW3C'
4953	HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"`
4954	// Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'VerbosityVerbose', 'VerbosityInformation', 'VerbosityError'
4955	Verbosity Verbosity `json:"verbosity,omitempty"`
4956	// OperationNameFormat - The format of the Operation Name for Application Insights telemetries. Default is Name. Possible values include: 'OperationNameFormatName', 'OperationNameFormatURL'
4957	OperationNameFormat OperationNameFormat `json:"operationNameFormat,omitempty"`
4958}
4959
4960// EmailTemplateCollection paged email template list representation.
4961type EmailTemplateCollection struct {
4962	autorest.Response `json:"-"`
4963	// Value - Page values.
4964	Value *[]EmailTemplateContract `json:"value,omitempty"`
4965	// Count - Total record count number across all pages.
4966	Count *int64 `json:"count,omitempty"`
4967	// NextLink - Next page link if any.
4968	NextLink *string `json:"nextLink,omitempty"`
4969}
4970
4971// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values.
4972type EmailTemplateCollectionIterator struct {
4973	i    int
4974	page EmailTemplateCollectionPage
4975}
4976
4977// NextWithContext advances to the next value.  If there was an error making
4978// the request the iterator does not advance and the error is returned.
4979func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) {
4980	if tracing.IsEnabled() {
4981		ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext")
4982		defer func() {
4983			sc := -1
4984			if iter.Response().Response.Response != nil {
4985				sc = iter.Response().Response.Response.StatusCode
4986			}
4987			tracing.EndSpan(ctx, sc, err)
4988		}()
4989	}
4990	iter.i++
4991	if iter.i < len(iter.page.Values()) {
4992		return nil
4993	}
4994	err = iter.page.NextWithContext(ctx)
4995	if err != nil {
4996		iter.i--
4997		return err
4998	}
4999	iter.i = 0
5000	return nil
5001}
5002
5003// Next advances to the next value.  If there was an error making
5004// the request the iterator does not advance and the error is returned.
5005// Deprecated: Use NextWithContext() instead.
5006func (iter *EmailTemplateCollectionIterator) Next() error {
5007	return iter.NextWithContext(context.Background())
5008}
5009
5010// NotDone returns true if the enumeration should be started or is not yet complete.
5011func (iter EmailTemplateCollectionIterator) NotDone() bool {
5012	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5013}
5014
5015// Response returns the raw server response from the last page request.
5016func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection {
5017	return iter.page.Response()
5018}
5019
5020// Value returns the current value or a zero-initialized value if the
5021// iterator has advanced beyond the end of the collection.
5022func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract {
5023	if !iter.page.NotDone() {
5024		return EmailTemplateContract{}
5025	}
5026	return iter.page.Values()[iter.i]
5027}
5028
5029// Creates a new instance of the EmailTemplateCollectionIterator type.
5030func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator {
5031	return EmailTemplateCollectionIterator{page: page}
5032}
5033
5034// IsEmpty returns true if the ListResult contains no values.
5035func (etc EmailTemplateCollection) IsEmpty() bool {
5036	return etc.Value == nil || len(*etc.Value) == 0
5037}
5038
5039// hasNextLink returns true if the NextLink is not empty.
5040func (etc EmailTemplateCollection) hasNextLink() bool {
5041	return etc.NextLink != nil && len(*etc.NextLink) != 0
5042}
5043
5044// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results.
5045// It returns nil if no more results exist.
5046func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) {
5047	if !etc.hasNextLink() {
5048		return nil, nil
5049	}
5050	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5051		autorest.AsJSON(),
5052		autorest.AsGet(),
5053		autorest.WithBaseURL(to.String(etc.NextLink)))
5054}
5055
5056// EmailTemplateCollectionPage contains a page of EmailTemplateContract values.
5057type EmailTemplateCollectionPage struct {
5058	fn  func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)
5059	etc EmailTemplateCollection
5060}
5061
5062// NextWithContext advances to the next page of values.  If there was an error making
5063// the request the page does not advance and the error is returned.
5064func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) {
5065	if tracing.IsEnabled() {
5066		ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext")
5067		defer func() {
5068			sc := -1
5069			if page.Response().Response.Response != nil {
5070				sc = page.Response().Response.Response.StatusCode
5071			}
5072			tracing.EndSpan(ctx, sc, err)
5073		}()
5074	}
5075	for {
5076		next, err := page.fn(ctx, page.etc)
5077		if err != nil {
5078			return err
5079		}
5080		page.etc = next
5081		if !next.hasNextLink() || !next.IsEmpty() {
5082			break
5083		}
5084	}
5085	return nil
5086}
5087
5088// Next advances to the next page of values.  If there was an error making
5089// the request the page does not advance and the error is returned.
5090// Deprecated: Use NextWithContext() instead.
5091func (page *EmailTemplateCollectionPage) Next() error {
5092	return page.NextWithContext(context.Background())
5093}
5094
5095// NotDone returns true if the page enumeration should be started or is not yet complete.
5096func (page EmailTemplateCollectionPage) NotDone() bool {
5097	return !page.etc.IsEmpty()
5098}
5099
5100// Response returns the raw server response from the last page request.
5101func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection {
5102	return page.etc
5103}
5104
5105// Values returns the slice of values for the current page or nil if there are no values.
5106func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract {
5107	if page.etc.IsEmpty() {
5108		return nil
5109	}
5110	return *page.etc.Value
5111}
5112
5113// Creates a new instance of the EmailTemplateCollectionPage type.
5114func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage {
5115	return EmailTemplateCollectionPage{
5116		fn:  getNextPage,
5117		etc: cur,
5118	}
5119}
5120
5121// EmailTemplateContract email Template details.
5122type EmailTemplateContract struct {
5123	autorest.Response `json:"-"`
5124	// EmailTemplateContractProperties - Email Template entity contract properties.
5125	*EmailTemplateContractProperties `json:"properties,omitempty"`
5126	// ID - READ-ONLY; Resource ID.
5127	ID *string `json:"id,omitempty"`
5128	// Name - READ-ONLY; Resource name.
5129	Name *string `json:"name,omitempty"`
5130	// Type - READ-ONLY; Resource type for API Management resource.
5131	Type *string `json:"type,omitempty"`
5132}
5133
5134// MarshalJSON is the custom marshaler for EmailTemplateContract.
5135func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) {
5136	objectMap := make(map[string]interface{})
5137	if etc.EmailTemplateContractProperties != nil {
5138		objectMap["properties"] = etc.EmailTemplateContractProperties
5139	}
5140	return json.Marshal(objectMap)
5141}
5142
5143// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct.
5144func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error {
5145	var m map[string]*json.RawMessage
5146	err := json.Unmarshal(body, &m)
5147	if err != nil {
5148		return err
5149	}
5150	for k, v := range m {
5151		switch k {
5152		case "properties":
5153			if v != nil {
5154				var emailTemplateContractProperties EmailTemplateContractProperties
5155				err = json.Unmarshal(*v, &emailTemplateContractProperties)
5156				if err != nil {
5157					return err
5158				}
5159				etc.EmailTemplateContractProperties = &emailTemplateContractProperties
5160			}
5161		case "id":
5162			if v != nil {
5163				var ID string
5164				err = json.Unmarshal(*v, &ID)
5165				if err != nil {
5166					return err
5167				}
5168				etc.ID = &ID
5169			}
5170		case "name":
5171			if v != nil {
5172				var name string
5173				err = json.Unmarshal(*v, &name)
5174				if err != nil {
5175					return err
5176				}
5177				etc.Name = &name
5178			}
5179		case "type":
5180			if v != nil {
5181				var typeVar string
5182				err = json.Unmarshal(*v, &typeVar)
5183				if err != nil {
5184					return err
5185				}
5186				etc.Type = &typeVar
5187			}
5188		}
5189	}
5190
5191	return nil
5192}
5193
5194// EmailTemplateContractProperties email Template Contract properties.
5195type EmailTemplateContractProperties struct {
5196	// Subject - Subject of the Template.
5197	Subject *string `json:"subject,omitempty"`
5198	// Body - Email Template Body. This should be a valid XDocument
5199	Body *string `json:"body,omitempty"`
5200	// Title - Title of the Template.
5201	Title *string `json:"title,omitempty"`
5202	// Description - Description of the Email Template.
5203	Description *string `json:"description,omitempty"`
5204	// IsDefault - READ-ONLY; Whether the template is the default template provided by API Management or has been edited.
5205	IsDefault *bool `json:"isDefault,omitempty"`
5206	// Parameters - Email Template Parameter values.
5207	Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"`
5208}
5209
5210// MarshalJSON is the custom marshaler for EmailTemplateContractProperties.
5211func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) {
5212	objectMap := make(map[string]interface{})
5213	if etcp.Subject != nil {
5214		objectMap["subject"] = etcp.Subject
5215	}
5216	if etcp.Body != nil {
5217		objectMap["body"] = etcp.Body
5218	}
5219	if etcp.Title != nil {
5220		objectMap["title"] = etcp.Title
5221	}
5222	if etcp.Description != nil {
5223		objectMap["description"] = etcp.Description
5224	}
5225	if etcp.Parameters != nil {
5226		objectMap["parameters"] = etcp.Parameters
5227	}
5228	return json.Marshal(objectMap)
5229}
5230
5231// EmailTemplateParametersContractProperties email Template Parameter contract.
5232type EmailTemplateParametersContractProperties struct {
5233	// Name - Template parameter name.
5234	Name *string `json:"name,omitempty"`
5235	// Title - Template parameter title.
5236	Title *string `json:"title,omitempty"`
5237	// Description - Template parameter description.
5238	Description *string `json:"description,omitempty"`
5239}
5240
5241// EmailTemplateUpdateParameterProperties email Template Update Contract properties.
5242type EmailTemplateUpdateParameterProperties struct {
5243	// Subject - Subject of the Template.
5244	Subject *string `json:"subject,omitempty"`
5245	// Title - Title of the Template.
5246	Title *string `json:"title,omitempty"`
5247	// Description - Description of the Email Template.
5248	Description *string `json:"description,omitempty"`
5249	// Body - Email Template Body. This should be a valid XDocument
5250	Body *string `json:"body,omitempty"`
5251	// Parameters - Email Template Parameter values.
5252	Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"`
5253}
5254
5255// EmailTemplateUpdateParameters email Template update Parameters.
5256type EmailTemplateUpdateParameters struct {
5257	// EmailTemplateUpdateParameterProperties - Email Template Update contract properties.
5258	*EmailTemplateUpdateParameterProperties `json:"properties,omitempty"`
5259}
5260
5261// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters.
5262func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) {
5263	objectMap := make(map[string]interface{})
5264	if etup.EmailTemplateUpdateParameterProperties != nil {
5265		objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties
5266	}
5267	return json.Marshal(objectMap)
5268}
5269
5270// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct.
5271func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error {
5272	var m map[string]*json.RawMessage
5273	err := json.Unmarshal(body, &m)
5274	if err != nil {
5275		return err
5276	}
5277	for k, v := range m {
5278		switch k {
5279		case "properties":
5280			if v != nil {
5281				var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties
5282				err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties)
5283				if err != nil {
5284					return err
5285				}
5286				etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties
5287			}
5288		}
5289	}
5290
5291	return nil
5292}
5293
5294// ErrorFieldContract error Field contract.
5295type ErrorFieldContract struct {
5296	// Code - Property level error code.
5297	Code *string `json:"code,omitempty"`
5298	// Message - Human-readable representation of property-level error.
5299	Message *string `json:"message,omitempty"`
5300	// Target - Property name.
5301	Target *string `json:"target,omitempty"`
5302}
5303
5304// ErrorResponse error Response.
5305type ErrorResponse struct {
5306	// ErrorResponseBody - Properties of the Error Response.
5307	*ErrorResponseBody `json:"error,omitempty"`
5308}
5309
5310// MarshalJSON is the custom marshaler for ErrorResponse.
5311func (er ErrorResponse) MarshalJSON() ([]byte, error) {
5312	objectMap := make(map[string]interface{})
5313	if er.ErrorResponseBody != nil {
5314		objectMap["error"] = er.ErrorResponseBody
5315	}
5316	return json.Marshal(objectMap)
5317}
5318
5319// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct.
5320func (er *ErrorResponse) UnmarshalJSON(body []byte) error {
5321	var m map[string]*json.RawMessage
5322	err := json.Unmarshal(body, &m)
5323	if err != nil {
5324		return err
5325	}
5326	for k, v := range m {
5327		switch k {
5328		case "error":
5329			if v != nil {
5330				var errorResponseBody ErrorResponseBody
5331				err = json.Unmarshal(*v, &errorResponseBody)
5332				if err != nil {
5333					return err
5334				}
5335				er.ErrorResponseBody = &errorResponseBody
5336			}
5337		}
5338	}
5339
5340	return nil
5341}
5342
5343// ErrorResponseBody error Body contract.
5344type ErrorResponseBody struct {
5345	// Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
5346	Code *string `json:"code,omitempty"`
5347	// Message - Human-readable representation of the error.
5348	Message *string `json:"message,omitempty"`
5349	// Details - The list of invalid fields send in request, in case of validation error.
5350	Details *[]ErrorFieldContract `json:"details,omitempty"`
5351}
5352
5353// GatewayCertificateAuthorityCollection paged Gateway certificate authority list representation.
5354type GatewayCertificateAuthorityCollection struct {
5355	autorest.Response `json:"-"`
5356	// Value - READ-ONLY; Page values.
5357	Value *[]GatewayCertificateAuthorityContract `json:"value,omitempty"`
5358	// NextLink - READ-ONLY; Next page link if any.
5359	NextLink *string `json:"nextLink,omitempty"`
5360}
5361
5362// MarshalJSON is the custom marshaler for GatewayCertificateAuthorityCollection.
5363func (gcac GatewayCertificateAuthorityCollection) MarshalJSON() ([]byte, error) {
5364	objectMap := make(map[string]interface{})
5365	return json.Marshal(objectMap)
5366}
5367
5368// GatewayCertificateAuthorityCollectionIterator provides access to a complete listing of
5369// GatewayCertificateAuthorityContract values.
5370type GatewayCertificateAuthorityCollectionIterator struct {
5371	i    int
5372	page GatewayCertificateAuthorityCollectionPage
5373}
5374
5375// NextWithContext advances to the next value.  If there was an error making
5376// the request the iterator does not advance and the error is returned.
5377func (iter *GatewayCertificateAuthorityCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5378	if tracing.IsEnabled() {
5379		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCertificateAuthorityCollectionIterator.NextWithContext")
5380		defer func() {
5381			sc := -1
5382			if iter.Response().Response.Response != nil {
5383				sc = iter.Response().Response.Response.StatusCode
5384			}
5385			tracing.EndSpan(ctx, sc, err)
5386		}()
5387	}
5388	iter.i++
5389	if iter.i < len(iter.page.Values()) {
5390		return nil
5391	}
5392	err = iter.page.NextWithContext(ctx)
5393	if err != nil {
5394		iter.i--
5395		return err
5396	}
5397	iter.i = 0
5398	return nil
5399}
5400
5401// Next advances to the next value.  If there was an error making
5402// the request the iterator does not advance and the error is returned.
5403// Deprecated: Use NextWithContext() instead.
5404func (iter *GatewayCertificateAuthorityCollectionIterator) Next() error {
5405	return iter.NextWithContext(context.Background())
5406}
5407
5408// NotDone returns true if the enumeration should be started or is not yet complete.
5409func (iter GatewayCertificateAuthorityCollectionIterator) NotDone() bool {
5410	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5411}
5412
5413// Response returns the raw server response from the last page request.
5414func (iter GatewayCertificateAuthorityCollectionIterator) Response() GatewayCertificateAuthorityCollection {
5415	return iter.page.Response()
5416}
5417
5418// Value returns the current value or a zero-initialized value if the
5419// iterator has advanced beyond the end of the collection.
5420func (iter GatewayCertificateAuthorityCollectionIterator) Value() GatewayCertificateAuthorityContract {
5421	if !iter.page.NotDone() {
5422		return GatewayCertificateAuthorityContract{}
5423	}
5424	return iter.page.Values()[iter.i]
5425}
5426
5427// Creates a new instance of the GatewayCertificateAuthorityCollectionIterator type.
5428func NewGatewayCertificateAuthorityCollectionIterator(page GatewayCertificateAuthorityCollectionPage) GatewayCertificateAuthorityCollectionIterator {
5429	return GatewayCertificateAuthorityCollectionIterator{page: page}
5430}
5431
5432// IsEmpty returns true if the ListResult contains no values.
5433func (gcac GatewayCertificateAuthorityCollection) IsEmpty() bool {
5434	return gcac.Value == nil || len(*gcac.Value) == 0
5435}
5436
5437// hasNextLink returns true if the NextLink is not empty.
5438func (gcac GatewayCertificateAuthorityCollection) hasNextLink() bool {
5439	return gcac.NextLink != nil && len(*gcac.NextLink) != 0
5440}
5441
5442// gatewayCertificateAuthorityCollectionPreparer prepares a request to retrieve the next set of results.
5443// It returns nil if no more results exist.
5444func (gcac GatewayCertificateAuthorityCollection) gatewayCertificateAuthorityCollectionPreparer(ctx context.Context) (*http.Request, error) {
5445	if !gcac.hasNextLink() {
5446		return nil, nil
5447	}
5448	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5449		autorest.AsJSON(),
5450		autorest.AsGet(),
5451		autorest.WithBaseURL(to.String(gcac.NextLink)))
5452}
5453
5454// GatewayCertificateAuthorityCollectionPage contains a page of GatewayCertificateAuthorityContract values.
5455type GatewayCertificateAuthorityCollectionPage struct {
5456	fn   func(context.Context, GatewayCertificateAuthorityCollection) (GatewayCertificateAuthorityCollection, error)
5457	gcac GatewayCertificateAuthorityCollection
5458}
5459
5460// NextWithContext advances to the next page of values.  If there was an error making
5461// the request the page does not advance and the error is returned.
5462func (page *GatewayCertificateAuthorityCollectionPage) NextWithContext(ctx context.Context) (err error) {
5463	if tracing.IsEnabled() {
5464		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCertificateAuthorityCollectionPage.NextWithContext")
5465		defer func() {
5466			sc := -1
5467			if page.Response().Response.Response != nil {
5468				sc = page.Response().Response.Response.StatusCode
5469			}
5470			tracing.EndSpan(ctx, sc, err)
5471		}()
5472	}
5473	for {
5474		next, err := page.fn(ctx, page.gcac)
5475		if err != nil {
5476			return err
5477		}
5478		page.gcac = next
5479		if !next.hasNextLink() || !next.IsEmpty() {
5480			break
5481		}
5482	}
5483	return nil
5484}
5485
5486// Next advances to the next page of values.  If there was an error making
5487// the request the page does not advance and the error is returned.
5488// Deprecated: Use NextWithContext() instead.
5489func (page *GatewayCertificateAuthorityCollectionPage) Next() error {
5490	return page.NextWithContext(context.Background())
5491}
5492
5493// NotDone returns true if the page enumeration should be started or is not yet complete.
5494func (page GatewayCertificateAuthorityCollectionPage) NotDone() bool {
5495	return !page.gcac.IsEmpty()
5496}
5497
5498// Response returns the raw server response from the last page request.
5499func (page GatewayCertificateAuthorityCollectionPage) Response() GatewayCertificateAuthorityCollection {
5500	return page.gcac
5501}
5502
5503// Values returns the slice of values for the current page or nil if there are no values.
5504func (page GatewayCertificateAuthorityCollectionPage) Values() []GatewayCertificateAuthorityContract {
5505	if page.gcac.IsEmpty() {
5506		return nil
5507	}
5508	return *page.gcac.Value
5509}
5510
5511// Creates a new instance of the GatewayCertificateAuthorityCollectionPage type.
5512func NewGatewayCertificateAuthorityCollectionPage(cur GatewayCertificateAuthorityCollection, getNextPage func(context.Context, GatewayCertificateAuthorityCollection) (GatewayCertificateAuthorityCollection, error)) GatewayCertificateAuthorityCollectionPage {
5513	return GatewayCertificateAuthorityCollectionPage{
5514		fn:   getNextPage,
5515		gcac: cur,
5516	}
5517}
5518
5519// GatewayCertificateAuthorityContract gateway certificate authority details.
5520type GatewayCertificateAuthorityContract struct {
5521	autorest.Response `json:"-"`
5522	// GatewayCertificateAuthorityContractProperties - Gateway certificate authority details.
5523	*GatewayCertificateAuthorityContractProperties `json:"properties,omitempty"`
5524	// ID - READ-ONLY; Resource ID.
5525	ID *string `json:"id,omitempty"`
5526	// Name - READ-ONLY; Resource name.
5527	Name *string `json:"name,omitempty"`
5528	// Type - READ-ONLY; Resource type for API Management resource.
5529	Type *string `json:"type,omitempty"`
5530}
5531
5532// MarshalJSON is the custom marshaler for GatewayCertificateAuthorityContract.
5533func (gcac GatewayCertificateAuthorityContract) MarshalJSON() ([]byte, error) {
5534	objectMap := make(map[string]interface{})
5535	if gcac.GatewayCertificateAuthorityContractProperties != nil {
5536		objectMap["properties"] = gcac.GatewayCertificateAuthorityContractProperties
5537	}
5538	return json.Marshal(objectMap)
5539}
5540
5541// UnmarshalJSON is the custom unmarshaler for GatewayCertificateAuthorityContract struct.
5542func (gcac *GatewayCertificateAuthorityContract) UnmarshalJSON(body []byte) error {
5543	var m map[string]*json.RawMessage
5544	err := json.Unmarshal(body, &m)
5545	if err != nil {
5546		return err
5547	}
5548	for k, v := range m {
5549		switch k {
5550		case "properties":
5551			if v != nil {
5552				var gatewayCertificateAuthorityContractProperties GatewayCertificateAuthorityContractProperties
5553				err = json.Unmarshal(*v, &gatewayCertificateAuthorityContractProperties)
5554				if err != nil {
5555					return err
5556				}
5557				gcac.GatewayCertificateAuthorityContractProperties = &gatewayCertificateAuthorityContractProperties
5558			}
5559		case "id":
5560			if v != nil {
5561				var ID string
5562				err = json.Unmarshal(*v, &ID)
5563				if err != nil {
5564					return err
5565				}
5566				gcac.ID = &ID
5567			}
5568		case "name":
5569			if v != nil {
5570				var name string
5571				err = json.Unmarshal(*v, &name)
5572				if err != nil {
5573					return err
5574				}
5575				gcac.Name = &name
5576			}
5577		case "type":
5578			if v != nil {
5579				var typeVar string
5580				err = json.Unmarshal(*v, &typeVar)
5581				if err != nil {
5582					return err
5583				}
5584				gcac.Type = &typeVar
5585			}
5586		}
5587	}
5588
5589	return nil
5590}
5591
5592// GatewayCertificateAuthorityContractProperties gateway certificate authority details.
5593type GatewayCertificateAuthorityContractProperties struct {
5594	// IsTrusted - Determines whether certificate authority is trusted.
5595	IsTrusted *bool `json:"isTrusted,omitempty"`
5596}
5597
5598// GatewayCollection paged Gateway list representation.
5599type GatewayCollection struct {
5600	autorest.Response `json:"-"`
5601	// Value - READ-ONLY; Page values.
5602	Value *[]GatewayContract `json:"value,omitempty"`
5603	// Count - Total record count number across all pages.
5604	Count *int64 `json:"count,omitempty"`
5605	// NextLink - READ-ONLY; Next page link if any.
5606	NextLink *string `json:"nextLink,omitempty"`
5607}
5608
5609// MarshalJSON is the custom marshaler for GatewayCollection.
5610func (gc GatewayCollection) MarshalJSON() ([]byte, error) {
5611	objectMap := make(map[string]interface{})
5612	if gc.Count != nil {
5613		objectMap["count"] = gc.Count
5614	}
5615	return json.Marshal(objectMap)
5616}
5617
5618// GatewayCollectionIterator provides access to a complete listing of GatewayContract values.
5619type GatewayCollectionIterator struct {
5620	i    int
5621	page GatewayCollectionPage
5622}
5623
5624// NextWithContext advances to the next value.  If there was an error making
5625// the request the iterator does not advance and the error is returned.
5626func (iter *GatewayCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5627	if tracing.IsEnabled() {
5628		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionIterator.NextWithContext")
5629		defer func() {
5630			sc := -1
5631			if iter.Response().Response.Response != nil {
5632				sc = iter.Response().Response.Response.StatusCode
5633			}
5634			tracing.EndSpan(ctx, sc, err)
5635		}()
5636	}
5637	iter.i++
5638	if iter.i < len(iter.page.Values()) {
5639		return nil
5640	}
5641	err = iter.page.NextWithContext(ctx)
5642	if err != nil {
5643		iter.i--
5644		return err
5645	}
5646	iter.i = 0
5647	return nil
5648}
5649
5650// Next advances to the next value.  If there was an error making
5651// the request the iterator does not advance and the error is returned.
5652// Deprecated: Use NextWithContext() instead.
5653func (iter *GatewayCollectionIterator) Next() error {
5654	return iter.NextWithContext(context.Background())
5655}
5656
5657// NotDone returns true if the enumeration should be started or is not yet complete.
5658func (iter GatewayCollectionIterator) NotDone() bool {
5659	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5660}
5661
5662// Response returns the raw server response from the last page request.
5663func (iter GatewayCollectionIterator) Response() GatewayCollection {
5664	return iter.page.Response()
5665}
5666
5667// Value returns the current value or a zero-initialized value if the
5668// iterator has advanced beyond the end of the collection.
5669func (iter GatewayCollectionIterator) Value() GatewayContract {
5670	if !iter.page.NotDone() {
5671		return GatewayContract{}
5672	}
5673	return iter.page.Values()[iter.i]
5674}
5675
5676// Creates a new instance of the GatewayCollectionIterator type.
5677func NewGatewayCollectionIterator(page GatewayCollectionPage) GatewayCollectionIterator {
5678	return GatewayCollectionIterator{page: page}
5679}
5680
5681// IsEmpty returns true if the ListResult contains no values.
5682func (gc GatewayCollection) IsEmpty() bool {
5683	return gc.Value == nil || len(*gc.Value) == 0
5684}
5685
5686// hasNextLink returns true if the NextLink is not empty.
5687func (gc GatewayCollection) hasNextLink() bool {
5688	return gc.NextLink != nil && len(*gc.NextLink) != 0
5689}
5690
5691// gatewayCollectionPreparer prepares a request to retrieve the next set of results.
5692// It returns nil if no more results exist.
5693func (gc GatewayCollection) gatewayCollectionPreparer(ctx context.Context) (*http.Request, error) {
5694	if !gc.hasNextLink() {
5695		return nil, nil
5696	}
5697	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5698		autorest.AsJSON(),
5699		autorest.AsGet(),
5700		autorest.WithBaseURL(to.String(gc.NextLink)))
5701}
5702
5703// GatewayCollectionPage contains a page of GatewayContract values.
5704type GatewayCollectionPage struct {
5705	fn func(context.Context, GatewayCollection) (GatewayCollection, error)
5706	gc GatewayCollection
5707}
5708
5709// NextWithContext advances to the next page of values.  If there was an error making
5710// the request the page does not advance and the error is returned.
5711func (page *GatewayCollectionPage) NextWithContext(ctx context.Context) (err error) {
5712	if tracing.IsEnabled() {
5713		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionPage.NextWithContext")
5714		defer func() {
5715			sc := -1
5716			if page.Response().Response.Response != nil {
5717				sc = page.Response().Response.Response.StatusCode
5718			}
5719			tracing.EndSpan(ctx, sc, err)
5720		}()
5721	}
5722	for {
5723		next, err := page.fn(ctx, page.gc)
5724		if err != nil {
5725			return err
5726		}
5727		page.gc = next
5728		if !next.hasNextLink() || !next.IsEmpty() {
5729			break
5730		}
5731	}
5732	return nil
5733}
5734
5735// Next advances to the next page of values.  If there was an error making
5736// the request the page does not advance and the error is returned.
5737// Deprecated: Use NextWithContext() instead.
5738func (page *GatewayCollectionPage) Next() error {
5739	return page.NextWithContext(context.Background())
5740}
5741
5742// NotDone returns true if the page enumeration should be started or is not yet complete.
5743func (page GatewayCollectionPage) NotDone() bool {
5744	return !page.gc.IsEmpty()
5745}
5746
5747// Response returns the raw server response from the last page request.
5748func (page GatewayCollectionPage) Response() GatewayCollection {
5749	return page.gc
5750}
5751
5752// Values returns the slice of values for the current page or nil if there are no values.
5753func (page GatewayCollectionPage) Values() []GatewayContract {
5754	if page.gc.IsEmpty() {
5755		return nil
5756	}
5757	return *page.gc.Value
5758}
5759
5760// Creates a new instance of the GatewayCollectionPage type.
5761func NewGatewayCollectionPage(cur GatewayCollection, getNextPage func(context.Context, GatewayCollection) (GatewayCollection, error)) GatewayCollectionPage {
5762	return GatewayCollectionPage{
5763		fn: getNextPage,
5764		gc: cur,
5765	}
5766}
5767
5768// GatewayContract gateway details.
5769type GatewayContract struct {
5770	autorest.Response `json:"-"`
5771	// GatewayContractProperties - Gateway details.
5772	*GatewayContractProperties `json:"properties,omitempty"`
5773	// ID - READ-ONLY; Resource ID.
5774	ID *string `json:"id,omitempty"`
5775	// Name - READ-ONLY; Resource name.
5776	Name *string `json:"name,omitempty"`
5777	// Type - READ-ONLY; Resource type for API Management resource.
5778	Type *string `json:"type,omitempty"`
5779}
5780
5781// MarshalJSON is the custom marshaler for GatewayContract.
5782func (gc GatewayContract) MarshalJSON() ([]byte, error) {
5783	objectMap := make(map[string]interface{})
5784	if gc.GatewayContractProperties != nil {
5785		objectMap["properties"] = gc.GatewayContractProperties
5786	}
5787	return json.Marshal(objectMap)
5788}
5789
5790// UnmarshalJSON is the custom unmarshaler for GatewayContract struct.
5791func (gc *GatewayContract) UnmarshalJSON(body []byte) error {
5792	var m map[string]*json.RawMessage
5793	err := json.Unmarshal(body, &m)
5794	if err != nil {
5795		return err
5796	}
5797	for k, v := range m {
5798		switch k {
5799		case "properties":
5800			if v != nil {
5801				var gatewayContractProperties GatewayContractProperties
5802				err = json.Unmarshal(*v, &gatewayContractProperties)
5803				if err != nil {
5804					return err
5805				}
5806				gc.GatewayContractProperties = &gatewayContractProperties
5807			}
5808		case "id":
5809			if v != nil {
5810				var ID string
5811				err = json.Unmarshal(*v, &ID)
5812				if err != nil {
5813					return err
5814				}
5815				gc.ID = &ID
5816			}
5817		case "name":
5818			if v != nil {
5819				var name string
5820				err = json.Unmarshal(*v, &name)
5821				if err != nil {
5822					return err
5823				}
5824				gc.Name = &name
5825			}
5826		case "type":
5827			if v != nil {
5828				var typeVar string
5829				err = json.Unmarshal(*v, &typeVar)
5830				if err != nil {
5831					return err
5832				}
5833				gc.Type = &typeVar
5834			}
5835		}
5836	}
5837
5838	return nil
5839}
5840
5841// GatewayContractProperties properties of the Gateway contract.
5842type GatewayContractProperties struct {
5843	// LocationData - Gateway location.
5844	LocationData *ResourceLocationDataContract `json:"locationData,omitempty"`
5845	// Description - Gateway description
5846	Description *string `json:"description,omitempty"`
5847}
5848
5849// GatewayHostnameConfigurationCollection paged Gateway hostname configuration list representation.
5850type GatewayHostnameConfigurationCollection struct {
5851	autorest.Response `json:"-"`
5852	// Value - READ-ONLY; Page values.
5853	Value *[]GatewayHostnameConfigurationContract `json:"value,omitempty"`
5854	// NextLink - READ-ONLY; Next page link if any.
5855	NextLink *string `json:"nextLink,omitempty"`
5856}
5857
5858// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationCollection.
5859func (ghcc GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error) {
5860	objectMap := make(map[string]interface{})
5861	return json.Marshal(objectMap)
5862}
5863
5864// GatewayHostnameConfigurationCollectionIterator provides access to a complete listing of
5865// GatewayHostnameConfigurationContract values.
5866type GatewayHostnameConfigurationCollectionIterator struct {
5867	i    int
5868	page GatewayHostnameConfigurationCollectionPage
5869}
5870
5871// NextWithContext advances to the next value.  If there was an error making
5872// the request the iterator does not advance and the error is returned.
5873func (iter *GatewayHostnameConfigurationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
5874	if tracing.IsEnabled() {
5875		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionIterator.NextWithContext")
5876		defer func() {
5877			sc := -1
5878			if iter.Response().Response.Response != nil {
5879				sc = iter.Response().Response.Response.StatusCode
5880			}
5881			tracing.EndSpan(ctx, sc, err)
5882		}()
5883	}
5884	iter.i++
5885	if iter.i < len(iter.page.Values()) {
5886		return nil
5887	}
5888	err = iter.page.NextWithContext(ctx)
5889	if err != nil {
5890		iter.i--
5891		return err
5892	}
5893	iter.i = 0
5894	return nil
5895}
5896
5897// Next advances to the next value.  If there was an error making
5898// the request the iterator does not advance and the error is returned.
5899// Deprecated: Use NextWithContext() instead.
5900func (iter *GatewayHostnameConfigurationCollectionIterator) Next() error {
5901	return iter.NextWithContext(context.Background())
5902}
5903
5904// NotDone returns true if the enumeration should be started or is not yet complete.
5905func (iter GatewayHostnameConfigurationCollectionIterator) NotDone() bool {
5906	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5907}
5908
5909// Response returns the raw server response from the last page request.
5910func (iter GatewayHostnameConfigurationCollectionIterator) Response() GatewayHostnameConfigurationCollection {
5911	return iter.page.Response()
5912}
5913
5914// Value returns the current value or a zero-initialized value if the
5915// iterator has advanced beyond the end of the collection.
5916func (iter GatewayHostnameConfigurationCollectionIterator) Value() GatewayHostnameConfigurationContract {
5917	if !iter.page.NotDone() {
5918		return GatewayHostnameConfigurationContract{}
5919	}
5920	return iter.page.Values()[iter.i]
5921}
5922
5923// Creates a new instance of the GatewayHostnameConfigurationCollectionIterator type.
5924func NewGatewayHostnameConfigurationCollectionIterator(page GatewayHostnameConfigurationCollectionPage) GatewayHostnameConfigurationCollectionIterator {
5925	return GatewayHostnameConfigurationCollectionIterator{page: page}
5926}
5927
5928// IsEmpty returns true if the ListResult contains no values.
5929func (ghcc GatewayHostnameConfigurationCollection) IsEmpty() bool {
5930	return ghcc.Value == nil || len(*ghcc.Value) == 0
5931}
5932
5933// hasNextLink returns true if the NextLink is not empty.
5934func (ghcc GatewayHostnameConfigurationCollection) hasNextLink() bool {
5935	return ghcc.NextLink != nil && len(*ghcc.NextLink) != 0
5936}
5937
5938// gatewayHostnameConfigurationCollectionPreparer prepares a request to retrieve the next set of results.
5939// It returns nil if no more results exist.
5940func (ghcc GatewayHostnameConfigurationCollection) gatewayHostnameConfigurationCollectionPreparer(ctx context.Context) (*http.Request, error) {
5941	if !ghcc.hasNextLink() {
5942		return nil, nil
5943	}
5944	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5945		autorest.AsJSON(),
5946		autorest.AsGet(),
5947		autorest.WithBaseURL(to.String(ghcc.NextLink)))
5948}
5949
5950// GatewayHostnameConfigurationCollectionPage contains a page of GatewayHostnameConfigurationContract
5951// values.
5952type GatewayHostnameConfigurationCollectionPage struct {
5953	fn   func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)
5954	ghcc GatewayHostnameConfigurationCollection
5955}
5956
5957// NextWithContext advances to the next page of values.  If there was an error making
5958// the request the page does not advance and the error is returned.
5959func (page *GatewayHostnameConfigurationCollectionPage) NextWithContext(ctx context.Context) (err error) {
5960	if tracing.IsEnabled() {
5961		ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionPage.NextWithContext")
5962		defer func() {
5963			sc := -1
5964			if page.Response().Response.Response != nil {
5965				sc = page.Response().Response.Response.StatusCode
5966			}
5967			tracing.EndSpan(ctx, sc, err)
5968		}()
5969	}
5970	for {
5971		next, err := page.fn(ctx, page.ghcc)
5972		if err != nil {
5973			return err
5974		}
5975		page.ghcc = next
5976		if !next.hasNextLink() || !next.IsEmpty() {
5977			break
5978		}
5979	}
5980	return nil
5981}
5982
5983// Next advances to the next page of values.  If there was an error making
5984// the request the page does not advance and the error is returned.
5985// Deprecated: Use NextWithContext() instead.
5986func (page *GatewayHostnameConfigurationCollectionPage) Next() error {
5987	return page.NextWithContext(context.Background())
5988}
5989
5990// NotDone returns true if the page enumeration should be started or is not yet complete.
5991func (page GatewayHostnameConfigurationCollectionPage) NotDone() bool {
5992	return !page.ghcc.IsEmpty()
5993}
5994
5995// Response returns the raw server response from the last page request.
5996func (page GatewayHostnameConfigurationCollectionPage) Response() GatewayHostnameConfigurationCollection {
5997	return page.ghcc
5998}
5999
6000// Values returns the slice of values for the current page or nil if there are no values.
6001func (page GatewayHostnameConfigurationCollectionPage) Values() []GatewayHostnameConfigurationContract {
6002	if page.ghcc.IsEmpty() {
6003		return nil
6004	}
6005	return *page.ghcc.Value
6006}
6007
6008// Creates a new instance of the GatewayHostnameConfigurationCollectionPage type.
6009func NewGatewayHostnameConfigurationCollectionPage(cur GatewayHostnameConfigurationCollection, getNextPage func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)) GatewayHostnameConfigurationCollectionPage {
6010	return GatewayHostnameConfigurationCollectionPage{
6011		fn:   getNextPage,
6012		ghcc: cur,
6013	}
6014}
6015
6016// GatewayHostnameConfigurationContract gateway hostname configuration details.
6017type GatewayHostnameConfigurationContract struct {
6018	autorest.Response `json:"-"`
6019	// GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details.
6020	*GatewayHostnameConfigurationContractProperties `json:"properties,omitempty"`
6021	// ID - READ-ONLY; Resource ID.
6022	ID *string `json:"id,omitempty"`
6023	// Name - READ-ONLY; Resource name.
6024	Name *string `json:"name,omitempty"`
6025	// Type - READ-ONLY; Resource type for API Management resource.
6026	Type *string `json:"type,omitempty"`
6027}
6028
6029// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationContract.
6030func (ghcc GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) {
6031	objectMap := make(map[string]interface{})
6032	if ghcc.GatewayHostnameConfigurationContractProperties != nil {
6033		objectMap["properties"] = ghcc.GatewayHostnameConfigurationContractProperties
6034	}
6035	return json.Marshal(objectMap)
6036}
6037
6038// UnmarshalJSON is the custom unmarshaler for GatewayHostnameConfigurationContract struct.
6039func (ghcc *GatewayHostnameConfigurationContract) UnmarshalJSON(body []byte) error {
6040	var m map[string]*json.RawMessage
6041	err := json.Unmarshal(body, &m)
6042	if err != nil {
6043		return err
6044	}
6045	for k, v := range m {
6046		switch k {
6047		case "properties":
6048			if v != nil {
6049				var gatewayHostnameConfigurationContractProperties GatewayHostnameConfigurationContractProperties
6050				err = json.Unmarshal(*v, &gatewayHostnameConfigurationContractProperties)
6051				if err != nil {
6052					return err
6053				}
6054				ghcc.GatewayHostnameConfigurationContractProperties = &gatewayHostnameConfigurationContractProperties
6055			}
6056		case "id":
6057			if v != nil {
6058				var ID string
6059				err = json.Unmarshal(*v, &ID)
6060				if err != nil {
6061					return err
6062				}
6063				ghcc.ID = &ID
6064			}
6065		case "name":
6066			if v != nil {
6067				var name string
6068				err = json.Unmarshal(*v, &name)
6069				if err != nil {
6070					return err
6071				}
6072				ghcc.Name = &name
6073			}
6074		case "type":
6075			if v != nil {
6076				var typeVar string
6077				err = json.Unmarshal(*v, &typeVar)
6078				if err != nil {
6079					return err
6080				}
6081				ghcc.Type = &typeVar
6082			}
6083		}
6084	}
6085
6086	return nil
6087}
6088
6089// GatewayHostnameConfigurationContractProperties gateway hostname configuration details.
6090type GatewayHostnameConfigurationContractProperties struct {
6091	// Hostname - Hostname value. Supports valid domain name, partial or full wildcard
6092	Hostname *string `json:"hostname,omitempty"`
6093	// CertificateID - Identifier of Certificate entity that will be used for TLS connection establishment
6094	CertificateID *string `json:"certificateId,omitempty"`
6095	// NegotiateClientCertificate - Determines whether gateway requests client certificate
6096	NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"`
6097	// TLS10Enabled - Specifies if TLS 1.0 is supported
6098	TLS10Enabled *bool `json:"tls10Enabled,omitempty"`
6099	// TLS11Enabled - Specifies if TLS 1.1 is supported
6100	TLS11Enabled *bool `json:"tls11Enabled,omitempty"`
6101	// HTTP2Enabled - Specifies if HTTP/2.0 is supported
6102	HTTP2Enabled *bool `json:"http2Enabled,omitempty"`
6103}
6104
6105// GatewayKeyRegenerationRequestContract gateway key regeneration request contract properties.
6106type GatewayKeyRegenerationRequestContract struct {
6107	// KeyType - The Key being regenerated. Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary'
6108	KeyType KeyType `json:"keyType,omitempty"`
6109}
6110
6111// GatewayKeysContract gateway authentication keys.
6112type GatewayKeysContract struct {
6113	autorest.Response `json:"-"`
6114	// Primary - Primary gateway key.
6115	Primary *string `json:"primary,omitempty"`
6116	// Secondary - Secondary gateway key.
6117	Secondary *string `json:"secondary,omitempty"`
6118}
6119
6120// GatewayTokenContract gateway access token.
6121type GatewayTokenContract struct {
6122	autorest.Response `json:"-"`
6123	// Value - Shared Access Authentication token value for the Gateway.
6124	Value *string `json:"value,omitempty"`
6125}
6126
6127// GatewayTokenRequestContract gateway token request contract properties.
6128type GatewayTokenRequestContract struct {
6129	// KeyType - The Key to be used to generate gateway token. Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary'
6130	KeyType KeyType `json:"keyType,omitempty"`
6131	// 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.
6132	Expiry *date.Time `json:"expiry,omitempty"`
6133}
6134
6135// GenerateSsoURLResult generate SSO Url operations response details.
6136type GenerateSsoURLResult struct {
6137	autorest.Response `json:"-"`
6138	// Value - Redirect Url containing the SSO URL value.
6139	Value *string `json:"value,omitempty"`
6140}
6141
6142// GroupCollection paged Group list representation.
6143type GroupCollection struct {
6144	autorest.Response `json:"-"`
6145	// Value - Page values.
6146	Value *[]GroupContract `json:"value,omitempty"`
6147	// Count - Total record count number across all pages.
6148	Count *int64 `json:"count,omitempty"`
6149	// NextLink - Next page link if any.
6150	NextLink *string `json:"nextLink,omitempty"`
6151}
6152
6153// GroupCollectionIterator provides access to a complete listing of GroupContract values.
6154type GroupCollectionIterator struct {
6155	i    int
6156	page GroupCollectionPage
6157}
6158
6159// NextWithContext advances to the next value.  If there was an error making
6160// the request the iterator does not advance and the error is returned.
6161func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) {
6162	if tracing.IsEnabled() {
6163		ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext")
6164		defer func() {
6165			sc := -1
6166			if iter.Response().Response.Response != nil {
6167				sc = iter.Response().Response.Response.StatusCode
6168			}
6169			tracing.EndSpan(ctx, sc, err)
6170		}()
6171	}
6172	iter.i++
6173	if iter.i < len(iter.page.Values()) {
6174		return nil
6175	}
6176	err = iter.page.NextWithContext(ctx)
6177	if err != nil {
6178		iter.i--
6179		return err
6180	}
6181	iter.i = 0
6182	return nil
6183}
6184
6185// Next advances to the next value.  If there was an error making
6186// the request the iterator does not advance and the error is returned.
6187// Deprecated: Use NextWithContext() instead.
6188func (iter *GroupCollectionIterator) Next() error {
6189	return iter.NextWithContext(context.Background())
6190}
6191
6192// NotDone returns true if the enumeration should be started or is not yet complete.
6193func (iter GroupCollectionIterator) NotDone() bool {
6194	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6195}
6196
6197// Response returns the raw server response from the last page request.
6198func (iter GroupCollectionIterator) Response() GroupCollection {
6199	return iter.page.Response()
6200}
6201
6202// Value returns the current value or a zero-initialized value if the
6203// iterator has advanced beyond the end of the collection.
6204func (iter GroupCollectionIterator) Value() GroupContract {
6205	if !iter.page.NotDone() {
6206		return GroupContract{}
6207	}
6208	return iter.page.Values()[iter.i]
6209}
6210
6211// Creates a new instance of the GroupCollectionIterator type.
6212func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator {
6213	return GroupCollectionIterator{page: page}
6214}
6215
6216// IsEmpty returns true if the ListResult contains no values.
6217func (gc GroupCollection) IsEmpty() bool {
6218	return gc.Value == nil || len(*gc.Value) == 0
6219}
6220
6221// hasNextLink returns true if the NextLink is not empty.
6222func (gc GroupCollection) hasNextLink() bool {
6223	return gc.NextLink != nil && len(*gc.NextLink) != 0
6224}
6225
6226// groupCollectionPreparer prepares a request to retrieve the next set of results.
6227// It returns nil if no more results exist.
6228func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) {
6229	if !gc.hasNextLink() {
6230		return nil, nil
6231	}
6232	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6233		autorest.AsJSON(),
6234		autorest.AsGet(),
6235		autorest.WithBaseURL(to.String(gc.NextLink)))
6236}
6237
6238// GroupCollectionPage contains a page of GroupContract values.
6239type GroupCollectionPage struct {
6240	fn func(context.Context, GroupCollection) (GroupCollection, error)
6241	gc GroupCollection
6242}
6243
6244// NextWithContext advances to the next page of values.  If there was an error making
6245// the request the page does not advance and the error is returned.
6246func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) {
6247	if tracing.IsEnabled() {
6248		ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext")
6249		defer func() {
6250			sc := -1
6251			if page.Response().Response.Response != nil {
6252				sc = page.Response().Response.Response.StatusCode
6253			}
6254			tracing.EndSpan(ctx, sc, err)
6255		}()
6256	}
6257	for {
6258		next, err := page.fn(ctx, page.gc)
6259		if err != nil {
6260			return err
6261		}
6262		page.gc = next
6263		if !next.hasNextLink() || !next.IsEmpty() {
6264			break
6265		}
6266	}
6267	return nil
6268}
6269
6270// Next advances to the next page of values.  If there was an error making
6271// the request the page does not advance and the error is returned.
6272// Deprecated: Use NextWithContext() instead.
6273func (page *GroupCollectionPage) Next() error {
6274	return page.NextWithContext(context.Background())
6275}
6276
6277// NotDone returns true if the page enumeration should be started or is not yet complete.
6278func (page GroupCollectionPage) NotDone() bool {
6279	return !page.gc.IsEmpty()
6280}
6281
6282// Response returns the raw server response from the last page request.
6283func (page GroupCollectionPage) Response() GroupCollection {
6284	return page.gc
6285}
6286
6287// Values returns the slice of values for the current page or nil if there are no values.
6288func (page GroupCollectionPage) Values() []GroupContract {
6289	if page.gc.IsEmpty() {
6290		return nil
6291	}
6292	return *page.gc.Value
6293}
6294
6295// Creates a new instance of the GroupCollectionPage type.
6296func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage {
6297	return GroupCollectionPage{
6298		fn: getNextPage,
6299		gc: cur,
6300	}
6301}
6302
6303// GroupContract contract details.
6304type GroupContract struct {
6305	autorest.Response `json:"-"`
6306	// GroupContractProperties - Group entity contract properties.
6307	*GroupContractProperties `json:"properties,omitempty"`
6308	// ID - READ-ONLY; Resource ID.
6309	ID *string `json:"id,omitempty"`
6310	// Name - READ-ONLY; Resource name.
6311	Name *string `json:"name,omitempty"`
6312	// Type - READ-ONLY; Resource type for API Management resource.
6313	Type *string `json:"type,omitempty"`
6314}
6315
6316// MarshalJSON is the custom marshaler for GroupContract.
6317func (gc GroupContract) MarshalJSON() ([]byte, error) {
6318	objectMap := make(map[string]interface{})
6319	if gc.GroupContractProperties != nil {
6320		objectMap["properties"] = gc.GroupContractProperties
6321	}
6322	return json.Marshal(objectMap)
6323}
6324
6325// UnmarshalJSON is the custom unmarshaler for GroupContract struct.
6326func (gc *GroupContract) UnmarshalJSON(body []byte) error {
6327	var m map[string]*json.RawMessage
6328	err := json.Unmarshal(body, &m)
6329	if err != nil {
6330		return err
6331	}
6332	for k, v := range m {
6333		switch k {
6334		case "properties":
6335			if v != nil {
6336				var groupContractProperties GroupContractProperties
6337				err = json.Unmarshal(*v, &groupContractProperties)
6338				if err != nil {
6339					return err
6340				}
6341				gc.GroupContractProperties = &groupContractProperties
6342			}
6343		case "id":
6344			if v != nil {
6345				var ID string
6346				err = json.Unmarshal(*v, &ID)
6347				if err != nil {
6348					return err
6349				}
6350				gc.ID = &ID
6351			}
6352		case "name":
6353			if v != nil {
6354				var name string
6355				err = json.Unmarshal(*v, &name)
6356				if err != nil {
6357					return err
6358				}
6359				gc.Name = &name
6360			}
6361		case "type":
6362			if v != nil {
6363				var typeVar string
6364				err = json.Unmarshal(*v, &typeVar)
6365				if err != nil {
6366					return err
6367				}
6368				gc.Type = &typeVar
6369			}
6370		}
6371	}
6372
6373	return nil
6374}
6375
6376// GroupContractProperties group contract Properties.
6377type GroupContractProperties struct {
6378	// DisplayName - Group name.
6379	DisplayName *string `json:"displayName,omitempty"`
6380	// Description - Group description. Can contain HTML formatting tags.
6381	Description *string `json:"description,omitempty"`
6382	// BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false.
6383	BuiltIn *bool `json:"builtIn,omitempty"`
6384	// Type - Group type. Possible values include: 'GroupTypeCustom', 'GroupTypeSystem', 'GroupTypeExternal'
6385	Type GroupType `json:"type,omitempty"`
6386	// 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.
6387	ExternalID *string `json:"externalId,omitempty"`
6388}
6389
6390// MarshalJSON is the custom marshaler for GroupContractProperties.
6391func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) {
6392	objectMap := make(map[string]interface{})
6393	if gcp.DisplayName != nil {
6394		objectMap["displayName"] = gcp.DisplayName
6395	}
6396	if gcp.Description != nil {
6397		objectMap["description"] = gcp.Description
6398	}
6399	if gcp.Type != "" {
6400		objectMap["type"] = gcp.Type
6401	}
6402	if gcp.ExternalID != nil {
6403		objectMap["externalId"] = gcp.ExternalID
6404	}
6405	return json.Marshal(objectMap)
6406}
6407
6408// GroupCreateParameters parameters supplied to the Create Group operation.
6409type GroupCreateParameters struct {
6410	// GroupCreateParametersProperties - Properties supplied to Create Group operation.
6411	*GroupCreateParametersProperties `json:"properties,omitempty"`
6412}
6413
6414// MarshalJSON is the custom marshaler for GroupCreateParameters.
6415func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) {
6416	objectMap := make(map[string]interface{})
6417	if gcp.GroupCreateParametersProperties != nil {
6418		objectMap["properties"] = gcp.GroupCreateParametersProperties
6419	}
6420	return json.Marshal(objectMap)
6421}
6422
6423// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct.
6424func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error {
6425	var m map[string]*json.RawMessage
6426	err := json.Unmarshal(body, &m)
6427	if err != nil {
6428		return err
6429	}
6430	for k, v := range m {
6431		switch k {
6432		case "properties":
6433			if v != nil {
6434				var groupCreateParametersProperties GroupCreateParametersProperties
6435				err = json.Unmarshal(*v, &groupCreateParametersProperties)
6436				if err != nil {
6437					return err
6438				}
6439				gcp.GroupCreateParametersProperties = &groupCreateParametersProperties
6440			}
6441		}
6442	}
6443
6444	return nil
6445}
6446
6447// GroupCreateParametersProperties parameters supplied to the Create Group operation.
6448type GroupCreateParametersProperties struct {
6449	// DisplayName - Group name.
6450	DisplayName *string `json:"displayName,omitempty"`
6451	// Description - Group description.
6452	Description *string `json:"description,omitempty"`
6453	// Type - Group type. Possible values include: 'GroupTypeCustom', 'GroupTypeSystem', 'GroupTypeExternal'
6454	Type GroupType `json:"type,omitempty"`
6455	// 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.
6456	ExternalID *string `json:"externalId,omitempty"`
6457}
6458
6459// GroupUpdateParameters parameters supplied to the Update Group operation.
6460type GroupUpdateParameters struct {
6461	// GroupUpdateParametersProperties - Group entity update contract properties.
6462	*GroupUpdateParametersProperties `json:"properties,omitempty"`
6463}
6464
6465// MarshalJSON is the custom marshaler for GroupUpdateParameters.
6466func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) {
6467	objectMap := make(map[string]interface{})
6468	if gup.GroupUpdateParametersProperties != nil {
6469		objectMap["properties"] = gup.GroupUpdateParametersProperties
6470	}
6471	return json.Marshal(objectMap)
6472}
6473
6474// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct.
6475func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error {
6476	var m map[string]*json.RawMessage
6477	err := json.Unmarshal(body, &m)
6478	if err != nil {
6479		return err
6480	}
6481	for k, v := range m {
6482		switch k {
6483		case "properties":
6484			if v != nil {
6485				var groupUpdateParametersProperties GroupUpdateParametersProperties
6486				err = json.Unmarshal(*v, &groupUpdateParametersProperties)
6487				if err != nil {
6488					return err
6489				}
6490				gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties
6491			}
6492		}
6493	}
6494
6495	return nil
6496}
6497
6498// GroupUpdateParametersProperties parameters supplied to the Update Group operation.
6499type GroupUpdateParametersProperties struct {
6500	// DisplayName - Group name.
6501	DisplayName *string `json:"displayName,omitempty"`
6502	// Description - Group description.
6503	Description *string `json:"description,omitempty"`
6504	// Type - Group type. Possible values include: 'GroupTypeCustom', 'GroupTypeSystem', 'GroupTypeExternal'
6505	Type GroupType `json:"type,omitempty"`
6506	// 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.
6507	ExternalID *string `json:"externalId,omitempty"`
6508}
6509
6510// HostnameConfiguration custom hostname configuration.
6511type HostnameConfiguration struct {
6512	// Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal'
6513	Type HostnameType `json:"type,omitempty"`
6514	// HostName - Hostname to configure on the Api Management service.
6515	HostName *string `json:"hostName,omitempty"`
6516	// 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 aka.ms/apimmsi. The secret should be of type *application/x-pkcs12*
6517	KeyVaultID *string `json:"keyVaultId,omitempty"`
6518	// IdentityClientID - System or User Assigned Managed identity clientId as generated by Azure AD, which has GET access to the keyVault containing the SSL certificate.
6519	IdentityClientID *string `json:"identityClientId,omitempty"`
6520	// EncodedCertificate - Base64 Encoded certificate.
6521	EncodedCertificate *string `json:"encodedCertificate,omitempty"`
6522	// CertificatePassword - Certificate Password.
6523	CertificatePassword *string `json:"certificatePassword,omitempty"`
6524	// 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.
6525	DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"`
6526	// NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false.
6527	NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"`
6528	// Certificate - Certificate information.
6529	Certificate *CertificateInformation `json:"certificate,omitempty"`
6530	// CertificateSource - Certificate Source. Possible values include: 'CertificateSourceManaged', 'CertificateSourceKeyVault', 'CertificateSourceCustom', 'CertificateSourceBuiltIn'
6531	CertificateSource CertificateSource `json:"certificateSource,omitempty"`
6532	// CertificateStatus - Certificate Status. Possible values include: 'CertificateStatusCompleted', 'CertificateStatusFailed', 'CertificateStatusInProgress'
6533	CertificateStatus CertificateStatus `json:"certificateStatus,omitempty"`
6534}
6535
6536// HTTPMessageDiagnostic http message diagnostic settings.
6537type HTTPMessageDiagnostic struct {
6538	// Headers - Array of HTTP Headers to log.
6539	Headers *[]string `json:"headers,omitempty"`
6540	// Body - Body logging settings.
6541	Body *BodyDiagnosticSettings `json:"body,omitempty"`
6542	// DataMasking - Data masking settings.
6543	DataMasking *DataMasking `json:"dataMasking,omitempty"`
6544}
6545
6546// IdentityProviderBaseParameters identity Provider Base Parameter Properties.
6547type IdentityProviderBaseParameters struct {
6548	// Type - Identity Provider Type identifier. Possible values include: 'IdentityProviderTypeFacebook', 'IdentityProviderTypeGoogle', 'IdentityProviderTypeMicrosoft', 'IdentityProviderTypeTwitter', 'IdentityProviderTypeAad', 'IdentityProviderTypeAadB2C'
6549	Type IdentityProviderType `json:"type,omitempty"`
6550	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
6551	SigninTenant *string `json:"signinTenant,omitempty"`
6552	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
6553	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
6554	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
6555	Authority *string `json:"authority,omitempty"`
6556	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
6557	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
6558	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
6559	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
6560	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
6561	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
6562	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
6563	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
6564}
6565
6566// IdentityProviderContract identity Provider details.
6567type IdentityProviderContract struct {
6568	autorest.Response `json:"-"`
6569	// IdentityProviderContractProperties - Identity Provider contract properties.
6570	*IdentityProviderContractProperties `json:"properties,omitempty"`
6571	// ID - READ-ONLY; Resource ID.
6572	ID *string `json:"id,omitempty"`
6573	// Name - READ-ONLY; Resource name.
6574	Name *string `json:"name,omitempty"`
6575	// Type - READ-ONLY; Resource type for API Management resource.
6576	Type *string `json:"type,omitempty"`
6577}
6578
6579// MarshalJSON is the custom marshaler for IdentityProviderContract.
6580func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) {
6581	objectMap := make(map[string]interface{})
6582	if ipc.IdentityProviderContractProperties != nil {
6583		objectMap["properties"] = ipc.IdentityProviderContractProperties
6584	}
6585	return json.Marshal(objectMap)
6586}
6587
6588// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct.
6589func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error {
6590	var m map[string]*json.RawMessage
6591	err := json.Unmarshal(body, &m)
6592	if err != nil {
6593		return err
6594	}
6595	for k, v := range m {
6596		switch k {
6597		case "properties":
6598			if v != nil {
6599				var identityProviderContractProperties IdentityProviderContractProperties
6600				err = json.Unmarshal(*v, &identityProviderContractProperties)
6601				if err != nil {
6602					return err
6603				}
6604				ipc.IdentityProviderContractProperties = &identityProviderContractProperties
6605			}
6606		case "id":
6607			if v != nil {
6608				var ID string
6609				err = json.Unmarshal(*v, &ID)
6610				if err != nil {
6611					return err
6612				}
6613				ipc.ID = &ID
6614			}
6615		case "name":
6616			if v != nil {
6617				var name string
6618				err = json.Unmarshal(*v, &name)
6619				if err != nil {
6620					return err
6621				}
6622				ipc.Name = &name
6623			}
6624		case "type":
6625			if v != nil {
6626				var typeVar string
6627				err = json.Unmarshal(*v, &typeVar)
6628				if err != nil {
6629					return err
6630				}
6631				ipc.Type = &typeVar
6632			}
6633		}
6634	}
6635
6636	return nil
6637}
6638
6639// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft,
6640// Twitter or Azure Active Directory which can be used to enable access to the API Management service
6641// developer portal for all users.
6642type IdentityProviderContractProperties struct {
6643	// 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.
6644	ClientID *string `json:"clientId,omitempty"`
6645	// 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.
6646	ClientSecret *string `json:"clientSecret,omitempty"`
6647	// Type - Identity Provider Type identifier. Possible values include: 'IdentityProviderTypeFacebook', 'IdentityProviderTypeGoogle', 'IdentityProviderTypeMicrosoft', 'IdentityProviderTypeTwitter', 'IdentityProviderTypeAad', 'IdentityProviderTypeAadB2C'
6648	Type IdentityProviderType `json:"type,omitempty"`
6649	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
6650	SigninTenant *string `json:"signinTenant,omitempty"`
6651	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
6652	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
6653	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
6654	Authority *string `json:"authority,omitempty"`
6655	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
6656	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
6657	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
6658	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
6659	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
6660	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
6661	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
6662	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
6663}
6664
6665// IdentityProviderCreateContract identity Provider details.
6666type IdentityProviderCreateContract struct {
6667	// IdentityProviderCreateContractProperties - Identity Provider contract properties.
6668	*IdentityProviderCreateContractProperties `json:"properties,omitempty"`
6669	// ID - READ-ONLY; Resource ID.
6670	ID *string `json:"id,omitempty"`
6671	// Name - READ-ONLY; Resource name.
6672	Name *string `json:"name,omitempty"`
6673	// Type - READ-ONLY; Resource type for API Management resource.
6674	Type *string `json:"type,omitempty"`
6675}
6676
6677// MarshalJSON is the custom marshaler for IdentityProviderCreateContract.
6678func (ipcc IdentityProviderCreateContract) MarshalJSON() ([]byte, error) {
6679	objectMap := make(map[string]interface{})
6680	if ipcc.IdentityProviderCreateContractProperties != nil {
6681		objectMap["properties"] = ipcc.IdentityProviderCreateContractProperties
6682	}
6683	return json.Marshal(objectMap)
6684}
6685
6686// UnmarshalJSON is the custom unmarshaler for IdentityProviderCreateContract struct.
6687func (ipcc *IdentityProviderCreateContract) UnmarshalJSON(body []byte) error {
6688	var m map[string]*json.RawMessage
6689	err := json.Unmarshal(body, &m)
6690	if err != nil {
6691		return err
6692	}
6693	for k, v := range m {
6694		switch k {
6695		case "properties":
6696			if v != nil {
6697				var identityProviderCreateContractProperties IdentityProviderCreateContractProperties
6698				err = json.Unmarshal(*v, &identityProviderCreateContractProperties)
6699				if err != nil {
6700					return err
6701				}
6702				ipcc.IdentityProviderCreateContractProperties = &identityProviderCreateContractProperties
6703			}
6704		case "id":
6705			if v != nil {
6706				var ID string
6707				err = json.Unmarshal(*v, &ID)
6708				if err != nil {
6709					return err
6710				}
6711				ipcc.ID = &ID
6712			}
6713		case "name":
6714			if v != nil {
6715				var name string
6716				err = json.Unmarshal(*v, &name)
6717				if err != nil {
6718					return err
6719				}
6720				ipcc.Name = &name
6721			}
6722		case "type":
6723			if v != nil {
6724				var typeVar string
6725				err = json.Unmarshal(*v, &typeVar)
6726				if err != nil {
6727					return err
6728				}
6729				ipcc.Type = &typeVar
6730			}
6731		}
6732	}
6733
6734	return nil
6735}
6736
6737// IdentityProviderCreateContractProperties the external Identity Providers like Facebook, Google,
6738// Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management
6739// service developer portal for all users.
6740type IdentityProviderCreateContractProperties struct {
6741	// 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.
6742	ClientID *string `json:"clientId,omitempty"`
6743	// 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.
6744	ClientSecret *string `json:"clientSecret,omitempty"`
6745	// Type - Identity Provider Type identifier. Possible values include: 'IdentityProviderTypeFacebook', 'IdentityProviderTypeGoogle', 'IdentityProviderTypeMicrosoft', 'IdentityProviderTypeTwitter', 'IdentityProviderTypeAad', 'IdentityProviderTypeAadB2C'
6746	Type IdentityProviderType `json:"type,omitempty"`
6747	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
6748	SigninTenant *string `json:"signinTenant,omitempty"`
6749	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
6750	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
6751	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
6752	Authority *string `json:"authority,omitempty"`
6753	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
6754	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
6755	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
6756	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
6757	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
6758	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
6759	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
6760	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
6761}
6762
6763// IdentityProviderList list of all the Identity Providers configured on the service instance.
6764type IdentityProviderList struct {
6765	autorest.Response `json:"-"`
6766	// Value - Identity Provider configuration values.
6767	Value *[]IdentityProviderContract `json:"value,omitempty"`
6768	// Count - Total record count number across all pages.
6769	Count *int64 `json:"count,omitempty"`
6770	// NextLink - Next page link if any.
6771	NextLink *string `json:"nextLink,omitempty"`
6772}
6773
6774// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values.
6775type IdentityProviderListIterator struct {
6776	i    int
6777	page IdentityProviderListPage
6778}
6779
6780// NextWithContext advances to the next value.  If there was an error making
6781// the request the iterator does not advance and the error is returned.
6782func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) {
6783	if tracing.IsEnabled() {
6784		ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext")
6785		defer func() {
6786			sc := -1
6787			if iter.Response().Response.Response != nil {
6788				sc = iter.Response().Response.Response.StatusCode
6789			}
6790			tracing.EndSpan(ctx, sc, err)
6791		}()
6792	}
6793	iter.i++
6794	if iter.i < len(iter.page.Values()) {
6795		return nil
6796	}
6797	err = iter.page.NextWithContext(ctx)
6798	if err != nil {
6799		iter.i--
6800		return err
6801	}
6802	iter.i = 0
6803	return nil
6804}
6805
6806// Next advances to the next value.  If there was an error making
6807// the request the iterator does not advance and the error is returned.
6808// Deprecated: Use NextWithContext() instead.
6809func (iter *IdentityProviderListIterator) Next() error {
6810	return iter.NextWithContext(context.Background())
6811}
6812
6813// NotDone returns true if the enumeration should be started or is not yet complete.
6814func (iter IdentityProviderListIterator) NotDone() bool {
6815	return iter.page.NotDone() && iter.i < len(iter.page.Values())
6816}
6817
6818// Response returns the raw server response from the last page request.
6819func (iter IdentityProviderListIterator) Response() IdentityProviderList {
6820	return iter.page.Response()
6821}
6822
6823// Value returns the current value or a zero-initialized value if the
6824// iterator has advanced beyond the end of the collection.
6825func (iter IdentityProviderListIterator) Value() IdentityProviderContract {
6826	if !iter.page.NotDone() {
6827		return IdentityProviderContract{}
6828	}
6829	return iter.page.Values()[iter.i]
6830}
6831
6832// Creates a new instance of the IdentityProviderListIterator type.
6833func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator {
6834	return IdentityProviderListIterator{page: page}
6835}
6836
6837// IsEmpty returns true if the ListResult contains no values.
6838func (ipl IdentityProviderList) IsEmpty() bool {
6839	return ipl.Value == nil || len(*ipl.Value) == 0
6840}
6841
6842// hasNextLink returns true if the NextLink is not empty.
6843func (ipl IdentityProviderList) hasNextLink() bool {
6844	return ipl.NextLink != nil && len(*ipl.NextLink) != 0
6845}
6846
6847// identityProviderListPreparer prepares a request to retrieve the next set of results.
6848// It returns nil if no more results exist.
6849func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) {
6850	if !ipl.hasNextLink() {
6851		return nil, nil
6852	}
6853	return autorest.Prepare((&http.Request{}).WithContext(ctx),
6854		autorest.AsJSON(),
6855		autorest.AsGet(),
6856		autorest.WithBaseURL(to.String(ipl.NextLink)))
6857}
6858
6859// IdentityProviderListPage contains a page of IdentityProviderContract values.
6860type IdentityProviderListPage struct {
6861	fn  func(context.Context, IdentityProviderList) (IdentityProviderList, error)
6862	ipl IdentityProviderList
6863}
6864
6865// NextWithContext advances to the next page of values.  If there was an error making
6866// the request the page does not advance and the error is returned.
6867func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) {
6868	if tracing.IsEnabled() {
6869		ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext")
6870		defer func() {
6871			sc := -1
6872			if page.Response().Response.Response != nil {
6873				sc = page.Response().Response.Response.StatusCode
6874			}
6875			tracing.EndSpan(ctx, sc, err)
6876		}()
6877	}
6878	for {
6879		next, err := page.fn(ctx, page.ipl)
6880		if err != nil {
6881			return err
6882		}
6883		page.ipl = next
6884		if !next.hasNextLink() || !next.IsEmpty() {
6885			break
6886		}
6887	}
6888	return nil
6889}
6890
6891// Next advances to the next page of values.  If there was an error making
6892// the request the page does not advance and the error is returned.
6893// Deprecated: Use NextWithContext() instead.
6894func (page *IdentityProviderListPage) Next() error {
6895	return page.NextWithContext(context.Background())
6896}
6897
6898// NotDone returns true if the page enumeration should be started or is not yet complete.
6899func (page IdentityProviderListPage) NotDone() bool {
6900	return !page.ipl.IsEmpty()
6901}
6902
6903// Response returns the raw server response from the last page request.
6904func (page IdentityProviderListPage) Response() IdentityProviderList {
6905	return page.ipl
6906}
6907
6908// Values returns the slice of values for the current page or nil if there are no values.
6909func (page IdentityProviderListPage) Values() []IdentityProviderContract {
6910	if page.ipl.IsEmpty() {
6911		return nil
6912	}
6913	return *page.ipl.Value
6914}
6915
6916// Creates a new instance of the IdentityProviderListPage type.
6917func NewIdentityProviderListPage(cur IdentityProviderList, getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage {
6918	return IdentityProviderListPage{
6919		fn:  getNextPage,
6920		ipl: cur,
6921	}
6922}
6923
6924// IdentityProviderUpdateParameters parameters supplied to update Identity Provider
6925type IdentityProviderUpdateParameters struct {
6926	// IdentityProviderUpdateProperties - Identity Provider update properties.
6927	*IdentityProviderUpdateProperties `json:"properties,omitempty"`
6928}
6929
6930// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters.
6931func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) {
6932	objectMap := make(map[string]interface{})
6933	if ipup.IdentityProviderUpdateProperties != nil {
6934		objectMap["properties"] = ipup.IdentityProviderUpdateProperties
6935	}
6936	return json.Marshal(objectMap)
6937}
6938
6939// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct.
6940func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error {
6941	var m map[string]*json.RawMessage
6942	err := json.Unmarshal(body, &m)
6943	if err != nil {
6944		return err
6945	}
6946	for k, v := range m {
6947		switch k {
6948		case "properties":
6949			if v != nil {
6950				var identityProviderUpdateProperties IdentityProviderUpdateProperties
6951				err = json.Unmarshal(*v, &identityProviderUpdateProperties)
6952				if err != nil {
6953					return err
6954				}
6955				ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties
6956			}
6957		}
6958	}
6959
6960	return nil
6961}
6962
6963// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation.
6964type IdentityProviderUpdateProperties struct {
6965	// 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.
6966	ClientID *string `json:"clientId,omitempty"`
6967	// 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.
6968	ClientSecret *string `json:"clientSecret,omitempty"`
6969	// Type - Identity Provider Type identifier. Possible values include: 'IdentityProviderTypeFacebook', 'IdentityProviderTypeGoogle', 'IdentityProviderTypeMicrosoft', 'IdentityProviderTypeTwitter', 'IdentityProviderTypeAad', 'IdentityProviderTypeAadB2C'
6970	Type IdentityProviderType `json:"type,omitempty"`
6971	// SigninTenant - The TenantId to use instead of Common when logging into Active Directory
6972	SigninTenant *string `json:"signinTenant,omitempty"`
6973	// AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login.
6974	AllowedTenants *[]string `json:"allowedTenants,omitempty"`
6975	// Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C.
6976	Authority *string `json:"authority,omitempty"`
6977	// SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider.
6978	SignupPolicyName *string `json:"signupPolicyName,omitempty"`
6979	// SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider.
6980	SigninPolicyName *string `json:"signinPolicyName,omitempty"`
6981	// ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider.
6982	ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"`
6983	// PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider.
6984	PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"`
6985}
6986
6987// IssueAttachmentCollection paged Issue Attachment list representation.
6988type IssueAttachmentCollection struct {
6989	autorest.Response `json:"-"`
6990	// Value - READ-ONLY; Issue Attachment values.
6991	Value *[]IssueAttachmentContract `json:"value,omitempty"`
6992	// Count - Total record count number across all pages.
6993	Count *int64 `json:"count,omitempty"`
6994	// NextLink - READ-ONLY; Next page link if any.
6995	NextLink *string `json:"nextLink,omitempty"`
6996}
6997
6998// MarshalJSON is the custom marshaler for IssueAttachmentCollection.
6999func (iac IssueAttachmentCollection) MarshalJSON() ([]byte, error) {
7000	objectMap := make(map[string]interface{})
7001	if iac.Count != nil {
7002		objectMap["count"] = iac.Count
7003	}
7004	return json.Marshal(objectMap)
7005}
7006
7007// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract
7008// values.
7009type IssueAttachmentCollectionIterator struct {
7010	i    int
7011	page IssueAttachmentCollectionPage
7012}
7013
7014// NextWithContext advances to the next value.  If there was an error making
7015// the request the iterator does not advance and the error is returned.
7016func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7017	if tracing.IsEnabled() {
7018		ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext")
7019		defer func() {
7020			sc := -1
7021			if iter.Response().Response.Response != nil {
7022				sc = iter.Response().Response.Response.StatusCode
7023			}
7024			tracing.EndSpan(ctx, sc, err)
7025		}()
7026	}
7027	iter.i++
7028	if iter.i < len(iter.page.Values()) {
7029		return nil
7030	}
7031	err = iter.page.NextWithContext(ctx)
7032	if err != nil {
7033		iter.i--
7034		return err
7035	}
7036	iter.i = 0
7037	return nil
7038}
7039
7040// Next advances to the next value.  If there was an error making
7041// the request the iterator does not advance and the error is returned.
7042// Deprecated: Use NextWithContext() instead.
7043func (iter *IssueAttachmentCollectionIterator) Next() error {
7044	return iter.NextWithContext(context.Background())
7045}
7046
7047// NotDone returns true if the enumeration should be started or is not yet complete.
7048func (iter IssueAttachmentCollectionIterator) NotDone() bool {
7049	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7050}
7051
7052// Response returns the raw server response from the last page request.
7053func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection {
7054	return iter.page.Response()
7055}
7056
7057// Value returns the current value or a zero-initialized value if the
7058// iterator has advanced beyond the end of the collection.
7059func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract {
7060	if !iter.page.NotDone() {
7061		return IssueAttachmentContract{}
7062	}
7063	return iter.page.Values()[iter.i]
7064}
7065
7066// Creates a new instance of the IssueAttachmentCollectionIterator type.
7067func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator {
7068	return IssueAttachmentCollectionIterator{page: page}
7069}
7070
7071// IsEmpty returns true if the ListResult contains no values.
7072func (iac IssueAttachmentCollection) IsEmpty() bool {
7073	return iac.Value == nil || len(*iac.Value) == 0
7074}
7075
7076// hasNextLink returns true if the NextLink is not empty.
7077func (iac IssueAttachmentCollection) hasNextLink() bool {
7078	return iac.NextLink != nil && len(*iac.NextLink) != 0
7079}
7080
7081// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results.
7082// It returns nil if no more results exist.
7083func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) {
7084	if !iac.hasNextLink() {
7085		return nil, nil
7086	}
7087	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7088		autorest.AsJSON(),
7089		autorest.AsGet(),
7090		autorest.WithBaseURL(to.String(iac.NextLink)))
7091}
7092
7093// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values.
7094type IssueAttachmentCollectionPage struct {
7095	fn  func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)
7096	iac IssueAttachmentCollection
7097}
7098
7099// NextWithContext advances to the next page of values.  If there was an error making
7100// the request the page does not advance and the error is returned.
7101func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) {
7102	if tracing.IsEnabled() {
7103		ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext")
7104		defer func() {
7105			sc := -1
7106			if page.Response().Response.Response != nil {
7107				sc = page.Response().Response.Response.StatusCode
7108			}
7109			tracing.EndSpan(ctx, sc, err)
7110		}()
7111	}
7112	for {
7113		next, err := page.fn(ctx, page.iac)
7114		if err != nil {
7115			return err
7116		}
7117		page.iac = next
7118		if !next.hasNextLink() || !next.IsEmpty() {
7119			break
7120		}
7121	}
7122	return nil
7123}
7124
7125// Next advances to the next page of values.  If there was an error making
7126// the request the page does not advance and the error is returned.
7127// Deprecated: Use NextWithContext() instead.
7128func (page *IssueAttachmentCollectionPage) Next() error {
7129	return page.NextWithContext(context.Background())
7130}
7131
7132// NotDone returns true if the page enumeration should be started or is not yet complete.
7133func (page IssueAttachmentCollectionPage) NotDone() bool {
7134	return !page.iac.IsEmpty()
7135}
7136
7137// Response returns the raw server response from the last page request.
7138func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection {
7139	return page.iac
7140}
7141
7142// Values returns the slice of values for the current page or nil if there are no values.
7143func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract {
7144	if page.iac.IsEmpty() {
7145		return nil
7146	}
7147	return *page.iac.Value
7148}
7149
7150// Creates a new instance of the IssueAttachmentCollectionPage type.
7151func NewIssueAttachmentCollectionPage(cur IssueAttachmentCollection, getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage {
7152	return IssueAttachmentCollectionPage{
7153		fn:  getNextPage,
7154		iac: cur,
7155	}
7156}
7157
7158// IssueAttachmentContract issue Attachment Contract details.
7159type IssueAttachmentContract struct {
7160	autorest.Response `json:"-"`
7161	// IssueAttachmentContractProperties - Properties of the Issue Attachment.
7162	*IssueAttachmentContractProperties `json:"properties,omitempty"`
7163	// ID - READ-ONLY; Resource ID.
7164	ID *string `json:"id,omitempty"`
7165	// Name - READ-ONLY; Resource name.
7166	Name *string `json:"name,omitempty"`
7167	// Type - READ-ONLY; Resource type for API Management resource.
7168	Type *string `json:"type,omitempty"`
7169}
7170
7171// MarshalJSON is the custom marshaler for IssueAttachmentContract.
7172func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) {
7173	objectMap := make(map[string]interface{})
7174	if iac.IssueAttachmentContractProperties != nil {
7175		objectMap["properties"] = iac.IssueAttachmentContractProperties
7176	}
7177	return json.Marshal(objectMap)
7178}
7179
7180// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct.
7181func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error {
7182	var m map[string]*json.RawMessage
7183	err := json.Unmarshal(body, &m)
7184	if err != nil {
7185		return err
7186	}
7187	for k, v := range m {
7188		switch k {
7189		case "properties":
7190			if v != nil {
7191				var issueAttachmentContractProperties IssueAttachmentContractProperties
7192				err = json.Unmarshal(*v, &issueAttachmentContractProperties)
7193				if err != nil {
7194					return err
7195				}
7196				iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties
7197			}
7198		case "id":
7199			if v != nil {
7200				var ID string
7201				err = json.Unmarshal(*v, &ID)
7202				if err != nil {
7203					return err
7204				}
7205				iac.ID = &ID
7206			}
7207		case "name":
7208			if v != nil {
7209				var name string
7210				err = json.Unmarshal(*v, &name)
7211				if err != nil {
7212					return err
7213				}
7214				iac.Name = &name
7215			}
7216		case "type":
7217			if v != nil {
7218				var typeVar string
7219				err = json.Unmarshal(*v, &typeVar)
7220				if err != nil {
7221					return err
7222				}
7223				iac.Type = &typeVar
7224			}
7225		}
7226	}
7227
7228	return nil
7229}
7230
7231// IssueAttachmentContractProperties issue Attachment contract Properties.
7232type IssueAttachmentContractProperties struct {
7233	// Title - Filename by which the binary data will be saved.
7234	Title *string `json:"title,omitempty"`
7235	// 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.
7236	ContentFormat *string `json:"contentFormat,omitempty"`
7237	// Content - An HTTP link or Base64-encoded binary data.
7238	Content *string `json:"content,omitempty"`
7239}
7240
7241// IssueCollection paged Issue list representation.
7242type IssueCollection struct {
7243	autorest.Response `json:"-"`
7244	// Value - READ-ONLY; Issue values.
7245	Value *[]IssueContract `json:"value,omitempty"`
7246	// Count - Total record count number across all pages.
7247	Count *int64 `json:"count,omitempty"`
7248	// NextLink - READ-ONLY; Next page link if any.
7249	NextLink *string `json:"nextLink,omitempty"`
7250}
7251
7252// MarshalJSON is the custom marshaler for IssueCollection.
7253func (ic IssueCollection) MarshalJSON() ([]byte, error) {
7254	objectMap := make(map[string]interface{})
7255	if ic.Count != nil {
7256		objectMap["count"] = ic.Count
7257	}
7258	return json.Marshal(objectMap)
7259}
7260
7261// IssueCollectionIterator provides access to a complete listing of IssueContract values.
7262type IssueCollectionIterator struct {
7263	i    int
7264	page IssueCollectionPage
7265}
7266
7267// NextWithContext advances to the next value.  If there was an error making
7268// the request the iterator does not advance and the error is returned.
7269func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7270	if tracing.IsEnabled() {
7271		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext")
7272		defer func() {
7273			sc := -1
7274			if iter.Response().Response.Response != nil {
7275				sc = iter.Response().Response.Response.StatusCode
7276			}
7277			tracing.EndSpan(ctx, sc, err)
7278		}()
7279	}
7280	iter.i++
7281	if iter.i < len(iter.page.Values()) {
7282		return nil
7283	}
7284	err = iter.page.NextWithContext(ctx)
7285	if err != nil {
7286		iter.i--
7287		return err
7288	}
7289	iter.i = 0
7290	return nil
7291}
7292
7293// Next advances to the next value.  If there was an error making
7294// the request the iterator does not advance and the error is returned.
7295// Deprecated: Use NextWithContext() instead.
7296func (iter *IssueCollectionIterator) Next() error {
7297	return iter.NextWithContext(context.Background())
7298}
7299
7300// NotDone returns true if the enumeration should be started or is not yet complete.
7301func (iter IssueCollectionIterator) NotDone() bool {
7302	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7303}
7304
7305// Response returns the raw server response from the last page request.
7306func (iter IssueCollectionIterator) Response() IssueCollection {
7307	return iter.page.Response()
7308}
7309
7310// Value returns the current value or a zero-initialized value if the
7311// iterator has advanced beyond the end of the collection.
7312func (iter IssueCollectionIterator) Value() IssueContract {
7313	if !iter.page.NotDone() {
7314		return IssueContract{}
7315	}
7316	return iter.page.Values()[iter.i]
7317}
7318
7319// Creates a new instance of the IssueCollectionIterator type.
7320func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator {
7321	return IssueCollectionIterator{page: page}
7322}
7323
7324// IsEmpty returns true if the ListResult contains no values.
7325func (ic IssueCollection) IsEmpty() bool {
7326	return ic.Value == nil || len(*ic.Value) == 0
7327}
7328
7329// hasNextLink returns true if the NextLink is not empty.
7330func (ic IssueCollection) hasNextLink() bool {
7331	return ic.NextLink != nil && len(*ic.NextLink) != 0
7332}
7333
7334// issueCollectionPreparer prepares a request to retrieve the next set of results.
7335// It returns nil if no more results exist.
7336func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) {
7337	if !ic.hasNextLink() {
7338		return nil, nil
7339	}
7340	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7341		autorest.AsJSON(),
7342		autorest.AsGet(),
7343		autorest.WithBaseURL(to.String(ic.NextLink)))
7344}
7345
7346// IssueCollectionPage contains a page of IssueContract values.
7347type IssueCollectionPage struct {
7348	fn func(context.Context, IssueCollection) (IssueCollection, error)
7349	ic IssueCollection
7350}
7351
7352// NextWithContext advances to the next page of values.  If there was an error making
7353// the request the page does not advance and the error is returned.
7354func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) {
7355	if tracing.IsEnabled() {
7356		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext")
7357		defer func() {
7358			sc := -1
7359			if page.Response().Response.Response != nil {
7360				sc = page.Response().Response.Response.StatusCode
7361			}
7362			tracing.EndSpan(ctx, sc, err)
7363		}()
7364	}
7365	for {
7366		next, err := page.fn(ctx, page.ic)
7367		if err != nil {
7368			return err
7369		}
7370		page.ic = next
7371		if !next.hasNextLink() || !next.IsEmpty() {
7372			break
7373		}
7374	}
7375	return nil
7376}
7377
7378// Next advances to the next page of values.  If there was an error making
7379// the request the page does not advance and the error is returned.
7380// Deprecated: Use NextWithContext() instead.
7381func (page *IssueCollectionPage) Next() error {
7382	return page.NextWithContext(context.Background())
7383}
7384
7385// NotDone returns true if the page enumeration should be started or is not yet complete.
7386func (page IssueCollectionPage) NotDone() bool {
7387	return !page.ic.IsEmpty()
7388}
7389
7390// Response returns the raw server response from the last page request.
7391func (page IssueCollectionPage) Response() IssueCollection {
7392	return page.ic
7393}
7394
7395// Values returns the slice of values for the current page or nil if there are no values.
7396func (page IssueCollectionPage) Values() []IssueContract {
7397	if page.ic.IsEmpty() {
7398		return nil
7399	}
7400	return *page.ic.Value
7401}
7402
7403// Creates a new instance of the IssueCollectionPage type.
7404func NewIssueCollectionPage(cur IssueCollection, getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage {
7405	return IssueCollectionPage{
7406		fn: getNextPage,
7407		ic: cur,
7408	}
7409}
7410
7411// IssueCommentCollection paged Issue Comment list representation.
7412type IssueCommentCollection struct {
7413	autorest.Response `json:"-"`
7414	// Value - READ-ONLY; Issue Comment values.
7415	Value *[]IssueCommentContract `json:"value,omitempty"`
7416	// Count - Total record count number across all pages.
7417	Count *int64 `json:"count,omitempty"`
7418	// NextLink - READ-ONLY; Next page link if any.
7419	NextLink *string `json:"nextLink,omitempty"`
7420}
7421
7422// MarshalJSON is the custom marshaler for IssueCommentCollection.
7423func (icc IssueCommentCollection) MarshalJSON() ([]byte, error) {
7424	objectMap := make(map[string]interface{})
7425	if icc.Count != nil {
7426		objectMap["count"] = icc.Count
7427	}
7428	return json.Marshal(objectMap)
7429}
7430
7431// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values.
7432type IssueCommentCollectionIterator struct {
7433	i    int
7434	page IssueCommentCollectionPage
7435}
7436
7437// NextWithContext advances to the next value.  If there was an error making
7438// the request the iterator does not advance and the error is returned.
7439func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7440	if tracing.IsEnabled() {
7441		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext")
7442		defer func() {
7443			sc := -1
7444			if iter.Response().Response.Response != nil {
7445				sc = iter.Response().Response.Response.StatusCode
7446			}
7447			tracing.EndSpan(ctx, sc, err)
7448		}()
7449	}
7450	iter.i++
7451	if iter.i < len(iter.page.Values()) {
7452		return nil
7453	}
7454	err = iter.page.NextWithContext(ctx)
7455	if err != nil {
7456		iter.i--
7457		return err
7458	}
7459	iter.i = 0
7460	return nil
7461}
7462
7463// Next advances to the next value.  If there was an error making
7464// the request the iterator does not advance and the error is returned.
7465// Deprecated: Use NextWithContext() instead.
7466func (iter *IssueCommentCollectionIterator) Next() error {
7467	return iter.NextWithContext(context.Background())
7468}
7469
7470// NotDone returns true if the enumeration should be started or is not yet complete.
7471func (iter IssueCommentCollectionIterator) NotDone() bool {
7472	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7473}
7474
7475// Response returns the raw server response from the last page request.
7476func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection {
7477	return iter.page.Response()
7478}
7479
7480// Value returns the current value or a zero-initialized value if the
7481// iterator has advanced beyond the end of the collection.
7482func (iter IssueCommentCollectionIterator) Value() IssueCommentContract {
7483	if !iter.page.NotDone() {
7484		return IssueCommentContract{}
7485	}
7486	return iter.page.Values()[iter.i]
7487}
7488
7489// Creates a new instance of the IssueCommentCollectionIterator type.
7490func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator {
7491	return IssueCommentCollectionIterator{page: page}
7492}
7493
7494// IsEmpty returns true if the ListResult contains no values.
7495func (icc IssueCommentCollection) IsEmpty() bool {
7496	return icc.Value == nil || len(*icc.Value) == 0
7497}
7498
7499// hasNextLink returns true if the NextLink is not empty.
7500func (icc IssueCommentCollection) hasNextLink() bool {
7501	return icc.NextLink != nil && len(*icc.NextLink) != 0
7502}
7503
7504// issueCommentCollectionPreparer prepares a request to retrieve the next set of results.
7505// It returns nil if no more results exist.
7506func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) {
7507	if !icc.hasNextLink() {
7508		return nil, nil
7509	}
7510	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7511		autorest.AsJSON(),
7512		autorest.AsGet(),
7513		autorest.WithBaseURL(to.String(icc.NextLink)))
7514}
7515
7516// IssueCommentCollectionPage contains a page of IssueCommentContract values.
7517type IssueCommentCollectionPage struct {
7518	fn  func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)
7519	icc IssueCommentCollection
7520}
7521
7522// NextWithContext advances to the next page of values.  If there was an error making
7523// the request the page does not advance and the error is returned.
7524func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) {
7525	if tracing.IsEnabled() {
7526		ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext")
7527		defer func() {
7528			sc := -1
7529			if page.Response().Response.Response != nil {
7530				sc = page.Response().Response.Response.StatusCode
7531			}
7532			tracing.EndSpan(ctx, sc, err)
7533		}()
7534	}
7535	for {
7536		next, err := page.fn(ctx, page.icc)
7537		if err != nil {
7538			return err
7539		}
7540		page.icc = next
7541		if !next.hasNextLink() || !next.IsEmpty() {
7542			break
7543		}
7544	}
7545	return nil
7546}
7547
7548// Next advances to the next page of values.  If there was an error making
7549// the request the page does not advance and the error is returned.
7550// Deprecated: Use NextWithContext() instead.
7551func (page *IssueCommentCollectionPage) Next() error {
7552	return page.NextWithContext(context.Background())
7553}
7554
7555// NotDone returns true if the page enumeration should be started or is not yet complete.
7556func (page IssueCommentCollectionPage) NotDone() bool {
7557	return !page.icc.IsEmpty()
7558}
7559
7560// Response returns the raw server response from the last page request.
7561func (page IssueCommentCollectionPage) Response() IssueCommentCollection {
7562	return page.icc
7563}
7564
7565// Values returns the slice of values for the current page or nil if there are no values.
7566func (page IssueCommentCollectionPage) Values() []IssueCommentContract {
7567	if page.icc.IsEmpty() {
7568		return nil
7569	}
7570	return *page.icc.Value
7571}
7572
7573// Creates a new instance of the IssueCommentCollectionPage type.
7574func NewIssueCommentCollectionPage(cur IssueCommentCollection, getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage {
7575	return IssueCommentCollectionPage{
7576		fn:  getNextPage,
7577		icc: cur,
7578	}
7579}
7580
7581// IssueCommentContract issue Comment Contract details.
7582type IssueCommentContract struct {
7583	autorest.Response `json:"-"`
7584	// IssueCommentContractProperties - Properties of the Issue Comment.
7585	*IssueCommentContractProperties `json:"properties,omitempty"`
7586	// ID - READ-ONLY; Resource ID.
7587	ID *string `json:"id,omitempty"`
7588	// Name - READ-ONLY; Resource name.
7589	Name *string `json:"name,omitempty"`
7590	// Type - READ-ONLY; Resource type for API Management resource.
7591	Type *string `json:"type,omitempty"`
7592}
7593
7594// MarshalJSON is the custom marshaler for IssueCommentContract.
7595func (icc IssueCommentContract) MarshalJSON() ([]byte, error) {
7596	objectMap := make(map[string]interface{})
7597	if icc.IssueCommentContractProperties != nil {
7598		objectMap["properties"] = icc.IssueCommentContractProperties
7599	}
7600	return json.Marshal(objectMap)
7601}
7602
7603// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct.
7604func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error {
7605	var m map[string]*json.RawMessage
7606	err := json.Unmarshal(body, &m)
7607	if err != nil {
7608		return err
7609	}
7610	for k, v := range m {
7611		switch k {
7612		case "properties":
7613			if v != nil {
7614				var issueCommentContractProperties IssueCommentContractProperties
7615				err = json.Unmarshal(*v, &issueCommentContractProperties)
7616				if err != nil {
7617					return err
7618				}
7619				icc.IssueCommentContractProperties = &issueCommentContractProperties
7620			}
7621		case "id":
7622			if v != nil {
7623				var ID string
7624				err = json.Unmarshal(*v, &ID)
7625				if err != nil {
7626					return err
7627				}
7628				icc.ID = &ID
7629			}
7630		case "name":
7631			if v != nil {
7632				var name string
7633				err = json.Unmarshal(*v, &name)
7634				if err != nil {
7635					return err
7636				}
7637				icc.Name = &name
7638			}
7639		case "type":
7640			if v != nil {
7641				var typeVar string
7642				err = json.Unmarshal(*v, &typeVar)
7643				if err != nil {
7644					return err
7645				}
7646				icc.Type = &typeVar
7647			}
7648		}
7649	}
7650
7651	return nil
7652}
7653
7654// IssueCommentContractProperties issue Comment contract Properties.
7655type IssueCommentContractProperties struct {
7656	// Text - Comment text.
7657	Text *string `json:"text,omitempty"`
7658	// CreatedDate - Date and time when the comment was created.
7659	CreatedDate *date.Time `json:"createdDate,omitempty"`
7660	// UserID - A resource identifier for the user who left the comment.
7661	UserID *string `json:"userId,omitempty"`
7662}
7663
7664// IssueContract issue Contract details.
7665type IssueContract struct {
7666	autorest.Response `json:"-"`
7667	// IssueContractProperties - Properties of the Issue.
7668	*IssueContractProperties `json:"properties,omitempty"`
7669	// ID - READ-ONLY; Resource ID.
7670	ID *string `json:"id,omitempty"`
7671	// Name - READ-ONLY; Resource name.
7672	Name *string `json:"name,omitempty"`
7673	// Type - READ-ONLY; Resource type for API Management resource.
7674	Type *string `json:"type,omitempty"`
7675}
7676
7677// MarshalJSON is the custom marshaler for IssueContract.
7678func (ic IssueContract) MarshalJSON() ([]byte, error) {
7679	objectMap := make(map[string]interface{})
7680	if ic.IssueContractProperties != nil {
7681		objectMap["properties"] = ic.IssueContractProperties
7682	}
7683	return json.Marshal(objectMap)
7684}
7685
7686// UnmarshalJSON is the custom unmarshaler for IssueContract struct.
7687func (ic *IssueContract) UnmarshalJSON(body []byte) error {
7688	var m map[string]*json.RawMessage
7689	err := json.Unmarshal(body, &m)
7690	if err != nil {
7691		return err
7692	}
7693	for k, v := range m {
7694		switch k {
7695		case "properties":
7696			if v != nil {
7697				var issueContractProperties IssueContractProperties
7698				err = json.Unmarshal(*v, &issueContractProperties)
7699				if err != nil {
7700					return err
7701				}
7702				ic.IssueContractProperties = &issueContractProperties
7703			}
7704		case "id":
7705			if v != nil {
7706				var ID string
7707				err = json.Unmarshal(*v, &ID)
7708				if err != nil {
7709					return err
7710				}
7711				ic.ID = &ID
7712			}
7713		case "name":
7714			if v != nil {
7715				var name string
7716				err = json.Unmarshal(*v, &name)
7717				if err != nil {
7718					return err
7719				}
7720				ic.Name = &name
7721			}
7722		case "type":
7723			if v != nil {
7724				var typeVar string
7725				err = json.Unmarshal(*v, &typeVar)
7726				if err != nil {
7727					return err
7728				}
7729				ic.Type = &typeVar
7730			}
7731		}
7732	}
7733
7734	return nil
7735}
7736
7737// IssueContractBaseProperties issue contract Base Properties.
7738type IssueContractBaseProperties struct {
7739	// CreatedDate - Date and time when the issue was created.
7740	CreatedDate *date.Time `json:"createdDate,omitempty"`
7741	// State - Status of the issue. Possible values include: 'StateProposed', 'StateOpen', 'StateRemoved', 'StateResolved', 'StateClosed'
7742	State State `json:"state,omitempty"`
7743	// APIID - A resource identifier for the API the issue was created for.
7744	APIID *string `json:"apiId,omitempty"`
7745}
7746
7747// IssueContractProperties issue contract Properties.
7748type IssueContractProperties struct {
7749	// Title - The issue title.
7750	Title *string `json:"title,omitempty"`
7751	// Description - Text describing the issue.
7752	Description *string `json:"description,omitempty"`
7753	// UserID - A resource identifier for the user created the issue.
7754	UserID *string `json:"userId,omitempty"`
7755	// CreatedDate - Date and time when the issue was created.
7756	CreatedDate *date.Time `json:"createdDate,omitempty"`
7757	// State - Status of the issue. Possible values include: 'StateProposed', 'StateOpen', 'StateRemoved', 'StateResolved', 'StateClosed'
7758	State State `json:"state,omitempty"`
7759	// APIID - A resource identifier for the API the issue was created for.
7760	APIID *string `json:"apiId,omitempty"`
7761}
7762
7763// IssueUpdateContract issue update Parameters.
7764type IssueUpdateContract struct {
7765	// IssueUpdateContractProperties - Issue entity Update contract properties.
7766	*IssueUpdateContractProperties `json:"properties,omitempty"`
7767}
7768
7769// MarshalJSON is the custom marshaler for IssueUpdateContract.
7770func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) {
7771	objectMap := make(map[string]interface{})
7772	if iuc.IssueUpdateContractProperties != nil {
7773		objectMap["properties"] = iuc.IssueUpdateContractProperties
7774	}
7775	return json.Marshal(objectMap)
7776}
7777
7778// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct.
7779func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error {
7780	var m map[string]*json.RawMessage
7781	err := json.Unmarshal(body, &m)
7782	if err != nil {
7783		return err
7784	}
7785	for k, v := range m {
7786		switch k {
7787		case "properties":
7788			if v != nil {
7789				var issueUpdateContractProperties IssueUpdateContractProperties
7790				err = json.Unmarshal(*v, &issueUpdateContractProperties)
7791				if err != nil {
7792					return err
7793				}
7794				iuc.IssueUpdateContractProperties = &issueUpdateContractProperties
7795			}
7796		}
7797	}
7798
7799	return nil
7800}
7801
7802// IssueUpdateContractProperties issue contract Update Properties.
7803type IssueUpdateContractProperties struct {
7804	// Title - The issue title.
7805	Title *string `json:"title,omitempty"`
7806	// Description - Text describing the issue.
7807	Description *string `json:"description,omitempty"`
7808	// UserID - A resource identifier for the user created the issue.
7809	UserID *string `json:"userId,omitempty"`
7810	// CreatedDate - Date and time when the issue was created.
7811	CreatedDate *date.Time `json:"createdDate,omitempty"`
7812	// State - Status of the issue. Possible values include: 'StateProposed', 'StateOpen', 'StateRemoved', 'StateResolved', 'StateClosed'
7813	State State `json:"state,omitempty"`
7814	// APIID - A resource identifier for the API the issue was created for.
7815	APIID *string `json:"apiId,omitempty"`
7816}
7817
7818// KeyVaultContractCreateProperties create keyVault contract details.
7819type KeyVaultContractCreateProperties struct {
7820	// SecretIdentifier - Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi
7821	SecretIdentifier *string `json:"secretIdentifier,omitempty"`
7822	// IdentityClientID - SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret.
7823	IdentityClientID *string `json:"identityClientId,omitempty"`
7824}
7825
7826// KeyVaultContractProperties keyVault contract details.
7827type KeyVaultContractProperties struct {
7828	// LastStatus - Last time sync and refresh status of secret from key vault.
7829	LastStatus *KeyVaultLastAccessStatusContractProperties `json:"lastStatus,omitempty"`
7830	// SecretIdentifier - Key vault secret identifier for fetching secret. Providing a versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi
7831	SecretIdentifier *string `json:"secretIdentifier,omitempty"`
7832	// IdentityClientID - SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret.
7833	IdentityClientID *string `json:"identityClientId,omitempty"`
7834}
7835
7836// KeyVaultLastAccessStatusContractProperties issue contract Update Properties.
7837type KeyVaultLastAccessStatusContractProperties struct {
7838	// Code - Last status code for sync and refresh of secret from key vault.
7839	Code *string `json:"code,omitempty"`
7840	// Message - Details of the error else empty.
7841	Message *string `json:"message,omitempty"`
7842	// TimeStampUtc - Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
7843	TimeStampUtc *date.Time `json:"timeStampUtc,omitempty"`
7844}
7845
7846// ListNetworkStatusContractByLocation ...
7847type ListNetworkStatusContractByLocation struct {
7848	autorest.Response `json:"-"`
7849	Value             *[]NetworkStatusContractByLocation `json:"value,omitempty"`
7850}
7851
7852// LoggerCollection paged Logger list representation.
7853type LoggerCollection struct {
7854	autorest.Response `json:"-"`
7855	// Value - Logger values.
7856	Value *[]LoggerContract `json:"value,omitempty"`
7857	// Count - Total record count number across all pages.
7858	Count *int64 `json:"count,omitempty"`
7859	// NextLink - Next page link if any.
7860	NextLink *string `json:"nextLink,omitempty"`
7861}
7862
7863// LoggerCollectionIterator provides access to a complete listing of LoggerContract values.
7864type LoggerCollectionIterator struct {
7865	i    int
7866	page LoggerCollectionPage
7867}
7868
7869// NextWithContext advances to the next value.  If there was an error making
7870// the request the iterator does not advance and the error is returned.
7871func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) {
7872	if tracing.IsEnabled() {
7873		ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext")
7874		defer func() {
7875			sc := -1
7876			if iter.Response().Response.Response != nil {
7877				sc = iter.Response().Response.Response.StatusCode
7878			}
7879			tracing.EndSpan(ctx, sc, err)
7880		}()
7881	}
7882	iter.i++
7883	if iter.i < len(iter.page.Values()) {
7884		return nil
7885	}
7886	err = iter.page.NextWithContext(ctx)
7887	if err != nil {
7888		iter.i--
7889		return err
7890	}
7891	iter.i = 0
7892	return nil
7893}
7894
7895// Next advances to the next value.  If there was an error making
7896// the request the iterator does not advance and the error is returned.
7897// Deprecated: Use NextWithContext() instead.
7898func (iter *LoggerCollectionIterator) Next() error {
7899	return iter.NextWithContext(context.Background())
7900}
7901
7902// NotDone returns true if the enumeration should be started or is not yet complete.
7903func (iter LoggerCollectionIterator) NotDone() bool {
7904	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7905}
7906
7907// Response returns the raw server response from the last page request.
7908func (iter LoggerCollectionIterator) Response() LoggerCollection {
7909	return iter.page.Response()
7910}
7911
7912// Value returns the current value or a zero-initialized value if the
7913// iterator has advanced beyond the end of the collection.
7914func (iter LoggerCollectionIterator) Value() LoggerContract {
7915	if !iter.page.NotDone() {
7916		return LoggerContract{}
7917	}
7918	return iter.page.Values()[iter.i]
7919}
7920
7921// Creates a new instance of the LoggerCollectionIterator type.
7922func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator {
7923	return LoggerCollectionIterator{page: page}
7924}
7925
7926// IsEmpty returns true if the ListResult contains no values.
7927func (lc LoggerCollection) IsEmpty() bool {
7928	return lc.Value == nil || len(*lc.Value) == 0
7929}
7930
7931// hasNextLink returns true if the NextLink is not empty.
7932func (lc LoggerCollection) hasNextLink() bool {
7933	return lc.NextLink != nil && len(*lc.NextLink) != 0
7934}
7935
7936// loggerCollectionPreparer prepares a request to retrieve the next set of results.
7937// It returns nil if no more results exist.
7938func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) {
7939	if !lc.hasNextLink() {
7940		return nil, nil
7941	}
7942	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7943		autorest.AsJSON(),
7944		autorest.AsGet(),
7945		autorest.WithBaseURL(to.String(lc.NextLink)))
7946}
7947
7948// LoggerCollectionPage contains a page of LoggerContract values.
7949type LoggerCollectionPage struct {
7950	fn func(context.Context, LoggerCollection) (LoggerCollection, error)
7951	lc LoggerCollection
7952}
7953
7954// NextWithContext advances to the next page of values.  If there was an error making
7955// the request the page does not advance and the error is returned.
7956func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) {
7957	if tracing.IsEnabled() {
7958		ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext")
7959		defer func() {
7960			sc := -1
7961			if page.Response().Response.Response != nil {
7962				sc = page.Response().Response.Response.StatusCode
7963			}
7964			tracing.EndSpan(ctx, sc, err)
7965		}()
7966	}
7967	for {
7968		next, err := page.fn(ctx, page.lc)
7969		if err != nil {
7970			return err
7971		}
7972		page.lc = next
7973		if !next.hasNextLink() || !next.IsEmpty() {
7974			break
7975		}
7976	}
7977	return nil
7978}
7979
7980// Next advances to the next page of values.  If there was an error making
7981// the request the page does not advance and the error is returned.
7982// Deprecated: Use NextWithContext() instead.
7983func (page *LoggerCollectionPage) Next() error {
7984	return page.NextWithContext(context.Background())
7985}
7986
7987// NotDone returns true if the page enumeration should be started or is not yet complete.
7988func (page LoggerCollectionPage) NotDone() bool {
7989	return !page.lc.IsEmpty()
7990}
7991
7992// Response returns the raw server response from the last page request.
7993func (page LoggerCollectionPage) Response() LoggerCollection {
7994	return page.lc
7995}
7996
7997// Values returns the slice of values for the current page or nil if there are no values.
7998func (page LoggerCollectionPage) Values() []LoggerContract {
7999	if page.lc.IsEmpty() {
8000		return nil
8001	}
8002	return *page.lc.Value
8003}
8004
8005// Creates a new instance of the LoggerCollectionPage type.
8006func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage {
8007	return LoggerCollectionPage{
8008		fn: getNextPage,
8009		lc: cur,
8010	}
8011}
8012
8013// LoggerContract logger details.
8014type LoggerContract struct {
8015	autorest.Response `json:"-"`
8016	// LoggerContractProperties - Logger entity contract properties.
8017	*LoggerContractProperties `json:"properties,omitempty"`
8018	// ID - READ-ONLY; Resource ID.
8019	ID *string `json:"id,omitempty"`
8020	// Name - READ-ONLY; Resource name.
8021	Name *string `json:"name,omitempty"`
8022	// Type - READ-ONLY; Resource type for API Management resource.
8023	Type *string `json:"type,omitempty"`
8024}
8025
8026// MarshalJSON is the custom marshaler for LoggerContract.
8027func (lc LoggerContract) MarshalJSON() ([]byte, error) {
8028	objectMap := make(map[string]interface{})
8029	if lc.LoggerContractProperties != nil {
8030		objectMap["properties"] = lc.LoggerContractProperties
8031	}
8032	return json.Marshal(objectMap)
8033}
8034
8035// UnmarshalJSON is the custom unmarshaler for LoggerContract struct.
8036func (lc *LoggerContract) UnmarshalJSON(body []byte) error {
8037	var m map[string]*json.RawMessage
8038	err := json.Unmarshal(body, &m)
8039	if err != nil {
8040		return err
8041	}
8042	for k, v := range m {
8043		switch k {
8044		case "properties":
8045			if v != nil {
8046				var loggerContractProperties LoggerContractProperties
8047				err = json.Unmarshal(*v, &loggerContractProperties)
8048				if err != nil {
8049					return err
8050				}
8051				lc.LoggerContractProperties = &loggerContractProperties
8052			}
8053		case "id":
8054			if v != nil {
8055				var ID string
8056				err = json.Unmarshal(*v, &ID)
8057				if err != nil {
8058					return err
8059				}
8060				lc.ID = &ID
8061			}
8062		case "name":
8063			if v != nil {
8064				var name string
8065				err = json.Unmarshal(*v, &name)
8066				if err != nil {
8067					return err
8068				}
8069				lc.Name = &name
8070			}
8071		case "type":
8072			if v != nil {
8073				var typeVar string
8074				err = json.Unmarshal(*v, &typeVar)
8075				if err != nil {
8076					return err
8077				}
8078				lc.Type = &typeVar
8079			}
8080		}
8081	}
8082
8083	return nil
8084}
8085
8086// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use
8087// to log API Management events. Currently the Logger entity supports logging API Management events to
8088// Azure Event Hubs.
8089type LoggerContractProperties struct {
8090	// LoggerType - Logger type. Possible values include: 'LoggerTypeAzureEventHub', 'LoggerTypeApplicationInsights', 'LoggerTypeAzureMonitor'
8091	LoggerType LoggerType `json:"loggerType,omitempty"`
8092	// Description - Logger description.
8093	Description *string `json:"description,omitempty"`
8094	// Credentials - The name and SendRule connection string of the event hub for azureEventHub logger.
8095	// Instrumentation key for applicationInsights logger.
8096	Credentials map[string]*string `json:"credentials"`
8097	// IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true.
8098	IsBuffered *bool `json:"isBuffered,omitempty"`
8099	// ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
8100	ResourceID *string `json:"resourceId,omitempty"`
8101}
8102
8103// MarshalJSON is the custom marshaler for LoggerContractProperties.
8104func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) {
8105	objectMap := make(map[string]interface{})
8106	if lcp.LoggerType != "" {
8107		objectMap["loggerType"] = lcp.LoggerType
8108	}
8109	if lcp.Description != nil {
8110		objectMap["description"] = lcp.Description
8111	}
8112	if lcp.Credentials != nil {
8113		objectMap["credentials"] = lcp.Credentials
8114	}
8115	if lcp.IsBuffered != nil {
8116		objectMap["isBuffered"] = lcp.IsBuffered
8117	}
8118	if lcp.ResourceID != nil {
8119		objectMap["resourceId"] = lcp.ResourceID
8120	}
8121	return json.Marshal(objectMap)
8122}
8123
8124// LoggerUpdateContract logger update contract.
8125type LoggerUpdateContract struct {
8126	// LoggerUpdateParameters - Logger entity update contract properties.
8127	*LoggerUpdateParameters `json:"properties,omitempty"`
8128}
8129
8130// MarshalJSON is the custom marshaler for LoggerUpdateContract.
8131func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) {
8132	objectMap := make(map[string]interface{})
8133	if luc.LoggerUpdateParameters != nil {
8134		objectMap["properties"] = luc.LoggerUpdateParameters
8135	}
8136	return json.Marshal(objectMap)
8137}
8138
8139// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct.
8140func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error {
8141	var m map[string]*json.RawMessage
8142	err := json.Unmarshal(body, &m)
8143	if err != nil {
8144		return err
8145	}
8146	for k, v := range m {
8147		switch k {
8148		case "properties":
8149			if v != nil {
8150				var loggerUpdateParameters LoggerUpdateParameters
8151				err = json.Unmarshal(*v, &loggerUpdateParameters)
8152				if err != nil {
8153					return err
8154				}
8155				luc.LoggerUpdateParameters = &loggerUpdateParameters
8156			}
8157		}
8158	}
8159
8160	return nil
8161}
8162
8163// LoggerUpdateParameters parameters supplied to the Update Logger operation.
8164type LoggerUpdateParameters struct {
8165	// LoggerType - Logger type. Possible values include: 'LoggerTypeAzureEventHub', 'LoggerTypeApplicationInsights', 'LoggerTypeAzureMonitor'
8166	LoggerType LoggerType `json:"loggerType,omitempty"`
8167	// Description - Logger description.
8168	Description *string `json:"description,omitempty"`
8169	// Credentials - Logger credentials.
8170	Credentials map[string]*string `json:"credentials"`
8171	// IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true.
8172	IsBuffered *bool `json:"isBuffered,omitempty"`
8173}
8174
8175// MarshalJSON is the custom marshaler for LoggerUpdateParameters.
8176func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) {
8177	objectMap := make(map[string]interface{})
8178	if lup.LoggerType != "" {
8179		objectMap["loggerType"] = lup.LoggerType
8180	}
8181	if lup.Description != nil {
8182		objectMap["description"] = lup.Description
8183	}
8184	if lup.Credentials != nil {
8185		objectMap["credentials"] = lup.Credentials
8186	}
8187	if lup.IsBuffered != nil {
8188		objectMap["isBuffered"] = lup.IsBuffered
8189	}
8190	return json.Marshal(objectMap)
8191}
8192
8193// NamedValueCollection paged NamedValue list representation.
8194type NamedValueCollection struct {
8195	autorest.Response `json:"-"`
8196	// Value - Page values.
8197	Value *[]NamedValueContract `json:"value,omitempty"`
8198	// Count - Total record count number across all pages.
8199	Count *int64 `json:"count,omitempty"`
8200	// NextLink - Next page link if any.
8201	NextLink *string `json:"nextLink,omitempty"`
8202}
8203
8204// NamedValueCollectionIterator provides access to a complete listing of NamedValueContract values.
8205type NamedValueCollectionIterator struct {
8206	i    int
8207	page NamedValueCollectionPage
8208}
8209
8210// NextWithContext advances to the next value.  If there was an error making
8211// the request the iterator does not advance and the error is returned.
8212func (iter *NamedValueCollectionIterator) NextWithContext(ctx context.Context) (err error) {
8213	if tracing.IsEnabled() {
8214		ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionIterator.NextWithContext")
8215		defer func() {
8216			sc := -1
8217			if iter.Response().Response.Response != nil {
8218				sc = iter.Response().Response.Response.StatusCode
8219			}
8220			tracing.EndSpan(ctx, sc, err)
8221		}()
8222	}
8223	iter.i++
8224	if iter.i < len(iter.page.Values()) {
8225		return nil
8226	}
8227	err = iter.page.NextWithContext(ctx)
8228	if err != nil {
8229		iter.i--
8230		return err
8231	}
8232	iter.i = 0
8233	return nil
8234}
8235
8236// Next advances to the next value.  If there was an error making
8237// the request the iterator does not advance and the error is returned.
8238// Deprecated: Use NextWithContext() instead.
8239func (iter *NamedValueCollectionIterator) Next() error {
8240	return iter.NextWithContext(context.Background())
8241}
8242
8243// NotDone returns true if the enumeration should be started or is not yet complete.
8244func (iter NamedValueCollectionIterator) NotDone() bool {
8245	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8246}
8247
8248// Response returns the raw server response from the last page request.
8249func (iter NamedValueCollectionIterator) Response() NamedValueCollection {
8250	return iter.page.Response()
8251}
8252
8253// Value returns the current value or a zero-initialized value if the
8254// iterator has advanced beyond the end of the collection.
8255func (iter NamedValueCollectionIterator) Value() NamedValueContract {
8256	if !iter.page.NotDone() {
8257		return NamedValueContract{}
8258	}
8259	return iter.page.Values()[iter.i]
8260}
8261
8262// Creates a new instance of the NamedValueCollectionIterator type.
8263func NewNamedValueCollectionIterator(page NamedValueCollectionPage) NamedValueCollectionIterator {
8264	return NamedValueCollectionIterator{page: page}
8265}
8266
8267// IsEmpty returns true if the ListResult contains no values.
8268func (nvc NamedValueCollection) IsEmpty() bool {
8269	return nvc.Value == nil || len(*nvc.Value) == 0
8270}
8271
8272// hasNextLink returns true if the NextLink is not empty.
8273func (nvc NamedValueCollection) hasNextLink() bool {
8274	return nvc.NextLink != nil && len(*nvc.NextLink) != 0
8275}
8276
8277// namedValueCollectionPreparer prepares a request to retrieve the next set of results.
8278// It returns nil if no more results exist.
8279func (nvc NamedValueCollection) namedValueCollectionPreparer(ctx context.Context) (*http.Request, error) {
8280	if !nvc.hasNextLink() {
8281		return nil, nil
8282	}
8283	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8284		autorest.AsJSON(),
8285		autorest.AsGet(),
8286		autorest.WithBaseURL(to.String(nvc.NextLink)))
8287}
8288
8289// NamedValueCollectionPage contains a page of NamedValueContract values.
8290type NamedValueCollectionPage struct {
8291	fn  func(context.Context, NamedValueCollection) (NamedValueCollection, error)
8292	nvc NamedValueCollection
8293}
8294
8295// NextWithContext advances to the next page of values.  If there was an error making
8296// the request the page does not advance and the error is returned.
8297func (page *NamedValueCollectionPage) NextWithContext(ctx context.Context) (err error) {
8298	if tracing.IsEnabled() {
8299		ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionPage.NextWithContext")
8300		defer func() {
8301			sc := -1
8302			if page.Response().Response.Response != nil {
8303				sc = page.Response().Response.Response.StatusCode
8304			}
8305			tracing.EndSpan(ctx, sc, err)
8306		}()
8307	}
8308	for {
8309		next, err := page.fn(ctx, page.nvc)
8310		if err != nil {
8311			return err
8312		}
8313		page.nvc = next
8314		if !next.hasNextLink() || !next.IsEmpty() {
8315			break
8316		}
8317	}
8318	return nil
8319}
8320
8321// Next advances to the next page of values.  If there was an error making
8322// the request the page does not advance and the error is returned.
8323// Deprecated: Use NextWithContext() instead.
8324func (page *NamedValueCollectionPage) Next() error {
8325	return page.NextWithContext(context.Background())
8326}
8327
8328// NotDone returns true if the page enumeration should be started or is not yet complete.
8329func (page NamedValueCollectionPage) NotDone() bool {
8330	return !page.nvc.IsEmpty()
8331}
8332
8333// Response returns the raw server response from the last page request.
8334func (page NamedValueCollectionPage) Response() NamedValueCollection {
8335	return page.nvc
8336}
8337
8338// Values returns the slice of values for the current page or nil if there are no values.
8339func (page NamedValueCollectionPage) Values() []NamedValueContract {
8340	if page.nvc.IsEmpty() {
8341		return nil
8342	}
8343	return *page.nvc.Value
8344}
8345
8346// Creates a new instance of the NamedValueCollectionPage type.
8347func NewNamedValueCollectionPage(cur NamedValueCollection, getNextPage func(context.Context, NamedValueCollection) (NamedValueCollection, error)) NamedValueCollectionPage {
8348	return NamedValueCollectionPage{
8349		fn:  getNextPage,
8350		nvc: cur,
8351	}
8352}
8353
8354// NamedValueContract namedValue details.
8355type NamedValueContract struct {
8356	autorest.Response `json:"-"`
8357	// NamedValueContractProperties - NamedValue entity contract properties.
8358	*NamedValueContractProperties `json:"properties,omitempty"`
8359	// ID - READ-ONLY; Resource ID.
8360	ID *string `json:"id,omitempty"`
8361	// Name - READ-ONLY; Resource name.
8362	Name *string `json:"name,omitempty"`
8363	// Type - READ-ONLY; Resource type for API Management resource.
8364	Type *string `json:"type,omitempty"`
8365}
8366
8367// MarshalJSON is the custom marshaler for NamedValueContract.
8368func (nvc NamedValueContract) MarshalJSON() ([]byte, error) {
8369	objectMap := make(map[string]interface{})
8370	if nvc.NamedValueContractProperties != nil {
8371		objectMap["properties"] = nvc.NamedValueContractProperties
8372	}
8373	return json.Marshal(objectMap)
8374}
8375
8376// UnmarshalJSON is the custom unmarshaler for NamedValueContract struct.
8377func (nvc *NamedValueContract) UnmarshalJSON(body []byte) error {
8378	var m map[string]*json.RawMessage
8379	err := json.Unmarshal(body, &m)
8380	if err != nil {
8381		return err
8382	}
8383	for k, v := range m {
8384		switch k {
8385		case "properties":
8386			if v != nil {
8387				var namedValueContractProperties NamedValueContractProperties
8388				err = json.Unmarshal(*v, &namedValueContractProperties)
8389				if err != nil {
8390					return err
8391				}
8392				nvc.NamedValueContractProperties = &namedValueContractProperties
8393			}
8394		case "id":
8395			if v != nil {
8396				var ID string
8397				err = json.Unmarshal(*v, &ID)
8398				if err != nil {
8399					return err
8400				}
8401				nvc.ID = &ID
8402			}
8403		case "name":
8404			if v != nil {
8405				var name string
8406				err = json.Unmarshal(*v, &name)
8407				if err != nil {
8408					return err
8409				}
8410				nvc.Name = &name
8411			}
8412		case "type":
8413			if v != nil {
8414				var typeVar string
8415				err = json.Unmarshal(*v, &typeVar)
8416				if err != nil {
8417					return err
8418				}
8419				nvc.Type = &typeVar
8420			}
8421		}
8422	}
8423
8424	return nil
8425}
8426
8427// NamedValueContractProperties namedValue Contract properties.
8428type NamedValueContractProperties struct {
8429	// DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
8430	DisplayName *string `json:"displayName,omitempty"`
8431	// 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.
8432	Value *string `json:"value,omitempty"`
8433	// KeyVault - KeyVault location details of the namedValue.
8434	KeyVault *KeyVaultContractProperties `json:"keyVault,omitempty"`
8435	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
8436	Tags *[]string `json:"tags,omitempty"`
8437	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
8438	Secret *bool `json:"secret,omitempty"`
8439}
8440
8441// NamedValueCreateContract namedValue details.
8442type NamedValueCreateContract struct {
8443	// NamedValueCreateContractProperties - NamedValue entity contract properties for PUT operation.
8444	*NamedValueCreateContractProperties `json:"properties,omitempty"`
8445	// ID - READ-ONLY; Resource ID.
8446	ID *string `json:"id,omitempty"`
8447	// Name - READ-ONLY; Resource name.
8448	Name *string `json:"name,omitempty"`
8449	// Type - READ-ONLY; Resource type for API Management resource.
8450	Type *string `json:"type,omitempty"`
8451}
8452
8453// MarshalJSON is the custom marshaler for NamedValueCreateContract.
8454func (nvcc NamedValueCreateContract) MarshalJSON() ([]byte, error) {
8455	objectMap := make(map[string]interface{})
8456	if nvcc.NamedValueCreateContractProperties != nil {
8457		objectMap["properties"] = nvcc.NamedValueCreateContractProperties
8458	}
8459	return json.Marshal(objectMap)
8460}
8461
8462// UnmarshalJSON is the custom unmarshaler for NamedValueCreateContract struct.
8463func (nvcc *NamedValueCreateContract) UnmarshalJSON(body []byte) error {
8464	var m map[string]*json.RawMessage
8465	err := json.Unmarshal(body, &m)
8466	if err != nil {
8467		return err
8468	}
8469	for k, v := range m {
8470		switch k {
8471		case "properties":
8472			if v != nil {
8473				var namedValueCreateContractProperties NamedValueCreateContractProperties
8474				err = json.Unmarshal(*v, &namedValueCreateContractProperties)
8475				if err != nil {
8476					return err
8477				}
8478				nvcc.NamedValueCreateContractProperties = &namedValueCreateContractProperties
8479			}
8480		case "id":
8481			if v != nil {
8482				var ID string
8483				err = json.Unmarshal(*v, &ID)
8484				if err != nil {
8485					return err
8486				}
8487				nvcc.ID = &ID
8488			}
8489		case "name":
8490			if v != nil {
8491				var name string
8492				err = json.Unmarshal(*v, &name)
8493				if err != nil {
8494					return err
8495				}
8496				nvcc.Name = &name
8497			}
8498		case "type":
8499			if v != nil {
8500				var typeVar string
8501				err = json.Unmarshal(*v, &typeVar)
8502				if err != nil {
8503					return err
8504				}
8505				nvcc.Type = &typeVar
8506			}
8507		}
8508	}
8509
8510	return nil
8511}
8512
8513// NamedValueCreateContractProperties namedValue Contract properties.
8514type NamedValueCreateContractProperties struct {
8515	// DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
8516	DisplayName *string `json:"displayName,omitempty"`
8517	// 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.
8518	Value *string `json:"value,omitempty"`
8519	// KeyVault - KeyVault location details of the namedValue.
8520	KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"`
8521	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
8522	Tags *[]string `json:"tags,omitempty"`
8523	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
8524	Secret *bool `json:"secret,omitempty"`
8525}
8526
8527// NamedValueCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
8528// long-running operation.
8529type NamedValueCreateOrUpdateFuture struct {
8530	azure.FutureAPI
8531	// Result returns the result of the asynchronous operation.
8532	// If the operation has not completed it will return an error.
8533	Result func(NamedValueClient) (NamedValueContract, error)
8534}
8535
8536// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8537func (future *NamedValueCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
8538	var azFuture azure.Future
8539	if err := json.Unmarshal(body, &azFuture); err != nil {
8540		return err
8541	}
8542	future.FutureAPI = &azFuture
8543	future.Result = future.result
8544	return nil
8545}
8546
8547// result is the default implementation for NamedValueCreateOrUpdateFuture.Result.
8548func (future *NamedValueCreateOrUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) {
8549	var done bool
8550	done, err = future.DoneWithContext(context.Background(), client)
8551	if err != nil {
8552		err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
8553		return
8554	}
8555	if !done {
8556		nvc.Response.Response = future.Response()
8557		err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueCreateOrUpdateFuture")
8558		return
8559	}
8560	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8561	if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent {
8562		nvc, err = client.CreateOrUpdateResponder(nvc.Response.Response)
8563		if err != nil {
8564			err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request")
8565		}
8566	}
8567	return
8568}
8569
8570// NamedValueEntityBaseParameters namedValue Entity Base Parameters set.
8571type NamedValueEntityBaseParameters struct {
8572	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
8573	Tags *[]string `json:"tags,omitempty"`
8574	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
8575	Secret *bool `json:"secret,omitempty"`
8576}
8577
8578// NamedValueRefreshSecretFuture an abstraction for monitoring and retrieving the results of a long-running
8579// operation.
8580type NamedValueRefreshSecretFuture struct {
8581	azure.FutureAPI
8582	// Result returns the result of the asynchronous operation.
8583	// If the operation has not completed it will return an error.
8584	Result func(NamedValueClient) (NamedValueContract, error)
8585}
8586
8587// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8588func (future *NamedValueRefreshSecretFuture) UnmarshalJSON(body []byte) error {
8589	var azFuture azure.Future
8590	if err := json.Unmarshal(body, &azFuture); err != nil {
8591		return err
8592	}
8593	future.FutureAPI = &azFuture
8594	future.Result = future.result
8595	return nil
8596}
8597
8598// result is the default implementation for NamedValueRefreshSecretFuture.Result.
8599func (future *NamedValueRefreshSecretFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) {
8600	var done bool
8601	done, err = future.DoneWithContext(context.Background(), client)
8602	if err != nil {
8603		err = autorest.NewErrorWithError(err, "apimanagement.NamedValueRefreshSecretFuture", "Result", future.Response(), "Polling failure")
8604		return
8605	}
8606	if !done {
8607		nvc.Response.Response = future.Response()
8608		err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueRefreshSecretFuture")
8609		return
8610	}
8611	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8612	if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent {
8613		nvc, err = client.RefreshSecretResponder(nvc.Response.Response)
8614		if err != nil {
8615			err = autorest.NewErrorWithError(err, "apimanagement.NamedValueRefreshSecretFuture", "Result", nvc.Response.Response, "Failure responding to request")
8616		}
8617	}
8618	return
8619}
8620
8621// NamedValueSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
8622type NamedValueSecretContract struct {
8623	autorest.Response `json:"-"`
8624	// Value - This is secret value of the NamedValue entity.
8625	Value *string `json:"value,omitempty"`
8626}
8627
8628// NamedValueUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
8629// operation.
8630type NamedValueUpdateFuture struct {
8631	azure.FutureAPI
8632	// Result returns the result of the asynchronous operation.
8633	// If the operation has not completed it will return an error.
8634	Result func(NamedValueClient) (NamedValueContract, error)
8635}
8636
8637// UnmarshalJSON is the custom unmarshaller for CreateFuture.
8638func (future *NamedValueUpdateFuture) UnmarshalJSON(body []byte) error {
8639	var azFuture azure.Future
8640	if err := json.Unmarshal(body, &azFuture); err != nil {
8641		return err
8642	}
8643	future.FutureAPI = &azFuture
8644	future.Result = future.result
8645	return nil
8646}
8647
8648// result is the default implementation for NamedValueUpdateFuture.Result.
8649func (future *NamedValueUpdateFuture) result(client NamedValueClient) (nvc NamedValueContract, err error) {
8650	var done bool
8651	done, err = future.DoneWithContext(context.Background(), client)
8652	if err != nil {
8653		err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", future.Response(), "Polling failure")
8654		return
8655	}
8656	if !done {
8657		nvc.Response.Response = future.Response()
8658		err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueUpdateFuture")
8659		return
8660	}
8661	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
8662	if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent {
8663		nvc, err = client.UpdateResponder(nvc.Response.Response)
8664		if err != nil {
8665			err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request")
8666		}
8667	}
8668	return
8669}
8670
8671// NamedValueUpdateParameterProperties namedValue Contract properties.
8672type NamedValueUpdateParameterProperties struct {
8673	// DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters.
8674	DisplayName *string `json:"displayName,omitempty"`
8675	// Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace.
8676	Value *string `json:"value,omitempty"`
8677	// KeyVault - KeyVault location details of the namedValue.
8678	KeyVault *KeyVaultContractCreateProperties `json:"keyVault,omitempty"`
8679	// Tags - Optional tags that when provided can be used to filter the NamedValue list.
8680	Tags *[]string `json:"tags,omitempty"`
8681	// Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false.
8682	Secret *bool `json:"secret,omitempty"`
8683}
8684
8685// NamedValueUpdateParameters namedValue update Parameters.
8686type NamedValueUpdateParameters struct {
8687	// NamedValueUpdateParameterProperties - NamedValue entity Update contract properties.
8688	*NamedValueUpdateParameterProperties `json:"properties,omitempty"`
8689}
8690
8691// MarshalJSON is the custom marshaler for NamedValueUpdateParameters.
8692func (nvup NamedValueUpdateParameters) MarshalJSON() ([]byte, error) {
8693	objectMap := make(map[string]interface{})
8694	if nvup.NamedValueUpdateParameterProperties != nil {
8695		objectMap["properties"] = nvup.NamedValueUpdateParameterProperties
8696	}
8697	return json.Marshal(objectMap)
8698}
8699
8700// UnmarshalJSON is the custom unmarshaler for NamedValueUpdateParameters struct.
8701func (nvup *NamedValueUpdateParameters) UnmarshalJSON(body []byte) error {
8702	var m map[string]*json.RawMessage
8703	err := json.Unmarshal(body, &m)
8704	if err != nil {
8705		return err
8706	}
8707	for k, v := range m {
8708		switch k {
8709		case "properties":
8710			if v != nil {
8711				var namedValueUpdateParameterProperties NamedValueUpdateParameterProperties
8712				err = json.Unmarshal(*v, &namedValueUpdateParameterProperties)
8713				if err != nil {
8714					return err
8715				}
8716				nvup.NamedValueUpdateParameterProperties = &namedValueUpdateParameterProperties
8717			}
8718		}
8719	}
8720
8721	return nil
8722}
8723
8724// NetworkStatusContract network Status details.
8725type NetworkStatusContract struct {
8726	autorest.Response `json:"-"`
8727	// DNSServers - Gets the list of DNS servers IPV4 addresses.
8728	DNSServers *[]string `json:"dnsServers,omitempty"`
8729	// ConnectivityStatus - Gets the list of Connectivity Status to the Resources on which the service depends upon.
8730	ConnectivityStatus *[]ConnectivityStatusContract `json:"connectivityStatus,omitempty"`
8731}
8732
8733// NetworkStatusContractByLocation network Status in the Location
8734type NetworkStatusContractByLocation struct {
8735	// Location - Location of service
8736	Location *string `json:"location,omitempty"`
8737	// NetworkStatus - Network status in Location
8738	NetworkStatus *NetworkStatusContract `json:"networkStatus,omitempty"`
8739}
8740
8741// NotificationCollection paged Notification list representation.
8742type NotificationCollection struct {
8743	autorest.Response `json:"-"`
8744	// Value - Page values.
8745	Value *[]NotificationContract `json:"value,omitempty"`
8746	// Count - Total record count number across all pages.
8747	Count *int64 `json:"count,omitempty"`
8748	// NextLink - Next page link if any.
8749	NextLink *string `json:"nextLink,omitempty"`
8750}
8751
8752// NotificationCollectionIterator provides access to a complete listing of NotificationContract values.
8753type NotificationCollectionIterator struct {
8754	i    int
8755	page NotificationCollectionPage
8756}
8757
8758// NextWithContext advances to the next value.  If there was an error making
8759// the request the iterator does not advance and the error is returned.
8760func (iter *NotificationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
8761	if tracing.IsEnabled() {
8762		ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionIterator.NextWithContext")
8763		defer func() {
8764			sc := -1
8765			if iter.Response().Response.Response != nil {
8766				sc = iter.Response().Response.Response.StatusCode
8767			}
8768			tracing.EndSpan(ctx, sc, err)
8769		}()
8770	}
8771	iter.i++
8772	if iter.i < len(iter.page.Values()) {
8773		return nil
8774	}
8775	err = iter.page.NextWithContext(ctx)
8776	if err != nil {
8777		iter.i--
8778		return err
8779	}
8780	iter.i = 0
8781	return nil
8782}
8783
8784// Next advances to the next value.  If there was an error making
8785// the request the iterator does not advance and the error is returned.
8786// Deprecated: Use NextWithContext() instead.
8787func (iter *NotificationCollectionIterator) Next() error {
8788	return iter.NextWithContext(context.Background())
8789}
8790
8791// NotDone returns true if the enumeration should be started or is not yet complete.
8792func (iter NotificationCollectionIterator) NotDone() bool {
8793	return iter.page.NotDone() && iter.i < len(iter.page.Values())
8794}
8795
8796// Response returns the raw server response from the last page request.
8797func (iter NotificationCollectionIterator) Response() NotificationCollection {
8798	return iter.page.Response()
8799}
8800
8801// Value returns the current value or a zero-initialized value if the
8802// iterator has advanced beyond the end of the collection.
8803func (iter NotificationCollectionIterator) Value() NotificationContract {
8804	if !iter.page.NotDone() {
8805		return NotificationContract{}
8806	}
8807	return iter.page.Values()[iter.i]
8808}
8809
8810// Creates a new instance of the NotificationCollectionIterator type.
8811func NewNotificationCollectionIterator(page NotificationCollectionPage) NotificationCollectionIterator {
8812	return NotificationCollectionIterator{page: page}
8813}
8814
8815// IsEmpty returns true if the ListResult contains no values.
8816func (nc NotificationCollection) IsEmpty() bool {
8817	return nc.Value == nil || len(*nc.Value) == 0
8818}
8819
8820// hasNextLink returns true if the NextLink is not empty.
8821func (nc NotificationCollection) hasNextLink() bool {
8822	return nc.NextLink != nil && len(*nc.NextLink) != 0
8823}
8824
8825// notificationCollectionPreparer prepares a request to retrieve the next set of results.
8826// It returns nil if no more results exist.
8827func (nc NotificationCollection) notificationCollectionPreparer(ctx context.Context) (*http.Request, error) {
8828	if !nc.hasNextLink() {
8829		return nil, nil
8830	}
8831	return autorest.Prepare((&http.Request{}).WithContext(ctx),
8832		autorest.AsJSON(),
8833		autorest.AsGet(),
8834		autorest.WithBaseURL(to.String(nc.NextLink)))
8835}
8836
8837// NotificationCollectionPage contains a page of NotificationContract values.
8838type NotificationCollectionPage struct {
8839	fn func(context.Context, NotificationCollection) (NotificationCollection, error)
8840	nc NotificationCollection
8841}
8842
8843// NextWithContext advances to the next page of values.  If there was an error making
8844// the request the page does not advance and the error is returned.
8845func (page *NotificationCollectionPage) NextWithContext(ctx context.Context) (err error) {
8846	if tracing.IsEnabled() {
8847		ctx = tracing.StartSpan(ctx, fqdn+"/NotificationCollectionPage.NextWithContext")
8848		defer func() {
8849			sc := -1
8850			if page.Response().Response.Response != nil {
8851				sc = page.Response().Response.Response.StatusCode
8852			}
8853			tracing.EndSpan(ctx, sc, err)
8854		}()
8855	}
8856	for {
8857		next, err := page.fn(ctx, page.nc)
8858		if err != nil {
8859			return err
8860		}
8861		page.nc = next
8862		if !next.hasNextLink() || !next.IsEmpty() {
8863			break
8864		}
8865	}
8866	return nil
8867}
8868
8869// Next advances to the next page of values.  If there was an error making
8870// the request the page does not advance and the error is returned.
8871// Deprecated: Use NextWithContext() instead.
8872func (page *NotificationCollectionPage) Next() error {
8873	return page.NextWithContext(context.Background())
8874}
8875
8876// NotDone returns true if the page enumeration should be started or is not yet complete.
8877func (page NotificationCollectionPage) NotDone() bool {
8878	return !page.nc.IsEmpty()
8879}
8880
8881// Response returns the raw server response from the last page request.
8882func (page NotificationCollectionPage) Response() NotificationCollection {
8883	return page.nc
8884}
8885
8886// Values returns the slice of values for the current page or nil if there are no values.
8887func (page NotificationCollectionPage) Values() []NotificationContract {
8888	if page.nc.IsEmpty() {
8889		return nil
8890	}
8891	return *page.nc.Value
8892}
8893
8894// Creates a new instance of the NotificationCollectionPage type.
8895func NewNotificationCollectionPage(cur NotificationCollection, getNextPage func(context.Context, NotificationCollection) (NotificationCollection, error)) NotificationCollectionPage {
8896	return NotificationCollectionPage{
8897		fn: getNextPage,
8898		nc: cur,
8899	}
8900}
8901
8902// NotificationContract notification details.
8903type NotificationContract struct {
8904	autorest.Response `json:"-"`
8905	// NotificationContractProperties - Notification entity contract properties.
8906	*NotificationContractProperties `json:"properties,omitempty"`
8907	// ID - READ-ONLY; Resource ID.
8908	ID *string `json:"id,omitempty"`
8909	// Name - READ-ONLY; Resource name.
8910	Name *string `json:"name,omitempty"`
8911	// Type - READ-ONLY; Resource type for API Management resource.
8912	Type *string `json:"type,omitempty"`
8913}
8914
8915// MarshalJSON is the custom marshaler for NotificationContract.
8916func (nc NotificationContract) MarshalJSON() ([]byte, error) {
8917	objectMap := make(map[string]interface{})
8918	if nc.NotificationContractProperties != nil {
8919		objectMap["properties"] = nc.NotificationContractProperties
8920	}
8921	return json.Marshal(objectMap)
8922}
8923
8924// UnmarshalJSON is the custom unmarshaler for NotificationContract struct.
8925func (nc *NotificationContract) UnmarshalJSON(body []byte) error {
8926	var m map[string]*json.RawMessage
8927	err := json.Unmarshal(body, &m)
8928	if err != nil {
8929		return err
8930	}
8931	for k, v := range m {
8932		switch k {
8933		case "properties":
8934			if v != nil {
8935				var notificationContractProperties NotificationContractProperties
8936				err = json.Unmarshal(*v, &notificationContractProperties)
8937				if err != nil {
8938					return err
8939				}
8940				nc.NotificationContractProperties = &notificationContractProperties
8941			}
8942		case "id":
8943			if v != nil {
8944				var ID string
8945				err = json.Unmarshal(*v, &ID)
8946				if err != nil {
8947					return err
8948				}
8949				nc.ID = &ID
8950			}
8951		case "name":
8952			if v != nil {
8953				var name string
8954				err = json.Unmarshal(*v, &name)
8955				if err != nil {
8956					return err
8957				}
8958				nc.Name = &name
8959			}
8960		case "type":
8961			if v != nil {
8962				var typeVar string
8963				err = json.Unmarshal(*v, &typeVar)
8964				if err != nil {
8965					return err
8966				}
8967				nc.Type = &typeVar
8968			}
8969		}
8970	}
8971
8972	return nil
8973}
8974
8975// NotificationContractProperties notification Contract properties.
8976type NotificationContractProperties struct {
8977	// Title - Title of the Notification.
8978	Title *string `json:"title,omitempty"`
8979	// Description - Description of the Notification.
8980	Description *string `json:"description,omitempty"`
8981	// Recipients - Recipient Parameter values.
8982	Recipients *RecipientsContractProperties `json:"recipients,omitempty"`
8983}
8984
8985// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details.
8986type OAuth2AuthenticationSettingsContract struct {
8987	// AuthorizationServerID - OAuth authorization server identifier.
8988	AuthorizationServerID *string `json:"authorizationServerId,omitempty"`
8989	// Scope - operations scope.
8990	Scope *string `json:"scope,omitempty"`
8991}
8992
8993// OpenIDAuthenticationSettingsContract API OAuth2 Authentication settings details.
8994type OpenIDAuthenticationSettingsContract struct {
8995	// OpenidProviderID - OAuth authorization server identifier.
8996	OpenidProviderID *string `json:"openidProviderId,omitempty"`
8997	// BearerTokenSendingMethods - How to send token to the server.
8998	BearerTokenSendingMethods *[]BearerTokenSendingMethods `json:"bearerTokenSendingMethods,omitempty"`
8999}
9000
9001// OpenIDConnectProviderCollection paged OpenIdProviders list representation.
9002type OpenIDConnectProviderCollection struct {
9003	autorest.Response `json:"-"`
9004	// Value - Page values.
9005	Value *[]OpenidConnectProviderContract `json:"value,omitempty"`
9006	// Count - Total record count number across all pages.
9007	Count *int64 `json:"count,omitempty"`
9008	// NextLink - Next page link if any.
9009	NextLink *string `json:"nextLink,omitempty"`
9010}
9011
9012// OpenIDConnectProviderCollectionIterator provides access to a complete listing of
9013// OpenidConnectProviderContract values.
9014type OpenIDConnectProviderCollectionIterator struct {
9015	i    int
9016	page OpenIDConnectProviderCollectionPage
9017}
9018
9019// NextWithContext advances to the next value.  If there was an error making
9020// the request the iterator does not advance and the error is returned.
9021func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) {
9022	if tracing.IsEnabled() {
9023		ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext")
9024		defer func() {
9025			sc := -1
9026			if iter.Response().Response.Response != nil {
9027				sc = iter.Response().Response.Response.StatusCode
9028			}
9029			tracing.EndSpan(ctx, sc, err)
9030		}()
9031	}
9032	iter.i++
9033	if iter.i < len(iter.page.Values()) {
9034		return nil
9035	}
9036	err = iter.page.NextWithContext(ctx)
9037	if err != nil {
9038		iter.i--
9039		return err
9040	}
9041	iter.i = 0
9042	return nil
9043}
9044
9045// Next advances to the next value.  If there was an error making
9046// the request the iterator does not advance and the error is returned.
9047// Deprecated: Use NextWithContext() instead.
9048func (iter *OpenIDConnectProviderCollectionIterator) Next() error {
9049	return iter.NextWithContext(context.Background())
9050}
9051
9052// NotDone returns true if the enumeration should be started or is not yet complete.
9053func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool {
9054	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9055}
9056
9057// Response returns the raw server response from the last page request.
9058func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection {
9059	return iter.page.Response()
9060}
9061
9062// Value returns the current value or a zero-initialized value if the
9063// iterator has advanced beyond the end of the collection.
9064func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract {
9065	if !iter.page.NotDone() {
9066		return OpenidConnectProviderContract{}
9067	}
9068	return iter.page.Values()[iter.i]
9069}
9070
9071// Creates a new instance of the OpenIDConnectProviderCollectionIterator type.
9072func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator {
9073	return OpenIDConnectProviderCollectionIterator{page: page}
9074}
9075
9076// IsEmpty returns true if the ListResult contains no values.
9077func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool {
9078	return oicpc.Value == nil || len(*oicpc.Value) == 0
9079}
9080
9081// hasNextLink returns true if the NextLink is not empty.
9082func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool {
9083	return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0
9084}
9085
9086// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results.
9087// It returns nil if no more results exist.
9088func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) {
9089	if !oicpc.hasNextLink() {
9090		return nil, nil
9091	}
9092	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9093		autorest.AsJSON(),
9094		autorest.AsGet(),
9095		autorest.WithBaseURL(to.String(oicpc.NextLink)))
9096}
9097
9098// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values.
9099type OpenIDConnectProviderCollectionPage struct {
9100	fn    func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)
9101	oicpc OpenIDConnectProviderCollection
9102}
9103
9104// NextWithContext advances to the next page of values.  If there was an error making
9105// the request the page does not advance and the error is returned.
9106func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) {
9107	if tracing.IsEnabled() {
9108		ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext")
9109		defer func() {
9110			sc := -1
9111			if page.Response().Response.Response != nil {
9112				sc = page.Response().Response.Response.StatusCode
9113			}
9114			tracing.EndSpan(ctx, sc, err)
9115		}()
9116	}
9117	for {
9118		next, err := page.fn(ctx, page.oicpc)
9119		if err != nil {
9120			return err
9121		}
9122		page.oicpc = next
9123		if !next.hasNextLink() || !next.IsEmpty() {
9124			break
9125		}
9126	}
9127	return nil
9128}
9129
9130// Next advances to the next page of values.  If there was an error making
9131// the request the page does not advance and the error is returned.
9132// Deprecated: Use NextWithContext() instead.
9133func (page *OpenIDConnectProviderCollectionPage) Next() error {
9134	return page.NextWithContext(context.Background())
9135}
9136
9137// NotDone returns true if the page enumeration should be started or is not yet complete.
9138func (page OpenIDConnectProviderCollectionPage) NotDone() bool {
9139	return !page.oicpc.IsEmpty()
9140}
9141
9142// Response returns the raw server response from the last page request.
9143func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection {
9144	return page.oicpc
9145}
9146
9147// Values returns the slice of values for the current page or nil if there are no values.
9148func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract {
9149	if page.oicpc.IsEmpty() {
9150		return nil
9151	}
9152	return *page.oicpc.Value
9153}
9154
9155// Creates a new instance of the OpenIDConnectProviderCollectionPage type.
9156func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage {
9157	return OpenIDConnectProviderCollectionPage{
9158		fn:    getNextPage,
9159		oicpc: cur,
9160	}
9161}
9162
9163// OpenidConnectProviderContract openId Connect Provider details.
9164type OpenidConnectProviderContract struct {
9165	autorest.Response `json:"-"`
9166	// OpenidConnectProviderContractProperties - OpenId Connect Provider contract properties.
9167	*OpenidConnectProviderContractProperties `json:"properties,omitempty"`
9168	// ID - READ-ONLY; Resource ID.
9169	ID *string `json:"id,omitempty"`
9170	// Name - READ-ONLY; Resource name.
9171	Name *string `json:"name,omitempty"`
9172	// Type - READ-ONLY; Resource type for API Management resource.
9173	Type *string `json:"type,omitempty"`
9174}
9175
9176// MarshalJSON is the custom marshaler for OpenidConnectProviderContract.
9177func (ocpc OpenidConnectProviderContract) MarshalJSON() ([]byte, error) {
9178	objectMap := make(map[string]interface{})
9179	if ocpc.OpenidConnectProviderContractProperties != nil {
9180		objectMap["properties"] = ocpc.OpenidConnectProviderContractProperties
9181	}
9182	return json.Marshal(objectMap)
9183}
9184
9185// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderContract struct.
9186func (ocpc *OpenidConnectProviderContract) UnmarshalJSON(body []byte) error {
9187	var m map[string]*json.RawMessage
9188	err := json.Unmarshal(body, &m)
9189	if err != nil {
9190		return err
9191	}
9192	for k, v := range m {
9193		switch k {
9194		case "properties":
9195			if v != nil {
9196				var openidConnectProviderContractProperties OpenidConnectProviderContractProperties
9197				err = json.Unmarshal(*v, &openidConnectProviderContractProperties)
9198				if err != nil {
9199					return err
9200				}
9201				ocpc.OpenidConnectProviderContractProperties = &openidConnectProviderContractProperties
9202			}
9203		case "id":
9204			if v != nil {
9205				var ID string
9206				err = json.Unmarshal(*v, &ID)
9207				if err != nil {
9208					return err
9209				}
9210				ocpc.ID = &ID
9211			}
9212		case "name":
9213			if v != nil {
9214				var name string
9215				err = json.Unmarshal(*v, &name)
9216				if err != nil {
9217					return err
9218				}
9219				ocpc.Name = &name
9220			}
9221		case "type":
9222			if v != nil {
9223				var typeVar string
9224				err = json.Unmarshal(*v, &typeVar)
9225				if err != nil {
9226					return err
9227				}
9228				ocpc.Type = &typeVar
9229			}
9230		}
9231	}
9232
9233	return nil
9234}
9235
9236// OpenidConnectProviderContractProperties openID Connect Providers Contract.
9237type OpenidConnectProviderContractProperties struct {
9238	// DisplayName - User-friendly OpenID Connect Provider name.
9239	DisplayName *string `json:"displayName,omitempty"`
9240	// Description - User-friendly description of OpenID Connect Provider.
9241	Description *string `json:"description,omitempty"`
9242	// MetadataEndpoint - Metadata endpoint URI.
9243	MetadataEndpoint *string `json:"metadataEndpoint,omitempty"`
9244	// ClientID - Client ID of developer console which is the client application.
9245	ClientID *string `json:"clientId,omitempty"`
9246	// ClientSecret - Client Secret of developer console which is the client application.
9247	ClientSecret *string `json:"clientSecret,omitempty"`
9248}
9249
9250// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation.
9251type OpenidConnectProviderUpdateContract struct {
9252	// OpenidConnectProviderUpdateContractProperties - OpenId Connect Provider Update contract properties.
9253	*OpenidConnectProviderUpdateContractProperties `json:"properties,omitempty"`
9254}
9255
9256// MarshalJSON is the custom marshaler for OpenidConnectProviderUpdateContract.
9257func (ocpuc OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) {
9258	objectMap := make(map[string]interface{})
9259	if ocpuc.OpenidConnectProviderUpdateContractProperties != nil {
9260		objectMap["properties"] = ocpuc.OpenidConnectProviderUpdateContractProperties
9261	}
9262	return json.Marshal(objectMap)
9263}
9264
9265// UnmarshalJSON is the custom unmarshaler for OpenidConnectProviderUpdateContract struct.
9266func (ocpuc *OpenidConnectProviderUpdateContract) UnmarshalJSON(body []byte) error {
9267	var m map[string]*json.RawMessage
9268	err := json.Unmarshal(body, &m)
9269	if err != nil {
9270		return err
9271	}
9272	for k, v := range m {
9273		switch k {
9274		case "properties":
9275			if v != nil {
9276				var openidConnectProviderUpdateContractProperties OpenidConnectProviderUpdateContractProperties
9277				err = json.Unmarshal(*v, &openidConnectProviderUpdateContractProperties)
9278				if err != nil {
9279					return err
9280				}
9281				ocpuc.OpenidConnectProviderUpdateContractProperties = &openidConnectProviderUpdateContractProperties
9282			}
9283		}
9284	}
9285
9286	return nil
9287}
9288
9289// OpenidConnectProviderUpdateContractProperties parameters supplied to the Update OpenID Connect Provider
9290// operation.
9291type OpenidConnectProviderUpdateContractProperties struct {
9292	// DisplayName - User-friendly OpenID Connect Provider name.
9293	DisplayName *string `json:"displayName,omitempty"`
9294	// Description - User-friendly description of OpenID Connect Provider.
9295	Description *string `json:"description,omitempty"`
9296	// MetadataEndpoint - Metadata endpoint URI.
9297	MetadataEndpoint *string `json:"metadataEndpoint,omitempty"`
9298	// ClientID - Client ID of developer console which is the client application.
9299	ClientID *string `json:"clientId,omitempty"`
9300	// ClientSecret - Client Secret of developer console which is the client application.
9301	ClientSecret *string `json:"clientSecret,omitempty"`
9302}
9303
9304// Operation REST API operation
9305type Operation struct {
9306	// Name - Operation name: {provider}/{resource}/{operation}
9307	Name *string `json:"name,omitempty"`
9308	// Display - The object that describes the operation.
9309	Display *OperationDisplay `json:"display,omitempty"`
9310	// Origin - The operation origin.
9311	Origin *string `json:"origin,omitempty"`
9312	// Properties - The operation properties.
9313	Properties interface{} `json:"properties,omitempty"`
9314}
9315
9316// OperationCollection paged Operation list representation.
9317type OperationCollection struct {
9318	autorest.Response `json:"-"`
9319	// Value - READ-ONLY; Page values.
9320	Value *[]OperationContract `json:"value,omitempty"`
9321	// Count - Total record count number across all pages.
9322	Count *int64 `json:"count,omitempty"`
9323	// NextLink - READ-ONLY; Next page link if any.
9324	NextLink *string `json:"nextLink,omitempty"`
9325}
9326
9327// MarshalJSON is the custom marshaler for OperationCollection.
9328func (oc OperationCollection) MarshalJSON() ([]byte, error) {
9329	objectMap := make(map[string]interface{})
9330	if oc.Count != nil {
9331		objectMap["count"] = oc.Count
9332	}
9333	return json.Marshal(objectMap)
9334}
9335
9336// OperationCollectionIterator provides access to a complete listing of OperationContract values.
9337type OperationCollectionIterator struct {
9338	i    int
9339	page OperationCollectionPage
9340}
9341
9342// NextWithContext advances to the next value.  If there was an error making
9343// the request the iterator does not advance and the error is returned.
9344func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) {
9345	if tracing.IsEnabled() {
9346		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext")
9347		defer func() {
9348			sc := -1
9349			if iter.Response().Response.Response != nil {
9350				sc = iter.Response().Response.Response.StatusCode
9351			}
9352			tracing.EndSpan(ctx, sc, err)
9353		}()
9354	}
9355	iter.i++
9356	if iter.i < len(iter.page.Values()) {
9357		return nil
9358	}
9359	err = iter.page.NextWithContext(ctx)
9360	if err != nil {
9361		iter.i--
9362		return err
9363	}
9364	iter.i = 0
9365	return nil
9366}
9367
9368// Next advances to the next value.  If there was an error making
9369// the request the iterator does not advance and the error is returned.
9370// Deprecated: Use NextWithContext() instead.
9371func (iter *OperationCollectionIterator) Next() error {
9372	return iter.NextWithContext(context.Background())
9373}
9374
9375// NotDone returns true if the enumeration should be started or is not yet complete.
9376func (iter OperationCollectionIterator) NotDone() bool {
9377	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9378}
9379
9380// Response returns the raw server response from the last page request.
9381func (iter OperationCollectionIterator) Response() OperationCollection {
9382	return iter.page.Response()
9383}
9384
9385// Value returns the current value or a zero-initialized value if the
9386// iterator has advanced beyond the end of the collection.
9387func (iter OperationCollectionIterator) Value() OperationContract {
9388	if !iter.page.NotDone() {
9389		return OperationContract{}
9390	}
9391	return iter.page.Values()[iter.i]
9392}
9393
9394// Creates a new instance of the OperationCollectionIterator type.
9395func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator {
9396	return OperationCollectionIterator{page: page}
9397}
9398
9399// IsEmpty returns true if the ListResult contains no values.
9400func (oc OperationCollection) IsEmpty() bool {
9401	return oc.Value == nil || len(*oc.Value) == 0
9402}
9403
9404// hasNextLink returns true if the NextLink is not empty.
9405func (oc OperationCollection) hasNextLink() bool {
9406	return oc.NextLink != nil && len(*oc.NextLink) != 0
9407}
9408
9409// operationCollectionPreparer prepares a request to retrieve the next set of results.
9410// It returns nil if no more results exist.
9411func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) {
9412	if !oc.hasNextLink() {
9413		return nil, nil
9414	}
9415	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9416		autorest.AsJSON(),
9417		autorest.AsGet(),
9418		autorest.WithBaseURL(to.String(oc.NextLink)))
9419}
9420
9421// OperationCollectionPage contains a page of OperationContract values.
9422type OperationCollectionPage struct {
9423	fn func(context.Context, OperationCollection) (OperationCollection, error)
9424	oc OperationCollection
9425}
9426
9427// NextWithContext advances to the next page of values.  If there was an error making
9428// the request the page does not advance and the error is returned.
9429func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) {
9430	if tracing.IsEnabled() {
9431		ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext")
9432		defer func() {
9433			sc := -1
9434			if page.Response().Response.Response != nil {
9435				sc = page.Response().Response.Response.StatusCode
9436			}
9437			tracing.EndSpan(ctx, sc, err)
9438		}()
9439	}
9440	for {
9441		next, err := page.fn(ctx, page.oc)
9442		if err != nil {
9443			return err
9444		}
9445		page.oc = next
9446		if !next.hasNextLink() || !next.IsEmpty() {
9447			break
9448		}
9449	}
9450	return nil
9451}
9452
9453// Next advances to the next page of values.  If there was an error making
9454// the request the page does not advance and the error is returned.
9455// Deprecated: Use NextWithContext() instead.
9456func (page *OperationCollectionPage) Next() error {
9457	return page.NextWithContext(context.Background())
9458}
9459
9460// NotDone returns true if the page enumeration should be started or is not yet complete.
9461func (page OperationCollectionPage) NotDone() bool {
9462	return !page.oc.IsEmpty()
9463}
9464
9465// Response returns the raw server response from the last page request.
9466func (page OperationCollectionPage) Response() OperationCollection {
9467	return page.oc
9468}
9469
9470// Values returns the slice of values for the current page or nil if there are no values.
9471func (page OperationCollectionPage) Values() []OperationContract {
9472	if page.oc.IsEmpty() {
9473		return nil
9474	}
9475	return *page.oc.Value
9476}
9477
9478// Creates a new instance of the OperationCollectionPage type.
9479func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage {
9480	return OperationCollectionPage{
9481		fn: getNextPage,
9482		oc: cur,
9483	}
9484}
9485
9486// OperationContract API Operation details.
9487type OperationContract struct {
9488	autorest.Response `json:"-"`
9489	// OperationContractProperties - Properties of the Operation Contract.
9490	*OperationContractProperties `json:"properties,omitempty"`
9491	// ID - READ-ONLY; Resource ID.
9492	ID *string `json:"id,omitempty"`
9493	// Name - READ-ONLY; Resource name.
9494	Name *string `json:"name,omitempty"`
9495	// Type - READ-ONLY; Resource type for API Management resource.
9496	Type *string `json:"type,omitempty"`
9497}
9498
9499// MarshalJSON is the custom marshaler for OperationContract.
9500func (oc OperationContract) MarshalJSON() ([]byte, error) {
9501	objectMap := make(map[string]interface{})
9502	if oc.OperationContractProperties != nil {
9503		objectMap["properties"] = oc.OperationContractProperties
9504	}
9505	return json.Marshal(objectMap)
9506}
9507
9508// UnmarshalJSON is the custom unmarshaler for OperationContract struct.
9509func (oc *OperationContract) UnmarshalJSON(body []byte) error {
9510	var m map[string]*json.RawMessage
9511	err := json.Unmarshal(body, &m)
9512	if err != nil {
9513		return err
9514	}
9515	for k, v := range m {
9516		switch k {
9517		case "properties":
9518			if v != nil {
9519				var operationContractProperties OperationContractProperties
9520				err = json.Unmarshal(*v, &operationContractProperties)
9521				if err != nil {
9522					return err
9523				}
9524				oc.OperationContractProperties = &operationContractProperties
9525			}
9526		case "id":
9527			if v != nil {
9528				var ID string
9529				err = json.Unmarshal(*v, &ID)
9530				if err != nil {
9531					return err
9532				}
9533				oc.ID = &ID
9534			}
9535		case "name":
9536			if v != nil {
9537				var name string
9538				err = json.Unmarshal(*v, &name)
9539				if err != nil {
9540					return err
9541				}
9542				oc.Name = &name
9543			}
9544		case "type":
9545			if v != nil {
9546				var typeVar string
9547				err = json.Unmarshal(*v, &typeVar)
9548				if err != nil {
9549					return err
9550				}
9551				oc.Type = &typeVar
9552			}
9553		}
9554	}
9555
9556	return nil
9557}
9558
9559// OperationContractProperties operation Contract Properties
9560type OperationContractProperties struct {
9561	// DisplayName - Operation Name.
9562	DisplayName *string `json:"displayName,omitempty"`
9563	// Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
9564	Method *string `json:"method,omitempty"`
9565	// URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
9566	URLTemplate *string `json:"urlTemplate,omitempty"`
9567	// TemplateParameters - Collection of URL template parameters.
9568	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
9569	// Description - Description of the operation. May include HTML formatting tags.
9570	Description *string `json:"description,omitempty"`
9571	// Request - An entity containing request details.
9572	Request *RequestContract `json:"request,omitempty"`
9573	// Responses - Array of Operation responses.
9574	Responses *[]ResponseContract `json:"responses,omitempty"`
9575	// Policies - Operation Policies
9576	Policies *string `json:"policies,omitempty"`
9577}
9578
9579// OperationDisplay the object that describes the operation.
9580type OperationDisplay struct {
9581	// Provider - Friendly name of the resource provider
9582	Provider *string `json:"provider,omitempty"`
9583	// Operation - Operation type: read, write, delete, listKeys/action, etc.
9584	Operation *string `json:"operation,omitempty"`
9585	// Resource - Resource type on which the operation is performed.
9586	Resource *string `json:"resource,omitempty"`
9587	// Description - Friendly name of the operation
9588	Description *string `json:"description,omitempty"`
9589}
9590
9591// OperationEntityBaseContract API Operation Entity Base Contract details.
9592type OperationEntityBaseContract struct {
9593	// TemplateParameters - Collection of URL template parameters.
9594	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
9595	// Description - Description of the operation. May include HTML formatting tags.
9596	Description *string `json:"description,omitempty"`
9597	// Request - An entity containing request details.
9598	Request *RequestContract `json:"request,omitempty"`
9599	// Responses - Array of Operation responses.
9600	Responses *[]ResponseContract `json:"responses,omitempty"`
9601	// Policies - Operation Policies
9602	Policies *string `json:"policies,omitempty"`
9603}
9604
9605// OperationListResult result of the request to list REST API operations. It contains a list of operations
9606// and a URL nextLink to get the next set of results.
9607type OperationListResult struct {
9608	autorest.Response `json:"-"`
9609	// Value - List of operations supported by the resource provider.
9610	Value *[]Operation `json:"value,omitempty"`
9611	// NextLink - URL to get the next set of operation list results if there are any.
9612	NextLink *string `json:"nextLink,omitempty"`
9613}
9614
9615// OperationListResultIterator provides access to a complete listing of Operation values.
9616type OperationListResultIterator struct {
9617	i    int
9618	page OperationListResultPage
9619}
9620
9621// NextWithContext advances to the next value.  If there was an error making
9622// the request the iterator does not advance and the error is returned.
9623func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
9624	if tracing.IsEnabled() {
9625		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
9626		defer func() {
9627			sc := -1
9628			if iter.Response().Response.Response != nil {
9629				sc = iter.Response().Response.Response.StatusCode
9630			}
9631			tracing.EndSpan(ctx, sc, err)
9632		}()
9633	}
9634	iter.i++
9635	if iter.i < len(iter.page.Values()) {
9636		return nil
9637	}
9638	err = iter.page.NextWithContext(ctx)
9639	if err != nil {
9640		iter.i--
9641		return err
9642	}
9643	iter.i = 0
9644	return nil
9645}
9646
9647// Next advances to the next value.  If there was an error making
9648// the request the iterator does not advance and the error is returned.
9649// Deprecated: Use NextWithContext() instead.
9650func (iter *OperationListResultIterator) Next() error {
9651	return iter.NextWithContext(context.Background())
9652}
9653
9654// NotDone returns true if the enumeration should be started or is not yet complete.
9655func (iter OperationListResultIterator) NotDone() bool {
9656	return iter.page.NotDone() && iter.i < len(iter.page.Values())
9657}
9658
9659// Response returns the raw server response from the last page request.
9660func (iter OperationListResultIterator) Response() OperationListResult {
9661	return iter.page.Response()
9662}
9663
9664// Value returns the current value or a zero-initialized value if the
9665// iterator has advanced beyond the end of the collection.
9666func (iter OperationListResultIterator) Value() Operation {
9667	if !iter.page.NotDone() {
9668		return Operation{}
9669	}
9670	return iter.page.Values()[iter.i]
9671}
9672
9673// Creates a new instance of the OperationListResultIterator type.
9674func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
9675	return OperationListResultIterator{page: page}
9676}
9677
9678// IsEmpty returns true if the ListResult contains no values.
9679func (olr OperationListResult) IsEmpty() bool {
9680	return olr.Value == nil || len(*olr.Value) == 0
9681}
9682
9683// hasNextLink returns true if the NextLink is not empty.
9684func (olr OperationListResult) hasNextLink() bool {
9685	return olr.NextLink != nil && len(*olr.NextLink) != 0
9686}
9687
9688// operationListResultPreparer prepares a request to retrieve the next set of results.
9689// It returns nil if no more results exist.
9690func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
9691	if !olr.hasNextLink() {
9692		return nil, nil
9693	}
9694	return autorest.Prepare((&http.Request{}).WithContext(ctx),
9695		autorest.AsJSON(),
9696		autorest.AsGet(),
9697		autorest.WithBaseURL(to.String(olr.NextLink)))
9698}
9699
9700// OperationListResultPage contains a page of Operation values.
9701type OperationListResultPage struct {
9702	fn  func(context.Context, OperationListResult) (OperationListResult, error)
9703	olr OperationListResult
9704}
9705
9706// NextWithContext advances to the next page of values.  If there was an error making
9707// the request the page does not advance and the error is returned.
9708func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
9709	if tracing.IsEnabled() {
9710		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
9711		defer func() {
9712			sc := -1
9713			if page.Response().Response.Response != nil {
9714				sc = page.Response().Response.Response.StatusCode
9715			}
9716			tracing.EndSpan(ctx, sc, err)
9717		}()
9718	}
9719	for {
9720		next, err := page.fn(ctx, page.olr)
9721		if err != nil {
9722			return err
9723		}
9724		page.olr = next
9725		if !next.hasNextLink() || !next.IsEmpty() {
9726			break
9727		}
9728	}
9729	return nil
9730}
9731
9732// Next advances to the next page of values.  If there was an error making
9733// the request the page does not advance and the error is returned.
9734// Deprecated: Use NextWithContext() instead.
9735func (page *OperationListResultPage) Next() error {
9736	return page.NextWithContext(context.Background())
9737}
9738
9739// NotDone returns true if the page enumeration should be started or is not yet complete.
9740func (page OperationListResultPage) NotDone() bool {
9741	return !page.olr.IsEmpty()
9742}
9743
9744// Response returns the raw server response from the last page request.
9745func (page OperationListResultPage) Response() OperationListResult {
9746	return page.olr
9747}
9748
9749// Values returns the slice of values for the current page or nil if there are no values.
9750func (page OperationListResultPage) Values() []Operation {
9751	if page.olr.IsEmpty() {
9752		return nil
9753	}
9754	return *page.olr.Value
9755}
9756
9757// Creates a new instance of the OperationListResultPage type.
9758func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
9759	return OperationListResultPage{
9760		fn:  getNextPage,
9761		olr: cur,
9762	}
9763}
9764
9765// OperationResultContract long Running Git Operation Results.
9766type OperationResultContract struct {
9767	autorest.Response `json:"-"`
9768	// OperationResultContractProperties - Properties of the Operation Contract.
9769	*OperationResultContractProperties `json:"properties,omitempty"`
9770	// ID - READ-ONLY; Resource ID.
9771	ID *string `json:"id,omitempty"`
9772	// Name - READ-ONLY; Resource name.
9773	Name *string `json:"name,omitempty"`
9774	// Type - READ-ONLY; Resource type for API Management resource.
9775	Type *string `json:"type,omitempty"`
9776}
9777
9778// MarshalJSON is the custom marshaler for OperationResultContract.
9779func (orc OperationResultContract) MarshalJSON() ([]byte, error) {
9780	objectMap := make(map[string]interface{})
9781	if orc.OperationResultContractProperties != nil {
9782		objectMap["properties"] = orc.OperationResultContractProperties
9783	}
9784	return json.Marshal(objectMap)
9785}
9786
9787// UnmarshalJSON is the custom unmarshaler for OperationResultContract struct.
9788func (orc *OperationResultContract) UnmarshalJSON(body []byte) error {
9789	var m map[string]*json.RawMessage
9790	err := json.Unmarshal(body, &m)
9791	if err != nil {
9792		return err
9793	}
9794	for k, v := range m {
9795		switch k {
9796		case "properties":
9797			if v != nil {
9798				var operationResultContractProperties OperationResultContractProperties
9799				err = json.Unmarshal(*v, &operationResultContractProperties)
9800				if err != nil {
9801					return err
9802				}
9803				orc.OperationResultContractProperties = &operationResultContractProperties
9804			}
9805		case "id":
9806			if v != nil {
9807				var ID string
9808				err = json.Unmarshal(*v, &ID)
9809				if err != nil {
9810					return err
9811				}
9812				orc.ID = &ID
9813			}
9814		case "name":
9815			if v != nil {
9816				var name string
9817				err = json.Unmarshal(*v, &name)
9818				if err != nil {
9819					return err
9820				}
9821				orc.Name = &name
9822			}
9823		case "type":
9824			if v != nil {
9825				var typeVar string
9826				err = json.Unmarshal(*v, &typeVar)
9827				if err != nil {
9828					return err
9829				}
9830				orc.Type = &typeVar
9831			}
9832		}
9833	}
9834
9835	return nil
9836}
9837
9838// OperationResultContractProperties operation Result.
9839type OperationResultContractProperties struct {
9840	// ID - Operation result identifier.
9841	ID *string `json:"id,omitempty"`
9842	// Status - Status of an async operation. Possible values include: 'AsyncOperationStatusStarted', 'AsyncOperationStatusInProgress', 'AsyncOperationStatusSucceeded', 'AsyncOperationStatusFailed'
9843	Status AsyncOperationStatus `json:"status,omitempty"`
9844	// 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.
9845	Started *date.Time `json:"started,omitempty"`
9846	// 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.
9847	Updated *date.Time `json:"updated,omitempty"`
9848	// ResultInfo - Optional result info.
9849	ResultInfo *string `json:"resultInfo,omitempty"`
9850	// Error - Error Body Contract
9851	Error *ErrorResponseBody `json:"error,omitempty"`
9852	// 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.
9853	ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"`
9854}
9855
9856// MarshalJSON is the custom marshaler for OperationResultContractProperties.
9857func (orcp OperationResultContractProperties) MarshalJSON() ([]byte, error) {
9858	objectMap := make(map[string]interface{})
9859	if orcp.ID != nil {
9860		objectMap["id"] = orcp.ID
9861	}
9862	if orcp.Status != "" {
9863		objectMap["status"] = orcp.Status
9864	}
9865	if orcp.Started != nil {
9866		objectMap["started"] = orcp.Started
9867	}
9868	if orcp.Updated != nil {
9869		objectMap["updated"] = orcp.Updated
9870	}
9871	if orcp.ResultInfo != nil {
9872		objectMap["resultInfo"] = orcp.ResultInfo
9873	}
9874	if orcp.Error != nil {
9875		objectMap["error"] = orcp.Error
9876	}
9877	return json.Marshal(objectMap)
9878}
9879
9880// OperationResultLogItemContract log of the entity being created, updated or deleted.
9881type OperationResultLogItemContract struct {
9882	// ObjectType - The type of entity contract.
9883	ObjectType *string `json:"objectType,omitempty"`
9884	// Action - Action like create/update/delete.
9885	Action *string `json:"action,omitempty"`
9886	// ObjectKey - Identifier of the entity being created/updated/deleted.
9887	ObjectKey *string `json:"objectKey,omitempty"`
9888}
9889
9890// OperationTagResourceContractProperties operation Entity contract Properties.
9891type OperationTagResourceContractProperties struct {
9892	// ID - Identifier of the operation in form /operations/{operationId}.
9893	ID *string `json:"id,omitempty"`
9894	// Name - READ-ONLY; Operation name.
9895	Name *string `json:"name,omitempty"`
9896	// APIName - READ-ONLY; API Name.
9897	APIName *string `json:"apiName,omitempty"`
9898	// APIRevision - READ-ONLY; API Revision.
9899	APIRevision *string `json:"apiRevision,omitempty"`
9900	// APIVersion - READ-ONLY; API Version.
9901	APIVersion *string `json:"apiVersion,omitempty"`
9902	// Description - READ-ONLY; Operation Description.
9903	Description *string `json:"description,omitempty"`
9904	// Method - READ-ONLY; A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
9905	Method *string `json:"method,omitempty"`
9906	// URLTemplate - READ-ONLY; Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
9907	URLTemplate *string `json:"urlTemplate,omitempty"`
9908}
9909
9910// MarshalJSON is the custom marshaler for OperationTagResourceContractProperties.
9911func (otrcp OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) {
9912	objectMap := make(map[string]interface{})
9913	if otrcp.ID != nil {
9914		objectMap["id"] = otrcp.ID
9915	}
9916	return json.Marshal(objectMap)
9917}
9918
9919// OperationUpdateContract API Operation Update Contract details.
9920type OperationUpdateContract struct {
9921	// OperationUpdateContractProperties - Properties of the API Operation entity that can be updated.
9922	*OperationUpdateContractProperties `json:"properties,omitempty"`
9923}
9924
9925// MarshalJSON is the custom marshaler for OperationUpdateContract.
9926func (ouc OperationUpdateContract) MarshalJSON() ([]byte, error) {
9927	objectMap := make(map[string]interface{})
9928	if ouc.OperationUpdateContractProperties != nil {
9929		objectMap["properties"] = ouc.OperationUpdateContractProperties
9930	}
9931	return json.Marshal(objectMap)
9932}
9933
9934// UnmarshalJSON is the custom unmarshaler for OperationUpdateContract struct.
9935func (ouc *OperationUpdateContract) UnmarshalJSON(body []byte) error {
9936	var m map[string]*json.RawMessage
9937	err := json.Unmarshal(body, &m)
9938	if err != nil {
9939		return err
9940	}
9941	for k, v := range m {
9942		switch k {
9943		case "properties":
9944			if v != nil {
9945				var operationUpdateContractProperties OperationUpdateContractProperties
9946				err = json.Unmarshal(*v, &operationUpdateContractProperties)
9947				if err != nil {
9948					return err
9949				}
9950				ouc.OperationUpdateContractProperties = &operationUpdateContractProperties
9951			}
9952		}
9953	}
9954
9955	return nil
9956}
9957
9958// OperationUpdateContractProperties operation Update Contract Properties.
9959type OperationUpdateContractProperties struct {
9960	// DisplayName - Operation Name.
9961	DisplayName *string `json:"displayName,omitempty"`
9962	// Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them.
9963	Method *string `json:"method,omitempty"`
9964	// URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date}
9965	URLTemplate *string `json:"urlTemplate,omitempty"`
9966	// TemplateParameters - Collection of URL template parameters.
9967	TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"`
9968	// Description - Description of the operation. May include HTML formatting tags.
9969	Description *string `json:"description,omitempty"`
9970	// Request - An entity containing request details.
9971	Request *RequestContract `json:"request,omitempty"`
9972	// Responses - Array of Operation responses.
9973	Responses *[]ResponseContract `json:"responses,omitempty"`
9974	// Policies - Operation Policies
9975	Policies *string `json:"policies,omitempty"`
9976}
9977
9978// ParameterContract operation parameters details.
9979type ParameterContract struct {
9980	// Name - Parameter name.
9981	Name *string `json:"name,omitempty"`
9982	// Description - Parameter description.
9983	Description *string `json:"description,omitempty"`
9984	// Type - Parameter type.
9985	Type *string `json:"type,omitempty"`
9986	// DefaultValue - Default parameter value.
9987	DefaultValue *string `json:"defaultValue,omitempty"`
9988	// Required - Specifies whether parameter is required or not.
9989	Required *bool `json:"required,omitempty"`
9990	// Values - Parameter values.
9991	Values *[]string `json:"values,omitempty"`
9992	// SchemaID - Schema identifier.
9993	SchemaID *string `json:"schemaId,omitempty"`
9994	// TypeName - Type name defined by the schema.
9995	TypeName *string `json:"typeName,omitempty"`
9996	// Examples - Exampled defined for the parameter.
9997	Examples map[string]*ParameterExampleContract `json:"examples"`
9998}
9999
10000// MarshalJSON is the custom marshaler for ParameterContract.
10001func (pc ParameterContract) MarshalJSON() ([]byte, error) {
10002	objectMap := make(map[string]interface{})
10003	if pc.Name != nil {
10004		objectMap["name"] = pc.Name
10005	}
10006	if pc.Description != nil {
10007		objectMap["description"] = pc.Description
10008	}
10009	if pc.Type != nil {
10010		objectMap["type"] = pc.Type
10011	}
10012	if pc.DefaultValue != nil {
10013		objectMap["defaultValue"] = pc.DefaultValue
10014	}
10015	if pc.Required != nil {
10016		objectMap["required"] = pc.Required
10017	}
10018	if pc.Values != nil {
10019		objectMap["values"] = pc.Values
10020	}
10021	if pc.SchemaID != nil {
10022		objectMap["schemaId"] = pc.SchemaID
10023	}
10024	if pc.TypeName != nil {
10025		objectMap["typeName"] = pc.TypeName
10026	}
10027	if pc.Examples != nil {
10028		objectMap["examples"] = pc.Examples
10029	}
10030	return json.Marshal(objectMap)
10031}
10032
10033// ParameterExampleContract parameter example.
10034type ParameterExampleContract struct {
10035	// Summary - Short description for the example
10036	Summary *string `json:"summary,omitempty"`
10037	// Description - Long description for the example
10038	Description *string `json:"description,omitempty"`
10039	// Value - Example value. May be a primitive value, or an object.
10040	Value interface{} `json:"value,omitempty"`
10041	// ExternalValue - A URL that points to the literal example
10042	ExternalValue *string `json:"externalValue,omitempty"`
10043}
10044
10045// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
10046type PipelineDiagnosticSettings struct {
10047	// Request - Diagnostic settings for request.
10048	Request *HTTPMessageDiagnostic `json:"request,omitempty"`
10049	// Response - Diagnostic settings for response.
10050	Response *HTTPMessageDiagnostic `json:"response,omitempty"`
10051}
10052
10053// PolicyCollection the response of the list policy operation.
10054type PolicyCollection struct {
10055	autorest.Response `json:"-"`
10056	// Value - Policy Contract value.
10057	Value *[]PolicyContract `json:"value,omitempty"`
10058	// Count - Total record count number.
10059	Count *int64 `json:"count,omitempty"`
10060	// NextLink - Next page link if any.
10061	NextLink *string `json:"nextLink,omitempty"`
10062}
10063
10064// PolicyContract policy Contract details.
10065type PolicyContract struct {
10066	autorest.Response `json:"-"`
10067	// PolicyContractProperties - Properties of the Policy.
10068	*PolicyContractProperties `json:"properties,omitempty"`
10069	// ID - READ-ONLY; Resource ID.
10070	ID *string `json:"id,omitempty"`
10071	// Name - READ-ONLY; Resource name.
10072	Name *string `json:"name,omitempty"`
10073	// Type - READ-ONLY; Resource type for API Management resource.
10074	Type *string `json:"type,omitempty"`
10075}
10076
10077// MarshalJSON is the custom marshaler for PolicyContract.
10078func (pc PolicyContract) MarshalJSON() ([]byte, error) {
10079	objectMap := make(map[string]interface{})
10080	if pc.PolicyContractProperties != nil {
10081		objectMap["properties"] = pc.PolicyContractProperties
10082	}
10083	return json.Marshal(objectMap)
10084}
10085
10086// UnmarshalJSON is the custom unmarshaler for PolicyContract struct.
10087func (pc *PolicyContract) UnmarshalJSON(body []byte) error {
10088	var m map[string]*json.RawMessage
10089	err := json.Unmarshal(body, &m)
10090	if err != nil {
10091		return err
10092	}
10093	for k, v := range m {
10094		switch k {
10095		case "properties":
10096			if v != nil {
10097				var policyContractProperties PolicyContractProperties
10098				err = json.Unmarshal(*v, &policyContractProperties)
10099				if err != nil {
10100					return err
10101				}
10102				pc.PolicyContractProperties = &policyContractProperties
10103			}
10104		case "id":
10105			if v != nil {
10106				var ID string
10107				err = json.Unmarshal(*v, &ID)
10108				if err != nil {
10109					return err
10110				}
10111				pc.ID = &ID
10112			}
10113		case "name":
10114			if v != nil {
10115				var name string
10116				err = json.Unmarshal(*v, &name)
10117				if err != nil {
10118					return err
10119				}
10120				pc.Name = &name
10121			}
10122		case "type":
10123			if v != nil {
10124				var typeVar string
10125				err = json.Unmarshal(*v, &typeVar)
10126				if err != nil {
10127					return err
10128				}
10129				pc.Type = &typeVar
10130			}
10131		}
10132	}
10133
10134	return nil
10135}
10136
10137// PolicyContractProperties policy contract Properties.
10138type PolicyContractProperties struct {
10139	// Value - Contents of the Policy as defined by the format.
10140	Value *string `json:"value,omitempty"`
10141	// Format - Format of the policyContent. Possible values include: 'PolicyContentFormatXML', 'PolicyContentFormatXMLLink', 'PolicyContentFormatRawxml', 'PolicyContentFormatRawxmlLink'
10142	Format PolicyContentFormat `json:"format,omitempty"`
10143}
10144
10145// PolicyDescriptionCollection descriptions of APIM policies.
10146type PolicyDescriptionCollection struct {
10147	autorest.Response `json:"-"`
10148	// Value - Descriptions of APIM policies.
10149	Value *[]PolicyDescriptionContract `json:"value,omitempty"`
10150	// Count - Total record count number.
10151	Count *int64 `json:"count,omitempty"`
10152}
10153
10154// PolicyDescriptionContract policy description details.
10155type PolicyDescriptionContract struct {
10156	// PolicyDescriptionContractProperties - Policy description contract properties.
10157	*PolicyDescriptionContractProperties `json:"properties,omitempty"`
10158	// ID - READ-ONLY; Resource ID.
10159	ID *string `json:"id,omitempty"`
10160	// Name - READ-ONLY; Resource name.
10161	Name *string `json:"name,omitempty"`
10162	// Type - READ-ONLY; Resource type for API Management resource.
10163	Type *string `json:"type,omitempty"`
10164}
10165
10166// MarshalJSON is the custom marshaler for PolicyDescriptionContract.
10167func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) {
10168	objectMap := make(map[string]interface{})
10169	if pdc.PolicyDescriptionContractProperties != nil {
10170		objectMap["properties"] = pdc.PolicyDescriptionContractProperties
10171	}
10172	return json.Marshal(objectMap)
10173}
10174
10175// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct.
10176func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error {
10177	var m map[string]*json.RawMessage
10178	err := json.Unmarshal(body, &m)
10179	if err != nil {
10180		return err
10181	}
10182	for k, v := range m {
10183		switch k {
10184		case "properties":
10185			if v != nil {
10186				var policyDescriptionContractProperties PolicyDescriptionContractProperties
10187				err = json.Unmarshal(*v, &policyDescriptionContractProperties)
10188				if err != nil {
10189					return err
10190				}
10191				pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties
10192			}
10193		case "id":
10194			if v != nil {
10195				var ID string
10196				err = json.Unmarshal(*v, &ID)
10197				if err != nil {
10198					return err
10199				}
10200				pdc.ID = &ID
10201			}
10202		case "name":
10203			if v != nil {
10204				var name string
10205				err = json.Unmarshal(*v, &name)
10206				if err != nil {
10207					return err
10208				}
10209				pdc.Name = &name
10210			}
10211		case "type":
10212			if v != nil {
10213				var typeVar string
10214				err = json.Unmarshal(*v, &typeVar)
10215				if err != nil {
10216					return err
10217				}
10218				pdc.Type = &typeVar
10219			}
10220		}
10221	}
10222
10223	return nil
10224}
10225
10226// PolicyDescriptionContractProperties policy description properties.
10227type PolicyDescriptionContractProperties struct {
10228	// Description - READ-ONLY; Policy description.
10229	Description *string `json:"description,omitempty"`
10230	// Scope - READ-ONLY; Binary OR value of the Snippet scope.
10231	Scope *int64 `json:"scope,omitempty"`
10232}
10233
10234// MarshalJSON is the custom marshaler for PolicyDescriptionContractProperties.
10235func (pdcp PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) {
10236	objectMap := make(map[string]interface{})
10237	return json.Marshal(objectMap)
10238}
10239
10240// PortalDelegationSettings delegation settings for a developer portal.
10241type PortalDelegationSettings struct {
10242	autorest.Response `json:"-"`
10243	// PortalDelegationSettingsProperties - Delegation settings contract properties.
10244	*PortalDelegationSettingsProperties `json:"properties,omitempty"`
10245	// ID - READ-ONLY; Resource ID.
10246	ID *string `json:"id,omitempty"`
10247	// Name - READ-ONLY; Resource name.
10248	Name *string `json:"name,omitempty"`
10249	// Type - READ-ONLY; Resource type for API Management resource.
10250	Type *string `json:"type,omitempty"`
10251}
10252
10253// MarshalJSON is the custom marshaler for PortalDelegationSettings.
10254func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) {
10255	objectMap := make(map[string]interface{})
10256	if pds.PortalDelegationSettingsProperties != nil {
10257		objectMap["properties"] = pds.PortalDelegationSettingsProperties
10258	}
10259	return json.Marshal(objectMap)
10260}
10261
10262// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct.
10263func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error {
10264	var m map[string]*json.RawMessage
10265	err := json.Unmarshal(body, &m)
10266	if err != nil {
10267		return err
10268	}
10269	for k, v := range m {
10270		switch k {
10271		case "properties":
10272			if v != nil {
10273				var portalDelegationSettingsProperties PortalDelegationSettingsProperties
10274				err = json.Unmarshal(*v, &portalDelegationSettingsProperties)
10275				if err != nil {
10276					return err
10277				}
10278				pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties
10279			}
10280		case "id":
10281			if v != nil {
10282				var ID string
10283				err = json.Unmarshal(*v, &ID)
10284				if err != nil {
10285					return err
10286				}
10287				pds.ID = &ID
10288			}
10289		case "name":
10290			if v != nil {
10291				var name string
10292				err = json.Unmarshal(*v, &name)
10293				if err != nil {
10294					return err
10295				}
10296				pds.Name = &name
10297			}
10298		case "type":
10299			if v != nil {
10300				var typeVar string
10301				err = json.Unmarshal(*v, &typeVar)
10302				if err != nil {
10303					return err
10304				}
10305				pds.Type = &typeVar
10306			}
10307		}
10308	}
10309
10310	return nil
10311}
10312
10313// PortalDelegationSettingsProperties delegation settings contract properties.
10314type PortalDelegationSettingsProperties struct {
10315	// URL - A delegation Url.
10316	URL *string `json:"url,omitempty"`
10317	// ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management.
10318	ValidationKey *string `json:"validationKey,omitempty"`
10319	// Subscriptions - Subscriptions delegation settings.
10320	Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"`
10321	// UserRegistration - User registration delegation settings.
10322	UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"`
10323}
10324
10325// PortalRevisionCollection paged list of portal revisions.
10326type PortalRevisionCollection struct {
10327	autorest.Response `json:"-"`
10328	// Value - READ-ONLY; Collection of portal revisions.
10329	Value *[]PortalRevisionContract `json:"value,omitempty"`
10330	// NextLink - READ-ONLY; Next page link, if any.
10331	NextLink *string `json:"nextLink,omitempty"`
10332}
10333
10334// MarshalJSON is the custom marshaler for PortalRevisionCollection.
10335func (prc PortalRevisionCollection) MarshalJSON() ([]byte, error) {
10336	objectMap := make(map[string]interface{})
10337	return json.Marshal(objectMap)
10338}
10339
10340// PortalRevisionCollectionIterator provides access to a complete listing of PortalRevisionContract values.
10341type PortalRevisionCollectionIterator struct {
10342	i    int
10343	page PortalRevisionCollectionPage
10344}
10345
10346// NextWithContext advances to the next value.  If there was an error making
10347// the request the iterator does not advance and the error is returned.
10348func (iter *PortalRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10349	if tracing.IsEnabled() {
10350		ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionIterator.NextWithContext")
10351		defer func() {
10352			sc := -1
10353			if iter.Response().Response.Response != nil {
10354				sc = iter.Response().Response.Response.StatusCode
10355			}
10356			tracing.EndSpan(ctx, sc, err)
10357		}()
10358	}
10359	iter.i++
10360	if iter.i < len(iter.page.Values()) {
10361		return nil
10362	}
10363	err = iter.page.NextWithContext(ctx)
10364	if err != nil {
10365		iter.i--
10366		return err
10367	}
10368	iter.i = 0
10369	return nil
10370}
10371
10372// Next advances to the next value.  If there was an error making
10373// the request the iterator does not advance and the error is returned.
10374// Deprecated: Use NextWithContext() instead.
10375func (iter *PortalRevisionCollectionIterator) Next() error {
10376	return iter.NextWithContext(context.Background())
10377}
10378
10379// NotDone returns true if the enumeration should be started or is not yet complete.
10380func (iter PortalRevisionCollectionIterator) NotDone() bool {
10381	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10382}
10383
10384// Response returns the raw server response from the last page request.
10385func (iter PortalRevisionCollectionIterator) Response() PortalRevisionCollection {
10386	return iter.page.Response()
10387}
10388
10389// Value returns the current value or a zero-initialized value if the
10390// iterator has advanced beyond the end of the collection.
10391func (iter PortalRevisionCollectionIterator) Value() PortalRevisionContract {
10392	if !iter.page.NotDone() {
10393		return PortalRevisionContract{}
10394	}
10395	return iter.page.Values()[iter.i]
10396}
10397
10398// Creates a new instance of the PortalRevisionCollectionIterator type.
10399func NewPortalRevisionCollectionIterator(page PortalRevisionCollectionPage) PortalRevisionCollectionIterator {
10400	return PortalRevisionCollectionIterator{page: page}
10401}
10402
10403// IsEmpty returns true if the ListResult contains no values.
10404func (prc PortalRevisionCollection) IsEmpty() bool {
10405	return prc.Value == nil || len(*prc.Value) == 0
10406}
10407
10408// hasNextLink returns true if the NextLink is not empty.
10409func (prc PortalRevisionCollection) hasNextLink() bool {
10410	return prc.NextLink != nil && len(*prc.NextLink) != 0
10411}
10412
10413// portalRevisionCollectionPreparer prepares a request to retrieve the next set of results.
10414// It returns nil if no more results exist.
10415func (prc PortalRevisionCollection) portalRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) {
10416	if !prc.hasNextLink() {
10417		return nil, nil
10418	}
10419	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10420		autorest.AsJSON(),
10421		autorest.AsGet(),
10422		autorest.WithBaseURL(to.String(prc.NextLink)))
10423}
10424
10425// PortalRevisionCollectionPage contains a page of PortalRevisionContract values.
10426type PortalRevisionCollectionPage struct {
10427	fn  func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error)
10428	prc PortalRevisionCollection
10429}
10430
10431// NextWithContext advances to the next page of values.  If there was an error making
10432// the request the page does not advance and the error is returned.
10433func (page *PortalRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) {
10434	if tracing.IsEnabled() {
10435		ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionPage.NextWithContext")
10436		defer func() {
10437			sc := -1
10438			if page.Response().Response.Response != nil {
10439				sc = page.Response().Response.Response.StatusCode
10440			}
10441			tracing.EndSpan(ctx, sc, err)
10442		}()
10443	}
10444	for {
10445		next, err := page.fn(ctx, page.prc)
10446		if err != nil {
10447			return err
10448		}
10449		page.prc = next
10450		if !next.hasNextLink() || !next.IsEmpty() {
10451			break
10452		}
10453	}
10454	return nil
10455}
10456
10457// Next advances to the next page of values.  If there was an error making
10458// the request the page does not advance and the error is returned.
10459// Deprecated: Use NextWithContext() instead.
10460func (page *PortalRevisionCollectionPage) Next() error {
10461	return page.NextWithContext(context.Background())
10462}
10463
10464// NotDone returns true if the page enumeration should be started or is not yet complete.
10465func (page PortalRevisionCollectionPage) NotDone() bool {
10466	return !page.prc.IsEmpty()
10467}
10468
10469// Response returns the raw server response from the last page request.
10470func (page PortalRevisionCollectionPage) Response() PortalRevisionCollection {
10471	return page.prc
10472}
10473
10474// Values returns the slice of values for the current page or nil if there are no values.
10475func (page PortalRevisionCollectionPage) Values() []PortalRevisionContract {
10476	if page.prc.IsEmpty() {
10477		return nil
10478	}
10479	return *page.prc.Value
10480}
10481
10482// Creates a new instance of the PortalRevisionCollectionPage type.
10483func NewPortalRevisionCollectionPage(cur PortalRevisionCollection, getNextPage func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error)) PortalRevisionCollectionPage {
10484	return PortalRevisionCollectionPage{
10485		fn:  getNextPage,
10486		prc: cur,
10487	}
10488}
10489
10490// PortalRevisionContract portal Revision's contract details.
10491type PortalRevisionContract struct {
10492	autorest.Response `json:"-"`
10493	// PortalRevisionContractProperties - Properties of the portal revisions.
10494	*PortalRevisionContractProperties `json:"properties,omitempty"`
10495	// ID - READ-ONLY; Resource ID.
10496	ID *string `json:"id,omitempty"`
10497	// Name - READ-ONLY; Resource name.
10498	Name *string `json:"name,omitempty"`
10499	// Type - READ-ONLY; Resource type for API Management resource.
10500	Type *string `json:"type,omitempty"`
10501}
10502
10503// MarshalJSON is the custom marshaler for PortalRevisionContract.
10504func (prc PortalRevisionContract) MarshalJSON() ([]byte, error) {
10505	objectMap := make(map[string]interface{})
10506	if prc.PortalRevisionContractProperties != nil {
10507		objectMap["properties"] = prc.PortalRevisionContractProperties
10508	}
10509	return json.Marshal(objectMap)
10510}
10511
10512// UnmarshalJSON is the custom unmarshaler for PortalRevisionContract struct.
10513func (prc *PortalRevisionContract) UnmarshalJSON(body []byte) error {
10514	var m map[string]*json.RawMessage
10515	err := json.Unmarshal(body, &m)
10516	if err != nil {
10517		return err
10518	}
10519	for k, v := range m {
10520		switch k {
10521		case "properties":
10522			if v != nil {
10523				var portalRevisionContractProperties PortalRevisionContractProperties
10524				err = json.Unmarshal(*v, &portalRevisionContractProperties)
10525				if err != nil {
10526					return err
10527				}
10528				prc.PortalRevisionContractProperties = &portalRevisionContractProperties
10529			}
10530		case "id":
10531			if v != nil {
10532				var ID string
10533				err = json.Unmarshal(*v, &ID)
10534				if err != nil {
10535					return err
10536				}
10537				prc.ID = &ID
10538			}
10539		case "name":
10540			if v != nil {
10541				var name string
10542				err = json.Unmarshal(*v, &name)
10543				if err != nil {
10544					return err
10545				}
10546				prc.Name = &name
10547			}
10548		case "type":
10549			if v != nil {
10550				var typeVar string
10551				err = json.Unmarshal(*v, &typeVar)
10552				if err != nil {
10553					return err
10554				}
10555				prc.Type = &typeVar
10556			}
10557		}
10558	}
10559
10560	return nil
10561}
10562
10563// PortalRevisionContractProperties ...
10564type PortalRevisionContractProperties struct {
10565	// Description - Portal revision description.
10566	Description *string `json:"description,omitempty"`
10567	// StatusDetails - READ-ONLY; Portal revision publishing status details.
10568	StatusDetails *string `json:"statusDetails,omitempty"`
10569	// Status - READ-ONLY; Status of the portal's revision. Possible values include: 'PortalRevisionStatusPending', 'PortalRevisionStatusPublishing', 'PortalRevisionStatusCompleted', 'PortalRevisionStatusFailed'
10570	Status PortalRevisionStatus `json:"status,omitempty"`
10571	// IsCurrent - Indicates if the portal's revision is public.
10572	IsCurrent *bool `json:"isCurrent,omitempty"`
10573	// CreatedDateTime - READ-ONLY; Portal's revision creation date and time.
10574	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
10575	// UpdatedDateTime - READ-ONLY; Last updated date and time.
10576	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
10577}
10578
10579// MarshalJSON is the custom marshaler for PortalRevisionContractProperties.
10580func (prcp PortalRevisionContractProperties) MarshalJSON() ([]byte, error) {
10581	objectMap := make(map[string]interface{})
10582	if prcp.Description != nil {
10583		objectMap["description"] = prcp.Description
10584	}
10585	if prcp.IsCurrent != nil {
10586		objectMap["isCurrent"] = prcp.IsCurrent
10587	}
10588	return json.Marshal(objectMap)
10589}
10590
10591// PortalRevisionCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
10592// long-running operation.
10593type PortalRevisionCreateOrUpdateFuture struct {
10594	azure.FutureAPI
10595	// Result returns the result of the asynchronous operation.
10596	// If the operation has not completed it will return an error.
10597	Result func(PortalRevisionClient) (PortalRevisionContract, error)
10598}
10599
10600// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10601func (future *PortalRevisionCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10602	var azFuture azure.Future
10603	if err := json.Unmarshal(body, &azFuture); err != nil {
10604		return err
10605	}
10606	future.FutureAPI = &azFuture
10607	future.Result = future.result
10608	return nil
10609}
10610
10611// result is the default implementation for PortalRevisionCreateOrUpdateFuture.Result.
10612func (future *PortalRevisionCreateOrUpdateFuture) result(client PortalRevisionClient) (prc PortalRevisionContract, err error) {
10613	var done bool
10614	done, err = future.DoneWithContext(context.Background(), client)
10615	if err != nil {
10616		err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10617		return
10618	}
10619	if !done {
10620		prc.Response.Response = future.Response()
10621		err = azure.NewAsyncOpIncompleteError("apimanagement.PortalRevisionCreateOrUpdateFuture")
10622		return
10623	}
10624	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10625	if prc.Response.Response, err = future.GetResult(sender); err == nil && prc.Response.Response.StatusCode != http.StatusNoContent {
10626		prc, err = client.CreateOrUpdateResponder(prc.Response.Response)
10627		if err != nil {
10628			err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionCreateOrUpdateFuture", "Result", prc.Response.Response, "Failure responding to request")
10629		}
10630	}
10631	return
10632}
10633
10634// PortalRevisionUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
10635// operation.
10636type PortalRevisionUpdateFuture struct {
10637	azure.FutureAPI
10638	// Result returns the result of the asynchronous operation.
10639	// If the operation has not completed it will return an error.
10640	Result func(PortalRevisionClient) (PortalRevisionContract, error)
10641}
10642
10643// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10644func (future *PortalRevisionUpdateFuture) UnmarshalJSON(body []byte) error {
10645	var azFuture azure.Future
10646	if err := json.Unmarshal(body, &azFuture); err != nil {
10647		return err
10648	}
10649	future.FutureAPI = &azFuture
10650	future.Result = future.result
10651	return nil
10652}
10653
10654// result is the default implementation for PortalRevisionUpdateFuture.Result.
10655func (future *PortalRevisionUpdateFuture) result(client PortalRevisionClient) (prc PortalRevisionContract, err error) {
10656	var done bool
10657	done, err = future.DoneWithContext(context.Background(), client)
10658	if err != nil {
10659		err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionUpdateFuture", "Result", future.Response(), "Polling failure")
10660		return
10661	}
10662	if !done {
10663		prc.Response.Response = future.Response()
10664		err = azure.NewAsyncOpIncompleteError("apimanagement.PortalRevisionUpdateFuture")
10665		return
10666	}
10667	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10668	if prc.Response.Response, err = future.GetResult(sender); err == nil && prc.Response.Response.StatusCode != http.StatusNoContent {
10669		prc, err = client.UpdateResponder(prc.Response.Response)
10670		if err != nil {
10671			err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionUpdateFuture", "Result", prc.Response.Response, "Failure responding to request")
10672		}
10673	}
10674	return
10675}
10676
10677// PortalSettingsCollection descriptions of APIM policies.
10678type PortalSettingsCollection struct {
10679	autorest.Response `json:"-"`
10680	// Value - Descriptions of APIM policies.
10681	Value *[]PortalSettingsContract `json:"value,omitempty"`
10682	// Count - Total record count number.
10683	Count *int64 `json:"count,omitempty"`
10684}
10685
10686// PortalSettingsContract portal Settings for the Developer Portal.
10687type PortalSettingsContract struct {
10688	// PortalSettingsContractProperties - Portal Settings contract properties.
10689	*PortalSettingsContractProperties `json:"properties,omitempty"`
10690	// ID - READ-ONLY; Resource ID.
10691	ID *string `json:"id,omitempty"`
10692	// Name - READ-ONLY; Resource name.
10693	Name *string `json:"name,omitempty"`
10694	// Type - READ-ONLY; Resource type for API Management resource.
10695	Type *string `json:"type,omitempty"`
10696}
10697
10698// MarshalJSON is the custom marshaler for PortalSettingsContract.
10699func (psc PortalSettingsContract) MarshalJSON() ([]byte, error) {
10700	objectMap := make(map[string]interface{})
10701	if psc.PortalSettingsContractProperties != nil {
10702		objectMap["properties"] = psc.PortalSettingsContractProperties
10703	}
10704	return json.Marshal(objectMap)
10705}
10706
10707// UnmarshalJSON is the custom unmarshaler for PortalSettingsContract struct.
10708func (psc *PortalSettingsContract) UnmarshalJSON(body []byte) error {
10709	var m map[string]*json.RawMessage
10710	err := json.Unmarshal(body, &m)
10711	if err != nil {
10712		return err
10713	}
10714	for k, v := range m {
10715		switch k {
10716		case "properties":
10717			if v != nil {
10718				var portalSettingsContractProperties PortalSettingsContractProperties
10719				err = json.Unmarshal(*v, &portalSettingsContractProperties)
10720				if err != nil {
10721					return err
10722				}
10723				psc.PortalSettingsContractProperties = &portalSettingsContractProperties
10724			}
10725		case "id":
10726			if v != nil {
10727				var ID string
10728				err = json.Unmarshal(*v, &ID)
10729				if err != nil {
10730					return err
10731				}
10732				psc.ID = &ID
10733			}
10734		case "name":
10735			if v != nil {
10736				var name string
10737				err = json.Unmarshal(*v, &name)
10738				if err != nil {
10739					return err
10740				}
10741				psc.Name = &name
10742			}
10743		case "type":
10744			if v != nil {
10745				var typeVar string
10746				err = json.Unmarshal(*v, &typeVar)
10747				if err != nil {
10748					return err
10749				}
10750				psc.Type = &typeVar
10751			}
10752		}
10753	}
10754
10755	return nil
10756}
10757
10758// PortalSettingsContractProperties sign-in settings contract properties.
10759type PortalSettingsContractProperties struct {
10760	// URL - A delegation Url.
10761	URL *string `json:"url,omitempty"`
10762	// ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management.
10763	ValidationKey *string `json:"validationKey,omitempty"`
10764	// Subscriptions - Subscriptions delegation settings.
10765	Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"`
10766	// UserRegistration - User registration delegation settings.
10767	UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"`
10768	// Enabled - Redirect Anonymous users to the Sign-In page.
10769	Enabled *bool `json:"enabled,omitempty"`
10770	// TermsOfService - Terms of service contract properties.
10771	TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"`
10772}
10773
10774// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
10775type PortalSettingValidationKeyContract struct {
10776	autorest.Response `json:"-"`
10777	// ValidationKey - This is secret value of the validation key in portal settings.
10778	ValidationKey *string `json:"validationKey,omitempty"`
10779}
10780
10781// PortalSigninSettingProperties sign-in settings contract properties.
10782type PortalSigninSettingProperties struct {
10783	// Enabled - Redirect Anonymous users to the Sign-In page.
10784	Enabled *bool `json:"enabled,omitempty"`
10785}
10786
10787// PortalSigninSettings sign-In settings for the Developer Portal.
10788type PortalSigninSettings struct {
10789	autorest.Response `json:"-"`
10790	// PortalSigninSettingProperties - Sign-in settings contract properties.
10791	*PortalSigninSettingProperties `json:"properties,omitempty"`
10792	// ID - READ-ONLY; Resource ID.
10793	ID *string `json:"id,omitempty"`
10794	// Name - READ-ONLY; Resource name.
10795	Name *string `json:"name,omitempty"`
10796	// Type - READ-ONLY; Resource type for API Management resource.
10797	Type *string `json:"type,omitempty"`
10798}
10799
10800// MarshalJSON is the custom marshaler for PortalSigninSettings.
10801func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) {
10802	objectMap := make(map[string]interface{})
10803	if pss.PortalSigninSettingProperties != nil {
10804		objectMap["properties"] = pss.PortalSigninSettingProperties
10805	}
10806	return json.Marshal(objectMap)
10807}
10808
10809// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct.
10810func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error {
10811	var m map[string]*json.RawMessage
10812	err := json.Unmarshal(body, &m)
10813	if err != nil {
10814		return err
10815	}
10816	for k, v := range m {
10817		switch k {
10818		case "properties":
10819			if v != nil {
10820				var portalSigninSettingProperties PortalSigninSettingProperties
10821				err = json.Unmarshal(*v, &portalSigninSettingProperties)
10822				if err != nil {
10823					return err
10824				}
10825				pss.PortalSigninSettingProperties = &portalSigninSettingProperties
10826			}
10827		case "id":
10828			if v != nil {
10829				var ID string
10830				err = json.Unmarshal(*v, &ID)
10831				if err != nil {
10832					return err
10833				}
10834				pss.ID = &ID
10835			}
10836		case "name":
10837			if v != nil {
10838				var name string
10839				err = json.Unmarshal(*v, &name)
10840				if err != nil {
10841					return err
10842				}
10843				pss.Name = &name
10844			}
10845		case "type":
10846			if v != nil {
10847				var typeVar string
10848				err = json.Unmarshal(*v, &typeVar)
10849				if err != nil {
10850					return err
10851				}
10852				pss.Type = &typeVar
10853			}
10854		}
10855	}
10856
10857	return nil
10858}
10859
10860// PortalSignupSettings sign-Up settings for a developer portal.
10861type PortalSignupSettings struct {
10862	autorest.Response `json:"-"`
10863	// PortalSignupSettingsProperties - Sign-up settings contract properties.
10864	*PortalSignupSettingsProperties `json:"properties,omitempty"`
10865	// ID - READ-ONLY; Resource ID.
10866	ID *string `json:"id,omitempty"`
10867	// Name - READ-ONLY; Resource name.
10868	Name *string `json:"name,omitempty"`
10869	// Type - READ-ONLY; Resource type for API Management resource.
10870	Type *string `json:"type,omitempty"`
10871}
10872
10873// MarshalJSON is the custom marshaler for PortalSignupSettings.
10874func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) {
10875	objectMap := make(map[string]interface{})
10876	if pss.PortalSignupSettingsProperties != nil {
10877		objectMap["properties"] = pss.PortalSignupSettingsProperties
10878	}
10879	return json.Marshal(objectMap)
10880}
10881
10882// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct.
10883func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error {
10884	var m map[string]*json.RawMessage
10885	err := json.Unmarshal(body, &m)
10886	if err != nil {
10887		return err
10888	}
10889	for k, v := range m {
10890		switch k {
10891		case "properties":
10892			if v != nil {
10893				var portalSignupSettingsProperties PortalSignupSettingsProperties
10894				err = json.Unmarshal(*v, &portalSignupSettingsProperties)
10895				if err != nil {
10896					return err
10897				}
10898				pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties
10899			}
10900		case "id":
10901			if v != nil {
10902				var ID string
10903				err = json.Unmarshal(*v, &ID)
10904				if err != nil {
10905					return err
10906				}
10907				pss.ID = &ID
10908			}
10909		case "name":
10910			if v != nil {
10911				var name string
10912				err = json.Unmarshal(*v, &name)
10913				if err != nil {
10914					return err
10915				}
10916				pss.Name = &name
10917			}
10918		case "type":
10919			if v != nil {
10920				var typeVar string
10921				err = json.Unmarshal(*v, &typeVar)
10922				if err != nil {
10923					return err
10924				}
10925				pss.Type = &typeVar
10926			}
10927		}
10928	}
10929
10930	return nil
10931}
10932
10933// PortalSignupSettingsProperties sign-up settings contract properties.
10934type PortalSignupSettingsProperties struct {
10935	// Enabled - Allow users to sign up on a developer portal.
10936	Enabled *bool `json:"enabled,omitempty"`
10937	// TermsOfService - Terms of service contract properties.
10938	TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"`
10939}
10940
10941// ProductCollection paged Products list representation.
10942type ProductCollection struct {
10943	autorest.Response `json:"-"`
10944	// Value - Page values.
10945	Value *[]ProductContract `json:"value,omitempty"`
10946	// Count - Total record count number across all pages.
10947	Count *int64 `json:"count,omitempty"`
10948	// NextLink - Next page link if any.
10949	NextLink *string `json:"nextLink,omitempty"`
10950}
10951
10952// ProductCollectionIterator provides access to a complete listing of ProductContract values.
10953type ProductCollectionIterator struct {
10954	i    int
10955	page ProductCollectionPage
10956}
10957
10958// NextWithContext advances to the next value.  If there was an error making
10959// the request the iterator does not advance and the error is returned.
10960func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10961	if tracing.IsEnabled() {
10962		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext")
10963		defer func() {
10964			sc := -1
10965			if iter.Response().Response.Response != nil {
10966				sc = iter.Response().Response.Response.StatusCode
10967			}
10968			tracing.EndSpan(ctx, sc, err)
10969		}()
10970	}
10971	iter.i++
10972	if iter.i < len(iter.page.Values()) {
10973		return nil
10974	}
10975	err = iter.page.NextWithContext(ctx)
10976	if err != nil {
10977		iter.i--
10978		return err
10979	}
10980	iter.i = 0
10981	return nil
10982}
10983
10984// Next advances to the next value.  If there was an error making
10985// the request the iterator does not advance and the error is returned.
10986// Deprecated: Use NextWithContext() instead.
10987func (iter *ProductCollectionIterator) Next() error {
10988	return iter.NextWithContext(context.Background())
10989}
10990
10991// NotDone returns true if the enumeration should be started or is not yet complete.
10992func (iter ProductCollectionIterator) NotDone() bool {
10993	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10994}
10995
10996// Response returns the raw server response from the last page request.
10997func (iter ProductCollectionIterator) Response() ProductCollection {
10998	return iter.page.Response()
10999}
11000
11001// Value returns the current value or a zero-initialized value if the
11002// iterator has advanced beyond the end of the collection.
11003func (iter ProductCollectionIterator) Value() ProductContract {
11004	if !iter.page.NotDone() {
11005		return ProductContract{}
11006	}
11007	return iter.page.Values()[iter.i]
11008}
11009
11010// Creates a new instance of the ProductCollectionIterator type.
11011func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator {
11012	return ProductCollectionIterator{page: page}
11013}
11014
11015// IsEmpty returns true if the ListResult contains no values.
11016func (pc ProductCollection) IsEmpty() bool {
11017	return pc.Value == nil || len(*pc.Value) == 0
11018}
11019
11020// hasNextLink returns true if the NextLink is not empty.
11021func (pc ProductCollection) hasNextLink() bool {
11022	return pc.NextLink != nil && len(*pc.NextLink) != 0
11023}
11024
11025// productCollectionPreparer prepares a request to retrieve the next set of results.
11026// It returns nil if no more results exist.
11027func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) {
11028	if !pc.hasNextLink() {
11029		return nil, nil
11030	}
11031	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11032		autorest.AsJSON(),
11033		autorest.AsGet(),
11034		autorest.WithBaseURL(to.String(pc.NextLink)))
11035}
11036
11037// ProductCollectionPage contains a page of ProductContract values.
11038type ProductCollectionPage struct {
11039	fn func(context.Context, ProductCollection) (ProductCollection, error)
11040	pc ProductCollection
11041}
11042
11043// NextWithContext advances to the next page of values.  If there was an error making
11044// the request the page does not advance and the error is returned.
11045func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) {
11046	if tracing.IsEnabled() {
11047		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext")
11048		defer func() {
11049			sc := -1
11050			if page.Response().Response.Response != nil {
11051				sc = page.Response().Response.Response.StatusCode
11052			}
11053			tracing.EndSpan(ctx, sc, err)
11054		}()
11055	}
11056	for {
11057		next, err := page.fn(ctx, page.pc)
11058		if err != nil {
11059			return err
11060		}
11061		page.pc = next
11062		if !next.hasNextLink() || !next.IsEmpty() {
11063			break
11064		}
11065	}
11066	return nil
11067}
11068
11069// Next advances to the next page of values.  If there was an error making
11070// the request the page does not advance and the error is returned.
11071// Deprecated: Use NextWithContext() instead.
11072func (page *ProductCollectionPage) Next() error {
11073	return page.NextWithContext(context.Background())
11074}
11075
11076// NotDone returns true if the page enumeration should be started or is not yet complete.
11077func (page ProductCollectionPage) NotDone() bool {
11078	return !page.pc.IsEmpty()
11079}
11080
11081// Response returns the raw server response from the last page request.
11082func (page ProductCollectionPage) Response() ProductCollection {
11083	return page.pc
11084}
11085
11086// Values returns the slice of values for the current page or nil if there are no values.
11087func (page ProductCollectionPage) Values() []ProductContract {
11088	if page.pc.IsEmpty() {
11089		return nil
11090	}
11091	return *page.pc.Value
11092}
11093
11094// Creates a new instance of the ProductCollectionPage type.
11095func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage {
11096	return ProductCollectionPage{
11097		fn: getNextPage,
11098		pc: cur,
11099	}
11100}
11101
11102// ProductContract product details.
11103type ProductContract struct {
11104	autorest.Response `json:"-"`
11105	// ProductContractProperties - Product entity contract properties.
11106	*ProductContractProperties `json:"properties,omitempty"`
11107	// ID - READ-ONLY; Resource ID.
11108	ID *string `json:"id,omitempty"`
11109	// Name - READ-ONLY; Resource name.
11110	Name *string `json:"name,omitempty"`
11111	// Type - READ-ONLY; Resource type for API Management resource.
11112	Type *string `json:"type,omitempty"`
11113}
11114
11115// MarshalJSON is the custom marshaler for ProductContract.
11116func (pc ProductContract) MarshalJSON() ([]byte, error) {
11117	objectMap := make(map[string]interface{})
11118	if pc.ProductContractProperties != nil {
11119		objectMap["properties"] = pc.ProductContractProperties
11120	}
11121	return json.Marshal(objectMap)
11122}
11123
11124// UnmarshalJSON is the custom unmarshaler for ProductContract struct.
11125func (pc *ProductContract) UnmarshalJSON(body []byte) error {
11126	var m map[string]*json.RawMessage
11127	err := json.Unmarshal(body, &m)
11128	if err != nil {
11129		return err
11130	}
11131	for k, v := range m {
11132		switch k {
11133		case "properties":
11134			if v != nil {
11135				var productContractProperties ProductContractProperties
11136				err = json.Unmarshal(*v, &productContractProperties)
11137				if err != nil {
11138					return err
11139				}
11140				pc.ProductContractProperties = &productContractProperties
11141			}
11142		case "id":
11143			if v != nil {
11144				var ID string
11145				err = json.Unmarshal(*v, &ID)
11146				if err != nil {
11147					return err
11148				}
11149				pc.ID = &ID
11150			}
11151		case "name":
11152			if v != nil {
11153				var name string
11154				err = json.Unmarshal(*v, &name)
11155				if err != nil {
11156					return err
11157				}
11158				pc.Name = &name
11159			}
11160		case "type":
11161			if v != nil {
11162				var typeVar string
11163				err = json.Unmarshal(*v, &typeVar)
11164				if err != nil {
11165					return err
11166				}
11167				pc.Type = &typeVar
11168			}
11169		}
11170	}
11171
11172	return nil
11173}
11174
11175// ProductContractProperties product profile.
11176type ProductContractProperties struct {
11177	// DisplayName - Product name.
11178	DisplayName *string `json:"displayName,omitempty"`
11179	// Description - Product description. May include HTML formatting tags.
11180	Description *string `json:"description,omitempty"`
11181	// 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.
11182	Terms *string `json:"terms,omitempty"`
11183	// 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.
11184	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11185	// 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 false.
11186	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11187	// 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 false.
11188	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11189	// 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: 'ProductStateNotPublished', 'ProductStatePublished'
11190	State ProductState `json:"state,omitempty"`
11191}
11192
11193// ProductEntityBaseParameters product Entity Base Parameters
11194type ProductEntityBaseParameters struct {
11195	// Description - Product description. May include HTML formatting tags.
11196	Description *string `json:"description,omitempty"`
11197	// 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.
11198	Terms *string `json:"terms,omitempty"`
11199	// 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.
11200	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11201	// 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 false.
11202	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11203	// 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 false.
11204	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11205	// 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: 'ProductStateNotPublished', 'ProductStatePublished'
11206	State ProductState `json:"state,omitempty"`
11207}
11208
11209// ProductTagResourceContractProperties product profile.
11210type ProductTagResourceContractProperties struct {
11211	// ID - Identifier of the product in the form of /products/{productId}
11212	ID *string `json:"id,omitempty"`
11213	// Name - Product name.
11214	Name *string `json:"name,omitempty"`
11215	// Description - Product description. May include HTML formatting tags.
11216	Description *string `json:"description,omitempty"`
11217	// 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.
11218	Terms *string `json:"terms,omitempty"`
11219	// 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.
11220	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11221	// 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 false.
11222	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11223	// 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 false.
11224	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11225	// 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: 'ProductStateNotPublished', 'ProductStatePublished'
11226	State ProductState `json:"state,omitempty"`
11227}
11228
11229// ProductUpdateParameters product Update parameters.
11230type ProductUpdateParameters struct {
11231	// ProductUpdateProperties - Product entity Update contract properties.
11232	*ProductUpdateProperties `json:"properties,omitempty"`
11233}
11234
11235// MarshalJSON is the custom marshaler for ProductUpdateParameters.
11236func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) {
11237	objectMap := make(map[string]interface{})
11238	if pup.ProductUpdateProperties != nil {
11239		objectMap["properties"] = pup.ProductUpdateProperties
11240	}
11241	return json.Marshal(objectMap)
11242}
11243
11244// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct.
11245func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error {
11246	var m map[string]*json.RawMessage
11247	err := json.Unmarshal(body, &m)
11248	if err != nil {
11249		return err
11250	}
11251	for k, v := range m {
11252		switch k {
11253		case "properties":
11254			if v != nil {
11255				var productUpdateProperties ProductUpdateProperties
11256				err = json.Unmarshal(*v, &productUpdateProperties)
11257				if err != nil {
11258					return err
11259				}
11260				pup.ProductUpdateProperties = &productUpdateProperties
11261			}
11262		}
11263	}
11264
11265	return nil
11266}
11267
11268// ProductUpdateProperties parameters supplied to the Update Product operation.
11269type ProductUpdateProperties struct {
11270	// DisplayName - Product name.
11271	DisplayName *string `json:"displayName,omitempty"`
11272	// Description - Product description. May include HTML formatting tags.
11273	Description *string `json:"description,omitempty"`
11274	// 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.
11275	Terms *string `json:"terms,omitempty"`
11276	// 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.
11277	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11278	// 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 false.
11279	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11280	// 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 false.
11281	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11282	// 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: 'ProductStateNotPublished', 'ProductStatePublished'
11283	State ProductState `json:"state,omitempty"`
11284}
11285
11286// QuotaCounterCollection paged Quota Counter list representation.
11287type QuotaCounterCollection struct {
11288	autorest.Response `json:"-"`
11289	// Value - Quota counter values.
11290	Value *[]QuotaCounterContract `json:"value,omitempty"`
11291	// Count - Total record count number across all pages.
11292	Count *int64 `json:"count,omitempty"`
11293	// NextLink - Next page link if any.
11294	NextLink *string `json:"nextLink,omitempty"`
11295}
11296
11297// QuotaCounterContract quota counter details.
11298type QuotaCounterContract struct {
11299	autorest.Response `json:"-"`
11300	// CounterKey - The Key value of the Counter. Must not be empty.
11301	CounterKey *string `json:"counterKey,omitempty"`
11302	// PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty.
11303	PeriodKey *string `json:"periodKey,omitempty"`
11304	// 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.
11305	PeriodStartTime *date.Time `json:"periodStartTime,omitempty"`
11306	// 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.
11307	PeriodEndTime *date.Time `json:"periodEndTime,omitempty"`
11308	// Value - Quota Value Properties
11309	Value *QuotaCounterValueContractProperties `json:"value,omitempty"`
11310}
11311
11312// QuotaCounterValueContract quota counter value details.
11313type QuotaCounterValueContract struct {
11314	// QuotaCounterValueContractProperties - Quota counter Value Properties.
11315	*QuotaCounterValueContractProperties `json:"value,omitempty"`
11316}
11317
11318// MarshalJSON is the custom marshaler for QuotaCounterValueContract.
11319func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) {
11320	objectMap := make(map[string]interface{})
11321	if qcvc.QuotaCounterValueContractProperties != nil {
11322		objectMap["value"] = qcvc.QuotaCounterValueContractProperties
11323	}
11324	return json.Marshal(objectMap)
11325}
11326
11327// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct.
11328func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error {
11329	var m map[string]*json.RawMessage
11330	err := json.Unmarshal(body, &m)
11331	if err != nil {
11332		return err
11333	}
11334	for k, v := range m {
11335		switch k {
11336		case "value":
11337			if v != nil {
11338				var quotaCounterValueContractProperties QuotaCounterValueContractProperties
11339				err = json.Unmarshal(*v, &quotaCounterValueContractProperties)
11340				if err != nil {
11341					return err
11342				}
11343				qcvc.QuotaCounterValueContractProperties = &quotaCounterValueContractProperties
11344			}
11345		}
11346	}
11347
11348	return nil
11349}
11350
11351// QuotaCounterValueContractProperties quota counter value details.
11352type QuotaCounterValueContractProperties struct {
11353	// CallsCount - Number of times Counter was called.
11354	CallsCount *int32 `json:"callsCount,omitempty"`
11355	// KbTransferred - Data Transferred in KiloBytes.
11356	KbTransferred *float64 `json:"kbTransferred,omitempty"`
11357}
11358
11359// QuotaCounterValueUpdateContract quota counter value details.
11360type QuotaCounterValueUpdateContract struct {
11361	// QuotaCounterValueContractProperties - Quota counter value details.
11362	*QuotaCounterValueContractProperties `json:"properties,omitempty"`
11363}
11364
11365// MarshalJSON is the custom marshaler for QuotaCounterValueUpdateContract.
11366func (qcvuc QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) {
11367	objectMap := make(map[string]interface{})
11368	if qcvuc.QuotaCounterValueContractProperties != nil {
11369		objectMap["properties"] = qcvuc.QuotaCounterValueContractProperties
11370	}
11371	return json.Marshal(objectMap)
11372}
11373
11374// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueUpdateContract struct.
11375func (qcvuc *QuotaCounterValueUpdateContract) UnmarshalJSON(body []byte) error {
11376	var m map[string]*json.RawMessage
11377	err := json.Unmarshal(body, &m)
11378	if err != nil {
11379		return err
11380	}
11381	for k, v := range m {
11382		switch k {
11383		case "properties":
11384			if v != nil {
11385				var quotaCounterValueContractProperties QuotaCounterValueContractProperties
11386				err = json.Unmarshal(*v, &quotaCounterValueContractProperties)
11387				if err != nil {
11388					return err
11389				}
11390				qcvuc.QuotaCounterValueContractProperties = &quotaCounterValueContractProperties
11391			}
11392		}
11393	}
11394
11395	return nil
11396}
11397
11398// RecipientEmailCollection paged Recipient User list representation.
11399type RecipientEmailCollection struct {
11400	autorest.Response `json:"-"`
11401	// Value - Page values.
11402	Value *[]RecipientEmailContract `json:"value,omitempty"`
11403	// Count - Total record count number across all pages.
11404	Count *int64 `json:"count,omitempty"`
11405	// NextLink - Next page link if any.
11406	NextLink *string `json:"nextLink,omitempty"`
11407}
11408
11409// RecipientEmailContract recipient Email details.
11410type RecipientEmailContract struct {
11411	autorest.Response `json:"-"`
11412	// RecipientEmailContractProperties - Recipient Email contract properties.
11413	*RecipientEmailContractProperties `json:"properties,omitempty"`
11414	// ID - READ-ONLY; Resource ID.
11415	ID *string `json:"id,omitempty"`
11416	// Name - READ-ONLY; Resource name.
11417	Name *string `json:"name,omitempty"`
11418	// Type - READ-ONLY; Resource type for API Management resource.
11419	Type *string `json:"type,omitempty"`
11420}
11421
11422// MarshalJSON is the custom marshaler for RecipientEmailContract.
11423func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) {
11424	objectMap := make(map[string]interface{})
11425	if rec.RecipientEmailContractProperties != nil {
11426		objectMap["properties"] = rec.RecipientEmailContractProperties
11427	}
11428	return json.Marshal(objectMap)
11429}
11430
11431// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct.
11432func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error {
11433	var m map[string]*json.RawMessage
11434	err := json.Unmarshal(body, &m)
11435	if err != nil {
11436		return err
11437	}
11438	for k, v := range m {
11439		switch k {
11440		case "properties":
11441			if v != nil {
11442				var recipientEmailContractProperties RecipientEmailContractProperties
11443				err = json.Unmarshal(*v, &recipientEmailContractProperties)
11444				if err != nil {
11445					return err
11446				}
11447				rec.RecipientEmailContractProperties = &recipientEmailContractProperties
11448			}
11449		case "id":
11450			if v != nil {
11451				var ID string
11452				err = json.Unmarshal(*v, &ID)
11453				if err != nil {
11454					return err
11455				}
11456				rec.ID = &ID
11457			}
11458		case "name":
11459			if v != nil {
11460				var name string
11461				err = json.Unmarshal(*v, &name)
11462				if err != nil {
11463					return err
11464				}
11465				rec.Name = &name
11466			}
11467		case "type":
11468			if v != nil {
11469				var typeVar string
11470				err = json.Unmarshal(*v, &typeVar)
11471				if err != nil {
11472					return err
11473				}
11474				rec.Type = &typeVar
11475			}
11476		}
11477	}
11478
11479	return nil
11480}
11481
11482// RecipientEmailContractProperties recipient Email Contract Properties.
11483type RecipientEmailContractProperties struct {
11484	// Email - User Email subscribed to notification.
11485	Email *string `json:"email,omitempty"`
11486}
11487
11488// RecipientsContractProperties notification Parameter contract.
11489type RecipientsContractProperties struct {
11490	// Emails - List of Emails subscribed for the notification.
11491	Emails *[]string `json:"emails,omitempty"`
11492	// Users - List of Users subscribed for the notification.
11493	Users *[]string `json:"users,omitempty"`
11494}
11495
11496// RecipientUserCollection paged Recipient User list representation.
11497type RecipientUserCollection struct {
11498	autorest.Response `json:"-"`
11499	// Value - Page values.
11500	Value *[]RecipientUserContract `json:"value,omitempty"`
11501	// Count - Total record count number across all pages.
11502	Count *int64 `json:"count,omitempty"`
11503	// NextLink - Next page link if any.
11504	NextLink *string `json:"nextLink,omitempty"`
11505}
11506
11507// RecipientUserContract recipient User details.
11508type RecipientUserContract struct {
11509	autorest.Response `json:"-"`
11510	// RecipientUsersContractProperties - Recipient User entity contract properties.
11511	*RecipientUsersContractProperties `json:"properties,omitempty"`
11512	// ID - READ-ONLY; Resource ID.
11513	ID *string `json:"id,omitempty"`
11514	// Name - READ-ONLY; Resource name.
11515	Name *string `json:"name,omitempty"`
11516	// Type - READ-ONLY; Resource type for API Management resource.
11517	Type *string `json:"type,omitempty"`
11518}
11519
11520// MarshalJSON is the custom marshaler for RecipientUserContract.
11521func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) {
11522	objectMap := make(map[string]interface{})
11523	if ruc.RecipientUsersContractProperties != nil {
11524		objectMap["properties"] = ruc.RecipientUsersContractProperties
11525	}
11526	return json.Marshal(objectMap)
11527}
11528
11529// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct.
11530func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error {
11531	var m map[string]*json.RawMessage
11532	err := json.Unmarshal(body, &m)
11533	if err != nil {
11534		return err
11535	}
11536	for k, v := range m {
11537		switch k {
11538		case "properties":
11539			if v != nil {
11540				var recipientUsersContractProperties RecipientUsersContractProperties
11541				err = json.Unmarshal(*v, &recipientUsersContractProperties)
11542				if err != nil {
11543					return err
11544				}
11545				ruc.RecipientUsersContractProperties = &recipientUsersContractProperties
11546			}
11547		case "id":
11548			if v != nil {
11549				var ID string
11550				err = json.Unmarshal(*v, &ID)
11551				if err != nil {
11552					return err
11553				}
11554				ruc.ID = &ID
11555			}
11556		case "name":
11557			if v != nil {
11558				var name string
11559				err = json.Unmarshal(*v, &name)
11560				if err != nil {
11561					return err
11562				}
11563				ruc.Name = &name
11564			}
11565		case "type":
11566			if v != nil {
11567				var typeVar string
11568				err = json.Unmarshal(*v, &typeVar)
11569				if err != nil {
11570					return err
11571				}
11572				ruc.Type = &typeVar
11573			}
11574		}
11575	}
11576
11577	return nil
11578}
11579
11580// RecipientUsersContractProperties recipient User Contract Properties.
11581type RecipientUsersContractProperties struct {
11582	// UserID - API Management UserId subscribed to notification.
11583	UserID *string `json:"userId,omitempty"`
11584}
11585
11586// RegionContract region profile.
11587type RegionContract struct {
11588	// Name - READ-ONLY; Region name.
11589	Name *string `json:"name,omitempty"`
11590	// IsMasterRegion - whether Region is the master region.
11591	IsMasterRegion *bool `json:"isMasterRegion,omitempty"`
11592	// IsDeleted - whether Region is deleted.
11593	IsDeleted *bool `json:"isDeleted,omitempty"`
11594}
11595
11596// MarshalJSON is the custom marshaler for RegionContract.
11597func (rc RegionContract) MarshalJSON() ([]byte, error) {
11598	objectMap := make(map[string]interface{})
11599	if rc.IsMasterRegion != nil {
11600		objectMap["isMasterRegion"] = rc.IsMasterRegion
11601	}
11602	if rc.IsDeleted != nil {
11603		objectMap["isDeleted"] = rc.IsDeleted
11604	}
11605	return json.Marshal(objectMap)
11606}
11607
11608// RegionListResult lists Regions operation response details.
11609type RegionListResult struct {
11610	autorest.Response `json:"-"`
11611	// Value - Lists of Regions.
11612	Value *[]RegionContract `json:"value,omitempty"`
11613	// Count - Total record count number across all pages.
11614	Count *int64 `json:"count,omitempty"`
11615	// NextLink - Next page link if any.
11616	NextLink *string `json:"nextLink,omitempty"`
11617}
11618
11619// RegionListResultIterator provides access to a complete listing of RegionContract values.
11620type RegionListResultIterator struct {
11621	i    int
11622	page RegionListResultPage
11623}
11624
11625// NextWithContext advances to the next value.  If there was an error making
11626// the request the iterator does not advance and the error is returned.
11627func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) {
11628	if tracing.IsEnabled() {
11629		ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext")
11630		defer func() {
11631			sc := -1
11632			if iter.Response().Response.Response != nil {
11633				sc = iter.Response().Response.Response.StatusCode
11634			}
11635			tracing.EndSpan(ctx, sc, err)
11636		}()
11637	}
11638	iter.i++
11639	if iter.i < len(iter.page.Values()) {
11640		return nil
11641	}
11642	err = iter.page.NextWithContext(ctx)
11643	if err != nil {
11644		iter.i--
11645		return err
11646	}
11647	iter.i = 0
11648	return nil
11649}
11650
11651// Next advances to the next value.  If there was an error making
11652// the request the iterator does not advance and the error is returned.
11653// Deprecated: Use NextWithContext() instead.
11654func (iter *RegionListResultIterator) Next() error {
11655	return iter.NextWithContext(context.Background())
11656}
11657
11658// NotDone returns true if the enumeration should be started or is not yet complete.
11659func (iter RegionListResultIterator) NotDone() bool {
11660	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11661}
11662
11663// Response returns the raw server response from the last page request.
11664func (iter RegionListResultIterator) Response() RegionListResult {
11665	return iter.page.Response()
11666}
11667
11668// Value returns the current value or a zero-initialized value if the
11669// iterator has advanced beyond the end of the collection.
11670func (iter RegionListResultIterator) Value() RegionContract {
11671	if !iter.page.NotDone() {
11672		return RegionContract{}
11673	}
11674	return iter.page.Values()[iter.i]
11675}
11676
11677// Creates a new instance of the RegionListResultIterator type.
11678func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator {
11679	return RegionListResultIterator{page: page}
11680}
11681
11682// IsEmpty returns true if the ListResult contains no values.
11683func (rlr RegionListResult) IsEmpty() bool {
11684	return rlr.Value == nil || len(*rlr.Value) == 0
11685}
11686
11687// hasNextLink returns true if the NextLink is not empty.
11688func (rlr RegionListResult) hasNextLink() bool {
11689	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
11690}
11691
11692// regionListResultPreparer prepares a request to retrieve the next set of results.
11693// It returns nil if no more results exist.
11694func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) {
11695	if !rlr.hasNextLink() {
11696		return nil, nil
11697	}
11698	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11699		autorest.AsJSON(),
11700		autorest.AsGet(),
11701		autorest.WithBaseURL(to.String(rlr.NextLink)))
11702}
11703
11704// RegionListResultPage contains a page of RegionContract values.
11705type RegionListResultPage struct {
11706	fn  func(context.Context, RegionListResult) (RegionListResult, error)
11707	rlr RegionListResult
11708}
11709
11710// NextWithContext advances to the next page of values.  If there was an error making
11711// the request the page does not advance and the error is returned.
11712func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) {
11713	if tracing.IsEnabled() {
11714		ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext")
11715		defer func() {
11716			sc := -1
11717			if page.Response().Response.Response != nil {
11718				sc = page.Response().Response.Response.StatusCode
11719			}
11720			tracing.EndSpan(ctx, sc, err)
11721		}()
11722	}
11723	for {
11724		next, err := page.fn(ctx, page.rlr)
11725		if err != nil {
11726			return err
11727		}
11728		page.rlr = next
11729		if !next.hasNextLink() || !next.IsEmpty() {
11730			break
11731		}
11732	}
11733	return nil
11734}
11735
11736// Next advances to the next page of values.  If there was an error making
11737// the request the page does not advance and the error is returned.
11738// Deprecated: Use NextWithContext() instead.
11739func (page *RegionListResultPage) Next() error {
11740	return page.NextWithContext(context.Background())
11741}
11742
11743// NotDone returns true if the page enumeration should be started or is not yet complete.
11744func (page RegionListResultPage) NotDone() bool {
11745	return !page.rlr.IsEmpty()
11746}
11747
11748// Response returns the raw server response from the last page request.
11749func (page RegionListResultPage) Response() RegionListResult {
11750	return page.rlr
11751}
11752
11753// Values returns the slice of values for the current page or nil if there are no values.
11754func (page RegionListResultPage) Values() []RegionContract {
11755	if page.rlr.IsEmpty() {
11756		return nil
11757	}
11758	return *page.rlr.Value
11759}
11760
11761// Creates a new instance of the RegionListResultPage type.
11762func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage {
11763	return RegionListResultPage{
11764		fn:  getNextPage,
11765		rlr: cur,
11766	}
11767}
11768
11769// RegistrationDelegationSettingsProperties user registration delegation settings properties.
11770type RegistrationDelegationSettingsProperties struct {
11771	// Enabled - Enable or disable delegation for user registration.
11772	Enabled *bool `json:"enabled,omitempty"`
11773}
11774
11775// ReportCollection paged Report records list representation.
11776type ReportCollection struct {
11777	autorest.Response `json:"-"`
11778	// Value - Page values.
11779	Value *[]ReportRecordContract `json:"value,omitempty"`
11780	// Count - Total record count number across all pages.
11781	Count *int64 `json:"count,omitempty"`
11782	// NextLink - Next page link if any.
11783	NextLink *string `json:"nextLink,omitempty"`
11784}
11785
11786// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values.
11787type ReportCollectionIterator struct {
11788	i    int
11789	page ReportCollectionPage
11790}
11791
11792// NextWithContext advances to the next value.  If there was an error making
11793// the request the iterator does not advance and the error is returned.
11794func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) {
11795	if tracing.IsEnabled() {
11796		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext")
11797		defer func() {
11798			sc := -1
11799			if iter.Response().Response.Response != nil {
11800				sc = iter.Response().Response.Response.StatusCode
11801			}
11802			tracing.EndSpan(ctx, sc, err)
11803		}()
11804	}
11805	iter.i++
11806	if iter.i < len(iter.page.Values()) {
11807		return nil
11808	}
11809	err = iter.page.NextWithContext(ctx)
11810	if err != nil {
11811		iter.i--
11812		return err
11813	}
11814	iter.i = 0
11815	return nil
11816}
11817
11818// Next advances to the next value.  If there was an error making
11819// the request the iterator does not advance and the error is returned.
11820// Deprecated: Use NextWithContext() instead.
11821func (iter *ReportCollectionIterator) Next() error {
11822	return iter.NextWithContext(context.Background())
11823}
11824
11825// NotDone returns true if the enumeration should be started or is not yet complete.
11826func (iter ReportCollectionIterator) NotDone() bool {
11827	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11828}
11829
11830// Response returns the raw server response from the last page request.
11831func (iter ReportCollectionIterator) Response() ReportCollection {
11832	return iter.page.Response()
11833}
11834
11835// Value returns the current value or a zero-initialized value if the
11836// iterator has advanced beyond the end of the collection.
11837func (iter ReportCollectionIterator) Value() ReportRecordContract {
11838	if !iter.page.NotDone() {
11839		return ReportRecordContract{}
11840	}
11841	return iter.page.Values()[iter.i]
11842}
11843
11844// Creates a new instance of the ReportCollectionIterator type.
11845func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator {
11846	return ReportCollectionIterator{page: page}
11847}
11848
11849// IsEmpty returns true if the ListResult contains no values.
11850func (rc ReportCollection) IsEmpty() bool {
11851	return rc.Value == nil || len(*rc.Value) == 0
11852}
11853
11854// hasNextLink returns true if the NextLink is not empty.
11855func (rc ReportCollection) hasNextLink() bool {
11856	return rc.NextLink != nil && len(*rc.NextLink) != 0
11857}
11858
11859// reportCollectionPreparer prepares a request to retrieve the next set of results.
11860// It returns nil if no more results exist.
11861func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) {
11862	if !rc.hasNextLink() {
11863		return nil, nil
11864	}
11865	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11866		autorest.AsJSON(),
11867		autorest.AsGet(),
11868		autorest.WithBaseURL(to.String(rc.NextLink)))
11869}
11870
11871// ReportCollectionPage contains a page of ReportRecordContract values.
11872type ReportCollectionPage struct {
11873	fn func(context.Context, ReportCollection) (ReportCollection, error)
11874	rc ReportCollection
11875}
11876
11877// NextWithContext advances to the next page of values.  If there was an error making
11878// the request the page does not advance and the error is returned.
11879func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) {
11880	if tracing.IsEnabled() {
11881		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext")
11882		defer func() {
11883			sc := -1
11884			if page.Response().Response.Response != nil {
11885				sc = page.Response().Response.Response.StatusCode
11886			}
11887			tracing.EndSpan(ctx, sc, err)
11888		}()
11889	}
11890	for {
11891		next, err := page.fn(ctx, page.rc)
11892		if err != nil {
11893			return err
11894		}
11895		page.rc = next
11896		if !next.hasNextLink() || !next.IsEmpty() {
11897			break
11898		}
11899	}
11900	return nil
11901}
11902
11903// Next advances to the next page of values.  If there was an error making
11904// the request the page does not advance and the error is returned.
11905// Deprecated: Use NextWithContext() instead.
11906func (page *ReportCollectionPage) Next() error {
11907	return page.NextWithContext(context.Background())
11908}
11909
11910// NotDone returns true if the page enumeration should be started or is not yet complete.
11911func (page ReportCollectionPage) NotDone() bool {
11912	return !page.rc.IsEmpty()
11913}
11914
11915// Response returns the raw server response from the last page request.
11916func (page ReportCollectionPage) Response() ReportCollection {
11917	return page.rc
11918}
11919
11920// Values returns the slice of values for the current page or nil if there are no values.
11921func (page ReportCollectionPage) Values() []ReportRecordContract {
11922	if page.rc.IsEmpty() {
11923		return nil
11924	}
11925	return *page.rc.Value
11926}
11927
11928// Creates a new instance of the ReportCollectionPage type.
11929func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage {
11930	return ReportCollectionPage{
11931		fn: getNextPage,
11932		rc: cur,
11933	}
11934}
11935
11936// ReportRecordContract report data.
11937type ReportRecordContract struct {
11938	// Name - Name depending on report endpoint specifies product, API, operation or developer name.
11939	Name *string `json:"name,omitempty"`
11940	// Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
11941	Timestamp *date.Time `json:"timestamp,omitempty"`
11942	// 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).
11943	Interval *string `json:"interval,omitempty"`
11944	// Country - Country to which this record data is related.
11945	Country *string `json:"country,omitempty"`
11946	// Region - Country region to which this record data is related.
11947	Region *string `json:"region,omitempty"`
11948	// Zip - Zip code to which this record data is related.
11949	Zip *string `json:"zip,omitempty"`
11950	// UserID - READ-ONLY; User identifier path. /users/{userId}
11951	UserID *string `json:"userId,omitempty"`
11952	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
11953	ProductID *string `json:"productId,omitempty"`
11954	// APIID - API identifier path. /apis/{apiId}
11955	APIID *string `json:"apiId,omitempty"`
11956	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
11957	OperationID *string `json:"operationId,omitempty"`
11958	// APIRegion - API region identifier.
11959	APIRegion *string `json:"apiRegion,omitempty"`
11960	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
11961	SubscriptionID *string `json:"subscriptionId,omitempty"`
11962	// CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect
11963	CallCountSuccess *int32 `json:"callCountSuccess,omitempty"`
11964	// CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests
11965	CallCountBlocked *int32 `json:"callCountBlocked,omitempty"`
11966	// 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
11967	CallCountFailed *int32 `json:"callCountFailed,omitempty"`
11968	// CallCountOther - Number of other calls.
11969	CallCountOther *int32 `json:"callCountOther,omitempty"`
11970	// CallCountTotal - Total number of calls.
11971	CallCountTotal *int32 `json:"callCountTotal,omitempty"`
11972	// Bandwidth - Bandwidth consumed.
11973	Bandwidth *int64 `json:"bandwidth,omitempty"`
11974	// CacheHitCount - Number of times when content was served from cache policy.
11975	CacheHitCount *int32 `json:"cacheHitCount,omitempty"`
11976	// CacheMissCount - Number of times content was fetched from backend.
11977	CacheMissCount *int32 `json:"cacheMissCount,omitempty"`
11978	// APITimeAvg - Average time it took to process request.
11979	APITimeAvg *float64 `json:"apiTimeAvg,omitempty"`
11980	// APITimeMin - Minimum time it took to process request.
11981	APITimeMin *float64 `json:"apiTimeMin,omitempty"`
11982	// APITimeMax - Maximum time it took to process request.
11983	APITimeMax *float64 `json:"apiTimeMax,omitempty"`
11984	// ServiceTimeAvg - Average time it took to process request on backend.
11985	ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"`
11986	// ServiceTimeMin - Minimum time it took to process request on backend.
11987	ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"`
11988	// ServiceTimeMax - Maximum time it took to process request on backend.
11989	ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"`
11990}
11991
11992// MarshalJSON is the custom marshaler for ReportRecordContract.
11993func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) {
11994	objectMap := make(map[string]interface{})
11995	if rrc.Name != nil {
11996		objectMap["name"] = rrc.Name
11997	}
11998	if rrc.Timestamp != nil {
11999		objectMap["timestamp"] = rrc.Timestamp
12000	}
12001	if rrc.Interval != nil {
12002		objectMap["interval"] = rrc.Interval
12003	}
12004	if rrc.Country != nil {
12005		objectMap["country"] = rrc.Country
12006	}
12007	if rrc.Region != nil {
12008		objectMap["region"] = rrc.Region
12009	}
12010	if rrc.Zip != nil {
12011		objectMap["zip"] = rrc.Zip
12012	}
12013	if rrc.APIID != nil {
12014		objectMap["apiId"] = rrc.APIID
12015	}
12016	if rrc.OperationID != nil {
12017		objectMap["operationId"] = rrc.OperationID
12018	}
12019	if rrc.APIRegion != nil {
12020		objectMap["apiRegion"] = rrc.APIRegion
12021	}
12022	if rrc.SubscriptionID != nil {
12023		objectMap["subscriptionId"] = rrc.SubscriptionID
12024	}
12025	if rrc.CallCountSuccess != nil {
12026		objectMap["callCountSuccess"] = rrc.CallCountSuccess
12027	}
12028	if rrc.CallCountBlocked != nil {
12029		objectMap["callCountBlocked"] = rrc.CallCountBlocked
12030	}
12031	if rrc.CallCountFailed != nil {
12032		objectMap["callCountFailed"] = rrc.CallCountFailed
12033	}
12034	if rrc.CallCountOther != nil {
12035		objectMap["callCountOther"] = rrc.CallCountOther
12036	}
12037	if rrc.CallCountTotal != nil {
12038		objectMap["callCountTotal"] = rrc.CallCountTotal
12039	}
12040	if rrc.Bandwidth != nil {
12041		objectMap["bandwidth"] = rrc.Bandwidth
12042	}
12043	if rrc.CacheHitCount != nil {
12044		objectMap["cacheHitCount"] = rrc.CacheHitCount
12045	}
12046	if rrc.CacheMissCount != nil {
12047		objectMap["cacheMissCount"] = rrc.CacheMissCount
12048	}
12049	if rrc.APITimeAvg != nil {
12050		objectMap["apiTimeAvg"] = rrc.APITimeAvg
12051	}
12052	if rrc.APITimeMin != nil {
12053		objectMap["apiTimeMin"] = rrc.APITimeMin
12054	}
12055	if rrc.APITimeMax != nil {
12056		objectMap["apiTimeMax"] = rrc.APITimeMax
12057	}
12058	if rrc.ServiceTimeAvg != nil {
12059		objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg
12060	}
12061	if rrc.ServiceTimeMin != nil {
12062		objectMap["serviceTimeMin"] = rrc.ServiceTimeMin
12063	}
12064	if rrc.ServiceTimeMax != nil {
12065		objectMap["serviceTimeMax"] = rrc.ServiceTimeMax
12066	}
12067	return json.Marshal(objectMap)
12068}
12069
12070// RepresentationContract operation request/response representation details.
12071type RepresentationContract struct {
12072	// ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml.
12073	ContentType *string `json:"contentType,omitempty"`
12074	// SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
12075	SchemaID *string `json:"schemaId,omitempty"`
12076	// TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
12077	TypeName *string `json:"typeName,omitempty"`
12078	// FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
12079	FormParameters *[]ParameterContract `json:"formParameters,omitempty"`
12080}
12081
12082// RequestContract operation request details.
12083type RequestContract struct {
12084	// Description - Operation request description.
12085	Description *string `json:"description,omitempty"`
12086	// QueryParameters - Collection of operation request query parameters.
12087	QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"`
12088	// Headers - Collection of operation request headers.
12089	Headers *[]ParameterContract `json:"headers,omitempty"`
12090	// Representations - Collection of operation request representations.
12091	Representations *[]RepresentationContract `json:"representations,omitempty"`
12092}
12093
12094// RequestReportCollection paged Report records list representation.
12095type RequestReportCollection struct {
12096	autorest.Response `json:"-"`
12097	// Value - Page values.
12098	Value *[]RequestReportRecordContract `json:"value,omitempty"`
12099	// Count - Total record count number across all pages.
12100	Count *int64 `json:"count,omitempty"`
12101}
12102
12103// RequestReportRecordContract request Report data.
12104type RequestReportRecordContract struct {
12105	// APIID - API identifier path. /apis/{apiId}
12106	APIID *string `json:"apiId,omitempty"`
12107	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
12108	OperationID *string `json:"operationId,omitempty"`
12109	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
12110	ProductID *string `json:"productId,omitempty"`
12111	// UserID - READ-ONLY; User identifier path. /users/{userId}
12112	UserID *string `json:"userId,omitempty"`
12113	// Method - The HTTP method associated with this request..
12114	Method *string `json:"method,omitempty"`
12115	// URL - The full URL associated with this request.
12116	URL *string `json:"url,omitempty"`
12117	// IPAddress - The client IP address associated with this request.
12118	IPAddress *string `json:"ipAddress,omitempty"`
12119	// BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend.
12120	BackendResponseCode *string `json:"backendResponseCode,omitempty"`
12121	// ResponseCode - The HTTP status code returned by the gateway.
12122	ResponseCode *int32 `json:"responseCode,omitempty"`
12123	// ResponseSize - The size of the response returned by the gateway.
12124	ResponseSize *int32 `json:"responseSize,omitempty"`
12125	// Timestamp - The date and time when this request was received by the gateway in ISO 8601 format.
12126	Timestamp *date.Time `json:"timestamp,omitempty"`
12127	// 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.
12128	Cache *string `json:"cache,omitempty"`
12129	// APITime - The total time it took to process this request.
12130	APITime *float64 `json:"apiTime,omitempty"`
12131	// ServiceTime - he time it took to forward this request to the backend and get the response back.
12132	ServiceTime *float64 `json:"serviceTime,omitempty"`
12133	// APIRegion - Azure region where the gateway that processed this request is located.
12134	APIRegion *string `json:"apiRegion,omitempty"`
12135	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
12136	SubscriptionID *string `json:"subscriptionId,omitempty"`
12137	// RequestID - Request Identifier.
12138	RequestID *string `json:"requestId,omitempty"`
12139	// RequestSize - The size of this request..
12140	RequestSize *int32 `json:"requestSize,omitempty"`
12141}
12142
12143// MarshalJSON is the custom marshaler for RequestReportRecordContract.
12144func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) {
12145	objectMap := make(map[string]interface{})
12146	if rrrc.APIID != nil {
12147		objectMap["apiId"] = rrrc.APIID
12148	}
12149	if rrrc.OperationID != nil {
12150		objectMap["operationId"] = rrrc.OperationID
12151	}
12152	if rrrc.Method != nil {
12153		objectMap["method"] = rrrc.Method
12154	}
12155	if rrrc.URL != nil {
12156		objectMap["url"] = rrrc.URL
12157	}
12158	if rrrc.IPAddress != nil {
12159		objectMap["ipAddress"] = rrrc.IPAddress
12160	}
12161	if rrrc.BackendResponseCode != nil {
12162		objectMap["backendResponseCode"] = rrrc.BackendResponseCode
12163	}
12164	if rrrc.ResponseCode != nil {
12165		objectMap["responseCode"] = rrrc.ResponseCode
12166	}
12167	if rrrc.ResponseSize != nil {
12168		objectMap["responseSize"] = rrrc.ResponseSize
12169	}
12170	if rrrc.Timestamp != nil {
12171		objectMap["timestamp"] = rrrc.Timestamp
12172	}
12173	if rrrc.Cache != nil {
12174		objectMap["cache"] = rrrc.Cache
12175	}
12176	if rrrc.APITime != nil {
12177		objectMap["apiTime"] = rrrc.APITime
12178	}
12179	if rrrc.ServiceTime != nil {
12180		objectMap["serviceTime"] = rrrc.ServiceTime
12181	}
12182	if rrrc.APIRegion != nil {
12183		objectMap["apiRegion"] = rrrc.APIRegion
12184	}
12185	if rrrc.SubscriptionID != nil {
12186		objectMap["subscriptionId"] = rrrc.SubscriptionID
12187	}
12188	if rrrc.RequestID != nil {
12189		objectMap["requestId"] = rrrc.RequestID
12190	}
12191	if rrrc.RequestSize != nil {
12192		objectMap["requestSize"] = rrrc.RequestSize
12193	}
12194	return json.Marshal(objectMap)
12195}
12196
12197// Resource the Resource definition.
12198type Resource struct {
12199	// ID - READ-ONLY; Resource ID.
12200	ID *string `json:"id,omitempty"`
12201	// Name - READ-ONLY; Resource name.
12202	Name *string `json:"name,omitempty"`
12203	// Type - READ-ONLY; Resource type for API Management resource.
12204	Type *string `json:"type,omitempty"`
12205}
12206
12207// MarshalJSON is the custom marshaler for Resource.
12208func (r Resource) MarshalJSON() ([]byte, error) {
12209	objectMap := make(map[string]interface{})
12210	return json.Marshal(objectMap)
12211}
12212
12213// ResourceLocationDataContract resource location data properties.
12214type ResourceLocationDataContract struct {
12215	// Name - A canonical name for the geographic or physical location.
12216	Name *string `json:"name,omitempty"`
12217	// City - The city or locality where the resource is located.
12218	City *string `json:"city,omitempty"`
12219	// District - The district, state, or province where the resource is located.
12220	District *string `json:"district,omitempty"`
12221	// CountryOrRegion - The country or region where the resource is located.
12222	CountryOrRegion *string `json:"countryOrRegion,omitempty"`
12223}
12224
12225// ResourceSku describes an available API Management SKU.
12226type ResourceSku struct {
12227	// Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated'
12228	Name SkuType `json:"name,omitempty"`
12229}
12230
12231// ResourceSkuCapacity describes scaling information of a SKU.
12232type ResourceSkuCapacity struct {
12233	// Minimum - READ-ONLY; The minimum capacity.
12234	Minimum *int32 `json:"minimum,omitempty"`
12235	// Maximum - READ-ONLY; The maximum capacity that can be set.
12236	Maximum *int32 `json:"maximum,omitempty"`
12237	// Default - READ-ONLY; The default capacity.
12238	Default *int32 `json:"default,omitempty"`
12239	// ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone'
12240	ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"`
12241}
12242
12243// MarshalJSON is the custom marshaler for ResourceSkuCapacity.
12244func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) {
12245	objectMap := make(map[string]interface{})
12246	return json.Marshal(objectMap)
12247}
12248
12249// ResourceSkuResult describes an available API Management service SKU.
12250type ResourceSkuResult struct {
12251	// ResourceType - READ-ONLY; The type of resource the SKU applies to.
12252	ResourceType *string `json:"resourceType,omitempty"`
12253	// Sku - READ-ONLY; Specifies API Management SKU.
12254	Sku *ResourceSku `json:"sku,omitempty"`
12255	// Capacity - READ-ONLY; Specifies the number of API Management units.
12256	Capacity *ResourceSkuCapacity `json:"capacity,omitempty"`
12257}
12258
12259// MarshalJSON is the custom marshaler for ResourceSkuResult.
12260func (rsr ResourceSkuResult) MarshalJSON() ([]byte, error) {
12261	objectMap := make(map[string]interface{})
12262	return json.Marshal(objectMap)
12263}
12264
12265// ResourceSkuResults the API Management service SKUs operation response.
12266type ResourceSkuResults struct {
12267	autorest.Response `json:"-"`
12268	// Value - The list of skus available for the service.
12269	Value *[]ResourceSkuResult `json:"value,omitempty"`
12270	// NextLink - The uri to fetch the next page of API Management service Skus.
12271	NextLink *string `json:"nextLink,omitempty"`
12272}
12273
12274// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values.
12275type ResourceSkuResultsIterator struct {
12276	i    int
12277	page ResourceSkuResultsPage
12278}
12279
12280// NextWithContext advances to the next value.  If there was an error making
12281// the request the iterator does not advance and the error is returned.
12282func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) {
12283	if tracing.IsEnabled() {
12284		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext")
12285		defer func() {
12286			sc := -1
12287			if iter.Response().Response.Response != nil {
12288				sc = iter.Response().Response.Response.StatusCode
12289			}
12290			tracing.EndSpan(ctx, sc, err)
12291		}()
12292	}
12293	iter.i++
12294	if iter.i < len(iter.page.Values()) {
12295		return nil
12296	}
12297	err = iter.page.NextWithContext(ctx)
12298	if err != nil {
12299		iter.i--
12300		return err
12301	}
12302	iter.i = 0
12303	return nil
12304}
12305
12306// Next advances to the next value.  If there was an error making
12307// the request the iterator does not advance and the error is returned.
12308// Deprecated: Use NextWithContext() instead.
12309func (iter *ResourceSkuResultsIterator) Next() error {
12310	return iter.NextWithContext(context.Background())
12311}
12312
12313// NotDone returns true if the enumeration should be started or is not yet complete.
12314func (iter ResourceSkuResultsIterator) NotDone() bool {
12315	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12316}
12317
12318// Response returns the raw server response from the last page request.
12319func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults {
12320	return iter.page.Response()
12321}
12322
12323// Value returns the current value or a zero-initialized value if the
12324// iterator has advanced beyond the end of the collection.
12325func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult {
12326	if !iter.page.NotDone() {
12327		return ResourceSkuResult{}
12328	}
12329	return iter.page.Values()[iter.i]
12330}
12331
12332// Creates a new instance of the ResourceSkuResultsIterator type.
12333func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator {
12334	return ResourceSkuResultsIterator{page: page}
12335}
12336
12337// IsEmpty returns true if the ListResult contains no values.
12338func (rsr ResourceSkuResults) IsEmpty() bool {
12339	return rsr.Value == nil || len(*rsr.Value) == 0
12340}
12341
12342// hasNextLink returns true if the NextLink is not empty.
12343func (rsr ResourceSkuResults) hasNextLink() bool {
12344	return rsr.NextLink != nil && len(*rsr.NextLink) != 0
12345}
12346
12347// resourceSkuResultsPreparer prepares a request to retrieve the next set of results.
12348// It returns nil if no more results exist.
12349func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) {
12350	if !rsr.hasNextLink() {
12351		return nil, nil
12352	}
12353	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12354		autorest.AsJSON(),
12355		autorest.AsGet(),
12356		autorest.WithBaseURL(to.String(rsr.NextLink)))
12357}
12358
12359// ResourceSkuResultsPage contains a page of ResourceSkuResult values.
12360type ResourceSkuResultsPage struct {
12361	fn  func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)
12362	rsr ResourceSkuResults
12363}
12364
12365// NextWithContext advances to the next page of values.  If there was an error making
12366// the request the page does not advance and the error is returned.
12367func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) {
12368	if tracing.IsEnabled() {
12369		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext")
12370		defer func() {
12371			sc := -1
12372			if page.Response().Response.Response != nil {
12373				sc = page.Response().Response.Response.StatusCode
12374			}
12375			tracing.EndSpan(ctx, sc, err)
12376		}()
12377	}
12378	for {
12379		next, err := page.fn(ctx, page.rsr)
12380		if err != nil {
12381			return err
12382		}
12383		page.rsr = next
12384		if !next.hasNextLink() || !next.IsEmpty() {
12385			break
12386		}
12387	}
12388	return nil
12389}
12390
12391// Next advances to the next page of values.  If there was an error making
12392// the request the page does not advance and the error is returned.
12393// Deprecated: Use NextWithContext() instead.
12394func (page *ResourceSkuResultsPage) Next() error {
12395	return page.NextWithContext(context.Background())
12396}
12397
12398// NotDone returns true if the page enumeration should be started or is not yet complete.
12399func (page ResourceSkuResultsPage) NotDone() bool {
12400	return !page.rsr.IsEmpty()
12401}
12402
12403// Response returns the raw server response from the last page request.
12404func (page ResourceSkuResultsPage) Response() ResourceSkuResults {
12405	return page.rsr
12406}
12407
12408// Values returns the slice of values for the current page or nil if there are no values.
12409func (page ResourceSkuResultsPage) Values() []ResourceSkuResult {
12410	if page.rsr.IsEmpty() {
12411		return nil
12412	}
12413	return *page.rsr.Value
12414}
12415
12416// Creates a new instance of the ResourceSkuResultsPage type.
12417func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage {
12418	return ResourceSkuResultsPage{
12419		fn:  getNextPage,
12420		rsr: cur,
12421	}
12422}
12423
12424// ResponseContract operation response details.
12425type ResponseContract struct {
12426	// StatusCode - Operation response HTTP status code.
12427	StatusCode *int32 `json:"statusCode,omitempty"`
12428	// Description - Operation response description.
12429	Description *string `json:"description,omitempty"`
12430	// Representations - Collection of operation response representations.
12431	Representations *[]RepresentationContract `json:"representations,omitempty"`
12432	// Headers - Collection of operation response headers.
12433	Headers *[]ParameterContract `json:"headers,omitempty"`
12434}
12435
12436// SamplingSettings sampling settings for Diagnostic.
12437type SamplingSettings struct {
12438	// SamplingType - Sampling type. Possible values include: 'SamplingTypeFixed'
12439	SamplingType SamplingType `json:"samplingType,omitempty"`
12440	// Percentage - Rate of sampling for fixed-rate sampling.
12441	Percentage *float64 `json:"percentage,omitempty"`
12442}
12443
12444// SaveConfigurationParameter save Tenant Configuration Contract details.
12445type SaveConfigurationParameter struct {
12446	// SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters.
12447	*SaveConfigurationParameterProperties `json:"properties,omitempty"`
12448}
12449
12450// MarshalJSON is the custom marshaler for SaveConfigurationParameter.
12451func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) {
12452	objectMap := make(map[string]interface{})
12453	if scp.SaveConfigurationParameterProperties != nil {
12454		objectMap["properties"] = scp.SaveConfigurationParameterProperties
12455	}
12456	return json.Marshal(objectMap)
12457}
12458
12459// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct.
12460func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error {
12461	var m map[string]*json.RawMessage
12462	err := json.Unmarshal(body, &m)
12463	if err != nil {
12464		return err
12465	}
12466	for k, v := range m {
12467		switch k {
12468		case "properties":
12469			if v != nil {
12470				var saveConfigurationParameterProperties SaveConfigurationParameterProperties
12471				err = json.Unmarshal(*v, &saveConfigurationParameterProperties)
12472				if err != nil {
12473					return err
12474				}
12475				scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties
12476			}
12477		}
12478	}
12479
12480	return nil
12481}
12482
12483// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation.
12484type SaveConfigurationParameterProperties struct {
12485	// Branch - The name of the Git branch in which to commit the current configuration snapshot.
12486	Branch *string `json:"branch,omitempty"`
12487	// 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.
12488	Force *bool `json:"force,omitempty"`
12489}
12490
12491// SchemaCollection the response of the list schema operation.
12492type SchemaCollection struct {
12493	autorest.Response `json:"-"`
12494	// Value - READ-ONLY; API Schema Contract value.
12495	Value *[]SchemaContract `json:"value,omitempty"`
12496	// Count - Total record count number.
12497	Count *int64 `json:"count,omitempty"`
12498	// NextLink - READ-ONLY; Next page link if any.
12499	NextLink *string `json:"nextLink,omitempty"`
12500}
12501
12502// MarshalJSON is the custom marshaler for SchemaCollection.
12503func (sc SchemaCollection) MarshalJSON() ([]byte, error) {
12504	objectMap := make(map[string]interface{})
12505	if sc.Count != nil {
12506		objectMap["count"] = sc.Count
12507	}
12508	return json.Marshal(objectMap)
12509}
12510
12511// SchemaCollectionIterator provides access to a complete listing of SchemaContract values.
12512type SchemaCollectionIterator struct {
12513	i    int
12514	page SchemaCollectionPage
12515}
12516
12517// NextWithContext advances to the next value.  If there was an error making
12518// the request the iterator does not advance and the error is returned.
12519func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12520	if tracing.IsEnabled() {
12521		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext")
12522		defer func() {
12523			sc := -1
12524			if iter.Response().Response.Response != nil {
12525				sc = iter.Response().Response.Response.StatusCode
12526			}
12527			tracing.EndSpan(ctx, sc, err)
12528		}()
12529	}
12530	iter.i++
12531	if iter.i < len(iter.page.Values()) {
12532		return nil
12533	}
12534	err = iter.page.NextWithContext(ctx)
12535	if err != nil {
12536		iter.i--
12537		return err
12538	}
12539	iter.i = 0
12540	return nil
12541}
12542
12543// Next advances to the next value.  If there was an error making
12544// the request the iterator does not advance and the error is returned.
12545// Deprecated: Use NextWithContext() instead.
12546func (iter *SchemaCollectionIterator) Next() error {
12547	return iter.NextWithContext(context.Background())
12548}
12549
12550// NotDone returns true if the enumeration should be started or is not yet complete.
12551func (iter SchemaCollectionIterator) NotDone() bool {
12552	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12553}
12554
12555// Response returns the raw server response from the last page request.
12556func (iter SchemaCollectionIterator) Response() SchemaCollection {
12557	return iter.page.Response()
12558}
12559
12560// Value returns the current value or a zero-initialized value if the
12561// iterator has advanced beyond the end of the collection.
12562func (iter SchemaCollectionIterator) Value() SchemaContract {
12563	if !iter.page.NotDone() {
12564		return SchemaContract{}
12565	}
12566	return iter.page.Values()[iter.i]
12567}
12568
12569// Creates a new instance of the SchemaCollectionIterator type.
12570func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator {
12571	return SchemaCollectionIterator{page: page}
12572}
12573
12574// IsEmpty returns true if the ListResult contains no values.
12575func (sc SchemaCollection) IsEmpty() bool {
12576	return sc.Value == nil || len(*sc.Value) == 0
12577}
12578
12579// hasNextLink returns true if the NextLink is not empty.
12580func (sc SchemaCollection) hasNextLink() bool {
12581	return sc.NextLink != nil && len(*sc.NextLink) != 0
12582}
12583
12584// schemaCollectionPreparer prepares a request to retrieve the next set of results.
12585// It returns nil if no more results exist.
12586func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) {
12587	if !sc.hasNextLink() {
12588		return nil, nil
12589	}
12590	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12591		autorest.AsJSON(),
12592		autorest.AsGet(),
12593		autorest.WithBaseURL(to.String(sc.NextLink)))
12594}
12595
12596// SchemaCollectionPage contains a page of SchemaContract values.
12597type SchemaCollectionPage struct {
12598	fn func(context.Context, SchemaCollection) (SchemaCollection, error)
12599	sc SchemaCollection
12600}
12601
12602// NextWithContext advances to the next page of values.  If there was an error making
12603// the request the page does not advance and the error is returned.
12604func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) {
12605	if tracing.IsEnabled() {
12606		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext")
12607		defer func() {
12608			sc := -1
12609			if page.Response().Response.Response != nil {
12610				sc = page.Response().Response.Response.StatusCode
12611			}
12612			tracing.EndSpan(ctx, sc, err)
12613		}()
12614	}
12615	for {
12616		next, err := page.fn(ctx, page.sc)
12617		if err != nil {
12618			return err
12619		}
12620		page.sc = next
12621		if !next.hasNextLink() || !next.IsEmpty() {
12622			break
12623		}
12624	}
12625	return nil
12626}
12627
12628// Next advances to the next page of values.  If there was an error making
12629// the request the page does not advance and the error is returned.
12630// Deprecated: Use NextWithContext() instead.
12631func (page *SchemaCollectionPage) Next() error {
12632	return page.NextWithContext(context.Background())
12633}
12634
12635// NotDone returns true if the page enumeration should be started or is not yet complete.
12636func (page SchemaCollectionPage) NotDone() bool {
12637	return !page.sc.IsEmpty()
12638}
12639
12640// Response returns the raw server response from the last page request.
12641func (page SchemaCollectionPage) Response() SchemaCollection {
12642	return page.sc
12643}
12644
12645// Values returns the slice of values for the current page or nil if there are no values.
12646func (page SchemaCollectionPage) Values() []SchemaContract {
12647	if page.sc.IsEmpty() {
12648		return nil
12649	}
12650	return *page.sc.Value
12651}
12652
12653// Creates a new instance of the SchemaCollectionPage type.
12654func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage {
12655	return SchemaCollectionPage{
12656		fn: getNextPage,
12657		sc: cur,
12658	}
12659}
12660
12661// SchemaContract schema Contract details.
12662type SchemaContract struct {
12663	autorest.Response `json:"-"`
12664	// SchemaContractProperties - Properties of the Schema.
12665	*SchemaContractProperties `json:"properties,omitempty"`
12666	// ID - READ-ONLY; Resource ID.
12667	ID *string `json:"id,omitempty"`
12668	// Name - READ-ONLY; Resource name.
12669	Name *string `json:"name,omitempty"`
12670	// Type - READ-ONLY; Resource type for API Management resource.
12671	Type *string `json:"type,omitempty"`
12672}
12673
12674// MarshalJSON is the custom marshaler for SchemaContract.
12675func (sc SchemaContract) MarshalJSON() ([]byte, error) {
12676	objectMap := make(map[string]interface{})
12677	if sc.SchemaContractProperties != nil {
12678		objectMap["properties"] = sc.SchemaContractProperties
12679	}
12680	return json.Marshal(objectMap)
12681}
12682
12683// UnmarshalJSON is the custom unmarshaler for SchemaContract struct.
12684func (sc *SchemaContract) UnmarshalJSON(body []byte) error {
12685	var m map[string]*json.RawMessage
12686	err := json.Unmarshal(body, &m)
12687	if err != nil {
12688		return err
12689	}
12690	for k, v := range m {
12691		switch k {
12692		case "properties":
12693			if v != nil {
12694				var schemaContractProperties SchemaContractProperties
12695				err = json.Unmarshal(*v, &schemaContractProperties)
12696				if err != nil {
12697					return err
12698				}
12699				sc.SchemaContractProperties = &schemaContractProperties
12700			}
12701		case "id":
12702			if v != nil {
12703				var ID string
12704				err = json.Unmarshal(*v, &ID)
12705				if err != nil {
12706					return err
12707				}
12708				sc.ID = &ID
12709			}
12710		case "name":
12711			if v != nil {
12712				var name string
12713				err = json.Unmarshal(*v, &name)
12714				if err != nil {
12715					return err
12716				}
12717				sc.Name = &name
12718			}
12719		case "type":
12720			if v != nil {
12721				var typeVar string
12722				err = json.Unmarshal(*v, &typeVar)
12723				if err != nil {
12724					return err
12725				}
12726				sc.Type = &typeVar
12727			}
12728		}
12729	}
12730
12731	return nil
12732}
12733
12734// SchemaContractProperties API Schema create or update contract Properties.
12735type SchemaContractProperties struct {
12736	// 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`.
12737	ContentType *string `json:"contentType,omitempty"`
12738	// Document - Create or update Properties of the Schema Document.
12739	Document interface{} `json:"document,omitempty"`
12740}
12741
12742// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration
12743// operation.
12744type ServiceApplyNetworkConfigurationParameters struct {
12745	// 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.
12746	Location *string `json:"location,omitempty"`
12747}
12748
12749// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results
12750// of a long-running operation.
12751type ServiceApplyNetworkConfigurationUpdatesFuture struct {
12752	azure.FutureAPI
12753	// Result returns the result of the asynchronous operation.
12754	// If the operation has not completed it will return an error.
12755	Result func(ServiceClient) (ServiceResource, error)
12756}
12757
12758// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12759func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error {
12760	var azFuture azure.Future
12761	if err := json.Unmarshal(body, &azFuture); err != nil {
12762		return err
12763	}
12764	future.FutureAPI = &azFuture
12765	future.Result = future.result
12766	return nil
12767}
12768
12769// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result.
12770func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) {
12771	var done bool
12772	done, err = future.DoneWithContext(context.Background(), client)
12773	if err != nil {
12774		err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure")
12775		return
12776	}
12777	if !done {
12778		sr.Response.Response = future.Response()
12779		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture")
12780		return
12781	}
12782	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12783	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
12784		sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response)
12785		if err != nil {
12786			err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request")
12787		}
12788	}
12789	return
12790}
12791
12792// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running
12793// operation.
12794type ServiceBackupFuture struct {
12795	azure.FutureAPI
12796	// Result returns the result of the asynchronous operation.
12797	// If the operation has not completed it will return an error.
12798	Result func(ServiceClient) (ServiceResource, error)
12799}
12800
12801// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12802func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error {
12803	var azFuture azure.Future
12804	if err := json.Unmarshal(body, &azFuture); err != nil {
12805		return err
12806	}
12807	future.FutureAPI = &azFuture
12808	future.Result = future.result
12809	return nil
12810}
12811
12812// result is the default implementation for ServiceBackupFuture.Result.
12813func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) {
12814	var done bool
12815	done, err = future.DoneWithContext(context.Background(), client)
12816	if err != nil {
12817		err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure")
12818		return
12819	}
12820	if !done {
12821		sr.Response.Response = future.Response()
12822		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture")
12823		return
12824	}
12825	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12826	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
12827		sr, err = client.BackupResponder(sr.Response.Response)
12828		if err != nil {
12829			err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request")
12830		}
12831	}
12832	return
12833}
12834
12835// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service
12836// operation.
12837type ServiceBackupRestoreParameters struct {
12838	// StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name.
12839	StorageAccount *string `json:"storageAccount,omitempty"`
12840	// AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key.
12841	AccessKey *string `json:"accessKey,omitempty"`
12842	// ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup.
12843	ContainerName *string `json:"containerName,omitempty"`
12844	// BackupName - The name of the backup file to create.
12845	BackupName *string `json:"backupName,omitempty"`
12846}
12847
12848// ServiceBaseProperties base Properties of an API Management service resource description.
12849type ServiceBaseProperties struct {
12850	// NotificationSenderEmail - Email address from which the notification will be sent.
12851	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
12852	// 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.
12853	ProvisioningState *string `json:"provisioningState,omitempty"`
12854	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
12855	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
12856	// 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.
12857	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
12858	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
12859	GatewayURL *string `json:"gatewayUrl,omitempty"`
12860	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
12861	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
12862	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
12863	PortalURL *string `json:"portalUrl,omitempty"`
12864	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
12865	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
12866	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
12867	ScmURL *string `json:"scmUrl,omitempty"`
12868	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
12869	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
12870	// HostnameConfigurations - Custom hostname configuration of the API Management service.
12871	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
12872	// PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU.
12873	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
12874	// 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, Premium and Isolated SKU.
12875	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
12876	// PublicIPAddressID - Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.
12877	PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
12878	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
12879	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
12880	// AdditionalLocations - Additional datacenter locations of the API Management service.
12881	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
12882	// 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
12883	CustomProperties map[string]*string `json:"customProperties"`
12884	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
12885	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
12886	// 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.
12887	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
12888	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
12889	DisableGateway *bool `json:"disableGateway,omitempty"`
12890	// 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'
12891	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
12892	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
12893	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
12894	// Restore - Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.
12895	Restore *bool `json:"restore,omitempty"`
12896}
12897
12898// MarshalJSON is the custom marshaler for ServiceBaseProperties.
12899func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) {
12900	objectMap := make(map[string]interface{})
12901	if sbp.NotificationSenderEmail != nil {
12902		objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail
12903	}
12904	if sbp.HostnameConfigurations != nil {
12905		objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations
12906	}
12907	if sbp.PublicIPAddressID != nil {
12908		objectMap["publicIpAddressId"] = sbp.PublicIPAddressID
12909	}
12910	if sbp.VirtualNetworkConfiguration != nil {
12911		objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration
12912	}
12913	if sbp.AdditionalLocations != nil {
12914		objectMap["additionalLocations"] = sbp.AdditionalLocations
12915	}
12916	if sbp.CustomProperties != nil {
12917		objectMap["customProperties"] = sbp.CustomProperties
12918	}
12919	if sbp.Certificates != nil {
12920		objectMap["certificates"] = sbp.Certificates
12921	}
12922	if sbp.EnableClientCertificate != nil {
12923		objectMap["enableClientCertificate"] = sbp.EnableClientCertificate
12924	}
12925	if sbp.DisableGateway != nil {
12926		objectMap["disableGateway"] = sbp.DisableGateway
12927	}
12928	if sbp.VirtualNetworkType != "" {
12929		objectMap["virtualNetworkType"] = sbp.VirtualNetworkType
12930	}
12931	if sbp.APIVersionConstraint != nil {
12932		objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint
12933	}
12934	if sbp.Restore != nil {
12935		objectMap["restore"] = sbp.Restore
12936	}
12937	return json.Marshal(objectMap)
12938}
12939
12940// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation.
12941type ServiceCheckNameAvailabilityParameters struct {
12942	// Name - The name to check for availability.
12943	Name *string `json:"name,omitempty"`
12944}
12945
12946// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
12947// operation.
12948type ServiceCreateOrUpdateFuture struct {
12949	azure.FutureAPI
12950	// Result returns the result of the asynchronous operation.
12951	// If the operation has not completed it will return an error.
12952	Result func(ServiceClient) (ServiceResource, error)
12953}
12954
12955// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12956func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12957	var azFuture azure.Future
12958	if err := json.Unmarshal(body, &azFuture); err != nil {
12959		return err
12960	}
12961	future.FutureAPI = &azFuture
12962	future.Result = future.result
12963	return nil
12964}
12965
12966// result is the default implementation for ServiceCreateOrUpdateFuture.Result.
12967func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
12968	var done bool
12969	done, err = future.DoneWithContext(context.Background(), client)
12970	if err != nil {
12971		err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12972		return
12973	}
12974	if !done {
12975		sr.Response.Response = future.Response()
12976		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture")
12977		return
12978	}
12979	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12980	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
12981		sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
12982		if err != nil {
12983			err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
12984		}
12985	}
12986	return
12987}
12988
12989// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
12990// operation.
12991type ServiceDeleteFuture struct {
12992	azure.FutureAPI
12993	// Result returns the result of the asynchronous operation.
12994	// If the operation has not completed it will return an error.
12995	Result func(ServiceClient) (ServiceResource, error)
12996}
12997
12998// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12999func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error {
13000	var azFuture azure.Future
13001	if err := json.Unmarshal(body, &azFuture); err != nil {
13002		return err
13003	}
13004	future.FutureAPI = &azFuture
13005	future.Result = future.result
13006	return nil
13007}
13008
13009// result is the default implementation for ServiceDeleteFuture.Result.
13010func (future *ServiceDeleteFuture) result(client ServiceClient) (sr ServiceResource, err error) {
13011	var done bool
13012	done, err = future.DoneWithContext(context.Background(), client)
13013	if err != nil {
13014		err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure")
13015		return
13016	}
13017	if !done {
13018		sr.Response.Response = future.Response()
13019		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture")
13020		return
13021	}
13022	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13023	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
13024		sr, err = client.DeleteResponder(sr.Response.Response)
13025		if err != nil {
13026			err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request")
13027		}
13028	}
13029	return
13030}
13031
13032// ServiceGetDomainOwnershipIdentifierResult response of the GetDomainOwnershipIdentifier operation.
13033type ServiceGetDomainOwnershipIdentifierResult struct {
13034	autorest.Response `json:"-"`
13035	// DomainOwnershipIdentifier - READ-ONLY; The domain ownership identifier value.
13036	DomainOwnershipIdentifier *string `json:"domainOwnershipIdentifier,omitempty"`
13037}
13038
13039// MarshalJSON is the custom marshaler for ServiceGetDomainOwnershipIdentifierResult.
13040func (sgdoir ServiceGetDomainOwnershipIdentifierResult) MarshalJSON() ([]byte, error) {
13041	objectMap := make(map[string]interface{})
13042	return json.Marshal(objectMap)
13043}
13044
13045// ServiceGetSsoTokenResult the response of the GetSsoToken operation.
13046type ServiceGetSsoTokenResult struct {
13047	autorest.Response `json:"-"`
13048	// RedirectURI - Redirect URL to the Publisher Portal containing the SSO token.
13049	RedirectURI *string `json:"redirectUri,omitempty"`
13050}
13051
13052// ServiceIdentity identity properties of the Api Management service resource.
13053type ServiceIdentity struct {
13054	// 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: 'ApimIdentityTypeSystemAssigned', 'ApimIdentityTypeUserAssigned', 'ApimIdentityTypeSystemAssignedUserAssigned', 'ApimIdentityTypeNone'
13055	Type ApimIdentityType `json:"type,omitempty"`
13056	// PrincipalID - READ-ONLY; The principal id of the identity.
13057	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
13058	// TenantID - READ-ONLY; The client tenant id of the identity.
13059	TenantID *uuid.UUID `json:"tenantId,omitempty"`
13060	// UserAssignedIdentities - The list of user identities associated with the resource. The user identity
13061	// dictionary key references will be ARM resource ids in the form:
13062	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
13063	//     providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
13064	UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"`
13065}
13066
13067// MarshalJSON is the custom marshaler for ServiceIdentity.
13068func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
13069	objectMap := make(map[string]interface{})
13070	if si.Type != "" {
13071		objectMap["type"] = si.Type
13072	}
13073	if si.UserAssignedIdentities != nil {
13074		objectMap["userAssignedIdentities"] = si.UserAssignedIdentities
13075	}
13076	return json.Marshal(objectMap)
13077}
13078
13079// ServiceListResult the response of the List API Management services operation.
13080type ServiceListResult struct {
13081	autorest.Response `json:"-"`
13082	// Value - Result of the List API Management services operation.
13083	Value *[]ServiceResource `json:"value,omitempty"`
13084	// NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services.
13085	NextLink *string `json:"nextLink,omitempty"`
13086}
13087
13088// ServiceListResultIterator provides access to a complete listing of ServiceResource values.
13089type ServiceListResultIterator struct {
13090	i    int
13091	page ServiceListResultPage
13092}
13093
13094// NextWithContext advances to the next value.  If there was an error making
13095// the request the iterator does not advance and the error is returned.
13096func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
13097	if tracing.IsEnabled() {
13098		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext")
13099		defer func() {
13100			sc := -1
13101			if iter.Response().Response.Response != nil {
13102				sc = iter.Response().Response.Response.StatusCode
13103			}
13104			tracing.EndSpan(ctx, sc, err)
13105		}()
13106	}
13107	iter.i++
13108	if iter.i < len(iter.page.Values()) {
13109		return nil
13110	}
13111	err = iter.page.NextWithContext(ctx)
13112	if err != nil {
13113		iter.i--
13114		return err
13115	}
13116	iter.i = 0
13117	return nil
13118}
13119
13120// Next advances to the next value.  If there was an error making
13121// the request the iterator does not advance and the error is returned.
13122// Deprecated: Use NextWithContext() instead.
13123func (iter *ServiceListResultIterator) Next() error {
13124	return iter.NextWithContext(context.Background())
13125}
13126
13127// NotDone returns true if the enumeration should be started or is not yet complete.
13128func (iter ServiceListResultIterator) NotDone() bool {
13129	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13130}
13131
13132// Response returns the raw server response from the last page request.
13133func (iter ServiceListResultIterator) Response() ServiceListResult {
13134	return iter.page.Response()
13135}
13136
13137// Value returns the current value or a zero-initialized value if the
13138// iterator has advanced beyond the end of the collection.
13139func (iter ServiceListResultIterator) Value() ServiceResource {
13140	if !iter.page.NotDone() {
13141		return ServiceResource{}
13142	}
13143	return iter.page.Values()[iter.i]
13144}
13145
13146// Creates a new instance of the ServiceListResultIterator type.
13147func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator {
13148	return ServiceListResultIterator{page: page}
13149}
13150
13151// IsEmpty returns true if the ListResult contains no values.
13152func (slr ServiceListResult) IsEmpty() bool {
13153	return slr.Value == nil || len(*slr.Value) == 0
13154}
13155
13156// hasNextLink returns true if the NextLink is not empty.
13157func (slr ServiceListResult) hasNextLink() bool {
13158	return slr.NextLink != nil && len(*slr.NextLink) != 0
13159}
13160
13161// serviceListResultPreparer prepares a request to retrieve the next set of results.
13162// It returns nil if no more results exist.
13163func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) {
13164	if !slr.hasNextLink() {
13165		return nil, nil
13166	}
13167	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13168		autorest.AsJSON(),
13169		autorest.AsGet(),
13170		autorest.WithBaseURL(to.String(slr.NextLink)))
13171}
13172
13173// ServiceListResultPage contains a page of ServiceResource values.
13174type ServiceListResultPage struct {
13175	fn  func(context.Context, ServiceListResult) (ServiceListResult, error)
13176	slr ServiceListResult
13177}
13178
13179// NextWithContext advances to the next page of values.  If there was an error making
13180// the request the page does not advance and the error is returned.
13181func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
13182	if tracing.IsEnabled() {
13183		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext")
13184		defer func() {
13185			sc := -1
13186			if page.Response().Response.Response != nil {
13187				sc = page.Response().Response.Response.StatusCode
13188			}
13189			tracing.EndSpan(ctx, sc, err)
13190		}()
13191	}
13192	for {
13193		next, err := page.fn(ctx, page.slr)
13194		if err != nil {
13195			return err
13196		}
13197		page.slr = next
13198		if !next.hasNextLink() || !next.IsEmpty() {
13199			break
13200		}
13201	}
13202	return nil
13203}
13204
13205// Next advances to the next page of values.  If there was an error making
13206// the request the page does not advance and the error is returned.
13207// Deprecated: Use NextWithContext() instead.
13208func (page *ServiceListResultPage) Next() error {
13209	return page.NextWithContext(context.Background())
13210}
13211
13212// NotDone returns true if the page enumeration should be started or is not yet complete.
13213func (page ServiceListResultPage) NotDone() bool {
13214	return !page.slr.IsEmpty()
13215}
13216
13217// Response returns the raw server response from the last page request.
13218func (page ServiceListResultPage) Response() ServiceListResult {
13219	return page.slr
13220}
13221
13222// Values returns the slice of values for the current page or nil if there are no values.
13223func (page ServiceListResultPage) Values() []ServiceResource {
13224	if page.slr.IsEmpty() {
13225		return nil
13226	}
13227	return *page.slr.Value
13228}
13229
13230// Creates a new instance of the ServiceListResultPage type.
13231func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage {
13232	return ServiceListResultPage{
13233		fn:  getNextPage,
13234		slr: cur,
13235	}
13236}
13237
13238// ServiceNameAvailabilityResult response of the CheckNameAvailability operation.
13239type ServiceNameAvailabilityResult struct {
13240	autorest.Response `json:"-"`
13241	// NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false.
13242	NameAvailable *bool `json:"nameAvailable,omitempty"`
13243	// 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.
13244	Message *string `json:"message,omitempty"`
13245	// 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: 'NameAvailabilityReasonValid', 'NameAvailabilityReasonInvalid', 'NameAvailabilityReasonAlreadyExists'
13246	Reason NameAvailabilityReason `json:"reason,omitempty"`
13247}
13248
13249// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult.
13250func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) {
13251	objectMap := make(map[string]interface{})
13252	if snar.Reason != "" {
13253		objectMap["reason"] = snar.Reason
13254	}
13255	return json.Marshal(objectMap)
13256}
13257
13258// ServiceProperties properties of an API Management service resource description.
13259type ServiceProperties struct {
13260	// PublisherEmail - Publisher email.
13261	PublisherEmail *string `json:"publisherEmail,omitempty"`
13262	// PublisherName - Publisher name.
13263	PublisherName *string `json:"publisherName,omitempty"`
13264	// NotificationSenderEmail - Email address from which the notification will be sent.
13265	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
13266	// 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.
13267	ProvisioningState *string `json:"provisioningState,omitempty"`
13268	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
13269	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
13270	// 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.
13271	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
13272	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
13273	GatewayURL *string `json:"gatewayUrl,omitempty"`
13274	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
13275	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
13276	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
13277	PortalURL *string `json:"portalUrl,omitempty"`
13278	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
13279	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
13280	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
13281	ScmURL *string `json:"scmUrl,omitempty"`
13282	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
13283	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
13284	// HostnameConfigurations - Custom hostname configuration of the API Management service.
13285	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
13286	// PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU.
13287	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
13288	// 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, Premium and Isolated SKU.
13289	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
13290	// PublicIPAddressID - Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.
13291	PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
13292	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
13293	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
13294	// AdditionalLocations - Additional datacenter locations of the API Management service.
13295	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
13296	// 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
13297	CustomProperties map[string]*string `json:"customProperties"`
13298	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
13299	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
13300	// 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.
13301	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
13302	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
13303	DisableGateway *bool `json:"disableGateway,omitempty"`
13304	// 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'
13305	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
13306	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
13307	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
13308	// Restore - Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.
13309	Restore *bool `json:"restore,omitempty"`
13310}
13311
13312// MarshalJSON is the custom marshaler for ServiceProperties.
13313func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
13314	objectMap := make(map[string]interface{})
13315	if sp.PublisherEmail != nil {
13316		objectMap["publisherEmail"] = sp.PublisherEmail
13317	}
13318	if sp.PublisherName != nil {
13319		objectMap["publisherName"] = sp.PublisherName
13320	}
13321	if sp.NotificationSenderEmail != nil {
13322		objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail
13323	}
13324	if sp.HostnameConfigurations != nil {
13325		objectMap["hostnameConfigurations"] = sp.HostnameConfigurations
13326	}
13327	if sp.PublicIPAddressID != nil {
13328		objectMap["publicIpAddressId"] = sp.PublicIPAddressID
13329	}
13330	if sp.VirtualNetworkConfiguration != nil {
13331		objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration
13332	}
13333	if sp.AdditionalLocations != nil {
13334		objectMap["additionalLocations"] = sp.AdditionalLocations
13335	}
13336	if sp.CustomProperties != nil {
13337		objectMap["customProperties"] = sp.CustomProperties
13338	}
13339	if sp.Certificates != nil {
13340		objectMap["certificates"] = sp.Certificates
13341	}
13342	if sp.EnableClientCertificate != nil {
13343		objectMap["enableClientCertificate"] = sp.EnableClientCertificate
13344	}
13345	if sp.DisableGateway != nil {
13346		objectMap["disableGateway"] = sp.DisableGateway
13347	}
13348	if sp.VirtualNetworkType != "" {
13349		objectMap["virtualNetworkType"] = sp.VirtualNetworkType
13350	}
13351	if sp.APIVersionConstraint != nil {
13352		objectMap["apiVersionConstraint"] = sp.APIVersionConstraint
13353	}
13354	if sp.Restore != nil {
13355		objectMap["restore"] = sp.Restore
13356	}
13357	return json.Marshal(objectMap)
13358}
13359
13360// ServiceResource a single API Management service resource in List or Get response.
13361type ServiceResource struct {
13362	autorest.Response `json:"-"`
13363	// ServiceProperties - Properties of the API Management service.
13364	*ServiceProperties `json:"properties,omitempty"`
13365	// Sku - SKU properties of the API Management service.
13366	Sku *ServiceSkuProperties `json:"sku,omitempty"`
13367	// Identity - Managed service identity of the Api Management service.
13368	Identity *ServiceIdentity `json:"identity,omitempty"`
13369	// Location - Resource location.
13370	Location *string `json:"location,omitempty"`
13371	// Etag - READ-ONLY; ETag of the resource.
13372	Etag *string `json:"etag,omitempty"`
13373	// Zones - A list of availability zones denoting where the resource needs to come from.
13374	Zones *[]string `json:"zones,omitempty"`
13375	// ID - READ-ONLY; Resource ID.
13376	ID *string `json:"id,omitempty"`
13377	// Name - READ-ONLY; Resource name.
13378	Name *string `json:"name,omitempty"`
13379	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
13380	Type *string `json:"type,omitempty"`
13381	// Tags - Resource tags.
13382	Tags map[string]*string `json:"tags"`
13383}
13384
13385// MarshalJSON is the custom marshaler for ServiceResource.
13386func (sr ServiceResource) MarshalJSON() ([]byte, error) {
13387	objectMap := make(map[string]interface{})
13388	if sr.ServiceProperties != nil {
13389		objectMap["properties"] = sr.ServiceProperties
13390	}
13391	if sr.Sku != nil {
13392		objectMap["sku"] = sr.Sku
13393	}
13394	if sr.Identity != nil {
13395		objectMap["identity"] = sr.Identity
13396	}
13397	if sr.Location != nil {
13398		objectMap["location"] = sr.Location
13399	}
13400	if sr.Zones != nil {
13401		objectMap["zones"] = sr.Zones
13402	}
13403	if sr.Tags != nil {
13404		objectMap["tags"] = sr.Tags
13405	}
13406	return json.Marshal(objectMap)
13407}
13408
13409// UnmarshalJSON is the custom unmarshaler for ServiceResource struct.
13410func (sr *ServiceResource) UnmarshalJSON(body []byte) error {
13411	var m map[string]*json.RawMessage
13412	err := json.Unmarshal(body, &m)
13413	if err != nil {
13414		return err
13415	}
13416	for k, v := range m {
13417		switch k {
13418		case "properties":
13419			if v != nil {
13420				var serviceProperties ServiceProperties
13421				err = json.Unmarshal(*v, &serviceProperties)
13422				if err != nil {
13423					return err
13424				}
13425				sr.ServiceProperties = &serviceProperties
13426			}
13427		case "sku":
13428			if v != nil {
13429				var sku ServiceSkuProperties
13430				err = json.Unmarshal(*v, &sku)
13431				if err != nil {
13432					return err
13433				}
13434				sr.Sku = &sku
13435			}
13436		case "identity":
13437			if v != nil {
13438				var identity ServiceIdentity
13439				err = json.Unmarshal(*v, &identity)
13440				if err != nil {
13441					return err
13442				}
13443				sr.Identity = &identity
13444			}
13445		case "location":
13446			if v != nil {
13447				var location string
13448				err = json.Unmarshal(*v, &location)
13449				if err != nil {
13450					return err
13451				}
13452				sr.Location = &location
13453			}
13454		case "etag":
13455			if v != nil {
13456				var etag string
13457				err = json.Unmarshal(*v, &etag)
13458				if err != nil {
13459					return err
13460				}
13461				sr.Etag = &etag
13462			}
13463		case "zones":
13464			if v != nil {
13465				var zones []string
13466				err = json.Unmarshal(*v, &zones)
13467				if err != nil {
13468					return err
13469				}
13470				sr.Zones = &zones
13471			}
13472		case "id":
13473			if v != nil {
13474				var ID string
13475				err = json.Unmarshal(*v, &ID)
13476				if err != nil {
13477					return err
13478				}
13479				sr.ID = &ID
13480			}
13481		case "name":
13482			if v != nil {
13483				var name string
13484				err = json.Unmarshal(*v, &name)
13485				if err != nil {
13486					return err
13487				}
13488				sr.Name = &name
13489			}
13490		case "type":
13491			if v != nil {
13492				var typeVar string
13493				err = json.Unmarshal(*v, &typeVar)
13494				if err != nil {
13495					return err
13496				}
13497				sr.Type = &typeVar
13498			}
13499		case "tags":
13500			if v != nil {
13501				var tags map[string]*string
13502				err = json.Unmarshal(*v, &tags)
13503				if err != nil {
13504					return err
13505				}
13506				sr.Tags = tags
13507			}
13508		}
13509	}
13510
13511	return nil
13512}
13513
13514// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running
13515// operation.
13516type ServiceRestoreFuture struct {
13517	azure.FutureAPI
13518	// Result returns the result of the asynchronous operation.
13519	// If the operation has not completed it will return an error.
13520	Result func(ServiceClient) (ServiceResource, error)
13521}
13522
13523// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13524func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error {
13525	var azFuture azure.Future
13526	if err := json.Unmarshal(body, &azFuture); err != nil {
13527		return err
13528	}
13529	future.FutureAPI = &azFuture
13530	future.Result = future.result
13531	return nil
13532}
13533
13534// result is the default implementation for ServiceRestoreFuture.Result.
13535func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) {
13536	var done bool
13537	done, err = future.DoneWithContext(context.Background(), client)
13538	if err != nil {
13539		err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure")
13540		return
13541	}
13542	if !done {
13543		sr.Response.Response = future.Response()
13544		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture")
13545		return
13546	}
13547	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13548	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
13549		sr, err = client.RestoreResponder(sr.Response.Response)
13550		if err != nil {
13551			err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request")
13552		}
13553	}
13554	return
13555}
13556
13557// ServiceSkuProperties API Management service resource SKU properties.
13558type ServiceSkuProperties struct {
13559	// Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated'
13560	Name SkuType `json:"name,omitempty"`
13561	// Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.
13562	Capacity *int32 `json:"capacity,omitempty"`
13563}
13564
13565// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
13566// operation.
13567type ServiceUpdateFuture struct {
13568	azure.FutureAPI
13569	// Result returns the result of the asynchronous operation.
13570	// If the operation has not completed it will return an error.
13571	Result func(ServiceClient) (ServiceResource, error)
13572}
13573
13574// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13575func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error {
13576	var azFuture azure.Future
13577	if err := json.Unmarshal(body, &azFuture); err != nil {
13578		return err
13579	}
13580	future.FutureAPI = &azFuture
13581	future.Result = future.result
13582	return nil
13583}
13584
13585// result is the default implementation for ServiceUpdateFuture.Result.
13586func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
13587	var done bool
13588	done, err = future.DoneWithContext(context.Background(), client)
13589	if err != nil {
13590		err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure")
13591		return
13592	}
13593	if !done {
13594		sr.Response.Response = future.Response()
13595		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture")
13596		return
13597	}
13598	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13599	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
13600		sr, err = client.UpdateResponder(sr.Response.Response)
13601		if err != nil {
13602			err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
13603		}
13604	}
13605	return
13606}
13607
13608// ServiceUpdateParameters parameter supplied to Update Api Management Service.
13609type ServiceUpdateParameters struct {
13610	// ServiceUpdateProperties - Properties of the API Management service.
13611	*ServiceUpdateProperties `json:"properties,omitempty"`
13612	// Sku - SKU properties of the API Management service.
13613	Sku *ServiceSkuProperties `json:"sku,omitempty"`
13614	// Identity - Managed service identity of the Api Management service.
13615	Identity *ServiceIdentity `json:"identity,omitempty"`
13616	// Etag - READ-ONLY; ETag of the resource.
13617	Etag *string `json:"etag,omitempty"`
13618	// Zones - A list of availability zones denoting where the resource needs to come from.
13619	Zones *[]string `json:"zones,omitempty"`
13620	// ID - READ-ONLY; Resource ID.
13621	ID *string `json:"id,omitempty"`
13622	// Name - READ-ONLY; Resource name.
13623	Name *string `json:"name,omitempty"`
13624	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
13625	Type *string `json:"type,omitempty"`
13626	// Tags - Resource tags.
13627	Tags map[string]*string `json:"tags"`
13628}
13629
13630// MarshalJSON is the custom marshaler for ServiceUpdateParameters.
13631func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) {
13632	objectMap := make(map[string]interface{})
13633	if sup.ServiceUpdateProperties != nil {
13634		objectMap["properties"] = sup.ServiceUpdateProperties
13635	}
13636	if sup.Sku != nil {
13637		objectMap["sku"] = sup.Sku
13638	}
13639	if sup.Identity != nil {
13640		objectMap["identity"] = sup.Identity
13641	}
13642	if sup.Zones != nil {
13643		objectMap["zones"] = sup.Zones
13644	}
13645	if sup.Tags != nil {
13646		objectMap["tags"] = sup.Tags
13647	}
13648	return json.Marshal(objectMap)
13649}
13650
13651// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct.
13652func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error {
13653	var m map[string]*json.RawMessage
13654	err := json.Unmarshal(body, &m)
13655	if err != nil {
13656		return err
13657	}
13658	for k, v := range m {
13659		switch k {
13660		case "properties":
13661			if v != nil {
13662				var serviceUpdateProperties ServiceUpdateProperties
13663				err = json.Unmarshal(*v, &serviceUpdateProperties)
13664				if err != nil {
13665					return err
13666				}
13667				sup.ServiceUpdateProperties = &serviceUpdateProperties
13668			}
13669		case "sku":
13670			if v != nil {
13671				var sku ServiceSkuProperties
13672				err = json.Unmarshal(*v, &sku)
13673				if err != nil {
13674					return err
13675				}
13676				sup.Sku = &sku
13677			}
13678		case "identity":
13679			if v != nil {
13680				var identity ServiceIdentity
13681				err = json.Unmarshal(*v, &identity)
13682				if err != nil {
13683					return err
13684				}
13685				sup.Identity = &identity
13686			}
13687		case "etag":
13688			if v != nil {
13689				var etag string
13690				err = json.Unmarshal(*v, &etag)
13691				if err != nil {
13692					return err
13693				}
13694				sup.Etag = &etag
13695			}
13696		case "zones":
13697			if v != nil {
13698				var zones []string
13699				err = json.Unmarshal(*v, &zones)
13700				if err != nil {
13701					return err
13702				}
13703				sup.Zones = &zones
13704			}
13705		case "id":
13706			if v != nil {
13707				var ID string
13708				err = json.Unmarshal(*v, &ID)
13709				if err != nil {
13710					return err
13711				}
13712				sup.ID = &ID
13713			}
13714		case "name":
13715			if v != nil {
13716				var name string
13717				err = json.Unmarshal(*v, &name)
13718				if err != nil {
13719					return err
13720				}
13721				sup.Name = &name
13722			}
13723		case "type":
13724			if v != nil {
13725				var typeVar string
13726				err = json.Unmarshal(*v, &typeVar)
13727				if err != nil {
13728					return err
13729				}
13730				sup.Type = &typeVar
13731			}
13732		case "tags":
13733			if v != nil {
13734				var tags map[string]*string
13735				err = json.Unmarshal(*v, &tags)
13736				if err != nil {
13737					return err
13738				}
13739				sup.Tags = tags
13740			}
13741		}
13742	}
13743
13744	return nil
13745}
13746
13747// ServiceUpdateProperties properties of an API Management service resource description.
13748type ServiceUpdateProperties struct {
13749	// PublisherEmail - Publisher email.
13750	PublisherEmail *string `json:"publisherEmail,omitempty"`
13751	// PublisherName - Publisher name.
13752	PublisherName *string `json:"publisherName,omitempty"`
13753	// NotificationSenderEmail - Email address from which the notification will be sent.
13754	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
13755	// 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.
13756	ProvisioningState *string `json:"provisioningState,omitempty"`
13757	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
13758	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
13759	// 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.
13760	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
13761	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
13762	GatewayURL *string `json:"gatewayUrl,omitempty"`
13763	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
13764	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
13765	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
13766	PortalURL *string `json:"portalUrl,omitempty"`
13767	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
13768	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
13769	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
13770	ScmURL *string `json:"scmUrl,omitempty"`
13771	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
13772	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
13773	// HostnameConfigurations - Custom hostname configuration of the API Management service.
13774	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
13775	// PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU.
13776	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
13777	// 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, Premium and Isolated SKU.
13778	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
13779	// PublicIPAddressID - Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network.
13780	PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
13781	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
13782	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
13783	// AdditionalLocations - Additional datacenter locations of the API Management service.
13784	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
13785	// 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
13786	CustomProperties map[string]*string `json:"customProperties"`
13787	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
13788	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
13789	// 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.
13790	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
13791	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
13792	DisableGateway *bool `json:"disableGateway,omitempty"`
13793	// 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'
13794	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
13795	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
13796	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
13797	// Restore - Undelete Api Management Service if it was previously soft-deleted. If this flag is specified and set to True all other properties will be ignored.
13798	Restore *bool `json:"restore,omitempty"`
13799}
13800
13801// MarshalJSON is the custom marshaler for ServiceUpdateProperties.
13802func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) {
13803	objectMap := make(map[string]interface{})
13804	if sup.PublisherEmail != nil {
13805		objectMap["publisherEmail"] = sup.PublisherEmail
13806	}
13807	if sup.PublisherName != nil {
13808		objectMap["publisherName"] = sup.PublisherName
13809	}
13810	if sup.NotificationSenderEmail != nil {
13811		objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail
13812	}
13813	if sup.HostnameConfigurations != nil {
13814		objectMap["hostnameConfigurations"] = sup.HostnameConfigurations
13815	}
13816	if sup.PublicIPAddressID != nil {
13817		objectMap["publicIpAddressId"] = sup.PublicIPAddressID
13818	}
13819	if sup.VirtualNetworkConfiguration != nil {
13820		objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration
13821	}
13822	if sup.AdditionalLocations != nil {
13823		objectMap["additionalLocations"] = sup.AdditionalLocations
13824	}
13825	if sup.CustomProperties != nil {
13826		objectMap["customProperties"] = sup.CustomProperties
13827	}
13828	if sup.Certificates != nil {
13829		objectMap["certificates"] = sup.Certificates
13830	}
13831	if sup.EnableClientCertificate != nil {
13832		objectMap["enableClientCertificate"] = sup.EnableClientCertificate
13833	}
13834	if sup.DisableGateway != nil {
13835		objectMap["disableGateway"] = sup.DisableGateway
13836	}
13837	if sup.VirtualNetworkType != "" {
13838		objectMap["virtualNetworkType"] = sup.VirtualNetworkType
13839	}
13840	if sup.APIVersionConstraint != nil {
13841		objectMap["apiVersionConstraint"] = sup.APIVersionConstraint
13842	}
13843	if sup.Restore != nil {
13844		objectMap["restore"] = sup.Restore
13845	}
13846	return json.Marshal(objectMap)
13847}
13848
13849// Sku describes an available ApiManagement SKU.
13850type Sku struct {
13851	// ResourceType - READ-ONLY; The type of resource the SKU applies to.
13852	ResourceType *string `json:"resourceType,omitempty"`
13853	// Name - READ-ONLY; The name of SKU.
13854	Name *string `json:"name,omitempty"`
13855	// Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**
13856	Tier *string `json:"tier,omitempty"`
13857	// Size - READ-ONLY; The Size of the SKU.
13858	Size *string `json:"size,omitempty"`
13859	// Family - READ-ONLY; The Family of this particular SKU.
13860	Family *string `json:"family,omitempty"`
13861	// Kind - READ-ONLY; The Kind of resources that are supported in this SKU.
13862	Kind *string `json:"kind,omitempty"`
13863	// Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set.
13864	Capacity *SkuCapacity `json:"capacity,omitempty"`
13865	// Locations - READ-ONLY; The set of locations that the SKU is available.
13866	Locations *[]string `json:"locations,omitempty"`
13867	// LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available.
13868	LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"`
13869	// APIVersions - READ-ONLY; The api versions that support this SKU.
13870	APIVersions *[]string `json:"apiVersions,omitempty"`
13871	// Costs - READ-ONLY; Metadata for retrieving price info.
13872	Costs *[]SkuCosts `json:"costs,omitempty"`
13873	// Capabilities - READ-ONLY; A name value pair to describe the capability.
13874	Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"`
13875	// Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
13876	Restrictions *[]SkuRestrictions `json:"restrictions,omitempty"`
13877}
13878
13879// MarshalJSON is the custom marshaler for Sku.
13880func (s Sku) MarshalJSON() ([]byte, error) {
13881	objectMap := make(map[string]interface{})
13882	return json.Marshal(objectMap)
13883}
13884
13885// SkuCapabilities describes The SKU capabilities object.
13886type SkuCapabilities struct {
13887	// Name - READ-ONLY; An invariant to describe the feature.
13888	Name *string `json:"name,omitempty"`
13889	// Value - READ-ONLY; An invariant if the feature is measured by quantity.
13890	Value *string `json:"value,omitempty"`
13891}
13892
13893// MarshalJSON is the custom marshaler for SkuCapabilities.
13894func (sc SkuCapabilities) MarshalJSON() ([]byte, error) {
13895	objectMap := make(map[string]interface{})
13896	return json.Marshal(objectMap)
13897}
13898
13899// SkuCapacity describes scaling information of a SKU.
13900type SkuCapacity struct {
13901	// Minimum - READ-ONLY; The minimum capacity.
13902	Minimum *int32 `json:"minimum,omitempty"`
13903	// Maximum - READ-ONLY; The maximum capacity that can be set.
13904	Maximum *int32 `json:"maximum,omitempty"`
13905	// Default - READ-ONLY; The default capacity.
13906	Default *int32 `json:"default,omitempty"`
13907	// ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'SkuCapacityScaleTypeAutomatic', 'SkuCapacityScaleTypeManual', 'SkuCapacityScaleTypeNone'
13908	ScaleType SkuCapacityScaleType `json:"scaleType,omitempty"`
13909}
13910
13911// MarshalJSON is the custom marshaler for SkuCapacity.
13912func (sc SkuCapacity) MarshalJSON() ([]byte, error) {
13913	objectMap := make(map[string]interface{})
13914	return json.Marshal(objectMap)
13915}
13916
13917// SkuCosts describes metadata for retrieving price info.
13918type SkuCosts struct {
13919	// MeterID - READ-ONLY; Used for querying price from commerce.
13920	MeterID *string `json:"meterID,omitempty"`
13921	// Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost.
13922	Quantity *int64 `json:"quantity,omitempty"`
13923	// ExtendedUnit - READ-ONLY; An invariant to show the extended unit.
13924	ExtendedUnit *string `json:"extendedUnit,omitempty"`
13925}
13926
13927// MarshalJSON is the custom marshaler for SkuCosts.
13928func (sc SkuCosts) MarshalJSON() ([]byte, error) {
13929	objectMap := make(map[string]interface{})
13930	return json.Marshal(objectMap)
13931}
13932
13933// SkuLocationInfo ...
13934type SkuLocationInfo struct {
13935	// Location - READ-ONLY; Location of the SKU
13936	Location *string `json:"location,omitempty"`
13937	// Zones - READ-ONLY; List of availability zones where the SKU is supported.
13938	Zones *[]string `json:"zones,omitempty"`
13939	// ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones.
13940	ZoneDetails *[]SkuZoneDetails `json:"zoneDetails,omitempty"`
13941}
13942
13943// MarshalJSON is the custom marshaler for SkuLocationInfo.
13944func (sli SkuLocationInfo) MarshalJSON() ([]byte, error) {
13945	objectMap := make(map[string]interface{})
13946	return json.Marshal(objectMap)
13947}
13948
13949// SkuRestrictionInfo ...
13950type SkuRestrictionInfo struct {
13951	// Locations - READ-ONLY; Locations where the SKU is restricted
13952	Locations *[]string `json:"locations,omitempty"`
13953	// Zones - READ-ONLY; List of availability zones where the SKU is restricted.
13954	Zones *[]string `json:"zones,omitempty"`
13955}
13956
13957// MarshalJSON is the custom marshaler for SkuRestrictionInfo.
13958func (sri SkuRestrictionInfo) MarshalJSON() ([]byte, error) {
13959	objectMap := make(map[string]interface{})
13960	return json.Marshal(objectMap)
13961}
13962
13963// SkuRestrictions describes scaling information of a SKU.
13964type SkuRestrictions struct {
13965	// Type - READ-ONLY; The type of restrictions. Possible values include: 'SkuRestrictionsTypeLocation', 'SkuRestrictionsTypeZone'
13966	Type SkuRestrictionsType `json:"type,omitempty"`
13967	// Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.
13968	Values *[]string `json:"values,omitempty"`
13969	// RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used.
13970	RestrictionInfo *SkuRestrictionInfo `json:"restrictionInfo,omitempty"`
13971	// ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'SkuRestrictionsReasonCodeQuotaID', 'SkuRestrictionsReasonCodeNotAvailableForSubscription'
13972	ReasonCode SkuRestrictionsReasonCode `json:"reasonCode,omitempty"`
13973}
13974
13975// MarshalJSON is the custom marshaler for SkuRestrictions.
13976func (sr SkuRestrictions) MarshalJSON() ([]byte, error) {
13977	objectMap := make(map[string]interface{})
13978	return json.Marshal(objectMap)
13979}
13980
13981// SkusResult the List Resource Skus operation response.
13982type SkusResult struct {
13983	autorest.Response `json:"-"`
13984	// Value - The list of skus available for the subscription.
13985	Value *[]Sku `json:"value,omitempty"`
13986	// NextLink - READ-ONLY; The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus
13987	NextLink *string `json:"nextLink,omitempty"`
13988}
13989
13990// MarshalJSON is the custom marshaler for SkusResult.
13991func (sr SkusResult) MarshalJSON() ([]byte, error) {
13992	objectMap := make(map[string]interface{})
13993	if sr.Value != nil {
13994		objectMap["value"] = sr.Value
13995	}
13996	return json.Marshal(objectMap)
13997}
13998
13999// SkusResultIterator provides access to a complete listing of Sku values.
14000type SkusResultIterator struct {
14001	i    int
14002	page SkusResultPage
14003}
14004
14005// NextWithContext advances to the next value.  If there was an error making
14006// the request the iterator does not advance and the error is returned.
14007func (iter *SkusResultIterator) NextWithContext(ctx context.Context) (err error) {
14008	if tracing.IsEnabled() {
14009		ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultIterator.NextWithContext")
14010		defer func() {
14011			sc := -1
14012			if iter.Response().Response.Response != nil {
14013				sc = iter.Response().Response.Response.StatusCode
14014			}
14015			tracing.EndSpan(ctx, sc, err)
14016		}()
14017	}
14018	iter.i++
14019	if iter.i < len(iter.page.Values()) {
14020		return nil
14021	}
14022	err = iter.page.NextWithContext(ctx)
14023	if err != nil {
14024		iter.i--
14025		return err
14026	}
14027	iter.i = 0
14028	return nil
14029}
14030
14031// Next advances to the next value.  If there was an error making
14032// the request the iterator does not advance and the error is returned.
14033// Deprecated: Use NextWithContext() instead.
14034func (iter *SkusResultIterator) Next() error {
14035	return iter.NextWithContext(context.Background())
14036}
14037
14038// NotDone returns true if the enumeration should be started or is not yet complete.
14039func (iter SkusResultIterator) NotDone() bool {
14040	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14041}
14042
14043// Response returns the raw server response from the last page request.
14044func (iter SkusResultIterator) Response() SkusResult {
14045	return iter.page.Response()
14046}
14047
14048// Value returns the current value or a zero-initialized value if the
14049// iterator has advanced beyond the end of the collection.
14050func (iter SkusResultIterator) Value() Sku {
14051	if !iter.page.NotDone() {
14052		return Sku{}
14053	}
14054	return iter.page.Values()[iter.i]
14055}
14056
14057// Creates a new instance of the SkusResultIterator type.
14058func NewSkusResultIterator(page SkusResultPage) SkusResultIterator {
14059	return SkusResultIterator{page: page}
14060}
14061
14062// IsEmpty returns true if the ListResult contains no values.
14063func (sr SkusResult) IsEmpty() bool {
14064	return sr.Value == nil || len(*sr.Value) == 0
14065}
14066
14067// hasNextLink returns true if the NextLink is not empty.
14068func (sr SkusResult) hasNextLink() bool {
14069	return sr.NextLink != nil && len(*sr.NextLink) != 0
14070}
14071
14072// skusResultPreparer prepares a request to retrieve the next set of results.
14073// It returns nil if no more results exist.
14074func (sr SkusResult) skusResultPreparer(ctx context.Context) (*http.Request, error) {
14075	if !sr.hasNextLink() {
14076		return nil, nil
14077	}
14078	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14079		autorest.AsJSON(),
14080		autorest.AsGet(),
14081		autorest.WithBaseURL(to.String(sr.NextLink)))
14082}
14083
14084// SkusResultPage contains a page of Sku values.
14085type SkusResultPage struct {
14086	fn func(context.Context, SkusResult) (SkusResult, error)
14087	sr SkusResult
14088}
14089
14090// NextWithContext advances to the next page of values.  If there was an error making
14091// the request the page does not advance and the error is returned.
14092func (page *SkusResultPage) NextWithContext(ctx context.Context) (err error) {
14093	if tracing.IsEnabled() {
14094		ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultPage.NextWithContext")
14095		defer func() {
14096			sc := -1
14097			if page.Response().Response.Response != nil {
14098				sc = page.Response().Response.Response.StatusCode
14099			}
14100			tracing.EndSpan(ctx, sc, err)
14101		}()
14102	}
14103	for {
14104		next, err := page.fn(ctx, page.sr)
14105		if err != nil {
14106			return err
14107		}
14108		page.sr = next
14109		if !next.hasNextLink() || !next.IsEmpty() {
14110			break
14111		}
14112	}
14113	return nil
14114}
14115
14116// Next advances to the next page of values.  If there was an error making
14117// the request the page does not advance and the error is returned.
14118// Deprecated: Use NextWithContext() instead.
14119func (page *SkusResultPage) Next() error {
14120	return page.NextWithContext(context.Background())
14121}
14122
14123// NotDone returns true if the page enumeration should be started or is not yet complete.
14124func (page SkusResultPage) NotDone() bool {
14125	return !page.sr.IsEmpty()
14126}
14127
14128// Response returns the raw server response from the last page request.
14129func (page SkusResultPage) Response() SkusResult {
14130	return page.sr
14131}
14132
14133// Values returns the slice of values for the current page or nil if there are no values.
14134func (page SkusResultPage) Values() []Sku {
14135	if page.sr.IsEmpty() {
14136		return nil
14137	}
14138	return *page.sr.Value
14139}
14140
14141// Creates a new instance of the SkusResultPage type.
14142func NewSkusResultPage(cur SkusResult, getNextPage func(context.Context, SkusResult) (SkusResult, error)) SkusResultPage {
14143	return SkusResultPage{
14144		fn: getNextPage,
14145		sr: cur,
14146	}
14147}
14148
14149// SkuZoneDetails describes The zonal capabilities of a SKU.
14150type SkuZoneDetails struct {
14151	// Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities.
14152	Name *[]string `json:"name,omitempty"`
14153	// Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones.
14154	Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"`
14155}
14156
14157// MarshalJSON is the custom marshaler for SkuZoneDetails.
14158func (szd SkuZoneDetails) MarshalJSON() ([]byte, error) {
14159	objectMap := make(map[string]interface{})
14160	return json.Marshal(objectMap)
14161}
14162
14163// SubscriptionCollection paged Subscriptions list representation.
14164type SubscriptionCollection struct {
14165	autorest.Response `json:"-"`
14166	// Value - Page values.
14167	Value *[]SubscriptionContract `json:"value,omitempty"`
14168	// Count - Total record count number across all pages.
14169	Count *int64 `json:"count,omitempty"`
14170	// NextLink - Next page link if any.
14171	NextLink *string `json:"nextLink,omitempty"`
14172}
14173
14174// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values.
14175type SubscriptionCollectionIterator struct {
14176	i    int
14177	page SubscriptionCollectionPage
14178}
14179
14180// NextWithContext advances to the next value.  If there was an error making
14181// the request the iterator does not advance and the error is returned.
14182func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
14183	if tracing.IsEnabled() {
14184		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext")
14185		defer func() {
14186			sc := -1
14187			if iter.Response().Response.Response != nil {
14188				sc = iter.Response().Response.Response.StatusCode
14189			}
14190			tracing.EndSpan(ctx, sc, err)
14191		}()
14192	}
14193	iter.i++
14194	if iter.i < len(iter.page.Values()) {
14195		return nil
14196	}
14197	err = iter.page.NextWithContext(ctx)
14198	if err != nil {
14199		iter.i--
14200		return err
14201	}
14202	iter.i = 0
14203	return nil
14204}
14205
14206// Next advances to the next value.  If there was an error making
14207// the request the iterator does not advance and the error is returned.
14208// Deprecated: Use NextWithContext() instead.
14209func (iter *SubscriptionCollectionIterator) Next() error {
14210	return iter.NextWithContext(context.Background())
14211}
14212
14213// NotDone returns true if the enumeration should be started or is not yet complete.
14214func (iter SubscriptionCollectionIterator) NotDone() bool {
14215	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14216}
14217
14218// Response returns the raw server response from the last page request.
14219func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection {
14220	return iter.page.Response()
14221}
14222
14223// Value returns the current value or a zero-initialized value if the
14224// iterator has advanced beyond the end of the collection.
14225func (iter SubscriptionCollectionIterator) Value() SubscriptionContract {
14226	if !iter.page.NotDone() {
14227		return SubscriptionContract{}
14228	}
14229	return iter.page.Values()[iter.i]
14230}
14231
14232// Creates a new instance of the SubscriptionCollectionIterator type.
14233func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator {
14234	return SubscriptionCollectionIterator{page: page}
14235}
14236
14237// IsEmpty returns true if the ListResult contains no values.
14238func (sc SubscriptionCollection) IsEmpty() bool {
14239	return sc.Value == nil || len(*sc.Value) == 0
14240}
14241
14242// hasNextLink returns true if the NextLink is not empty.
14243func (sc SubscriptionCollection) hasNextLink() bool {
14244	return sc.NextLink != nil && len(*sc.NextLink) != 0
14245}
14246
14247// subscriptionCollectionPreparer prepares a request to retrieve the next set of results.
14248// It returns nil if no more results exist.
14249func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
14250	if !sc.hasNextLink() {
14251		return nil, nil
14252	}
14253	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14254		autorest.AsJSON(),
14255		autorest.AsGet(),
14256		autorest.WithBaseURL(to.String(sc.NextLink)))
14257}
14258
14259// SubscriptionCollectionPage contains a page of SubscriptionContract values.
14260type SubscriptionCollectionPage struct {
14261	fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)
14262	sc SubscriptionCollection
14263}
14264
14265// NextWithContext advances to the next page of values.  If there was an error making
14266// the request the page does not advance and the error is returned.
14267func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
14268	if tracing.IsEnabled() {
14269		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext")
14270		defer func() {
14271			sc := -1
14272			if page.Response().Response.Response != nil {
14273				sc = page.Response().Response.Response.StatusCode
14274			}
14275			tracing.EndSpan(ctx, sc, err)
14276		}()
14277	}
14278	for {
14279		next, err := page.fn(ctx, page.sc)
14280		if err != nil {
14281			return err
14282		}
14283		page.sc = next
14284		if !next.hasNextLink() || !next.IsEmpty() {
14285			break
14286		}
14287	}
14288	return nil
14289}
14290
14291// Next advances to the next page of values.  If there was an error making
14292// the request the page does not advance and the error is returned.
14293// Deprecated: Use NextWithContext() instead.
14294func (page *SubscriptionCollectionPage) Next() error {
14295	return page.NextWithContext(context.Background())
14296}
14297
14298// NotDone returns true if the page enumeration should be started or is not yet complete.
14299func (page SubscriptionCollectionPage) NotDone() bool {
14300	return !page.sc.IsEmpty()
14301}
14302
14303// Response returns the raw server response from the last page request.
14304func (page SubscriptionCollectionPage) Response() SubscriptionCollection {
14305	return page.sc
14306}
14307
14308// Values returns the slice of values for the current page or nil if there are no values.
14309func (page SubscriptionCollectionPage) Values() []SubscriptionContract {
14310	if page.sc.IsEmpty() {
14311		return nil
14312	}
14313	return *page.sc.Value
14314}
14315
14316// Creates a new instance of the SubscriptionCollectionPage type.
14317func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage {
14318	return SubscriptionCollectionPage{
14319		fn: getNextPage,
14320		sc: cur,
14321	}
14322}
14323
14324// SubscriptionContract subscription details.
14325type SubscriptionContract struct {
14326	autorest.Response `json:"-"`
14327	// SubscriptionContractProperties - Subscription contract properties.
14328	*SubscriptionContractProperties `json:"properties,omitempty"`
14329	// ID - READ-ONLY; Resource ID.
14330	ID *string `json:"id,omitempty"`
14331	// Name - READ-ONLY; Resource name.
14332	Name *string `json:"name,omitempty"`
14333	// Type - READ-ONLY; Resource type for API Management resource.
14334	Type *string `json:"type,omitempty"`
14335}
14336
14337// MarshalJSON is the custom marshaler for SubscriptionContract.
14338func (sc SubscriptionContract) MarshalJSON() ([]byte, error) {
14339	objectMap := make(map[string]interface{})
14340	if sc.SubscriptionContractProperties != nil {
14341		objectMap["properties"] = sc.SubscriptionContractProperties
14342	}
14343	return json.Marshal(objectMap)
14344}
14345
14346// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct.
14347func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error {
14348	var m map[string]*json.RawMessage
14349	err := json.Unmarshal(body, &m)
14350	if err != nil {
14351		return err
14352	}
14353	for k, v := range m {
14354		switch k {
14355		case "properties":
14356			if v != nil {
14357				var subscriptionContractProperties SubscriptionContractProperties
14358				err = json.Unmarshal(*v, &subscriptionContractProperties)
14359				if err != nil {
14360					return err
14361				}
14362				sc.SubscriptionContractProperties = &subscriptionContractProperties
14363			}
14364		case "id":
14365			if v != nil {
14366				var ID string
14367				err = json.Unmarshal(*v, &ID)
14368				if err != nil {
14369					return err
14370				}
14371				sc.ID = &ID
14372			}
14373		case "name":
14374			if v != nil {
14375				var name string
14376				err = json.Unmarshal(*v, &name)
14377				if err != nil {
14378					return err
14379				}
14380				sc.Name = &name
14381			}
14382		case "type":
14383			if v != nil {
14384				var typeVar string
14385				err = json.Unmarshal(*v, &typeVar)
14386				if err != nil {
14387					return err
14388				}
14389				sc.Type = &typeVar
14390			}
14391		}
14392	}
14393
14394	return nil
14395}
14396
14397// SubscriptionContractProperties subscription details.
14398type SubscriptionContractProperties struct {
14399	// 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.
14400	OwnerID *string `json:"ownerId,omitempty"`
14401	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}.
14402	Scope *string `json:"scope,omitempty"`
14403	// DisplayName - The name of the subscription, or null if the subscription has no name.
14404	DisplayName *string `json:"displayName,omitempty"`
14405	// 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: 'SubscriptionStateSuspended', 'SubscriptionStateActive', 'SubscriptionStateExpired', 'SubscriptionStateSubmitted', 'SubscriptionStateRejected', 'SubscriptionStateCancelled'
14406	State SubscriptionState `json:"state,omitempty"`
14407	// 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.
14408	CreatedDate *date.Time `json:"createdDate,omitempty"`
14409	// 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.
14410	StartDate *date.Time `json:"startDate,omitempty"`
14411	// 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.
14412	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
14413	// 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.
14414	EndDate *date.Time `json:"endDate,omitempty"`
14415	// 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.
14416	NotificationDate *date.Time `json:"notificationDate,omitempty"`
14417	// PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
14418	PrimaryKey *string `json:"primaryKey,omitempty"`
14419	// SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
14420	SecondaryKey *string `json:"secondaryKey,omitempty"`
14421	// StateComment - Optional subscription comment added by an administrator when the state is changed to the 'rejected'.
14422	StateComment *string `json:"stateComment,omitempty"`
14423	// AllowTracing - Determines whether tracing is enabled
14424	AllowTracing *bool `json:"allowTracing,omitempty"`
14425}
14426
14427// MarshalJSON is the custom marshaler for SubscriptionContractProperties.
14428func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) {
14429	objectMap := make(map[string]interface{})
14430	if scp.OwnerID != nil {
14431		objectMap["ownerId"] = scp.OwnerID
14432	}
14433	if scp.Scope != nil {
14434		objectMap["scope"] = scp.Scope
14435	}
14436	if scp.DisplayName != nil {
14437		objectMap["displayName"] = scp.DisplayName
14438	}
14439	if scp.State != "" {
14440		objectMap["state"] = scp.State
14441	}
14442	if scp.StartDate != nil {
14443		objectMap["startDate"] = scp.StartDate
14444	}
14445	if scp.ExpirationDate != nil {
14446		objectMap["expirationDate"] = scp.ExpirationDate
14447	}
14448	if scp.EndDate != nil {
14449		objectMap["endDate"] = scp.EndDate
14450	}
14451	if scp.NotificationDate != nil {
14452		objectMap["notificationDate"] = scp.NotificationDate
14453	}
14454	if scp.PrimaryKey != nil {
14455		objectMap["primaryKey"] = scp.PrimaryKey
14456	}
14457	if scp.SecondaryKey != nil {
14458		objectMap["secondaryKey"] = scp.SecondaryKey
14459	}
14460	if scp.StateComment != nil {
14461		objectMap["stateComment"] = scp.StateComment
14462	}
14463	if scp.AllowTracing != nil {
14464		objectMap["allowTracing"] = scp.AllowTracing
14465	}
14466	return json.Marshal(objectMap)
14467}
14468
14469// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation.
14470type SubscriptionCreateParameterProperties struct {
14471	// OwnerID - User (user id path) for whom subscription is being created in form /users/{userId}
14472	OwnerID *string `json:"ownerId,omitempty"`
14473	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}.
14474	Scope *string `json:"scope,omitempty"`
14475	// DisplayName - Subscription name.
14476	DisplayName *string `json:"displayName,omitempty"`
14477	// PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically.
14478	PrimaryKey *string `json:"primaryKey,omitempty"`
14479	// SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically.
14480	SecondaryKey *string `json:"secondaryKey,omitempty"`
14481	// 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: 'SubscriptionStateSuspended', 'SubscriptionStateActive', 'SubscriptionStateExpired', 'SubscriptionStateSubmitted', 'SubscriptionStateRejected', 'SubscriptionStateCancelled'
14482	State SubscriptionState `json:"state,omitempty"`
14483	// AllowTracing - Determines whether tracing can be enabled
14484	AllowTracing *bool `json:"allowTracing,omitempty"`
14485}
14486
14487// SubscriptionCreateParameters subscription create details.
14488type SubscriptionCreateParameters struct {
14489	// SubscriptionCreateParameterProperties - Subscription contract properties.
14490	*SubscriptionCreateParameterProperties `json:"properties,omitempty"`
14491}
14492
14493// MarshalJSON is the custom marshaler for SubscriptionCreateParameters.
14494func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) {
14495	objectMap := make(map[string]interface{})
14496	if scp.SubscriptionCreateParameterProperties != nil {
14497		objectMap["properties"] = scp.SubscriptionCreateParameterProperties
14498	}
14499	return json.Marshal(objectMap)
14500}
14501
14502// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct.
14503func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error {
14504	var m map[string]*json.RawMessage
14505	err := json.Unmarshal(body, &m)
14506	if err != nil {
14507		return err
14508	}
14509	for k, v := range m {
14510		switch k {
14511		case "properties":
14512			if v != nil {
14513				var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties
14514				err = json.Unmarshal(*v, &subscriptionCreateParameterProperties)
14515				if err != nil {
14516					return err
14517				}
14518				scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties
14519			}
14520		}
14521	}
14522
14523	return nil
14524}
14525
14526// SubscriptionKeyParameterNamesContract subscription key parameter names details.
14527type SubscriptionKeyParameterNamesContract struct {
14528	// Header - Subscription key header name.
14529	Header *string `json:"header,omitempty"`
14530	// Query - Subscription key query string parameter name.
14531	Query *string `json:"query,omitempty"`
14532}
14533
14534// SubscriptionKeysContract subscription keys.
14535type SubscriptionKeysContract struct {
14536	autorest.Response `json:"-"`
14537	// PrimaryKey - Subscription primary key.
14538	PrimaryKey *string `json:"primaryKey,omitempty"`
14539	// SecondaryKey - Subscription secondary key.
14540	SecondaryKey *string `json:"secondaryKey,omitempty"`
14541}
14542
14543// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties.
14544type SubscriptionsDelegationSettingsProperties struct {
14545	// Enabled - Enable or disable delegation for subscriptions.
14546	Enabled *bool `json:"enabled,omitempty"`
14547}
14548
14549// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation.
14550type SubscriptionUpdateParameterProperties struct {
14551	// OwnerID - User identifier path: /users/{userId}
14552	OwnerID *string `json:"ownerId,omitempty"`
14553	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}
14554	Scope *string `json:"scope,omitempty"`
14555	// 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.
14556	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
14557	// DisplayName - Subscription name.
14558	DisplayName *string `json:"displayName,omitempty"`
14559	// PrimaryKey - Primary subscription key.
14560	PrimaryKey *string `json:"primaryKey,omitempty"`
14561	// SecondaryKey - Secondary subscription key.
14562	SecondaryKey *string `json:"secondaryKey,omitempty"`
14563	// 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: 'SubscriptionStateSuspended', 'SubscriptionStateActive', 'SubscriptionStateExpired', 'SubscriptionStateSubmitted', 'SubscriptionStateRejected', 'SubscriptionStateCancelled'
14564	State SubscriptionState `json:"state,omitempty"`
14565	// StateComment - Comments describing subscription state change by the administrator when the state is changed to the 'rejected'.
14566	StateComment *string `json:"stateComment,omitempty"`
14567	// AllowTracing - Determines whether tracing can be enabled
14568	AllowTracing *bool `json:"allowTracing,omitempty"`
14569}
14570
14571// SubscriptionUpdateParameters subscription update details.
14572type SubscriptionUpdateParameters struct {
14573	// SubscriptionUpdateParameterProperties - Subscription Update contract properties.
14574	*SubscriptionUpdateParameterProperties `json:"properties,omitempty"`
14575}
14576
14577// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters.
14578func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) {
14579	objectMap := make(map[string]interface{})
14580	if sup.SubscriptionUpdateParameterProperties != nil {
14581		objectMap["properties"] = sup.SubscriptionUpdateParameterProperties
14582	}
14583	return json.Marshal(objectMap)
14584}
14585
14586// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct.
14587func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error {
14588	var m map[string]*json.RawMessage
14589	err := json.Unmarshal(body, &m)
14590	if err != nil {
14591		return err
14592	}
14593	for k, v := range m {
14594		switch k {
14595		case "properties":
14596			if v != nil {
14597				var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties
14598				err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties)
14599				if err != nil {
14600					return err
14601				}
14602				sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties
14603			}
14604		}
14605	}
14606
14607	return nil
14608}
14609
14610// TagCollection paged Tag list representation.
14611type TagCollection struct {
14612	autorest.Response `json:"-"`
14613	// Value - Page values.
14614	Value *[]TagContract `json:"value,omitempty"`
14615	// Count - Total record count number across all pages.
14616	Count *int64 `json:"count,omitempty"`
14617	// NextLink - Next page link if any.
14618	NextLink *string `json:"nextLink,omitempty"`
14619}
14620
14621// TagCollectionIterator provides access to a complete listing of TagContract values.
14622type TagCollectionIterator struct {
14623	i    int
14624	page TagCollectionPage
14625}
14626
14627// NextWithContext advances to the next value.  If there was an error making
14628// the request the iterator does not advance and the error is returned.
14629func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) {
14630	if tracing.IsEnabled() {
14631		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext")
14632		defer func() {
14633			sc := -1
14634			if iter.Response().Response.Response != nil {
14635				sc = iter.Response().Response.Response.StatusCode
14636			}
14637			tracing.EndSpan(ctx, sc, err)
14638		}()
14639	}
14640	iter.i++
14641	if iter.i < len(iter.page.Values()) {
14642		return nil
14643	}
14644	err = iter.page.NextWithContext(ctx)
14645	if err != nil {
14646		iter.i--
14647		return err
14648	}
14649	iter.i = 0
14650	return nil
14651}
14652
14653// Next advances to the next value.  If there was an error making
14654// the request the iterator does not advance and the error is returned.
14655// Deprecated: Use NextWithContext() instead.
14656func (iter *TagCollectionIterator) Next() error {
14657	return iter.NextWithContext(context.Background())
14658}
14659
14660// NotDone returns true if the enumeration should be started or is not yet complete.
14661func (iter TagCollectionIterator) NotDone() bool {
14662	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14663}
14664
14665// Response returns the raw server response from the last page request.
14666func (iter TagCollectionIterator) Response() TagCollection {
14667	return iter.page.Response()
14668}
14669
14670// Value returns the current value or a zero-initialized value if the
14671// iterator has advanced beyond the end of the collection.
14672func (iter TagCollectionIterator) Value() TagContract {
14673	if !iter.page.NotDone() {
14674		return TagContract{}
14675	}
14676	return iter.page.Values()[iter.i]
14677}
14678
14679// Creates a new instance of the TagCollectionIterator type.
14680func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator {
14681	return TagCollectionIterator{page: page}
14682}
14683
14684// IsEmpty returns true if the ListResult contains no values.
14685func (tc TagCollection) IsEmpty() bool {
14686	return tc.Value == nil || len(*tc.Value) == 0
14687}
14688
14689// hasNextLink returns true if the NextLink is not empty.
14690func (tc TagCollection) hasNextLink() bool {
14691	return tc.NextLink != nil && len(*tc.NextLink) != 0
14692}
14693
14694// tagCollectionPreparer prepares a request to retrieve the next set of results.
14695// It returns nil if no more results exist.
14696func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) {
14697	if !tc.hasNextLink() {
14698		return nil, nil
14699	}
14700	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14701		autorest.AsJSON(),
14702		autorest.AsGet(),
14703		autorest.WithBaseURL(to.String(tc.NextLink)))
14704}
14705
14706// TagCollectionPage contains a page of TagContract values.
14707type TagCollectionPage struct {
14708	fn func(context.Context, TagCollection) (TagCollection, error)
14709	tc TagCollection
14710}
14711
14712// NextWithContext advances to the next page of values.  If there was an error making
14713// the request the page does not advance and the error is returned.
14714func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) {
14715	if tracing.IsEnabled() {
14716		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext")
14717		defer func() {
14718			sc := -1
14719			if page.Response().Response.Response != nil {
14720				sc = page.Response().Response.Response.StatusCode
14721			}
14722			tracing.EndSpan(ctx, sc, err)
14723		}()
14724	}
14725	for {
14726		next, err := page.fn(ctx, page.tc)
14727		if err != nil {
14728			return err
14729		}
14730		page.tc = next
14731		if !next.hasNextLink() || !next.IsEmpty() {
14732			break
14733		}
14734	}
14735	return nil
14736}
14737
14738// Next advances to the next page of values.  If there was an error making
14739// the request the page does not advance and the error is returned.
14740// Deprecated: Use NextWithContext() instead.
14741func (page *TagCollectionPage) Next() error {
14742	return page.NextWithContext(context.Background())
14743}
14744
14745// NotDone returns true if the page enumeration should be started or is not yet complete.
14746func (page TagCollectionPage) NotDone() bool {
14747	return !page.tc.IsEmpty()
14748}
14749
14750// Response returns the raw server response from the last page request.
14751func (page TagCollectionPage) Response() TagCollection {
14752	return page.tc
14753}
14754
14755// Values returns the slice of values for the current page or nil if there are no values.
14756func (page TagCollectionPage) Values() []TagContract {
14757	if page.tc.IsEmpty() {
14758		return nil
14759	}
14760	return *page.tc.Value
14761}
14762
14763// Creates a new instance of the TagCollectionPage type.
14764func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage {
14765	return TagCollectionPage{
14766		fn: getNextPage,
14767		tc: cur,
14768	}
14769}
14770
14771// TagContract tag Contract details.
14772type TagContract struct {
14773	autorest.Response `json:"-"`
14774	// TagContractProperties - Tag entity contract properties.
14775	*TagContractProperties `json:"properties,omitempty"`
14776	// ID - READ-ONLY; Resource ID.
14777	ID *string `json:"id,omitempty"`
14778	// Name - READ-ONLY; Resource name.
14779	Name *string `json:"name,omitempty"`
14780	// Type - READ-ONLY; Resource type for API Management resource.
14781	Type *string `json:"type,omitempty"`
14782}
14783
14784// MarshalJSON is the custom marshaler for TagContract.
14785func (tc TagContract) MarshalJSON() ([]byte, error) {
14786	objectMap := make(map[string]interface{})
14787	if tc.TagContractProperties != nil {
14788		objectMap["properties"] = tc.TagContractProperties
14789	}
14790	return json.Marshal(objectMap)
14791}
14792
14793// UnmarshalJSON is the custom unmarshaler for TagContract struct.
14794func (tc *TagContract) UnmarshalJSON(body []byte) error {
14795	var m map[string]*json.RawMessage
14796	err := json.Unmarshal(body, &m)
14797	if err != nil {
14798		return err
14799	}
14800	for k, v := range m {
14801		switch k {
14802		case "properties":
14803			if v != nil {
14804				var tagContractProperties TagContractProperties
14805				err = json.Unmarshal(*v, &tagContractProperties)
14806				if err != nil {
14807					return err
14808				}
14809				tc.TagContractProperties = &tagContractProperties
14810			}
14811		case "id":
14812			if v != nil {
14813				var ID string
14814				err = json.Unmarshal(*v, &ID)
14815				if err != nil {
14816					return err
14817				}
14818				tc.ID = &ID
14819			}
14820		case "name":
14821			if v != nil {
14822				var name string
14823				err = json.Unmarshal(*v, &name)
14824				if err != nil {
14825					return err
14826				}
14827				tc.Name = &name
14828			}
14829		case "type":
14830			if v != nil {
14831				var typeVar string
14832				err = json.Unmarshal(*v, &typeVar)
14833				if err != nil {
14834					return err
14835				}
14836				tc.Type = &typeVar
14837			}
14838		}
14839	}
14840
14841	return nil
14842}
14843
14844// TagContractProperties tag contract Properties.
14845type TagContractProperties struct {
14846	// DisplayName - Tag name.
14847	DisplayName *string `json:"displayName,omitempty"`
14848}
14849
14850// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations.
14851type TagCreateUpdateParameters struct {
14852	// TagContractProperties - Properties supplied to Create Tag operation.
14853	*TagContractProperties `json:"properties,omitempty"`
14854}
14855
14856// MarshalJSON is the custom marshaler for TagCreateUpdateParameters.
14857func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) {
14858	objectMap := make(map[string]interface{})
14859	if tcup.TagContractProperties != nil {
14860		objectMap["properties"] = tcup.TagContractProperties
14861	}
14862	return json.Marshal(objectMap)
14863}
14864
14865// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct.
14866func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error {
14867	var m map[string]*json.RawMessage
14868	err := json.Unmarshal(body, &m)
14869	if err != nil {
14870		return err
14871	}
14872	for k, v := range m {
14873		switch k {
14874		case "properties":
14875			if v != nil {
14876				var tagContractProperties TagContractProperties
14877				err = json.Unmarshal(*v, &tagContractProperties)
14878				if err != nil {
14879					return err
14880				}
14881				tcup.TagContractProperties = &tagContractProperties
14882			}
14883		}
14884	}
14885
14886	return nil
14887}
14888
14889// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation.
14890type TagDescriptionBaseProperties struct {
14891	// Description - Description of the Tag.
14892	Description *string `json:"description,omitempty"`
14893	// ExternalDocsURL - Absolute URL of external resources describing the tag.
14894	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
14895	// ExternalDocsDescription - Description of the external resources describing the tag.
14896	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
14897}
14898
14899// TagDescriptionCollection paged TagDescription list representation.
14900type TagDescriptionCollection struct {
14901	autorest.Response `json:"-"`
14902	// Value - Page values.
14903	Value *[]TagDescriptionContract `json:"value,omitempty"`
14904	// Count - Total record count number across all pages.
14905	Count *int64 `json:"count,omitempty"`
14906	// NextLink - Next page link if any.
14907	NextLink *string `json:"nextLink,omitempty"`
14908}
14909
14910// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values.
14911type TagDescriptionCollectionIterator struct {
14912	i    int
14913	page TagDescriptionCollectionPage
14914}
14915
14916// NextWithContext advances to the next value.  If there was an error making
14917// the request the iterator does not advance and the error is returned.
14918func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
14919	if tracing.IsEnabled() {
14920		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext")
14921		defer func() {
14922			sc := -1
14923			if iter.Response().Response.Response != nil {
14924				sc = iter.Response().Response.Response.StatusCode
14925			}
14926			tracing.EndSpan(ctx, sc, err)
14927		}()
14928	}
14929	iter.i++
14930	if iter.i < len(iter.page.Values()) {
14931		return nil
14932	}
14933	err = iter.page.NextWithContext(ctx)
14934	if err != nil {
14935		iter.i--
14936		return err
14937	}
14938	iter.i = 0
14939	return nil
14940}
14941
14942// Next advances to the next value.  If there was an error making
14943// the request the iterator does not advance and the error is returned.
14944// Deprecated: Use NextWithContext() instead.
14945func (iter *TagDescriptionCollectionIterator) Next() error {
14946	return iter.NextWithContext(context.Background())
14947}
14948
14949// NotDone returns true if the enumeration should be started or is not yet complete.
14950func (iter TagDescriptionCollectionIterator) NotDone() bool {
14951	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14952}
14953
14954// Response returns the raw server response from the last page request.
14955func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection {
14956	return iter.page.Response()
14957}
14958
14959// Value returns the current value or a zero-initialized value if the
14960// iterator has advanced beyond the end of the collection.
14961func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract {
14962	if !iter.page.NotDone() {
14963		return TagDescriptionContract{}
14964	}
14965	return iter.page.Values()[iter.i]
14966}
14967
14968// Creates a new instance of the TagDescriptionCollectionIterator type.
14969func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator {
14970	return TagDescriptionCollectionIterator{page: page}
14971}
14972
14973// IsEmpty returns true if the ListResult contains no values.
14974func (tdc TagDescriptionCollection) IsEmpty() bool {
14975	return tdc.Value == nil || len(*tdc.Value) == 0
14976}
14977
14978// hasNextLink returns true if the NextLink is not empty.
14979func (tdc TagDescriptionCollection) hasNextLink() bool {
14980	return tdc.NextLink != nil && len(*tdc.NextLink) != 0
14981}
14982
14983// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results.
14984// It returns nil if no more results exist.
14985func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
14986	if !tdc.hasNextLink() {
14987		return nil, nil
14988	}
14989	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14990		autorest.AsJSON(),
14991		autorest.AsGet(),
14992		autorest.WithBaseURL(to.String(tdc.NextLink)))
14993}
14994
14995// TagDescriptionCollectionPage contains a page of TagDescriptionContract values.
14996type TagDescriptionCollectionPage struct {
14997	fn  func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)
14998	tdc TagDescriptionCollection
14999}
15000
15001// NextWithContext advances to the next page of values.  If there was an error making
15002// the request the page does not advance and the error is returned.
15003func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
15004	if tracing.IsEnabled() {
15005		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext")
15006		defer func() {
15007			sc := -1
15008			if page.Response().Response.Response != nil {
15009				sc = page.Response().Response.Response.StatusCode
15010			}
15011			tracing.EndSpan(ctx, sc, err)
15012		}()
15013	}
15014	for {
15015		next, err := page.fn(ctx, page.tdc)
15016		if err != nil {
15017			return err
15018		}
15019		page.tdc = next
15020		if !next.hasNextLink() || !next.IsEmpty() {
15021			break
15022		}
15023	}
15024	return nil
15025}
15026
15027// Next advances to the next page of values.  If there was an error making
15028// the request the page does not advance and the error is returned.
15029// Deprecated: Use NextWithContext() instead.
15030func (page *TagDescriptionCollectionPage) Next() error {
15031	return page.NextWithContext(context.Background())
15032}
15033
15034// NotDone returns true if the page enumeration should be started or is not yet complete.
15035func (page TagDescriptionCollectionPage) NotDone() bool {
15036	return !page.tdc.IsEmpty()
15037}
15038
15039// Response returns the raw server response from the last page request.
15040func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection {
15041	return page.tdc
15042}
15043
15044// Values returns the slice of values for the current page or nil if there are no values.
15045func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract {
15046	if page.tdc.IsEmpty() {
15047		return nil
15048	}
15049	return *page.tdc.Value
15050}
15051
15052// Creates a new instance of the TagDescriptionCollectionPage type.
15053func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage {
15054	return TagDescriptionCollectionPage{
15055		fn:  getNextPage,
15056		tdc: cur,
15057	}
15058}
15059
15060// TagDescriptionContract contract details.
15061type TagDescriptionContract struct {
15062	autorest.Response `json:"-"`
15063	// TagDescriptionContractProperties - TagDescription entity contract properties.
15064	*TagDescriptionContractProperties `json:"properties,omitempty"`
15065	// ID - READ-ONLY; Resource ID.
15066	ID *string `json:"id,omitempty"`
15067	// Name - READ-ONLY; Resource name.
15068	Name *string `json:"name,omitempty"`
15069	// Type - READ-ONLY; Resource type for API Management resource.
15070	Type *string `json:"type,omitempty"`
15071}
15072
15073// MarshalJSON is the custom marshaler for TagDescriptionContract.
15074func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) {
15075	objectMap := make(map[string]interface{})
15076	if tdc.TagDescriptionContractProperties != nil {
15077		objectMap["properties"] = tdc.TagDescriptionContractProperties
15078	}
15079	return json.Marshal(objectMap)
15080}
15081
15082// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct.
15083func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error {
15084	var m map[string]*json.RawMessage
15085	err := json.Unmarshal(body, &m)
15086	if err != nil {
15087		return err
15088	}
15089	for k, v := range m {
15090		switch k {
15091		case "properties":
15092			if v != nil {
15093				var tagDescriptionContractProperties TagDescriptionContractProperties
15094				err = json.Unmarshal(*v, &tagDescriptionContractProperties)
15095				if err != nil {
15096					return err
15097				}
15098				tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties
15099			}
15100		case "id":
15101			if v != nil {
15102				var ID string
15103				err = json.Unmarshal(*v, &ID)
15104				if err != nil {
15105					return err
15106				}
15107				tdc.ID = &ID
15108			}
15109		case "name":
15110			if v != nil {
15111				var name string
15112				err = json.Unmarshal(*v, &name)
15113				if err != nil {
15114					return err
15115				}
15116				tdc.Name = &name
15117			}
15118		case "type":
15119			if v != nil {
15120				var typeVar string
15121				err = json.Unmarshal(*v, &typeVar)
15122				if err != nil {
15123					return err
15124				}
15125				tdc.Type = &typeVar
15126			}
15127		}
15128	}
15129
15130	return nil
15131}
15132
15133// TagDescriptionContractProperties tagDescription contract Properties.
15134type TagDescriptionContractProperties struct {
15135	// TagID - Identifier of the tag in the form of /tags/{tagId}
15136	TagID *string `json:"tagId,omitempty"`
15137	// DisplayName - Tag name.
15138	DisplayName *string `json:"displayName,omitempty"`
15139	// Description - Description of the Tag.
15140	Description *string `json:"description,omitempty"`
15141	// ExternalDocsURL - Absolute URL of external resources describing the tag.
15142	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
15143	// ExternalDocsDescription - Description of the external resources describing the tag.
15144	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
15145}
15146
15147// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation.
15148type TagDescriptionCreateParameters struct {
15149	// TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation.
15150	*TagDescriptionBaseProperties `json:"properties,omitempty"`
15151}
15152
15153// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters.
15154func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) {
15155	objectMap := make(map[string]interface{})
15156	if tdcp.TagDescriptionBaseProperties != nil {
15157		objectMap["properties"] = tdcp.TagDescriptionBaseProperties
15158	}
15159	return json.Marshal(objectMap)
15160}
15161
15162// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct.
15163func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error {
15164	var m map[string]*json.RawMessage
15165	err := json.Unmarshal(body, &m)
15166	if err != nil {
15167		return err
15168	}
15169	for k, v := range m {
15170		switch k {
15171		case "properties":
15172			if v != nil {
15173				var tagDescriptionBaseProperties TagDescriptionBaseProperties
15174				err = json.Unmarshal(*v, &tagDescriptionBaseProperties)
15175				if err != nil {
15176					return err
15177				}
15178				tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties
15179			}
15180		}
15181	}
15182
15183	return nil
15184}
15185
15186// TagResourceCollection paged Tag list representation.
15187type TagResourceCollection struct {
15188	autorest.Response `json:"-"`
15189	// Value - Page values.
15190	Value *[]TagResourceContract `json:"value,omitempty"`
15191	// Count - Total record count number across all pages.
15192	Count *int64 `json:"count,omitempty"`
15193	// NextLink - Next page link if any.
15194	NextLink *string `json:"nextLink,omitempty"`
15195}
15196
15197// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values.
15198type TagResourceCollectionIterator struct {
15199	i    int
15200	page TagResourceCollectionPage
15201}
15202
15203// NextWithContext advances to the next value.  If there was an error making
15204// the request the iterator does not advance and the error is returned.
15205func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
15206	if tracing.IsEnabled() {
15207		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext")
15208		defer func() {
15209			sc := -1
15210			if iter.Response().Response.Response != nil {
15211				sc = iter.Response().Response.Response.StatusCode
15212			}
15213			tracing.EndSpan(ctx, sc, err)
15214		}()
15215	}
15216	iter.i++
15217	if iter.i < len(iter.page.Values()) {
15218		return nil
15219	}
15220	err = iter.page.NextWithContext(ctx)
15221	if err != nil {
15222		iter.i--
15223		return err
15224	}
15225	iter.i = 0
15226	return nil
15227}
15228
15229// Next advances to the next value.  If there was an error making
15230// the request the iterator does not advance and the error is returned.
15231// Deprecated: Use NextWithContext() instead.
15232func (iter *TagResourceCollectionIterator) Next() error {
15233	return iter.NextWithContext(context.Background())
15234}
15235
15236// NotDone returns true if the enumeration should be started or is not yet complete.
15237func (iter TagResourceCollectionIterator) NotDone() bool {
15238	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15239}
15240
15241// Response returns the raw server response from the last page request.
15242func (iter TagResourceCollectionIterator) Response() TagResourceCollection {
15243	return iter.page.Response()
15244}
15245
15246// Value returns the current value or a zero-initialized value if the
15247// iterator has advanced beyond the end of the collection.
15248func (iter TagResourceCollectionIterator) Value() TagResourceContract {
15249	if !iter.page.NotDone() {
15250		return TagResourceContract{}
15251	}
15252	return iter.page.Values()[iter.i]
15253}
15254
15255// Creates a new instance of the TagResourceCollectionIterator type.
15256func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator {
15257	return TagResourceCollectionIterator{page: page}
15258}
15259
15260// IsEmpty returns true if the ListResult contains no values.
15261func (trc TagResourceCollection) IsEmpty() bool {
15262	return trc.Value == nil || len(*trc.Value) == 0
15263}
15264
15265// hasNextLink returns true if the NextLink is not empty.
15266func (trc TagResourceCollection) hasNextLink() bool {
15267	return trc.NextLink != nil && len(*trc.NextLink) != 0
15268}
15269
15270// tagResourceCollectionPreparer prepares a request to retrieve the next set of results.
15271// It returns nil if no more results exist.
15272func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
15273	if !trc.hasNextLink() {
15274		return nil, nil
15275	}
15276	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15277		autorest.AsJSON(),
15278		autorest.AsGet(),
15279		autorest.WithBaseURL(to.String(trc.NextLink)))
15280}
15281
15282// TagResourceCollectionPage contains a page of TagResourceContract values.
15283type TagResourceCollectionPage struct {
15284	fn  func(context.Context, TagResourceCollection) (TagResourceCollection, error)
15285	trc TagResourceCollection
15286}
15287
15288// NextWithContext advances to the next page of values.  If there was an error making
15289// the request the page does not advance and the error is returned.
15290func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
15291	if tracing.IsEnabled() {
15292		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext")
15293		defer func() {
15294			sc := -1
15295			if page.Response().Response.Response != nil {
15296				sc = page.Response().Response.Response.StatusCode
15297			}
15298			tracing.EndSpan(ctx, sc, err)
15299		}()
15300	}
15301	for {
15302		next, err := page.fn(ctx, page.trc)
15303		if err != nil {
15304			return err
15305		}
15306		page.trc = next
15307		if !next.hasNextLink() || !next.IsEmpty() {
15308			break
15309		}
15310	}
15311	return nil
15312}
15313
15314// Next advances to the next page of values.  If there was an error making
15315// the request the page does not advance and the error is returned.
15316// Deprecated: Use NextWithContext() instead.
15317func (page *TagResourceCollectionPage) Next() error {
15318	return page.NextWithContext(context.Background())
15319}
15320
15321// NotDone returns true if the page enumeration should be started or is not yet complete.
15322func (page TagResourceCollectionPage) NotDone() bool {
15323	return !page.trc.IsEmpty()
15324}
15325
15326// Response returns the raw server response from the last page request.
15327func (page TagResourceCollectionPage) Response() TagResourceCollection {
15328	return page.trc
15329}
15330
15331// Values returns the slice of values for the current page or nil if there are no values.
15332func (page TagResourceCollectionPage) Values() []TagResourceContract {
15333	if page.trc.IsEmpty() {
15334		return nil
15335	}
15336	return *page.trc.Value
15337}
15338
15339// Creates a new instance of the TagResourceCollectionPage type.
15340func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage {
15341	return TagResourceCollectionPage{
15342		fn:  getNextPage,
15343		trc: cur,
15344	}
15345}
15346
15347// TagResourceContract tagResource contract properties.
15348type TagResourceContract struct {
15349	// Tag - Tag associated with the resource.
15350	Tag *TagTagResourceContractProperties `json:"tag,omitempty"`
15351	// API - API associated with the tag.
15352	API *APITagResourceContractProperties `json:"api,omitempty"`
15353	// Operation - Operation associated with the tag.
15354	Operation *OperationTagResourceContractProperties `json:"operation,omitempty"`
15355	// Product - Product associated with the tag.
15356	Product *ProductTagResourceContractProperties `json:"product,omitempty"`
15357}
15358
15359// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract
15360type TagTagResourceContractProperties struct {
15361	// ID - Tag identifier
15362	ID *string `json:"id,omitempty"`
15363	// Name - Tag Name
15364	Name *string `json:"name,omitempty"`
15365}
15366
15367// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a
15368// long-running operation.
15369type TenantConfigurationDeployFuture struct {
15370	azure.FutureAPI
15371	// Result returns the result of the asynchronous operation.
15372	// If the operation has not completed it will return an error.
15373	Result func(TenantConfigurationClient) (OperationResultContract, error)
15374}
15375
15376// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15377func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error {
15378	var azFuture azure.Future
15379	if err := json.Unmarshal(body, &azFuture); err != nil {
15380		return err
15381	}
15382	future.FutureAPI = &azFuture
15383	future.Result = future.result
15384	return nil
15385}
15386
15387// result is the default implementation for TenantConfigurationDeployFuture.Result.
15388func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
15389	var done bool
15390	done, err = future.DoneWithContext(context.Background(), client)
15391	if err != nil {
15392		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure")
15393		return
15394	}
15395	if !done {
15396		orc.Response.Response = future.Response()
15397		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture")
15398		return
15399	}
15400	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15401	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
15402		orc, err = client.DeployResponder(orc.Response.Response)
15403		if err != nil {
15404			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request")
15405		}
15406	}
15407	return
15408}
15409
15410// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running
15411// operation.
15412type TenantConfigurationSaveFuture struct {
15413	azure.FutureAPI
15414	// Result returns the result of the asynchronous operation.
15415	// If the operation has not completed it will return an error.
15416	Result func(TenantConfigurationClient) (OperationResultContract, error)
15417}
15418
15419// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15420func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error {
15421	var azFuture azure.Future
15422	if err := json.Unmarshal(body, &azFuture); err != nil {
15423		return err
15424	}
15425	future.FutureAPI = &azFuture
15426	future.Result = future.result
15427	return nil
15428}
15429
15430// result is the default implementation for TenantConfigurationSaveFuture.Result.
15431func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
15432	var done bool
15433	done, err = future.DoneWithContext(context.Background(), client)
15434	if err != nil {
15435		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure")
15436		return
15437	}
15438	if !done {
15439		orc.Response.Response = future.Response()
15440		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture")
15441		return
15442	}
15443	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15444	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
15445		orc, err = client.SaveResponder(orc.Response.Response)
15446		if err != nil {
15447			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request")
15448		}
15449	}
15450	return
15451}
15452
15453// TenantConfigurationSyncStateContract result of Tenant Configuration Sync State.
15454type TenantConfigurationSyncStateContract struct {
15455	autorest.Response `json:"-"`
15456	// TenantConfigurationSyncStateContractProperties - Properties returned Tenant Configuration Sync State check.
15457	*TenantConfigurationSyncStateContractProperties `json:"properties,omitempty"`
15458}
15459
15460// MarshalJSON is the custom marshaler for TenantConfigurationSyncStateContract.
15461func (tcssc TenantConfigurationSyncStateContract) MarshalJSON() ([]byte, error) {
15462	objectMap := make(map[string]interface{})
15463	if tcssc.TenantConfigurationSyncStateContractProperties != nil {
15464		objectMap["properties"] = tcssc.TenantConfigurationSyncStateContractProperties
15465	}
15466	return json.Marshal(objectMap)
15467}
15468
15469// UnmarshalJSON is the custom unmarshaler for TenantConfigurationSyncStateContract struct.
15470func (tcssc *TenantConfigurationSyncStateContract) UnmarshalJSON(body []byte) error {
15471	var m map[string]*json.RawMessage
15472	err := json.Unmarshal(body, &m)
15473	if err != nil {
15474		return err
15475	}
15476	for k, v := range m {
15477		switch k {
15478		case "properties":
15479			if v != nil {
15480				var tenantConfigurationSyncStateContractProperties TenantConfigurationSyncStateContractProperties
15481				err = json.Unmarshal(*v, &tenantConfigurationSyncStateContractProperties)
15482				if err != nil {
15483					return err
15484				}
15485				tcssc.TenantConfigurationSyncStateContractProperties = &tenantConfigurationSyncStateContractProperties
15486			}
15487		}
15488	}
15489
15490	return nil
15491}
15492
15493// TenantConfigurationSyncStateContractProperties tenant Configuration Synchronization State.
15494type TenantConfigurationSyncStateContractProperties struct {
15495	// Branch - The name of Git branch.
15496	Branch *string `json:"branch,omitempty"`
15497	// CommitID - The latest commit Id.
15498	CommitID *string `json:"commitId,omitempty"`
15499	// IsExport - value indicating if last sync was save (true) or deploy (false) operation.
15500	IsExport *bool `json:"isExport,omitempty"`
15501	// IsSynced - value indicating if last synchronization was later than the configuration change.
15502	IsSynced *bool `json:"isSynced,omitempty"`
15503	// IsGitEnabled - value indicating whether Git configuration access is enabled.
15504	IsGitEnabled *bool `json:"isGitEnabled,omitempty"`
15505	// 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.
15506	SyncDate *date.Time `json:"syncDate,omitempty"`
15507	// 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.
15508	ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"`
15509	// LastOperationID - Most recent tenant configuration operation identifier
15510	LastOperationID *string `json:"lastOperationId,omitempty"`
15511}
15512
15513// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a
15514// long-running operation.
15515type TenantConfigurationValidateFuture struct {
15516	azure.FutureAPI
15517	// Result returns the result of the asynchronous operation.
15518	// If the operation has not completed it will return an error.
15519	Result func(TenantConfigurationClient) (OperationResultContract, error)
15520}
15521
15522// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15523func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error {
15524	var azFuture azure.Future
15525	if err := json.Unmarshal(body, &azFuture); err != nil {
15526		return err
15527	}
15528	future.FutureAPI = &azFuture
15529	future.Result = future.result
15530	return nil
15531}
15532
15533// result is the default implementation for TenantConfigurationValidateFuture.Result.
15534func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
15535	var done bool
15536	done, err = future.DoneWithContext(context.Background(), client)
15537	if err != nil {
15538		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure")
15539		return
15540	}
15541	if !done {
15542		orc.Response.Response = future.Response()
15543		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture")
15544		return
15545	}
15546	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15547	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
15548		orc, err = client.ValidateResponder(orc.Response.Response)
15549		if err != nil {
15550			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request")
15551		}
15552	}
15553	return
15554}
15555
15556// TenantSettingsCollection paged AccessInformation list representation.
15557type TenantSettingsCollection struct {
15558	autorest.Response `json:"-"`
15559	// Value - READ-ONLY; Page values.
15560	Value *[]TenantSettingsContract `json:"value,omitempty"`
15561	// NextLink - READ-ONLY; Next page link if any.
15562	NextLink *string `json:"nextLink,omitempty"`
15563}
15564
15565// MarshalJSON is the custom marshaler for TenantSettingsCollection.
15566func (tsc TenantSettingsCollection) MarshalJSON() ([]byte, error) {
15567	objectMap := make(map[string]interface{})
15568	return json.Marshal(objectMap)
15569}
15570
15571// TenantSettingsCollectionIterator provides access to a complete listing of TenantSettingsContract values.
15572type TenantSettingsCollectionIterator struct {
15573	i    int
15574	page TenantSettingsCollectionPage
15575}
15576
15577// NextWithContext advances to the next value.  If there was an error making
15578// the request the iterator does not advance and the error is returned.
15579func (iter *TenantSettingsCollectionIterator) NextWithContext(ctx context.Context) (err error) {
15580	if tracing.IsEnabled() {
15581		ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionIterator.NextWithContext")
15582		defer func() {
15583			sc := -1
15584			if iter.Response().Response.Response != nil {
15585				sc = iter.Response().Response.Response.StatusCode
15586			}
15587			tracing.EndSpan(ctx, sc, err)
15588		}()
15589	}
15590	iter.i++
15591	if iter.i < len(iter.page.Values()) {
15592		return nil
15593	}
15594	err = iter.page.NextWithContext(ctx)
15595	if err != nil {
15596		iter.i--
15597		return err
15598	}
15599	iter.i = 0
15600	return nil
15601}
15602
15603// Next advances to the next value.  If there was an error making
15604// the request the iterator does not advance and the error is returned.
15605// Deprecated: Use NextWithContext() instead.
15606func (iter *TenantSettingsCollectionIterator) Next() error {
15607	return iter.NextWithContext(context.Background())
15608}
15609
15610// NotDone returns true if the enumeration should be started or is not yet complete.
15611func (iter TenantSettingsCollectionIterator) NotDone() bool {
15612	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15613}
15614
15615// Response returns the raw server response from the last page request.
15616func (iter TenantSettingsCollectionIterator) Response() TenantSettingsCollection {
15617	return iter.page.Response()
15618}
15619
15620// Value returns the current value or a zero-initialized value if the
15621// iterator has advanced beyond the end of the collection.
15622func (iter TenantSettingsCollectionIterator) Value() TenantSettingsContract {
15623	if !iter.page.NotDone() {
15624		return TenantSettingsContract{}
15625	}
15626	return iter.page.Values()[iter.i]
15627}
15628
15629// Creates a new instance of the TenantSettingsCollectionIterator type.
15630func NewTenantSettingsCollectionIterator(page TenantSettingsCollectionPage) TenantSettingsCollectionIterator {
15631	return TenantSettingsCollectionIterator{page: page}
15632}
15633
15634// IsEmpty returns true if the ListResult contains no values.
15635func (tsc TenantSettingsCollection) IsEmpty() bool {
15636	return tsc.Value == nil || len(*tsc.Value) == 0
15637}
15638
15639// hasNextLink returns true if the NextLink is not empty.
15640func (tsc TenantSettingsCollection) hasNextLink() bool {
15641	return tsc.NextLink != nil && len(*tsc.NextLink) != 0
15642}
15643
15644// tenantSettingsCollectionPreparer prepares a request to retrieve the next set of results.
15645// It returns nil if no more results exist.
15646func (tsc TenantSettingsCollection) tenantSettingsCollectionPreparer(ctx context.Context) (*http.Request, error) {
15647	if !tsc.hasNextLink() {
15648		return nil, nil
15649	}
15650	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15651		autorest.AsJSON(),
15652		autorest.AsGet(),
15653		autorest.WithBaseURL(to.String(tsc.NextLink)))
15654}
15655
15656// TenantSettingsCollectionPage contains a page of TenantSettingsContract values.
15657type TenantSettingsCollectionPage struct {
15658	fn  func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error)
15659	tsc TenantSettingsCollection
15660}
15661
15662// NextWithContext advances to the next page of values.  If there was an error making
15663// the request the page does not advance and the error is returned.
15664func (page *TenantSettingsCollectionPage) NextWithContext(ctx context.Context) (err error) {
15665	if tracing.IsEnabled() {
15666		ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionPage.NextWithContext")
15667		defer func() {
15668			sc := -1
15669			if page.Response().Response.Response != nil {
15670				sc = page.Response().Response.Response.StatusCode
15671			}
15672			tracing.EndSpan(ctx, sc, err)
15673		}()
15674	}
15675	for {
15676		next, err := page.fn(ctx, page.tsc)
15677		if err != nil {
15678			return err
15679		}
15680		page.tsc = next
15681		if !next.hasNextLink() || !next.IsEmpty() {
15682			break
15683		}
15684	}
15685	return nil
15686}
15687
15688// Next advances to the next page of values.  If there was an error making
15689// the request the page does not advance and the error is returned.
15690// Deprecated: Use NextWithContext() instead.
15691func (page *TenantSettingsCollectionPage) Next() error {
15692	return page.NextWithContext(context.Background())
15693}
15694
15695// NotDone returns true if the page enumeration should be started or is not yet complete.
15696func (page TenantSettingsCollectionPage) NotDone() bool {
15697	return !page.tsc.IsEmpty()
15698}
15699
15700// Response returns the raw server response from the last page request.
15701func (page TenantSettingsCollectionPage) Response() TenantSettingsCollection {
15702	return page.tsc
15703}
15704
15705// Values returns the slice of values for the current page or nil if there are no values.
15706func (page TenantSettingsCollectionPage) Values() []TenantSettingsContract {
15707	if page.tsc.IsEmpty() {
15708		return nil
15709	}
15710	return *page.tsc.Value
15711}
15712
15713// Creates a new instance of the TenantSettingsCollectionPage type.
15714func NewTenantSettingsCollectionPage(cur TenantSettingsCollection, getNextPage func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error)) TenantSettingsCollectionPage {
15715	return TenantSettingsCollectionPage{
15716		fn:  getNextPage,
15717		tsc: cur,
15718	}
15719}
15720
15721// TenantSettingsContract tenant Settings.
15722type TenantSettingsContract struct {
15723	autorest.Response `json:"-"`
15724	// TenantSettingsContractProperties - TenantSettings entity contract properties.
15725	*TenantSettingsContractProperties `json:"properties,omitempty"`
15726	// ID - READ-ONLY; Resource ID.
15727	ID *string `json:"id,omitempty"`
15728	// Name - READ-ONLY; Resource name.
15729	Name *string `json:"name,omitempty"`
15730	// Type - READ-ONLY; Resource type for API Management resource.
15731	Type *string `json:"type,omitempty"`
15732}
15733
15734// MarshalJSON is the custom marshaler for TenantSettingsContract.
15735func (tsc TenantSettingsContract) MarshalJSON() ([]byte, error) {
15736	objectMap := make(map[string]interface{})
15737	if tsc.TenantSettingsContractProperties != nil {
15738		objectMap["properties"] = tsc.TenantSettingsContractProperties
15739	}
15740	return json.Marshal(objectMap)
15741}
15742
15743// UnmarshalJSON is the custom unmarshaler for TenantSettingsContract struct.
15744func (tsc *TenantSettingsContract) UnmarshalJSON(body []byte) error {
15745	var m map[string]*json.RawMessage
15746	err := json.Unmarshal(body, &m)
15747	if err != nil {
15748		return err
15749	}
15750	for k, v := range m {
15751		switch k {
15752		case "properties":
15753			if v != nil {
15754				var tenantSettingsContractProperties TenantSettingsContractProperties
15755				err = json.Unmarshal(*v, &tenantSettingsContractProperties)
15756				if err != nil {
15757					return err
15758				}
15759				tsc.TenantSettingsContractProperties = &tenantSettingsContractProperties
15760			}
15761		case "id":
15762			if v != nil {
15763				var ID string
15764				err = json.Unmarshal(*v, &ID)
15765				if err != nil {
15766					return err
15767				}
15768				tsc.ID = &ID
15769			}
15770		case "name":
15771			if v != nil {
15772				var name string
15773				err = json.Unmarshal(*v, &name)
15774				if err != nil {
15775					return err
15776				}
15777				tsc.Name = &name
15778			}
15779		case "type":
15780			if v != nil {
15781				var typeVar string
15782				err = json.Unmarshal(*v, &typeVar)
15783				if err != nil {
15784					return err
15785				}
15786				tsc.Type = &typeVar
15787			}
15788		}
15789	}
15790
15791	return nil
15792}
15793
15794// TenantSettingsContractProperties tenant access information contract of the API Management service.
15795type TenantSettingsContractProperties struct {
15796	// Settings - Tenant settings
15797	Settings map[string]*string `json:"settings"`
15798}
15799
15800// MarshalJSON is the custom marshaler for TenantSettingsContractProperties.
15801func (tscp TenantSettingsContractProperties) MarshalJSON() ([]byte, error) {
15802	objectMap := make(map[string]interface{})
15803	if tscp.Settings != nil {
15804		objectMap["settings"] = tscp.Settings
15805	}
15806	return json.Marshal(objectMap)
15807}
15808
15809// TermsOfServiceProperties terms of service contract properties.
15810type TermsOfServiceProperties struct {
15811	// Text - A terms of service text.
15812	Text *string `json:"text,omitempty"`
15813	// Enabled - Display terms of service during a sign-up process.
15814	Enabled *bool `json:"enabled,omitempty"`
15815	// ConsentRequired - Ask user for consent to the terms of service.
15816	ConsentRequired *bool `json:"consentRequired,omitempty"`
15817}
15818
15819// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded).
15820type TokenBodyParameterContract struct {
15821	// Name - body parameter name.
15822	Name *string `json:"name,omitempty"`
15823	// Value - body parameter value.
15824	Value *string `json:"value,omitempty"`
15825}
15826
15827// UserCollection paged Users list representation.
15828type UserCollection struct {
15829	autorest.Response `json:"-"`
15830	// Value - Page values.
15831	Value *[]UserContract `json:"value,omitempty"`
15832	// Count - Total record count number across all pages.
15833	Count *int64 `json:"count,omitempty"`
15834	// NextLink - Next page link if any.
15835	NextLink *string `json:"nextLink,omitempty"`
15836}
15837
15838// UserCollectionIterator provides access to a complete listing of UserContract values.
15839type UserCollectionIterator struct {
15840	i    int
15841	page UserCollectionPage
15842}
15843
15844// NextWithContext advances to the next value.  If there was an error making
15845// the request the iterator does not advance and the error is returned.
15846func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) {
15847	if tracing.IsEnabled() {
15848		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext")
15849		defer func() {
15850			sc := -1
15851			if iter.Response().Response.Response != nil {
15852				sc = iter.Response().Response.Response.StatusCode
15853			}
15854			tracing.EndSpan(ctx, sc, err)
15855		}()
15856	}
15857	iter.i++
15858	if iter.i < len(iter.page.Values()) {
15859		return nil
15860	}
15861	err = iter.page.NextWithContext(ctx)
15862	if err != nil {
15863		iter.i--
15864		return err
15865	}
15866	iter.i = 0
15867	return nil
15868}
15869
15870// Next advances to the next value.  If there was an error making
15871// the request the iterator does not advance and the error is returned.
15872// Deprecated: Use NextWithContext() instead.
15873func (iter *UserCollectionIterator) Next() error {
15874	return iter.NextWithContext(context.Background())
15875}
15876
15877// NotDone returns true if the enumeration should be started or is not yet complete.
15878func (iter UserCollectionIterator) NotDone() bool {
15879	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15880}
15881
15882// Response returns the raw server response from the last page request.
15883func (iter UserCollectionIterator) Response() UserCollection {
15884	return iter.page.Response()
15885}
15886
15887// Value returns the current value or a zero-initialized value if the
15888// iterator has advanced beyond the end of the collection.
15889func (iter UserCollectionIterator) Value() UserContract {
15890	if !iter.page.NotDone() {
15891		return UserContract{}
15892	}
15893	return iter.page.Values()[iter.i]
15894}
15895
15896// Creates a new instance of the UserCollectionIterator type.
15897func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator {
15898	return UserCollectionIterator{page: page}
15899}
15900
15901// IsEmpty returns true if the ListResult contains no values.
15902func (uc UserCollection) IsEmpty() bool {
15903	return uc.Value == nil || len(*uc.Value) == 0
15904}
15905
15906// hasNextLink returns true if the NextLink is not empty.
15907func (uc UserCollection) hasNextLink() bool {
15908	return uc.NextLink != nil && len(*uc.NextLink) != 0
15909}
15910
15911// userCollectionPreparer prepares a request to retrieve the next set of results.
15912// It returns nil if no more results exist.
15913func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) {
15914	if !uc.hasNextLink() {
15915		return nil, nil
15916	}
15917	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15918		autorest.AsJSON(),
15919		autorest.AsGet(),
15920		autorest.WithBaseURL(to.String(uc.NextLink)))
15921}
15922
15923// UserCollectionPage contains a page of UserContract values.
15924type UserCollectionPage struct {
15925	fn func(context.Context, UserCollection) (UserCollection, error)
15926	uc UserCollection
15927}
15928
15929// NextWithContext advances to the next page of values.  If there was an error making
15930// the request the page does not advance and the error is returned.
15931func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) {
15932	if tracing.IsEnabled() {
15933		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext")
15934		defer func() {
15935			sc := -1
15936			if page.Response().Response.Response != nil {
15937				sc = page.Response().Response.Response.StatusCode
15938			}
15939			tracing.EndSpan(ctx, sc, err)
15940		}()
15941	}
15942	for {
15943		next, err := page.fn(ctx, page.uc)
15944		if err != nil {
15945			return err
15946		}
15947		page.uc = next
15948		if !next.hasNextLink() || !next.IsEmpty() {
15949			break
15950		}
15951	}
15952	return nil
15953}
15954
15955// Next advances to the next page of values.  If there was an error making
15956// the request the page does not advance and the error is returned.
15957// Deprecated: Use NextWithContext() instead.
15958func (page *UserCollectionPage) Next() error {
15959	return page.NextWithContext(context.Background())
15960}
15961
15962// NotDone returns true if the page enumeration should be started or is not yet complete.
15963func (page UserCollectionPage) NotDone() bool {
15964	return !page.uc.IsEmpty()
15965}
15966
15967// Response returns the raw server response from the last page request.
15968func (page UserCollectionPage) Response() UserCollection {
15969	return page.uc
15970}
15971
15972// Values returns the slice of values for the current page or nil if there are no values.
15973func (page UserCollectionPage) Values() []UserContract {
15974	if page.uc.IsEmpty() {
15975		return nil
15976	}
15977	return *page.uc.Value
15978}
15979
15980// Creates a new instance of the UserCollectionPage type.
15981func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage {
15982	return UserCollectionPage{
15983		fn: getNextPage,
15984		uc: cur,
15985	}
15986}
15987
15988// UserContract user details.
15989type UserContract struct {
15990	autorest.Response `json:"-"`
15991	// UserContractProperties - User entity contract properties.
15992	*UserContractProperties `json:"properties,omitempty"`
15993	// ID - READ-ONLY; Resource ID.
15994	ID *string `json:"id,omitempty"`
15995	// Name - READ-ONLY; Resource name.
15996	Name *string `json:"name,omitempty"`
15997	// Type - READ-ONLY; Resource type for API Management resource.
15998	Type *string `json:"type,omitempty"`
15999}
16000
16001// MarshalJSON is the custom marshaler for UserContract.
16002func (uc UserContract) MarshalJSON() ([]byte, error) {
16003	objectMap := make(map[string]interface{})
16004	if uc.UserContractProperties != nil {
16005		objectMap["properties"] = uc.UserContractProperties
16006	}
16007	return json.Marshal(objectMap)
16008}
16009
16010// UnmarshalJSON is the custom unmarshaler for UserContract struct.
16011func (uc *UserContract) UnmarshalJSON(body []byte) error {
16012	var m map[string]*json.RawMessage
16013	err := json.Unmarshal(body, &m)
16014	if err != nil {
16015		return err
16016	}
16017	for k, v := range m {
16018		switch k {
16019		case "properties":
16020			if v != nil {
16021				var userContractProperties UserContractProperties
16022				err = json.Unmarshal(*v, &userContractProperties)
16023				if err != nil {
16024					return err
16025				}
16026				uc.UserContractProperties = &userContractProperties
16027			}
16028		case "id":
16029			if v != nil {
16030				var ID string
16031				err = json.Unmarshal(*v, &ID)
16032				if err != nil {
16033					return err
16034				}
16035				uc.ID = &ID
16036			}
16037		case "name":
16038			if v != nil {
16039				var name string
16040				err = json.Unmarshal(*v, &name)
16041				if err != nil {
16042					return err
16043				}
16044				uc.Name = &name
16045			}
16046		case "type":
16047			if v != nil {
16048				var typeVar string
16049				err = json.Unmarshal(*v, &typeVar)
16050				if err != nil {
16051					return err
16052				}
16053				uc.Type = &typeVar
16054			}
16055		}
16056	}
16057
16058	return nil
16059}
16060
16061// UserContractProperties user profile.
16062type UserContractProperties struct {
16063	// FirstName - First name.
16064	FirstName *string `json:"firstName,omitempty"`
16065	// LastName - Last name.
16066	LastName *string `json:"lastName,omitempty"`
16067	// Email - Email address.
16068	Email *string `json:"email,omitempty"`
16069	// RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
16070	RegistrationDate *date.Time `json:"registrationDate,omitempty"`
16071	// Groups - READ-ONLY; Collection of groups user is part of.
16072	Groups *[]GroupContractProperties `json:"groups,omitempty"`
16073	// 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'
16074	State UserState `json:"state,omitempty"`
16075	// Note - Optional note about a user set by the administrator.
16076	Note *string `json:"note,omitempty"`
16077	// Identities - Collection of user identities.
16078	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16079}
16080
16081// MarshalJSON is the custom marshaler for UserContractProperties.
16082func (ucp UserContractProperties) MarshalJSON() ([]byte, error) {
16083	objectMap := make(map[string]interface{})
16084	if ucp.FirstName != nil {
16085		objectMap["firstName"] = ucp.FirstName
16086	}
16087	if ucp.LastName != nil {
16088		objectMap["lastName"] = ucp.LastName
16089	}
16090	if ucp.Email != nil {
16091		objectMap["email"] = ucp.Email
16092	}
16093	if ucp.RegistrationDate != nil {
16094		objectMap["registrationDate"] = ucp.RegistrationDate
16095	}
16096	if ucp.State != "" {
16097		objectMap["state"] = ucp.State
16098	}
16099	if ucp.Note != nil {
16100		objectMap["note"] = ucp.Note
16101	}
16102	if ucp.Identities != nil {
16103		objectMap["identities"] = ucp.Identities
16104	}
16105	return json.Marshal(objectMap)
16106}
16107
16108// UserCreateParameterProperties parameters supplied to the Create User operation.
16109type UserCreateParameterProperties struct {
16110	// Email - Email address. Must not be empty and must be unique within the service instance.
16111	Email *string `json:"email,omitempty"`
16112	// FirstName - First name.
16113	FirstName *string `json:"firstName,omitempty"`
16114	// LastName - Last name.
16115	LastName *string `json:"lastName,omitempty"`
16116	// Password - User Password. If no value is provided, a default password is generated.
16117	Password *string `json:"password,omitempty"`
16118	// AppType - Determines the type of application which send the create user request. Default is legacy portal. Possible values include: 'AppTypePortal', 'AppTypeDeveloperPortal'
16119	AppType AppType `json:"appType,omitempty"`
16120	// Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'ConfirmationSignup', 'ConfirmationInvite'
16121	Confirmation Confirmation `json:"confirmation,omitempty"`
16122	// 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'
16123	State UserState `json:"state,omitempty"`
16124	// Note - Optional note about a user set by the administrator.
16125	Note *string `json:"note,omitempty"`
16126	// Identities - Collection of user identities.
16127	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16128}
16129
16130// UserCreateParameters user create details.
16131type UserCreateParameters struct {
16132	// UserCreateParameterProperties - User entity create contract properties.
16133	*UserCreateParameterProperties `json:"properties,omitempty"`
16134}
16135
16136// MarshalJSON is the custom marshaler for UserCreateParameters.
16137func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) {
16138	objectMap := make(map[string]interface{})
16139	if ucp.UserCreateParameterProperties != nil {
16140		objectMap["properties"] = ucp.UserCreateParameterProperties
16141	}
16142	return json.Marshal(objectMap)
16143}
16144
16145// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct.
16146func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error {
16147	var m map[string]*json.RawMessage
16148	err := json.Unmarshal(body, &m)
16149	if err != nil {
16150		return err
16151	}
16152	for k, v := range m {
16153		switch k {
16154		case "properties":
16155			if v != nil {
16156				var userCreateParameterProperties UserCreateParameterProperties
16157				err = json.Unmarshal(*v, &userCreateParameterProperties)
16158				if err != nil {
16159					return err
16160				}
16161				ucp.UserCreateParameterProperties = &userCreateParameterProperties
16162			}
16163		}
16164	}
16165
16166	return nil
16167}
16168
16169// UserEntityBaseParameters user Entity Base Parameters set.
16170type UserEntityBaseParameters struct {
16171	// 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'
16172	State UserState `json:"state,omitempty"`
16173	// Note - Optional note about a user set by the administrator.
16174	Note *string `json:"note,omitempty"`
16175	// Identities - Collection of user identities.
16176	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16177}
16178
16179// UserIdentityCollection list of Users Identity list representation.
16180type UserIdentityCollection struct {
16181	autorest.Response `json:"-"`
16182	// Value - User Identity values.
16183	Value *[]UserIdentityContract `json:"value,omitempty"`
16184	// Count - Total record count number across all pages.
16185	Count *int64 `json:"count,omitempty"`
16186	// NextLink - Next page link if any.
16187	NextLink *string `json:"nextLink,omitempty"`
16188}
16189
16190// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values.
16191type UserIdentityCollectionIterator struct {
16192	i    int
16193	page UserIdentityCollectionPage
16194}
16195
16196// NextWithContext advances to the next value.  If there was an error making
16197// the request the iterator does not advance and the error is returned.
16198func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) {
16199	if tracing.IsEnabled() {
16200		ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext")
16201		defer func() {
16202			sc := -1
16203			if iter.Response().Response.Response != nil {
16204				sc = iter.Response().Response.Response.StatusCode
16205			}
16206			tracing.EndSpan(ctx, sc, err)
16207		}()
16208	}
16209	iter.i++
16210	if iter.i < len(iter.page.Values()) {
16211		return nil
16212	}
16213	err = iter.page.NextWithContext(ctx)
16214	if err != nil {
16215		iter.i--
16216		return err
16217	}
16218	iter.i = 0
16219	return nil
16220}
16221
16222// Next advances to the next value.  If there was an error making
16223// the request the iterator does not advance and the error is returned.
16224// Deprecated: Use NextWithContext() instead.
16225func (iter *UserIdentityCollectionIterator) Next() error {
16226	return iter.NextWithContext(context.Background())
16227}
16228
16229// NotDone returns true if the enumeration should be started or is not yet complete.
16230func (iter UserIdentityCollectionIterator) NotDone() bool {
16231	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16232}
16233
16234// Response returns the raw server response from the last page request.
16235func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection {
16236	return iter.page.Response()
16237}
16238
16239// Value returns the current value or a zero-initialized value if the
16240// iterator has advanced beyond the end of the collection.
16241func (iter UserIdentityCollectionIterator) Value() UserIdentityContract {
16242	if !iter.page.NotDone() {
16243		return UserIdentityContract{}
16244	}
16245	return iter.page.Values()[iter.i]
16246}
16247
16248// Creates a new instance of the UserIdentityCollectionIterator type.
16249func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator {
16250	return UserIdentityCollectionIterator{page: page}
16251}
16252
16253// IsEmpty returns true if the ListResult contains no values.
16254func (uic UserIdentityCollection) IsEmpty() bool {
16255	return uic.Value == nil || len(*uic.Value) == 0
16256}
16257
16258// hasNextLink returns true if the NextLink is not empty.
16259func (uic UserIdentityCollection) hasNextLink() bool {
16260	return uic.NextLink != nil && len(*uic.NextLink) != 0
16261}
16262
16263// userIdentityCollectionPreparer prepares a request to retrieve the next set of results.
16264// It returns nil if no more results exist.
16265func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) {
16266	if !uic.hasNextLink() {
16267		return nil, nil
16268	}
16269	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16270		autorest.AsJSON(),
16271		autorest.AsGet(),
16272		autorest.WithBaseURL(to.String(uic.NextLink)))
16273}
16274
16275// UserIdentityCollectionPage contains a page of UserIdentityContract values.
16276type UserIdentityCollectionPage struct {
16277	fn  func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)
16278	uic UserIdentityCollection
16279}
16280
16281// NextWithContext advances to the next page of values.  If there was an error making
16282// the request the page does not advance and the error is returned.
16283func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) {
16284	if tracing.IsEnabled() {
16285		ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext")
16286		defer func() {
16287			sc := -1
16288			if page.Response().Response.Response != nil {
16289				sc = page.Response().Response.Response.StatusCode
16290			}
16291			tracing.EndSpan(ctx, sc, err)
16292		}()
16293	}
16294	for {
16295		next, err := page.fn(ctx, page.uic)
16296		if err != nil {
16297			return err
16298		}
16299		page.uic = next
16300		if !next.hasNextLink() || !next.IsEmpty() {
16301			break
16302		}
16303	}
16304	return nil
16305}
16306
16307// Next advances to the next page of values.  If there was an error making
16308// the request the page does not advance and the error is returned.
16309// Deprecated: Use NextWithContext() instead.
16310func (page *UserIdentityCollectionPage) Next() error {
16311	return page.NextWithContext(context.Background())
16312}
16313
16314// NotDone returns true if the page enumeration should be started or is not yet complete.
16315func (page UserIdentityCollectionPage) NotDone() bool {
16316	return !page.uic.IsEmpty()
16317}
16318
16319// Response returns the raw server response from the last page request.
16320func (page UserIdentityCollectionPage) Response() UserIdentityCollection {
16321	return page.uic
16322}
16323
16324// Values returns the slice of values for the current page or nil if there are no values.
16325func (page UserIdentityCollectionPage) Values() []UserIdentityContract {
16326	if page.uic.IsEmpty() {
16327		return nil
16328	}
16329	return *page.uic.Value
16330}
16331
16332// Creates a new instance of the UserIdentityCollectionPage type.
16333func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage {
16334	return UserIdentityCollectionPage{
16335		fn:  getNextPage,
16336		uic: cur,
16337	}
16338}
16339
16340// UserIdentityContract user identity details.
16341type UserIdentityContract struct {
16342	// Provider - Identity provider name.
16343	Provider *string `json:"provider,omitempty"`
16344	// ID - Identifier value within provider.
16345	ID *string `json:"id,omitempty"`
16346}
16347
16348// UserIdentityProperties ...
16349type UserIdentityProperties struct {
16350	// PrincipalID - The principal id of user assigned identity.
16351	PrincipalID *string `json:"principalId,omitempty"`
16352	// ClientID - The client id of user assigned identity.
16353	ClientID *string `json:"clientId,omitempty"`
16354}
16355
16356// UserTokenParameterProperties parameters supplied to the Get User Token operation.
16357type UserTokenParameterProperties struct {
16358	// KeyType - The Key to be used to generate token for user. Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary'
16359	KeyType KeyType `json:"keyType,omitempty"`
16360	// 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.
16361	Expiry *date.Time `json:"expiry,omitempty"`
16362}
16363
16364// UserTokenParameters get User Token parameters.
16365type UserTokenParameters struct {
16366	// UserTokenParameterProperties - User Token Parameter contract properties.
16367	*UserTokenParameterProperties `json:"properties,omitempty"`
16368}
16369
16370// MarshalJSON is the custom marshaler for UserTokenParameters.
16371func (utp UserTokenParameters) MarshalJSON() ([]byte, error) {
16372	objectMap := make(map[string]interface{})
16373	if utp.UserTokenParameterProperties != nil {
16374		objectMap["properties"] = utp.UserTokenParameterProperties
16375	}
16376	return json.Marshal(objectMap)
16377}
16378
16379// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct.
16380func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error {
16381	var m map[string]*json.RawMessage
16382	err := json.Unmarshal(body, &m)
16383	if err != nil {
16384		return err
16385	}
16386	for k, v := range m {
16387		switch k {
16388		case "properties":
16389			if v != nil {
16390				var userTokenParameterProperties UserTokenParameterProperties
16391				err = json.Unmarshal(*v, &userTokenParameterProperties)
16392				if err != nil {
16393					return err
16394				}
16395				utp.UserTokenParameterProperties = &userTokenParameterProperties
16396			}
16397		}
16398	}
16399
16400	return nil
16401}
16402
16403// UserTokenResult get User Token response details.
16404type UserTokenResult struct {
16405	autorest.Response `json:"-"`
16406	// Value - Shared Access Authorization token for the User.
16407	Value *string `json:"value,omitempty"`
16408}
16409
16410// UserUpdateParameters user update parameters.
16411type UserUpdateParameters struct {
16412	// UserUpdateParametersProperties - User entity update contract properties.
16413	*UserUpdateParametersProperties `json:"properties,omitempty"`
16414}
16415
16416// MarshalJSON is the custom marshaler for UserUpdateParameters.
16417func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) {
16418	objectMap := make(map[string]interface{})
16419	if uup.UserUpdateParametersProperties != nil {
16420		objectMap["properties"] = uup.UserUpdateParametersProperties
16421	}
16422	return json.Marshal(objectMap)
16423}
16424
16425// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct.
16426func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error {
16427	var m map[string]*json.RawMessage
16428	err := json.Unmarshal(body, &m)
16429	if err != nil {
16430		return err
16431	}
16432	for k, v := range m {
16433		switch k {
16434		case "properties":
16435			if v != nil {
16436				var userUpdateParametersProperties UserUpdateParametersProperties
16437				err = json.Unmarshal(*v, &userUpdateParametersProperties)
16438				if err != nil {
16439					return err
16440				}
16441				uup.UserUpdateParametersProperties = &userUpdateParametersProperties
16442			}
16443		}
16444	}
16445
16446	return nil
16447}
16448
16449// UserUpdateParametersProperties parameters supplied to the Update User operation.
16450type UserUpdateParametersProperties struct {
16451	// Email - Email address. Must not be empty and must be unique within the service instance.
16452	Email *string `json:"email,omitempty"`
16453	// Password - User Password.
16454	Password *string `json:"password,omitempty"`
16455	// FirstName - First name.
16456	FirstName *string `json:"firstName,omitempty"`
16457	// LastName - Last name.
16458	LastName *string `json:"lastName,omitempty"`
16459	// 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'
16460	State UserState `json:"state,omitempty"`
16461	// Note - Optional note about a user set by the administrator.
16462	Note *string `json:"note,omitempty"`
16463	// Identities - Collection of user identities.
16464	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16465}
16466
16467// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is
16468// deployed.
16469type VirtualNetworkConfiguration struct {
16470	// Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default.
16471	Vnetid *string `json:"vnetid,omitempty"`
16472	// Subnetname - READ-ONLY; The name of the subnet.
16473	Subnetname *string `json:"subnetname,omitempty"`
16474	// SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in.
16475	SubnetResourceID *string `json:"subnetResourceId,omitempty"`
16476}
16477
16478// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration.
16479func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) {
16480	objectMap := make(map[string]interface{})
16481	if vnc.SubnetResourceID != nil {
16482		objectMap["subnetResourceId"] = vnc.SubnetResourceID
16483	}
16484	return json.Marshal(objectMap)
16485}
16486
16487// X509CertificateName properties of server X509Names.
16488type X509CertificateName struct {
16489	// Name - Common Name of the Certificate.
16490	Name *string `json:"name,omitempty"`
16491	// IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate.
16492	IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"`
16493}
16494