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