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// ResourceIdentityType enumerates the values for resource identity type.
45type ResourceIdentityType string
46
47const (
48	// SystemAssigned ...
49	SystemAssigned ResourceIdentityType = "SystemAssigned"
50)
51
52// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type.
53func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
54	return []ResourceIdentityType{SystemAssigned}
55}
56
57// AliasPathType the type of the paths for alias.
58type AliasPathType struct {
59	// Path - The path of an alias.
60	Path *string `json:"path,omitempty"`
61	// APIVersions - The API versions.
62	APIVersions *[]string `json:"apiVersions,omitempty"`
63}
64
65// AliasType the alias type.
66type AliasType struct {
67	// Name - The alias name.
68	Name *string `json:"name,omitempty"`
69	// Paths - The paths for an alias.
70	Paths *[]AliasPathType `json:"paths,omitempty"`
71}
72
73// BasicDependency deployment dependency information.
74type BasicDependency struct {
75	// ID - The ID of the dependency.
76	ID *string `json:"id,omitempty"`
77	// ResourceType - The dependency resource type.
78	ResourceType *string `json:"resourceType,omitempty"`
79	// ResourceName - The dependency resource name.
80	ResourceName *string `json:"resourceName,omitempty"`
81}
82
83// CreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
84type CreateOrUpdateByIDFuture struct {
85	azure.Future
86}
87
88// Result returns the result of the asynchronous operation.
89// If the operation has not completed it will return an error.
90func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
91	var done bool
92	done, err = future.Done(client)
93	if err != nil {
94		err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", future.Response(), "Polling failure")
95		return
96	}
97	if !done {
98		err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture")
99		return
100	}
101	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
102	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
103		gr, err = client.CreateOrUpdateByIDResponder(gr.Response.Response)
104		if err != nil {
105			err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
106		}
107	}
108	return
109}
110
111// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
112type CreateOrUpdateFuture struct {
113	azure.Future
114}
115
116// Result returns the result of the asynchronous operation.
117// If the operation has not completed it will return an error.
118func (future *CreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) {
119	var done bool
120	done, err = future.Done(client)
121	if err != nil {
122		err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
123		return
124	}
125	if !done {
126		err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture")
127		return
128	}
129	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
130	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
131		gr, err = client.CreateOrUpdateResponder(gr.Response.Response)
132		if err != nil {
133			err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
134		}
135	}
136	return
137}
138
139// DebugSetting ...
140type DebugSetting struct {
141	// 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.
142	DetailLevel *string `json:"detailLevel,omitempty"`
143}
144
145// DeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
146type DeleteByIDFuture struct {
147	azure.Future
148}
149
150// Result returns the result of the asynchronous operation.
151// If the operation has not completed it will return an error.
152func (future *DeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) {
153	var done bool
154	done, err = future.Done(client)
155	if err != nil {
156		err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", future.Response(), "Polling failure")
157		return
158	}
159	if !done {
160		err = azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture")
161		return
162	}
163	ar.Response = future.Response()
164	return
165}
166
167// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
168type DeleteFuture struct {
169	azure.Future
170}
171
172// Result returns the result of the asynchronous operation.
173// If the operation has not completed it will return an error.
174func (future *DeleteFuture) Result(client Client) (ar autorest.Response, err error) {
175	var done bool
176	done, err = future.Done(client)
177	if err != nil {
178		err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", future.Response(), "Polling failure")
179		return
180	}
181	if !done {
182		err = azure.NewAsyncOpIncompleteError("resources.DeleteFuture")
183		return
184	}
185	ar.Response = future.Response()
186	return
187}
188
189// Dependency deployment dependency information.
190type Dependency struct {
191	// DependsOn - The list of dependencies.
192	DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
193	// ID - The ID of the dependency.
194	ID *string `json:"id,omitempty"`
195	// ResourceType - The dependency resource type.
196	ResourceType *string `json:"resourceType,omitempty"`
197	// ResourceName - The dependency resource name.
198	ResourceName *string `json:"resourceName,omitempty"`
199}
200
201// Deployment deployment operation parameters.
202type Deployment struct {
203	// Properties - The deployment properties.
204	Properties *DeploymentProperties `json:"properties,omitempty"`
205}
206
207// DeploymentExportResult the deployment export result.
208type DeploymentExportResult struct {
209	autorest.Response `json:"-"`
210	// Template - The template content.
211	Template interface{} `json:"template,omitempty"`
212}
213
214// DeploymentExtended deployment information.
215type DeploymentExtended struct {
216	autorest.Response `json:"-"`
217	// ID - The ID of the deployment.
218	ID *string `json:"id,omitempty"`
219	// Name - The name of the deployment.
220	Name *string `json:"name,omitempty"`
221	// Properties - Deployment properties.
222	Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
223}
224
225// DeploymentExtendedFilter deployment filter.
226type DeploymentExtendedFilter struct {
227	// ProvisioningState - The provisioning state.
228	ProvisioningState *string `json:"provisioningState,omitempty"`
229}
230
231// DeploymentListResult list of deployments.
232type DeploymentListResult struct {
233	autorest.Response `json:"-"`
234	// Value - An array of deployments.
235	Value *[]DeploymentExtended `json:"value,omitempty"`
236	// NextLink - The URL to use for getting the next set of results.
237	NextLink *string `json:"nextLink,omitempty"`
238}
239
240// DeploymentListResultIterator provides access to a complete listing of DeploymentExtended values.
241type DeploymentListResultIterator struct {
242	i    int
243	page DeploymentListResultPage
244}
245
246// Next advances to the next value.  If there was an error making
247// the request the iterator does not advance and the error is returned.
248func (iter *DeploymentListResultIterator) Next() error {
249	iter.i++
250	if iter.i < len(iter.page.Values()) {
251		return nil
252	}
253	err := iter.page.Next()
254	if err != nil {
255		iter.i--
256		return err
257	}
258	iter.i = 0
259	return nil
260}
261
262// NotDone returns true if the enumeration should be started or is not yet complete.
263func (iter DeploymentListResultIterator) NotDone() bool {
264	return iter.page.NotDone() && iter.i < len(iter.page.Values())
265}
266
267// Response returns the raw server response from the last page request.
268func (iter DeploymentListResultIterator) Response() DeploymentListResult {
269	return iter.page.Response()
270}
271
272// Value returns the current value or a zero-initialized value if the
273// iterator has advanced beyond the end of the collection.
274func (iter DeploymentListResultIterator) Value() DeploymentExtended {
275	if !iter.page.NotDone() {
276		return DeploymentExtended{}
277	}
278	return iter.page.Values()[iter.i]
279}
280
281// IsEmpty returns true if the ListResult contains no values.
282func (dlr DeploymentListResult) IsEmpty() bool {
283	return dlr.Value == nil || len(*dlr.Value) == 0
284}
285
286// deploymentListResultPreparer prepares a request to retrieve the next set of results.
287// It returns nil if no more results exist.
288func (dlr DeploymentListResult) deploymentListResultPreparer() (*http.Request, error) {
289	if dlr.NextLink == nil || len(to.String(dlr.NextLink)) < 1 {
290		return nil, nil
291	}
292	return autorest.Prepare(&http.Request{},
293		autorest.AsJSON(),
294		autorest.AsGet(),
295		autorest.WithBaseURL(to.String(dlr.NextLink)))
296}
297
298// DeploymentListResultPage contains a page of DeploymentExtended values.
299type DeploymentListResultPage struct {
300	fn  func(DeploymentListResult) (DeploymentListResult, error)
301	dlr DeploymentListResult
302}
303
304// Next advances to the next page of values.  If there was an error making
305// the request the page does not advance and the error is returned.
306func (page *DeploymentListResultPage) Next() error {
307	next, err := page.fn(page.dlr)
308	if err != nil {
309		return err
310	}
311	page.dlr = next
312	return nil
313}
314
315// NotDone returns true if the page enumeration should be started or is not yet complete.
316func (page DeploymentListResultPage) NotDone() bool {
317	return !page.dlr.IsEmpty()
318}
319
320// Response returns the raw server response from the last page request.
321func (page DeploymentListResultPage) Response() DeploymentListResult {
322	return page.dlr
323}
324
325// Values returns the slice of values for the current page or nil if there are no values.
326func (page DeploymentListResultPage) Values() []DeploymentExtended {
327	if page.dlr.IsEmpty() {
328		return nil
329	}
330	return *page.dlr.Value
331}
332
333// DeploymentOperation deployment operation information.
334type DeploymentOperation struct {
335	autorest.Response `json:"-"`
336	// ID - Full deployment operation ID.
337	ID *string `json:"id,omitempty"`
338	// OperationID - Deployment operation ID.
339	OperationID *string `json:"operationId,omitempty"`
340	// Properties - Deployment properties.
341	Properties *DeploymentOperationProperties `json:"properties,omitempty"`
342}
343
344// DeploymentOperationProperties deployment operation properties.
345type DeploymentOperationProperties struct {
346	// ProvisioningState - The state of the provisioning.
347	ProvisioningState *string `json:"provisioningState,omitempty"`
348	// Timestamp - The date and time of the operation.
349	Timestamp *date.Time `json:"timestamp,omitempty"`
350	// ServiceRequestID - Deployment operation service request id.
351	ServiceRequestID *string `json:"serviceRequestId,omitempty"`
352	// StatusCode - Operation status code.
353	StatusCode *string `json:"statusCode,omitempty"`
354	// StatusMessage - Operation status message.
355	StatusMessage interface{} `json:"statusMessage,omitempty"`
356	// TargetResource - The target resource.
357	TargetResource *TargetResource `json:"targetResource,omitempty"`
358	// Request - The HTTP request message.
359	Request *HTTPMessage `json:"request,omitempty"`
360	// Response - The HTTP response message.
361	Response *HTTPMessage `json:"response,omitempty"`
362}
363
364// DeploymentOperationsListResult list of deployment operations.
365type DeploymentOperationsListResult struct {
366	autorest.Response `json:"-"`
367	// Value - An array of deployment operations.
368	Value *[]DeploymentOperation `json:"value,omitempty"`
369	// NextLink - The URL to use for getting the next set of results.
370	NextLink *string `json:"nextLink,omitempty"`
371}
372
373// DeploymentOperationsListResultIterator provides access to a complete listing of DeploymentOperation values.
374type DeploymentOperationsListResultIterator struct {
375	i    int
376	page DeploymentOperationsListResultPage
377}
378
379// Next advances to the next value.  If there was an error making
380// the request the iterator does not advance and the error is returned.
381func (iter *DeploymentOperationsListResultIterator) Next() error {
382	iter.i++
383	if iter.i < len(iter.page.Values()) {
384		return nil
385	}
386	err := iter.page.Next()
387	if err != nil {
388		iter.i--
389		return err
390	}
391	iter.i = 0
392	return nil
393}
394
395// NotDone returns true if the enumeration should be started or is not yet complete.
396func (iter DeploymentOperationsListResultIterator) NotDone() bool {
397	return iter.page.NotDone() && iter.i < len(iter.page.Values())
398}
399
400// Response returns the raw server response from the last page request.
401func (iter DeploymentOperationsListResultIterator) Response() DeploymentOperationsListResult {
402	return iter.page.Response()
403}
404
405// Value returns the current value or a zero-initialized value if the
406// iterator has advanced beyond the end of the collection.
407func (iter DeploymentOperationsListResultIterator) Value() DeploymentOperation {
408	if !iter.page.NotDone() {
409		return DeploymentOperation{}
410	}
411	return iter.page.Values()[iter.i]
412}
413
414// IsEmpty returns true if the ListResult contains no values.
415func (dolr DeploymentOperationsListResult) IsEmpty() bool {
416	return dolr.Value == nil || len(*dolr.Value) == 0
417}
418
419// deploymentOperationsListResultPreparer prepares a request to retrieve the next set of results.
420// It returns nil if no more results exist.
421func (dolr DeploymentOperationsListResult) deploymentOperationsListResultPreparer() (*http.Request, error) {
422	if dolr.NextLink == nil || len(to.String(dolr.NextLink)) < 1 {
423		return nil, nil
424	}
425	return autorest.Prepare(&http.Request{},
426		autorest.AsJSON(),
427		autorest.AsGet(),
428		autorest.WithBaseURL(to.String(dolr.NextLink)))
429}
430
431// DeploymentOperationsListResultPage contains a page of DeploymentOperation values.
432type DeploymentOperationsListResultPage struct {
433	fn   func(DeploymentOperationsListResult) (DeploymentOperationsListResult, error)
434	dolr DeploymentOperationsListResult
435}
436
437// Next advances to the next page of values.  If there was an error making
438// the request the page does not advance and the error is returned.
439func (page *DeploymentOperationsListResultPage) Next() error {
440	next, err := page.fn(page.dolr)
441	if err != nil {
442		return err
443	}
444	page.dolr = next
445	return nil
446}
447
448// NotDone returns true if the page enumeration should be started or is not yet complete.
449func (page DeploymentOperationsListResultPage) NotDone() bool {
450	return !page.dolr.IsEmpty()
451}
452
453// Response returns the raw server response from the last page request.
454func (page DeploymentOperationsListResultPage) Response() DeploymentOperationsListResult {
455	return page.dolr
456}
457
458// Values returns the slice of values for the current page or nil if there are no values.
459func (page DeploymentOperationsListResultPage) Values() []DeploymentOperation {
460	if page.dolr.IsEmpty() {
461		return nil
462	}
463	return *page.dolr.Value
464}
465
466// DeploymentProperties deployment properties.
467type DeploymentProperties struct {
468	// 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.
469	Template interface{} `json:"template,omitempty"`
470	// TemplateLink - The URI of the template. Use either the templateLink property or the template property, but not both.
471	TemplateLink *TemplateLink `json:"templateLink,omitempty"`
472	// 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.
473	Parameters interface{} `json:"parameters,omitempty"`
474	// 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.
475	ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
476	// 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'
477	Mode DeploymentMode `json:"mode,omitempty"`
478	// DebugSetting - The debug setting of the deployment.
479	DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
480}
481
482// DeploymentPropertiesExtended deployment properties with additional details.
483type DeploymentPropertiesExtended struct {
484	// ProvisioningState - The state of the provisioning.
485	ProvisioningState *string `json:"provisioningState,omitempty"`
486	// CorrelationID - The correlation ID of the deployment.
487	CorrelationID *string `json:"correlationId,omitempty"`
488	// Timestamp - The timestamp of the template deployment.
489	Timestamp *date.Time `json:"timestamp,omitempty"`
490	// Outputs - Key/value pairs that represent deploymentoutput.
491	Outputs interface{} `json:"outputs,omitempty"`
492	// Providers - The list of resource providers needed for the deployment.
493	Providers *[]Provider `json:"providers,omitempty"`
494	// Dependencies - The list of deployment dependencies.
495	Dependencies *[]Dependency `json:"dependencies,omitempty"`
496	// Template - The template content. Use only one of Template or TemplateLink.
497	Template interface{} `json:"template,omitempty"`
498	// TemplateLink - The URI referencing the template. Use only one of Template or TemplateLink.
499	TemplateLink *TemplateLink `json:"templateLink,omitempty"`
500	// Parameters - Deployment parameters. Use only one of Parameters or ParametersLink.
501	Parameters interface{} `json:"parameters,omitempty"`
502	// ParametersLink - The URI referencing the parameters. Use only one of Parameters or ParametersLink.
503	ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
504	// Mode - The deployment mode. Possible values are Incremental and Complete. Possible values include: 'Incremental', 'Complete'
505	Mode DeploymentMode `json:"mode,omitempty"`
506	// DebugSetting - The debug setting of the deployment.
507	DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
508}
509
510// DeploymentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
511// operation.
512type DeploymentsCreateOrUpdateFuture struct {
513	azure.Future
514}
515
516// Result returns the result of the asynchronous operation.
517// If the operation has not completed it will return an error.
518func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (de DeploymentExtended, err error) {
519	var done bool
520	done, err = future.Done(client)
521	if err != nil {
522		err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
523		return
524	}
525	if !done {
526		err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture")
527		return
528	}
529	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
530	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
531		de, err = client.CreateOrUpdateResponder(de.Response.Response)
532		if err != nil {
533			err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request")
534		}
535	}
536	return
537}
538
539// DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
540type DeploymentsDeleteFuture struct {
541	azure.Future
542}
543
544// Result returns the result of the asynchronous operation.
545// If the operation has not completed it will return an error.
546func (future *DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
547	var done bool
548	done, err = future.Done(client)
549	if err != nil {
550		err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", future.Response(), "Polling failure")
551		return
552	}
553	if !done {
554		err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture")
555		return
556	}
557	ar.Response = future.Response()
558	return
559}
560
561// DeploymentValidateResult information from validate template deployment response.
562type DeploymentValidateResult struct {
563	autorest.Response `json:"-"`
564	// Error - Validation error.
565	Error *ManagementErrorWithDetails `json:"error,omitempty"`
566	// Properties - The template deployment properties.
567	Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
568}
569
570// ExportTemplateRequest export resource group template request parameters.
571type ExportTemplateRequest struct {
572	// ResourcesProperty - The IDs of the resources. The only supported string currently is '*' (all resources). Future updates will support exporting specific resources.
573	ResourcesProperty *[]string `json:"resources,omitempty"`
574	// Options - The export template options. Supported values include 'IncludeParameterDefaultValue', 'IncludeComments' or 'IncludeParameterDefaultValue, IncludeComments
575	Options *string `json:"options,omitempty"`
576}
577
578// GenericResource resource information.
579type GenericResource struct {
580	autorest.Response `json:"-"`
581	// Plan - The plan of the resource.
582	Plan *Plan `json:"plan,omitempty"`
583	// Properties - The resource properties.
584	Properties interface{} `json:"properties,omitempty"`
585	// Kind - The kind of the resource.
586	Kind *string `json:"kind,omitempty"`
587	// ManagedBy - ID of the resource that manages this resource.
588	ManagedBy *string `json:"managedBy,omitempty"`
589	// Sku - The SKU of the resource.
590	Sku *Sku `json:"sku,omitempty"`
591	// Identity - The identity of the resource.
592	Identity *Identity `json:"identity,omitempty"`
593	// ID - Resource ID
594	ID *string `json:"id,omitempty"`
595	// Name - Resource name
596	Name *string `json:"name,omitempty"`
597	// Type - Resource type
598	Type *string `json:"type,omitempty"`
599	// Location - Resource location
600	Location *string `json:"location,omitempty"`
601	// Tags - Resource tags
602	Tags map[string]*string `json:"tags"`
603}
604
605// MarshalJSON is the custom marshaler for GenericResource.
606func (gr GenericResource) MarshalJSON() ([]byte, error) {
607	objectMap := make(map[string]interface{})
608	if gr.Plan != nil {
609		objectMap["plan"] = gr.Plan
610	}
611	objectMap["properties"] = gr.Properties
612	if gr.Kind != nil {
613		objectMap["kind"] = gr.Kind
614	}
615	if gr.ManagedBy != nil {
616		objectMap["managedBy"] = gr.ManagedBy
617	}
618	if gr.Sku != nil {
619		objectMap["sku"] = gr.Sku
620	}
621	if gr.Identity != nil {
622		objectMap["identity"] = gr.Identity
623	}
624	if gr.ID != nil {
625		objectMap["id"] = gr.ID
626	}
627	if gr.Name != nil {
628		objectMap["name"] = gr.Name
629	}
630	if gr.Type != nil {
631		objectMap["type"] = gr.Type
632	}
633	if gr.Location != nil {
634		objectMap["location"] = gr.Location
635	}
636	if gr.Tags != nil {
637		objectMap["tags"] = gr.Tags
638	}
639	return json.Marshal(objectMap)
640}
641
642// GenericResourceFilter resource filter.
643type GenericResourceFilter struct {
644	// ResourceType - The resource type.
645	ResourceType *string `json:"resourceType,omitempty"`
646	// Tagname - The tag name.
647	Tagname *string `json:"tagname,omitempty"`
648	// Tagvalue - The tag value.
649	Tagvalue *string `json:"tagvalue,omitempty"`
650}
651
652// Group resource group information.
653type Group struct {
654	autorest.Response `json:"-"`
655	// ID - The ID of the resource group.
656	ID *string `json:"id,omitempty"`
657	// Name - The name of the resource group.
658	Name       *string          `json:"name,omitempty"`
659	Properties *GroupProperties `json:"properties,omitempty"`
660	// Location - The location of the resource group. It cannot be changed after the resource group has been created. It muct be one of the supported Azure locations.
661	Location *string `json:"location,omitempty"`
662	// ManagedBy - The ID of the resource that manages this resource group.
663	ManagedBy *string `json:"managedBy,omitempty"`
664	// Tags - The tags attached to the resource group.
665	Tags map[string]*string `json:"tags"`
666}
667
668// MarshalJSON is the custom marshaler for Group.
669func (g Group) MarshalJSON() ([]byte, error) {
670	objectMap := make(map[string]interface{})
671	if g.ID != nil {
672		objectMap["id"] = g.ID
673	}
674	if g.Name != nil {
675		objectMap["name"] = g.Name
676	}
677	if g.Properties != nil {
678		objectMap["properties"] = g.Properties
679	}
680	if g.Location != nil {
681		objectMap["location"] = g.Location
682	}
683	if g.ManagedBy != nil {
684		objectMap["managedBy"] = g.ManagedBy
685	}
686	if g.Tags != nil {
687		objectMap["tags"] = g.Tags
688	}
689	return json.Marshal(objectMap)
690}
691
692// GroupExportResult ...
693type GroupExportResult struct {
694	autorest.Response `json:"-"`
695	// Template - The template content.
696	Template interface{} `json:"template,omitempty"`
697	// Error - The error.
698	Error *ManagementErrorWithDetails `json:"error,omitempty"`
699}
700
701// GroupFilter resource group filter.
702type GroupFilter struct {
703	// TagName - The tag name.
704	TagName *string `json:"tagName,omitempty"`
705	// TagValue - The tag value.
706	TagValue *string `json:"tagValue,omitempty"`
707}
708
709// GroupListResult list of resource groups.
710type GroupListResult struct {
711	autorest.Response `json:"-"`
712	// Value - An array of resource groups.
713	Value *[]Group `json:"value,omitempty"`
714	// NextLink - The URL to use for getting the next set of results.
715	NextLink *string `json:"nextLink,omitempty"`
716}
717
718// GroupListResultIterator provides access to a complete listing of Group values.
719type GroupListResultIterator struct {
720	i    int
721	page GroupListResultPage
722}
723
724// Next advances to the next value.  If there was an error making
725// the request the iterator does not advance and the error is returned.
726func (iter *GroupListResultIterator) Next() error {
727	iter.i++
728	if iter.i < len(iter.page.Values()) {
729		return nil
730	}
731	err := iter.page.Next()
732	if err != nil {
733		iter.i--
734		return err
735	}
736	iter.i = 0
737	return nil
738}
739
740// NotDone returns true if the enumeration should be started or is not yet complete.
741func (iter GroupListResultIterator) NotDone() bool {
742	return iter.page.NotDone() && iter.i < len(iter.page.Values())
743}
744
745// Response returns the raw server response from the last page request.
746func (iter GroupListResultIterator) Response() GroupListResult {
747	return iter.page.Response()
748}
749
750// Value returns the current value or a zero-initialized value if the
751// iterator has advanced beyond the end of the collection.
752func (iter GroupListResultIterator) Value() Group {
753	if !iter.page.NotDone() {
754		return Group{}
755	}
756	return iter.page.Values()[iter.i]
757}
758
759// IsEmpty returns true if the ListResult contains no values.
760func (glr GroupListResult) IsEmpty() bool {
761	return glr.Value == nil || len(*glr.Value) == 0
762}
763
764// groupListResultPreparer prepares a request to retrieve the next set of results.
765// It returns nil if no more results exist.
766func (glr GroupListResult) groupListResultPreparer() (*http.Request, error) {
767	if glr.NextLink == nil || len(to.String(glr.NextLink)) < 1 {
768		return nil, nil
769	}
770	return autorest.Prepare(&http.Request{},
771		autorest.AsJSON(),
772		autorest.AsGet(),
773		autorest.WithBaseURL(to.String(glr.NextLink)))
774}
775
776// GroupListResultPage contains a page of Group values.
777type GroupListResultPage struct {
778	fn  func(GroupListResult) (GroupListResult, error)
779	glr GroupListResult
780}
781
782// Next advances to the next page of values.  If there was an error making
783// the request the page does not advance and the error is returned.
784func (page *GroupListResultPage) Next() error {
785	next, err := page.fn(page.glr)
786	if err != nil {
787		return err
788	}
789	page.glr = next
790	return nil
791}
792
793// NotDone returns true if the page enumeration should be started or is not yet complete.
794func (page GroupListResultPage) NotDone() bool {
795	return !page.glr.IsEmpty()
796}
797
798// Response returns the raw server response from the last page request.
799func (page GroupListResultPage) Response() GroupListResult {
800	return page.glr
801}
802
803// Values returns the slice of values for the current page or nil if there are no values.
804func (page GroupListResultPage) Values() []Group {
805	if page.glr.IsEmpty() {
806		return nil
807	}
808	return *page.glr.Value
809}
810
811// GroupProperties the resource group properties.
812type GroupProperties struct {
813	// ProvisioningState - The provisioning state.
814	ProvisioningState *string `json:"provisioningState,omitempty"`
815}
816
817// GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
818type GroupsDeleteFuture struct {
819	azure.Future
820}
821
822// Result returns the result of the asynchronous operation.
823// If the operation has not completed it will return an error.
824func (future *GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Response, err error) {
825	var done bool
826	done, err = future.Done(client)
827	if err != nil {
828		err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", future.Response(), "Polling failure")
829		return
830	}
831	if !done {
832		err = azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture")
833		return
834	}
835	ar.Response = future.Response()
836	return
837}
838
839// HTTPMessage ...
840type HTTPMessage struct {
841	// Content - HTTP message content.
842	Content interface{} `json:"content,omitempty"`
843}
844
845// Identity identity for the resource.
846type Identity struct {
847	// PrincipalID - The principal ID of resource identity.
848	PrincipalID *string `json:"principalId,omitempty"`
849	// TenantID - The tenant ID of resource.
850	TenantID *string `json:"tenantId,omitempty"`
851	// Type - The identity type. Possible values include: 'SystemAssigned'
852	Type ResourceIdentityType `json:"type,omitempty"`
853}
854
855// ListResult list of resource groups.
856type ListResult struct {
857	autorest.Response `json:"-"`
858	// Value - An array of resources.
859	Value *[]GenericResource `json:"value,omitempty"`
860	// NextLink - The URL to use for getting the next set of results.
861	NextLink *string `json:"nextLink,omitempty"`
862}
863
864// ListResultIterator provides access to a complete listing of GenericResource values.
865type ListResultIterator struct {
866	i    int
867	page ListResultPage
868}
869
870// Next advances to the next value.  If there was an error making
871// the request the iterator does not advance and the error is returned.
872func (iter *ListResultIterator) Next() error {
873	iter.i++
874	if iter.i < len(iter.page.Values()) {
875		return nil
876	}
877	err := iter.page.Next()
878	if err != nil {
879		iter.i--
880		return err
881	}
882	iter.i = 0
883	return nil
884}
885
886// NotDone returns true if the enumeration should be started or is not yet complete.
887func (iter ListResultIterator) NotDone() bool {
888	return iter.page.NotDone() && iter.i < len(iter.page.Values())
889}
890
891// Response returns the raw server response from the last page request.
892func (iter ListResultIterator) Response() ListResult {
893	return iter.page.Response()
894}
895
896// Value returns the current value or a zero-initialized value if the
897// iterator has advanced beyond the end of the collection.
898func (iter ListResultIterator) Value() GenericResource {
899	if !iter.page.NotDone() {
900		return GenericResource{}
901	}
902	return iter.page.Values()[iter.i]
903}
904
905// IsEmpty returns true if the ListResult contains no values.
906func (lr ListResult) IsEmpty() bool {
907	return lr.Value == nil || len(*lr.Value) == 0
908}
909
910// listResultPreparer prepares a request to retrieve the next set of results.
911// It returns nil if no more results exist.
912func (lr ListResult) listResultPreparer() (*http.Request, error) {
913	if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 {
914		return nil, nil
915	}
916	return autorest.Prepare(&http.Request{},
917		autorest.AsJSON(),
918		autorest.AsGet(),
919		autorest.WithBaseURL(to.String(lr.NextLink)))
920}
921
922// ListResultPage contains a page of GenericResource values.
923type ListResultPage struct {
924	fn func(ListResult) (ListResult, error)
925	lr ListResult
926}
927
928// Next advances to the next page of values.  If there was an error making
929// the request the page does not advance and the error is returned.
930func (page *ListResultPage) Next() error {
931	next, err := page.fn(page.lr)
932	if err != nil {
933		return err
934	}
935	page.lr = next
936	return nil
937}
938
939// NotDone returns true if the page enumeration should be started or is not yet complete.
940func (page ListResultPage) NotDone() bool {
941	return !page.lr.IsEmpty()
942}
943
944// Response returns the raw server response from the last page request.
945func (page ListResultPage) Response() ListResult {
946	return page.lr
947}
948
949// Values returns the slice of values for the current page or nil if there are no values.
950func (page ListResultPage) Values() []GenericResource {
951	if page.lr.IsEmpty() {
952		return nil
953	}
954	return *page.lr.Value
955}
956
957// ManagementErrorWithDetails ...
958type ManagementErrorWithDetails struct {
959	// Code - The error code returned when exporting the template.
960	Code *string `json:"code,omitempty"`
961	// Message - The error message describing the export error.
962	Message *string `json:"message,omitempty"`
963	// Target - The target of the error.
964	Target *string `json:"target,omitempty"`
965	// Details - Validation error.
966	Details *[]ManagementErrorWithDetails `json:"details,omitempty"`
967}
968
969// MoveInfo parameters of move resources.
970type MoveInfo struct {
971	// ResourcesProperty - The IDs of the resources.
972	ResourcesProperty *[]string `json:"resources,omitempty"`
973	// TargetResourceGroup - The target resource group.
974	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
975}
976
977// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation.
978type MoveResourcesFuture struct {
979	azure.Future
980}
981
982// Result returns the result of the asynchronous operation.
983// If the operation has not completed it will return an error.
984func (future *MoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
985	var done bool
986	done, err = future.Done(client)
987	if err != nil {
988		err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", future.Response(), "Polling failure")
989		return
990	}
991	if !done {
992		err = azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture")
993		return
994	}
995	ar.Response = future.Response()
996	return
997}
998
999// ParametersLink entity representing the reference to the deployment paramaters.
1000type ParametersLink struct {
1001	// URI - The URI of the parameters file.
1002	URI *string `json:"uri,omitempty"`
1003	// ContentVersion - If included, must match the ContentVersion in the template.
1004	ContentVersion *string `json:"contentVersion,omitempty"`
1005}
1006
1007// Plan plan for the resource.
1008type Plan struct {
1009	// Name - The plan ID.
1010	Name *string `json:"name,omitempty"`
1011	// Publisher - The publisher ID.
1012	Publisher *string `json:"publisher,omitempty"`
1013	// Product - The offer ID.
1014	Product *string `json:"product,omitempty"`
1015	// PromotionCode - The promotion code.
1016	PromotionCode *string `json:"promotionCode,omitempty"`
1017}
1018
1019// Provider resource provider information.
1020type Provider struct {
1021	autorest.Response `json:"-"`
1022	// ID - The provider ID.
1023	ID *string `json:"id,omitempty"`
1024	// Namespace - The namespace of the resource provider.
1025	Namespace *string `json:"namespace,omitempty"`
1026	// RegistrationState - The registration state of the provider.
1027	RegistrationState *string `json:"registrationState,omitempty"`
1028	// ResourceTypes - The collection of provider resource types.
1029	ResourceTypes *[]ProviderResourceType `json:"resourceTypes,omitempty"`
1030}
1031
1032// ProviderListResult list of resource providers.
1033type ProviderListResult struct {
1034	autorest.Response `json:"-"`
1035	// Value - An array of resource providers.
1036	Value *[]Provider `json:"value,omitempty"`
1037	// NextLink - The URL to use for getting the next set of results.
1038	NextLink *string `json:"nextLink,omitempty"`
1039}
1040
1041// ProviderListResultIterator provides access to a complete listing of Provider values.
1042type ProviderListResultIterator struct {
1043	i    int
1044	page ProviderListResultPage
1045}
1046
1047// Next advances to the next value.  If there was an error making
1048// the request the iterator does not advance and the error is returned.
1049func (iter *ProviderListResultIterator) Next() error {
1050	iter.i++
1051	if iter.i < len(iter.page.Values()) {
1052		return nil
1053	}
1054	err := iter.page.Next()
1055	if err != nil {
1056		iter.i--
1057		return err
1058	}
1059	iter.i = 0
1060	return nil
1061}
1062
1063// NotDone returns true if the enumeration should be started or is not yet complete.
1064func (iter ProviderListResultIterator) NotDone() bool {
1065	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1066}
1067
1068// Response returns the raw server response from the last page request.
1069func (iter ProviderListResultIterator) Response() ProviderListResult {
1070	return iter.page.Response()
1071}
1072
1073// Value returns the current value or a zero-initialized value if the
1074// iterator has advanced beyond the end of the collection.
1075func (iter ProviderListResultIterator) Value() Provider {
1076	if !iter.page.NotDone() {
1077		return Provider{}
1078	}
1079	return iter.page.Values()[iter.i]
1080}
1081
1082// IsEmpty returns true if the ListResult contains no values.
1083func (plr ProviderListResult) IsEmpty() bool {
1084	return plr.Value == nil || len(*plr.Value) == 0
1085}
1086
1087// providerListResultPreparer prepares a request to retrieve the next set of results.
1088// It returns nil if no more results exist.
1089func (plr ProviderListResult) providerListResultPreparer() (*http.Request, error) {
1090	if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 {
1091		return nil, nil
1092	}
1093	return autorest.Prepare(&http.Request{},
1094		autorest.AsJSON(),
1095		autorest.AsGet(),
1096		autorest.WithBaseURL(to.String(plr.NextLink)))
1097}
1098
1099// ProviderListResultPage contains a page of Provider values.
1100type ProviderListResultPage struct {
1101	fn  func(ProviderListResult) (ProviderListResult, error)
1102	plr ProviderListResult
1103}
1104
1105// Next advances to the next page of values.  If there was an error making
1106// the request the page does not advance and the error is returned.
1107func (page *ProviderListResultPage) Next() error {
1108	next, err := page.fn(page.plr)
1109	if err != nil {
1110		return err
1111	}
1112	page.plr = next
1113	return nil
1114}
1115
1116// NotDone returns true if the page enumeration should be started or is not yet complete.
1117func (page ProviderListResultPage) NotDone() bool {
1118	return !page.plr.IsEmpty()
1119}
1120
1121// Response returns the raw server response from the last page request.
1122func (page ProviderListResultPage) Response() ProviderListResult {
1123	return page.plr
1124}
1125
1126// Values returns the slice of values for the current page or nil if there are no values.
1127func (page ProviderListResultPage) Values() []Provider {
1128	if page.plr.IsEmpty() {
1129		return nil
1130	}
1131	return *page.plr.Value
1132}
1133
1134// ProviderOperationDisplayProperties resource provider operation's display properties.
1135type ProviderOperationDisplayProperties struct {
1136	// Publisher - Operation description.
1137	Publisher *string `json:"publisher,omitempty"`
1138	// Provider - Operation provider.
1139	Provider *string `json:"provider,omitempty"`
1140	// Resource - Operation resource.
1141	Resource *string `json:"resource,omitempty"`
1142	// Operation - Operation.
1143	Operation *string `json:"operation,omitempty"`
1144	// Description - Operation description.
1145	Description *string `json:"description,omitempty"`
1146}
1147
1148// ProviderResourceType resource type managed by the resource provider.
1149type ProviderResourceType struct {
1150	// ResourceType - The resource type.
1151	ResourceType *string `json:"resourceType,omitempty"`
1152	// Locations - The collection of locations where this resource type can be created.
1153	Locations *[]string `json:"locations,omitempty"`
1154	// Aliases - The aliases that are supported by this resource type.
1155	Aliases *[]AliasType `json:"aliases,omitempty"`
1156	// APIVersions - The API version.
1157	APIVersions *[]string `json:"apiVersions,omitempty"`
1158	// Properties - The properties.
1159	Properties map[string]*string `json:"properties"`
1160}
1161
1162// MarshalJSON is the custom marshaler for ProviderResourceType.
1163func (prt ProviderResourceType) MarshalJSON() ([]byte, error) {
1164	objectMap := make(map[string]interface{})
1165	if prt.ResourceType != nil {
1166		objectMap["resourceType"] = prt.ResourceType
1167	}
1168	if prt.Locations != nil {
1169		objectMap["locations"] = prt.Locations
1170	}
1171	if prt.Aliases != nil {
1172		objectMap["aliases"] = prt.Aliases
1173	}
1174	if prt.APIVersions != nil {
1175		objectMap["apiVersions"] = prt.APIVersions
1176	}
1177	if prt.Properties != nil {
1178		objectMap["properties"] = prt.Properties
1179	}
1180	return json.Marshal(objectMap)
1181}
1182
1183// Resource ...
1184type Resource struct {
1185	// ID - Resource ID
1186	ID *string `json:"id,omitempty"`
1187	// Name - Resource name
1188	Name *string `json:"name,omitempty"`
1189	// Type - Resource type
1190	Type *string `json:"type,omitempty"`
1191	// Location - Resource location
1192	Location *string `json:"location,omitempty"`
1193	// Tags - Resource tags
1194	Tags map[string]*string `json:"tags"`
1195}
1196
1197// MarshalJSON is the custom marshaler for Resource.
1198func (r Resource) MarshalJSON() ([]byte, error) {
1199	objectMap := make(map[string]interface{})
1200	if r.ID != nil {
1201		objectMap["id"] = r.ID
1202	}
1203	if r.Name != nil {
1204		objectMap["name"] = r.Name
1205	}
1206	if r.Type != nil {
1207		objectMap["type"] = r.Type
1208	}
1209	if r.Location != nil {
1210		objectMap["location"] = r.Location
1211	}
1212	if r.Tags != nil {
1213		objectMap["tags"] = r.Tags
1214	}
1215	return json.Marshal(objectMap)
1216}
1217
1218// Sku SKU for the resource.
1219type Sku struct {
1220	// Name - The SKU name.
1221	Name *string `json:"name,omitempty"`
1222	// Tier - The SKU tier.
1223	Tier *string `json:"tier,omitempty"`
1224	// Size - The SKU size.
1225	Size *string `json:"size,omitempty"`
1226	// Family - The SKU family.
1227	Family *string `json:"family,omitempty"`
1228	// Model - The SKU model.
1229	Model *string `json:"model,omitempty"`
1230	// Capacity - The SKU capacity.
1231	Capacity *int32 `json:"capacity,omitempty"`
1232}
1233
1234// SubResource ...
1235type SubResource struct {
1236	// ID - Resource ID
1237	ID *string `json:"id,omitempty"`
1238}
1239
1240// TagCount tag count.
1241type TagCount struct {
1242	// Type - Type of count.
1243	Type *string `json:"type,omitempty"`
1244	// Value - Value of count.
1245	Value *int32 `json:"value,omitempty"`
1246}
1247
1248// TagDetails tag details.
1249type TagDetails struct {
1250	autorest.Response `json:"-"`
1251	// ID - The tag ID.
1252	ID *string `json:"id,omitempty"`
1253	// TagName - The tag name.
1254	TagName *string `json:"tagName,omitempty"`
1255	// 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.
1256	Count *TagCount `json:"count,omitempty"`
1257	// Values - The list of tag values.
1258	Values *[]TagValue `json:"values,omitempty"`
1259}
1260
1261// TagsListResult list of subscription tags.
1262type TagsListResult struct {
1263	autorest.Response `json:"-"`
1264	// Value - An array of tags.
1265	Value *[]TagDetails `json:"value,omitempty"`
1266	// NextLink - The URL to use for getting the next set of results.
1267	NextLink *string `json:"nextLink,omitempty"`
1268}
1269
1270// TagsListResultIterator provides access to a complete listing of TagDetails values.
1271type TagsListResultIterator struct {
1272	i    int
1273	page TagsListResultPage
1274}
1275
1276// Next advances to the next value.  If there was an error making
1277// the request the iterator does not advance and the error is returned.
1278func (iter *TagsListResultIterator) Next() error {
1279	iter.i++
1280	if iter.i < len(iter.page.Values()) {
1281		return nil
1282	}
1283	err := iter.page.Next()
1284	if err != nil {
1285		iter.i--
1286		return err
1287	}
1288	iter.i = 0
1289	return nil
1290}
1291
1292// NotDone returns true if the enumeration should be started or is not yet complete.
1293func (iter TagsListResultIterator) NotDone() bool {
1294	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1295}
1296
1297// Response returns the raw server response from the last page request.
1298func (iter TagsListResultIterator) Response() TagsListResult {
1299	return iter.page.Response()
1300}
1301
1302// Value returns the current value or a zero-initialized value if the
1303// iterator has advanced beyond the end of the collection.
1304func (iter TagsListResultIterator) Value() TagDetails {
1305	if !iter.page.NotDone() {
1306		return TagDetails{}
1307	}
1308	return iter.page.Values()[iter.i]
1309}
1310
1311// IsEmpty returns true if the ListResult contains no values.
1312func (tlr TagsListResult) IsEmpty() bool {
1313	return tlr.Value == nil || len(*tlr.Value) == 0
1314}
1315
1316// tagsListResultPreparer prepares a request to retrieve the next set of results.
1317// It returns nil if no more results exist.
1318func (tlr TagsListResult) tagsListResultPreparer() (*http.Request, error) {
1319	if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 {
1320		return nil, nil
1321	}
1322	return autorest.Prepare(&http.Request{},
1323		autorest.AsJSON(),
1324		autorest.AsGet(),
1325		autorest.WithBaseURL(to.String(tlr.NextLink)))
1326}
1327
1328// TagsListResultPage contains a page of TagDetails values.
1329type TagsListResultPage struct {
1330	fn  func(TagsListResult) (TagsListResult, error)
1331	tlr TagsListResult
1332}
1333
1334// Next advances to the next page of values.  If there was an error making
1335// the request the page does not advance and the error is returned.
1336func (page *TagsListResultPage) Next() error {
1337	next, err := page.fn(page.tlr)
1338	if err != nil {
1339		return err
1340	}
1341	page.tlr = next
1342	return nil
1343}
1344
1345// NotDone returns true if the page enumeration should be started or is not yet complete.
1346func (page TagsListResultPage) NotDone() bool {
1347	return !page.tlr.IsEmpty()
1348}
1349
1350// Response returns the raw server response from the last page request.
1351func (page TagsListResultPage) Response() TagsListResult {
1352	return page.tlr
1353}
1354
1355// Values returns the slice of values for the current page or nil if there are no values.
1356func (page TagsListResultPage) Values() []TagDetails {
1357	if page.tlr.IsEmpty() {
1358		return nil
1359	}
1360	return *page.tlr.Value
1361}
1362
1363// TagValue tag information.
1364type TagValue struct {
1365	autorest.Response `json:"-"`
1366	// ID - The tag ID.
1367	ID *string `json:"id,omitempty"`
1368	// TagValue - The tag value.
1369	TagValue *string `json:"tagValue,omitempty"`
1370	// Count - The tag value count.
1371	Count *TagCount `json:"count,omitempty"`
1372}
1373
1374// TargetResource target resource.
1375type TargetResource struct {
1376	// ID - The ID of the resource.
1377	ID *string `json:"id,omitempty"`
1378	// ResourceName - The name of the resource.
1379	ResourceName *string `json:"resourceName,omitempty"`
1380	// ResourceType - The type of the resource.
1381	ResourceType *string `json:"resourceType,omitempty"`
1382}
1383
1384// TemplateLink entity representing the reference to the template.
1385type TemplateLink struct {
1386	// URI - The URI of the template to deploy.
1387	URI *string `json:"uri,omitempty"`
1388	// ContentVersion - If included, must match the ContentVersion in the template.
1389	ContentVersion *string `json:"contentVersion,omitempty"`
1390}
1391
1392// UpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1393type UpdateByIDFuture struct {
1394	azure.Future
1395}
1396
1397// Result returns the result of the asynchronous operation.
1398// If the operation has not completed it will return an error.
1399func (future *UpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
1400	var done bool
1401	done, err = future.Done(client)
1402	if err != nil {
1403		err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", future.Response(), "Polling failure")
1404		return
1405	}
1406	if !done {
1407		err = azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture")
1408		return
1409	}
1410	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1411	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
1412		gr, err = client.UpdateByIDResponder(gr.Response.Response)
1413		if err != nil {
1414			err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
1415		}
1416	}
1417	return
1418}
1419
1420// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1421type UpdateFuture struct {
1422	azure.Future
1423}
1424
1425// Result returns the result of the asynchronous operation.
1426// If the operation has not completed it will return an error.
1427func (future *UpdateFuture) Result(client Client) (gr GenericResource, err error) {
1428	var done bool
1429	done, err = future.Done(client)
1430	if err != nil {
1431		err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", future.Response(), "Polling failure")
1432		return
1433	}
1434	if !done {
1435		err = azure.NewAsyncOpIncompleteError("resources.UpdateFuture")
1436		return
1437	}
1438	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1439	if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
1440		gr, err = client.UpdateResponder(gr.Response.Response)
1441		if err != nil {
1442			err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
1443		}
1444	}
1445	return
1446}
1447