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}
9997
9998// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
9999type PipelineDiagnosticSettings struct {
10000	// Request - Diagnostic settings for request.
10001	Request *HTTPMessageDiagnostic `json:"request,omitempty"`
10002	// Response - Diagnostic settings for response.
10003	Response *HTTPMessageDiagnostic `json:"response,omitempty"`
10004}
10005
10006// PolicyCollection the response of the list policy operation.
10007type PolicyCollection struct {
10008	autorest.Response `json:"-"`
10009	// Value - Policy Contract value.
10010	Value *[]PolicyContract `json:"value,omitempty"`
10011	// Count - Total record count number.
10012	Count *int64 `json:"count,omitempty"`
10013	// NextLink - Next page link if any.
10014	NextLink *string `json:"nextLink,omitempty"`
10015}
10016
10017// PolicyContract policy Contract details.
10018type PolicyContract struct {
10019	autorest.Response `json:"-"`
10020	// PolicyContractProperties - Properties of the Policy.
10021	*PolicyContractProperties `json:"properties,omitempty"`
10022	// ID - READ-ONLY; Resource ID.
10023	ID *string `json:"id,omitempty"`
10024	// Name - READ-ONLY; Resource name.
10025	Name *string `json:"name,omitempty"`
10026	// Type - READ-ONLY; Resource type for API Management resource.
10027	Type *string `json:"type,omitempty"`
10028}
10029
10030// MarshalJSON is the custom marshaler for PolicyContract.
10031func (pc PolicyContract) MarshalJSON() ([]byte, error) {
10032	objectMap := make(map[string]interface{})
10033	if pc.PolicyContractProperties != nil {
10034		objectMap["properties"] = pc.PolicyContractProperties
10035	}
10036	return json.Marshal(objectMap)
10037}
10038
10039// UnmarshalJSON is the custom unmarshaler for PolicyContract struct.
10040func (pc *PolicyContract) UnmarshalJSON(body []byte) error {
10041	var m map[string]*json.RawMessage
10042	err := json.Unmarshal(body, &m)
10043	if err != nil {
10044		return err
10045	}
10046	for k, v := range m {
10047		switch k {
10048		case "properties":
10049			if v != nil {
10050				var policyContractProperties PolicyContractProperties
10051				err = json.Unmarshal(*v, &policyContractProperties)
10052				if err != nil {
10053					return err
10054				}
10055				pc.PolicyContractProperties = &policyContractProperties
10056			}
10057		case "id":
10058			if v != nil {
10059				var ID string
10060				err = json.Unmarshal(*v, &ID)
10061				if err != nil {
10062					return err
10063				}
10064				pc.ID = &ID
10065			}
10066		case "name":
10067			if v != nil {
10068				var name string
10069				err = json.Unmarshal(*v, &name)
10070				if err != nil {
10071					return err
10072				}
10073				pc.Name = &name
10074			}
10075		case "type":
10076			if v != nil {
10077				var typeVar string
10078				err = json.Unmarshal(*v, &typeVar)
10079				if err != nil {
10080					return err
10081				}
10082				pc.Type = &typeVar
10083			}
10084		}
10085	}
10086
10087	return nil
10088}
10089
10090// PolicyContractProperties policy contract Properties.
10091type PolicyContractProperties struct {
10092	// Value - Contents of the Policy as defined by the format.
10093	Value *string `json:"value,omitempty"`
10094	// Format - Format of the policyContent. Possible values include: 'PolicyContentFormatXML', 'PolicyContentFormatXMLLink', 'PolicyContentFormatRawxml', 'PolicyContentFormatRawxmlLink'
10095	Format PolicyContentFormat `json:"format,omitempty"`
10096}
10097
10098// PolicyDescriptionCollection descriptions of APIM policies.
10099type PolicyDescriptionCollection struct {
10100	autorest.Response `json:"-"`
10101	// Value - Descriptions of APIM policies.
10102	Value *[]PolicyDescriptionContract `json:"value,omitempty"`
10103	// Count - Total record count number.
10104	Count *int64 `json:"count,omitempty"`
10105}
10106
10107// PolicyDescriptionContract policy description details.
10108type PolicyDescriptionContract struct {
10109	// PolicyDescriptionContractProperties - Policy description contract properties.
10110	*PolicyDescriptionContractProperties `json:"properties,omitempty"`
10111	// ID - READ-ONLY; Resource ID.
10112	ID *string `json:"id,omitempty"`
10113	// Name - READ-ONLY; Resource name.
10114	Name *string `json:"name,omitempty"`
10115	// Type - READ-ONLY; Resource type for API Management resource.
10116	Type *string `json:"type,omitempty"`
10117}
10118
10119// MarshalJSON is the custom marshaler for PolicyDescriptionContract.
10120func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) {
10121	objectMap := make(map[string]interface{})
10122	if pdc.PolicyDescriptionContractProperties != nil {
10123		objectMap["properties"] = pdc.PolicyDescriptionContractProperties
10124	}
10125	return json.Marshal(objectMap)
10126}
10127
10128// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct.
10129func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error {
10130	var m map[string]*json.RawMessage
10131	err := json.Unmarshal(body, &m)
10132	if err != nil {
10133		return err
10134	}
10135	for k, v := range m {
10136		switch k {
10137		case "properties":
10138			if v != nil {
10139				var policyDescriptionContractProperties PolicyDescriptionContractProperties
10140				err = json.Unmarshal(*v, &policyDescriptionContractProperties)
10141				if err != nil {
10142					return err
10143				}
10144				pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties
10145			}
10146		case "id":
10147			if v != nil {
10148				var ID string
10149				err = json.Unmarshal(*v, &ID)
10150				if err != nil {
10151					return err
10152				}
10153				pdc.ID = &ID
10154			}
10155		case "name":
10156			if v != nil {
10157				var name string
10158				err = json.Unmarshal(*v, &name)
10159				if err != nil {
10160					return err
10161				}
10162				pdc.Name = &name
10163			}
10164		case "type":
10165			if v != nil {
10166				var typeVar string
10167				err = json.Unmarshal(*v, &typeVar)
10168				if err != nil {
10169					return err
10170				}
10171				pdc.Type = &typeVar
10172			}
10173		}
10174	}
10175
10176	return nil
10177}
10178
10179// PolicyDescriptionContractProperties policy description properties.
10180type PolicyDescriptionContractProperties struct {
10181	// Description - READ-ONLY; Policy description.
10182	Description *string `json:"description,omitempty"`
10183	// Scope - READ-ONLY; Binary OR value of the Snippet scope.
10184	Scope *int64 `json:"scope,omitempty"`
10185}
10186
10187// MarshalJSON is the custom marshaler for PolicyDescriptionContractProperties.
10188func (pdcp PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) {
10189	objectMap := make(map[string]interface{})
10190	return json.Marshal(objectMap)
10191}
10192
10193// PortalDelegationSettings delegation settings for a developer portal.
10194type PortalDelegationSettings struct {
10195	autorest.Response `json:"-"`
10196	// PortalDelegationSettingsProperties - Delegation settings contract properties.
10197	*PortalDelegationSettingsProperties `json:"properties,omitempty"`
10198	// ID - READ-ONLY; Resource ID.
10199	ID *string `json:"id,omitempty"`
10200	// Name - READ-ONLY; Resource name.
10201	Name *string `json:"name,omitempty"`
10202	// Type - READ-ONLY; Resource type for API Management resource.
10203	Type *string `json:"type,omitempty"`
10204}
10205
10206// MarshalJSON is the custom marshaler for PortalDelegationSettings.
10207func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) {
10208	objectMap := make(map[string]interface{})
10209	if pds.PortalDelegationSettingsProperties != nil {
10210		objectMap["properties"] = pds.PortalDelegationSettingsProperties
10211	}
10212	return json.Marshal(objectMap)
10213}
10214
10215// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct.
10216func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error {
10217	var m map[string]*json.RawMessage
10218	err := json.Unmarshal(body, &m)
10219	if err != nil {
10220		return err
10221	}
10222	for k, v := range m {
10223		switch k {
10224		case "properties":
10225			if v != nil {
10226				var portalDelegationSettingsProperties PortalDelegationSettingsProperties
10227				err = json.Unmarshal(*v, &portalDelegationSettingsProperties)
10228				if err != nil {
10229					return err
10230				}
10231				pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties
10232			}
10233		case "id":
10234			if v != nil {
10235				var ID string
10236				err = json.Unmarshal(*v, &ID)
10237				if err != nil {
10238					return err
10239				}
10240				pds.ID = &ID
10241			}
10242		case "name":
10243			if v != nil {
10244				var name string
10245				err = json.Unmarshal(*v, &name)
10246				if err != nil {
10247					return err
10248				}
10249				pds.Name = &name
10250			}
10251		case "type":
10252			if v != nil {
10253				var typeVar string
10254				err = json.Unmarshal(*v, &typeVar)
10255				if err != nil {
10256					return err
10257				}
10258				pds.Type = &typeVar
10259			}
10260		}
10261	}
10262
10263	return nil
10264}
10265
10266// PortalDelegationSettingsProperties delegation settings contract properties.
10267type PortalDelegationSettingsProperties struct {
10268	// URL - A delegation Url.
10269	URL *string `json:"url,omitempty"`
10270	// ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management.
10271	ValidationKey *string `json:"validationKey,omitempty"`
10272	// Subscriptions - Subscriptions delegation settings.
10273	Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"`
10274	// UserRegistration - User registration delegation settings.
10275	UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"`
10276}
10277
10278// PortalRevisionCollection paged list of portal revisions.
10279type PortalRevisionCollection struct {
10280	autorest.Response `json:"-"`
10281	// Value - READ-ONLY; Collection of portal revisions.
10282	Value *[]PortalRevisionContract `json:"value,omitempty"`
10283	// NextLink - READ-ONLY; Next page link, if any.
10284	NextLink *string `json:"nextLink,omitempty"`
10285}
10286
10287// MarshalJSON is the custom marshaler for PortalRevisionCollection.
10288func (prc PortalRevisionCollection) MarshalJSON() ([]byte, error) {
10289	objectMap := make(map[string]interface{})
10290	return json.Marshal(objectMap)
10291}
10292
10293// PortalRevisionCollectionIterator provides access to a complete listing of PortalRevisionContract values.
10294type PortalRevisionCollectionIterator struct {
10295	i    int
10296	page PortalRevisionCollectionPage
10297}
10298
10299// NextWithContext advances to the next value.  If there was an error making
10300// the request the iterator does not advance and the error is returned.
10301func (iter *PortalRevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10302	if tracing.IsEnabled() {
10303		ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionIterator.NextWithContext")
10304		defer func() {
10305			sc := -1
10306			if iter.Response().Response.Response != nil {
10307				sc = iter.Response().Response.Response.StatusCode
10308			}
10309			tracing.EndSpan(ctx, sc, err)
10310		}()
10311	}
10312	iter.i++
10313	if iter.i < len(iter.page.Values()) {
10314		return nil
10315	}
10316	err = iter.page.NextWithContext(ctx)
10317	if err != nil {
10318		iter.i--
10319		return err
10320	}
10321	iter.i = 0
10322	return nil
10323}
10324
10325// Next advances to the next value.  If there was an error making
10326// the request the iterator does not advance and the error is returned.
10327// Deprecated: Use NextWithContext() instead.
10328func (iter *PortalRevisionCollectionIterator) Next() error {
10329	return iter.NextWithContext(context.Background())
10330}
10331
10332// NotDone returns true if the enumeration should be started or is not yet complete.
10333func (iter PortalRevisionCollectionIterator) NotDone() bool {
10334	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10335}
10336
10337// Response returns the raw server response from the last page request.
10338func (iter PortalRevisionCollectionIterator) Response() PortalRevisionCollection {
10339	return iter.page.Response()
10340}
10341
10342// Value returns the current value or a zero-initialized value if the
10343// iterator has advanced beyond the end of the collection.
10344func (iter PortalRevisionCollectionIterator) Value() PortalRevisionContract {
10345	if !iter.page.NotDone() {
10346		return PortalRevisionContract{}
10347	}
10348	return iter.page.Values()[iter.i]
10349}
10350
10351// Creates a new instance of the PortalRevisionCollectionIterator type.
10352func NewPortalRevisionCollectionIterator(page PortalRevisionCollectionPage) PortalRevisionCollectionIterator {
10353	return PortalRevisionCollectionIterator{page: page}
10354}
10355
10356// IsEmpty returns true if the ListResult contains no values.
10357func (prc PortalRevisionCollection) IsEmpty() bool {
10358	return prc.Value == nil || len(*prc.Value) == 0
10359}
10360
10361// hasNextLink returns true if the NextLink is not empty.
10362func (prc PortalRevisionCollection) hasNextLink() bool {
10363	return prc.NextLink != nil && len(*prc.NextLink) != 0
10364}
10365
10366// portalRevisionCollectionPreparer prepares a request to retrieve the next set of results.
10367// It returns nil if no more results exist.
10368func (prc PortalRevisionCollection) portalRevisionCollectionPreparer(ctx context.Context) (*http.Request, error) {
10369	if !prc.hasNextLink() {
10370		return nil, nil
10371	}
10372	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10373		autorest.AsJSON(),
10374		autorest.AsGet(),
10375		autorest.WithBaseURL(to.String(prc.NextLink)))
10376}
10377
10378// PortalRevisionCollectionPage contains a page of PortalRevisionContract values.
10379type PortalRevisionCollectionPage struct {
10380	fn  func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error)
10381	prc PortalRevisionCollection
10382}
10383
10384// NextWithContext advances to the next page of values.  If there was an error making
10385// the request the page does not advance and the error is returned.
10386func (page *PortalRevisionCollectionPage) NextWithContext(ctx context.Context) (err error) {
10387	if tracing.IsEnabled() {
10388		ctx = tracing.StartSpan(ctx, fqdn+"/PortalRevisionCollectionPage.NextWithContext")
10389		defer func() {
10390			sc := -1
10391			if page.Response().Response.Response != nil {
10392				sc = page.Response().Response.Response.StatusCode
10393			}
10394			tracing.EndSpan(ctx, sc, err)
10395		}()
10396	}
10397	for {
10398		next, err := page.fn(ctx, page.prc)
10399		if err != nil {
10400			return err
10401		}
10402		page.prc = next
10403		if !next.hasNextLink() || !next.IsEmpty() {
10404			break
10405		}
10406	}
10407	return nil
10408}
10409
10410// Next advances to the next page of values.  If there was an error making
10411// the request the page does not advance and the error is returned.
10412// Deprecated: Use NextWithContext() instead.
10413func (page *PortalRevisionCollectionPage) Next() error {
10414	return page.NextWithContext(context.Background())
10415}
10416
10417// NotDone returns true if the page enumeration should be started or is not yet complete.
10418func (page PortalRevisionCollectionPage) NotDone() bool {
10419	return !page.prc.IsEmpty()
10420}
10421
10422// Response returns the raw server response from the last page request.
10423func (page PortalRevisionCollectionPage) Response() PortalRevisionCollection {
10424	return page.prc
10425}
10426
10427// Values returns the slice of values for the current page or nil if there are no values.
10428func (page PortalRevisionCollectionPage) Values() []PortalRevisionContract {
10429	if page.prc.IsEmpty() {
10430		return nil
10431	}
10432	return *page.prc.Value
10433}
10434
10435// Creates a new instance of the PortalRevisionCollectionPage type.
10436func NewPortalRevisionCollectionPage(cur PortalRevisionCollection, getNextPage func(context.Context, PortalRevisionCollection) (PortalRevisionCollection, error)) PortalRevisionCollectionPage {
10437	return PortalRevisionCollectionPage{
10438		fn:  getNextPage,
10439		prc: cur,
10440	}
10441}
10442
10443// PortalRevisionContract portal Revision's contract details.
10444type PortalRevisionContract struct {
10445	autorest.Response `json:"-"`
10446	// PortalRevisionContractProperties - Properties of the portal revisions.
10447	*PortalRevisionContractProperties `json:"properties,omitempty"`
10448	// ID - READ-ONLY; Resource ID.
10449	ID *string `json:"id,omitempty"`
10450	// Name - READ-ONLY; Resource name.
10451	Name *string `json:"name,omitempty"`
10452	// Type - READ-ONLY; Resource type for API Management resource.
10453	Type *string `json:"type,omitempty"`
10454}
10455
10456// MarshalJSON is the custom marshaler for PortalRevisionContract.
10457func (prc PortalRevisionContract) MarshalJSON() ([]byte, error) {
10458	objectMap := make(map[string]interface{})
10459	if prc.PortalRevisionContractProperties != nil {
10460		objectMap["properties"] = prc.PortalRevisionContractProperties
10461	}
10462	return json.Marshal(objectMap)
10463}
10464
10465// UnmarshalJSON is the custom unmarshaler for PortalRevisionContract struct.
10466func (prc *PortalRevisionContract) UnmarshalJSON(body []byte) error {
10467	var m map[string]*json.RawMessage
10468	err := json.Unmarshal(body, &m)
10469	if err != nil {
10470		return err
10471	}
10472	for k, v := range m {
10473		switch k {
10474		case "properties":
10475			if v != nil {
10476				var portalRevisionContractProperties PortalRevisionContractProperties
10477				err = json.Unmarshal(*v, &portalRevisionContractProperties)
10478				if err != nil {
10479					return err
10480				}
10481				prc.PortalRevisionContractProperties = &portalRevisionContractProperties
10482			}
10483		case "id":
10484			if v != nil {
10485				var ID string
10486				err = json.Unmarshal(*v, &ID)
10487				if err != nil {
10488					return err
10489				}
10490				prc.ID = &ID
10491			}
10492		case "name":
10493			if v != nil {
10494				var name string
10495				err = json.Unmarshal(*v, &name)
10496				if err != nil {
10497					return err
10498				}
10499				prc.Name = &name
10500			}
10501		case "type":
10502			if v != nil {
10503				var typeVar string
10504				err = json.Unmarshal(*v, &typeVar)
10505				if err != nil {
10506					return err
10507				}
10508				prc.Type = &typeVar
10509			}
10510		}
10511	}
10512
10513	return nil
10514}
10515
10516// PortalRevisionContractProperties ...
10517type PortalRevisionContractProperties struct {
10518	// Description - Portal revision description.
10519	Description *string `json:"description,omitempty"`
10520	// StatusDetails - READ-ONLY; Portal revision publishing status details.
10521	StatusDetails *string `json:"statusDetails,omitempty"`
10522	// Status - READ-ONLY; Status of the portal's revision. Possible values include: 'PortalRevisionStatusPending', 'PortalRevisionStatusPublishing', 'PortalRevisionStatusCompleted', 'PortalRevisionStatusFailed'
10523	Status PortalRevisionStatus `json:"status,omitempty"`
10524	// IsCurrent - Indicates if the portal's revision is public.
10525	IsCurrent *bool `json:"isCurrent,omitempty"`
10526	// CreatedDateTime - READ-ONLY; Portal's revision creation date and time.
10527	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
10528	// UpdatedDateTime - READ-ONLY; Last updated date and time.
10529	UpdatedDateTime *date.Time `json:"updatedDateTime,omitempty"`
10530}
10531
10532// MarshalJSON is the custom marshaler for PortalRevisionContractProperties.
10533func (prcp PortalRevisionContractProperties) MarshalJSON() ([]byte, error) {
10534	objectMap := make(map[string]interface{})
10535	if prcp.Description != nil {
10536		objectMap["description"] = prcp.Description
10537	}
10538	if prcp.IsCurrent != nil {
10539		objectMap["isCurrent"] = prcp.IsCurrent
10540	}
10541	return json.Marshal(objectMap)
10542}
10543
10544// PortalRevisionCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
10545// long-running operation.
10546type PortalRevisionCreateOrUpdateFuture struct {
10547	azure.FutureAPI
10548	// Result returns the result of the asynchronous operation.
10549	// If the operation has not completed it will return an error.
10550	Result func(PortalRevisionClient) (PortalRevisionContract, error)
10551}
10552
10553// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10554func (future *PortalRevisionCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
10555	var azFuture azure.Future
10556	if err := json.Unmarshal(body, &azFuture); err != nil {
10557		return err
10558	}
10559	future.FutureAPI = &azFuture
10560	future.Result = future.result
10561	return nil
10562}
10563
10564// result is the default implementation for PortalRevisionCreateOrUpdateFuture.Result.
10565func (future *PortalRevisionCreateOrUpdateFuture) result(client PortalRevisionClient) (prc PortalRevisionContract, err error) {
10566	var done bool
10567	done, err = future.DoneWithContext(context.Background(), client)
10568	if err != nil {
10569		err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
10570		return
10571	}
10572	if !done {
10573		prc.Response.Response = future.Response()
10574		err = azure.NewAsyncOpIncompleteError("apimanagement.PortalRevisionCreateOrUpdateFuture")
10575		return
10576	}
10577	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10578	if prc.Response.Response, err = future.GetResult(sender); err == nil && prc.Response.Response.StatusCode != http.StatusNoContent {
10579		prc, err = client.CreateOrUpdateResponder(prc.Response.Response)
10580		if err != nil {
10581			err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionCreateOrUpdateFuture", "Result", prc.Response.Response, "Failure responding to request")
10582		}
10583	}
10584	return
10585}
10586
10587// PortalRevisionUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
10588// operation.
10589type PortalRevisionUpdateFuture struct {
10590	azure.FutureAPI
10591	// Result returns the result of the asynchronous operation.
10592	// If the operation has not completed it will return an error.
10593	Result func(PortalRevisionClient) (PortalRevisionContract, error)
10594}
10595
10596// UnmarshalJSON is the custom unmarshaller for CreateFuture.
10597func (future *PortalRevisionUpdateFuture) UnmarshalJSON(body []byte) error {
10598	var azFuture azure.Future
10599	if err := json.Unmarshal(body, &azFuture); err != nil {
10600		return err
10601	}
10602	future.FutureAPI = &azFuture
10603	future.Result = future.result
10604	return nil
10605}
10606
10607// result is the default implementation for PortalRevisionUpdateFuture.Result.
10608func (future *PortalRevisionUpdateFuture) result(client PortalRevisionClient) (prc PortalRevisionContract, err error) {
10609	var done bool
10610	done, err = future.DoneWithContext(context.Background(), client)
10611	if err != nil {
10612		err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionUpdateFuture", "Result", future.Response(), "Polling failure")
10613		return
10614	}
10615	if !done {
10616		prc.Response.Response = future.Response()
10617		err = azure.NewAsyncOpIncompleteError("apimanagement.PortalRevisionUpdateFuture")
10618		return
10619	}
10620	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
10621	if prc.Response.Response, err = future.GetResult(sender); err == nil && prc.Response.Response.StatusCode != http.StatusNoContent {
10622		prc, err = client.UpdateResponder(prc.Response.Response)
10623		if err != nil {
10624			err = autorest.NewErrorWithError(err, "apimanagement.PortalRevisionUpdateFuture", "Result", prc.Response.Response, "Failure responding to request")
10625		}
10626	}
10627	return
10628}
10629
10630// PortalSettingsCollection descriptions of APIM policies.
10631type PortalSettingsCollection struct {
10632	autorest.Response `json:"-"`
10633	// Value - Descriptions of APIM policies.
10634	Value *[]PortalSettingsContract `json:"value,omitempty"`
10635	// Count - Total record count number.
10636	Count *int64 `json:"count,omitempty"`
10637}
10638
10639// PortalSettingsContract portal Settings for the Developer Portal.
10640type PortalSettingsContract struct {
10641	// PortalSettingsContractProperties - Portal Settings contract properties.
10642	*PortalSettingsContractProperties `json:"properties,omitempty"`
10643	// ID - READ-ONLY; Resource ID.
10644	ID *string `json:"id,omitempty"`
10645	// Name - READ-ONLY; Resource name.
10646	Name *string `json:"name,omitempty"`
10647	// Type - READ-ONLY; Resource type for API Management resource.
10648	Type *string `json:"type,omitempty"`
10649}
10650
10651// MarshalJSON is the custom marshaler for PortalSettingsContract.
10652func (psc PortalSettingsContract) MarshalJSON() ([]byte, error) {
10653	objectMap := make(map[string]interface{})
10654	if psc.PortalSettingsContractProperties != nil {
10655		objectMap["properties"] = psc.PortalSettingsContractProperties
10656	}
10657	return json.Marshal(objectMap)
10658}
10659
10660// UnmarshalJSON is the custom unmarshaler for PortalSettingsContract struct.
10661func (psc *PortalSettingsContract) UnmarshalJSON(body []byte) error {
10662	var m map[string]*json.RawMessage
10663	err := json.Unmarshal(body, &m)
10664	if err != nil {
10665		return err
10666	}
10667	for k, v := range m {
10668		switch k {
10669		case "properties":
10670			if v != nil {
10671				var portalSettingsContractProperties PortalSettingsContractProperties
10672				err = json.Unmarshal(*v, &portalSettingsContractProperties)
10673				if err != nil {
10674					return err
10675				}
10676				psc.PortalSettingsContractProperties = &portalSettingsContractProperties
10677			}
10678		case "id":
10679			if v != nil {
10680				var ID string
10681				err = json.Unmarshal(*v, &ID)
10682				if err != nil {
10683					return err
10684				}
10685				psc.ID = &ID
10686			}
10687		case "name":
10688			if v != nil {
10689				var name string
10690				err = json.Unmarshal(*v, &name)
10691				if err != nil {
10692					return err
10693				}
10694				psc.Name = &name
10695			}
10696		case "type":
10697			if v != nil {
10698				var typeVar string
10699				err = json.Unmarshal(*v, &typeVar)
10700				if err != nil {
10701					return err
10702				}
10703				psc.Type = &typeVar
10704			}
10705		}
10706	}
10707
10708	return nil
10709}
10710
10711// PortalSettingsContractProperties sign-in settings contract properties.
10712type PortalSettingsContractProperties struct {
10713	// URL - A delegation Url.
10714	URL *string `json:"url,omitempty"`
10715	// ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management.
10716	ValidationKey *string `json:"validationKey,omitempty"`
10717	// Subscriptions - Subscriptions delegation settings.
10718	Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"`
10719	// UserRegistration - User registration delegation settings.
10720	UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"`
10721	// Enabled - Redirect Anonymous users to the Sign-In page.
10722	Enabled *bool `json:"enabled,omitempty"`
10723	// TermsOfService - Terms of service contract properties.
10724	TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"`
10725}
10726
10727// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth.
10728type PortalSettingValidationKeyContract struct {
10729	autorest.Response `json:"-"`
10730	// ValidationKey - This is secret value of the validation key in portal settings.
10731	ValidationKey *string `json:"validationKey,omitempty"`
10732}
10733
10734// PortalSigninSettingProperties sign-in settings contract properties.
10735type PortalSigninSettingProperties struct {
10736	// Enabled - Redirect Anonymous users to the Sign-In page.
10737	Enabled *bool `json:"enabled,omitempty"`
10738}
10739
10740// PortalSigninSettings sign-In settings for the Developer Portal.
10741type PortalSigninSettings struct {
10742	autorest.Response `json:"-"`
10743	// PortalSigninSettingProperties - Sign-in settings contract properties.
10744	*PortalSigninSettingProperties `json:"properties,omitempty"`
10745	// ID - READ-ONLY; Resource ID.
10746	ID *string `json:"id,omitempty"`
10747	// Name - READ-ONLY; Resource name.
10748	Name *string `json:"name,omitempty"`
10749	// Type - READ-ONLY; Resource type for API Management resource.
10750	Type *string `json:"type,omitempty"`
10751}
10752
10753// MarshalJSON is the custom marshaler for PortalSigninSettings.
10754func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) {
10755	objectMap := make(map[string]interface{})
10756	if pss.PortalSigninSettingProperties != nil {
10757		objectMap["properties"] = pss.PortalSigninSettingProperties
10758	}
10759	return json.Marshal(objectMap)
10760}
10761
10762// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct.
10763func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error {
10764	var m map[string]*json.RawMessage
10765	err := json.Unmarshal(body, &m)
10766	if err != nil {
10767		return err
10768	}
10769	for k, v := range m {
10770		switch k {
10771		case "properties":
10772			if v != nil {
10773				var portalSigninSettingProperties PortalSigninSettingProperties
10774				err = json.Unmarshal(*v, &portalSigninSettingProperties)
10775				if err != nil {
10776					return err
10777				}
10778				pss.PortalSigninSettingProperties = &portalSigninSettingProperties
10779			}
10780		case "id":
10781			if v != nil {
10782				var ID string
10783				err = json.Unmarshal(*v, &ID)
10784				if err != nil {
10785					return err
10786				}
10787				pss.ID = &ID
10788			}
10789		case "name":
10790			if v != nil {
10791				var name string
10792				err = json.Unmarshal(*v, &name)
10793				if err != nil {
10794					return err
10795				}
10796				pss.Name = &name
10797			}
10798		case "type":
10799			if v != nil {
10800				var typeVar string
10801				err = json.Unmarshal(*v, &typeVar)
10802				if err != nil {
10803					return err
10804				}
10805				pss.Type = &typeVar
10806			}
10807		}
10808	}
10809
10810	return nil
10811}
10812
10813// PortalSignupSettings sign-Up settings for a developer portal.
10814type PortalSignupSettings struct {
10815	autorest.Response `json:"-"`
10816	// PortalSignupSettingsProperties - Sign-up settings contract properties.
10817	*PortalSignupSettingsProperties `json:"properties,omitempty"`
10818	// ID - READ-ONLY; Resource ID.
10819	ID *string `json:"id,omitempty"`
10820	// Name - READ-ONLY; Resource name.
10821	Name *string `json:"name,omitempty"`
10822	// Type - READ-ONLY; Resource type for API Management resource.
10823	Type *string `json:"type,omitempty"`
10824}
10825
10826// MarshalJSON is the custom marshaler for PortalSignupSettings.
10827func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) {
10828	objectMap := make(map[string]interface{})
10829	if pss.PortalSignupSettingsProperties != nil {
10830		objectMap["properties"] = pss.PortalSignupSettingsProperties
10831	}
10832	return json.Marshal(objectMap)
10833}
10834
10835// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct.
10836func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error {
10837	var m map[string]*json.RawMessage
10838	err := json.Unmarshal(body, &m)
10839	if err != nil {
10840		return err
10841	}
10842	for k, v := range m {
10843		switch k {
10844		case "properties":
10845			if v != nil {
10846				var portalSignupSettingsProperties PortalSignupSettingsProperties
10847				err = json.Unmarshal(*v, &portalSignupSettingsProperties)
10848				if err != nil {
10849					return err
10850				}
10851				pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties
10852			}
10853		case "id":
10854			if v != nil {
10855				var ID string
10856				err = json.Unmarshal(*v, &ID)
10857				if err != nil {
10858					return err
10859				}
10860				pss.ID = &ID
10861			}
10862		case "name":
10863			if v != nil {
10864				var name string
10865				err = json.Unmarshal(*v, &name)
10866				if err != nil {
10867					return err
10868				}
10869				pss.Name = &name
10870			}
10871		case "type":
10872			if v != nil {
10873				var typeVar string
10874				err = json.Unmarshal(*v, &typeVar)
10875				if err != nil {
10876					return err
10877				}
10878				pss.Type = &typeVar
10879			}
10880		}
10881	}
10882
10883	return nil
10884}
10885
10886// PortalSignupSettingsProperties sign-up settings contract properties.
10887type PortalSignupSettingsProperties struct {
10888	// Enabled - Allow users to sign up on a developer portal.
10889	Enabled *bool `json:"enabled,omitempty"`
10890	// TermsOfService - Terms of service contract properties.
10891	TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"`
10892}
10893
10894// ProductCollection paged Products list representation.
10895type ProductCollection struct {
10896	autorest.Response `json:"-"`
10897	// Value - Page values.
10898	Value *[]ProductContract `json:"value,omitempty"`
10899	// Count - Total record count number across all pages.
10900	Count *int64 `json:"count,omitempty"`
10901	// NextLink - Next page link if any.
10902	NextLink *string `json:"nextLink,omitempty"`
10903}
10904
10905// ProductCollectionIterator provides access to a complete listing of ProductContract values.
10906type ProductCollectionIterator struct {
10907	i    int
10908	page ProductCollectionPage
10909}
10910
10911// NextWithContext advances to the next value.  If there was an error making
10912// the request the iterator does not advance and the error is returned.
10913func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) {
10914	if tracing.IsEnabled() {
10915		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext")
10916		defer func() {
10917			sc := -1
10918			if iter.Response().Response.Response != nil {
10919				sc = iter.Response().Response.Response.StatusCode
10920			}
10921			tracing.EndSpan(ctx, sc, err)
10922		}()
10923	}
10924	iter.i++
10925	if iter.i < len(iter.page.Values()) {
10926		return nil
10927	}
10928	err = iter.page.NextWithContext(ctx)
10929	if err != nil {
10930		iter.i--
10931		return err
10932	}
10933	iter.i = 0
10934	return nil
10935}
10936
10937// Next advances to the next value.  If there was an error making
10938// the request the iterator does not advance and the error is returned.
10939// Deprecated: Use NextWithContext() instead.
10940func (iter *ProductCollectionIterator) Next() error {
10941	return iter.NextWithContext(context.Background())
10942}
10943
10944// NotDone returns true if the enumeration should be started or is not yet complete.
10945func (iter ProductCollectionIterator) NotDone() bool {
10946	return iter.page.NotDone() && iter.i < len(iter.page.Values())
10947}
10948
10949// Response returns the raw server response from the last page request.
10950func (iter ProductCollectionIterator) Response() ProductCollection {
10951	return iter.page.Response()
10952}
10953
10954// Value returns the current value or a zero-initialized value if the
10955// iterator has advanced beyond the end of the collection.
10956func (iter ProductCollectionIterator) Value() ProductContract {
10957	if !iter.page.NotDone() {
10958		return ProductContract{}
10959	}
10960	return iter.page.Values()[iter.i]
10961}
10962
10963// Creates a new instance of the ProductCollectionIterator type.
10964func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator {
10965	return ProductCollectionIterator{page: page}
10966}
10967
10968// IsEmpty returns true if the ListResult contains no values.
10969func (pc ProductCollection) IsEmpty() bool {
10970	return pc.Value == nil || len(*pc.Value) == 0
10971}
10972
10973// hasNextLink returns true if the NextLink is not empty.
10974func (pc ProductCollection) hasNextLink() bool {
10975	return pc.NextLink != nil && len(*pc.NextLink) != 0
10976}
10977
10978// productCollectionPreparer prepares a request to retrieve the next set of results.
10979// It returns nil if no more results exist.
10980func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) {
10981	if !pc.hasNextLink() {
10982		return nil, nil
10983	}
10984	return autorest.Prepare((&http.Request{}).WithContext(ctx),
10985		autorest.AsJSON(),
10986		autorest.AsGet(),
10987		autorest.WithBaseURL(to.String(pc.NextLink)))
10988}
10989
10990// ProductCollectionPage contains a page of ProductContract values.
10991type ProductCollectionPage struct {
10992	fn func(context.Context, ProductCollection) (ProductCollection, error)
10993	pc ProductCollection
10994}
10995
10996// NextWithContext advances to the next page of values.  If there was an error making
10997// the request the page does not advance and the error is returned.
10998func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) {
10999	if tracing.IsEnabled() {
11000		ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext")
11001		defer func() {
11002			sc := -1
11003			if page.Response().Response.Response != nil {
11004				sc = page.Response().Response.Response.StatusCode
11005			}
11006			tracing.EndSpan(ctx, sc, err)
11007		}()
11008	}
11009	for {
11010		next, err := page.fn(ctx, page.pc)
11011		if err != nil {
11012			return err
11013		}
11014		page.pc = next
11015		if !next.hasNextLink() || !next.IsEmpty() {
11016			break
11017		}
11018	}
11019	return nil
11020}
11021
11022// Next advances to the next page of values.  If there was an error making
11023// the request the page does not advance and the error is returned.
11024// Deprecated: Use NextWithContext() instead.
11025func (page *ProductCollectionPage) Next() error {
11026	return page.NextWithContext(context.Background())
11027}
11028
11029// NotDone returns true if the page enumeration should be started or is not yet complete.
11030func (page ProductCollectionPage) NotDone() bool {
11031	return !page.pc.IsEmpty()
11032}
11033
11034// Response returns the raw server response from the last page request.
11035func (page ProductCollectionPage) Response() ProductCollection {
11036	return page.pc
11037}
11038
11039// Values returns the slice of values for the current page or nil if there are no values.
11040func (page ProductCollectionPage) Values() []ProductContract {
11041	if page.pc.IsEmpty() {
11042		return nil
11043	}
11044	return *page.pc.Value
11045}
11046
11047// Creates a new instance of the ProductCollectionPage type.
11048func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage {
11049	return ProductCollectionPage{
11050		fn: getNextPage,
11051		pc: cur,
11052	}
11053}
11054
11055// ProductContract product details.
11056type ProductContract struct {
11057	autorest.Response `json:"-"`
11058	// ProductContractProperties - Product entity contract properties.
11059	*ProductContractProperties `json:"properties,omitempty"`
11060	// ID - READ-ONLY; Resource ID.
11061	ID *string `json:"id,omitempty"`
11062	// Name - READ-ONLY; Resource name.
11063	Name *string `json:"name,omitempty"`
11064	// Type - READ-ONLY; Resource type for API Management resource.
11065	Type *string `json:"type,omitempty"`
11066}
11067
11068// MarshalJSON is the custom marshaler for ProductContract.
11069func (pc ProductContract) MarshalJSON() ([]byte, error) {
11070	objectMap := make(map[string]interface{})
11071	if pc.ProductContractProperties != nil {
11072		objectMap["properties"] = pc.ProductContractProperties
11073	}
11074	return json.Marshal(objectMap)
11075}
11076
11077// UnmarshalJSON is the custom unmarshaler for ProductContract struct.
11078func (pc *ProductContract) UnmarshalJSON(body []byte) error {
11079	var m map[string]*json.RawMessage
11080	err := json.Unmarshal(body, &m)
11081	if err != nil {
11082		return err
11083	}
11084	for k, v := range m {
11085		switch k {
11086		case "properties":
11087			if v != nil {
11088				var productContractProperties ProductContractProperties
11089				err = json.Unmarshal(*v, &productContractProperties)
11090				if err != nil {
11091					return err
11092				}
11093				pc.ProductContractProperties = &productContractProperties
11094			}
11095		case "id":
11096			if v != nil {
11097				var ID string
11098				err = json.Unmarshal(*v, &ID)
11099				if err != nil {
11100					return err
11101				}
11102				pc.ID = &ID
11103			}
11104		case "name":
11105			if v != nil {
11106				var name string
11107				err = json.Unmarshal(*v, &name)
11108				if err != nil {
11109					return err
11110				}
11111				pc.Name = &name
11112			}
11113		case "type":
11114			if v != nil {
11115				var typeVar string
11116				err = json.Unmarshal(*v, &typeVar)
11117				if err != nil {
11118					return err
11119				}
11120				pc.Type = &typeVar
11121			}
11122		}
11123	}
11124
11125	return nil
11126}
11127
11128// ProductContractProperties product profile.
11129type ProductContractProperties struct {
11130	// DisplayName - Product name.
11131	DisplayName *string `json:"displayName,omitempty"`
11132	// Description - Product description. May include HTML formatting tags.
11133	Description *string `json:"description,omitempty"`
11134	// 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.
11135	Terms *string `json:"terms,omitempty"`
11136	// 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.
11137	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11138	// 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.
11139	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11140	// 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.
11141	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11142	// 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'
11143	State ProductState `json:"state,omitempty"`
11144}
11145
11146// ProductEntityBaseParameters product Entity Base Parameters
11147type ProductEntityBaseParameters struct {
11148	// Description - Product description. May include HTML formatting tags.
11149	Description *string `json:"description,omitempty"`
11150	// 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.
11151	Terms *string `json:"terms,omitempty"`
11152	// 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.
11153	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11154	// 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.
11155	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11156	// 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.
11157	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11158	// 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'
11159	State ProductState `json:"state,omitempty"`
11160}
11161
11162// ProductTagResourceContractProperties product profile.
11163type ProductTagResourceContractProperties struct {
11164	// ID - Identifier of the product in the form of /products/{productId}
11165	ID *string `json:"id,omitempty"`
11166	// Name - Product name.
11167	Name *string `json:"name,omitempty"`
11168	// Description - Product description. May include HTML formatting tags.
11169	Description *string `json:"description,omitempty"`
11170	// 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.
11171	Terms *string `json:"terms,omitempty"`
11172	// 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.
11173	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11174	// 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.
11175	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11176	// 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.
11177	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11178	// 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'
11179	State ProductState `json:"state,omitempty"`
11180}
11181
11182// ProductUpdateParameters product Update parameters.
11183type ProductUpdateParameters struct {
11184	// ProductUpdateProperties - Product entity Update contract properties.
11185	*ProductUpdateProperties `json:"properties,omitempty"`
11186}
11187
11188// MarshalJSON is the custom marshaler for ProductUpdateParameters.
11189func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) {
11190	objectMap := make(map[string]interface{})
11191	if pup.ProductUpdateProperties != nil {
11192		objectMap["properties"] = pup.ProductUpdateProperties
11193	}
11194	return json.Marshal(objectMap)
11195}
11196
11197// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct.
11198func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error {
11199	var m map[string]*json.RawMessage
11200	err := json.Unmarshal(body, &m)
11201	if err != nil {
11202		return err
11203	}
11204	for k, v := range m {
11205		switch k {
11206		case "properties":
11207			if v != nil {
11208				var productUpdateProperties ProductUpdateProperties
11209				err = json.Unmarshal(*v, &productUpdateProperties)
11210				if err != nil {
11211					return err
11212				}
11213				pup.ProductUpdateProperties = &productUpdateProperties
11214			}
11215		}
11216	}
11217
11218	return nil
11219}
11220
11221// ProductUpdateProperties parameters supplied to the Update Product operation.
11222type ProductUpdateProperties struct {
11223	// DisplayName - Product name.
11224	DisplayName *string `json:"displayName,omitempty"`
11225	// Description - Product description. May include HTML formatting tags.
11226	Description *string `json:"description,omitempty"`
11227	// 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.
11228	Terms *string `json:"terms,omitempty"`
11229	// 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.
11230	SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"`
11231	// 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.
11232	ApprovalRequired *bool `json:"approvalRequired,omitempty"`
11233	// 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.
11234	SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"`
11235	// 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'
11236	State ProductState `json:"state,omitempty"`
11237}
11238
11239// QuotaCounterCollection paged Quota Counter list representation.
11240type QuotaCounterCollection struct {
11241	autorest.Response `json:"-"`
11242	// Value - Quota counter values.
11243	Value *[]QuotaCounterContract `json:"value,omitempty"`
11244	// Count - Total record count number across all pages.
11245	Count *int64 `json:"count,omitempty"`
11246	// NextLink - Next page link if any.
11247	NextLink *string `json:"nextLink,omitempty"`
11248}
11249
11250// QuotaCounterContract quota counter details.
11251type QuotaCounterContract struct {
11252	autorest.Response `json:"-"`
11253	// CounterKey - The Key value of the Counter. Must not be empty.
11254	CounterKey *string `json:"counterKey,omitempty"`
11255	// PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty.
11256	PeriodKey *string `json:"periodKey,omitempty"`
11257	// 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.
11258	PeriodStartTime *date.Time `json:"periodStartTime,omitempty"`
11259	// 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.
11260	PeriodEndTime *date.Time `json:"periodEndTime,omitempty"`
11261	// Value - Quota Value Properties
11262	Value *QuotaCounterValueContractProperties `json:"value,omitempty"`
11263}
11264
11265// QuotaCounterValueContract quota counter value details.
11266type QuotaCounterValueContract struct {
11267	// QuotaCounterValueContractProperties - Quota counter Value Properties.
11268	*QuotaCounterValueContractProperties `json:"value,omitempty"`
11269}
11270
11271// MarshalJSON is the custom marshaler for QuotaCounterValueContract.
11272func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) {
11273	objectMap := make(map[string]interface{})
11274	if qcvc.QuotaCounterValueContractProperties != nil {
11275		objectMap["value"] = qcvc.QuotaCounterValueContractProperties
11276	}
11277	return json.Marshal(objectMap)
11278}
11279
11280// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct.
11281func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error {
11282	var m map[string]*json.RawMessage
11283	err := json.Unmarshal(body, &m)
11284	if err != nil {
11285		return err
11286	}
11287	for k, v := range m {
11288		switch k {
11289		case "value":
11290			if v != nil {
11291				var quotaCounterValueContractProperties QuotaCounterValueContractProperties
11292				err = json.Unmarshal(*v, &quotaCounterValueContractProperties)
11293				if err != nil {
11294					return err
11295				}
11296				qcvc.QuotaCounterValueContractProperties = &quotaCounterValueContractProperties
11297			}
11298		}
11299	}
11300
11301	return nil
11302}
11303
11304// QuotaCounterValueContractProperties quota counter value details.
11305type QuotaCounterValueContractProperties struct {
11306	// CallsCount - Number of times Counter was called.
11307	CallsCount *int32 `json:"callsCount,omitempty"`
11308	// KbTransferred - Data Transferred in KiloBytes.
11309	KbTransferred *float64 `json:"kbTransferred,omitempty"`
11310}
11311
11312// QuotaCounterValueUpdateContract quota counter value details.
11313type QuotaCounterValueUpdateContract struct {
11314	// QuotaCounterValueContractProperties - Quota counter value details.
11315	*QuotaCounterValueContractProperties `json:"properties,omitempty"`
11316}
11317
11318// MarshalJSON is the custom marshaler for QuotaCounterValueUpdateContract.
11319func (qcvuc QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) {
11320	objectMap := make(map[string]interface{})
11321	if qcvuc.QuotaCounterValueContractProperties != nil {
11322		objectMap["properties"] = qcvuc.QuotaCounterValueContractProperties
11323	}
11324	return json.Marshal(objectMap)
11325}
11326
11327// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueUpdateContract struct.
11328func (qcvuc *QuotaCounterValueUpdateContract) 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 "properties":
11337			if v != nil {
11338				var quotaCounterValueContractProperties QuotaCounterValueContractProperties
11339				err = json.Unmarshal(*v, &quotaCounterValueContractProperties)
11340				if err != nil {
11341					return err
11342				}
11343				qcvuc.QuotaCounterValueContractProperties = &quotaCounterValueContractProperties
11344			}
11345		}
11346	}
11347
11348	return nil
11349}
11350
11351// RecipientEmailCollection paged Recipient User list representation.
11352type RecipientEmailCollection struct {
11353	autorest.Response `json:"-"`
11354	// Value - Page values.
11355	Value *[]RecipientEmailContract `json:"value,omitempty"`
11356	// Count - Total record count number across all pages.
11357	Count *int64 `json:"count,omitempty"`
11358	// NextLink - Next page link if any.
11359	NextLink *string `json:"nextLink,omitempty"`
11360}
11361
11362// RecipientEmailContract recipient Email details.
11363type RecipientEmailContract struct {
11364	autorest.Response `json:"-"`
11365	// RecipientEmailContractProperties - Recipient Email contract properties.
11366	*RecipientEmailContractProperties `json:"properties,omitempty"`
11367	// ID - READ-ONLY; Resource ID.
11368	ID *string `json:"id,omitempty"`
11369	// Name - READ-ONLY; Resource name.
11370	Name *string `json:"name,omitempty"`
11371	// Type - READ-ONLY; Resource type for API Management resource.
11372	Type *string `json:"type,omitempty"`
11373}
11374
11375// MarshalJSON is the custom marshaler for RecipientEmailContract.
11376func (rec RecipientEmailContract) MarshalJSON() ([]byte, error) {
11377	objectMap := make(map[string]interface{})
11378	if rec.RecipientEmailContractProperties != nil {
11379		objectMap["properties"] = rec.RecipientEmailContractProperties
11380	}
11381	return json.Marshal(objectMap)
11382}
11383
11384// UnmarshalJSON is the custom unmarshaler for RecipientEmailContract struct.
11385func (rec *RecipientEmailContract) UnmarshalJSON(body []byte) error {
11386	var m map[string]*json.RawMessage
11387	err := json.Unmarshal(body, &m)
11388	if err != nil {
11389		return err
11390	}
11391	for k, v := range m {
11392		switch k {
11393		case "properties":
11394			if v != nil {
11395				var recipientEmailContractProperties RecipientEmailContractProperties
11396				err = json.Unmarshal(*v, &recipientEmailContractProperties)
11397				if err != nil {
11398					return err
11399				}
11400				rec.RecipientEmailContractProperties = &recipientEmailContractProperties
11401			}
11402		case "id":
11403			if v != nil {
11404				var ID string
11405				err = json.Unmarshal(*v, &ID)
11406				if err != nil {
11407					return err
11408				}
11409				rec.ID = &ID
11410			}
11411		case "name":
11412			if v != nil {
11413				var name string
11414				err = json.Unmarshal(*v, &name)
11415				if err != nil {
11416					return err
11417				}
11418				rec.Name = &name
11419			}
11420		case "type":
11421			if v != nil {
11422				var typeVar string
11423				err = json.Unmarshal(*v, &typeVar)
11424				if err != nil {
11425					return err
11426				}
11427				rec.Type = &typeVar
11428			}
11429		}
11430	}
11431
11432	return nil
11433}
11434
11435// RecipientEmailContractProperties recipient Email Contract Properties.
11436type RecipientEmailContractProperties struct {
11437	// Email - User Email subscribed to notification.
11438	Email *string `json:"email,omitempty"`
11439}
11440
11441// RecipientsContractProperties notification Parameter contract.
11442type RecipientsContractProperties struct {
11443	// Emails - List of Emails subscribed for the notification.
11444	Emails *[]string `json:"emails,omitempty"`
11445	// Users - List of Users subscribed for the notification.
11446	Users *[]string `json:"users,omitempty"`
11447}
11448
11449// RecipientUserCollection paged Recipient User list representation.
11450type RecipientUserCollection struct {
11451	autorest.Response `json:"-"`
11452	// Value - Page values.
11453	Value *[]RecipientUserContract `json:"value,omitempty"`
11454	// Count - Total record count number across all pages.
11455	Count *int64 `json:"count,omitempty"`
11456	// NextLink - Next page link if any.
11457	NextLink *string `json:"nextLink,omitempty"`
11458}
11459
11460// RecipientUserContract recipient User details.
11461type RecipientUserContract struct {
11462	autorest.Response `json:"-"`
11463	// RecipientUsersContractProperties - Recipient User entity contract properties.
11464	*RecipientUsersContractProperties `json:"properties,omitempty"`
11465	// ID - READ-ONLY; Resource ID.
11466	ID *string `json:"id,omitempty"`
11467	// Name - READ-ONLY; Resource name.
11468	Name *string `json:"name,omitempty"`
11469	// Type - READ-ONLY; Resource type for API Management resource.
11470	Type *string `json:"type,omitempty"`
11471}
11472
11473// MarshalJSON is the custom marshaler for RecipientUserContract.
11474func (ruc RecipientUserContract) MarshalJSON() ([]byte, error) {
11475	objectMap := make(map[string]interface{})
11476	if ruc.RecipientUsersContractProperties != nil {
11477		objectMap["properties"] = ruc.RecipientUsersContractProperties
11478	}
11479	return json.Marshal(objectMap)
11480}
11481
11482// UnmarshalJSON is the custom unmarshaler for RecipientUserContract struct.
11483func (ruc *RecipientUserContract) UnmarshalJSON(body []byte) error {
11484	var m map[string]*json.RawMessage
11485	err := json.Unmarshal(body, &m)
11486	if err != nil {
11487		return err
11488	}
11489	for k, v := range m {
11490		switch k {
11491		case "properties":
11492			if v != nil {
11493				var recipientUsersContractProperties RecipientUsersContractProperties
11494				err = json.Unmarshal(*v, &recipientUsersContractProperties)
11495				if err != nil {
11496					return err
11497				}
11498				ruc.RecipientUsersContractProperties = &recipientUsersContractProperties
11499			}
11500		case "id":
11501			if v != nil {
11502				var ID string
11503				err = json.Unmarshal(*v, &ID)
11504				if err != nil {
11505					return err
11506				}
11507				ruc.ID = &ID
11508			}
11509		case "name":
11510			if v != nil {
11511				var name string
11512				err = json.Unmarshal(*v, &name)
11513				if err != nil {
11514					return err
11515				}
11516				ruc.Name = &name
11517			}
11518		case "type":
11519			if v != nil {
11520				var typeVar string
11521				err = json.Unmarshal(*v, &typeVar)
11522				if err != nil {
11523					return err
11524				}
11525				ruc.Type = &typeVar
11526			}
11527		}
11528	}
11529
11530	return nil
11531}
11532
11533// RecipientUsersContractProperties recipient User Contract Properties.
11534type RecipientUsersContractProperties struct {
11535	// UserID - API Management UserId subscribed to notification.
11536	UserID *string `json:"userId,omitempty"`
11537}
11538
11539// RegionContract region profile.
11540type RegionContract struct {
11541	// Name - READ-ONLY; Region name.
11542	Name *string `json:"name,omitempty"`
11543	// IsMasterRegion - whether Region is the master region.
11544	IsMasterRegion *bool `json:"isMasterRegion,omitempty"`
11545	// IsDeleted - whether Region is deleted.
11546	IsDeleted *bool `json:"isDeleted,omitempty"`
11547}
11548
11549// MarshalJSON is the custom marshaler for RegionContract.
11550func (rc RegionContract) MarshalJSON() ([]byte, error) {
11551	objectMap := make(map[string]interface{})
11552	if rc.IsMasterRegion != nil {
11553		objectMap["isMasterRegion"] = rc.IsMasterRegion
11554	}
11555	if rc.IsDeleted != nil {
11556		objectMap["isDeleted"] = rc.IsDeleted
11557	}
11558	return json.Marshal(objectMap)
11559}
11560
11561// RegionListResult lists Regions operation response details.
11562type RegionListResult struct {
11563	autorest.Response `json:"-"`
11564	// Value - Lists of Regions.
11565	Value *[]RegionContract `json:"value,omitempty"`
11566	// Count - Total record count number across all pages.
11567	Count *int64 `json:"count,omitempty"`
11568	// NextLink - Next page link if any.
11569	NextLink *string `json:"nextLink,omitempty"`
11570}
11571
11572// RegionListResultIterator provides access to a complete listing of RegionContract values.
11573type RegionListResultIterator struct {
11574	i    int
11575	page RegionListResultPage
11576}
11577
11578// NextWithContext advances to the next value.  If there was an error making
11579// the request the iterator does not advance and the error is returned.
11580func (iter *RegionListResultIterator) NextWithContext(ctx context.Context) (err error) {
11581	if tracing.IsEnabled() {
11582		ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultIterator.NextWithContext")
11583		defer func() {
11584			sc := -1
11585			if iter.Response().Response.Response != nil {
11586				sc = iter.Response().Response.Response.StatusCode
11587			}
11588			tracing.EndSpan(ctx, sc, err)
11589		}()
11590	}
11591	iter.i++
11592	if iter.i < len(iter.page.Values()) {
11593		return nil
11594	}
11595	err = iter.page.NextWithContext(ctx)
11596	if err != nil {
11597		iter.i--
11598		return err
11599	}
11600	iter.i = 0
11601	return nil
11602}
11603
11604// Next advances to the next value.  If there was an error making
11605// the request the iterator does not advance and the error is returned.
11606// Deprecated: Use NextWithContext() instead.
11607func (iter *RegionListResultIterator) Next() error {
11608	return iter.NextWithContext(context.Background())
11609}
11610
11611// NotDone returns true if the enumeration should be started or is not yet complete.
11612func (iter RegionListResultIterator) NotDone() bool {
11613	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11614}
11615
11616// Response returns the raw server response from the last page request.
11617func (iter RegionListResultIterator) Response() RegionListResult {
11618	return iter.page.Response()
11619}
11620
11621// Value returns the current value or a zero-initialized value if the
11622// iterator has advanced beyond the end of the collection.
11623func (iter RegionListResultIterator) Value() RegionContract {
11624	if !iter.page.NotDone() {
11625		return RegionContract{}
11626	}
11627	return iter.page.Values()[iter.i]
11628}
11629
11630// Creates a new instance of the RegionListResultIterator type.
11631func NewRegionListResultIterator(page RegionListResultPage) RegionListResultIterator {
11632	return RegionListResultIterator{page: page}
11633}
11634
11635// IsEmpty returns true if the ListResult contains no values.
11636func (rlr RegionListResult) IsEmpty() bool {
11637	return rlr.Value == nil || len(*rlr.Value) == 0
11638}
11639
11640// hasNextLink returns true if the NextLink is not empty.
11641func (rlr RegionListResult) hasNextLink() bool {
11642	return rlr.NextLink != nil && len(*rlr.NextLink) != 0
11643}
11644
11645// regionListResultPreparer prepares a request to retrieve the next set of results.
11646// It returns nil if no more results exist.
11647func (rlr RegionListResult) regionListResultPreparer(ctx context.Context) (*http.Request, error) {
11648	if !rlr.hasNextLink() {
11649		return nil, nil
11650	}
11651	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11652		autorest.AsJSON(),
11653		autorest.AsGet(),
11654		autorest.WithBaseURL(to.String(rlr.NextLink)))
11655}
11656
11657// RegionListResultPage contains a page of RegionContract values.
11658type RegionListResultPage struct {
11659	fn  func(context.Context, RegionListResult) (RegionListResult, error)
11660	rlr RegionListResult
11661}
11662
11663// NextWithContext advances to the next page of values.  If there was an error making
11664// the request the page does not advance and the error is returned.
11665func (page *RegionListResultPage) NextWithContext(ctx context.Context) (err error) {
11666	if tracing.IsEnabled() {
11667		ctx = tracing.StartSpan(ctx, fqdn+"/RegionListResultPage.NextWithContext")
11668		defer func() {
11669			sc := -1
11670			if page.Response().Response.Response != nil {
11671				sc = page.Response().Response.Response.StatusCode
11672			}
11673			tracing.EndSpan(ctx, sc, err)
11674		}()
11675	}
11676	for {
11677		next, err := page.fn(ctx, page.rlr)
11678		if err != nil {
11679			return err
11680		}
11681		page.rlr = next
11682		if !next.hasNextLink() || !next.IsEmpty() {
11683			break
11684		}
11685	}
11686	return nil
11687}
11688
11689// Next advances to the next page of values.  If there was an error making
11690// the request the page does not advance and the error is returned.
11691// Deprecated: Use NextWithContext() instead.
11692func (page *RegionListResultPage) Next() error {
11693	return page.NextWithContext(context.Background())
11694}
11695
11696// NotDone returns true if the page enumeration should be started or is not yet complete.
11697func (page RegionListResultPage) NotDone() bool {
11698	return !page.rlr.IsEmpty()
11699}
11700
11701// Response returns the raw server response from the last page request.
11702func (page RegionListResultPage) Response() RegionListResult {
11703	return page.rlr
11704}
11705
11706// Values returns the slice of values for the current page or nil if there are no values.
11707func (page RegionListResultPage) Values() []RegionContract {
11708	if page.rlr.IsEmpty() {
11709		return nil
11710	}
11711	return *page.rlr.Value
11712}
11713
11714// Creates a new instance of the RegionListResultPage type.
11715func NewRegionListResultPage(cur RegionListResult, getNextPage func(context.Context, RegionListResult) (RegionListResult, error)) RegionListResultPage {
11716	return RegionListResultPage{
11717		fn:  getNextPage,
11718		rlr: cur,
11719	}
11720}
11721
11722// RegistrationDelegationSettingsProperties user registration delegation settings properties.
11723type RegistrationDelegationSettingsProperties struct {
11724	// Enabled - Enable or disable delegation for user registration.
11725	Enabled *bool `json:"enabled,omitempty"`
11726}
11727
11728// ReportCollection paged Report records list representation.
11729type ReportCollection struct {
11730	autorest.Response `json:"-"`
11731	// Value - Page values.
11732	Value *[]ReportRecordContract `json:"value,omitempty"`
11733	// Count - Total record count number across all pages.
11734	Count *int64 `json:"count,omitempty"`
11735	// NextLink - Next page link if any.
11736	NextLink *string `json:"nextLink,omitempty"`
11737}
11738
11739// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values.
11740type ReportCollectionIterator struct {
11741	i    int
11742	page ReportCollectionPage
11743}
11744
11745// NextWithContext advances to the next value.  If there was an error making
11746// the request the iterator does not advance and the error is returned.
11747func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) {
11748	if tracing.IsEnabled() {
11749		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext")
11750		defer func() {
11751			sc := -1
11752			if iter.Response().Response.Response != nil {
11753				sc = iter.Response().Response.Response.StatusCode
11754			}
11755			tracing.EndSpan(ctx, sc, err)
11756		}()
11757	}
11758	iter.i++
11759	if iter.i < len(iter.page.Values()) {
11760		return nil
11761	}
11762	err = iter.page.NextWithContext(ctx)
11763	if err != nil {
11764		iter.i--
11765		return err
11766	}
11767	iter.i = 0
11768	return nil
11769}
11770
11771// Next advances to the next value.  If there was an error making
11772// the request the iterator does not advance and the error is returned.
11773// Deprecated: Use NextWithContext() instead.
11774func (iter *ReportCollectionIterator) Next() error {
11775	return iter.NextWithContext(context.Background())
11776}
11777
11778// NotDone returns true if the enumeration should be started or is not yet complete.
11779func (iter ReportCollectionIterator) NotDone() bool {
11780	return iter.page.NotDone() && iter.i < len(iter.page.Values())
11781}
11782
11783// Response returns the raw server response from the last page request.
11784func (iter ReportCollectionIterator) Response() ReportCollection {
11785	return iter.page.Response()
11786}
11787
11788// Value returns the current value or a zero-initialized value if the
11789// iterator has advanced beyond the end of the collection.
11790func (iter ReportCollectionIterator) Value() ReportRecordContract {
11791	if !iter.page.NotDone() {
11792		return ReportRecordContract{}
11793	}
11794	return iter.page.Values()[iter.i]
11795}
11796
11797// Creates a new instance of the ReportCollectionIterator type.
11798func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator {
11799	return ReportCollectionIterator{page: page}
11800}
11801
11802// IsEmpty returns true if the ListResult contains no values.
11803func (rc ReportCollection) IsEmpty() bool {
11804	return rc.Value == nil || len(*rc.Value) == 0
11805}
11806
11807// hasNextLink returns true if the NextLink is not empty.
11808func (rc ReportCollection) hasNextLink() bool {
11809	return rc.NextLink != nil && len(*rc.NextLink) != 0
11810}
11811
11812// reportCollectionPreparer prepares a request to retrieve the next set of results.
11813// It returns nil if no more results exist.
11814func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) {
11815	if !rc.hasNextLink() {
11816		return nil, nil
11817	}
11818	return autorest.Prepare((&http.Request{}).WithContext(ctx),
11819		autorest.AsJSON(),
11820		autorest.AsGet(),
11821		autorest.WithBaseURL(to.String(rc.NextLink)))
11822}
11823
11824// ReportCollectionPage contains a page of ReportRecordContract values.
11825type ReportCollectionPage struct {
11826	fn func(context.Context, ReportCollection) (ReportCollection, error)
11827	rc ReportCollection
11828}
11829
11830// NextWithContext advances to the next page of values.  If there was an error making
11831// the request the page does not advance and the error is returned.
11832func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) {
11833	if tracing.IsEnabled() {
11834		ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext")
11835		defer func() {
11836			sc := -1
11837			if page.Response().Response.Response != nil {
11838				sc = page.Response().Response.Response.StatusCode
11839			}
11840			tracing.EndSpan(ctx, sc, err)
11841		}()
11842	}
11843	for {
11844		next, err := page.fn(ctx, page.rc)
11845		if err != nil {
11846			return err
11847		}
11848		page.rc = next
11849		if !next.hasNextLink() || !next.IsEmpty() {
11850			break
11851		}
11852	}
11853	return nil
11854}
11855
11856// Next advances to the next page of values.  If there was an error making
11857// the request the page does not advance and the error is returned.
11858// Deprecated: Use NextWithContext() instead.
11859func (page *ReportCollectionPage) Next() error {
11860	return page.NextWithContext(context.Background())
11861}
11862
11863// NotDone returns true if the page enumeration should be started or is not yet complete.
11864func (page ReportCollectionPage) NotDone() bool {
11865	return !page.rc.IsEmpty()
11866}
11867
11868// Response returns the raw server response from the last page request.
11869func (page ReportCollectionPage) Response() ReportCollection {
11870	return page.rc
11871}
11872
11873// Values returns the slice of values for the current page or nil if there are no values.
11874func (page ReportCollectionPage) Values() []ReportRecordContract {
11875	if page.rc.IsEmpty() {
11876		return nil
11877	}
11878	return *page.rc.Value
11879}
11880
11881// Creates a new instance of the ReportCollectionPage type.
11882func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage {
11883	return ReportCollectionPage{
11884		fn: getNextPage,
11885		rc: cur,
11886	}
11887}
11888
11889// ReportRecordContract report data.
11890type ReportRecordContract struct {
11891	// Name - Name depending on report endpoint specifies product, API, operation or developer name.
11892	Name *string `json:"name,omitempty"`
11893	// Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
11894	Timestamp *date.Time `json:"timestamp,omitempty"`
11895	// 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).
11896	Interval *string `json:"interval,omitempty"`
11897	// Country - Country to which this record data is related.
11898	Country *string `json:"country,omitempty"`
11899	// Region - Country region to which this record data is related.
11900	Region *string `json:"region,omitempty"`
11901	// Zip - Zip code to which this record data is related.
11902	Zip *string `json:"zip,omitempty"`
11903	// UserID - READ-ONLY; User identifier path. /users/{userId}
11904	UserID *string `json:"userId,omitempty"`
11905	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
11906	ProductID *string `json:"productId,omitempty"`
11907	// APIID - API identifier path. /apis/{apiId}
11908	APIID *string `json:"apiId,omitempty"`
11909	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
11910	OperationID *string `json:"operationId,omitempty"`
11911	// APIRegion - API region identifier.
11912	APIRegion *string `json:"apiRegion,omitempty"`
11913	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
11914	SubscriptionID *string `json:"subscriptionId,omitempty"`
11915	// CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect
11916	CallCountSuccess *int32 `json:"callCountSuccess,omitempty"`
11917	// CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests
11918	CallCountBlocked *int32 `json:"callCountBlocked,omitempty"`
11919	// 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
11920	CallCountFailed *int32 `json:"callCountFailed,omitempty"`
11921	// CallCountOther - Number of other calls.
11922	CallCountOther *int32 `json:"callCountOther,omitempty"`
11923	// CallCountTotal - Total number of calls.
11924	CallCountTotal *int32 `json:"callCountTotal,omitempty"`
11925	// Bandwidth - Bandwidth consumed.
11926	Bandwidth *int64 `json:"bandwidth,omitempty"`
11927	// CacheHitCount - Number of times when content was served from cache policy.
11928	CacheHitCount *int32 `json:"cacheHitCount,omitempty"`
11929	// CacheMissCount - Number of times content was fetched from backend.
11930	CacheMissCount *int32 `json:"cacheMissCount,omitempty"`
11931	// APITimeAvg - Average time it took to process request.
11932	APITimeAvg *float64 `json:"apiTimeAvg,omitempty"`
11933	// APITimeMin - Minimum time it took to process request.
11934	APITimeMin *float64 `json:"apiTimeMin,omitempty"`
11935	// APITimeMax - Maximum time it took to process request.
11936	APITimeMax *float64 `json:"apiTimeMax,omitempty"`
11937	// ServiceTimeAvg - Average time it took to process request on backend.
11938	ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"`
11939	// ServiceTimeMin - Minimum time it took to process request on backend.
11940	ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"`
11941	// ServiceTimeMax - Maximum time it took to process request on backend.
11942	ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"`
11943}
11944
11945// MarshalJSON is the custom marshaler for ReportRecordContract.
11946func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) {
11947	objectMap := make(map[string]interface{})
11948	if rrc.Name != nil {
11949		objectMap["name"] = rrc.Name
11950	}
11951	if rrc.Timestamp != nil {
11952		objectMap["timestamp"] = rrc.Timestamp
11953	}
11954	if rrc.Interval != nil {
11955		objectMap["interval"] = rrc.Interval
11956	}
11957	if rrc.Country != nil {
11958		objectMap["country"] = rrc.Country
11959	}
11960	if rrc.Region != nil {
11961		objectMap["region"] = rrc.Region
11962	}
11963	if rrc.Zip != nil {
11964		objectMap["zip"] = rrc.Zip
11965	}
11966	if rrc.APIID != nil {
11967		objectMap["apiId"] = rrc.APIID
11968	}
11969	if rrc.OperationID != nil {
11970		objectMap["operationId"] = rrc.OperationID
11971	}
11972	if rrc.APIRegion != nil {
11973		objectMap["apiRegion"] = rrc.APIRegion
11974	}
11975	if rrc.SubscriptionID != nil {
11976		objectMap["subscriptionId"] = rrc.SubscriptionID
11977	}
11978	if rrc.CallCountSuccess != nil {
11979		objectMap["callCountSuccess"] = rrc.CallCountSuccess
11980	}
11981	if rrc.CallCountBlocked != nil {
11982		objectMap["callCountBlocked"] = rrc.CallCountBlocked
11983	}
11984	if rrc.CallCountFailed != nil {
11985		objectMap["callCountFailed"] = rrc.CallCountFailed
11986	}
11987	if rrc.CallCountOther != nil {
11988		objectMap["callCountOther"] = rrc.CallCountOther
11989	}
11990	if rrc.CallCountTotal != nil {
11991		objectMap["callCountTotal"] = rrc.CallCountTotal
11992	}
11993	if rrc.Bandwidth != nil {
11994		objectMap["bandwidth"] = rrc.Bandwidth
11995	}
11996	if rrc.CacheHitCount != nil {
11997		objectMap["cacheHitCount"] = rrc.CacheHitCount
11998	}
11999	if rrc.CacheMissCount != nil {
12000		objectMap["cacheMissCount"] = rrc.CacheMissCount
12001	}
12002	if rrc.APITimeAvg != nil {
12003		objectMap["apiTimeAvg"] = rrc.APITimeAvg
12004	}
12005	if rrc.APITimeMin != nil {
12006		objectMap["apiTimeMin"] = rrc.APITimeMin
12007	}
12008	if rrc.APITimeMax != nil {
12009		objectMap["apiTimeMax"] = rrc.APITimeMax
12010	}
12011	if rrc.ServiceTimeAvg != nil {
12012		objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg
12013	}
12014	if rrc.ServiceTimeMin != nil {
12015		objectMap["serviceTimeMin"] = rrc.ServiceTimeMin
12016	}
12017	if rrc.ServiceTimeMax != nil {
12018		objectMap["serviceTimeMax"] = rrc.ServiceTimeMax
12019	}
12020	return json.Marshal(objectMap)
12021}
12022
12023// RepresentationContract operation request/response representation details.
12024type RepresentationContract struct {
12025	// ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml.
12026	ContentType *string `json:"contentType,omitempty"`
12027	// Sample - An example of the representation.
12028	Sample *string `json:"sample,omitempty"`
12029	// SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
12030	SchemaID *string `json:"schemaId,omitempty"`
12031	// TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
12032	TypeName *string `json:"typeName,omitempty"`
12033	// FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
12034	FormParameters *[]ParameterContract `json:"formParameters,omitempty"`
12035}
12036
12037// RequestContract operation request details.
12038type RequestContract struct {
12039	// Description - Operation request description.
12040	Description *string `json:"description,omitempty"`
12041	// QueryParameters - Collection of operation request query parameters.
12042	QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"`
12043	// Headers - Collection of operation request headers.
12044	Headers *[]ParameterContract `json:"headers,omitempty"`
12045	// Representations - Collection of operation request representations.
12046	Representations *[]RepresentationContract `json:"representations,omitempty"`
12047}
12048
12049// RequestReportCollection paged Report records list representation.
12050type RequestReportCollection struct {
12051	autorest.Response `json:"-"`
12052	// Value - Page values.
12053	Value *[]RequestReportRecordContract `json:"value,omitempty"`
12054	// Count - Total record count number across all pages.
12055	Count *int64 `json:"count,omitempty"`
12056}
12057
12058// RequestReportRecordContract request Report data.
12059type RequestReportRecordContract struct {
12060	// APIID - API identifier path. /apis/{apiId}
12061	APIID *string `json:"apiId,omitempty"`
12062	// OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId}
12063	OperationID *string `json:"operationId,omitempty"`
12064	// ProductID - READ-ONLY; Product identifier path. /products/{productId}
12065	ProductID *string `json:"productId,omitempty"`
12066	// UserID - READ-ONLY; User identifier path. /users/{userId}
12067	UserID *string `json:"userId,omitempty"`
12068	// Method - The HTTP method associated with this request..
12069	Method *string `json:"method,omitempty"`
12070	// URL - The full URL associated with this request.
12071	URL *string `json:"url,omitempty"`
12072	// IPAddress - The client IP address associated with this request.
12073	IPAddress *string `json:"ipAddress,omitempty"`
12074	// BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend.
12075	BackendResponseCode *string `json:"backendResponseCode,omitempty"`
12076	// ResponseCode - The HTTP status code returned by the gateway.
12077	ResponseCode *int32 `json:"responseCode,omitempty"`
12078	// ResponseSize - The size of the response returned by the gateway.
12079	ResponseSize *int32 `json:"responseSize,omitempty"`
12080	// Timestamp - The date and time when this request was received by the gateway in ISO 8601 format.
12081	Timestamp *date.Time `json:"timestamp,omitempty"`
12082	// 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.
12083	Cache *string `json:"cache,omitempty"`
12084	// APITime - The total time it took to process this request.
12085	APITime *float64 `json:"apiTime,omitempty"`
12086	// ServiceTime - he time it took to forward this request to the backend and get the response back.
12087	ServiceTime *float64 `json:"serviceTime,omitempty"`
12088	// APIRegion - Azure region where the gateway that processed this request is located.
12089	APIRegion *string `json:"apiRegion,omitempty"`
12090	// SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId}
12091	SubscriptionID *string `json:"subscriptionId,omitempty"`
12092	// RequestID - Request Identifier.
12093	RequestID *string `json:"requestId,omitempty"`
12094	// RequestSize - The size of this request..
12095	RequestSize *int32 `json:"requestSize,omitempty"`
12096}
12097
12098// MarshalJSON is the custom marshaler for RequestReportRecordContract.
12099func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) {
12100	objectMap := make(map[string]interface{})
12101	if rrrc.APIID != nil {
12102		objectMap["apiId"] = rrrc.APIID
12103	}
12104	if rrrc.OperationID != nil {
12105		objectMap["operationId"] = rrrc.OperationID
12106	}
12107	if rrrc.Method != nil {
12108		objectMap["method"] = rrrc.Method
12109	}
12110	if rrrc.URL != nil {
12111		objectMap["url"] = rrrc.URL
12112	}
12113	if rrrc.IPAddress != nil {
12114		objectMap["ipAddress"] = rrrc.IPAddress
12115	}
12116	if rrrc.BackendResponseCode != nil {
12117		objectMap["backendResponseCode"] = rrrc.BackendResponseCode
12118	}
12119	if rrrc.ResponseCode != nil {
12120		objectMap["responseCode"] = rrrc.ResponseCode
12121	}
12122	if rrrc.ResponseSize != nil {
12123		objectMap["responseSize"] = rrrc.ResponseSize
12124	}
12125	if rrrc.Timestamp != nil {
12126		objectMap["timestamp"] = rrrc.Timestamp
12127	}
12128	if rrrc.Cache != nil {
12129		objectMap["cache"] = rrrc.Cache
12130	}
12131	if rrrc.APITime != nil {
12132		objectMap["apiTime"] = rrrc.APITime
12133	}
12134	if rrrc.ServiceTime != nil {
12135		objectMap["serviceTime"] = rrrc.ServiceTime
12136	}
12137	if rrrc.APIRegion != nil {
12138		objectMap["apiRegion"] = rrrc.APIRegion
12139	}
12140	if rrrc.SubscriptionID != nil {
12141		objectMap["subscriptionId"] = rrrc.SubscriptionID
12142	}
12143	if rrrc.RequestID != nil {
12144		objectMap["requestId"] = rrrc.RequestID
12145	}
12146	if rrrc.RequestSize != nil {
12147		objectMap["requestSize"] = rrrc.RequestSize
12148	}
12149	return json.Marshal(objectMap)
12150}
12151
12152// Resource the Resource definition.
12153type Resource struct {
12154	// ID - READ-ONLY; Resource ID.
12155	ID *string `json:"id,omitempty"`
12156	// Name - READ-ONLY; Resource name.
12157	Name *string `json:"name,omitempty"`
12158	// Type - READ-ONLY; Resource type for API Management resource.
12159	Type *string `json:"type,omitempty"`
12160}
12161
12162// MarshalJSON is the custom marshaler for Resource.
12163func (r Resource) MarshalJSON() ([]byte, error) {
12164	objectMap := make(map[string]interface{})
12165	return json.Marshal(objectMap)
12166}
12167
12168// ResourceLocationDataContract resource location data properties.
12169type ResourceLocationDataContract struct {
12170	// Name - A canonical name for the geographic or physical location.
12171	Name *string `json:"name,omitempty"`
12172	// City - The city or locality where the resource is located.
12173	City *string `json:"city,omitempty"`
12174	// District - The district, state, or province where the resource is located.
12175	District *string `json:"district,omitempty"`
12176	// CountryOrRegion - The country or region where the resource is located.
12177	CountryOrRegion *string `json:"countryOrRegion,omitempty"`
12178}
12179
12180// ResourceSku describes an available API Management SKU.
12181type ResourceSku struct {
12182	// Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated'
12183	Name SkuType `json:"name,omitempty"`
12184}
12185
12186// ResourceSkuCapacity describes scaling information of a SKU.
12187type ResourceSkuCapacity struct {
12188	// Minimum - READ-ONLY; The minimum capacity.
12189	Minimum *int32 `json:"minimum,omitempty"`
12190	// Maximum - READ-ONLY; The maximum capacity that can be set.
12191	Maximum *int32 `json:"maximum,omitempty"`
12192	// Default - READ-ONLY; The default capacity.
12193	Default *int32 `json:"default,omitempty"`
12194	// ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone'
12195	ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"`
12196}
12197
12198// MarshalJSON is the custom marshaler for ResourceSkuCapacity.
12199func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) {
12200	objectMap := make(map[string]interface{})
12201	return json.Marshal(objectMap)
12202}
12203
12204// ResourceSkuResult describes an available API Management service SKU.
12205type ResourceSkuResult struct {
12206	// ResourceType - READ-ONLY; The type of resource the SKU applies to.
12207	ResourceType *string `json:"resourceType,omitempty"`
12208	// Sku - READ-ONLY; Specifies API Management SKU.
12209	Sku *ResourceSku `json:"sku,omitempty"`
12210	// Capacity - READ-ONLY; Specifies the number of API Management units.
12211	Capacity *ResourceSkuCapacity `json:"capacity,omitempty"`
12212}
12213
12214// MarshalJSON is the custom marshaler for ResourceSkuResult.
12215func (rsr ResourceSkuResult) MarshalJSON() ([]byte, error) {
12216	objectMap := make(map[string]interface{})
12217	return json.Marshal(objectMap)
12218}
12219
12220// ResourceSkuResults the API Management service SKUs operation response.
12221type ResourceSkuResults struct {
12222	autorest.Response `json:"-"`
12223	// Value - The list of skus available for the service.
12224	Value *[]ResourceSkuResult `json:"value,omitempty"`
12225	// NextLink - The uri to fetch the next page of API Management service Skus.
12226	NextLink *string `json:"nextLink,omitempty"`
12227}
12228
12229// ResourceSkuResultsIterator provides access to a complete listing of ResourceSkuResult values.
12230type ResourceSkuResultsIterator struct {
12231	i    int
12232	page ResourceSkuResultsPage
12233}
12234
12235// NextWithContext advances to the next value.  If there was an error making
12236// the request the iterator does not advance and the error is returned.
12237func (iter *ResourceSkuResultsIterator) NextWithContext(ctx context.Context) (err error) {
12238	if tracing.IsEnabled() {
12239		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsIterator.NextWithContext")
12240		defer func() {
12241			sc := -1
12242			if iter.Response().Response.Response != nil {
12243				sc = iter.Response().Response.Response.StatusCode
12244			}
12245			tracing.EndSpan(ctx, sc, err)
12246		}()
12247	}
12248	iter.i++
12249	if iter.i < len(iter.page.Values()) {
12250		return nil
12251	}
12252	err = iter.page.NextWithContext(ctx)
12253	if err != nil {
12254		iter.i--
12255		return err
12256	}
12257	iter.i = 0
12258	return nil
12259}
12260
12261// Next advances to the next value.  If there was an error making
12262// the request the iterator does not advance and the error is returned.
12263// Deprecated: Use NextWithContext() instead.
12264func (iter *ResourceSkuResultsIterator) Next() error {
12265	return iter.NextWithContext(context.Background())
12266}
12267
12268// NotDone returns true if the enumeration should be started or is not yet complete.
12269func (iter ResourceSkuResultsIterator) NotDone() bool {
12270	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12271}
12272
12273// Response returns the raw server response from the last page request.
12274func (iter ResourceSkuResultsIterator) Response() ResourceSkuResults {
12275	return iter.page.Response()
12276}
12277
12278// Value returns the current value or a zero-initialized value if the
12279// iterator has advanced beyond the end of the collection.
12280func (iter ResourceSkuResultsIterator) Value() ResourceSkuResult {
12281	if !iter.page.NotDone() {
12282		return ResourceSkuResult{}
12283	}
12284	return iter.page.Values()[iter.i]
12285}
12286
12287// Creates a new instance of the ResourceSkuResultsIterator type.
12288func NewResourceSkuResultsIterator(page ResourceSkuResultsPage) ResourceSkuResultsIterator {
12289	return ResourceSkuResultsIterator{page: page}
12290}
12291
12292// IsEmpty returns true if the ListResult contains no values.
12293func (rsr ResourceSkuResults) IsEmpty() bool {
12294	return rsr.Value == nil || len(*rsr.Value) == 0
12295}
12296
12297// hasNextLink returns true if the NextLink is not empty.
12298func (rsr ResourceSkuResults) hasNextLink() bool {
12299	return rsr.NextLink != nil && len(*rsr.NextLink) != 0
12300}
12301
12302// resourceSkuResultsPreparer prepares a request to retrieve the next set of results.
12303// It returns nil if no more results exist.
12304func (rsr ResourceSkuResults) resourceSkuResultsPreparer(ctx context.Context) (*http.Request, error) {
12305	if !rsr.hasNextLink() {
12306		return nil, nil
12307	}
12308	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12309		autorest.AsJSON(),
12310		autorest.AsGet(),
12311		autorest.WithBaseURL(to.String(rsr.NextLink)))
12312}
12313
12314// ResourceSkuResultsPage contains a page of ResourceSkuResult values.
12315type ResourceSkuResultsPage struct {
12316	fn  func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)
12317	rsr ResourceSkuResults
12318}
12319
12320// NextWithContext advances to the next page of values.  If there was an error making
12321// the request the page does not advance and the error is returned.
12322func (page *ResourceSkuResultsPage) NextWithContext(ctx context.Context) (err error) {
12323	if tracing.IsEnabled() {
12324		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuResultsPage.NextWithContext")
12325		defer func() {
12326			sc := -1
12327			if page.Response().Response.Response != nil {
12328				sc = page.Response().Response.Response.StatusCode
12329			}
12330			tracing.EndSpan(ctx, sc, err)
12331		}()
12332	}
12333	for {
12334		next, err := page.fn(ctx, page.rsr)
12335		if err != nil {
12336			return err
12337		}
12338		page.rsr = next
12339		if !next.hasNextLink() || !next.IsEmpty() {
12340			break
12341		}
12342	}
12343	return nil
12344}
12345
12346// Next advances to the next page of values.  If there was an error making
12347// the request the page does not advance and the error is returned.
12348// Deprecated: Use NextWithContext() instead.
12349func (page *ResourceSkuResultsPage) Next() error {
12350	return page.NextWithContext(context.Background())
12351}
12352
12353// NotDone returns true if the page enumeration should be started or is not yet complete.
12354func (page ResourceSkuResultsPage) NotDone() bool {
12355	return !page.rsr.IsEmpty()
12356}
12357
12358// Response returns the raw server response from the last page request.
12359func (page ResourceSkuResultsPage) Response() ResourceSkuResults {
12360	return page.rsr
12361}
12362
12363// Values returns the slice of values for the current page or nil if there are no values.
12364func (page ResourceSkuResultsPage) Values() []ResourceSkuResult {
12365	if page.rsr.IsEmpty() {
12366		return nil
12367	}
12368	return *page.rsr.Value
12369}
12370
12371// Creates a new instance of the ResourceSkuResultsPage type.
12372func NewResourceSkuResultsPage(cur ResourceSkuResults, getNextPage func(context.Context, ResourceSkuResults) (ResourceSkuResults, error)) ResourceSkuResultsPage {
12373	return ResourceSkuResultsPage{
12374		fn:  getNextPage,
12375		rsr: cur,
12376	}
12377}
12378
12379// ResponseContract operation response details.
12380type ResponseContract struct {
12381	// StatusCode - Operation response HTTP status code.
12382	StatusCode *int32 `json:"statusCode,omitempty"`
12383	// Description - Operation response description.
12384	Description *string `json:"description,omitempty"`
12385	// Representations - Collection of operation response representations.
12386	Representations *[]RepresentationContract `json:"representations,omitempty"`
12387	// Headers - Collection of operation response headers.
12388	Headers *[]ParameterContract `json:"headers,omitempty"`
12389}
12390
12391// SamplingSettings sampling settings for Diagnostic.
12392type SamplingSettings struct {
12393	// SamplingType - Sampling type. Possible values include: 'SamplingTypeFixed'
12394	SamplingType SamplingType `json:"samplingType,omitempty"`
12395	// Percentage - Rate of sampling for fixed-rate sampling.
12396	Percentage *float64 `json:"percentage,omitempty"`
12397}
12398
12399// SaveConfigurationParameter save Tenant Configuration Contract details.
12400type SaveConfigurationParameter struct {
12401	// SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters.
12402	*SaveConfigurationParameterProperties `json:"properties,omitempty"`
12403}
12404
12405// MarshalJSON is the custom marshaler for SaveConfigurationParameter.
12406func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) {
12407	objectMap := make(map[string]interface{})
12408	if scp.SaveConfigurationParameterProperties != nil {
12409		objectMap["properties"] = scp.SaveConfigurationParameterProperties
12410	}
12411	return json.Marshal(objectMap)
12412}
12413
12414// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct.
12415func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error {
12416	var m map[string]*json.RawMessage
12417	err := json.Unmarshal(body, &m)
12418	if err != nil {
12419		return err
12420	}
12421	for k, v := range m {
12422		switch k {
12423		case "properties":
12424			if v != nil {
12425				var saveConfigurationParameterProperties SaveConfigurationParameterProperties
12426				err = json.Unmarshal(*v, &saveConfigurationParameterProperties)
12427				if err != nil {
12428					return err
12429				}
12430				scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties
12431			}
12432		}
12433	}
12434
12435	return nil
12436}
12437
12438// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation.
12439type SaveConfigurationParameterProperties struct {
12440	// Branch - The name of the Git branch in which to commit the current configuration snapshot.
12441	Branch *string `json:"branch,omitempty"`
12442	// 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.
12443	Force *bool `json:"force,omitempty"`
12444}
12445
12446// SchemaCollection the response of the list schema operation.
12447type SchemaCollection struct {
12448	autorest.Response `json:"-"`
12449	// Value - READ-ONLY; API Schema Contract value.
12450	Value *[]SchemaContract `json:"value,omitempty"`
12451	// Count - Total record count number.
12452	Count *int64 `json:"count,omitempty"`
12453	// NextLink - READ-ONLY; Next page link if any.
12454	NextLink *string `json:"nextLink,omitempty"`
12455}
12456
12457// MarshalJSON is the custom marshaler for SchemaCollection.
12458func (sc SchemaCollection) MarshalJSON() ([]byte, error) {
12459	objectMap := make(map[string]interface{})
12460	if sc.Count != nil {
12461		objectMap["count"] = sc.Count
12462	}
12463	return json.Marshal(objectMap)
12464}
12465
12466// SchemaCollectionIterator provides access to a complete listing of SchemaContract values.
12467type SchemaCollectionIterator struct {
12468	i    int
12469	page SchemaCollectionPage
12470}
12471
12472// NextWithContext advances to the next value.  If there was an error making
12473// the request the iterator does not advance and the error is returned.
12474func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) {
12475	if tracing.IsEnabled() {
12476		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext")
12477		defer func() {
12478			sc := -1
12479			if iter.Response().Response.Response != nil {
12480				sc = iter.Response().Response.Response.StatusCode
12481			}
12482			tracing.EndSpan(ctx, sc, err)
12483		}()
12484	}
12485	iter.i++
12486	if iter.i < len(iter.page.Values()) {
12487		return nil
12488	}
12489	err = iter.page.NextWithContext(ctx)
12490	if err != nil {
12491		iter.i--
12492		return err
12493	}
12494	iter.i = 0
12495	return nil
12496}
12497
12498// Next advances to the next value.  If there was an error making
12499// the request the iterator does not advance and the error is returned.
12500// Deprecated: Use NextWithContext() instead.
12501func (iter *SchemaCollectionIterator) Next() error {
12502	return iter.NextWithContext(context.Background())
12503}
12504
12505// NotDone returns true if the enumeration should be started or is not yet complete.
12506func (iter SchemaCollectionIterator) NotDone() bool {
12507	return iter.page.NotDone() && iter.i < len(iter.page.Values())
12508}
12509
12510// Response returns the raw server response from the last page request.
12511func (iter SchemaCollectionIterator) Response() SchemaCollection {
12512	return iter.page.Response()
12513}
12514
12515// Value returns the current value or a zero-initialized value if the
12516// iterator has advanced beyond the end of the collection.
12517func (iter SchemaCollectionIterator) Value() SchemaContract {
12518	if !iter.page.NotDone() {
12519		return SchemaContract{}
12520	}
12521	return iter.page.Values()[iter.i]
12522}
12523
12524// Creates a new instance of the SchemaCollectionIterator type.
12525func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator {
12526	return SchemaCollectionIterator{page: page}
12527}
12528
12529// IsEmpty returns true if the ListResult contains no values.
12530func (sc SchemaCollection) IsEmpty() bool {
12531	return sc.Value == nil || len(*sc.Value) == 0
12532}
12533
12534// hasNextLink returns true if the NextLink is not empty.
12535func (sc SchemaCollection) hasNextLink() bool {
12536	return sc.NextLink != nil && len(*sc.NextLink) != 0
12537}
12538
12539// schemaCollectionPreparer prepares a request to retrieve the next set of results.
12540// It returns nil if no more results exist.
12541func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) {
12542	if !sc.hasNextLink() {
12543		return nil, nil
12544	}
12545	return autorest.Prepare((&http.Request{}).WithContext(ctx),
12546		autorest.AsJSON(),
12547		autorest.AsGet(),
12548		autorest.WithBaseURL(to.String(sc.NextLink)))
12549}
12550
12551// SchemaCollectionPage contains a page of SchemaContract values.
12552type SchemaCollectionPage struct {
12553	fn func(context.Context, SchemaCollection) (SchemaCollection, error)
12554	sc SchemaCollection
12555}
12556
12557// NextWithContext advances to the next page of values.  If there was an error making
12558// the request the page does not advance and the error is returned.
12559func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) {
12560	if tracing.IsEnabled() {
12561		ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext")
12562		defer func() {
12563			sc := -1
12564			if page.Response().Response.Response != nil {
12565				sc = page.Response().Response.Response.StatusCode
12566			}
12567			tracing.EndSpan(ctx, sc, err)
12568		}()
12569	}
12570	for {
12571		next, err := page.fn(ctx, page.sc)
12572		if err != nil {
12573			return err
12574		}
12575		page.sc = next
12576		if !next.hasNextLink() || !next.IsEmpty() {
12577			break
12578		}
12579	}
12580	return nil
12581}
12582
12583// Next advances to the next page of values.  If there was an error making
12584// the request the page does not advance and the error is returned.
12585// Deprecated: Use NextWithContext() instead.
12586func (page *SchemaCollectionPage) Next() error {
12587	return page.NextWithContext(context.Background())
12588}
12589
12590// NotDone returns true if the page enumeration should be started or is not yet complete.
12591func (page SchemaCollectionPage) NotDone() bool {
12592	return !page.sc.IsEmpty()
12593}
12594
12595// Response returns the raw server response from the last page request.
12596func (page SchemaCollectionPage) Response() SchemaCollection {
12597	return page.sc
12598}
12599
12600// Values returns the slice of values for the current page or nil if there are no values.
12601func (page SchemaCollectionPage) Values() []SchemaContract {
12602	if page.sc.IsEmpty() {
12603		return nil
12604	}
12605	return *page.sc.Value
12606}
12607
12608// Creates a new instance of the SchemaCollectionPage type.
12609func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage {
12610	return SchemaCollectionPage{
12611		fn: getNextPage,
12612		sc: cur,
12613	}
12614}
12615
12616// SchemaContract schema Contract details.
12617type SchemaContract struct {
12618	autorest.Response `json:"-"`
12619	// SchemaContractProperties - Properties of the Schema.
12620	*SchemaContractProperties `json:"properties,omitempty"`
12621	// ID - READ-ONLY; Resource ID.
12622	ID *string `json:"id,omitempty"`
12623	// Name - READ-ONLY; Resource name.
12624	Name *string `json:"name,omitempty"`
12625	// Type - READ-ONLY; Resource type for API Management resource.
12626	Type *string `json:"type,omitempty"`
12627}
12628
12629// MarshalJSON is the custom marshaler for SchemaContract.
12630func (sc SchemaContract) MarshalJSON() ([]byte, error) {
12631	objectMap := make(map[string]interface{})
12632	if sc.SchemaContractProperties != nil {
12633		objectMap["properties"] = sc.SchemaContractProperties
12634	}
12635	return json.Marshal(objectMap)
12636}
12637
12638// UnmarshalJSON is the custom unmarshaler for SchemaContract struct.
12639func (sc *SchemaContract) UnmarshalJSON(body []byte) error {
12640	var m map[string]*json.RawMessage
12641	err := json.Unmarshal(body, &m)
12642	if err != nil {
12643		return err
12644	}
12645	for k, v := range m {
12646		switch k {
12647		case "properties":
12648			if v != nil {
12649				var schemaContractProperties SchemaContractProperties
12650				err = json.Unmarshal(*v, &schemaContractProperties)
12651				if err != nil {
12652					return err
12653				}
12654				sc.SchemaContractProperties = &schemaContractProperties
12655			}
12656		case "id":
12657			if v != nil {
12658				var ID string
12659				err = json.Unmarshal(*v, &ID)
12660				if err != nil {
12661					return err
12662				}
12663				sc.ID = &ID
12664			}
12665		case "name":
12666			if v != nil {
12667				var name string
12668				err = json.Unmarshal(*v, &name)
12669				if err != nil {
12670					return err
12671				}
12672				sc.Name = &name
12673			}
12674		case "type":
12675			if v != nil {
12676				var typeVar string
12677				err = json.Unmarshal(*v, &typeVar)
12678				if err != nil {
12679					return err
12680				}
12681				sc.Type = &typeVar
12682			}
12683		}
12684	}
12685
12686	return nil
12687}
12688
12689// SchemaContractProperties API Schema create or update contract Properties.
12690type SchemaContractProperties struct {
12691	// 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`.
12692	ContentType *string `json:"contentType,omitempty"`
12693	// Document - Create or update Properties of the Schema Document.
12694	Document interface{} `json:"document,omitempty"`
12695}
12696
12697// ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration
12698// operation.
12699type ServiceApplyNetworkConfigurationParameters struct {
12700	// 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.
12701	Location *string `json:"location,omitempty"`
12702}
12703
12704// ServiceApplyNetworkConfigurationUpdatesFuture an abstraction for monitoring and retrieving the results
12705// of a long-running operation.
12706type ServiceApplyNetworkConfigurationUpdatesFuture struct {
12707	azure.FutureAPI
12708	// Result returns the result of the asynchronous operation.
12709	// If the operation has not completed it will return an error.
12710	Result func(ServiceClient) (ServiceResource, error)
12711}
12712
12713// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12714func (future *ServiceApplyNetworkConfigurationUpdatesFuture) UnmarshalJSON(body []byte) error {
12715	var azFuture azure.Future
12716	if err := json.Unmarshal(body, &azFuture); err != nil {
12717		return err
12718	}
12719	future.FutureAPI = &azFuture
12720	future.Result = future.result
12721	return nil
12722}
12723
12724// result is the default implementation for ServiceApplyNetworkConfigurationUpdatesFuture.Result.
12725func (future *ServiceApplyNetworkConfigurationUpdatesFuture) result(client ServiceClient) (sr ServiceResource, err error) {
12726	var done bool
12727	done, err = future.DoneWithContext(context.Background(), client)
12728	if err != nil {
12729		err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", future.Response(), "Polling failure")
12730		return
12731	}
12732	if !done {
12733		sr.Response.Response = future.Response()
12734		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture")
12735		return
12736	}
12737	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12738	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
12739		sr, err = client.ApplyNetworkConfigurationUpdatesResponder(sr.Response.Response)
12740		if err != nil {
12741			err = autorest.NewErrorWithError(err, "apimanagement.ServiceApplyNetworkConfigurationUpdatesFuture", "Result", sr.Response.Response, "Failure responding to request")
12742		}
12743	}
12744	return
12745}
12746
12747// ServiceBackupFuture an abstraction for monitoring and retrieving the results of a long-running
12748// operation.
12749type ServiceBackupFuture struct {
12750	azure.FutureAPI
12751	// Result returns the result of the asynchronous operation.
12752	// If the operation has not completed it will return an error.
12753	Result func(ServiceClient) (ServiceResource, error)
12754}
12755
12756// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12757func (future *ServiceBackupFuture) UnmarshalJSON(body []byte) error {
12758	var azFuture azure.Future
12759	if err := json.Unmarshal(body, &azFuture); err != nil {
12760		return err
12761	}
12762	future.FutureAPI = &azFuture
12763	future.Result = future.result
12764	return nil
12765}
12766
12767// result is the default implementation for ServiceBackupFuture.Result.
12768func (future *ServiceBackupFuture) result(client ServiceClient) (sr ServiceResource, err error) {
12769	var done bool
12770	done, err = future.DoneWithContext(context.Background(), client)
12771	if err != nil {
12772		err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", future.Response(), "Polling failure")
12773		return
12774	}
12775	if !done {
12776		sr.Response.Response = future.Response()
12777		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceBackupFuture")
12778		return
12779	}
12780	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12781	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
12782		sr, err = client.BackupResponder(sr.Response.Response)
12783		if err != nil {
12784			err = autorest.NewErrorWithError(err, "apimanagement.ServiceBackupFuture", "Result", sr.Response.Response, "Failure responding to request")
12785		}
12786	}
12787	return
12788}
12789
12790// ServiceBackupRestoreParameters parameters supplied to the Backup/Restore of an API Management service
12791// operation.
12792type ServiceBackupRestoreParameters struct {
12793	// StorageAccount - Azure Cloud Storage account (used to place/retrieve the backup) name.
12794	StorageAccount *string `json:"storageAccount,omitempty"`
12795	// AccessKey - Azure Cloud Storage account (used to place/retrieve the backup) access key.
12796	AccessKey *string `json:"accessKey,omitempty"`
12797	// ContainerName - Azure Cloud Storage blob container name used to place/retrieve the backup.
12798	ContainerName *string `json:"containerName,omitempty"`
12799	// BackupName - The name of the backup file to create.
12800	BackupName *string `json:"backupName,omitempty"`
12801}
12802
12803// ServiceBaseProperties base Properties of an API Management service resource description.
12804type ServiceBaseProperties struct {
12805	// NotificationSenderEmail - Email address from which the notification will be sent.
12806	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
12807	// 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.
12808	ProvisioningState *string `json:"provisioningState,omitempty"`
12809	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
12810	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
12811	// 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.
12812	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
12813	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
12814	GatewayURL *string `json:"gatewayUrl,omitempty"`
12815	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
12816	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
12817	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
12818	PortalURL *string `json:"portalUrl,omitempty"`
12819	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
12820	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
12821	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
12822	ScmURL *string `json:"scmUrl,omitempty"`
12823	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
12824	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
12825	// HostnameConfigurations - Custom hostname configuration of the API Management service.
12826	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
12827	// 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.
12828	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
12829	// 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.
12830	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
12831	// 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.
12832	PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
12833	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
12834	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
12835	// AdditionalLocations - Additional datacenter locations of the API Management service.
12836	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
12837	// 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
12838	CustomProperties map[string]*string `json:"customProperties"`
12839	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
12840	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
12841	// 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.
12842	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
12843	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
12844	DisableGateway *bool `json:"disableGateway,omitempty"`
12845	// 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'
12846	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
12847	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
12848	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
12849	// 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.
12850	Restore *bool `json:"restore,omitempty"`
12851}
12852
12853// MarshalJSON is the custom marshaler for ServiceBaseProperties.
12854func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) {
12855	objectMap := make(map[string]interface{})
12856	if sbp.NotificationSenderEmail != nil {
12857		objectMap["notificationSenderEmail"] = sbp.NotificationSenderEmail
12858	}
12859	if sbp.HostnameConfigurations != nil {
12860		objectMap["hostnameConfigurations"] = sbp.HostnameConfigurations
12861	}
12862	if sbp.PublicIPAddressID != nil {
12863		objectMap["publicIpAddressId"] = sbp.PublicIPAddressID
12864	}
12865	if sbp.VirtualNetworkConfiguration != nil {
12866		objectMap["virtualNetworkConfiguration"] = sbp.VirtualNetworkConfiguration
12867	}
12868	if sbp.AdditionalLocations != nil {
12869		objectMap["additionalLocations"] = sbp.AdditionalLocations
12870	}
12871	if sbp.CustomProperties != nil {
12872		objectMap["customProperties"] = sbp.CustomProperties
12873	}
12874	if sbp.Certificates != nil {
12875		objectMap["certificates"] = sbp.Certificates
12876	}
12877	if sbp.EnableClientCertificate != nil {
12878		objectMap["enableClientCertificate"] = sbp.EnableClientCertificate
12879	}
12880	if sbp.DisableGateway != nil {
12881		objectMap["disableGateway"] = sbp.DisableGateway
12882	}
12883	if sbp.VirtualNetworkType != "" {
12884		objectMap["virtualNetworkType"] = sbp.VirtualNetworkType
12885	}
12886	if sbp.APIVersionConstraint != nil {
12887		objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint
12888	}
12889	if sbp.Restore != nil {
12890		objectMap["restore"] = sbp.Restore
12891	}
12892	return json.Marshal(objectMap)
12893}
12894
12895// ServiceCheckNameAvailabilityParameters parameters supplied to the CheckNameAvailability operation.
12896type ServiceCheckNameAvailabilityParameters struct {
12897	// Name - The name to check for availability.
12898	Name *string `json:"name,omitempty"`
12899}
12900
12901// ServiceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
12902// operation.
12903type ServiceCreateOrUpdateFuture struct {
12904	azure.FutureAPI
12905	// Result returns the result of the asynchronous operation.
12906	// If the operation has not completed it will return an error.
12907	Result func(ServiceClient) (ServiceResource, error)
12908}
12909
12910// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12911func (future *ServiceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
12912	var azFuture azure.Future
12913	if err := json.Unmarshal(body, &azFuture); err != nil {
12914		return err
12915	}
12916	future.FutureAPI = &azFuture
12917	future.Result = future.result
12918	return nil
12919}
12920
12921// result is the default implementation for ServiceCreateOrUpdateFuture.Result.
12922func (future *ServiceCreateOrUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
12923	var done bool
12924	done, err = future.DoneWithContext(context.Background(), client)
12925	if err != nil {
12926		err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
12927		return
12928	}
12929	if !done {
12930		sr.Response.Response = future.Response()
12931		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceCreateOrUpdateFuture")
12932		return
12933	}
12934	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12935	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
12936		sr, err = client.CreateOrUpdateResponder(sr.Response.Response)
12937		if err != nil {
12938			err = autorest.NewErrorWithError(err, "apimanagement.ServiceCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
12939		}
12940	}
12941	return
12942}
12943
12944// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
12945// operation.
12946type ServiceDeleteFuture struct {
12947	azure.FutureAPI
12948	// Result returns the result of the asynchronous operation.
12949	// If the operation has not completed it will return an error.
12950	Result func(ServiceClient) (ServiceResource, error)
12951}
12952
12953// UnmarshalJSON is the custom unmarshaller for CreateFuture.
12954func (future *ServiceDeleteFuture) UnmarshalJSON(body []byte) error {
12955	var azFuture azure.Future
12956	if err := json.Unmarshal(body, &azFuture); err != nil {
12957		return err
12958	}
12959	future.FutureAPI = &azFuture
12960	future.Result = future.result
12961	return nil
12962}
12963
12964// result is the default implementation for ServiceDeleteFuture.Result.
12965func (future *ServiceDeleteFuture) result(client ServiceClient) (sr ServiceResource, err error) {
12966	var done bool
12967	done, err = future.DoneWithContext(context.Background(), client)
12968	if err != nil {
12969		err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure")
12970		return
12971	}
12972	if !done {
12973		sr.Response.Response = future.Response()
12974		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture")
12975		return
12976	}
12977	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
12978	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
12979		sr, err = client.DeleteResponder(sr.Response.Response)
12980		if err != nil {
12981			err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request")
12982		}
12983	}
12984	return
12985}
12986
12987// ServiceGetDomainOwnershipIdentifierResult response of the GetDomainOwnershipIdentifier operation.
12988type ServiceGetDomainOwnershipIdentifierResult struct {
12989	autorest.Response `json:"-"`
12990	// DomainOwnershipIdentifier - READ-ONLY; The domain ownership identifier value.
12991	DomainOwnershipIdentifier *string `json:"domainOwnershipIdentifier,omitempty"`
12992}
12993
12994// MarshalJSON is the custom marshaler for ServiceGetDomainOwnershipIdentifierResult.
12995func (sgdoir ServiceGetDomainOwnershipIdentifierResult) MarshalJSON() ([]byte, error) {
12996	objectMap := make(map[string]interface{})
12997	return json.Marshal(objectMap)
12998}
12999
13000// ServiceGetSsoTokenResult the response of the GetSsoToken operation.
13001type ServiceGetSsoTokenResult struct {
13002	autorest.Response `json:"-"`
13003	// RedirectURI - Redirect URL to the Publisher Portal containing the SSO token.
13004	RedirectURI *string `json:"redirectUri,omitempty"`
13005}
13006
13007// ServiceIdentity identity properties of the Api Management service resource.
13008type ServiceIdentity struct {
13009	// 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'
13010	Type ApimIdentityType `json:"type,omitempty"`
13011	// PrincipalID - READ-ONLY; The principal id of the identity.
13012	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
13013	// TenantID - READ-ONLY; The client tenant id of the identity.
13014	TenantID *uuid.UUID `json:"tenantId,omitempty"`
13015	// UserAssignedIdentities - The list of user identities associated with the resource. The user identity
13016	// dictionary key references will be ARM resource ids in the form:
13017	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/
13018	//     providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
13019	UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"`
13020}
13021
13022// MarshalJSON is the custom marshaler for ServiceIdentity.
13023func (si ServiceIdentity) MarshalJSON() ([]byte, error) {
13024	objectMap := make(map[string]interface{})
13025	if si.Type != "" {
13026		objectMap["type"] = si.Type
13027	}
13028	if si.UserAssignedIdentities != nil {
13029		objectMap["userAssignedIdentities"] = si.UserAssignedIdentities
13030	}
13031	return json.Marshal(objectMap)
13032}
13033
13034// ServiceListResult the response of the List API Management services operation.
13035type ServiceListResult struct {
13036	autorest.Response `json:"-"`
13037	// Value - Result of the List API Management services operation.
13038	Value *[]ServiceResource `json:"value,omitempty"`
13039	// NextLink - Link to the next set of results. Not empty if Value contains incomplete list of API Management services.
13040	NextLink *string `json:"nextLink,omitempty"`
13041}
13042
13043// ServiceListResultIterator provides access to a complete listing of ServiceResource values.
13044type ServiceListResultIterator struct {
13045	i    int
13046	page ServiceListResultPage
13047}
13048
13049// NextWithContext advances to the next value.  If there was an error making
13050// the request the iterator does not advance and the error is returned.
13051func (iter *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
13052	if tracing.IsEnabled() {
13053		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.NextWithContext")
13054		defer func() {
13055			sc := -1
13056			if iter.Response().Response.Response != nil {
13057				sc = iter.Response().Response.Response.StatusCode
13058			}
13059			tracing.EndSpan(ctx, sc, err)
13060		}()
13061	}
13062	iter.i++
13063	if iter.i < len(iter.page.Values()) {
13064		return nil
13065	}
13066	err = iter.page.NextWithContext(ctx)
13067	if err != nil {
13068		iter.i--
13069		return err
13070	}
13071	iter.i = 0
13072	return nil
13073}
13074
13075// Next advances to the next value.  If there was an error making
13076// the request the iterator does not advance and the error is returned.
13077// Deprecated: Use NextWithContext() instead.
13078func (iter *ServiceListResultIterator) Next() error {
13079	return iter.NextWithContext(context.Background())
13080}
13081
13082// NotDone returns true if the enumeration should be started or is not yet complete.
13083func (iter ServiceListResultIterator) NotDone() bool {
13084	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13085}
13086
13087// Response returns the raw server response from the last page request.
13088func (iter ServiceListResultIterator) Response() ServiceListResult {
13089	return iter.page.Response()
13090}
13091
13092// Value returns the current value or a zero-initialized value if the
13093// iterator has advanced beyond the end of the collection.
13094func (iter ServiceListResultIterator) Value() ServiceResource {
13095	if !iter.page.NotDone() {
13096		return ServiceResource{}
13097	}
13098	return iter.page.Values()[iter.i]
13099}
13100
13101// Creates a new instance of the ServiceListResultIterator type.
13102func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator {
13103	return ServiceListResultIterator{page: page}
13104}
13105
13106// IsEmpty returns true if the ListResult contains no values.
13107func (slr ServiceListResult) IsEmpty() bool {
13108	return slr.Value == nil || len(*slr.Value) == 0
13109}
13110
13111// hasNextLink returns true if the NextLink is not empty.
13112func (slr ServiceListResult) hasNextLink() bool {
13113	return slr.NextLink != nil && len(*slr.NextLink) != 0
13114}
13115
13116// serviceListResultPreparer prepares a request to retrieve the next set of results.
13117// It returns nil if no more results exist.
13118func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) {
13119	if !slr.hasNextLink() {
13120		return nil, nil
13121	}
13122	return autorest.Prepare((&http.Request{}).WithContext(ctx),
13123		autorest.AsJSON(),
13124		autorest.AsGet(),
13125		autorest.WithBaseURL(to.String(slr.NextLink)))
13126}
13127
13128// ServiceListResultPage contains a page of ServiceResource values.
13129type ServiceListResultPage struct {
13130	fn  func(context.Context, ServiceListResult) (ServiceListResult, error)
13131	slr ServiceListResult
13132}
13133
13134// NextWithContext advances to the next page of values.  If there was an error making
13135// the request the page does not advance and the error is returned.
13136func (page *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
13137	if tracing.IsEnabled() {
13138		ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext")
13139		defer func() {
13140			sc := -1
13141			if page.Response().Response.Response != nil {
13142				sc = page.Response().Response.Response.StatusCode
13143			}
13144			tracing.EndSpan(ctx, sc, err)
13145		}()
13146	}
13147	for {
13148		next, err := page.fn(ctx, page.slr)
13149		if err != nil {
13150			return err
13151		}
13152		page.slr = next
13153		if !next.hasNextLink() || !next.IsEmpty() {
13154			break
13155		}
13156	}
13157	return nil
13158}
13159
13160// Next advances to the next page of values.  If there was an error making
13161// the request the page does not advance and the error is returned.
13162// Deprecated: Use NextWithContext() instead.
13163func (page *ServiceListResultPage) Next() error {
13164	return page.NextWithContext(context.Background())
13165}
13166
13167// NotDone returns true if the page enumeration should be started or is not yet complete.
13168func (page ServiceListResultPage) NotDone() bool {
13169	return !page.slr.IsEmpty()
13170}
13171
13172// Response returns the raw server response from the last page request.
13173func (page ServiceListResultPage) Response() ServiceListResult {
13174	return page.slr
13175}
13176
13177// Values returns the slice of values for the current page or nil if there are no values.
13178func (page ServiceListResultPage) Values() []ServiceResource {
13179	if page.slr.IsEmpty() {
13180		return nil
13181	}
13182	return *page.slr.Value
13183}
13184
13185// Creates a new instance of the ServiceListResultPage type.
13186func NewServiceListResultPage(cur ServiceListResult, getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage {
13187	return ServiceListResultPage{
13188		fn:  getNextPage,
13189		slr: cur,
13190	}
13191}
13192
13193// ServiceNameAvailabilityResult response of the CheckNameAvailability operation.
13194type ServiceNameAvailabilityResult struct {
13195	autorest.Response `json:"-"`
13196	// NameAvailable - READ-ONLY; True if the name is available and can be used to create a new API Management service; otherwise false.
13197	NameAvailable *bool `json:"nameAvailable,omitempty"`
13198	// 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.
13199	Message *string `json:"message,omitempty"`
13200	// 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'
13201	Reason NameAvailabilityReason `json:"reason,omitempty"`
13202}
13203
13204// MarshalJSON is the custom marshaler for ServiceNameAvailabilityResult.
13205func (snar ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) {
13206	objectMap := make(map[string]interface{})
13207	if snar.Reason != "" {
13208		objectMap["reason"] = snar.Reason
13209	}
13210	return json.Marshal(objectMap)
13211}
13212
13213// ServiceProperties properties of an API Management service resource description.
13214type ServiceProperties struct {
13215	// PublisherEmail - Publisher email.
13216	PublisherEmail *string `json:"publisherEmail,omitempty"`
13217	// PublisherName - Publisher name.
13218	PublisherName *string `json:"publisherName,omitempty"`
13219	// NotificationSenderEmail - Email address from which the notification will be sent.
13220	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
13221	// 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.
13222	ProvisioningState *string `json:"provisioningState,omitempty"`
13223	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
13224	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
13225	// 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.
13226	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
13227	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
13228	GatewayURL *string `json:"gatewayUrl,omitempty"`
13229	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
13230	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
13231	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
13232	PortalURL *string `json:"portalUrl,omitempty"`
13233	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
13234	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
13235	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
13236	ScmURL *string `json:"scmUrl,omitempty"`
13237	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
13238	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
13239	// HostnameConfigurations - Custom hostname configuration of the API Management service.
13240	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
13241	// 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.
13242	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
13243	// 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.
13244	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
13245	// 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.
13246	PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
13247	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
13248	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
13249	// AdditionalLocations - Additional datacenter locations of the API Management service.
13250	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
13251	// 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
13252	CustomProperties map[string]*string `json:"customProperties"`
13253	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
13254	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
13255	// 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.
13256	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
13257	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
13258	DisableGateway *bool `json:"disableGateway,omitempty"`
13259	// 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'
13260	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
13261	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
13262	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
13263	// 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.
13264	Restore *bool `json:"restore,omitempty"`
13265}
13266
13267// MarshalJSON is the custom marshaler for ServiceProperties.
13268func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
13269	objectMap := make(map[string]interface{})
13270	if sp.PublisherEmail != nil {
13271		objectMap["publisherEmail"] = sp.PublisherEmail
13272	}
13273	if sp.PublisherName != nil {
13274		objectMap["publisherName"] = sp.PublisherName
13275	}
13276	if sp.NotificationSenderEmail != nil {
13277		objectMap["notificationSenderEmail"] = sp.NotificationSenderEmail
13278	}
13279	if sp.HostnameConfigurations != nil {
13280		objectMap["hostnameConfigurations"] = sp.HostnameConfigurations
13281	}
13282	if sp.PublicIPAddressID != nil {
13283		objectMap["publicIpAddressId"] = sp.PublicIPAddressID
13284	}
13285	if sp.VirtualNetworkConfiguration != nil {
13286		objectMap["virtualNetworkConfiguration"] = sp.VirtualNetworkConfiguration
13287	}
13288	if sp.AdditionalLocations != nil {
13289		objectMap["additionalLocations"] = sp.AdditionalLocations
13290	}
13291	if sp.CustomProperties != nil {
13292		objectMap["customProperties"] = sp.CustomProperties
13293	}
13294	if sp.Certificates != nil {
13295		objectMap["certificates"] = sp.Certificates
13296	}
13297	if sp.EnableClientCertificate != nil {
13298		objectMap["enableClientCertificate"] = sp.EnableClientCertificate
13299	}
13300	if sp.DisableGateway != nil {
13301		objectMap["disableGateway"] = sp.DisableGateway
13302	}
13303	if sp.VirtualNetworkType != "" {
13304		objectMap["virtualNetworkType"] = sp.VirtualNetworkType
13305	}
13306	if sp.APIVersionConstraint != nil {
13307		objectMap["apiVersionConstraint"] = sp.APIVersionConstraint
13308	}
13309	if sp.Restore != nil {
13310		objectMap["restore"] = sp.Restore
13311	}
13312	return json.Marshal(objectMap)
13313}
13314
13315// ServiceResource a single API Management service resource in List or Get response.
13316type ServiceResource struct {
13317	autorest.Response `json:"-"`
13318	// ServiceProperties - Properties of the API Management service.
13319	*ServiceProperties `json:"properties,omitempty"`
13320	// Sku - SKU properties of the API Management service.
13321	Sku *ServiceSkuProperties `json:"sku,omitempty"`
13322	// Identity - Managed service identity of the Api Management service.
13323	Identity *ServiceIdentity `json:"identity,omitempty"`
13324	// Location - Resource location.
13325	Location *string `json:"location,omitempty"`
13326	// Etag - READ-ONLY; ETag of the resource.
13327	Etag *string `json:"etag,omitempty"`
13328	// Zones - A list of availability zones denoting where the resource needs to come from.
13329	Zones *[]string `json:"zones,omitempty"`
13330	// ID - READ-ONLY; Resource ID.
13331	ID *string `json:"id,omitempty"`
13332	// Name - READ-ONLY; Resource name.
13333	Name *string `json:"name,omitempty"`
13334	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
13335	Type *string `json:"type,omitempty"`
13336	// Tags - Resource tags.
13337	Tags map[string]*string `json:"tags"`
13338}
13339
13340// MarshalJSON is the custom marshaler for ServiceResource.
13341func (sr ServiceResource) MarshalJSON() ([]byte, error) {
13342	objectMap := make(map[string]interface{})
13343	if sr.ServiceProperties != nil {
13344		objectMap["properties"] = sr.ServiceProperties
13345	}
13346	if sr.Sku != nil {
13347		objectMap["sku"] = sr.Sku
13348	}
13349	if sr.Identity != nil {
13350		objectMap["identity"] = sr.Identity
13351	}
13352	if sr.Location != nil {
13353		objectMap["location"] = sr.Location
13354	}
13355	if sr.Zones != nil {
13356		objectMap["zones"] = sr.Zones
13357	}
13358	if sr.Tags != nil {
13359		objectMap["tags"] = sr.Tags
13360	}
13361	return json.Marshal(objectMap)
13362}
13363
13364// UnmarshalJSON is the custom unmarshaler for ServiceResource struct.
13365func (sr *ServiceResource) UnmarshalJSON(body []byte) error {
13366	var m map[string]*json.RawMessage
13367	err := json.Unmarshal(body, &m)
13368	if err != nil {
13369		return err
13370	}
13371	for k, v := range m {
13372		switch k {
13373		case "properties":
13374			if v != nil {
13375				var serviceProperties ServiceProperties
13376				err = json.Unmarshal(*v, &serviceProperties)
13377				if err != nil {
13378					return err
13379				}
13380				sr.ServiceProperties = &serviceProperties
13381			}
13382		case "sku":
13383			if v != nil {
13384				var sku ServiceSkuProperties
13385				err = json.Unmarshal(*v, &sku)
13386				if err != nil {
13387					return err
13388				}
13389				sr.Sku = &sku
13390			}
13391		case "identity":
13392			if v != nil {
13393				var identity ServiceIdentity
13394				err = json.Unmarshal(*v, &identity)
13395				if err != nil {
13396					return err
13397				}
13398				sr.Identity = &identity
13399			}
13400		case "location":
13401			if v != nil {
13402				var location string
13403				err = json.Unmarshal(*v, &location)
13404				if err != nil {
13405					return err
13406				}
13407				sr.Location = &location
13408			}
13409		case "etag":
13410			if v != nil {
13411				var etag string
13412				err = json.Unmarshal(*v, &etag)
13413				if err != nil {
13414					return err
13415				}
13416				sr.Etag = &etag
13417			}
13418		case "zones":
13419			if v != nil {
13420				var zones []string
13421				err = json.Unmarshal(*v, &zones)
13422				if err != nil {
13423					return err
13424				}
13425				sr.Zones = &zones
13426			}
13427		case "id":
13428			if v != nil {
13429				var ID string
13430				err = json.Unmarshal(*v, &ID)
13431				if err != nil {
13432					return err
13433				}
13434				sr.ID = &ID
13435			}
13436		case "name":
13437			if v != nil {
13438				var name string
13439				err = json.Unmarshal(*v, &name)
13440				if err != nil {
13441					return err
13442				}
13443				sr.Name = &name
13444			}
13445		case "type":
13446			if v != nil {
13447				var typeVar string
13448				err = json.Unmarshal(*v, &typeVar)
13449				if err != nil {
13450					return err
13451				}
13452				sr.Type = &typeVar
13453			}
13454		case "tags":
13455			if v != nil {
13456				var tags map[string]*string
13457				err = json.Unmarshal(*v, &tags)
13458				if err != nil {
13459					return err
13460				}
13461				sr.Tags = tags
13462			}
13463		}
13464	}
13465
13466	return nil
13467}
13468
13469// ServiceRestoreFuture an abstraction for monitoring and retrieving the results of a long-running
13470// operation.
13471type ServiceRestoreFuture struct {
13472	azure.FutureAPI
13473	// Result returns the result of the asynchronous operation.
13474	// If the operation has not completed it will return an error.
13475	Result func(ServiceClient) (ServiceResource, error)
13476}
13477
13478// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13479func (future *ServiceRestoreFuture) UnmarshalJSON(body []byte) error {
13480	var azFuture azure.Future
13481	if err := json.Unmarshal(body, &azFuture); err != nil {
13482		return err
13483	}
13484	future.FutureAPI = &azFuture
13485	future.Result = future.result
13486	return nil
13487}
13488
13489// result is the default implementation for ServiceRestoreFuture.Result.
13490func (future *ServiceRestoreFuture) result(client ServiceClient) (sr ServiceResource, err error) {
13491	var done bool
13492	done, err = future.DoneWithContext(context.Background(), client)
13493	if err != nil {
13494		err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", future.Response(), "Polling failure")
13495		return
13496	}
13497	if !done {
13498		sr.Response.Response = future.Response()
13499		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceRestoreFuture")
13500		return
13501	}
13502	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13503	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
13504		sr, err = client.RestoreResponder(sr.Response.Response)
13505		if err != nil {
13506			err = autorest.NewErrorWithError(err, "apimanagement.ServiceRestoreFuture", "Result", sr.Response.Response, "Failure responding to request")
13507		}
13508	}
13509	return
13510}
13511
13512// ServiceSkuProperties API Management service resource SKU properties.
13513type ServiceSkuProperties struct {
13514	// Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption', 'SkuTypeIsolated'
13515	Name SkuType `json:"name,omitempty"`
13516	// Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0.
13517	Capacity *int32 `json:"capacity,omitempty"`
13518}
13519
13520// ServiceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
13521// operation.
13522type ServiceUpdateFuture struct {
13523	azure.FutureAPI
13524	// Result returns the result of the asynchronous operation.
13525	// If the operation has not completed it will return an error.
13526	Result func(ServiceClient) (ServiceResource, error)
13527}
13528
13529// UnmarshalJSON is the custom unmarshaller for CreateFuture.
13530func (future *ServiceUpdateFuture) UnmarshalJSON(body []byte) error {
13531	var azFuture azure.Future
13532	if err := json.Unmarshal(body, &azFuture); err != nil {
13533		return err
13534	}
13535	future.FutureAPI = &azFuture
13536	future.Result = future.result
13537	return nil
13538}
13539
13540// result is the default implementation for ServiceUpdateFuture.Result.
13541func (future *ServiceUpdateFuture) result(client ServiceClient) (sr ServiceResource, err error) {
13542	var done bool
13543	done, err = future.DoneWithContext(context.Background(), client)
13544	if err != nil {
13545		err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", future.Response(), "Polling failure")
13546		return
13547	}
13548	if !done {
13549		sr.Response.Response = future.Response()
13550		err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateFuture")
13551		return
13552	}
13553	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
13554	if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent {
13555		sr, err = client.UpdateResponder(sr.Response.Response)
13556		if err != nil {
13557			err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateFuture", "Result", sr.Response.Response, "Failure responding to request")
13558		}
13559	}
13560	return
13561}
13562
13563// ServiceUpdateParameters parameter supplied to Update Api Management Service.
13564type ServiceUpdateParameters struct {
13565	// ServiceUpdateProperties - Properties of the API Management service.
13566	*ServiceUpdateProperties `json:"properties,omitempty"`
13567	// Sku - SKU properties of the API Management service.
13568	Sku *ServiceSkuProperties `json:"sku,omitempty"`
13569	// Identity - Managed service identity of the Api Management service.
13570	Identity *ServiceIdentity `json:"identity,omitempty"`
13571	// Etag - READ-ONLY; ETag of the resource.
13572	Etag *string `json:"etag,omitempty"`
13573	// ID - READ-ONLY; Resource ID.
13574	ID *string `json:"id,omitempty"`
13575	// Name - READ-ONLY; Resource name.
13576	Name *string `json:"name,omitempty"`
13577	// Type - READ-ONLY; Resource type for API Management resource is set to Microsoft.ApiManagement.
13578	Type *string `json:"type,omitempty"`
13579	// Tags - Resource tags.
13580	Tags map[string]*string `json:"tags"`
13581}
13582
13583// MarshalJSON is the custom marshaler for ServiceUpdateParameters.
13584func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) {
13585	objectMap := make(map[string]interface{})
13586	if sup.ServiceUpdateProperties != nil {
13587		objectMap["properties"] = sup.ServiceUpdateProperties
13588	}
13589	if sup.Sku != nil {
13590		objectMap["sku"] = sup.Sku
13591	}
13592	if sup.Identity != nil {
13593		objectMap["identity"] = sup.Identity
13594	}
13595	if sup.Tags != nil {
13596		objectMap["tags"] = sup.Tags
13597	}
13598	return json.Marshal(objectMap)
13599}
13600
13601// UnmarshalJSON is the custom unmarshaler for ServiceUpdateParameters struct.
13602func (sup *ServiceUpdateParameters) UnmarshalJSON(body []byte) error {
13603	var m map[string]*json.RawMessage
13604	err := json.Unmarshal(body, &m)
13605	if err != nil {
13606		return err
13607	}
13608	for k, v := range m {
13609		switch k {
13610		case "properties":
13611			if v != nil {
13612				var serviceUpdateProperties ServiceUpdateProperties
13613				err = json.Unmarshal(*v, &serviceUpdateProperties)
13614				if err != nil {
13615					return err
13616				}
13617				sup.ServiceUpdateProperties = &serviceUpdateProperties
13618			}
13619		case "sku":
13620			if v != nil {
13621				var sku ServiceSkuProperties
13622				err = json.Unmarshal(*v, &sku)
13623				if err != nil {
13624					return err
13625				}
13626				sup.Sku = &sku
13627			}
13628		case "identity":
13629			if v != nil {
13630				var identity ServiceIdentity
13631				err = json.Unmarshal(*v, &identity)
13632				if err != nil {
13633					return err
13634				}
13635				sup.Identity = &identity
13636			}
13637		case "etag":
13638			if v != nil {
13639				var etag string
13640				err = json.Unmarshal(*v, &etag)
13641				if err != nil {
13642					return err
13643				}
13644				sup.Etag = &etag
13645			}
13646		case "id":
13647			if v != nil {
13648				var ID string
13649				err = json.Unmarshal(*v, &ID)
13650				if err != nil {
13651					return err
13652				}
13653				sup.ID = &ID
13654			}
13655		case "name":
13656			if v != nil {
13657				var name string
13658				err = json.Unmarshal(*v, &name)
13659				if err != nil {
13660					return err
13661				}
13662				sup.Name = &name
13663			}
13664		case "type":
13665			if v != nil {
13666				var typeVar string
13667				err = json.Unmarshal(*v, &typeVar)
13668				if err != nil {
13669					return err
13670				}
13671				sup.Type = &typeVar
13672			}
13673		case "tags":
13674			if v != nil {
13675				var tags map[string]*string
13676				err = json.Unmarshal(*v, &tags)
13677				if err != nil {
13678					return err
13679				}
13680				sup.Tags = tags
13681			}
13682		}
13683	}
13684
13685	return nil
13686}
13687
13688// ServiceUpdateProperties properties of an API Management service resource description.
13689type ServiceUpdateProperties struct {
13690	// PublisherEmail - Publisher email.
13691	PublisherEmail *string `json:"publisherEmail,omitempty"`
13692	// PublisherName - Publisher name.
13693	PublisherName *string `json:"publisherName,omitempty"`
13694	// NotificationSenderEmail - Email address from which the notification will be sent.
13695	NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"`
13696	// 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.
13697	ProvisioningState *string `json:"provisioningState,omitempty"`
13698	// TargetProvisioningState - READ-ONLY; The provisioning state of the API Management service, which is targeted by the long running operation started on the service.
13699	TargetProvisioningState *string `json:"targetProvisioningState,omitempty"`
13700	// 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.
13701	CreatedAtUtc *date.Time `json:"createdAtUtc,omitempty"`
13702	// GatewayURL - READ-ONLY; Gateway URL of the API Management service.
13703	GatewayURL *string `json:"gatewayUrl,omitempty"`
13704	// GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Default Region.
13705	GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"`
13706	// PortalURL - READ-ONLY; Publisher portal endpoint Url of the API Management service.
13707	PortalURL *string `json:"portalUrl,omitempty"`
13708	// ManagementAPIURL - READ-ONLY; Management API endpoint URL of the API Management service.
13709	ManagementAPIURL *string `json:"managementApiUrl,omitempty"`
13710	// ScmURL - READ-ONLY; SCM endpoint URL of the API Management service.
13711	ScmURL *string `json:"scmUrl,omitempty"`
13712	// DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service.
13713	DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"`
13714	// HostnameConfigurations - Custom hostname configuration of the API Management service.
13715	HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"`
13716	// 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.
13717	PublicIPAddresses *[]string `json:"publicIPAddresses,omitempty"`
13718	// 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.
13719	PrivateIPAddresses *[]string `json:"privateIPAddresses,omitempty"`
13720	// 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.
13721	PublicIPAddressID *string `json:"publicIpAddressId,omitempty"`
13722	// VirtualNetworkConfiguration - Virtual network configuration of the API Management service.
13723	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
13724	// AdditionalLocations - Additional datacenter locations of the API Management service.
13725	AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"`
13726	// 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
13727	CustomProperties map[string]*string `json:"customProperties"`
13728	// Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10.
13729	Certificates *[]CertificateConfiguration `json:"certificates,omitempty"`
13730	// 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.
13731	EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"`
13732	// DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region.
13733	DisableGateway *bool `json:"disableGateway,omitempty"`
13734	// 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'
13735	VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"`
13736	// APIVersionConstraint - Control Plane Apis version constraint for the API Management service.
13737	APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"`
13738	// 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.
13739	Restore *bool `json:"restore,omitempty"`
13740}
13741
13742// MarshalJSON is the custom marshaler for ServiceUpdateProperties.
13743func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) {
13744	objectMap := make(map[string]interface{})
13745	if sup.PublisherEmail != nil {
13746		objectMap["publisherEmail"] = sup.PublisherEmail
13747	}
13748	if sup.PublisherName != nil {
13749		objectMap["publisherName"] = sup.PublisherName
13750	}
13751	if sup.NotificationSenderEmail != nil {
13752		objectMap["notificationSenderEmail"] = sup.NotificationSenderEmail
13753	}
13754	if sup.HostnameConfigurations != nil {
13755		objectMap["hostnameConfigurations"] = sup.HostnameConfigurations
13756	}
13757	if sup.PublicIPAddressID != nil {
13758		objectMap["publicIpAddressId"] = sup.PublicIPAddressID
13759	}
13760	if sup.VirtualNetworkConfiguration != nil {
13761		objectMap["virtualNetworkConfiguration"] = sup.VirtualNetworkConfiguration
13762	}
13763	if sup.AdditionalLocations != nil {
13764		objectMap["additionalLocations"] = sup.AdditionalLocations
13765	}
13766	if sup.CustomProperties != nil {
13767		objectMap["customProperties"] = sup.CustomProperties
13768	}
13769	if sup.Certificates != nil {
13770		objectMap["certificates"] = sup.Certificates
13771	}
13772	if sup.EnableClientCertificate != nil {
13773		objectMap["enableClientCertificate"] = sup.EnableClientCertificate
13774	}
13775	if sup.DisableGateway != nil {
13776		objectMap["disableGateway"] = sup.DisableGateway
13777	}
13778	if sup.VirtualNetworkType != "" {
13779		objectMap["virtualNetworkType"] = sup.VirtualNetworkType
13780	}
13781	if sup.APIVersionConstraint != nil {
13782		objectMap["apiVersionConstraint"] = sup.APIVersionConstraint
13783	}
13784	if sup.Restore != nil {
13785		objectMap["restore"] = sup.Restore
13786	}
13787	return json.Marshal(objectMap)
13788}
13789
13790// Sku describes an available ApiManagement SKU.
13791type Sku struct {
13792	// ResourceType - READ-ONLY; The type of resource the SKU applies to.
13793	ResourceType *string `json:"resourceType,omitempty"`
13794	// Name - READ-ONLY; The name of SKU.
13795	Name *string `json:"name,omitempty"`
13796	// Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.<br /><br /> Possible Values:<br /><br /> **Standard**<br /><br /> **Basic**
13797	Tier *string `json:"tier,omitempty"`
13798	// Size - READ-ONLY; The Size of the SKU.
13799	Size *string `json:"size,omitempty"`
13800	// Family - READ-ONLY; The Family of this particular SKU.
13801	Family *string `json:"family,omitempty"`
13802	// Kind - READ-ONLY; The Kind of resources that are supported in this SKU.
13803	Kind *string `json:"kind,omitempty"`
13804	// Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set.
13805	Capacity *SkuCapacity `json:"capacity,omitempty"`
13806	// Locations - READ-ONLY; The set of locations that the SKU is available.
13807	Locations *[]string `json:"locations,omitempty"`
13808	// LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available.
13809	LocationInfo *[]SkuLocationInfo `json:"locationInfo,omitempty"`
13810	// APIVersions - READ-ONLY; The api versions that support this SKU.
13811	APIVersions *[]string `json:"apiVersions,omitempty"`
13812	// Costs - READ-ONLY; Metadata for retrieving price info.
13813	Costs *[]SkuCosts `json:"costs,omitempty"`
13814	// Capabilities - READ-ONLY; A name value pair to describe the capability.
13815	Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"`
13816	// Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
13817	Restrictions *[]SkuRestrictions `json:"restrictions,omitempty"`
13818}
13819
13820// MarshalJSON is the custom marshaler for Sku.
13821func (s Sku) MarshalJSON() ([]byte, error) {
13822	objectMap := make(map[string]interface{})
13823	return json.Marshal(objectMap)
13824}
13825
13826// SkuCapabilities describes The SKU capabilities object.
13827type SkuCapabilities struct {
13828	// Name - READ-ONLY; An invariant to describe the feature.
13829	Name *string `json:"name,omitempty"`
13830	// Value - READ-ONLY; An invariant if the feature is measured by quantity.
13831	Value *string `json:"value,omitempty"`
13832}
13833
13834// MarshalJSON is the custom marshaler for SkuCapabilities.
13835func (sc SkuCapabilities) MarshalJSON() ([]byte, error) {
13836	objectMap := make(map[string]interface{})
13837	return json.Marshal(objectMap)
13838}
13839
13840// SkuCapacity describes scaling information of a SKU.
13841type SkuCapacity struct {
13842	// Minimum - READ-ONLY; The minimum capacity.
13843	Minimum *int32 `json:"minimum,omitempty"`
13844	// Maximum - READ-ONLY; The maximum capacity that can be set.
13845	Maximum *int32 `json:"maximum,omitempty"`
13846	// Default - READ-ONLY; The default capacity.
13847	Default *int32 `json:"default,omitempty"`
13848	// ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'SkuCapacityScaleTypeAutomatic', 'SkuCapacityScaleTypeManual', 'SkuCapacityScaleTypeNone'
13849	ScaleType SkuCapacityScaleType `json:"scaleType,omitempty"`
13850}
13851
13852// MarshalJSON is the custom marshaler for SkuCapacity.
13853func (sc SkuCapacity) MarshalJSON() ([]byte, error) {
13854	objectMap := make(map[string]interface{})
13855	return json.Marshal(objectMap)
13856}
13857
13858// SkuCosts describes metadata for retrieving price info.
13859type SkuCosts struct {
13860	// MeterID - READ-ONLY; Used for querying price from commerce.
13861	MeterID *string `json:"meterID,omitempty"`
13862	// Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost.
13863	Quantity *int64 `json:"quantity,omitempty"`
13864	// ExtendedUnit - READ-ONLY; An invariant to show the extended unit.
13865	ExtendedUnit *string `json:"extendedUnit,omitempty"`
13866}
13867
13868// MarshalJSON is the custom marshaler for SkuCosts.
13869func (sc SkuCosts) MarshalJSON() ([]byte, error) {
13870	objectMap := make(map[string]interface{})
13871	return json.Marshal(objectMap)
13872}
13873
13874// SkuLocationInfo ...
13875type SkuLocationInfo struct {
13876	// Location - READ-ONLY; Location of the SKU
13877	Location *string `json:"location,omitempty"`
13878	// Zones - READ-ONLY; List of availability zones where the SKU is supported.
13879	Zones *[]string `json:"zones,omitempty"`
13880	// ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones.
13881	ZoneDetails *[]SkuZoneDetails `json:"zoneDetails,omitempty"`
13882}
13883
13884// MarshalJSON is the custom marshaler for SkuLocationInfo.
13885func (sli SkuLocationInfo) MarshalJSON() ([]byte, error) {
13886	objectMap := make(map[string]interface{})
13887	return json.Marshal(objectMap)
13888}
13889
13890// SkuRestrictionInfo ...
13891type SkuRestrictionInfo struct {
13892	// Locations - READ-ONLY; Locations where the SKU is restricted
13893	Locations *[]string `json:"locations,omitempty"`
13894	// Zones - READ-ONLY; List of availability zones where the SKU is restricted.
13895	Zones *[]string `json:"zones,omitempty"`
13896}
13897
13898// MarshalJSON is the custom marshaler for SkuRestrictionInfo.
13899func (sri SkuRestrictionInfo) MarshalJSON() ([]byte, error) {
13900	objectMap := make(map[string]interface{})
13901	return json.Marshal(objectMap)
13902}
13903
13904// SkuRestrictions describes scaling information of a SKU.
13905type SkuRestrictions struct {
13906	// Type - READ-ONLY; The type of restrictions. Possible values include: 'SkuRestrictionsTypeLocation', 'SkuRestrictionsTypeZone'
13907	Type SkuRestrictionsType `json:"type,omitempty"`
13908	// 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.
13909	Values *[]string `json:"values,omitempty"`
13910	// RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used.
13911	RestrictionInfo *SkuRestrictionInfo `json:"restrictionInfo,omitempty"`
13912	// ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'SkuRestrictionsReasonCodeQuotaID', 'SkuRestrictionsReasonCodeNotAvailableForSubscription'
13913	ReasonCode SkuRestrictionsReasonCode `json:"reasonCode,omitempty"`
13914}
13915
13916// MarshalJSON is the custom marshaler for SkuRestrictions.
13917func (sr SkuRestrictions) MarshalJSON() ([]byte, error) {
13918	objectMap := make(map[string]interface{})
13919	return json.Marshal(objectMap)
13920}
13921
13922// SkusResult the List Resource Skus operation response.
13923type SkusResult struct {
13924	autorest.Response `json:"-"`
13925	// Value - The list of skus available for the subscription.
13926	Value *[]Sku `json:"value,omitempty"`
13927	// 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
13928	NextLink *string `json:"nextLink,omitempty"`
13929}
13930
13931// MarshalJSON is the custom marshaler for SkusResult.
13932func (sr SkusResult) MarshalJSON() ([]byte, error) {
13933	objectMap := make(map[string]interface{})
13934	if sr.Value != nil {
13935		objectMap["value"] = sr.Value
13936	}
13937	return json.Marshal(objectMap)
13938}
13939
13940// SkusResultIterator provides access to a complete listing of Sku values.
13941type SkusResultIterator struct {
13942	i    int
13943	page SkusResultPage
13944}
13945
13946// NextWithContext advances to the next value.  If there was an error making
13947// the request the iterator does not advance and the error is returned.
13948func (iter *SkusResultIterator) NextWithContext(ctx context.Context) (err error) {
13949	if tracing.IsEnabled() {
13950		ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultIterator.NextWithContext")
13951		defer func() {
13952			sc := -1
13953			if iter.Response().Response.Response != nil {
13954				sc = iter.Response().Response.Response.StatusCode
13955			}
13956			tracing.EndSpan(ctx, sc, err)
13957		}()
13958	}
13959	iter.i++
13960	if iter.i < len(iter.page.Values()) {
13961		return nil
13962	}
13963	err = iter.page.NextWithContext(ctx)
13964	if err != nil {
13965		iter.i--
13966		return err
13967	}
13968	iter.i = 0
13969	return nil
13970}
13971
13972// Next advances to the next value.  If there was an error making
13973// the request the iterator does not advance and the error is returned.
13974// Deprecated: Use NextWithContext() instead.
13975func (iter *SkusResultIterator) Next() error {
13976	return iter.NextWithContext(context.Background())
13977}
13978
13979// NotDone returns true if the enumeration should be started or is not yet complete.
13980func (iter SkusResultIterator) NotDone() bool {
13981	return iter.page.NotDone() && iter.i < len(iter.page.Values())
13982}
13983
13984// Response returns the raw server response from the last page request.
13985func (iter SkusResultIterator) Response() SkusResult {
13986	return iter.page.Response()
13987}
13988
13989// Value returns the current value or a zero-initialized value if the
13990// iterator has advanced beyond the end of the collection.
13991func (iter SkusResultIterator) Value() Sku {
13992	if !iter.page.NotDone() {
13993		return Sku{}
13994	}
13995	return iter.page.Values()[iter.i]
13996}
13997
13998// Creates a new instance of the SkusResultIterator type.
13999func NewSkusResultIterator(page SkusResultPage) SkusResultIterator {
14000	return SkusResultIterator{page: page}
14001}
14002
14003// IsEmpty returns true if the ListResult contains no values.
14004func (sr SkusResult) IsEmpty() bool {
14005	return sr.Value == nil || len(*sr.Value) == 0
14006}
14007
14008// hasNextLink returns true if the NextLink is not empty.
14009func (sr SkusResult) hasNextLink() bool {
14010	return sr.NextLink != nil && len(*sr.NextLink) != 0
14011}
14012
14013// skusResultPreparer prepares a request to retrieve the next set of results.
14014// It returns nil if no more results exist.
14015func (sr SkusResult) skusResultPreparer(ctx context.Context) (*http.Request, error) {
14016	if !sr.hasNextLink() {
14017		return nil, nil
14018	}
14019	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14020		autorest.AsJSON(),
14021		autorest.AsGet(),
14022		autorest.WithBaseURL(to.String(sr.NextLink)))
14023}
14024
14025// SkusResultPage contains a page of Sku values.
14026type SkusResultPage struct {
14027	fn func(context.Context, SkusResult) (SkusResult, error)
14028	sr SkusResult
14029}
14030
14031// NextWithContext advances to the next page of values.  If there was an error making
14032// the request the page does not advance and the error is returned.
14033func (page *SkusResultPage) NextWithContext(ctx context.Context) (err error) {
14034	if tracing.IsEnabled() {
14035		ctx = tracing.StartSpan(ctx, fqdn+"/SkusResultPage.NextWithContext")
14036		defer func() {
14037			sc := -1
14038			if page.Response().Response.Response != nil {
14039				sc = page.Response().Response.Response.StatusCode
14040			}
14041			tracing.EndSpan(ctx, sc, err)
14042		}()
14043	}
14044	for {
14045		next, err := page.fn(ctx, page.sr)
14046		if err != nil {
14047			return err
14048		}
14049		page.sr = next
14050		if !next.hasNextLink() || !next.IsEmpty() {
14051			break
14052		}
14053	}
14054	return nil
14055}
14056
14057// Next advances to the next page of values.  If there was an error making
14058// the request the page does not advance and the error is returned.
14059// Deprecated: Use NextWithContext() instead.
14060func (page *SkusResultPage) Next() error {
14061	return page.NextWithContext(context.Background())
14062}
14063
14064// NotDone returns true if the page enumeration should be started or is not yet complete.
14065func (page SkusResultPage) NotDone() bool {
14066	return !page.sr.IsEmpty()
14067}
14068
14069// Response returns the raw server response from the last page request.
14070func (page SkusResultPage) Response() SkusResult {
14071	return page.sr
14072}
14073
14074// Values returns the slice of values for the current page or nil if there are no values.
14075func (page SkusResultPage) Values() []Sku {
14076	if page.sr.IsEmpty() {
14077		return nil
14078	}
14079	return *page.sr.Value
14080}
14081
14082// Creates a new instance of the SkusResultPage type.
14083func NewSkusResultPage(cur SkusResult, getNextPage func(context.Context, SkusResult) (SkusResult, error)) SkusResultPage {
14084	return SkusResultPage{
14085		fn: getNextPage,
14086		sr: cur,
14087	}
14088}
14089
14090// SkuZoneDetails describes The zonal capabilities of a SKU.
14091type SkuZoneDetails struct {
14092	// Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities.
14093	Name *[]string `json:"name,omitempty"`
14094	// Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones.
14095	Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"`
14096}
14097
14098// MarshalJSON is the custom marshaler for SkuZoneDetails.
14099func (szd SkuZoneDetails) MarshalJSON() ([]byte, error) {
14100	objectMap := make(map[string]interface{})
14101	return json.Marshal(objectMap)
14102}
14103
14104// SubscriptionCollection paged Subscriptions list representation.
14105type SubscriptionCollection struct {
14106	autorest.Response `json:"-"`
14107	// Value - Page values.
14108	Value *[]SubscriptionContract `json:"value,omitempty"`
14109	// Count - Total record count number across all pages.
14110	Count *int64 `json:"count,omitempty"`
14111	// NextLink - Next page link if any.
14112	NextLink *string `json:"nextLink,omitempty"`
14113}
14114
14115// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values.
14116type SubscriptionCollectionIterator struct {
14117	i    int
14118	page SubscriptionCollectionPage
14119}
14120
14121// NextWithContext advances to the next value.  If there was an error making
14122// the request the iterator does not advance and the error is returned.
14123func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
14124	if tracing.IsEnabled() {
14125		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext")
14126		defer func() {
14127			sc := -1
14128			if iter.Response().Response.Response != nil {
14129				sc = iter.Response().Response.Response.StatusCode
14130			}
14131			tracing.EndSpan(ctx, sc, err)
14132		}()
14133	}
14134	iter.i++
14135	if iter.i < len(iter.page.Values()) {
14136		return nil
14137	}
14138	err = iter.page.NextWithContext(ctx)
14139	if err != nil {
14140		iter.i--
14141		return err
14142	}
14143	iter.i = 0
14144	return nil
14145}
14146
14147// Next advances to the next value.  If there was an error making
14148// the request the iterator does not advance and the error is returned.
14149// Deprecated: Use NextWithContext() instead.
14150func (iter *SubscriptionCollectionIterator) Next() error {
14151	return iter.NextWithContext(context.Background())
14152}
14153
14154// NotDone returns true if the enumeration should be started or is not yet complete.
14155func (iter SubscriptionCollectionIterator) NotDone() bool {
14156	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14157}
14158
14159// Response returns the raw server response from the last page request.
14160func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection {
14161	return iter.page.Response()
14162}
14163
14164// Value returns the current value or a zero-initialized value if the
14165// iterator has advanced beyond the end of the collection.
14166func (iter SubscriptionCollectionIterator) Value() SubscriptionContract {
14167	if !iter.page.NotDone() {
14168		return SubscriptionContract{}
14169	}
14170	return iter.page.Values()[iter.i]
14171}
14172
14173// Creates a new instance of the SubscriptionCollectionIterator type.
14174func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator {
14175	return SubscriptionCollectionIterator{page: page}
14176}
14177
14178// IsEmpty returns true if the ListResult contains no values.
14179func (sc SubscriptionCollection) IsEmpty() bool {
14180	return sc.Value == nil || len(*sc.Value) == 0
14181}
14182
14183// hasNextLink returns true if the NextLink is not empty.
14184func (sc SubscriptionCollection) hasNextLink() bool {
14185	return sc.NextLink != nil && len(*sc.NextLink) != 0
14186}
14187
14188// subscriptionCollectionPreparer prepares a request to retrieve the next set of results.
14189// It returns nil if no more results exist.
14190func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
14191	if !sc.hasNextLink() {
14192		return nil, nil
14193	}
14194	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14195		autorest.AsJSON(),
14196		autorest.AsGet(),
14197		autorest.WithBaseURL(to.String(sc.NextLink)))
14198}
14199
14200// SubscriptionCollectionPage contains a page of SubscriptionContract values.
14201type SubscriptionCollectionPage struct {
14202	fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)
14203	sc SubscriptionCollection
14204}
14205
14206// NextWithContext advances to the next page of values.  If there was an error making
14207// the request the page does not advance and the error is returned.
14208func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
14209	if tracing.IsEnabled() {
14210		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext")
14211		defer func() {
14212			sc := -1
14213			if page.Response().Response.Response != nil {
14214				sc = page.Response().Response.Response.StatusCode
14215			}
14216			tracing.EndSpan(ctx, sc, err)
14217		}()
14218	}
14219	for {
14220		next, err := page.fn(ctx, page.sc)
14221		if err != nil {
14222			return err
14223		}
14224		page.sc = next
14225		if !next.hasNextLink() || !next.IsEmpty() {
14226			break
14227		}
14228	}
14229	return nil
14230}
14231
14232// Next advances to the next page of values.  If there was an error making
14233// the request the page does not advance and the error is returned.
14234// Deprecated: Use NextWithContext() instead.
14235func (page *SubscriptionCollectionPage) Next() error {
14236	return page.NextWithContext(context.Background())
14237}
14238
14239// NotDone returns true if the page enumeration should be started or is not yet complete.
14240func (page SubscriptionCollectionPage) NotDone() bool {
14241	return !page.sc.IsEmpty()
14242}
14243
14244// Response returns the raw server response from the last page request.
14245func (page SubscriptionCollectionPage) Response() SubscriptionCollection {
14246	return page.sc
14247}
14248
14249// Values returns the slice of values for the current page or nil if there are no values.
14250func (page SubscriptionCollectionPage) Values() []SubscriptionContract {
14251	if page.sc.IsEmpty() {
14252		return nil
14253	}
14254	return *page.sc.Value
14255}
14256
14257// Creates a new instance of the SubscriptionCollectionPage type.
14258func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage {
14259	return SubscriptionCollectionPage{
14260		fn: getNextPage,
14261		sc: cur,
14262	}
14263}
14264
14265// SubscriptionContract subscription details.
14266type SubscriptionContract struct {
14267	autorest.Response `json:"-"`
14268	// SubscriptionContractProperties - Subscription contract properties.
14269	*SubscriptionContractProperties `json:"properties,omitempty"`
14270	// ID - READ-ONLY; Resource ID.
14271	ID *string `json:"id,omitempty"`
14272	// Name - READ-ONLY; Resource name.
14273	Name *string `json:"name,omitempty"`
14274	// Type - READ-ONLY; Resource type for API Management resource.
14275	Type *string `json:"type,omitempty"`
14276}
14277
14278// MarshalJSON is the custom marshaler for SubscriptionContract.
14279func (sc SubscriptionContract) MarshalJSON() ([]byte, error) {
14280	objectMap := make(map[string]interface{})
14281	if sc.SubscriptionContractProperties != nil {
14282		objectMap["properties"] = sc.SubscriptionContractProperties
14283	}
14284	return json.Marshal(objectMap)
14285}
14286
14287// UnmarshalJSON is the custom unmarshaler for SubscriptionContract struct.
14288func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error {
14289	var m map[string]*json.RawMessage
14290	err := json.Unmarshal(body, &m)
14291	if err != nil {
14292		return err
14293	}
14294	for k, v := range m {
14295		switch k {
14296		case "properties":
14297			if v != nil {
14298				var subscriptionContractProperties SubscriptionContractProperties
14299				err = json.Unmarshal(*v, &subscriptionContractProperties)
14300				if err != nil {
14301					return err
14302				}
14303				sc.SubscriptionContractProperties = &subscriptionContractProperties
14304			}
14305		case "id":
14306			if v != nil {
14307				var ID string
14308				err = json.Unmarshal(*v, &ID)
14309				if err != nil {
14310					return err
14311				}
14312				sc.ID = &ID
14313			}
14314		case "name":
14315			if v != nil {
14316				var name string
14317				err = json.Unmarshal(*v, &name)
14318				if err != nil {
14319					return err
14320				}
14321				sc.Name = &name
14322			}
14323		case "type":
14324			if v != nil {
14325				var typeVar string
14326				err = json.Unmarshal(*v, &typeVar)
14327				if err != nil {
14328					return err
14329				}
14330				sc.Type = &typeVar
14331			}
14332		}
14333	}
14334
14335	return nil
14336}
14337
14338// SubscriptionContractProperties subscription details.
14339type SubscriptionContractProperties struct {
14340	// 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.
14341	OwnerID *string `json:"ownerId,omitempty"`
14342	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}.
14343	Scope *string `json:"scope,omitempty"`
14344	// DisplayName - The name of the subscription, or null if the subscription has no name.
14345	DisplayName *string `json:"displayName,omitempty"`
14346	// 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'
14347	State SubscriptionState `json:"state,omitempty"`
14348	// 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.
14349	CreatedDate *date.Time `json:"createdDate,omitempty"`
14350	// 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.
14351	StartDate *date.Time `json:"startDate,omitempty"`
14352	// 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.
14353	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
14354	// 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.
14355	EndDate *date.Time `json:"endDate,omitempty"`
14356	// 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.
14357	NotificationDate *date.Time `json:"notificationDate,omitempty"`
14358	// PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
14359	PrimaryKey *string `json:"primaryKey,omitempty"`
14360	// SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
14361	SecondaryKey *string `json:"secondaryKey,omitempty"`
14362	// StateComment - Optional subscription comment added by an administrator when the state is changed to the 'rejected'.
14363	StateComment *string `json:"stateComment,omitempty"`
14364	// AllowTracing - Determines whether tracing is enabled
14365	AllowTracing *bool `json:"allowTracing,omitempty"`
14366}
14367
14368// MarshalJSON is the custom marshaler for SubscriptionContractProperties.
14369func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) {
14370	objectMap := make(map[string]interface{})
14371	if scp.OwnerID != nil {
14372		objectMap["ownerId"] = scp.OwnerID
14373	}
14374	if scp.Scope != nil {
14375		objectMap["scope"] = scp.Scope
14376	}
14377	if scp.DisplayName != nil {
14378		objectMap["displayName"] = scp.DisplayName
14379	}
14380	if scp.State != "" {
14381		objectMap["state"] = scp.State
14382	}
14383	if scp.StartDate != nil {
14384		objectMap["startDate"] = scp.StartDate
14385	}
14386	if scp.ExpirationDate != nil {
14387		objectMap["expirationDate"] = scp.ExpirationDate
14388	}
14389	if scp.EndDate != nil {
14390		objectMap["endDate"] = scp.EndDate
14391	}
14392	if scp.NotificationDate != nil {
14393		objectMap["notificationDate"] = scp.NotificationDate
14394	}
14395	if scp.PrimaryKey != nil {
14396		objectMap["primaryKey"] = scp.PrimaryKey
14397	}
14398	if scp.SecondaryKey != nil {
14399		objectMap["secondaryKey"] = scp.SecondaryKey
14400	}
14401	if scp.StateComment != nil {
14402		objectMap["stateComment"] = scp.StateComment
14403	}
14404	if scp.AllowTracing != nil {
14405		objectMap["allowTracing"] = scp.AllowTracing
14406	}
14407	return json.Marshal(objectMap)
14408}
14409
14410// SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation.
14411type SubscriptionCreateParameterProperties struct {
14412	// OwnerID - User (user id path) for whom subscription is being created in form /users/{userId}
14413	OwnerID *string `json:"ownerId,omitempty"`
14414	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}.
14415	Scope *string `json:"scope,omitempty"`
14416	// DisplayName - Subscription name.
14417	DisplayName *string `json:"displayName,omitempty"`
14418	// PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically.
14419	PrimaryKey *string `json:"primaryKey,omitempty"`
14420	// SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically.
14421	SecondaryKey *string `json:"secondaryKey,omitempty"`
14422	// 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'
14423	State SubscriptionState `json:"state,omitempty"`
14424	// AllowTracing - Determines whether tracing can be enabled
14425	AllowTracing *bool `json:"allowTracing,omitempty"`
14426}
14427
14428// SubscriptionCreateParameters subscription create details.
14429type SubscriptionCreateParameters struct {
14430	// SubscriptionCreateParameterProperties - Subscription contract properties.
14431	*SubscriptionCreateParameterProperties `json:"properties,omitempty"`
14432}
14433
14434// MarshalJSON is the custom marshaler for SubscriptionCreateParameters.
14435func (scp SubscriptionCreateParameters) MarshalJSON() ([]byte, error) {
14436	objectMap := make(map[string]interface{})
14437	if scp.SubscriptionCreateParameterProperties != nil {
14438		objectMap["properties"] = scp.SubscriptionCreateParameterProperties
14439	}
14440	return json.Marshal(objectMap)
14441}
14442
14443// UnmarshalJSON is the custom unmarshaler for SubscriptionCreateParameters struct.
14444func (scp *SubscriptionCreateParameters) UnmarshalJSON(body []byte) error {
14445	var m map[string]*json.RawMessage
14446	err := json.Unmarshal(body, &m)
14447	if err != nil {
14448		return err
14449	}
14450	for k, v := range m {
14451		switch k {
14452		case "properties":
14453			if v != nil {
14454				var subscriptionCreateParameterProperties SubscriptionCreateParameterProperties
14455				err = json.Unmarshal(*v, &subscriptionCreateParameterProperties)
14456				if err != nil {
14457					return err
14458				}
14459				scp.SubscriptionCreateParameterProperties = &subscriptionCreateParameterProperties
14460			}
14461		}
14462	}
14463
14464	return nil
14465}
14466
14467// SubscriptionKeyParameterNamesContract subscription key parameter names details.
14468type SubscriptionKeyParameterNamesContract struct {
14469	// Header - Subscription key header name.
14470	Header *string `json:"header,omitempty"`
14471	// Query - Subscription key query string parameter name.
14472	Query *string `json:"query,omitempty"`
14473}
14474
14475// SubscriptionKeysContract subscription keys.
14476type SubscriptionKeysContract struct {
14477	autorest.Response `json:"-"`
14478	// PrimaryKey - Subscription primary key.
14479	PrimaryKey *string `json:"primaryKey,omitempty"`
14480	// SecondaryKey - Subscription secondary key.
14481	SecondaryKey *string `json:"secondaryKey,omitempty"`
14482}
14483
14484// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties.
14485type SubscriptionsDelegationSettingsProperties struct {
14486	// Enabled - Enable or disable delegation for subscriptions.
14487	Enabled *bool `json:"enabled,omitempty"`
14488}
14489
14490// SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation.
14491type SubscriptionUpdateParameterProperties struct {
14492	// OwnerID - User identifier path: /users/{userId}
14493	OwnerID *string `json:"ownerId,omitempty"`
14494	// Scope - Scope like /products/{productId} or /apis or /apis/{apiId}
14495	Scope *string `json:"scope,omitempty"`
14496	// 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.
14497	ExpirationDate *date.Time `json:"expirationDate,omitempty"`
14498	// DisplayName - Subscription name.
14499	DisplayName *string `json:"displayName,omitempty"`
14500	// PrimaryKey - Primary subscription key.
14501	PrimaryKey *string `json:"primaryKey,omitempty"`
14502	// SecondaryKey - Secondary subscription key.
14503	SecondaryKey *string `json:"secondaryKey,omitempty"`
14504	// 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'
14505	State SubscriptionState `json:"state,omitempty"`
14506	// StateComment - Comments describing subscription state change by the administrator when the state is changed to the 'rejected'.
14507	StateComment *string `json:"stateComment,omitempty"`
14508	// AllowTracing - Determines whether tracing can be enabled
14509	AllowTracing *bool `json:"allowTracing,omitempty"`
14510}
14511
14512// SubscriptionUpdateParameters subscription update details.
14513type SubscriptionUpdateParameters struct {
14514	// SubscriptionUpdateParameterProperties - Subscription Update contract properties.
14515	*SubscriptionUpdateParameterProperties `json:"properties,omitempty"`
14516}
14517
14518// MarshalJSON is the custom marshaler for SubscriptionUpdateParameters.
14519func (sup SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) {
14520	objectMap := make(map[string]interface{})
14521	if sup.SubscriptionUpdateParameterProperties != nil {
14522		objectMap["properties"] = sup.SubscriptionUpdateParameterProperties
14523	}
14524	return json.Marshal(objectMap)
14525}
14526
14527// UnmarshalJSON is the custom unmarshaler for SubscriptionUpdateParameters struct.
14528func (sup *SubscriptionUpdateParameters) UnmarshalJSON(body []byte) error {
14529	var m map[string]*json.RawMessage
14530	err := json.Unmarshal(body, &m)
14531	if err != nil {
14532		return err
14533	}
14534	for k, v := range m {
14535		switch k {
14536		case "properties":
14537			if v != nil {
14538				var subscriptionUpdateParameterProperties SubscriptionUpdateParameterProperties
14539				err = json.Unmarshal(*v, &subscriptionUpdateParameterProperties)
14540				if err != nil {
14541					return err
14542				}
14543				sup.SubscriptionUpdateParameterProperties = &subscriptionUpdateParameterProperties
14544			}
14545		}
14546	}
14547
14548	return nil
14549}
14550
14551// TagCollection paged Tag list representation.
14552type TagCollection struct {
14553	autorest.Response `json:"-"`
14554	// Value - Page values.
14555	Value *[]TagContract `json:"value,omitempty"`
14556	// Count - Total record count number across all pages.
14557	Count *int64 `json:"count,omitempty"`
14558	// NextLink - Next page link if any.
14559	NextLink *string `json:"nextLink,omitempty"`
14560}
14561
14562// TagCollectionIterator provides access to a complete listing of TagContract values.
14563type TagCollectionIterator struct {
14564	i    int
14565	page TagCollectionPage
14566}
14567
14568// NextWithContext advances to the next value.  If there was an error making
14569// the request the iterator does not advance and the error is returned.
14570func (iter *TagCollectionIterator) NextWithContext(ctx context.Context) (err error) {
14571	if tracing.IsEnabled() {
14572		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionIterator.NextWithContext")
14573		defer func() {
14574			sc := -1
14575			if iter.Response().Response.Response != nil {
14576				sc = iter.Response().Response.Response.StatusCode
14577			}
14578			tracing.EndSpan(ctx, sc, err)
14579		}()
14580	}
14581	iter.i++
14582	if iter.i < len(iter.page.Values()) {
14583		return nil
14584	}
14585	err = iter.page.NextWithContext(ctx)
14586	if err != nil {
14587		iter.i--
14588		return err
14589	}
14590	iter.i = 0
14591	return nil
14592}
14593
14594// Next advances to the next value.  If there was an error making
14595// the request the iterator does not advance and the error is returned.
14596// Deprecated: Use NextWithContext() instead.
14597func (iter *TagCollectionIterator) Next() error {
14598	return iter.NextWithContext(context.Background())
14599}
14600
14601// NotDone returns true if the enumeration should be started or is not yet complete.
14602func (iter TagCollectionIterator) NotDone() bool {
14603	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14604}
14605
14606// Response returns the raw server response from the last page request.
14607func (iter TagCollectionIterator) Response() TagCollection {
14608	return iter.page.Response()
14609}
14610
14611// Value returns the current value or a zero-initialized value if the
14612// iterator has advanced beyond the end of the collection.
14613func (iter TagCollectionIterator) Value() TagContract {
14614	if !iter.page.NotDone() {
14615		return TagContract{}
14616	}
14617	return iter.page.Values()[iter.i]
14618}
14619
14620// Creates a new instance of the TagCollectionIterator type.
14621func NewTagCollectionIterator(page TagCollectionPage) TagCollectionIterator {
14622	return TagCollectionIterator{page: page}
14623}
14624
14625// IsEmpty returns true if the ListResult contains no values.
14626func (tc TagCollection) IsEmpty() bool {
14627	return tc.Value == nil || len(*tc.Value) == 0
14628}
14629
14630// hasNextLink returns true if the NextLink is not empty.
14631func (tc TagCollection) hasNextLink() bool {
14632	return tc.NextLink != nil && len(*tc.NextLink) != 0
14633}
14634
14635// tagCollectionPreparer prepares a request to retrieve the next set of results.
14636// It returns nil if no more results exist.
14637func (tc TagCollection) tagCollectionPreparer(ctx context.Context) (*http.Request, error) {
14638	if !tc.hasNextLink() {
14639		return nil, nil
14640	}
14641	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14642		autorest.AsJSON(),
14643		autorest.AsGet(),
14644		autorest.WithBaseURL(to.String(tc.NextLink)))
14645}
14646
14647// TagCollectionPage contains a page of TagContract values.
14648type TagCollectionPage struct {
14649	fn func(context.Context, TagCollection) (TagCollection, error)
14650	tc TagCollection
14651}
14652
14653// NextWithContext advances to the next page of values.  If there was an error making
14654// the request the page does not advance and the error is returned.
14655func (page *TagCollectionPage) NextWithContext(ctx context.Context) (err error) {
14656	if tracing.IsEnabled() {
14657		ctx = tracing.StartSpan(ctx, fqdn+"/TagCollectionPage.NextWithContext")
14658		defer func() {
14659			sc := -1
14660			if page.Response().Response.Response != nil {
14661				sc = page.Response().Response.Response.StatusCode
14662			}
14663			tracing.EndSpan(ctx, sc, err)
14664		}()
14665	}
14666	for {
14667		next, err := page.fn(ctx, page.tc)
14668		if err != nil {
14669			return err
14670		}
14671		page.tc = next
14672		if !next.hasNextLink() || !next.IsEmpty() {
14673			break
14674		}
14675	}
14676	return nil
14677}
14678
14679// Next advances to the next page of values.  If there was an error making
14680// the request the page does not advance and the error is returned.
14681// Deprecated: Use NextWithContext() instead.
14682func (page *TagCollectionPage) Next() error {
14683	return page.NextWithContext(context.Background())
14684}
14685
14686// NotDone returns true if the page enumeration should be started or is not yet complete.
14687func (page TagCollectionPage) NotDone() bool {
14688	return !page.tc.IsEmpty()
14689}
14690
14691// Response returns the raw server response from the last page request.
14692func (page TagCollectionPage) Response() TagCollection {
14693	return page.tc
14694}
14695
14696// Values returns the slice of values for the current page or nil if there are no values.
14697func (page TagCollectionPage) Values() []TagContract {
14698	if page.tc.IsEmpty() {
14699		return nil
14700	}
14701	return *page.tc.Value
14702}
14703
14704// Creates a new instance of the TagCollectionPage type.
14705func NewTagCollectionPage(cur TagCollection, getNextPage func(context.Context, TagCollection) (TagCollection, error)) TagCollectionPage {
14706	return TagCollectionPage{
14707		fn: getNextPage,
14708		tc: cur,
14709	}
14710}
14711
14712// TagContract tag Contract details.
14713type TagContract struct {
14714	autorest.Response `json:"-"`
14715	// TagContractProperties - Tag entity contract properties.
14716	*TagContractProperties `json:"properties,omitempty"`
14717	// ID - READ-ONLY; Resource ID.
14718	ID *string `json:"id,omitempty"`
14719	// Name - READ-ONLY; Resource name.
14720	Name *string `json:"name,omitempty"`
14721	// Type - READ-ONLY; Resource type for API Management resource.
14722	Type *string `json:"type,omitempty"`
14723}
14724
14725// MarshalJSON is the custom marshaler for TagContract.
14726func (tc TagContract) MarshalJSON() ([]byte, error) {
14727	objectMap := make(map[string]interface{})
14728	if tc.TagContractProperties != nil {
14729		objectMap["properties"] = tc.TagContractProperties
14730	}
14731	return json.Marshal(objectMap)
14732}
14733
14734// UnmarshalJSON is the custom unmarshaler for TagContract struct.
14735func (tc *TagContract) UnmarshalJSON(body []byte) error {
14736	var m map[string]*json.RawMessage
14737	err := json.Unmarshal(body, &m)
14738	if err != nil {
14739		return err
14740	}
14741	for k, v := range m {
14742		switch k {
14743		case "properties":
14744			if v != nil {
14745				var tagContractProperties TagContractProperties
14746				err = json.Unmarshal(*v, &tagContractProperties)
14747				if err != nil {
14748					return err
14749				}
14750				tc.TagContractProperties = &tagContractProperties
14751			}
14752		case "id":
14753			if v != nil {
14754				var ID string
14755				err = json.Unmarshal(*v, &ID)
14756				if err != nil {
14757					return err
14758				}
14759				tc.ID = &ID
14760			}
14761		case "name":
14762			if v != nil {
14763				var name string
14764				err = json.Unmarshal(*v, &name)
14765				if err != nil {
14766					return err
14767				}
14768				tc.Name = &name
14769			}
14770		case "type":
14771			if v != nil {
14772				var typeVar string
14773				err = json.Unmarshal(*v, &typeVar)
14774				if err != nil {
14775					return err
14776				}
14777				tc.Type = &typeVar
14778			}
14779		}
14780	}
14781
14782	return nil
14783}
14784
14785// TagContractProperties tag contract Properties.
14786type TagContractProperties struct {
14787	// DisplayName - Tag name.
14788	DisplayName *string `json:"displayName,omitempty"`
14789}
14790
14791// TagCreateUpdateParameters parameters supplied to Create/Update Tag operations.
14792type TagCreateUpdateParameters struct {
14793	// TagContractProperties - Properties supplied to Create Tag operation.
14794	*TagContractProperties `json:"properties,omitempty"`
14795}
14796
14797// MarshalJSON is the custom marshaler for TagCreateUpdateParameters.
14798func (tcup TagCreateUpdateParameters) MarshalJSON() ([]byte, error) {
14799	objectMap := make(map[string]interface{})
14800	if tcup.TagContractProperties != nil {
14801		objectMap["properties"] = tcup.TagContractProperties
14802	}
14803	return json.Marshal(objectMap)
14804}
14805
14806// UnmarshalJSON is the custom unmarshaler for TagCreateUpdateParameters struct.
14807func (tcup *TagCreateUpdateParameters) UnmarshalJSON(body []byte) error {
14808	var m map[string]*json.RawMessage
14809	err := json.Unmarshal(body, &m)
14810	if err != nil {
14811		return err
14812	}
14813	for k, v := range m {
14814		switch k {
14815		case "properties":
14816			if v != nil {
14817				var tagContractProperties TagContractProperties
14818				err = json.Unmarshal(*v, &tagContractProperties)
14819				if err != nil {
14820					return err
14821				}
14822				tcup.TagContractProperties = &tagContractProperties
14823			}
14824		}
14825	}
14826
14827	return nil
14828}
14829
14830// TagDescriptionBaseProperties parameters supplied to the Create TagDescription operation.
14831type TagDescriptionBaseProperties struct {
14832	// Description - Description of the Tag.
14833	Description *string `json:"description,omitempty"`
14834	// ExternalDocsURL - Absolute URL of external resources describing the tag.
14835	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
14836	// ExternalDocsDescription - Description of the external resources describing the tag.
14837	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
14838}
14839
14840// TagDescriptionCollection paged TagDescription list representation.
14841type TagDescriptionCollection struct {
14842	autorest.Response `json:"-"`
14843	// Value - Page values.
14844	Value *[]TagDescriptionContract `json:"value,omitempty"`
14845	// Count - Total record count number across all pages.
14846	Count *int64 `json:"count,omitempty"`
14847	// NextLink - Next page link if any.
14848	NextLink *string `json:"nextLink,omitempty"`
14849}
14850
14851// TagDescriptionCollectionIterator provides access to a complete listing of TagDescriptionContract values.
14852type TagDescriptionCollectionIterator struct {
14853	i    int
14854	page TagDescriptionCollectionPage
14855}
14856
14857// NextWithContext advances to the next value.  If there was an error making
14858// the request the iterator does not advance and the error is returned.
14859func (iter *TagDescriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
14860	if tracing.IsEnabled() {
14861		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionIterator.NextWithContext")
14862		defer func() {
14863			sc := -1
14864			if iter.Response().Response.Response != nil {
14865				sc = iter.Response().Response.Response.StatusCode
14866			}
14867			tracing.EndSpan(ctx, sc, err)
14868		}()
14869	}
14870	iter.i++
14871	if iter.i < len(iter.page.Values()) {
14872		return nil
14873	}
14874	err = iter.page.NextWithContext(ctx)
14875	if err != nil {
14876		iter.i--
14877		return err
14878	}
14879	iter.i = 0
14880	return nil
14881}
14882
14883// Next advances to the next value.  If there was an error making
14884// the request the iterator does not advance and the error is returned.
14885// Deprecated: Use NextWithContext() instead.
14886func (iter *TagDescriptionCollectionIterator) Next() error {
14887	return iter.NextWithContext(context.Background())
14888}
14889
14890// NotDone returns true if the enumeration should be started or is not yet complete.
14891func (iter TagDescriptionCollectionIterator) NotDone() bool {
14892	return iter.page.NotDone() && iter.i < len(iter.page.Values())
14893}
14894
14895// Response returns the raw server response from the last page request.
14896func (iter TagDescriptionCollectionIterator) Response() TagDescriptionCollection {
14897	return iter.page.Response()
14898}
14899
14900// Value returns the current value or a zero-initialized value if the
14901// iterator has advanced beyond the end of the collection.
14902func (iter TagDescriptionCollectionIterator) Value() TagDescriptionContract {
14903	if !iter.page.NotDone() {
14904		return TagDescriptionContract{}
14905	}
14906	return iter.page.Values()[iter.i]
14907}
14908
14909// Creates a new instance of the TagDescriptionCollectionIterator type.
14910func NewTagDescriptionCollectionIterator(page TagDescriptionCollectionPage) TagDescriptionCollectionIterator {
14911	return TagDescriptionCollectionIterator{page: page}
14912}
14913
14914// IsEmpty returns true if the ListResult contains no values.
14915func (tdc TagDescriptionCollection) IsEmpty() bool {
14916	return tdc.Value == nil || len(*tdc.Value) == 0
14917}
14918
14919// hasNextLink returns true if the NextLink is not empty.
14920func (tdc TagDescriptionCollection) hasNextLink() bool {
14921	return tdc.NextLink != nil && len(*tdc.NextLink) != 0
14922}
14923
14924// tagDescriptionCollectionPreparer prepares a request to retrieve the next set of results.
14925// It returns nil if no more results exist.
14926func (tdc TagDescriptionCollection) tagDescriptionCollectionPreparer(ctx context.Context) (*http.Request, error) {
14927	if !tdc.hasNextLink() {
14928		return nil, nil
14929	}
14930	return autorest.Prepare((&http.Request{}).WithContext(ctx),
14931		autorest.AsJSON(),
14932		autorest.AsGet(),
14933		autorest.WithBaseURL(to.String(tdc.NextLink)))
14934}
14935
14936// TagDescriptionCollectionPage contains a page of TagDescriptionContract values.
14937type TagDescriptionCollectionPage struct {
14938	fn  func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)
14939	tdc TagDescriptionCollection
14940}
14941
14942// NextWithContext advances to the next page of values.  If there was an error making
14943// the request the page does not advance and the error is returned.
14944func (page *TagDescriptionCollectionPage) NextWithContext(ctx context.Context) (err error) {
14945	if tracing.IsEnabled() {
14946		ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionCollectionPage.NextWithContext")
14947		defer func() {
14948			sc := -1
14949			if page.Response().Response.Response != nil {
14950				sc = page.Response().Response.Response.StatusCode
14951			}
14952			tracing.EndSpan(ctx, sc, err)
14953		}()
14954	}
14955	for {
14956		next, err := page.fn(ctx, page.tdc)
14957		if err != nil {
14958			return err
14959		}
14960		page.tdc = next
14961		if !next.hasNextLink() || !next.IsEmpty() {
14962			break
14963		}
14964	}
14965	return nil
14966}
14967
14968// Next advances to the next page of values.  If there was an error making
14969// the request the page does not advance and the error is returned.
14970// Deprecated: Use NextWithContext() instead.
14971func (page *TagDescriptionCollectionPage) Next() error {
14972	return page.NextWithContext(context.Background())
14973}
14974
14975// NotDone returns true if the page enumeration should be started or is not yet complete.
14976func (page TagDescriptionCollectionPage) NotDone() bool {
14977	return !page.tdc.IsEmpty()
14978}
14979
14980// Response returns the raw server response from the last page request.
14981func (page TagDescriptionCollectionPage) Response() TagDescriptionCollection {
14982	return page.tdc
14983}
14984
14985// Values returns the slice of values for the current page or nil if there are no values.
14986func (page TagDescriptionCollectionPage) Values() []TagDescriptionContract {
14987	if page.tdc.IsEmpty() {
14988		return nil
14989	}
14990	return *page.tdc.Value
14991}
14992
14993// Creates a new instance of the TagDescriptionCollectionPage type.
14994func NewTagDescriptionCollectionPage(cur TagDescriptionCollection, getNextPage func(context.Context, TagDescriptionCollection) (TagDescriptionCollection, error)) TagDescriptionCollectionPage {
14995	return TagDescriptionCollectionPage{
14996		fn:  getNextPage,
14997		tdc: cur,
14998	}
14999}
15000
15001// TagDescriptionContract contract details.
15002type TagDescriptionContract struct {
15003	autorest.Response `json:"-"`
15004	// TagDescriptionContractProperties - TagDescription entity contract properties.
15005	*TagDescriptionContractProperties `json:"properties,omitempty"`
15006	// ID - READ-ONLY; Resource ID.
15007	ID *string `json:"id,omitempty"`
15008	// Name - READ-ONLY; Resource name.
15009	Name *string `json:"name,omitempty"`
15010	// Type - READ-ONLY; Resource type for API Management resource.
15011	Type *string `json:"type,omitempty"`
15012}
15013
15014// MarshalJSON is the custom marshaler for TagDescriptionContract.
15015func (tdc TagDescriptionContract) MarshalJSON() ([]byte, error) {
15016	objectMap := make(map[string]interface{})
15017	if tdc.TagDescriptionContractProperties != nil {
15018		objectMap["properties"] = tdc.TagDescriptionContractProperties
15019	}
15020	return json.Marshal(objectMap)
15021}
15022
15023// UnmarshalJSON is the custom unmarshaler for TagDescriptionContract struct.
15024func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error {
15025	var m map[string]*json.RawMessage
15026	err := json.Unmarshal(body, &m)
15027	if err != nil {
15028		return err
15029	}
15030	for k, v := range m {
15031		switch k {
15032		case "properties":
15033			if v != nil {
15034				var tagDescriptionContractProperties TagDescriptionContractProperties
15035				err = json.Unmarshal(*v, &tagDescriptionContractProperties)
15036				if err != nil {
15037					return err
15038				}
15039				tdc.TagDescriptionContractProperties = &tagDescriptionContractProperties
15040			}
15041		case "id":
15042			if v != nil {
15043				var ID string
15044				err = json.Unmarshal(*v, &ID)
15045				if err != nil {
15046					return err
15047				}
15048				tdc.ID = &ID
15049			}
15050		case "name":
15051			if v != nil {
15052				var name string
15053				err = json.Unmarshal(*v, &name)
15054				if err != nil {
15055					return err
15056				}
15057				tdc.Name = &name
15058			}
15059		case "type":
15060			if v != nil {
15061				var typeVar string
15062				err = json.Unmarshal(*v, &typeVar)
15063				if err != nil {
15064					return err
15065				}
15066				tdc.Type = &typeVar
15067			}
15068		}
15069	}
15070
15071	return nil
15072}
15073
15074// TagDescriptionContractProperties tagDescription contract Properties.
15075type TagDescriptionContractProperties struct {
15076	// TagID - Identifier of the tag in the form of /tags/{tagId}
15077	TagID *string `json:"tagId,omitempty"`
15078	// DisplayName - Tag name.
15079	DisplayName *string `json:"displayName,omitempty"`
15080	// Description - Description of the Tag.
15081	Description *string `json:"description,omitempty"`
15082	// ExternalDocsURL - Absolute URL of external resources describing the tag.
15083	ExternalDocsURL *string `json:"externalDocsUrl,omitempty"`
15084	// ExternalDocsDescription - Description of the external resources describing the tag.
15085	ExternalDocsDescription *string `json:"externalDocsDescription,omitempty"`
15086}
15087
15088// TagDescriptionCreateParameters parameters supplied to the Create TagDescription operation.
15089type TagDescriptionCreateParameters struct {
15090	// TagDescriptionBaseProperties - Properties supplied to Create TagDescription operation.
15091	*TagDescriptionBaseProperties `json:"properties,omitempty"`
15092}
15093
15094// MarshalJSON is the custom marshaler for TagDescriptionCreateParameters.
15095func (tdcp TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) {
15096	objectMap := make(map[string]interface{})
15097	if tdcp.TagDescriptionBaseProperties != nil {
15098		objectMap["properties"] = tdcp.TagDescriptionBaseProperties
15099	}
15100	return json.Marshal(objectMap)
15101}
15102
15103// UnmarshalJSON is the custom unmarshaler for TagDescriptionCreateParameters struct.
15104func (tdcp *TagDescriptionCreateParameters) UnmarshalJSON(body []byte) error {
15105	var m map[string]*json.RawMessage
15106	err := json.Unmarshal(body, &m)
15107	if err != nil {
15108		return err
15109	}
15110	for k, v := range m {
15111		switch k {
15112		case "properties":
15113			if v != nil {
15114				var tagDescriptionBaseProperties TagDescriptionBaseProperties
15115				err = json.Unmarshal(*v, &tagDescriptionBaseProperties)
15116				if err != nil {
15117					return err
15118				}
15119				tdcp.TagDescriptionBaseProperties = &tagDescriptionBaseProperties
15120			}
15121		}
15122	}
15123
15124	return nil
15125}
15126
15127// TagResourceCollection paged Tag list representation.
15128type TagResourceCollection struct {
15129	autorest.Response `json:"-"`
15130	// Value - Page values.
15131	Value *[]TagResourceContract `json:"value,omitempty"`
15132	// Count - Total record count number across all pages.
15133	Count *int64 `json:"count,omitempty"`
15134	// NextLink - Next page link if any.
15135	NextLink *string `json:"nextLink,omitempty"`
15136}
15137
15138// TagResourceCollectionIterator provides access to a complete listing of TagResourceContract values.
15139type TagResourceCollectionIterator struct {
15140	i    int
15141	page TagResourceCollectionPage
15142}
15143
15144// NextWithContext advances to the next value.  If there was an error making
15145// the request the iterator does not advance and the error is returned.
15146func (iter *TagResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
15147	if tracing.IsEnabled() {
15148		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionIterator.NextWithContext")
15149		defer func() {
15150			sc := -1
15151			if iter.Response().Response.Response != nil {
15152				sc = iter.Response().Response.Response.StatusCode
15153			}
15154			tracing.EndSpan(ctx, sc, err)
15155		}()
15156	}
15157	iter.i++
15158	if iter.i < len(iter.page.Values()) {
15159		return nil
15160	}
15161	err = iter.page.NextWithContext(ctx)
15162	if err != nil {
15163		iter.i--
15164		return err
15165	}
15166	iter.i = 0
15167	return nil
15168}
15169
15170// Next advances to the next value.  If there was an error making
15171// the request the iterator does not advance and the error is returned.
15172// Deprecated: Use NextWithContext() instead.
15173func (iter *TagResourceCollectionIterator) Next() error {
15174	return iter.NextWithContext(context.Background())
15175}
15176
15177// NotDone returns true if the enumeration should be started or is not yet complete.
15178func (iter TagResourceCollectionIterator) NotDone() bool {
15179	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15180}
15181
15182// Response returns the raw server response from the last page request.
15183func (iter TagResourceCollectionIterator) Response() TagResourceCollection {
15184	return iter.page.Response()
15185}
15186
15187// Value returns the current value or a zero-initialized value if the
15188// iterator has advanced beyond the end of the collection.
15189func (iter TagResourceCollectionIterator) Value() TagResourceContract {
15190	if !iter.page.NotDone() {
15191		return TagResourceContract{}
15192	}
15193	return iter.page.Values()[iter.i]
15194}
15195
15196// Creates a new instance of the TagResourceCollectionIterator type.
15197func NewTagResourceCollectionIterator(page TagResourceCollectionPage) TagResourceCollectionIterator {
15198	return TagResourceCollectionIterator{page: page}
15199}
15200
15201// IsEmpty returns true if the ListResult contains no values.
15202func (trc TagResourceCollection) IsEmpty() bool {
15203	return trc.Value == nil || len(*trc.Value) == 0
15204}
15205
15206// hasNextLink returns true if the NextLink is not empty.
15207func (trc TagResourceCollection) hasNextLink() bool {
15208	return trc.NextLink != nil && len(*trc.NextLink) != 0
15209}
15210
15211// tagResourceCollectionPreparer prepares a request to retrieve the next set of results.
15212// It returns nil if no more results exist.
15213func (trc TagResourceCollection) tagResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
15214	if !trc.hasNextLink() {
15215		return nil, nil
15216	}
15217	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15218		autorest.AsJSON(),
15219		autorest.AsGet(),
15220		autorest.WithBaseURL(to.String(trc.NextLink)))
15221}
15222
15223// TagResourceCollectionPage contains a page of TagResourceContract values.
15224type TagResourceCollectionPage struct {
15225	fn  func(context.Context, TagResourceCollection) (TagResourceCollection, error)
15226	trc TagResourceCollection
15227}
15228
15229// NextWithContext advances to the next page of values.  If there was an error making
15230// the request the page does not advance and the error is returned.
15231func (page *TagResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
15232	if tracing.IsEnabled() {
15233		ctx = tracing.StartSpan(ctx, fqdn+"/TagResourceCollectionPage.NextWithContext")
15234		defer func() {
15235			sc := -1
15236			if page.Response().Response.Response != nil {
15237				sc = page.Response().Response.Response.StatusCode
15238			}
15239			tracing.EndSpan(ctx, sc, err)
15240		}()
15241	}
15242	for {
15243		next, err := page.fn(ctx, page.trc)
15244		if err != nil {
15245			return err
15246		}
15247		page.trc = next
15248		if !next.hasNextLink() || !next.IsEmpty() {
15249			break
15250		}
15251	}
15252	return nil
15253}
15254
15255// Next advances to the next page of values.  If there was an error making
15256// the request the page does not advance and the error is returned.
15257// Deprecated: Use NextWithContext() instead.
15258func (page *TagResourceCollectionPage) Next() error {
15259	return page.NextWithContext(context.Background())
15260}
15261
15262// NotDone returns true if the page enumeration should be started or is not yet complete.
15263func (page TagResourceCollectionPage) NotDone() bool {
15264	return !page.trc.IsEmpty()
15265}
15266
15267// Response returns the raw server response from the last page request.
15268func (page TagResourceCollectionPage) Response() TagResourceCollection {
15269	return page.trc
15270}
15271
15272// Values returns the slice of values for the current page or nil if there are no values.
15273func (page TagResourceCollectionPage) Values() []TagResourceContract {
15274	if page.trc.IsEmpty() {
15275		return nil
15276	}
15277	return *page.trc.Value
15278}
15279
15280// Creates a new instance of the TagResourceCollectionPage type.
15281func NewTagResourceCollectionPage(cur TagResourceCollection, getNextPage func(context.Context, TagResourceCollection) (TagResourceCollection, error)) TagResourceCollectionPage {
15282	return TagResourceCollectionPage{
15283		fn:  getNextPage,
15284		trc: cur,
15285	}
15286}
15287
15288// TagResourceContract tagResource contract properties.
15289type TagResourceContract struct {
15290	// Tag - Tag associated with the resource.
15291	Tag *TagTagResourceContractProperties `json:"tag,omitempty"`
15292	// API - API associated with the tag.
15293	API *APITagResourceContractProperties `json:"api,omitempty"`
15294	// Operation - Operation associated with the tag.
15295	Operation *OperationTagResourceContractProperties `json:"operation,omitempty"`
15296	// Product - Product associated with the tag.
15297	Product *ProductTagResourceContractProperties `json:"product,omitempty"`
15298}
15299
15300// TagTagResourceContractProperties contract defining the Tag property in the Tag Resource Contract
15301type TagTagResourceContractProperties struct {
15302	// ID - Tag identifier
15303	ID *string `json:"id,omitempty"`
15304	// Name - Tag Name
15305	Name *string `json:"name,omitempty"`
15306}
15307
15308// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a
15309// long-running operation.
15310type TenantConfigurationDeployFuture struct {
15311	azure.FutureAPI
15312	// Result returns the result of the asynchronous operation.
15313	// If the operation has not completed it will return an error.
15314	Result func(TenantConfigurationClient) (OperationResultContract, error)
15315}
15316
15317// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15318func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error {
15319	var azFuture azure.Future
15320	if err := json.Unmarshal(body, &azFuture); err != nil {
15321		return err
15322	}
15323	future.FutureAPI = &azFuture
15324	future.Result = future.result
15325	return nil
15326}
15327
15328// result is the default implementation for TenantConfigurationDeployFuture.Result.
15329func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
15330	var done bool
15331	done, err = future.DoneWithContext(context.Background(), client)
15332	if err != nil {
15333		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure")
15334		return
15335	}
15336	if !done {
15337		orc.Response.Response = future.Response()
15338		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture")
15339		return
15340	}
15341	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15342	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
15343		orc, err = client.DeployResponder(orc.Response.Response)
15344		if err != nil {
15345			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request")
15346		}
15347	}
15348	return
15349}
15350
15351// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running
15352// operation.
15353type TenantConfigurationSaveFuture struct {
15354	azure.FutureAPI
15355	// Result returns the result of the asynchronous operation.
15356	// If the operation has not completed it will return an error.
15357	Result func(TenantConfigurationClient) (OperationResultContract, error)
15358}
15359
15360// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15361func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error {
15362	var azFuture azure.Future
15363	if err := json.Unmarshal(body, &azFuture); err != nil {
15364		return err
15365	}
15366	future.FutureAPI = &azFuture
15367	future.Result = future.result
15368	return nil
15369}
15370
15371// result is the default implementation for TenantConfigurationSaveFuture.Result.
15372func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
15373	var done bool
15374	done, err = future.DoneWithContext(context.Background(), client)
15375	if err != nil {
15376		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure")
15377		return
15378	}
15379	if !done {
15380		orc.Response.Response = future.Response()
15381		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture")
15382		return
15383	}
15384	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15385	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
15386		orc, err = client.SaveResponder(orc.Response.Response)
15387		if err != nil {
15388			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request")
15389		}
15390	}
15391	return
15392}
15393
15394// TenantConfigurationSyncStateContract result of Tenant Configuration Sync State.
15395type TenantConfigurationSyncStateContract struct {
15396	autorest.Response `json:"-"`
15397	// TenantConfigurationSyncStateContractProperties - Properties returned Tenant Configuration Sync State check.
15398	*TenantConfigurationSyncStateContractProperties `json:"properties,omitempty"`
15399}
15400
15401// MarshalJSON is the custom marshaler for TenantConfigurationSyncStateContract.
15402func (tcssc TenantConfigurationSyncStateContract) MarshalJSON() ([]byte, error) {
15403	objectMap := make(map[string]interface{})
15404	if tcssc.TenantConfigurationSyncStateContractProperties != nil {
15405		objectMap["properties"] = tcssc.TenantConfigurationSyncStateContractProperties
15406	}
15407	return json.Marshal(objectMap)
15408}
15409
15410// UnmarshalJSON is the custom unmarshaler for TenantConfigurationSyncStateContract struct.
15411func (tcssc *TenantConfigurationSyncStateContract) UnmarshalJSON(body []byte) error {
15412	var m map[string]*json.RawMessage
15413	err := json.Unmarshal(body, &m)
15414	if err != nil {
15415		return err
15416	}
15417	for k, v := range m {
15418		switch k {
15419		case "properties":
15420			if v != nil {
15421				var tenantConfigurationSyncStateContractProperties TenantConfigurationSyncStateContractProperties
15422				err = json.Unmarshal(*v, &tenantConfigurationSyncStateContractProperties)
15423				if err != nil {
15424					return err
15425				}
15426				tcssc.TenantConfigurationSyncStateContractProperties = &tenantConfigurationSyncStateContractProperties
15427			}
15428		}
15429	}
15430
15431	return nil
15432}
15433
15434// TenantConfigurationSyncStateContractProperties tenant Configuration Synchronization State.
15435type TenantConfigurationSyncStateContractProperties struct {
15436	// Branch - The name of Git branch.
15437	Branch *string `json:"branch,omitempty"`
15438	// CommitID - The latest commit Id.
15439	CommitID *string `json:"commitId,omitempty"`
15440	// IsExport - value indicating if last sync was save (true) or deploy (false) operation.
15441	IsExport *bool `json:"isExport,omitempty"`
15442	// IsSynced - value indicating if last synchronization was later than the configuration change.
15443	IsSynced *bool `json:"isSynced,omitempty"`
15444	// IsGitEnabled - value indicating whether Git configuration access is enabled.
15445	IsGitEnabled *bool `json:"isGitEnabled,omitempty"`
15446	// 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.
15447	SyncDate *date.Time `json:"syncDate,omitempty"`
15448	// 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.
15449	ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"`
15450	// LastOperationID - Most recent tenant configuration operation identifier
15451	LastOperationID *string `json:"lastOperationId,omitempty"`
15452}
15453
15454// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a
15455// long-running operation.
15456type TenantConfigurationValidateFuture struct {
15457	azure.FutureAPI
15458	// Result returns the result of the asynchronous operation.
15459	// If the operation has not completed it will return an error.
15460	Result func(TenantConfigurationClient) (OperationResultContract, error)
15461}
15462
15463// UnmarshalJSON is the custom unmarshaller for CreateFuture.
15464func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error {
15465	var azFuture azure.Future
15466	if err := json.Unmarshal(body, &azFuture); err != nil {
15467		return err
15468	}
15469	future.FutureAPI = &azFuture
15470	future.Result = future.result
15471	return nil
15472}
15473
15474// result is the default implementation for TenantConfigurationValidateFuture.Result.
15475func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) {
15476	var done bool
15477	done, err = future.DoneWithContext(context.Background(), client)
15478	if err != nil {
15479		err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure")
15480		return
15481	}
15482	if !done {
15483		orc.Response.Response = future.Response()
15484		err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture")
15485		return
15486	}
15487	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
15488	if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent {
15489		orc, err = client.ValidateResponder(orc.Response.Response)
15490		if err != nil {
15491			err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request")
15492		}
15493	}
15494	return
15495}
15496
15497// TenantSettingsCollection paged AccessInformation list representation.
15498type TenantSettingsCollection struct {
15499	autorest.Response `json:"-"`
15500	// Value - READ-ONLY; Page values.
15501	Value *[]TenantSettingsContract `json:"value,omitempty"`
15502	// NextLink - READ-ONLY; Next page link if any.
15503	NextLink *string `json:"nextLink,omitempty"`
15504}
15505
15506// MarshalJSON is the custom marshaler for TenantSettingsCollection.
15507func (tsc TenantSettingsCollection) MarshalJSON() ([]byte, error) {
15508	objectMap := make(map[string]interface{})
15509	return json.Marshal(objectMap)
15510}
15511
15512// TenantSettingsCollectionIterator provides access to a complete listing of TenantSettingsContract values.
15513type TenantSettingsCollectionIterator struct {
15514	i    int
15515	page TenantSettingsCollectionPage
15516}
15517
15518// NextWithContext advances to the next value.  If there was an error making
15519// the request the iterator does not advance and the error is returned.
15520func (iter *TenantSettingsCollectionIterator) NextWithContext(ctx context.Context) (err error) {
15521	if tracing.IsEnabled() {
15522		ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionIterator.NextWithContext")
15523		defer func() {
15524			sc := -1
15525			if iter.Response().Response.Response != nil {
15526				sc = iter.Response().Response.Response.StatusCode
15527			}
15528			tracing.EndSpan(ctx, sc, err)
15529		}()
15530	}
15531	iter.i++
15532	if iter.i < len(iter.page.Values()) {
15533		return nil
15534	}
15535	err = iter.page.NextWithContext(ctx)
15536	if err != nil {
15537		iter.i--
15538		return err
15539	}
15540	iter.i = 0
15541	return nil
15542}
15543
15544// Next advances to the next value.  If there was an error making
15545// the request the iterator does not advance and the error is returned.
15546// Deprecated: Use NextWithContext() instead.
15547func (iter *TenantSettingsCollectionIterator) Next() error {
15548	return iter.NextWithContext(context.Background())
15549}
15550
15551// NotDone returns true if the enumeration should be started or is not yet complete.
15552func (iter TenantSettingsCollectionIterator) NotDone() bool {
15553	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15554}
15555
15556// Response returns the raw server response from the last page request.
15557func (iter TenantSettingsCollectionIterator) Response() TenantSettingsCollection {
15558	return iter.page.Response()
15559}
15560
15561// Value returns the current value or a zero-initialized value if the
15562// iterator has advanced beyond the end of the collection.
15563func (iter TenantSettingsCollectionIterator) Value() TenantSettingsContract {
15564	if !iter.page.NotDone() {
15565		return TenantSettingsContract{}
15566	}
15567	return iter.page.Values()[iter.i]
15568}
15569
15570// Creates a new instance of the TenantSettingsCollectionIterator type.
15571func NewTenantSettingsCollectionIterator(page TenantSettingsCollectionPage) TenantSettingsCollectionIterator {
15572	return TenantSettingsCollectionIterator{page: page}
15573}
15574
15575// IsEmpty returns true if the ListResult contains no values.
15576func (tsc TenantSettingsCollection) IsEmpty() bool {
15577	return tsc.Value == nil || len(*tsc.Value) == 0
15578}
15579
15580// hasNextLink returns true if the NextLink is not empty.
15581func (tsc TenantSettingsCollection) hasNextLink() bool {
15582	return tsc.NextLink != nil && len(*tsc.NextLink) != 0
15583}
15584
15585// tenantSettingsCollectionPreparer prepares a request to retrieve the next set of results.
15586// It returns nil if no more results exist.
15587func (tsc TenantSettingsCollection) tenantSettingsCollectionPreparer(ctx context.Context) (*http.Request, error) {
15588	if !tsc.hasNextLink() {
15589		return nil, nil
15590	}
15591	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15592		autorest.AsJSON(),
15593		autorest.AsGet(),
15594		autorest.WithBaseURL(to.String(tsc.NextLink)))
15595}
15596
15597// TenantSettingsCollectionPage contains a page of TenantSettingsContract values.
15598type TenantSettingsCollectionPage struct {
15599	fn  func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error)
15600	tsc TenantSettingsCollection
15601}
15602
15603// NextWithContext advances to the next page of values.  If there was an error making
15604// the request the page does not advance and the error is returned.
15605func (page *TenantSettingsCollectionPage) NextWithContext(ctx context.Context) (err error) {
15606	if tracing.IsEnabled() {
15607		ctx = tracing.StartSpan(ctx, fqdn+"/TenantSettingsCollectionPage.NextWithContext")
15608		defer func() {
15609			sc := -1
15610			if page.Response().Response.Response != nil {
15611				sc = page.Response().Response.Response.StatusCode
15612			}
15613			tracing.EndSpan(ctx, sc, err)
15614		}()
15615	}
15616	for {
15617		next, err := page.fn(ctx, page.tsc)
15618		if err != nil {
15619			return err
15620		}
15621		page.tsc = next
15622		if !next.hasNextLink() || !next.IsEmpty() {
15623			break
15624		}
15625	}
15626	return nil
15627}
15628
15629// Next advances to the next page of values.  If there was an error making
15630// the request the page does not advance and the error is returned.
15631// Deprecated: Use NextWithContext() instead.
15632func (page *TenantSettingsCollectionPage) Next() error {
15633	return page.NextWithContext(context.Background())
15634}
15635
15636// NotDone returns true if the page enumeration should be started or is not yet complete.
15637func (page TenantSettingsCollectionPage) NotDone() bool {
15638	return !page.tsc.IsEmpty()
15639}
15640
15641// Response returns the raw server response from the last page request.
15642func (page TenantSettingsCollectionPage) Response() TenantSettingsCollection {
15643	return page.tsc
15644}
15645
15646// Values returns the slice of values for the current page or nil if there are no values.
15647func (page TenantSettingsCollectionPage) Values() []TenantSettingsContract {
15648	if page.tsc.IsEmpty() {
15649		return nil
15650	}
15651	return *page.tsc.Value
15652}
15653
15654// Creates a new instance of the TenantSettingsCollectionPage type.
15655func NewTenantSettingsCollectionPage(cur TenantSettingsCollection, getNextPage func(context.Context, TenantSettingsCollection) (TenantSettingsCollection, error)) TenantSettingsCollectionPage {
15656	return TenantSettingsCollectionPage{
15657		fn:  getNextPage,
15658		tsc: cur,
15659	}
15660}
15661
15662// TenantSettingsContract tenant Settings.
15663type TenantSettingsContract struct {
15664	autorest.Response `json:"-"`
15665	// TenantSettingsContractProperties - TenantSettings entity contract properties.
15666	*TenantSettingsContractProperties `json:"properties,omitempty"`
15667	// ID - READ-ONLY; Resource ID.
15668	ID *string `json:"id,omitempty"`
15669	// Name - READ-ONLY; Resource name.
15670	Name *string `json:"name,omitempty"`
15671	// Type - READ-ONLY; Resource type for API Management resource.
15672	Type *string `json:"type,omitempty"`
15673}
15674
15675// MarshalJSON is the custom marshaler for TenantSettingsContract.
15676func (tsc TenantSettingsContract) MarshalJSON() ([]byte, error) {
15677	objectMap := make(map[string]interface{})
15678	if tsc.TenantSettingsContractProperties != nil {
15679		objectMap["properties"] = tsc.TenantSettingsContractProperties
15680	}
15681	return json.Marshal(objectMap)
15682}
15683
15684// UnmarshalJSON is the custom unmarshaler for TenantSettingsContract struct.
15685func (tsc *TenantSettingsContract) UnmarshalJSON(body []byte) error {
15686	var m map[string]*json.RawMessage
15687	err := json.Unmarshal(body, &m)
15688	if err != nil {
15689		return err
15690	}
15691	for k, v := range m {
15692		switch k {
15693		case "properties":
15694			if v != nil {
15695				var tenantSettingsContractProperties TenantSettingsContractProperties
15696				err = json.Unmarshal(*v, &tenantSettingsContractProperties)
15697				if err != nil {
15698					return err
15699				}
15700				tsc.TenantSettingsContractProperties = &tenantSettingsContractProperties
15701			}
15702		case "id":
15703			if v != nil {
15704				var ID string
15705				err = json.Unmarshal(*v, &ID)
15706				if err != nil {
15707					return err
15708				}
15709				tsc.ID = &ID
15710			}
15711		case "name":
15712			if v != nil {
15713				var name string
15714				err = json.Unmarshal(*v, &name)
15715				if err != nil {
15716					return err
15717				}
15718				tsc.Name = &name
15719			}
15720		case "type":
15721			if v != nil {
15722				var typeVar string
15723				err = json.Unmarshal(*v, &typeVar)
15724				if err != nil {
15725					return err
15726				}
15727				tsc.Type = &typeVar
15728			}
15729		}
15730	}
15731
15732	return nil
15733}
15734
15735// TenantSettingsContractProperties tenant access information contract of the API Management service.
15736type TenantSettingsContractProperties struct {
15737	// Settings - Tenant settings
15738	Settings map[string]*string `json:"settings"`
15739}
15740
15741// MarshalJSON is the custom marshaler for TenantSettingsContractProperties.
15742func (tscp TenantSettingsContractProperties) MarshalJSON() ([]byte, error) {
15743	objectMap := make(map[string]interface{})
15744	if tscp.Settings != nil {
15745		objectMap["settings"] = tscp.Settings
15746	}
15747	return json.Marshal(objectMap)
15748}
15749
15750// TermsOfServiceProperties terms of service contract properties.
15751type TermsOfServiceProperties struct {
15752	// Text - A terms of service text.
15753	Text *string `json:"text,omitempty"`
15754	// Enabled - Display terms of service during a sign-up process.
15755	Enabled *bool `json:"enabled,omitempty"`
15756	// ConsentRequired - Ask user for consent to the terms of service.
15757	ConsentRequired *bool `json:"consentRequired,omitempty"`
15758}
15759
15760// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded).
15761type TokenBodyParameterContract struct {
15762	// Name - body parameter name.
15763	Name *string `json:"name,omitempty"`
15764	// Value - body parameter value.
15765	Value *string `json:"value,omitempty"`
15766}
15767
15768// UserCollection paged Users list representation.
15769type UserCollection struct {
15770	autorest.Response `json:"-"`
15771	// Value - Page values.
15772	Value *[]UserContract `json:"value,omitempty"`
15773	// Count - Total record count number across all pages.
15774	Count *int64 `json:"count,omitempty"`
15775	// NextLink - Next page link if any.
15776	NextLink *string `json:"nextLink,omitempty"`
15777}
15778
15779// UserCollectionIterator provides access to a complete listing of UserContract values.
15780type UserCollectionIterator struct {
15781	i    int
15782	page UserCollectionPage
15783}
15784
15785// NextWithContext advances to the next value.  If there was an error making
15786// the request the iterator does not advance and the error is returned.
15787func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) {
15788	if tracing.IsEnabled() {
15789		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext")
15790		defer func() {
15791			sc := -1
15792			if iter.Response().Response.Response != nil {
15793				sc = iter.Response().Response.Response.StatusCode
15794			}
15795			tracing.EndSpan(ctx, sc, err)
15796		}()
15797	}
15798	iter.i++
15799	if iter.i < len(iter.page.Values()) {
15800		return nil
15801	}
15802	err = iter.page.NextWithContext(ctx)
15803	if err != nil {
15804		iter.i--
15805		return err
15806	}
15807	iter.i = 0
15808	return nil
15809}
15810
15811// Next advances to the next value.  If there was an error making
15812// the request the iterator does not advance and the error is returned.
15813// Deprecated: Use NextWithContext() instead.
15814func (iter *UserCollectionIterator) Next() error {
15815	return iter.NextWithContext(context.Background())
15816}
15817
15818// NotDone returns true if the enumeration should be started or is not yet complete.
15819func (iter UserCollectionIterator) NotDone() bool {
15820	return iter.page.NotDone() && iter.i < len(iter.page.Values())
15821}
15822
15823// Response returns the raw server response from the last page request.
15824func (iter UserCollectionIterator) Response() UserCollection {
15825	return iter.page.Response()
15826}
15827
15828// Value returns the current value or a zero-initialized value if the
15829// iterator has advanced beyond the end of the collection.
15830func (iter UserCollectionIterator) Value() UserContract {
15831	if !iter.page.NotDone() {
15832		return UserContract{}
15833	}
15834	return iter.page.Values()[iter.i]
15835}
15836
15837// Creates a new instance of the UserCollectionIterator type.
15838func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator {
15839	return UserCollectionIterator{page: page}
15840}
15841
15842// IsEmpty returns true if the ListResult contains no values.
15843func (uc UserCollection) IsEmpty() bool {
15844	return uc.Value == nil || len(*uc.Value) == 0
15845}
15846
15847// hasNextLink returns true if the NextLink is not empty.
15848func (uc UserCollection) hasNextLink() bool {
15849	return uc.NextLink != nil && len(*uc.NextLink) != 0
15850}
15851
15852// userCollectionPreparer prepares a request to retrieve the next set of results.
15853// It returns nil if no more results exist.
15854func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) {
15855	if !uc.hasNextLink() {
15856		return nil, nil
15857	}
15858	return autorest.Prepare((&http.Request{}).WithContext(ctx),
15859		autorest.AsJSON(),
15860		autorest.AsGet(),
15861		autorest.WithBaseURL(to.String(uc.NextLink)))
15862}
15863
15864// UserCollectionPage contains a page of UserContract values.
15865type UserCollectionPage struct {
15866	fn func(context.Context, UserCollection) (UserCollection, error)
15867	uc UserCollection
15868}
15869
15870// NextWithContext advances to the next page of values.  If there was an error making
15871// the request the page does not advance and the error is returned.
15872func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) {
15873	if tracing.IsEnabled() {
15874		ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext")
15875		defer func() {
15876			sc := -1
15877			if page.Response().Response.Response != nil {
15878				sc = page.Response().Response.Response.StatusCode
15879			}
15880			tracing.EndSpan(ctx, sc, err)
15881		}()
15882	}
15883	for {
15884		next, err := page.fn(ctx, page.uc)
15885		if err != nil {
15886			return err
15887		}
15888		page.uc = next
15889		if !next.hasNextLink() || !next.IsEmpty() {
15890			break
15891		}
15892	}
15893	return nil
15894}
15895
15896// Next advances to the next page of values.  If there was an error making
15897// the request the page does not advance and the error is returned.
15898// Deprecated: Use NextWithContext() instead.
15899func (page *UserCollectionPage) Next() error {
15900	return page.NextWithContext(context.Background())
15901}
15902
15903// NotDone returns true if the page enumeration should be started or is not yet complete.
15904func (page UserCollectionPage) NotDone() bool {
15905	return !page.uc.IsEmpty()
15906}
15907
15908// Response returns the raw server response from the last page request.
15909func (page UserCollectionPage) Response() UserCollection {
15910	return page.uc
15911}
15912
15913// Values returns the slice of values for the current page or nil if there are no values.
15914func (page UserCollectionPage) Values() []UserContract {
15915	if page.uc.IsEmpty() {
15916		return nil
15917	}
15918	return *page.uc.Value
15919}
15920
15921// Creates a new instance of the UserCollectionPage type.
15922func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage {
15923	return UserCollectionPage{
15924		fn: getNextPage,
15925		uc: cur,
15926	}
15927}
15928
15929// UserContract user details.
15930type UserContract struct {
15931	autorest.Response `json:"-"`
15932	// UserContractProperties - User entity contract properties.
15933	*UserContractProperties `json:"properties,omitempty"`
15934	// ID - READ-ONLY; Resource ID.
15935	ID *string `json:"id,omitempty"`
15936	// Name - READ-ONLY; Resource name.
15937	Name *string `json:"name,omitempty"`
15938	// Type - READ-ONLY; Resource type for API Management resource.
15939	Type *string `json:"type,omitempty"`
15940}
15941
15942// MarshalJSON is the custom marshaler for UserContract.
15943func (uc UserContract) MarshalJSON() ([]byte, error) {
15944	objectMap := make(map[string]interface{})
15945	if uc.UserContractProperties != nil {
15946		objectMap["properties"] = uc.UserContractProperties
15947	}
15948	return json.Marshal(objectMap)
15949}
15950
15951// UnmarshalJSON is the custom unmarshaler for UserContract struct.
15952func (uc *UserContract) UnmarshalJSON(body []byte) error {
15953	var m map[string]*json.RawMessage
15954	err := json.Unmarshal(body, &m)
15955	if err != nil {
15956		return err
15957	}
15958	for k, v := range m {
15959		switch k {
15960		case "properties":
15961			if v != nil {
15962				var userContractProperties UserContractProperties
15963				err = json.Unmarshal(*v, &userContractProperties)
15964				if err != nil {
15965					return err
15966				}
15967				uc.UserContractProperties = &userContractProperties
15968			}
15969		case "id":
15970			if v != nil {
15971				var ID string
15972				err = json.Unmarshal(*v, &ID)
15973				if err != nil {
15974					return err
15975				}
15976				uc.ID = &ID
15977			}
15978		case "name":
15979			if v != nil {
15980				var name string
15981				err = json.Unmarshal(*v, &name)
15982				if err != nil {
15983					return err
15984				}
15985				uc.Name = &name
15986			}
15987		case "type":
15988			if v != nil {
15989				var typeVar string
15990				err = json.Unmarshal(*v, &typeVar)
15991				if err != nil {
15992					return err
15993				}
15994				uc.Type = &typeVar
15995			}
15996		}
15997	}
15998
15999	return nil
16000}
16001
16002// UserContractProperties user profile.
16003type UserContractProperties struct {
16004	// FirstName - First name.
16005	FirstName *string `json:"firstName,omitempty"`
16006	// LastName - Last name.
16007	LastName *string `json:"lastName,omitempty"`
16008	// Email - Email address.
16009	Email *string `json:"email,omitempty"`
16010	// RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
16011	RegistrationDate *date.Time `json:"registrationDate,omitempty"`
16012	// Groups - READ-ONLY; Collection of groups user is part of.
16013	Groups *[]GroupContractProperties `json:"groups,omitempty"`
16014	// 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'
16015	State UserState `json:"state,omitempty"`
16016	// Note - Optional note about a user set by the administrator.
16017	Note *string `json:"note,omitempty"`
16018	// Identities - Collection of user identities.
16019	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16020}
16021
16022// MarshalJSON is the custom marshaler for UserContractProperties.
16023func (ucp UserContractProperties) MarshalJSON() ([]byte, error) {
16024	objectMap := make(map[string]interface{})
16025	if ucp.FirstName != nil {
16026		objectMap["firstName"] = ucp.FirstName
16027	}
16028	if ucp.LastName != nil {
16029		objectMap["lastName"] = ucp.LastName
16030	}
16031	if ucp.Email != nil {
16032		objectMap["email"] = ucp.Email
16033	}
16034	if ucp.RegistrationDate != nil {
16035		objectMap["registrationDate"] = ucp.RegistrationDate
16036	}
16037	if ucp.State != "" {
16038		objectMap["state"] = ucp.State
16039	}
16040	if ucp.Note != nil {
16041		objectMap["note"] = ucp.Note
16042	}
16043	if ucp.Identities != nil {
16044		objectMap["identities"] = ucp.Identities
16045	}
16046	return json.Marshal(objectMap)
16047}
16048
16049// UserCreateParameterProperties parameters supplied to the Create User operation.
16050type UserCreateParameterProperties struct {
16051	// Email - Email address. Must not be empty and must be unique within the service instance.
16052	Email *string `json:"email,omitempty"`
16053	// FirstName - First name.
16054	FirstName *string `json:"firstName,omitempty"`
16055	// LastName - Last name.
16056	LastName *string `json:"lastName,omitempty"`
16057	// Password - User Password. If no value is provided, a default password is generated.
16058	Password *string `json:"password,omitempty"`
16059	// AppType - Determines the type of application which send the create user request. Default is legacy portal. Possible values include: 'AppTypePortal', 'AppTypeDeveloperPortal'
16060	AppType AppType `json:"appType,omitempty"`
16061	// Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'ConfirmationSignup', 'ConfirmationInvite'
16062	Confirmation Confirmation `json:"confirmation,omitempty"`
16063	// 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'
16064	State UserState `json:"state,omitempty"`
16065	// Note - Optional note about a user set by the administrator.
16066	Note *string `json:"note,omitempty"`
16067	// Identities - Collection of user identities.
16068	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16069}
16070
16071// UserCreateParameters user create details.
16072type UserCreateParameters struct {
16073	// UserCreateParameterProperties - User entity create contract properties.
16074	*UserCreateParameterProperties `json:"properties,omitempty"`
16075}
16076
16077// MarshalJSON is the custom marshaler for UserCreateParameters.
16078func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) {
16079	objectMap := make(map[string]interface{})
16080	if ucp.UserCreateParameterProperties != nil {
16081		objectMap["properties"] = ucp.UserCreateParameterProperties
16082	}
16083	return json.Marshal(objectMap)
16084}
16085
16086// UnmarshalJSON is the custom unmarshaler for UserCreateParameters struct.
16087func (ucp *UserCreateParameters) UnmarshalJSON(body []byte) error {
16088	var m map[string]*json.RawMessage
16089	err := json.Unmarshal(body, &m)
16090	if err != nil {
16091		return err
16092	}
16093	for k, v := range m {
16094		switch k {
16095		case "properties":
16096			if v != nil {
16097				var userCreateParameterProperties UserCreateParameterProperties
16098				err = json.Unmarshal(*v, &userCreateParameterProperties)
16099				if err != nil {
16100					return err
16101				}
16102				ucp.UserCreateParameterProperties = &userCreateParameterProperties
16103			}
16104		}
16105	}
16106
16107	return nil
16108}
16109
16110// UserEntityBaseParameters user Entity Base Parameters set.
16111type UserEntityBaseParameters struct {
16112	// 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'
16113	State UserState `json:"state,omitempty"`
16114	// Note - Optional note about a user set by the administrator.
16115	Note *string `json:"note,omitempty"`
16116	// Identities - Collection of user identities.
16117	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16118}
16119
16120// UserIdentityCollection list of Users Identity list representation.
16121type UserIdentityCollection struct {
16122	autorest.Response `json:"-"`
16123	// Value - User Identity values.
16124	Value *[]UserIdentityContract `json:"value,omitempty"`
16125	// Count - Total record count number across all pages.
16126	Count *int64 `json:"count,omitempty"`
16127	// NextLink - Next page link if any.
16128	NextLink *string `json:"nextLink,omitempty"`
16129}
16130
16131// UserIdentityCollectionIterator provides access to a complete listing of UserIdentityContract values.
16132type UserIdentityCollectionIterator struct {
16133	i    int
16134	page UserIdentityCollectionPage
16135}
16136
16137// NextWithContext advances to the next value.  If there was an error making
16138// the request the iterator does not advance and the error is returned.
16139func (iter *UserIdentityCollectionIterator) NextWithContext(ctx context.Context) (err error) {
16140	if tracing.IsEnabled() {
16141		ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionIterator.NextWithContext")
16142		defer func() {
16143			sc := -1
16144			if iter.Response().Response.Response != nil {
16145				sc = iter.Response().Response.Response.StatusCode
16146			}
16147			tracing.EndSpan(ctx, sc, err)
16148		}()
16149	}
16150	iter.i++
16151	if iter.i < len(iter.page.Values()) {
16152		return nil
16153	}
16154	err = iter.page.NextWithContext(ctx)
16155	if err != nil {
16156		iter.i--
16157		return err
16158	}
16159	iter.i = 0
16160	return nil
16161}
16162
16163// Next advances to the next value.  If there was an error making
16164// the request the iterator does not advance and the error is returned.
16165// Deprecated: Use NextWithContext() instead.
16166func (iter *UserIdentityCollectionIterator) Next() error {
16167	return iter.NextWithContext(context.Background())
16168}
16169
16170// NotDone returns true if the enumeration should be started or is not yet complete.
16171func (iter UserIdentityCollectionIterator) NotDone() bool {
16172	return iter.page.NotDone() && iter.i < len(iter.page.Values())
16173}
16174
16175// Response returns the raw server response from the last page request.
16176func (iter UserIdentityCollectionIterator) Response() UserIdentityCollection {
16177	return iter.page.Response()
16178}
16179
16180// Value returns the current value or a zero-initialized value if the
16181// iterator has advanced beyond the end of the collection.
16182func (iter UserIdentityCollectionIterator) Value() UserIdentityContract {
16183	if !iter.page.NotDone() {
16184		return UserIdentityContract{}
16185	}
16186	return iter.page.Values()[iter.i]
16187}
16188
16189// Creates a new instance of the UserIdentityCollectionIterator type.
16190func NewUserIdentityCollectionIterator(page UserIdentityCollectionPage) UserIdentityCollectionIterator {
16191	return UserIdentityCollectionIterator{page: page}
16192}
16193
16194// IsEmpty returns true if the ListResult contains no values.
16195func (uic UserIdentityCollection) IsEmpty() bool {
16196	return uic.Value == nil || len(*uic.Value) == 0
16197}
16198
16199// hasNextLink returns true if the NextLink is not empty.
16200func (uic UserIdentityCollection) hasNextLink() bool {
16201	return uic.NextLink != nil && len(*uic.NextLink) != 0
16202}
16203
16204// userIdentityCollectionPreparer prepares a request to retrieve the next set of results.
16205// It returns nil if no more results exist.
16206func (uic UserIdentityCollection) userIdentityCollectionPreparer(ctx context.Context) (*http.Request, error) {
16207	if !uic.hasNextLink() {
16208		return nil, nil
16209	}
16210	return autorest.Prepare((&http.Request{}).WithContext(ctx),
16211		autorest.AsJSON(),
16212		autorest.AsGet(),
16213		autorest.WithBaseURL(to.String(uic.NextLink)))
16214}
16215
16216// UserIdentityCollectionPage contains a page of UserIdentityContract values.
16217type UserIdentityCollectionPage struct {
16218	fn  func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)
16219	uic UserIdentityCollection
16220}
16221
16222// NextWithContext advances to the next page of values.  If there was an error making
16223// the request the page does not advance and the error is returned.
16224func (page *UserIdentityCollectionPage) NextWithContext(ctx context.Context) (err error) {
16225	if tracing.IsEnabled() {
16226		ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentityCollectionPage.NextWithContext")
16227		defer func() {
16228			sc := -1
16229			if page.Response().Response.Response != nil {
16230				sc = page.Response().Response.Response.StatusCode
16231			}
16232			tracing.EndSpan(ctx, sc, err)
16233		}()
16234	}
16235	for {
16236		next, err := page.fn(ctx, page.uic)
16237		if err != nil {
16238			return err
16239		}
16240		page.uic = next
16241		if !next.hasNextLink() || !next.IsEmpty() {
16242			break
16243		}
16244	}
16245	return nil
16246}
16247
16248// Next advances to the next page of values.  If there was an error making
16249// the request the page does not advance and the error is returned.
16250// Deprecated: Use NextWithContext() instead.
16251func (page *UserIdentityCollectionPage) Next() error {
16252	return page.NextWithContext(context.Background())
16253}
16254
16255// NotDone returns true if the page enumeration should be started or is not yet complete.
16256func (page UserIdentityCollectionPage) NotDone() bool {
16257	return !page.uic.IsEmpty()
16258}
16259
16260// Response returns the raw server response from the last page request.
16261func (page UserIdentityCollectionPage) Response() UserIdentityCollection {
16262	return page.uic
16263}
16264
16265// Values returns the slice of values for the current page or nil if there are no values.
16266func (page UserIdentityCollectionPage) Values() []UserIdentityContract {
16267	if page.uic.IsEmpty() {
16268		return nil
16269	}
16270	return *page.uic.Value
16271}
16272
16273// Creates a new instance of the UserIdentityCollectionPage type.
16274func NewUserIdentityCollectionPage(cur UserIdentityCollection, getNextPage func(context.Context, UserIdentityCollection) (UserIdentityCollection, error)) UserIdentityCollectionPage {
16275	return UserIdentityCollectionPage{
16276		fn:  getNextPage,
16277		uic: cur,
16278	}
16279}
16280
16281// UserIdentityContract user identity details.
16282type UserIdentityContract struct {
16283	// Provider - Identity provider name.
16284	Provider *string `json:"provider,omitempty"`
16285	// ID - Identifier value within provider.
16286	ID *string `json:"id,omitempty"`
16287}
16288
16289// UserIdentityProperties ...
16290type UserIdentityProperties struct {
16291	// PrincipalID - The principal id of user assigned identity.
16292	PrincipalID *string `json:"principalId,omitempty"`
16293	// ClientID - The client id of user assigned identity.
16294	ClientID *string `json:"clientId,omitempty"`
16295}
16296
16297// UserTokenParameterProperties parameters supplied to the Get User Token operation.
16298type UserTokenParameterProperties struct {
16299	// KeyType - The Key to be used to generate token for user. Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary'
16300	KeyType KeyType `json:"keyType,omitempty"`
16301	// 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.
16302	Expiry *date.Time `json:"expiry,omitempty"`
16303}
16304
16305// UserTokenParameters get User Token parameters.
16306type UserTokenParameters struct {
16307	// UserTokenParameterProperties - User Token Parameter contract properties.
16308	*UserTokenParameterProperties `json:"properties,omitempty"`
16309}
16310
16311// MarshalJSON is the custom marshaler for UserTokenParameters.
16312func (utp UserTokenParameters) MarshalJSON() ([]byte, error) {
16313	objectMap := make(map[string]interface{})
16314	if utp.UserTokenParameterProperties != nil {
16315		objectMap["properties"] = utp.UserTokenParameterProperties
16316	}
16317	return json.Marshal(objectMap)
16318}
16319
16320// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct.
16321func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error {
16322	var m map[string]*json.RawMessage
16323	err := json.Unmarshal(body, &m)
16324	if err != nil {
16325		return err
16326	}
16327	for k, v := range m {
16328		switch k {
16329		case "properties":
16330			if v != nil {
16331				var userTokenParameterProperties UserTokenParameterProperties
16332				err = json.Unmarshal(*v, &userTokenParameterProperties)
16333				if err != nil {
16334					return err
16335				}
16336				utp.UserTokenParameterProperties = &userTokenParameterProperties
16337			}
16338		}
16339	}
16340
16341	return nil
16342}
16343
16344// UserTokenResult get User Token response details.
16345type UserTokenResult struct {
16346	autorest.Response `json:"-"`
16347	// Value - Shared Access Authorization token for the User.
16348	Value *string `json:"value,omitempty"`
16349}
16350
16351// UserUpdateParameters user update parameters.
16352type UserUpdateParameters struct {
16353	// UserUpdateParametersProperties - User entity update contract properties.
16354	*UserUpdateParametersProperties `json:"properties,omitempty"`
16355}
16356
16357// MarshalJSON is the custom marshaler for UserUpdateParameters.
16358func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) {
16359	objectMap := make(map[string]interface{})
16360	if uup.UserUpdateParametersProperties != nil {
16361		objectMap["properties"] = uup.UserUpdateParametersProperties
16362	}
16363	return json.Marshal(objectMap)
16364}
16365
16366// UnmarshalJSON is the custom unmarshaler for UserUpdateParameters struct.
16367func (uup *UserUpdateParameters) UnmarshalJSON(body []byte) error {
16368	var m map[string]*json.RawMessage
16369	err := json.Unmarshal(body, &m)
16370	if err != nil {
16371		return err
16372	}
16373	for k, v := range m {
16374		switch k {
16375		case "properties":
16376			if v != nil {
16377				var userUpdateParametersProperties UserUpdateParametersProperties
16378				err = json.Unmarshal(*v, &userUpdateParametersProperties)
16379				if err != nil {
16380					return err
16381				}
16382				uup.UserUpdateParametersProperties = &userUpdateParametersProperties
16383			}
16384		}
16385	}
16386
16387	return nil
16388}
16389
16390// UserUpdateParametersProperties parameters supplied to the Update User operation.
16391type UserUpdateParametersProperties struct {
16392	// Email - Email address. Must not be empty and must be unique within the service instance.
16393	Email *string `json:"email,omitempty"`
16394	// Password - User Password.
16395	Password *string `json:"password,omitempty"`
16396	// FirstName - First name.
16397	FirstName *string `json:"firstName,omitempty"`
16398	// LastName - Last name.
16399	LastName *string `json:"lastName,omitempty"`
16400	// 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'
16401	State UserState `json:"state,omitempty"`
16402	// Note - Optional note about a user set by the administrator.
16403	Note *string `json:"note,omitempty"`
16404	// Identities - Collection of user identities.
16405	Identities *[]UserIdentityContract `json:"identities,omitempty"`
16406}
16407
16408// VirtualNetworkConfiguration configuration of a virtual network to which API Management service is
16409// deployed.
16410type VirtualNetworkConfiguration struct {
16411	// Vnetid - READ-ONLY; The virtual network ID. This is typically a GUID. Expect a null GUID by default.
16412	Vnetid *string `json:"vnetid,omitempty"`
16413	// Subnetname - READ-ONLY; The name of the subnet.
16414	Subnetname *string `json:"subnetname,omitempty"`
16415	// SubnetResourceID - The full resource ID of a subnet in a virtual network to deploy the API Management service in.
16416	SubnetResourceID *string `json:"subnetResourceId,omitempty"`
16417}
16418
16419// MarshalJSON is the custom marshaler for VirtualNetworkConfiguration.
16420func (vnc VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) {
16421	objectMap := make(map[string]interface{})
16422	if vnc.SubnetResourceID != nil {
16423		objectMap["subnetResourceId"] = vnc.SubnetResourceID
16424	}
16425	return json.Marshal(objectMap)
16426}
16427
16428// X509CertificateName properties of server X509Names.
16429type X509CertificateName struct {
16430	// Name - Common Name of the Certificate.
16431	Name *string `json:"name,omitempty"`
16432	// IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate.
16433	IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"`
16434}
16435