1package resources
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"encoding/json"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/azure"
24	"github.com/Azure/go-autorest/autorest/date"
25	"github.com/Azure/go-autorest/autorest/to"
26	"net/http"
27)
28
29// DeploymentMode enumerates the values for deployment mode.
30type DeploymentMode string
31
32const (
33	// Complete ...
34	Complete DeploymentMode = "Complete"
35	// Incremental ...
36	Incremental DeploymentMode = "Incremental"
37)
38
39// PossibleDeploymentModeValues returns an array of possible values for the DeploymentMode const type.
40func PossibleDeploymentModeValues() []DeploymentMode {
41	return []DeploymentMode{Complete, Incremental}
42}
43
44// OnErrorDeploymentType enumerates the values for on error deployment type.
45type OnErrorDeploymentType string
46
47const (
48	// LastSuccessful ...
49	LastSuccessful OnErrorDeploymentType = "LastSuccessful"
50	// SpecificDeployment ...
51	SpecificDeployment OnErrorDeploymentType = "SpecificDeployment"
52)
53
54// PossibleOnErrorDeploymentTypeValues returns an array of possible values for the OnErrorDeploymentType const type.
55func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType {
56	return []OnErrorDeploymentType{LastSuccessful, SpecificDeployment}
57}
58
59// ResourceIdentityType enumerates the values for resource identity type.
60type ResourceIdentityType string
61
62const (
63	// None ...
64	None ResourceIdentityType = "None"
65	// SystemAssigned ...
66	SystemAssigned ResourceIdentityType = "SystemAssigned"
67	// SystemAssignedUserAssigned ...
68	SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
69	// UserAssigned ...
70	UserAssigned ResourceIdentityType = "UserAssigned"
71)
72
73// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type.
74func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
75	return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned}
76}
77
78// AliasPathType the type of the paths for alias.
79type AliasPathType struct {
80	// Path - The path of an alias.
81	Path *string `json:"path,omitempty"`
82	// APIVersions - The API versions.
83	APIVersions *[]string `json:"apiVersions,omitempty"`
84}
85
86// AliasType the alias type.
87type AliasType struct {
88	// Name - The alias name.
89	Name *string `json:"name,omitempty"`
90	// Paths - The paths for an alias.
91	Paths *[]AliasPathType `json:"paths,omitempty"`
92}
93
94// BasicDependency deployment dependency information.
95type BasicDependency struct {
96	// ID - The ID of the dependency.
97	ID *string `json:"id,omitempty"`
98	// ResourceType - The dependency resource type.
99	ResourceType *string `json:"resourceType,omitempty"`
100	// ResourceName - The dependency resource name.
101	ResourceName *string `json:"resourceName,omitempty"`
102}
103
104// CreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
105type CreateOrUpdateByIDFuture struct {
106	azure.Future
107}
108
109// Result returns the result of the asynchronous operation.
110// If the operation has not completed it will return an error.
111func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
112	var done bool
113	done, err = future.Done(client)
114	if err != nil {
115		err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
116		return
117	}
118	if !done {
119		err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture")
120		return
121	}
122	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
123	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
124		gr, err = client.CreateOrUpdateByIDResponder(gr.Response.Response)
125		if err != nil {
126			err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
127		}
128	}
129	return
130}
131
132// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
133type CreateOrUpdateFuture struct {
134	azure.Future
135}
136
137// Result returns the result of the asynchronous operation.
138// If the operation has not completed it will return an error.
139func (future *CreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) {
140	var done bool
141	done, err = future.Done(client)
142	if err != nil {
143		err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
144		return
145	}
146	if !done {
147		err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture")
148		return
149	}
150	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
151	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
152		gr, err = client.CreateOrUpdateResponder(gr.Response.Response)
153		if err != nil {
154			err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
155		}
156	}
157	return
158}
159
160// DebugSetting ...
161type DebugSetting struct {
162	// DetailLevel - Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information you are passing in during deployment. By logging information about the request or response, you could potentially expose sensitive data that is retrieved through the deployment operations.
163	DetailLevel *string `json:"detailLevel,omitempty"`
164}
165
166// DeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
167type DeleteByIDFuture struct {
168	azure.Future
169}
170
171// Result returns the result of the asynchronous operation.
172// If the operation has not completed it will return an error.
173func (future *DeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) {
174	var done bool
175	done, err = future.Done(client)
176	if err != nil {
177		err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", future.Response(), "Polling failure")
178		return
179	}
180	if !done {
181		err = azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture")
182		return
183	}
184	ar.Response = future.Response()
185	return
186}
187
188// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
189type DeleteFuture struct {
190	azure.Future
191}
192
193// Result returns the result of the asynchronous operation.
194// If the operation has not completed it will return an error.
195func (future *DeleteFuture) Result(client Client) (ar autorest.Response, err error) {
196	var done bool
197	done, err = future.Done(client)
198	if err != nil {
199		err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", future.Response(), "Polling failure")
200		return
201	}
202	if !done {
203		err = azure.NewAsyncOpIncompleteError("resources.DeleteFuture")
204		return
205	}
206	ar.Response = future.Response()
207	return
208}
209
210// Dependency deployment dependency information.
211type Dependency struct {
212	// DependsOn - The list of dependencies.
213	DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
214	// ID - The ID of the dependency.
215	ID *string `json:"id,omitempty"`
216	// ResourceType - The dependency resource type.
217	ResourceType *string `json:"resourceType,omitempty"`
218	// ResourceName - The dependency resource name.
219	ResourceName *string `json:"resourceName,omitempty"`
220}
221
222// Deployment deployment operation parameters.
223type Deployment struct {
224	// Location - The location to store the deployment data.
225	Location *string `json:"location,omitempty"`
226	// Properties - The deployment properties.
227	Properties *DeploymentProperties `json:"properties,omitempty"`
228}
229
230// DeploymentExportResult the deployment export result.
231type DeploymentExportResult struct {
232	autorest.Response `json:"-"`
233	// Template - The template content.
234	Template interface{} `json:"template,omitempty"`
235}
236
237// DeploymentExtended deployment information.
238type DeploymentExtended struct {
239	autorest.Response `json:"-"`
240	// ID - The ID of the deployment.
241	ID *string `json:"id,omitempty"`
242	// Name - The name of the deployment.
243	Name *string `json:"name,omitempty"`
244	// Location - the location of the deployment.
245	Location *string `json:"location,omitempty"`
246	// Properties - Deployment properties.
247	Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
248}
249
250// DeploymentExtendedFilter deployment filter.
251type DeploymentExtendedFilter struct {
252	// ProvisioningState - The provisioning state.
253	ProvisioningState *string `json:"provisioningState,omitempty"`
254}
255
256// DeploymentListResult list of deployments.
257type DeploymentListResult struct {
258	autorest.Response `json:"-"`
259	// Value - An array of deployments.
260	Value *[]DeploymentExtended `json:"value,omitempty"`
261	// NextLink - The URL to use for getting the next set of results.
262	NextLink *string `json:"nextLink,omitempty"`
263}
264
265// DeploymentListResultIterator provides access to a complete listing of DeploymentExtended values.
266type DeploymentListResultIterator struct {
267	i    int
268	page DeploymentListResultPage
269}
270
271// Next advances to the next value.  If there was an error making
272// the request the iterator does not advance and the error is returned.
273func (iter *DeploymentListResultIterator) Next() error {
274	iter.i++
275	if iter.i < len(iter.page.Values()) {
276		return nil
277	}
278	err := iter.page.Next()
279	if err != nil {
280		iter.i--
281		return err
282	}
283	iter.i = 0
284	return nil
285}
286
287// NotDone returns true if the enumeration should be started or is not yet complete.
288func (iter DeploymentListResultIterator) NotDone() bool {
289	return iter.page.NotDone() && iter.i < len(iter.page.Values())
290}
291
292// Response returns the raw server response from the last page request.
293func (iter DeploymentListResultIterator) Response() DeploymentListResult {
294	return iter.page.Response()
295}
296
297// Value returns the current value or a zero-initialized value if the
298// iterator has advanced beyond the end of the collection.
299func (iter DeploymentListResultIterator) Value() DeploymentExtended {
300	if !iter.page.NotDone() {
301		return DeploymentExtended{}
302	}
303	return iter.page.Values()[iter.i]
304}
305
306// IsEmpty returns true if the ListResult contains no values.
307func (dlr DeploymentListResult) IsEmpty() bool {
308	return dlr.Value == nil || len(*dlr.Value) == 0
309}
310
311// deploymentListResultPreparer prepares a request to retrieve the next set of results.
312// It returns nil if no more results exist.
313func (dlr DeploymentListResult) deploymentListResultPreparer() (*http.Request, error) {
314	if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 {
315		return nil, nil
316	}
317	return autorest.Prepare(&http.Request{},
318		autorest.AsJSON(),
319		autorest.AsGet(),
320		autorest.WithBaseURL(to.String(dlr.NextLink)))
321}
322
323// DeploymentListResultPage contains a page of DeploymentExtended values.
324type DeploymentListResultPage struct {
325	fn  func(DeploymentListResult) (DeploymentListResult, error)
326	dlr DeploymentListResult
327}
328
329// Next advances to the next page of values.  If there was an error making
330// the request the page does not advance and the error is returned.
331func (page *DeploymentListResultPage) Next() error {
332	next, err := page.fn(page.dlr)
333	if err != nil {
334		return err
335	}
336	page.dlr = next
337	return nil
338}
339
340// NotDone returns true if the page enumeration should be started or is not yet complete.
341func (page DeploymentListResultPage) NotDone() bool {
342	return !page.dlr.IsEmpty()
343}
344
345// Response returns the raw server response from the last page request.
346func (page DeploymentListResultPage) Response() DeploymentListResult {
347	return page.dlr
348}
349
350// Values returns the slice of values for the current page or nil if there are no values.
351func (page DeploymentListResultPage) Values() []DeploymentExtended {
352	if page.dlr.IsEmpty() {
353		return nil
354	}
355	return *page.dlr.Value
356}
357
358// DeploymentOperation deployment operation information.
359type DeploymentOperation struct {
360	autorest.Response `json:"-"`
361	// ID - Full deployment operation ID.
362	ID *string `json:"id,omitempty"`
363	// OperationID - Deployment operation ID.
364	OperationID *string `json:"operationId,omitempty"`
365	// Properties - Deployment properties.
366	Properties *DeploymentOperationProperties `json:"properties,omitempty"`
367}
368
369// DeploymentOperationProperties deployment operation properties.
370type DeploymentOperationProperties struct {
371	// ProvisioningState - The state of the provisioning.
372	ProvisioningState *string `json:"provisioningState,omitempty"`
373	// Timestamp - The date and time of the operation.
374	Timestamp *date.Time `json:"timestamp,omitempty"`
375	// ServiceRequestID - Deployment operation service request id.
376	ServiceRequestID *string `json:"serviceRequestId,omitempty"`
377	// StatusCode - Operation status code.
378	StatusCode *string `json:"statusCode,omitempty"`
379	// StatusMessage - Operation status message.
380	StatusMessage interface{} `json:"statusMessage,omitempty"`
381	// TargetResource - The target resource.
382	TargetResource *TargetResource `json:"targetResource,omitempty"`
383	// Request - The HTTP request message.
384	Request *HTTPMessage `json:"request,omitempty"`
385	// Response - The HTTP response message.
386	Response *HTTPMessage `json:"response,omitempty"`
387}
388
389// DeploymentOperationsListResult list of deployment operations.
390type DeploymentOperationsListResult struct {
391	autorest.Response `json:"-"`
392	// Value - An array of deployment operations.
393	Value *[]DeploymentOperation `json:"value,omitempty"`
394	// NextLink - The URL to use for getting the next set of results.
395	NextLink *string `json:"nextLink,omitempty"`
396}
397
398// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation values.
399type DeploymentOperationsListResultIterator struct {
400	i    int
401	page DeploymentOperationsListResultPage
402}
403
404// Next advances to the next value.  If there was an error making
405// the request the iterator does not advance and the error is returned.
406func (iter *DeploymentOperationsListResultIterator) Next() error {
407	iter.i++
408	if iter.i < len(iter.page.Values()) {
409		return nil
410	}
411	err := iter.page.Next()
412	if err != nil {
413		iter.i--
414		return err
415	}
416	iter.i = 0
417	return nil
418}
419
420// NotDone returns true if the enumeration should be started or is not yet complete.
421func (iter DeploymentOperationsListResultIterator) NotDone() bool {
422	return iter.page.NotDone() && iter.i < len(iter.page.Values())
423}
424
425// Response returns the raw server response from the last page request.
426func (iter DeploymentOperationsListResultIterator) Response() DeploymentOperationsListResult {
427	return iter.page.Response()
428}
429
430// Value returns the current value or a zero-initialized value if the
431// iterator has advanced beyond the end of the collection.
432func (iter DeploymentOperationsListResultIterator) Value() DeploymentOperation {
433	if !iter.page.NotDone() {
434		return DeploymentOperation{}
435	}
436	return iter.page.Values()[iter.i]
437}
438
439// IsEmpty returns true if the ListResult contains no values.
440func (dolr DeploymentOperationsListResult) IsEmpty() bool {
441	return dolr.Value == nil || len(*dolr.Value) == 0
442}
443
444// deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results.
445// It returns nil if no more results exist.
446func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer() (*http.Request, error) {
447	if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 {
448		return nil, nil
449	}
450	return autorest.Prepare(&http.Request{},
451		autorest.AsJSON(),
452		autorest.AsGet(),
453		autorest.WithBaseURL(to.String(dolr.NextLink)))
454}
455
456// DeploymentOperationsListResultPage contains a page of DeploymentOperation values.
457type DeploymentOperationsListResultPage struct {
458	fn   func(DeploymentOperationsListResult) (DeploymentOperationsListResult, error)
459	dolr DeploymentOperationsListResult
460}
461
462// Next advances to the next page of values.  If there was an error making
463// the request the page does not advance and the error is returned.
464func (page *DeploymentOperationsListResultPage) Next() error {
465	next, err := page.fn(page.dolr)
466	if err != nil {
467		return err
468	}
469	page.dolr = next
470	return nil
471}
472
473// NotDone returns true if the page enumeration should be started or is not yet complete.
474func (page DeploymentOperationsListResultPage) NotDone() bool {
475	return !page.dolr.IsEmpty()
476}
477
478// Response returns the raw server response from the last page request.
479func (page DeploymentOperationsListResultPage) Response() DeploymentOperationsListResult {
480	return page.dolr
481}
482
483// Values returns the slice of values for the current page or nil if there are no values.
484func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation {
485	if page.dolr.IsEmpty() {
486		return nil
487	}
488	return *page.dolr.Value
489}
490
491// DeploymentProperties deployment properties.
492type DeploymentProperties struct {
493	// Template - The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both.
494	Template interface{} `json:"template,omitempty"`
495	// TemplateLink - The URI of the template. Use either the templateLink property or the template property, but not both.
496	TemplateLink *TemplateLink `json:"templateLink,omitempty"`
497	// Parameters - Name and value pairs that define the deployment parameters for the template. You use this element when you want to provide the parameter values directly in the request rather than link to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. It can be a JObject or a well formed JSON string.
498	Parameters interface{} `json:"parameters,omitempty"`
499	// ParametersLink - The URI of parameters file. You use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both.
500	ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
501	// Mode - The mode that is used to deploy resources. This value can be either Incremental or Complete. In Incremental mode, resources are deployed without deleting existing resources that are not included in the template. In Complete mode, resources are deployed and existing resources in the resource group that are not included in the template are deleted. Be careful when using Complete mode as you may unintentionally delete resources. Possible values include: 'Incremental', 'Complete'
502	Mode DeploymentMode `json:"mode,omitempty"`
503	// DebugSetting - The debug setting of the deployment.
504	DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
505	// OnErrorDeployment - The deployment on error behavior.
506	OnErrorDeployment *OnErrorDeployment `json:"onErrorDeployment,omitempty"`
507}
508
509// DeploymentPropertiesExtended deployment properties with additional details.
510type DeploymentPropertiesExtended struct {
511	// ProvisioningState - The state of the provisioning.
512	ProvisioningState *string `json:"provisioningState,omitempty"`
513	// CorrelationID - The correlation ID of the deployment.
514	CorrelationID *string `json:"correlationId,omitempty"`
515	// Timestamp - The timestamp of the template deployment.
516	Timestamp *date.Time `json:"timestamp,omitempty"`
517	// Outputs - Key/value pairs that represent deploymentoutput.
518	Outputs interface{} `json:"outputs,omitempty"`
519	// Providers - The list of resource providers needed for the deployment.
520	Providers *[]Provider `json:"providers,omitempty"`
521	// Dependencies - The list of deployment dependencies.
522	Dependencies *[]Dependency `json:"dependencies,omitempty"`
523	// Template - The template content. Use only one of Template or TemplateLink.
524	Template interface{} `json:"template,omitempty"`
525	// TemplateLink - The URI referencing the template. Use only one of Template or TemplateLink.
526	TemplateLink *TemplateLink `json:"templateLink,omitempty"`
527	// Parameters - Deployment parameters. Use only one of Parameters or ParametersLink.
528	Parameters interface{} `json:"parameters,omitempty"`
529	// ParametersLink - The URI referencing the parameters. Use only one of Parameters or ParametersLink.
530	ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
531	// Mode - The deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete'
532	Mode DeploymentMode `json:"mode,omitempty"`
533	// DebugSetting - The debug setting of the deployment.
534	DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
535	// OnErrorDeployment - The deployment on error behavior.
536	OnErrorDeployment *OnErrorDeploymentExtended `json:"onErrorDeployment,omitempty"`
537}
538
539// DeploymentsCreateOrUpdateAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the results of a
540// long-running operation.
541type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture struct {
542	azure.Future
543}
544
545// Result returns the result of the asynchronous operation.
546// If the operation has not completed it will return an error.
547func (future *DeploymentsCreateOrUpdateAtSubscriptionScopeFuture) Result(client DeploymentsClient) (de DeploymentExtended, err error) {
548	var done bool
549	done, err = future.Done(client)
550	if err != nil {
551		err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
552		return
553	}
554	if !done {
555		err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture")
556		return
557	}
558	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
559	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
560		de, err = client.CreateOrUpdateAtSubscriptionScopeResponder(de.Response.Response)
561		if err != nil {
562			err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture", "Result", de.Response.Response, "Failure responding to request")
563		}
564	}
565	return
566}
567
568// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
569// operation.
570type DeploymentsCreateOrUpdateFuture struct {
571	azure.Future
572}
573
574// Result returns the result of the asynchronous operation.
575// If the operation has not completed it will return an error.
576func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (de DeploymentExtended, err error) {
577	var done bool
578	done, err = future.Done(client)
579	if err != nil {
580		err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
581		return
582	}
583	if !done {
584		err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture")
585		return
586	}
587	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
588	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
589		de, err = client.CreateOrUpdateResponder(de.Response.Response)
590		if err != nil {
591			err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request")
592		}
593	}
594	return
595}
596
597// DeploymentsDeleteAtSubscriptionScopeFuture an abstraction for monitoring and retrieving the results of a
598// long-running operation.
599type DeploymentsDeleteAtSubscriptionScopeFuture struct {
600	azure.Future
601}
602
603// Result returns the result of the asynchronous operation.
604// If the operation has not completed it will return an error.
605func (future *DeploymentsDeleteAtSubscriptionScopeFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
606	var done bool
607	done, err = future.Done(client)
608	if err != nil {
609		err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteAtSubscriptionScopeFuture", "Result", future.Response(), "Polling failure")
610		return
611	}
612	if !done {
613		err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteAtSubscriptionScopeFuture")
614		return
615	}
616	ar.Response = future.Response()
617	return
618}
619
620// DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
621type DeploymentsDeleteFuture struct {
622	azure.Future
623}
624
625// Result returns the result of the asynchronous operation.
626// If the operation has not completed it will return an error.
627func (future *DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
628	var done bool
629	done, err = future.Done(client)
630	if err != nil {
631		err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure")
632		return
633	}
634	if !done {
635		err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture")
636		return
637	}
638	ar.Response = future.Response()
639	return
640}
641
642// DeploymentValidateResult information from validate template deployment response.
643type DeploymentValidateResult struct {
644	autorest.Response `json:"-"`
645	// Error - Validation error.
646	Error *ManagementErrorWithDetails `json:"error,omitempty"`
647	// Properties - The template deployment properties.
648	Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
649}
650
651// ExportTemplateRequest export resource group template request parameters.
652type ExportTemplateRequest struct {
653	// ResourcesProperty - The IDs of the resources. The only supported string currently is '*' (all resources). Future updates will support exporting specific resources.
654	ResourcesProperty *[]string `json:"resources,omitempty"`
655	// Options - The export template options. Supported values include 'IncludeParameterDefaultValue', 'IncludeComments' or 'IncludeParameterDefaultValue, IncludeComments
656	Options *string `json:"options,omitempty"`
657}
658
659// GenericResource resource information.
660type GenericResource struct {
661	autorest.Response `json:"-"`
662	// Plan - The plan of the resource.
663	Plan *Plan `json:"plan,omitempty"`
664	// Properties - The resource properties.
665	Properties interface{} `json:"properties,omitempty"`
666	// Kind - The kind of the resource.
667	Kind *string `json:"kind,omitempty"`
668	// ManagedBy - ID of the resource that manages this resource.
669	ManagedBy *string `json:"managedBy,omitempty"`
670	// Sku - The SKU of the resource.
671	Sku *Sku `json:"sku,omitempty"`
672	// Identity - The identity of the resource.
673	Identity *Identity `json:"identity,omitempty"`
674	// ID - Resource ID
675	ID *string `json:"id,omitempty"`
676	// Name - Resource name
677	Name *string `json:"name,omitempty"`
678	// Type - Resource type
679	Type *string `json:"type,omitempty"`
680	// Location - Resource location
681	Location *string `json:"location,omitempty"`
682	// Tags - Resource tags
683	Tags map[string]*string `json:"tags"`
684}
685
686// MarshalJSON is the custom marshaler for GenericResource.
687func (gr GenericResource) MarshalJSON() ([]byte, error) {
688	objectMap := make(map[string]interface{})
689	if gr.Plan != nil {
690		objectMap["plan"] = gr.Plan
691	}
692	objectMap["properties"] = gr.Properties
693	if gr.Kind != nil {
694		objectMap["kind"] = gr.Kind
695	}
696	if gr.ManagedBy != nil {
697		objectMap["managedBy"] = gr.ManagedBy
698	}
699	if gr.Sku != nil {
700		objectMap["sku"] = gr.Sku
701	}
702	if gr.Identity != nil {
703		objectMap["identity"] = gr.Identity
704	}
705	if gr.ID != nil {
706		objectMap["id"] = gr.ID
707	}
708	if gr.Name != nil {
709		objectMap["name"] = gr.Name
710	}
711	if gr.Type != nil {
712		objectMap["type"] = gr.Type
713	}
714	if gr.Location != nil {
715		objectMap["location"] = gr.Location
716	}
717	if gr.Tags != nil {
718		objectMap["tags"] = gr.Tags
719	}
720	return json.Marshal(objectMap)
721}
722
723// GenericResourceFilter resource filter.
724type GenericResourceFilter struct {
725	// ResourceType - The resource type.
726	ResourceType *string `json:"resourceType,omitempty"`
727	// Tagname - The tag name.
728	Tagname *string `json:"tagname,omitempty"`
729	// Tagvalue - The tag value.
730	Tagvalue *string `json:"tagvalue,omitempty"`
731}
732
733// Group resource group information.
734type Group struct {
735	autorest.Response `json:"-"`
736	// ID - The ID of the resource group.
737	ID *string `json:"id,omitempty"`
738	// Name - The name of the resource group.
739	Name       *string          `json:"name,omitempty"`
740	Properties *GroupProperties `json:"properties,omitempty"`
741	// Location - The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations.
742	Location *string `json:"location,omitempty"`
743	// ManagedBy - The ID of the resource that manages this resource group.
744	ManagedBy *string `json:"managedBy,omitempty"`
745	// Tags - The tags attached to the resource group.
746	Tags map[string]*string `json:"tags"`
747}
748
749// MarshalJSON is the custom marshaler for Group.
750func (g Group) MarshalJSON() ([]byte, error) {
751	objectMap := make(map[string]interface{})
752	if g.ID != nil {
753		objectMap["id"] = g.ID
754	}
755	if g.Name != nil {
756		objectMap["name"] = g.Name
757	}
758	if g.Properties != nil {
759		objectMap["properties"] = g.Properties
760	}
761	if g.Location != nil {
762		objectMap["location"] = g.Location
763	}
764	if g.ManagedBy != nil {
765		objectMap["managedBy"] = g.ManagedBy
766	}
767	if g.Tags != nil {
768		objectMap["tags"] = g.Tags
769	}
770	return json.Marshal(objectMap)
771}
772
773// GroupExportResult resource group export result.
774type GroupExportResult struct {
775	autorest.Response `json:"-"`
776	// Template - The template content.
777	Template interface{} `json:"template,omitempty"`
778	// Error - The error.
779	Error *ManagementErrorWithDetails `json:"error,omitempty"`
780}
781
782// GroupFilter resource group filter.
783type GroupFilter struct {
784	// TagName - The tag name.
785	TagName *string `json:"tagName,omitempty"`
786	// TagValue - The tag value.
787	TagValue *string `json:"tagValue,omitempty"`
788}
789
790// GroupListResult list of resource groups.
791type GroupListResult struct {
792	autorest.Response `json:"-"`
793	// Value - An array of resource groups.
794	Value *[]Group `json:"value,omitempty"`
795	// NextLink - The URL to use for getting the next set of results.
796	NextLink *string `json:"nextLink,omitempty"`
797}
798
799// GroupListResultIterator provides access to a complete listing of Group values.
800type GroupListResultIterator struct {
801	i    int
802	page GroupListResultPage
803}
804
805// Next advances to the next value.  If there was an error making
806// the request the iterator does not advance and the error is returned.
807func (iter *GroupListResultIterator) Next() error {
808	iter.i++
809	if iter.i < len(iter.page.Values()) {
810		return nil
811	}
812	err := iter.page.Next()
813	if err != nil {
814		iter.i--
815		return err
816	}
817	iter.i = 0
818	return nil
819}
820
821// NotDone returns true if the enumeration should be started or is not yet complete.
822func (iter GroupListResultIterator) NotDone() bool {
823	return iter.page.NotDone() && iter.i < len(iter.page.Values())
824}
825
826// Response returns the raw server response from the last page request.
827func (iter GroupListResultIterator) Response() GroupListResult {
828	return iter.page.Response()
829}
830
831// Value returns the current value or a zero-initialized value if the
832// iterator has advanced beyond the end of the collection.
833func (iter GroupListResultIterator) Value() Group {
834	if !iter.page.NotDone() {
835		return Group{}
836	}
837	return iter.page.Values()[iter.i]
838}
839
840// IsEmpty returns true if the ListResult contains no values.
841func (glr GroupListResult) IsEmpty() bool {
842	return glr.Value == nil || len(*glr.Value) == 0
843}
844
845// groupListResultPreparer prepares a request to retrieve the next set of results.
846// It returns nil if no more results exist.
847func (glr GroupListResult) groupListResultPreparer() (*http.Request, error) {
848	if glr.NextLink == nil || len(to.String(glr.NextLink)) < 1 {
849		return nil, nil
850	}
851	return autorest.Prepare(&http.Request{},
852		autorest.AsJSON(),
853		autorest.AsGet(),
854		autorest.WithBaseURL(to.String(glr.NextLink)))
855}
856
857// GroupListResultPage contains a page of Group values.
858type GroupListResultPage struct {
859	fn  func(GroupListResult) (GroupListResult, error)
860	glr GroupListResult
861}
862
863// Next advances to the next page of values.  If there was an error making
864// the request the page does not advance and the error is returned.
865func (page *GroupListResultPage) Next() error {
866	next, err := page.fn(page.glr)
867	if err != nil {
868		return err
869	}
870	page.glr = next
871	return nil
872}
873
874// NotDone returns true if the page enumeration should be started or is not yet complete.
875func (page GroupListResultPage) NotDone() bool {
876	return !page.glr.IsEmpty()
877}
878
879// Response returns the raw server response from the last page request.
880func (page GroupListResultPage) Response() GroupListResult {
881	return page.glr
882}
883
884// Values returns the slice of values for the current page or nil if there are no values.
885func (page GroupListResultPage) Values() []Group {
886	if page.glr.IsEmpty() {
887		return nil
888	}
889	return *page.glr.Value
890}
891
892// GroupPatchable resource group information.
893type GroupPatchable struct {
894	// Name - The name of the resource group.
895	Name       *string          `json:"name,omitempty"`
896	Properties *GroupProperties `json:"properties,omitempty"`
897	// ManagedBy - The ID of the resource that manages this resource group.
898	ManagedBy *string `json:"managedBy,omitempty"`
899	// Tags - The tags attached to the resource group.
900	Tags map[string]*string `json:"tags"`
901}
902
903// MarshalJSON is the custom marshaler for GroupPatchable.
904func (gp GroupPatchable) MarshalJSON() ([]byte, error) {
905	objectMap := make(map[string]interface{})
906	if gp.Name != nil {
907		objectMap["name"] = gp.Name
908	}
909	if gp.Properties != nil {
910		objectMap["properties"] = gp.Properties
911	}
912	if gp.ManagedBy != nil {
913		objectMap["managedBy"] = gp.ManagedBy
914	}
915	if gp.Tags != nil {
916		objectMap["tags"] = gp.Tags
917	}
918	return json.Marshal(objectMap)
919}
920
921// GroupProperties the resource group properties.
922type GroupProperties struct {
923	// ProvisioningState - The provisioning state.
924	ProvisioningState *string `json:"provisioningState,omitempty"`
925}
926
927// GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
928type GroupsDeleteFuture struct {
929	azure.Future
930}
931
932// Result returns the result of the asynchronous operation.
933// If the operation has not completed it will return an error.
934func (future *GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Response, err error) {
935	var done bool
936	done, err = future.Done(client)
937	if err != nil {
938		err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", future.Response(), "Polling failure")
939		return
940	}
941	if !done {
942		err = azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture")
943		return
944	}
945	ar.Response = future.Response()
946	return
947}
948
949// HTTPMessage HTTP message.
950type HTTPMessage struct {
951	// Content - HTTP message content.
952	Content interface{} `json:"content,omitempty"`
953}
954
955// Identity identity for the resource.
956type Identity struct {
957	// PrincipalID - The principal ID of resource identity.
958	PrincipalID *string `json:"principalId,omitempty"`
959	// TenantID - The tenant ID of resource.
960	TenantID *string `json:"tenantId,omitempty"`
961	// Type - The identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None'
962	Type ResourceIdentityType `json:"type,omitempty"`
963	// UserAssignedIdentities - The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
964	UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
965}
966
967// MarshalJSON is the custom marshaler for Identity.
968func (i Identity) MarshalJSON() ([]byte, error) {
969	objectMap := make(map[string]interface{})
970	if i.PrincipalID != nil {
971		objectMap["principalId"] = i.PrincipalID
972	}
973	if i.TenantID != nil {
974		objectMap["tenantId"] = i.TenantID
975	}
976	if i.Type != "" {
977		objectMap["type"] = i.Type
978	}
979	if i.UserAssignedIdentities != nil {
980		objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
981	}
982	return json.Marshal(objectMap)
983}
984
985// IdentityUserAssignedIdentitiesValue ...
986type IdentityUserAssignedIdentitiesValue struct {
987	// PrincipalID - The principal id of user assigned identity.
988	PrincipalID *string `json:"principalId,omitempty"`
989	// ClientID - The client id of user assigned identity.
990	ClientID *string `json:"clientId,omitempty"`
991}
992
993// ListResult list of resource groups.
994type ListResult struct {
995	autorest.Response `json:"-"`
996	// Value - An array of resources.
997	Value *[]GenericResource `json:"value,omitempty"`
998	// NextLink - The URL to use for getting the next set of results.
999	NextLink *string `json:"nextLink,omitempty"`
1000}
1001
1002// ListResultIterator provides access to a complete listing of GenericResource values.
1003type ListResultIterator struct {
1004	i    int
1005	page ListResultPage
1006}
1007
1008// Next advances to the next value.  If there was an error making
1009// the request the iterator does not advance and the error is returned.
1010func (iter *ListResultIterator) Next() error {
1011	iter.i++
1012	if iter.i < len(iter.page.Values()) {
1013		return nil
1014	}
1015	err := iter.page.Next()
1016	if err != nil {
1017		iter.i--
1018		return err
1019	}
1020	iter.i = 0
1021	return nil
1022}
1023
1024// NotDone returns true if the enumeration should be started or is not yet complete.
1025func (iter ListResultIterator) NotDone() bool {
1026	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1027}
1028
1029// Response returns the raw server response from the last page request.
1030func (iter ListResultIterator) Response() ListResult {
1031	return iter.page.Response()
1032}
1033
1034// Value returns the current value or a zero-initialized value if the
1035// iterator has advanced beyond the end of the collection.
1036func (iter ListResultIterator) Value() GenericResource {
1037	if !iter.page.NotDone() {
1038		return GenericResource{}
1039	}
1040	return iter.page.Values()[iter.i]
1041}
1042
1043// IsEmpty returns true if the ListResult contains no values.
1044func (lr ListResult) IsEmpty() bool {
1045	return lr.Value == nil || len(*lr.Value) == 0
1046}
1047
1048// listResultPreparer prepares a request to retrieve the next set of results.
1049// It returns nil if no more results exist.
1050func (lr ListResult) listResultPreparer() (*http.Request, error) {
1051	if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 {
1052		return nil, nil
1053	}
1054	return autorest.Prepare(&http.Request{},
1055		autorest.AsJSON(),
1056		autorest.AsGet(),
1057		autorest.WithBaseURL(to.String(lr.NextLink)))
1058}
1059
1060// ListResultPage contains a page of GenericResource values.
1061type ListResultPage struct {
1062	fn func(ListResult) (ListResult, error)
1063	lr ListResult
1064}
1065
1066// Next advances to the next page of values.  If there was an error making
1067// the request the page does not advance and the error is returned.
1068func (page *ListResultPage) Next() error {
1069	next, err := page.fn(page.lr)
1070	if err != nil {
1071		return err
1072	}
1073	page.lr = next
1074	return nil
1075}
1076
1077// NotDone returns true if the page enumeration should be started or is not yet complete.
1078func (page ListResultPage) NotDone() bool {
1079	return !page.lr.IsEmpty()
1080}
1081
1082// Response returns the raw server response from the last page request.
1083func (page ListResultPage) Response() ListResult {
1084	return page.lr
1085}
1086
1087// Values returns the slice of values for the current page or nil if there are no values.
1088func (page ListResultPage) Values() []GenericResource {
1089	if page.lr.IsEmpty() {
1090		return nil
1091	}
1092	return *page.lr.Value
1093}
1094
1095// ManagementErrorWithDetails the detailed error message of resource management.
1096type ManagementErrorWithDetails struct {
1097	// Code - The error code returned when exporting the template.
1098	Code *string `json:"code,omitempty"`
1099	// Message - The error message describing the export error.
1100	Message *string `json:"message,omitempty"`
1101	// Target - The target of the error.
1102	Target *string `json:"target,omitempty"`
1103	// Details - Validation error.
1104	Details *[]ManagementErrorWithDetails `json:"details,omitempty"`
1105}
1106
1107// MoveInfo parameters of move resources.
1108type MoveInfo struct {
1109	// ResourcesProperty - The IDs of the resources.
1110	ResourcesProperty *[]string `json:"resources,omitempty"`
1111	// TargetResourceGroup - The target resource group.
1112	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
1113}
1114
1115// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1116type MoveResourcesFuture struct {
1117	azure.Future
1118}
1119
1120// Result returns the result of the asynchronous operation.
1121// If the operation has not completed it will return an error.
1122func (future *MoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
1123	var done bool
1124	done, err = future.Done(client)
1125	if err != nil {
1126		err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", future.Response(), "Polling failure")
1127		return
1128	}
1129	if !done {
1130		err = azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture")
1131		return
1132	}
1133	ar.Response = future.Response()
1134	return
1135}
1136
1137// OnErrorDeployment deployment on error behavior.
1138type OnErrorDeployment struct {
1139	// Type - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment'
1140	Type OnErrorDeploymentType `json:"type,omitempty"`
1141	// DeploymentName - The deployment to be used on error case.
1142	DeploymentName *string `json:"deploymentName,omitempty"`
1143}
1144
1145// OnErrorDeploymentExtended deployment on error behavior with additional details.
1146type OnErrorDeploymentExtended struct {
1147	// ProvisioningState - The state of the provisioning for the on error deployment.
1148	ProvisioningState *string `json:"provisioningState,omitempty"`
1149	// Type - The deployment on error behavior type. Possible values are LastSuccessful and SpecificDeployment. Possible values include: 'LastSuccessful', 'SpecificDeployment'
1150	Type OnErrorDeploymentType `json:"type,omitempty"`
1151	// DeploymentName - The deployment to be used on error case.
1152	DeploymentName *string `json:"deploymentName,omitempty"`
1153}
1154
1155// Operation microsoft.Resources operation
1156type Operation struct {
1157	// Name - Operation name: {provider}/{resource}/{operation}
1158	Name *string `json:"name,omitempty"`
1159	// Display - The object that represents the operation.
1160	Display *OperationDisplay `json:"display,omitempty"`
1161}
1162
1163// OperationDisplay the object that represents the operation.
1164type OperationDisplay struct {
1165	// Provider - Service provider: Microsoft.Resources
1166	Provider *string `json:"provider,omitempty"`
1167	// Resource - Resource on which the operation is performed: Profile, endpoint, etc.
1168	Resource *string `json:"resource,omitempty"`
1169	// Operation - Operation type: Read, write, delete, etc.
1170	Operation *string `json:"operation,omitempty"`
1171	// Description - Description of the operation.
1172	Description *string `json:"description,omitempty"`
1173}
1174
1175// OperationListResult result of the request to list Microsoft.Resources operations. It contains a list of
1176// operations and a URL link to get the next set of results.
1177type OperationListResult struct {
1178	autorest.Response `json:"-"`
1179	// Value - List of Microsoft.Resources operations.
1180	Value *[]Operation `json:"value,omitempty"`
1181	// NextLink - URL to get the next set of operation list results if there are any.
1182	NextLink *string `json:"nextLink,omitempty"`
1183}
1184
1185// OperationListResultIterator provides access to a complete listing of Operation values.
1186type OperationListResultIterator struct {
1187	i    int
1188	page OperationListResultPage
1189}
1190
1191// Next advances to the next value.  If there was an error making
1192// the request the iterator does not advance and the error is returned.
1193func (iter *OperationListResultIterator) Next() error {
1194	iter.i++
1195	if iter.i < len(iter.page.Values()) {
1196		return nil
1197	}
1198	err := iter.page.Next()
1199	if err != nil {
1200		iter.i--
1201		return err
1202	}
1203	iter.i = 0
1204	return nil
1205}
1206
1207// NotDone returns true if the enumeration should be started or is not yet complete.
1208func (iter OperationListResultIterator) NotDone() bool {
1209	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1210}
1211
1212// Response returns the raw server response from the last page request.
1213func (iter OperationListResultIterator) Response() OperationListResult {
1214	return iter.page.Response()
1215}
1216
1217// Value returns the current value or a zero-initialized value if the
1218// iterator has advanced beyond the end of the collection.
1219func (iter OperationListResultIterator) Value() Operation {
1220	if !iter.page.NotDone() {
1221		return Operation{}
1222	}
1223	return iter.page.Values()[iter.i]
1224}
1225
1226// IsEmpty returns true if the ListResult contains no values.
1227func (olr OperationListResult) IsEmpty() bool {
1228	return olr.Value == nil || len(*olr.Value) == 0
1229}
1230
1231// operationListResultPreparer prepares a request to retrieve the next set of results.
1232// It returns nil if no more results exist.
1233func (olr OperationListResult) operationListResultPreparer() (*http.Request, error) {
1234	if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 {
1235		return nil, nil
1236	}
1237	return autorest.Prepare(&http.Request{},
1238		autorest.AsJSON(),
1239		autorest.AsGet(),
1240		autorest.WithBaseURL(to.String(olr.NextLink)))
1241}
1242
1243// OperationListResultPage contains a page of Operation values.
1244type OperationListResultPage struct {
1245	fn  func(OperationListResult) (OperationListResult, error)
1246	olr OperationListResult
1247}
1248
1249// Next advances to the next page of values.  If there was an error making
1250// the request the page does not advance and the error is returned.
1251func (page *OperationListResultPage) Next() error {
1252	next, err := page.fn(page.olr)
1253	if err != nil {
1254		return err
1255	}
1256	page.olr = next
1257	return nil
1258}
1259
1260// NotDone returns true if the page enumeration should be started or is not yet complete.
1261func (page OperationListResultPage) NotDone() bool {
1262	return !page.olr.IsEmpty()
1263}
1264
1265// Response returns the raw server response from the last page request.
1266func (page OperationListResultPage) Response() OperationListResult {
1267	return page.olr
1268}
1269
1270// Values returns the slice of values for the current page or nil if there are no values.
1271func (page OperationListResultPage) Values() []Operation {
1272	if page.olr.IsEmpty() {
1273		return nil
1274	}
1275	return *page.olr.Value
1276}
1277
1278// ParametersLink entity representing the reference to the deployment paramaters.
1279type ParametersLink struct {
1280	// URI - The URI of the parameters file.
1281	URI *string `json:"uri,omitempty"`
1282	// ContentVersion - If included, must match the ContentVersion in the template.
1283	ContentVersion *string `json:"contentVersion,omitempty"`
1284}
1285
1286// Plan plan for the resource.
1287type Plan struct {
1288	// Name - The plan ID.
1289	Name *string `json:"name,omitempty"`
1290	// Publisher - The publisher ID.
1291	Publisher *string `json:"publisher,omitempty"`
1292	// Product - The offer ID.
1293	Product *string `json:"product,omitempty"`
1294	// PromotionCode - The promotion code.
1295	PromotionCode *string `json:"promotionCode,omitempty"`
1296	// Version - The plan's version.
1297	Version *string `json:"version,omitempty"`
1298}
1299
1300// Provider resource provider information.
1301type Provider struct {
1302	autorest.Response `json:"-"`
1303	// ID - The provider ID.
1304	ID *string `json:"id,omitempty"`
1305	// Namespace - The namespace of the resource provider.
1306	Namespace *string `json:"namespace,omitempty"`
1307	// RegistrationState - The registration state of the provider.
1308	RegistrationState *string `json:"registrationState,omitempty"`
1309	// ResourceTypes - The collection of provider resource types.
1310	ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
1311}
1312
1313// ProviderListResult list of resource providers.
1314type ProviderListResult struct {
1315	autorest.Response `json:"-"`
1316	// Value - An array of resource providers.
1317	Value *[]Provider `json:"value,omitempty"`
1318	// NextLink - The URL to use for getting the next set of results.
1319	NextLink *string `json:"nextLink,omitempty"`
1320}
1321
1322// ProviderListResultIterator provides access to a complete listing of Provider values.
1323type ProviderListResultIterator struct {
1324	i    int
1325	page ProviderListResultPage
1326}
1327
1328// Next advances to the next value.  If there was an error making
1329// the request the iterator does not advance and the error is returned.
1330func (iter *ProviderListResultIterator) Next() error {
1331	iter.i++
1332	if iter.i < len(iter.page.Values()) {
1333		return nil
1334	}
1335	err := iter.page.Next()
1336	if err != nil {
1337		iter.i--
1338		return err
1339	}
1340	iter.i = 0
1341	return nil
1342}
1343
1344// NotDone returns true if the enumeration should be started or is not yet complete.
1345func (iter ProviderListResultIterator) NotDone() bool {
1346	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1347}
1348
1349// Response returns the raw server response from the last page request.
1350func (iter ProviderListResultIterator) Response() ProviderListResult {
1351	return iter.page.Response()
1352}
1353
1354// Value returns the current value or a zero-initialized value if the
1355// iterator has advanced beyond the end of the collection.
1356func (iter ProviderListResultIterator) Value() Provider {
1357	if !iter.page.NotDone() {
1358		return Provider{}
1359	}
1360	return iter.page.Values()[iter.i]
1361}
1362
1363// IsEmpty returns true if the ListResult contains no values.
1364func (plr ProviderListResult) IsEmpty() bool {
1365	return plr.Value == nil || len(*plr.Value) == 0
1366}
1367
1368// providerListResultPreparer prepares a request to retrieve the next set of results.
1369// It returns nil if no more results exist.
1370func (plr ProviderListResult) providerListResultPreparer() (*http.Request, error) {
1371	if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 {
1372		return nil, nil
1373	}
1374	return autorest.Prepare(&http.Request{},
1375		autorest.AsJSON(),
1376		autorest.AsGet(),
1377		autorest.WithBaseURL(to.String(plr.NextLink)))
1378}
1379
1380// ProviderListResultPage contains a page of Provider values.
1381type ProviderListResultPage struct {
1382	fn  func(ProviderListResult) (ProviderListResult, error)
1383	plr ProviderListResult
1384}
1385
1386// Next advances to the next page of values.  If there was an error making
1387// the request the page does not advance and the error is returned.
1388func (page *ProviderListResultPage) Next() error {
1389	next, err := page.fn(page.plr)
1390	if err != nil {
1391		return err
1392	}
1393	page.plr = next
1394	return nil
1395}
1396
1397// NotDone returns true if the page enumeration should be started or is not yet complete.
1398func (page ProviderListResultPage) NotDone() bool {
1399	return !page.plr.IsEmpty()
1400}
1401
1402// Response returns the raw server response from the last page request.
1403func (page ProviderListResultPage) Response() ProviderListResult {
1404	return page.plr
1405}
1406
1407// Values returns the slice of values for the current page or nil if there are no values.
1408func (page ProviderListResultPage) Values() []Provider {
1409	if page.plr.IsEmpty() {
1410		return nil
1411	}
1412	return *page.plr.Value
1413}
1414
1415// ProviderOperationDisplayProperties resource provider operation's display properties.
1416type ProviderOperationDisplayProperties struct {
1417	// Publisher - Operation description.
1418	Publisher *string `json:"publisher,omitempty"`
1419	// Provider - Operation provider.
1420	Provider *string `json:"provider,omitempty"`
1421	// Resource - Operation resource.
1422	Resource *string `json:"resource,omitempty"`
1423	// Operation - Resource provider operation.
1424	Operation *string `json:"operation,omitempty"`
1425	// Description - Operation description.
1426	Description *string `json:"description,omitempty"`
1427}
1428
1429// ProviderResourceType resource type managed by the resource provider.
1430type ProviderResourceType struct {
1431	// ResourceType - The resource type.
1432	ResourceType *string `json:"resourceType,omitempty"`
1433	// Locations - The collection of locations where this resource type can be created.
1434	Locations *[]string `json:"locations,omitempty"`
1435	// Aliases - The aliases that are supported by this resource type.
1436	Aliases *[]AliasType `json:"aliases,omitempty"`
1437	// APIVersions - The API version.
1438	APIVersions *[]string `json:"apiVersions,omitempty"`
1439	// Properties - The properties.
1440	Properties map[string]*string `json:"properties"`
1441}
1442
1443// MarshalJSON is the custom marshaler for ProviderResourceType.
1444func (prt ProviderResourceType) MarshalJSON() ([]byte, error) {
1445	objectMap := make(map[string]interface{})
1446	if prt.ResourceType != nil {
1447		objectMap["resourceType"] = prt.ResourceType
1448	}
1449	if prt.Locations != nil {
1450		objectMap["locations"] = prt.Locations
1451	}
1452	if prt.Aliases != nil {
1453		objectMap["aliases"] = prt.Aliases
1454	}
1455	if prt.APIVersions != nil {
1456		objectMap["apiVersions"] = prt.APIVersions
1457	}
1458	if prt.Properties != nil {
1459		objectMap["properties"] = prt.Properties
1460	}
1461	return json.Marshal(objectMap)
1462}
1463
1464// Resource specified resource.
1465type Resource struct {
1466	// ID - Resource ID
1467	ID *string `json:"id,omitempty"`
1468	// Name - Resource name
1469	Name *string `json:"name,omitempty"`
1470	// Type - Resource type
1471	Type *string `json:"type,omitempty"`
1472	// Location - Resource location
1473	Location *string `json:"location,omitempty"`
1474	// Tags - Resource tags
1475	Tags map[string]*string `json:"tags"`
1476}
1477
1478// MarshalJSON is the custom marshaler for Resource.
1479func (r Resource) MarshalJSON() ([]byte, error) {
1480	objectMap := make(map[string]interface{})
1481	if r.ID != nil {
1482		objectMap["id"] = r.ID
1483	}
1484	if r.Name != nil {
1485		objectMap["name"] = r.Name
1486	}
1487	if r.Type != nil {
1488		objectMap["type"] = r.Type
1489	}
1490	if r.Location != nil {
1491		objectMap["location"] = r.Location
1492	}
1493	if r.Tags != nil {
1494		objectMap["tags"] = r.Tags
1495	}
1496	return json.Marshal(objectMap)
1497}
1498
1499// Sku SKU for the resource.
1500type Sku struct {
1501	// Name - The SKU name.
1502	Name *string `json:"name,omitempty"`
1503	// Tier - The SKU tier.
1504	Tier *string `json:"tier,omitempty"`
1505	// Size - The SKU size.
1506	Size *string `json:"size,omitempty"`
1507	// Family - The SKU family.
1508	Family *string `json:"family,omitempty"`
1509	// Model - The SKU model.
1510	Model *string `json:"model,omitempty"`
1511	// Capacity - The SKU capacity.
1512	Capacity *int32 `json:"capacity,omitempty"`
1513}
1514
1515// SubResource sub-resource.
1516type SubResource struct {
1517	// ID - Resource ID
1518	ID *string `json:"id,omitempty"`
1519}
1520
1521// TagCount tag count.
1522type TagCount struct {
1523	// Type - Type of count.
1524	Type *string `json:"type,omitempty"`
1525	// Value - Value of count.
1526	Value *int32 `json:"value,omitempty"`
1527}
1528
1529// TagDetails tag details.
1530type TagDetails struct {
1531	autorest.Response `json:"-"`
1532	// ID - The tag ID.
1533	ID *string `json:"id,omitempty"`
1534	// TagName - The tag name.
1535	TagName *string `json:"tagName,omitempty"`
1536	// Count - The total number of resources that use the resource tag. When a tag is initially created and has no associated resources, the value is 0.
1537	Count *TagCount `json:"count,omitempty"`
1538	// Values - The list of tag values.
1539	Values *[]TagValue `json:"values,omitempty"`
1540}
1541
1542// TagsListResult list of subscription tags.
1543type TagsListResult struct {
1544	autorest.Response `json:"-"`
1545	// Value - An array of tags.
1546	Value *[]TagDetails `json:"value,omitempty"`
1547	// NextLink - The URL to use for getting the next set of results.
1548	NextLink *string `json:"nextLink,omitempty"`
1549}
1550
1551// TagsListResultIterator provides access to a complete listing of TagDetails values.
1552type TagsListResultIterator struct {
1553	i    int
1554	page TagsListResultPage
1555}
1556
1557// Next advances to the next value.  If there was an error making
1558// the request the iterator does not advance and the error is returned.
1559func (iter *TagsListResultIterator) Next() error {
1560	iter.i++
1561	if iter.i < len(iter.page.Values()) {
1562		return nil
1563	}
1564	err := iter.page.Next()
1565	if err != nil {
1566		iter.i--
1567		return err
1568	}
1569	iter.i = 0
1570	return nil
1571}
1572
1573// NotDone returns true if the enumeration should be started or is not yet complete.
1574func (iter TagsListResultIterator) NotDone() bool {
1575	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1576}
1577
1578// Response returns the raw server response from the last page request.
1579func (iter TagsListResultIterator) Response() TagsListResult {
1580	return iter.page.Response()
1581}
1582
1583// Value returns the current value or a zero-initialized value if the
1584// iterator has advanced beyond the end of the collection.
1585func (iter TagsListResultIterator) Value() TagDetails {
1586	if !iter.page.NotDone() {
1587		return TagDetails{}
1588	}
1589	return iter.page.Values()[iter.i]
1590}
1591
1592// IsEmpty returns true if the ListResult contains no values.
1593func (tlr TagsListResult) IsEmpty() bool {
1594	return tlr.Value == nil || len(*tlr.Value) == 0
1595}
1596
1597// tagsListResultPreparer prepares a request to retrieve the next set of results.
1598// It returns nil if no more results exist.
1599func (tlr TagsListResult) tagsListResultPreparer() (*http.Request, error) {
1600	if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 {
1601		return nil, nil
1602	}
1603	return autorest.Prepare(&http.Request{},
1604		autorest.AsJSON(),
1605		autorest.AsGet(),
1606		autorest.WithBaseURL(to.String(tlr.NextLink)))
1607}
1608
1609// TagsListResultPage contains a page of TagDetails values.
1610type TagsListResultPage struct {
1611	fn  func(TagsListResult) (TagsListResult, error)
1612	tlr TagsListResult
1613}
1614
1615// Next advances to the next page of values.  If there was an error making
1616// the request the page does not advance and the error is returned.
1617func (page *TagsListResultPage) Next() error {
1618	next, err := page.fn(page.tlr)
1619	if err != nil {
1620		return err
1621	}
1622	page.tlr = next
1623	return nil
1624}
1625
1626// NotDone returns true if the page enumeration should be started or is not yet complete.
1627func (page TagsListResultPage) NotDone() bool {
1628	return !page.tlr.IsEmpty()
1629}
1630
1631// Response returns the raw server response from the last page request.
1632func (page TagsListResultPage) Response() TagsListResult {
1633	return page.tlr
1634}
1635
1636// Values returns the slice of values for the current page or nil if there are no values.
1637func (page TagsListResultPage) Values() []TagDetails {
1638	if page.tlr.IsEmpty() {
1639		return nil
1640	}
1641	return *page.tlr.Value
1642}
1643
1644// TagValue tag information.
1645type TagValue struct {
1646	autorest.Response `json:"-"`
1647	// ID - The tag ID.
1648	ID *string `json:"id,omitempty"`
1649	// TagValue - The tag value.
1650	TagValue *string `json:"tagValue,omitempty"`
1651	// Count - The tag value count.
1652	Count *TagCount `json:"count,omitempty"`
1653}
1654
1655// TargetResource target resource.
1656type TargetResource struct {
1657	// ID - The ID of the resource.
1658	ID *string `json:"id,omitempty"`
1659	// ResourceName - The name of the resource.
1660	ResourceName *string `json:"resourceName,omitempty"`
1661	// ResourceType - The type of the resource.
1662	ResourceType *string `json:"resourceType,omitempty"`
1663}
1664
1665// TemplateLink entity representing the reference to the template.
1666type TemplateLink struct {
1667	// URI - The URI of the template to deploy.
1668	URI *string `json:"uri,omitempty"`
1669	// ContentVersion - If included, must match the ContentVersion in the template.
1670	ContentVersion *string `json:"contentVersion,omitempty"`
1671}
1672
1673// UpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1674type UpdateByIDFuture struct {
1675	azure.Future
1676}
1677
1678// Result returns the result of the asynchronous operation.
1679// If the operation has not completed it will return an error.
1680func (future *UpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
1681	var done bool
1682	done, err = future.Done(client)
1683	if err != nil {
1684		err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", future.Response(), "Polling failure")
1685		return
1686	}
1687	if !done {
1688		err = azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture")
1689		return
1690	}
1691	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1692	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
1693		gr, err = client.UpdateByIDResponder(gr.Response.Response)
1694		if err != nil {
1695			err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
1696		}
1697	}
1698	return
1699}
1700
1701// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1702type UpdateFuture struct {
1703	azure.Future
1704}
1705
1706// Result returns the result of the asynchronous operation.
1707// If the operation has not completed it will return an error.
1708func (future *UpdateFuture) Result(client Client) (gr GenericResource, err error) {
1709	var done bool
1710	done, err = future.Done(client)
1711	if err != nil {
1712		err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", future.Response(), "Polling failure")
1713		return
1714	}
1715	if !done {
1716		err = azure.NewAsyncOpIncompleteError("resources.UpdateFuture")
1717		return
1718	}
1719	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1720	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
1721		gr, err = client.UpdateResponder(gr.Response.Response)
1722		if err != nil {
1723			err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
1724		}
1725	}
1726	return
1727}
1728
1729// ValidateMoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running
1730// operation.
1731type ValidateMoveResourcesFuture struct {
1732	azure.Future
1733}
1734
1735// Result returns the result of the asynchronous operation.
1736// If the operation has not completed it will return an error.
1737func (future *ValidateMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
1738	var done bool
1739	done, err = future.Done(client)
1740	if err != nil {
1741		err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", future.Response(), "Polling failure")
1742		return
1743	}
1744	if !done {
1745		err = azure.NewAsyncOpIncompleteError("resources.ValidateMoveResourcesFuture")
1746		return
1747	}
1748	ar.Response = future.Response()
1749	return
1750}
1751