1package appconfiguration
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	"net/http"
18)
19
20// The package's fully qualified name.
21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/appconfiguration/mgmt/2019-11-01-preview/appconfiguration"
22
23// APIKey an API key used for authenticating with a configuration store endpoint.
24type APIKey struct {
25	autorest.Response `json:"-"`
26	// ID - READ-ONLY; The key ID.
27	ID *string `json:"id,omitempty"`
28	// Name - READ-ONLY; A name for the key describing its usage.
29	Name *string `json:"name,omitempty"`
30	// Value - READ-ONLY; The value of the key that is used for authentication purposes.
31	Value *string `json:"value,omitempty"`
32	// ConnectionString - READ-ONLY; A connection string that can be used by supporting clients for authentication.
33	ConnectionString *string `json:"connectionString,omitempty"`
34	// LastModified - READ-ONLY; The last time any of the key's properties were modified.
35	LastModified *date.Time `json:"lastModified,omitempty"`
36	// ReadOnly - READ-ONLY; Whether this key can only be used for read operations.
37	ReadOnly *bool `json:"readOnly,omitempty"`
38}
39
40// MarshalJSON is the custom marshaler for APIKey.
41func (ak APIKey) MarshalJSON() ([]byte, error) {
42	objectMap := make(map[string]interface{})
43	return json.Marshal(objectMap)
44}
45
46// APIKeyListResult the result of a request to list API keys.
47type APIKeyListResult struct {
48	autorest.Response `json:"-"`
49	// Value - The collection value.
50	Value *[]APIKey `json:"value,omitempty"`
51	// NextLink - The URI that can be used to request the next set of paged results.
52	NextLink *string `json:"nextLink,omitempty"`
53}
54
55// APIKeyListResultIterator provides access to a complete listing of APIKey values.
56type APIKeyListResultIterator struct {
57	i    int
58	page APIKeyListResultPage
59}
60
61// NextWithContext advances to the next value.  If there was an error making
62// the request the iterator does not advance and the error is returned.
63func (iter *APIKeyListResultIterator) NextWithContext(ctx context.Context) (err error) {
64	if tracing.IsEnabled() {
65		ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResultIterator.NextWithContext")
66		defer func() {
67			sc := -1
68			if iter.Response().Response.Response != nil {
69				sc = iter.Response().Response.Response.StatusCode
70			}
71			tracing.EndSpan(ctx, sc, err)
72		}()
73	}
74	iter.i++
75	if iter.i < len(iter.page.Values()) {
76		return nil
77	}
78	err = iter.page.NextWithContext(ctx)
79	if err != nil {
80		iter.i--
81		return err
82	}
83	iter.i = 0
84	return nil
85}
86
87// Next advances to the next value.  If there was an error making
88// the request the iterator does not advance and the error is returned.
89// Deprecated: Use NextWithContext() instead.
90func (iter *APIKeyListResultIterator) Next() error {
91	return iter.NextWithContext(context.Background())
92}
93
94// NotDone returns true if the enumeration should be started or is not yet complete.
95func (iter APIKeyListResultIterator) NotDone() bool {
96	return iter.page.NotDone() && iter.i < len(iter.page.Values())
97}
98
99// Response returns the raw server response from the last page request.
100func (iter APIKeyListResultIterator) Response() APIKeyListResult {
101	return iter.page.Response()
102}
103
104// Value returns the current value or a zero-initialized value if the
105// iterator has advanced beyond the end of the collection.
106func (iter APIKeyListResultIterator) Value() APIKey {
107	if !iter.page.NotDone() {
108		return APIKey{}
109	}
110	return iter.page.Values()[iter.i]
111}
112
113// Creates a new instance of the APIKeyListResultIterator type.
114func NewAPIKeyListResultIterator(page APIKeyListResultPage) APIKeyListResultIterator {
115	return APIKeyListResultIterator{page: page}
116}
117
118// IsEmpty returns true if the ListResult contains no values.
119func (aklr APIKeyListResult) IsEmpty() bool {
120	return aklr.Value == nil || len(*aklr.Value) == 0
121}
122
123// hasNextLink returns true if the NextLink is not empty.
124func (aklr APIKeyListResult) hasNextLink() bool {
125	return aklr.NextLink != nil && len(*aklr.NextLink) != 0
126}
127
128// aPIKeyListResultPreparer prepares a request to retrieve the next set of results.
129// It returns nil if no more results exist.
130func (aklr APIKeyListResult) aPIKeyListResultPreparer(ctx context.Context) (*http.Request, error) {
131	if !aklr.hasNextLink() {
132		return nil, nil
133	}
134	return autorest.Prepare((&http.Request{}).WithContext(ctx),
135		autorest.AsJSON(),
136		autorest.AsGet(),
137		autorest.WithBaseURL(to.String(aklr.NextLink)))
138}
139
140// APIKeyListResultPage contains a page of APIKey values.
141type APIKeyListResultPage struct {
142	fn   func(context.Context, APIKeyListResult) (APIKeyListResult, error)
143	aklr APIKeyListResult
144}
145
146// NextWithContext advances to the next page of values.  If there was an error making
147// the request the page does not advance and the error is returned.
148func (page *APIKeyListResultPage) NextWithContext(ctx context.Context) (err error) {
149	if tracing.IsEnabled() {
150		ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResultPage.NextWithContext")
151		defer func() {
152			sc := -1
153			if page.Response().Response.Response != nil {
154				sc = page.Response().Response.Response.StatusCode
155			}
156			tracing.EndSpan(ctx, sc, err)
157		}()
158	}
159	for {
160		next, err := page.fn(ctx, page.aklr)
161		if err != nil {
162			return err
163		}
164		page.aklr = next
165		if !next.hasNextLink() || !next.IsEmpty() {
166			break
167		}
168	}
169	return nil
170}
171
172// Next advances to the next page of values.  If there was an error making
173// the request the page does not advance and the error is returned.
174// Deprecated: Use NextWithContext() instead.
175func (page *APIKeyListResultPage) Next() error {
176	return page.NextWithContext(context.Background())
177}
178
179// NotDone returns true if the page enumeration should be started or is not yet complete.
180func (page APIKeyListResultPage) NotDone() bool {
181	return !page.aklr.IsEmpty()
182}
183
184// Response returns the raw server response from the last page request.
185func (page APIKeyListResultPage) Response() APIKeyListResult {
186	return page.aklr
187}
188
189// Values returns the slice of values for the current page or nil if there are no values.
190func (page APIKeyListResultPage) Values() []APIKey {
191	if page.aklr.IsEmpty() {
192		return nil
193	}
194	return *page.aklr.Value
195}
196
197// Creates a new instance of the APIKeyListResultPage type.
198func NewAPIKeyListResultPage(cur APIKeyListResult, getNextPage func(context.Context, APIKeyListResult) (APIKeyListResult, error)) APIKeyListResultPage {
199	return APIKeyListResultPage{
200		fn:   getNextPage,
201		aklr: cur,
202	}
203}
204
205// CheckNameAvailabilityParameters parameters used for checking whether a resource name is available.
206type CheckNameAvailabilityParameters struct {
207	// Name - The name to check for availability.
208	Name *string `json:"name,omitempty"`
209	// Type - The resource type to check for name availability.
210	Type *string `json:"type,omitempty"`
211}
212
213// ConfigurationStore the configuration store along with all resource properties. The Configuration Store
214// will have all information to begin utilizing it.
215type ConfigurationStore struct {
216	autorest.Response `json:"-"`
217	// Identity - The managed identity information, if configured.
218	Identity *ResourceIdentity `json:"identity,omitempty"`
219	// ConfigurationStoreProperties - The properties of a configuration store.
220	*ConfigurationStoreProperties `json:"properties,omitempty"`
221	// Sku - The sku of the configuration store.
222	Sku *Sku `json:"sku,omitempty"`
223	// ID - READ-ONLY; The resource ID.
224	ID *string `json:"id,omitempty"`
225	// Name - READ-ONLY; The name of the resource.
226	Name *string `json:"name,omitempty"`
227	// Type - READ-ONLY; The type of the resource.
228	Type *string `json:"type,omitempty"`
229	// Location - The location of the resource. This cannot be changed after the resource is created.
230	Location *string `json:"location,omitempty"`
231	// Tags - The tags of the resource.
232	Tags map[string]*string `json:"tags"`
233}
234
235// MarshalJSON is the custom marshaler for ConfigurationStore.
236func (cs ConfigurationStore) MarshalJSON() ([]byte, error) {
237	objectMap := make(map[string]interface{})
238	if cs.Identity != nil {
239		objectMap["identity"] = cs.Identity
240	}
241	if cs.ConfigurationStoreProperties != nil {
242		objectMap["properties"] = cs.ConfigurationStoreProperties
243	}
244	if cs.Sku != nil {
245		objectMap["sku"] = cs.Sku
246	}
247	if cs.Location != nil {
248		objectMap["location"] = cs.Location
249	}
250	if cs.Tags != nil {
251		objectMap["tags"] = cs.Tags
252	}
253	return json.Marshal(objectMap)
254}
255
256// UnmarshalJSON is the custom unmarshaler for ConfigurationStore struct.
257func (cs *ConfigurationStore) UnmarshalJSON(body []byte) error {
258	var m map[string]*json.RawMessage
259	err := json.Unmarshal(body, &m)
260	if err != nil {
261		return err
262	}
263	for k, v := range m {
264		switch k {
265		case "identity":
266			if v != nil {
267				var identity ResourceIdentity
268				err = json.Unmarshal(*v, &identity)
269				if err != nil {
270					return err
271				}
272				cs.Identity = &identity
273			}
274		case "properties":
275			if v != nil {
276				var configurationStoreProperties ConfigurationStoreProperties
277				err = json.Unmarshal(*v, &configurationStoreProperties)
278				if err != nil {
279					return err
280				}
281				cs.ConfigurationStoreProperties = &configurationStoreProperties
282			}
283		case "sku":
284			if v != nil {
285				var sku Sku
286				err = json.Unmarshal(*v, &sku)
287				if err != nil {
288					return err
289				}
290				cs.Sku = &sku
291			}
292		case "id":
293			if v != nil {
294				var ID string
295				err = json.Unmarshal(*v, &ID)
296				if err != nil {
297					return err
298				}
299				cs.ID = &ID
300			}
301		case "name":
302			if v != nil {
303				var name string
304				err = json.Unmarshal(*v, &name)
305				if err != nil {
306					return err
307				}
308				cs.Name = &name
309			}
310		case "type":
311			if v != nil {
312				var typeVar string
313				err = json.Unmarshal(*v, &typeVar)
314				if err != nil {
315					return err
316				}
317				cs.Type = &typeVar
318			}
319		case "location":
320			if v != nil {
321				var location string
322				err = json.Unmarshal(*v, &location)
323				if err != nil {
324					return err
325				}
326				cs.Location = &location
327			}
328		case "tags":
329			if v != nil {
330				var tags map[string]*string
331				err = json.Unmarshal(*v, &tags)
332				if err != nil {
333					return err
334				}
335				cs.Tags = tags
336			}
337		}
338	}
339
340	return nil
341}
342
343// ConfigurationStoreListResult the result of a request to list configuration stores.
344type ConfigurationStoreListResult struct {
345	autorest.Response `json:"-"`
346	// Value - The collection value.
347	Value *[]ConfigurationStore `json:"value,omitempty"`
348	// NextLink - The URI that can be used to request the next set of paged results.
349	NextLink *string `json:"nextLink,omitempty"`
350}
351
352// ConfigurationStoreListResultIterator provides access to a complete listing of ConfigurationStore values.
353type ConfigurationStoreListResultIterator struct {
354	i    int
355	page ConfigurationStoreListResultPage
356}
357
358// NextWithContext advances to the next value.  If there was an error making
359// the request the iterator does not advance and the error is returned.
360func (iter *ConfigurationStoreListResultIterator) NextWithContext(ctx context.Context) (err error) {
361	if tracing.IsEnabled() {
362		ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoreListResultIterator.NextWithContext")
363		defer func() {
364			sc := -1
365			if iter.Response().Response.Response != nil {
366				sc = iter.Response().Response.Response.StatusCode
367			}
368			tracing.EndSpan(ctx, sc, err)
369		}()
370	}
371	iter.i++
372	if iter.i < len(iter.page.Values()) {
373		return nil
374	}
375	err = iter.page.NextWithContext(ctx)
376	if err != nil {
377		iter.i--
378		return err
379	}
380	iter.i = 0
381	return nil
382}
383
384// Next advances to the next value.  If there was an error making
385// the request the iterator does not advance and the error is returned.
386// Deprecated: Use NextWithContext() instead.
387func (iter *ConfigurationStoreListResultIterator) Next() error {
388	return iter.NextWithContext(context.Background())
389}
390
391// NotDone returns true if the enumeration should be started or is not yet complete.
392func (iter ConfigurationStoreListResultIterator) NotDone() bool {
393	return iter.page.NotDone() && iter.i < len(iter.page.Values())
394}
395
396// Response returns the raw server response from the last page request.
397func (iter ConfigurationStoreListResultIterator) Response() ConfigurationStoreListResult {
398	return iter.page.Response()
399}
400
401// Value returns the current value or a zero-initialized value if the
402// iterator has advanced beyond the end of the collection.
403func (iter ConfigurationStoreListResultIterator) Value() ConfigurationStore {
404	if !iter.page.NotDone() {
405		return ConfigurationStore{}
406	}
407	return iter.page.Values()[iter.i]
408}
409
410// Creates a new instance of the ConfigurationStoreListResultIterator type.
411func NewConfigurationStoreListResultIterator(page ConfigurationStoreListResultPage) ConfigurationStoreListResultIterator {
412	return ConfigurationStoreListResultIterator{page: page}
413}
414
415// IsEmpty returns true if the ListResult contains no values.
416func (cslr ConfigurationStoreListResult) IsEmpty() bool {
417	return cslr.Value == nil || len(*cslr.Value) == 0
418}
419
420// hasNextLink returns true if the NextLink is not empty.
421func (cslr ConfigurationStoreListResult) hasNextLink() bool {
422	return cslr.NextLink != nil && len(*cslr.NextLink) != 0
423}
424
425// configurationStoreListResultPreparer prepares a request to retrieve the next set of results.
426// It returns nil if no more results exist.
427func (cslr ConfigurationStoreListResult) configurationStoreListResultPreparer(ctx context.Context) (*http.Request, error) {
428	if !cslr.hasNextLink() {
429		return nil, nil
430	}
431	return autorest.Prepare((&http.Request{}).WithContext(ctx),
432		autorest.AsJSON(),
433		autorest.AsGet(),
434		autorest.WithBaseURL(to.String(cslr.NextLink)))
435}
436
437// ConfigurationStoreListResultPage contains a page of ConfigurationStore values.
438type ConfigurationStoreListResultPage struct {
439	fn   func(context.Context, ConfigurationStoreListResult) (ConfigurationStoreListResult, error)
440	cslr ConfigurationStoreListResult
441}
442
443// NextWithContext advances to the next page of values.  If there was an error making
444// the request the page does not advance and the error is returned.
445func (page *ConfigurationStoreListResultPage) NextWithContext(ctx context.Context) (err error) {
446	if tracing.IsEnabled() {
447		ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoreListResultPage.NextWithContext")
448		defer func() {
449			sc := -1
450			if page.Response().Response.Response != nil {
451				sc = page.Response().Response.Response.StatusCode
452			}
453			tracing.EndSpan(ctx, sc, err)
454		}()
455	}
456	for {
457		next, err := page.fn(ctx, page.cslr)
458		if err != nil {
459			return err
460		}
461		page.cslr = next
462		if !next.hasNextLink() || !next.IsEmpty() {
463			break
464		}
465	}
466	return nil
467}
468
469// Next advances to the next page of values.  If there was an error making
470// the request the page does not advance and the error is returned.
471// Deprecated: Use NextWithContext() instead.
472func (page *ConfigurationStoreListResultPage) Next() error {
473	return page.NextWithContext(context.Background())
474}
475
476// NotDone returns true if the page enumeration should be started or is not yet complete.
477func (page ConfigurationStoreListResultPage) NotDone() bool {
478	return !page.cslr.IsEmpty()
479}
480
481// Response returns the raw server response from the last page request.
482func (page ConfigurationStoreListResultPage) Response() ConfigurationStoreListResult {
483	return page.cslr
484}
485
486// Values returns the slice of values for the current page or nil if there are no values.
487func (page ConfigurationStoreListResultPage) Values() []ConfigurationStore {
488	if page.cslr.IsEmpty() {
489		return nil
490	}
491	return *page.cslr.Value
492}
493
494// Creates a new instance of the ConfigurationStoreListResultPage type.
495func NewConfigurationStoreListResultPage(cur ConfigurationStoreListResult, getNextPage func(context.Context, ConfigurationStoreListResult) (ConfigurationStoreListResult, error)) ConfigurationStoreListResultPage {
496	return ConfigurationStoreListResultPage{
497		fn:   getNextPage,
498		cslr: cur,
499	}
500}
501
502// ConfigurationStoreProperties the properties of a configuration store.
503type ConfigurationStoreProperties struct {
504	// ProvisioningState - READ-ONLY; The provisioning state of the configuration store. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
505	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
506	// CreationDate - READ-ONLY; The creation date of configuration store.
507	CreationDate *date.Time `json:"creationDate,omitempty"`
508	// Endpoint - READ-ONLY; The DNS endpoint where the configuration store API will be available.
509	Endpoint *string `json:"endpoint,omitempty"`
510	// Encryption - The encryption settings of the configuration store.
511	Encryption *EncryptionProperties `json:"encryption,omitempty"`
512	// PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections that are set up for this resource.
513	PrivateEndpointConnections *[]PrivateEndpointConnectionReference `json:"privateEndpointConnections,omitempty"`
514	// PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled'
515	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
516}
517
518// MarshalJSON is the custom marshaler for ConfigurationStoreProperties.
519func (csp ConfigurationStoreProperties) MarshalJSON() ([]byte, error) {
520	objectMap := make(map[string]interface{})
521	if csp.Encryption != nil {
522		objectMap["encryption"] = csp.Encryption
523	}
524	if csp.PublicNetworkAccess != "" {
525		objectMap["publicNetworkAccess"] = csp.PublicNetworkAccess
526	}
527	return json.Marshal(objectMap)
528}
529
530// ConfigurationStorePropertiesUpdateParameters the properties for updating a configuration store.
531type ConfigurationStorePropertiesUpdateParameters struct {
532	// Encryption - The encryption settings of the configuration store.
533	Encryption *EncryptionProperties `json:"encryption,omitempty"`
534}
535
536// ConfigurationStoresCreateFuture an abstraction for monitoring and retrieving the results of a
537// long-running operation.
538type ConfigurationStoresCreateFuture struct {
539	azure.FutureAPI
540	// Result returns the result of the asynchronous operation.
541	// If the operation has not completed it will return an error.
542	Result func(ConfigurationStoresClient) (ConfigurationStore, error)
543}
544
545// UnmarshalJSON is the custom unmarshaller for CreateFuture.
546func (future *ConfigurationStoresCreateFuture) UnmarshalJSON(body []byte) error {
547	var azFuture azure.Future
548	if err := json.Unmarshal(body, &azFuture); err != nil {
549		return err
550	}
551	future.FutureAPI = &azFuture
552	future.Result = future.result
553	return nil
554}
555
556// result is the default implementation for ConfigurationStoresCreateFuture.Result.
557func (future *ConfigurationStoresCreateFuture) result(client ConfigurationStoresClient) (cs ConfigurationStore, err error) {
558	var done bool
559	done, err = future.DoneWithContext(context.Background(), client)
560	if err != nil {
561		err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresCreateFuture", "Result", future.Response(), "Polling failure")
562		return
563	}
564	if !done {
565		cs.Response.Response = future.Response()
566		err = azure.NewAsyncOpIncompleteError("appconfiguration.ConfigurationStoresCreateFuture")
567		return
568	}
569	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
570	if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent {
571		cs, err = client.CreateResponder(cs.Response.Response)
572		if err != nil {
573			err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresCreateFuture", "Result", cs.Response.Response, "Failure responding to request")
574		}
575	}
576	return
577}
578
579// ConfigurationStoresDeleteFuture an abstraction for monitoring and retrieving the results of a
580// long-running operation.
581type ConfigurationStoresDeleteFuture struct {
582	azure.FutureAPI
583	// Result returns the result of the asynchronous operation.
584	// If the operation has not completed it will return an error.
585	Result func(ConfigurationStoresClient) (autorest.Response, error)
586}
587
588// UnmarshalJSON is the custom unmarshaller for CreateFuture.
589func (future *ConfigurationStoresDeleteFuture) UnmarshalJSON(body []byte) error {
590	var azFuture azure.Future
591	if err := json.Unmarshal(body, &azFuture); err != nil {
592		return err
593	}
594	future.FutureAPI = &azFuture
595	future.Result = future.result
596	return nil
597}
598
599// result is the default implementation for ConfigurationStoresDeleteFuture.Result.
600func (future *ConfigurationStoresDeleteFuture) result(client ConfigurationStoresClient) (ar autorest.Response, err error) {
601	var done bool
602	done, err = future.DoneWithContext(context.Background(), client)
603	if err != nil {
604		err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresDeleteFuture", "Result", future.Response(), "Polling failure")
605		return
606	}
607	if !done {
608		ar.Response = future.Response()
609		err = azure.NewAsyncOpIncompleteError("appconfiguration.ConfigurationStoresDeleteFuture")
610		return
611	}
612	ar.Response = future.Response()
613	return
614}
615
616// ConfigurationStoresUpdateFuture an abstraction for monitoring and retrieving the results of a
617// long-running operation.
618type ConfigurationStoresUpdateFuture struct {
619	azure.FutureAPI
620	// Result returns the result of the asynchronous operation.
621	// If the operation has not completed it will return an error.
622	Result func(ConfigurationStoresClient) (ConfigurationStore, error)
623}
624
625// UnmarshalJSON is the custom unmarshaller for CreateFuture.
626func (future *ConfigurationStoresUpdateFuture) UnmarshalJSON(body []byte) error {
627	var azFuture azure.Future
628	if err := json.Unmarshal(body, &azFuture); err != nil {
629		return err
630	}
631	future.FutureAPI = &azFuture
632	future.Result = future.result
633	return nil
634}
635
636// result is the default implementation for ConfigurationStoresUpdateFuture.Result.
637func (future *ConfigurationStoresUpdateFuture) result(client ConfigurationStoresClient) (cs ConfigurationStore, err error) {
638	var done bool
639	done, err = future.DoneWithContext(context.Background(), client)
640	if err != nil {
641		err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresUpdateFuture", "Result", future.Response(), "Polling failure")
642		return
643	}
644	if !done {
645		cs.Response.Response = future.Response()
646		err = azure.NewAsyncOpIncompleteError("appconfiguration.ConfigurationStoresUpdateFuture")
647		return
648	}
649	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
650	if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent {
651		cs, err = client.UpdateResponder(cs.Response.Response)
652		if err != nil {
653			err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresUpdateFuture", "Result", cs.Response.Response, "Failure responding to request")
654		}
655	}
656	return
657}
658
659// ConfigurationStoreUpdateParameters the parameters for updating a configuration store.
660type ConfigurationStoreUpdateParameters struct {
661	// ConfigurationStorePropertiesUpdateParameters - The properties for updating a configuration store.
662	*ConfigurationStorePropertiesUpdateParameters `json:"properties,omitempty"`
663	// Identity - The managed identity information for the configuration store.
664	Identity *ResourceIdentity `json:"identity,omitempty"`
665	// Sku - The SKU of the configuration store.
666	Sku *Sku `json:"sku,omitempty"`
667	// Tags - The ARM resource tags.
668	Tags map[string]*string `json:"tags"`
669}
670
671// MarshalJSON is the custom marshaler for ConfigurationStoreUpdateParameters.
672func (csup ConfigurationStoreUpdateParameters) MarshalJSON() ([]byte, error) {
673	objectMap := make(map[string]interface{})
674	if csup.ConfigurationStorePropertiesUpdateParameters != nil {
675		objectMap["properties"] = csup.ConfigurationStorePropertiesUpdateParameters
676	}
677	if csup.Identity != nil {
678		objectMap["identity"] = csup.Identity
679	}
680	if csup.Sku != nil {
681		objectMap["sku"] = csup.Sku
682	}
683	if csup.Tags != nil {
684		objectMap["tags"] = csup.Tags
685	}
686	return json.Marshal(objectMap)
687}
688
689// UnmarshalJSON is the custom unmarshaler for ConfigurationStoreUpdateParameters struct.
690func (csup *ConfigurationStoreUpdateParameters) UnmarshalJSON(body []byte) error {
691	var m map[string]*json.RawMessage
692	err := json.Unmarshal(body, &m)
693	if err != nil {
694		return err
695	}
696	for k, v := range m {
697		switch k {
698		case "properties":
699			if v != nil {
700				var configurationStorePropertiesUpdateParameters ConfigurationStorePropertiesUpdateParameters
701				err = json.Unmarshal(*v, &configurationStorePropertiesUpdateParameters)
702				if err != nil {
703					return err
704				}
705				csup.ConfigurationStorePropertiesUpdateParameters = &configurationStorePropertiesUpdateParameters
706			}
707		case "identity":
708			if v != nil {
709				var identity ResourceIdentity
710				err = json.Unmarshal(*v, &identity)
711				if err != nil {
712					return err
713				}
714				csup.Identity = &identity
715			}
716		case "sku":
717			if v != nil {
718				var sku Sku
719				err = json.Unmarshal(*v, &sku)
720				if err != nil {
721					return err
722				}
723				csup.Sku = &sku
724			}
725		case "tags":
726			if v != nil {
727				var tags map[string]*string
728				err = json.Unmarshal(*v, &tags)
729				if err != nil {
730					return err
731				}
732				csup.Tags = tags
733			}
734		}
735	}
736
737	return nil
738}
739
740// EncryptionProperties the encryption settings for a configuration store.
741type EncryptionProperties struct {
742	// KeyVaultProperties - Key vault properties.
743	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
744}
745
746// Error appConfiguration error object.
747type Error struct {
748	// Code - Error code.
749	Code *string `json:"code,omitempty"`
750	// Message - Error message.
751	Message *string `json:"message,omitempty"`
752}
753
754// KeyValue the result of a request to retrieve a key-value from the specified configuration store.
755type KeyValue struct {
756	autorest.Response `json:"-"`
757	// Key - READ-ONLY; The primary identifier of a key-value.
758	// The key is used in unison with the label to uniquely identify a key-value.
759	Key *string `json:"key,omitempty"`
760	// Label - READ-ONLY; A value used to group key-values.
761	// The label is used in unison with the key to uniquely identify a key-value.
762	Label *string `json:"label,omitempty"`
763	// Value - READ-ONLY; The value of the key-value.
764	Value *string `json:"value,omitempty"`
765	// ContentType - READ-ONLY; The content type of the key-value's value.
766	// Providing a proper content-type can enable transformations of values when they are retrieved by applications.
767	ContentType *string `json:"contentType,omitempty"`
768	// ETag - READ-ONLY; An ETag indicating the state of a key-value within a configuration store.
769	ETag *string `json:"eTag,omitempty"`
770	// LastModified - READ-ONLY; The last time a modifying operation was performed on the given key-value.
771	LastModified *date.Time `json:"lastModified,omitempty"`
772	// Locked - READ-ONLY; A value indicating whether the key-value is locked.
773	// A locked key-value may not be modified until it is unlocked.
774	Locked *bool `json:"locked,omitempty"`
775	// Tags - READ-ONLY; A dictionary of tags that can help identify what a key-value may be applicable for.
776	Tags map[string]*string `json:"tags"`
777}
778
779// MarshalJSON is the custom marshaler for KeyValue.
780func (kv KeyValue) MarshalJSON() ([]byte, error) {
781	objectMap := make(map[string]interface{})
782	return json.Marshal(objectMap)
783}
784
785// KeyVaultProperties settings concerning key vault encryption for a configuration store.
786type KeyVaultProperties struct {
787	// KeyIdentifier - The URI of the key vault key used to encrypt data.
788	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
789	// IdentityClientID - The client id of the identity which will be used to access key vault.
790	IdentityClientID *string `json:"identityClientId,omitempty"`
791}
792
793// ListKeyValueParameters the parameters used to list a configuration store key-value
794type ListKeyValueParameters struct {
795	// Key - The key to retrieve.
796	Key *string `json:"key,omitempty"`
797	// Label - The label of the key.
798	Label *string `json:"label,omitempty"`
799}
800
801// NameAvailabilityStatus the result of a request to check the availability of a resource name.
802type NameAvailabilityStatus struct {
803	autorest.Response `json:"-"`
804	// NameAvailable - READ-ONLY; The value indicating whether the resource name is available.
805	NameAvailable *bool `json:"nameAvailable,omitempty"`
806	// Message - READ-ONLY; If any, the error message that provides more detail for the reason that the name is not available.
807	Message *string `json:"message,omitempty"`
808	// Reason - READ-ONLY; If any, the reason that the name is not available.
809	Reason *string `json:"reason,omitempty"`
810}
811
812// MarshalJSON is the custom marshaler for NameAvailabilityStatus.
813func (nas NameAvailabilityStatus) MarshalJSON() ([]byte, error) {
814	objectMap := make(map[string]interface{})
815	return json.Marshal(objectMap)
816}
817
818// OperationDefinition the definition of a configuration store operation.
819type OperationDefinition struct {
820	// Name - Operation name: {provider}/{resource}/{operation}.
821	Name *string `json:"name,omitempty"`
822	// Display - The display information for the configuration store operation.
823	Display *OperationDefinitionDisplay `json:"display,omitempty"`
824}
825
826// OperationDefinitionDisplay the display information for a configuration store operation.
827type OperationDefinitionDisplay struct {
828	// Provider - READ-ONLY; The resource provider name: Microsoft App Configuration."
829	Provider *string `json:"provider,omitempty"`
830	// Resource - The resource on which the operation is performed.
831	Resource *string `json:"resource,omitempty"`
832	// Operation - The operation that users can perform.
833	Operation *string `json:"operation,omitempty"`
834	// Description - The description for the operation.
835	Description *string `json:"description,omitempty"`
836}
837
838// MarshalJSON is the custom marshaler for OperationDefinitionDisplay.
839func (odd OperationDefinitionDisplay) MarshalJSON() ([]byte, error) {
840	objectMap := make(map[string]interface{})
841	if odd.Resource != nil {
842		objectMap["resource"] = odd.Resource
843	}
844	if odd.Operation != nil {
845		objectMap["operation"] = odd.Operation
846	}
847	if odd.Description != nil {
848		objectMap["description"] = odd.Description
849	}
850	return json.Marshal(objectMap)
851}
852
853// OperationDefinitionListResult the result of a request to list configuration store operations.
854type OperationDefinitionListResult struct {
855	autorest.Response `json:"-"`
856	// Value - The collection value.
857	Value *[]OperationDefinition `json:"value,omitempty"`
858	// NextLink - The URI that can be used to request the next set of paged results.
859	NextLink *string `json:"nextLink,omitempty"`
860}
861
862// OperationDefinitionListResultIterator provides access to a complete listing of OperationDefinition
863// values.
864type OperationDefinitionListResultIterator struct {
865	i    int
866	page OperationDefinitionListResultPage
867}
868
869// NextWithContext advances to the next value.  If there was an error making
870// the request the iterator does not advance and the error is returned.
871func (iter *OperationDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) {
872	if tracing.IsEnabled() {
873		ctx = tracing.StartSpan(ctx, fqdn+"/OperationDefinitionListResultIterator.NextWithContext")
874		defer func() {
875			sc := -1
876			if iter.Response().Response.Response != nil {
877				sc = iter.Response().Response.Response.StatusCode
878			}
879			tracing.EndSpan(ctx, sc, err)
880		}()
881	}
882	iter.i++
883	if iter.i < len(iter.page.Values()) {
884		return nil
885	}
886	err = iter.page.NextWithContext(ctx)
887	if err != nil {
888		iter.i--
889		return err
890	}
891	iter.i = 0
892	return nil
893}
894
895// Next advances to the next value.  If there was an error making
896// the request the iterator does not advance and the error is returned.
897// Deprecated: Use NextWithContext() instead.
898func (iter *OperationDefinitionListResultIterator) Next() error {
899	return iter.NextWithContext(context.Background())
900}
901
902// NotDone returns true if the enumeration should be started or is not yet complete.
903func (iter OperationDefinitionListResultIterator) NotDone() bool {
904	return iter.page.NotDone() && iter.i < len(iter.page.Values())
905}
906
907// Response returns the raw server response from the last page request.
908func (iter OperationDefinitionListResultIterator) Response() OperationDefinitionListResult {
909	return iter.page.Response()
910}
911
912// Value returns the current value or a zero-initialized value if the
913// iterator has advanced beyond the end of the collection.
914func (iter OperationDefinitionListResultIterator) Value() OperationDefinition {
915	if !iter.page.NotDone() {
916		return OperationDefinition{}
917	}
918	return iter.page.Values()[iter.i]
919}
920
921// Creates a new instance of the OperationDefinitionListResultIterator type.
922func NewOperationDefinitionListResultIterator(page OperationDefinitionListResultPage) OperationDefinitionListResultIterator {
923	return OperationDefinitionListResultIterator{page: page}
924}
925
926// IsEmpty returns true if the ListResult contains no values.
927func (odlr OperationDefinitionListResult) IsEmpty() bool {
928	return odlr.Value == nil || len(*odlr.Value) == 0
929}
930
931// hasNextLink returns true if the NextLink is not empty.
932func (odlr OperationDefinitionListResult) hasNextLink() bool {
933	return odlr.NextLink != nil && len(*odlr.NextLink) != 0
934}
935
936// operationDefinitionListResultPreparer prepares a request to retrieve the next set of results.
937// It returns nil if no more results exist.
938func (odlr OperationDefinitionListResult) operationDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) {
939	if !odlr.hasNextLink() {
940		return nil, nil
941	}
942	return autorest.Prepare((&http.Request{}).WithContext(ctx),
943		autorest.AsJSON(),
944		autorest.AsGet(),
945		autorest.WithBaseURL(to.String(odlr.NextLink)))
946}
947
948// OperationDefinitionListResultPage contains a page of OperationDefinition values.
949type OperationDefinitionListResultPage struct {
950	fn   func(context.Context, OperationDefinitionListResult) (OperationDefinitionListResult, error)
951	odlr OperationDefinitionListResult
952}
953
954// NextWithContext advances to the next page of values.  If there was an error making
955// the request the page does not advance and the error is returned.
956func (page *OperationDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) {
957	if tracing.IsEnabled() {
958		ctx = tracing.StartSpan(ctx, fqdn+"/OperationDefinitionListResultPage.NextWithContext")
959		defer func() {
960			sc := -1
961			if page.Response().Response.Response != nil {
962				sc = page.Response().Response.Response.StatusCode
963			}
964			tracing.EndSpan(ctx, sc, err)
965		}()
966	}
967	for {
968		next, err := page.fn(ctx, page.odlr)
969		if err != nil {
970			return err
971		}
972		page.odlr = next
973		if !next.hasNextLink() || !next.IsEmpty() {
974			break
975		}
976	}
977	return nil
978}
979
980// Next advances to the next page of values.  If there was an error making
981// the request the page does not advance and the error is returned.
982// Deprecated: Use NextWithContext() instead.
983func (page *OperationDefinitionListResultPage) Next() error {
984	return page.NextWithContext(context.Background())
985}
986
987// NotDone returns true if the page enumeration should be started or is not yet complete.
988func (page OperationDefinitionListResultPage) NotDone() bool {
989	return !page.odlr.IsEmpty()
990}
991
992// Response returns the raw server response from the last page request.
993func (page OperationDefinitionListResultPage) Response() OperationDefinitionListResult {
994	return page.odlr
995}
996
997// Values returns the slice of values for the current page or nil if there are no values.
998func (page OperationDefinitionListResultPage) Values() []OperationDefinition {
999	if page.odlr.IsEmpty() {
1000		return nil
1001	}
1002	return *page.odlr.Value
1003}
1004
1005// Creates a new instance of the OperationDefinitionListResultPage type.
1006func NewOperationDefinitionListResultPage(cur OperationDefinitionListResult, getNextPage func(context.Context, OperationDefinitionListResult) (OperationDefinitionListResult, error)) OperationDefinitionListResultPage {
1007	return OperationDefinitionListResultPage{
1008		fn:   getNextPage,
1009		odlr: cur,
1010	}
1011}
1012
1013// PrivateEndpoint private endpoint which a connection belongs to.
1014type PrivateEndpoint struct {
1015	// ID - The resource Id for private endpoint
1016	ID *string `json:"id,omitempty"`
1017}
1018
1019// PrivateEndpointConnection a private endpoint connection
1020type PrivateEndpointConnection struct {
1021	autorest.Response `json:"-"`
1022	// ID - READ-ONLY; The resource ID.
1023	ID *string `json:"id,omitempty"`
1024	// Name - READ-ONLY; The name of the resource.
1025	Name *string `json:"name,omitempty"`
1026	// Type - READ-ONLY; The type of the resource.
1027	Type *string `json:"type,omitempty"`
1028	// PrivateEndpointConnectionProperties - The properties of a private endpoint.
1029	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
1030}
1031
1032// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
1033func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
1034	objectMap := make(map[string]interface{})
1035	if pec.PrivateEndpointConnectionProperties != nil {
1036		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
1037	}
1038	return json.Marshal(objectMap)
1039}
1040
1041// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
1042func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
1043	var m map[string]*json.RawMessage
1044	err := json.Unmarshal(body, &m)
1045	if err != nil {
1046		return err
1047	}
1048	for k, v := range m {
1049		switch k {
1050		case "id":
1051			if v != nil {
1052				var ID string
1053				err = json.Unmarshal(*v, &ID)
1054				if err != nil {
1055					return err
1056				}
1057				pec.ID = &ID
1058			}
1059		case "name":
1060			if v != nil {
1061				var name string
1062				err = json.Unmarshal(*v, &name)
1063				if err != nil {
1064					return err
1065				}
1066				pec.Name = &name
1067			}
1068		case "type":
1069			if v != nil {
1070				var typeVar string
1071				err = json.Unmarshal(*v, &typeVar)
1072				if err != nil {
1073					return err
1074				}
1075				pec.Type = &typeVar
1076			}
1077		case "properties":
1078			if v != nil {
1079				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
1080				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
1081				if err != nil {
1082					return err
1083				}
1084				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
1085			}
1086		}
1087	}
1088
1089	return nil
1090}
1091
1092// PrivateEndpointConnectionListResult a list of private endpoint connections
1093type PrivateEndpointConnectionListResult struct {
1094	autorest.Response `json:"-"`
1095	// Value - The collection value.
1096	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
1097	// NextLink - The URI that can be used to request the next set of paged results.
1098	NextLink *string `json:"nextLink,omitempty"`
1099}
1100
1101// PrivateEndpointConnectionListResultIterator provides access to a complete listing of
1102// PrivateEndpointConnection values.
1103type PrivateEndpointConnectionListResultIterator struct {
1104	i    int
1105	page PrivateEndpointConnectionListResultPage
1106}
1107
1108// NextWithContext advances to the next value.  If there was an error making
1109// the request the iterator does not advance and the error is returned.
1110func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) {
1111	if tracing.IsEnabled() {
1112		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext")
1113		defer func() {
1114			sc := -1
1115			if iter.Response().Response.Response != nil {
1116				sc = iter.Response().Response.Response.StatusCode
1117			}
1118			tracing.EndSpan(ctx, sc, err)
1119		}()
1120	}
1121	iter.i++
1122	if iter.i < len(iter.page.Values()) {
1123		return nil
1124	}
1125	err = iter.page.NextWithContext(ctx)
1126	if err != nil {
1127		iter.i--
1128		return err
1129	}
1130	iter.i = 0
1131	return nil
1132}
1133
1134// Next advances to the next value.  If there was an error making
1135// the request the iterator does not advance and the error is returned.
1136// Deprecated: Use NextWithContext() instead.
1137func (iter *PrivateEndpointConnectionListResultIterator) Next() error {
1138	return iter.NextWithContext(context.Background())
1139}
1140
1141// NotDone returns true if the enumeration should be started or is not yet complete.
1142func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool {
1143	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1144}
1145
1146// Response returns the raw server response from the last page request.
1147func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult {
1148	return iter.page.Response()
1149}
1150
1151// Value returns the current value or a zero-initialized value if the
1152// iterator has advanced beyond the end of the collection.
1153func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection {
1154	if !iter.page.NotDone() {
1155		return PrivateEndpointConnection{}
1156	}
1157	return iter.page.Values()[iter.i]
1158}
1159
1160// Creates a new instance of the PrivateEndpointConnectionListResultIterator type.
1161func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator {
1162	return PrivateEndpointConnectionListResultIterator{page: page}
1163}
1164
1165// IsEmpty returns true if the ListResult contains no values.
1166func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool {
1167	return peclr.Value == nil || len(*peclr.Value) == 0
1168}
1169
1170// hasNextLink returns true if the NextLink is not empty.
1171func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool {
1172	return peclr.NextLink != nil && len(*peclr.NextLink) != 0
1173}
1174
1175// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results.
1176// It returns nil if no more results exist.
1177func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) {
1178	if !peclr.hasNextLink() {
1179		return nil, nil
1180	}
1181	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1182		autorest.AsJSON(),
1183		autorest.AsGet(),
1184		autorest.WithBaseURL(to.String(peclr.NextLink)))
1185}
1186
1187// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values.
1188type PrivateEndpointConnectionListResultPage struct {
1189	fn    func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)
1190	peclr PrivateEndpointConnectionListResult
1191}
1192
1193// NextWithContext advances to the next page of values.  If there was an error making
1194// the request the page does not advance and the error is returned.
1195func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) {
1196	if tracing.IsEnabled() {
1197		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext")
1198		defer func() {
1199			sc := -1
1200			if page.Response().Response.Response != nil {
1201				sc = page.Response().Response.Response.StatusCode
1202			}
1203			tracing.EndSpan(ctx, sc, err)
1204		}()
1205	}
1206	for {
1207		next, err := page.fn(ctx, page.peclr)
1208		if err != nil {
1209			return err
1210		}
1211		page.peclr = next
1212		if !next.hasNextLink() || !next.IsEmpty() {
1213			break
1214		}
1215	}
1216	return nil
1217}
1218
1219// Next advances to the next page of values.  If there was an error making
1220// the request the page does not advance and the error is returned.
1221// Deprecated: Use NextWithContext() instead.
1222func (page *PrivateEndpointConnectionListResultPage) Next() error {
1223	return page.NextWithContext(context.Background())
1224}
1225
1226// NotDone returns true if the page enumeration should be started or is not yet complete.
1227func (page PrivateEndpointConnectionListResultPage) NotDone() bool {
1228	return !page.peclr.IsEmpty()
1229}
1230
1231// Response returns the raw server response from the last page request.
1232func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult {
1233	return page.peclr
1234}
1235
1236// Values returns the slice of values for the current page or nil if there are no values.
1237func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection {
1238	if page.peclr.IsEmpty() {
1239		return nil
1240	}
1241	return *page.peclr.Value
1242}
1243
1244// Creates a new instance of the PrivateEndpointConnectionListResultPage type.
1245func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage {
1246	return PrivateEndpointConnectionListResultPage{
1247		fn:    getNextPage,
1248		peclr: cur,
1249	}
1250}
1251
1252// PrivateEndpointConnectionProperties properties of a private endpoint connection.
1253type PrivateEndpointConnectionProperties struct {
1254	// ProvisioningState - READ-ONLY; The provisioning status of the private endpoint connection. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
1255	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1256	// PrivateEndpoint - The resource of private endpoint.
1257	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
1258	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
1259	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
1260}
1261
1262// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
1263func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
1264	objectMap := make(map[string]interface{})
1265	if pecp.PrivateEndpoint != nil {
1266		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
1267	}
1268	if pecp.PrivateLinkServiceConnectionState != nil {
1269		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
1270	}
1271	return json.Marshal(objectMap)
1272}
1273
1274// PrivateEndpointConnectionReference a reference to a related private endpoint connection.
1275type PrivateEndpointConnectionReference struct {
1276	// ID - READ-ONLY; The resource ID.
1277	ID *string `json:"id,omitempty"`
1278	// Name - READ-ONLY; The name of the resource.
1279	Name *string `json:"name,omitempty"`
1280	// Type - READ-ONLY; The type of the resource.
1281	Type *string `json:"type,omitempty"`
1282	// PrivateEndpointConnectionProperties - The properties of a private endpoint connection.
1283	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
1284}
1285
1286// MarshalJSON is the custom marshaler for PrivateEndpointConnectionReference.
1287func (pecr PrivateEndpointConnectionReference) MarshalJSON() ([]byte, error) {
1288	objectMap := make(map[string]interface{})
1289	if pecr.PrivateEndpointConnectionProperties != nil {
1290		objectMap["properties"] = pecr.PrivateEndpointConnectionProperties
1291	}
1292	return json.Marshal(objectMap)
1293}
1294
1295// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnectionReference struct.
1296func (pecr *PrivateEndpointConnectionReference) UnmarshalJSON(body []byte) error {
1297	var m map[string]*json.RawMessage
1298	err := json.Unmarshal(body, &m)
1299	if err != nil {
1300		return err
1301	}
1302	for k, v := range m {
1303		switch k {
1304		case "id":
1305			if v != nil {
1306				var ID string
1307				err = json.Unmarshal(*v, &ID)
1308				if err != nil {
1309					return err
1310				}
1311				pecr.ID = &ID
1312			}
1313		case "name":
1314			if v != nil {
1315				var name string
1316				err = json.Unmarshal(*v, &name)
1317				if err != nil {
1318					return err
1319				}
1320				pecr.Name = &name
1321			}
1322		case "type":
1323			if v != nil {
1324				var typeVar string
1325				err = json.Unmarshal(*v, &typeVar)
1326				if err != nil {
1327					return err
1328				}
1329				pecr.Type = &typeVar
1330			}
1331		case "properties":
1332			if v != nil {
1333				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
1334				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
1335				if err != nil {
1336					return err
1337				}
1338				pecr.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
1339			}
1340		}
1341	}
1342
1343	return nil
1344}
1345
1346// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
1347// of a long-running operation.
1348type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
1349	azure.FutureAPI
1350	// Result returns the result of the asynchronous operation.
1351	// If the operation has not completed it will return an error.
1352	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
1353}
1354
1355// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1356func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1357	var azFuture azure.Future
1358	if err := json.Unmarshal(body, &azFuture); err != nil {
1359		return err
1360	}
1361	future.FutureAPI = &azFuture
1362	future.Result = future.result
1363	return nil
1364}
1365
1366// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
1367func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
1368	var done bool
1369	done, err = future.DoneWithContext(context.Background(), client)
1370	if err != nil {
1371		err = autorest.NewErrorWithError(err, "appconfiguration.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1372		return
1373	}
1374	if !done {
1375		pec.Response.Response = future.Response()
1376		err = azure.NewAsyncOpIncompleteError("appconfiguration.PrivateEndpointConnectionsCreateOrUpdateFuture")
1377		return
1378	}
1379	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1380	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
1381		pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
1382		if err != nil {
1383			err = autorest.NewErrorWithError(err, "appconfiguration.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
1384		}
1385	}
1386	return
1387}
1388
1389// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
1390// long-running operation.
1391type PrivateEndpointConnectionsDeleteFuture struct {
1392	azure.FutureAPI
1393	// Result returns the result of the asynchronous operation.
1394	// If the operation has not completed it will return an error.
1395	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
1396}
1397
1398// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1399func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
1400	var azFuture azure.Future
1401	if err := json.Unmarshal(body, &azFuture); err != nil {
1402		return err
1403	}
1404	future.FutureAPI = &azFuture
1405	future.Result = future.result
1406	return nil
1407}
1408
1409// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
1410func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
1411	var done bool
1412	done, err = future.DoneWithContext(context.Background(), client)
1413	if err != nil {
1414		err = autorest.NewErrorWithError(err, "appconfiguration.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
1415		return
1416	}
1417	if !done {
1418		ar.Response = future.Response()
1419		err = azure.NewAsyncOpIncompleteError("appconfiguration.PrivateEndpointConnectionsDeleteFuture")
1420		return
1421	}
1422	ar.Response = future.Response()
1423	return
1424}
1425
1426// PrivateLinkResource a resource that supports private link capabilities.
1427type PrivateLinkResource struct {
1428	autorest.Response `json:"-"`
1429	// ID - READ-ONLY; The resource ID.
1430	ID *string `json:"id,omitempty"`
1431	// Name - READ-ONLY; The name of the resource.
1432	Name *string `json:"name,omitempty"`
1433	// Type - READ-ONLY; The type of the resource.
1434	Type *string `json:"type,omitempty"`
1435	// PrivateLinkResourceProperties - Private link resource properties.
1436	*PrivateLinkResourceProperties `json:"properties,omitempty"`
1437}
1438
1439// MarshalJSON is the custom marshaler for PrivateLinkResource.
1440func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
1441	objectMap := make(map[string]interface{})
1442	if plr.PrivateLinkResourceProperties != nil {
1443		objectMap["properties"] = plr.PrivateLinkResourceProperties
1444	}
1445	return json.Marshal(objectMap)
1446}
1447
1448// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
1449func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
1450	var m map[string]*json.RawMessage
1451	err := json.Unmarshal(body, &m)
1452	if err != nil {
1453		return err
1454	}
1455	for k, v := range m {
1456		switch k {
1457		case "id":
1458			if v != nil {
1459				var ID string
1460				err = json.Unmarshal(*v, &ID)
1461				if err != nil {
1462					return err
1463				}
1464				plr.ID = &ID
1465			}
1466		case "name":
1467			if v != nil {
1468				var name string
1469				err = json.Unmarshal(*v, &name)
1470				if err != nil {
1471					return err
1472				}
1473				plr.Name = &name
1474			}
1475		case "type":
1476			if v != nil {
1477				var typeVar string
1478				err = json.Unmarshal(*v, &typeVar)
1479				if err != nil {
1480					return err
1481				}
1482				plr.Type = &typeVar
1483			}
1484		case "properties":
1485			if v != nil {
1486				var privateLinkResourceProperties PrivateLinkResourceProperties
1487				err = json.Unmarshal(*v, &privateLinkResourceProperties)
1488				if err != nil {
1489					return err
1490				}
1491				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
1492			}
1493		}
1494	}
1495
1496	return nil
1497}
1498
1499// PrivateLinkResourceListResult a list of private link resources.
1500type PrivateLinkResourceListResult struct {
1501	autorest.Response `json:"-"`
1502	// Value - The collection value.
1503	Value *[]PrivateLinkResource `json:"value,omitempty"`
1504	// NextLink - The URI that can be used to request the next set of paged results.
1505	NextLink *string `json:"nextLink,omitempty"`
1506}
1507
1508// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource
1509// values.
1510type PrivateLinkResourceListResultIterator struct {
1511	i    int
1512	page PrivateLinkResourceListResultPage
1513}
1514
1515// NextWithContext advances to the next value.  If there was an error making
1516// the request the iterator does not advance and the error is returned.
1517func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
1518	if tracing.IsEnabled() {
1519		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext")
1520		defer func() {
1521			sc := -1
1522			if iter.Response().Response.Response != nil {
1523				sc = iter.Response().Response.Response.StatusCode
1524			}
1525			tracing.EndSpan(ctx, sc, err)
1526		}()
1527	}
1528	iter.i++
1529	if iter.i < len(iter.page.Values()) {
1530		return nil
1531	}
1532	err = iter.page.NextWithContext(ctx)
1533	if err != nil {
1534		iter.i--
1535		return err
1536	}
1537	iter.i = 0
1538	return nil
1539}
1540
1541// Next advances to the next value.  If there was an error making
1542// the request the iterator does not advance and the error is returned.
1543// Deprecated: Use NextWithContext() instead.
1544func (iter *PrivateLinkResourceListResultIterator) Next() error {
1545	return iter.NextWithContext(context.Background())
1546}
1547
1548// NotDone returns true if the enumeration should be started or is not yet complete.
1549func (iter PrivateLinkResourceListResultIterator) NotDone() bool {
1550	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1551}
1552
1553// Response returns the raw server response from the last page request.
1554func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult {
1555	return iter.page.Response()
1556}
1557
1558// Value returns the current value or a zero-initialized value if the
1559// iterator has advanced beyond the end of the collection.
1560func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource {
1561	if !iter.page.NotDone() {
1562		return PrivateLinkResource{}
1563	}
1564	return iter.page.Values()[iter.i]
1565}
1566
1567// Creates a new instance of the PrivateLinkResourceListResultIterator type.
1568func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator {
1569	return PrivateLinkResourceListResultIterator{page: page}
1570}
1571
1572// IsEmpty returns true if the ListResult contains no values.
1573func (plrlr PrivateLinkResourceListResult) IsEmpty() bool {
1574	return plrlr.Value == nil || len(*plrlr.Value) == 0
1575}
1576
1577// hasNextLink returns true if the NextLink is not empty.
1578func (plrlr PrivateLinkResourceListResult) hasNextLink() bool {
1579	return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0
1580}
1581
1582// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results.
1583// It returns nil if no more results exist.
1584func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) {
1585	if !plrlr.hasNextLink() {
1586		return nil, nil
1587	}
1588	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1589		autorest.AsJSON(),
1590		autorest.AsGet(),
1591		autorest.WithBaseURL(to.String(plrlr.NextLink)))
1592}
1593
1594// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values.
1595type PrivateLinkResourceListResultPage struct {
1596	fn    func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)
1597	plrlr PrivateLinkResourceListResult
1598}
1599
1600// NextWithContext advances to the next page of values.  If there was an error making
1601// the request the page does not advance and the error is returned.
1602func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) {
1603	if tracing.IsEnabled() {
1604		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext")
1605		defer func() {
1606			sc := -1
1607			if page.Response().Response.Response != nil {
1608				sc = page.Response().Response.Response.StatusCode
1609			}
1610			tracing.EndSpan(ctx, sc, err)
1611		}()
1612	}
1613	for {
1614		next, err := page.fn(ctx, page.plrlr)
1615		if err != nil {
1616			return err
1617		}
1618		page.plrlr = next
1619		if !next.hasNextLink() || !next.IsEmpty() {
1620			break
1621		}
1622	}
1623	return nil
1624}
1625
1626// Next advances to the next page of values.  If there was an error making
1627// the request the page does not advance and the error is returned.
1628// Deprecated: Use NextWithContext() instead.
1629func (page *PrivateLinkResourceListResultPage) Next() error {
1630	return page.NextWithContext(context.Background())
1631}
1632
1633// NotDone returns true if the page enumeration should be started or is not yet complete.
1634func (page PrivateLinkResourceListResultPage) NotDone() bool {
1635	return !page.plrlr.IsEmpty()
1636}
1637
1638// Response returns the raw server response from the last page request.
1639func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult {
1640	return page.plrlr
1641}
1642
1643// Values returns the slice of values for the current page or nil if there are no values.
1644func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource {
1645	if page.plrlr.IsEmpty() {
1646		return nil
1647	}
1648	return *page.plrlr.Value
1649}
1650
1651// Creates a new instance of the PrivateLinkResourceListResultPage type.
1652func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage {
1653	return PrivateLinkResourceListResultPage{
1654		fn:    getNextPage,
1655		plrlr: cur,
1656	}
1657}
1658
1659// PrivateLinkResourceProperties properties of a private link resource.
1660type PrivateLinkResourceProperties struct {
1661	// GroupID - READ-ONLY; The private link resource group id.
1662	GroupID *string `json:"groupId,omitempty"`
1663	// RequiredMembers - READ-ONLY; The private link resource required member names.
1664	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
1665	// RequiredZoneNames - READ-ONLY; The list of required DNS zone names of the private link resource.
1666	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
1667}
1668
1669// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
1670func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
1671	objectMap := make(map[string]interface{})
1672	return json.Marshal(objectMap)
1673}
1674
1675// PrivateLinkServiceConnectionState the state of a private link service connection.
1676type PrivateLinkServiceConnectionState struct {
1677	// Status - The private link service connection status. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected'
1678	Status ConnectionStatus `json:"status,omitempty"`
1679	// Description - The private link service connection description.
1680	Description *string `json:"description,omitempty"`
1681	// ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect). Possible values include: 'None', 'Recreate'
1682	ActionsRequired ActionsRequired `json:"actionsRequired,omitempty"`
1683}
1684
1685// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionState.
1686func (plscs PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) {
1687	objectMap := make(map[string]interface{})
1688	if plscs.Status != "" {
1689		objectMap["status"] = plscs.Status
1690	}
1691	if plscs.Description != nil {
1692		objectMap["description"] = plscs.Description
1693	}
1694	return json.Marshal(objectMap)
1695}
1696
1697// RegenerateKeyParameters the parameters used to regenerate an API key.
1698type RegenerateKeyParameters struct {
1699	// ID - The id of the key to regenerate.
1700	ID *string `json:"id,omitempty"`
1701}
1702
1703// Resource an Azure resource.
1704type Resource struct {
1705	// ID - READ-ONLY; The resource ID.
1706	ID *string `json:"id,omitempty"`
1707	// Name - READ-ONLY; The name of the resource.
1708	Name *string `json:"name,omitempty"`
1709	// Type - READ-ONLY; The type of the resource.
1710	Type *string `json:"type,omitempty"`
1711	// Location - The location of the resource. This cannot be changed after the resource is created.
1712	Location *string `json:"location,omitempty"`
1713	// Tags - The tags of the resource.
1714	Tags map[string]*string `json:"tags"`
1715}
1716
1717// MarshalJSON is the custom marshaler for Resource.
1718func (r Resource) MarshalJSON() ([]byte, error) {
1719	objectMap := make(map[string]interface{})
1720	if r.Location != nil {
1721		objectMap["location"] = r.Location
1722	}
1723	if r.Tags != nil {
1724		objectMap["tags"] = r.Tags
1725	}
1726	return json.Marshal(objectMap)
1727}
1728
1729// ResourceIdentity an identity that can be associated with a resource.
1730type ResourceIdentity struct {
1731	// Type - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities. Possible values include: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned', 'IdentityTypeSystemAssignedUserAssigned'
1732	Type IdentityType `json:"type,omitempty"`
1733	// UserAssignedIdentities - The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
1734	UserAssignedIdentities map[string]*UserIdentity `json:"userAssignedIdentities"`
1735	// PrincipalID - READ-ONLY; The principal id of the identity. This property will only be provided for a system-assigned identity.
1736	PrincipalID *string `json:"principalId,omitempty"`
1737	// TenantID - READ-ONLY; The tenant id associated with the resource's identity. This property will only be provided for a system-assigned identity.
1738	TenantID *string `json:"tenantId,omitempty"`
1739}
1740
1741// MarshalJSON is the custom marshaler for ResourceIdentity.
1742func (ri ResourceIdentity) MarshalJSON() ([]byte, error) {
1743	objectMap := make(map[string]interface{})
1744	if ri.Type != "" {
1745		objectMap["type"] = ri.Type
1746	}
1747	if ri.UserAssignedIdentities != nil {
1748		objectMap["userAssignedIdentities"] = ri.UserAssignedIdentities
1749	}
1750	return json.Marshal(objectMap)
1751}
1752
1753// Sku describes a configuration store SKU.
1754type Sku struct {
1755	// Name - The SKU name of the configuration store.
1756	Name *string `json:"name,omitempty"`
1757}
1758
1759// UserIdentity a resource identity that is managed by the user of the service.
1760type UserIdentity struct {
1761	// PrincipalID - READ-ONLY; The principal ID of the user-assigned identity.
1762	PrincipalID *string `json:"principalId,omitempty"`
1763	// ClientID - READ-ONLY; The client ID of the user-assigned identity.
1764	ClientID *string `json:"clientId,omitempty"`
1765}
1766
1767// MarshalJSON is the custom marshaler for UserIdentity.
1768func (UI UserIdentity) MarshalJSON() ([]byte, error) {
1769	objectMap := make(map[string]interface{})
1770	return json.Marshal(objectMap)
1771}
1772