1package migrate 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/date" 14 "github.com/Azure/go-autorest/autorest/to" 15 "github.com/Azure/go-autorest/tracing" 16 "net/http" 17) 18 19// The package's fully qualified name. 20const fqdn = "github.com/Azure/azure-sdk-for-go/services/migrate/mgmt/2020-01-01/migrate" 21 22// AgentConfiguration ... 23type AgentConfiguration struct { 24 AgentID *string `json:"agentId,omitempty"` 25 DependencyAgentID *string `json:"dependencyAgentId,omitempty"` 26 DependencyAgentVersion *string `json:"dependencyAgentVersion,omitempty"` 27 DependencyAgentRevision *string `json:"dependencyAgentRevision,omitempty"` 28 // RebootStatus - Possible values include: 'RebootStatusUnknown', 'RebootStatusRebooted', 'RebootStatusNotRebooted' 29 RebootStatus RebootStatus `json:"rebootStatus,omitempty"` 30 ClockGranularity *int32 `json:"clockGranularity,omitempty"` 31} 32 33// Application application in the guest virtual machine. 34type Application struct { 35 // Name - READ-ONLY; Name of the Application. 36 Name *string `json:"name,omitempty"` 37 // Version - READ-ONLY; Version of the Application. 38 Version *string `json:"version,omitempty"` 39 // Provider - READ-ONLY; Provider of the Application. 40 Provider *string `json:"provider,omitempty"` 41} 42 43// MarshalJSON is the custom marshaler for Application. 44func (a Application) MarshalJSON() ([]byte, error) { 45 objectMap := make(map[string]interface{}) 46 return json.Marshal(objectMap) 47} 48 49// AppsAndRoles appsAndRoles in the guest virtual machine. 50type AppsAndRoles struct { 51 // Applications - READ-ONLY; Applications of the AppsAndRoles. 52 Applications *[]Application `json:"applications,omitempty"` 53 // WebApplications - READ-ONLY; WebApplications of the AppsAndRoles. 54 WebApplications *[]WebApplication `json:"webApplications,omitempty"` 55 // Features - READ-ONLY; Features of the AppsAndRoles. 56 Features *[]Feature `json:"features,omitempty"` 57 // SQLServers - READ-ONLY; SQLServers of the AppsAndRoles. 58 SQLServers *[]SQLServer `json:"sqlServers,omitempty"` 59 // SharePointServers - READ-ONLY; SharePointServers of the AppsAndRoles. 60 SharePointServers *[]SharePointServer `json:"sharePointServers,omitempty"` 61 // SystemCenters - READ-ONLY; SystemCenters of the AppsAndRoles. 62 SystemCenters *[]SystemCenter `json:"systemCenters,omitempty"` 63 // BizTalkServers - READ-ONLY; BizTalkServers of the AppsAndRoles. 64 BizTalkServers *[]BizTalkServer `json:"bizTalkServers,omitempty"` 65 // ExchangeServers - READ-ONLY; ExchangeServers of the AppsAndRoles. 66 ExchangeServers *[]ExchangeServer `json:"exchangeServers,omitempty"` 67 // OtherDatabases - READ-ONLY; OtherDatabaseServers of the AppsAndRoles. 68 OtherDatabases *[]OtherDatabase `json:"otherDatabases,omitempty"` 69} 70 71// MarshalJSON is the custom marshaler for AppsAndRoles. 72func (aar AppsAndRoles) MarshalJSON() ([]byte, error) { 73 objectMap := make(map[string]interface{}) 74 return json.Marshal(objectMap) 75} 76 77// BizTalkServer bizTalkServer in the guest virtual machine. 78type BizTalkServer struct { 79 // ProductName - READ-ONLY; ProductName of the BizTalkServer. 80 ProductName *string `json:"productName,omitempty"` 81 // Status - READ-ONLY; Status of the BizTalkServer. 82 Status *string `json:"status,omitempty"` 83} 84 85// MarshalJSON is the custom marshaler for BizTalkServer. 86func (bts BizTalkServer) MarshalJSON() ([]byte, error) { 87 objectMap := make(map[string]interface{}) 88 return json.Marshal(objectMap) 89} 90 91// ErrorDetails error contract returned when some exception occurs in Rest API. 92type ErrorDetails struct { 93 // Code - READ-ONLY; Error code. 94 Code *string `json:"code,omitempty"` 95 // Message - READ-ONLY; Error message. 96 Message *string `json:"message,omitempty"` 97 // PossibleCauses - READ-ONLY; Possible causes of error. 98 PossibleCauses *string `json:"possibleCauses,omitempty"` 99 // RecommendedAction - READ-ONLY; Recommended action to resolve error. 100 RecommendedAction *string `json:"recommendedAction,omitempty"` 101 // Severity - READ-ONLY; Error severity. 102 Severity *string `json:"severity,omitempty"` 103 // IsAgentReportedError - READ-ONLY; Value indicating whether the error originated from a agent or not. 104 IsAgentReportedError *bool `json:"isAgentReportedError,omitempty"` 105 // AgentErrorCode - READ-ONLY; Agent error code. 106 AgentErrorCode *string `json:"agentErrorCode,omitempty"` 107 // AgentErrorMessage - READ-ONLY; Error message from the agent. 108 AgentErrorMessage *string `json:"agentErrorMessage,omitempty"` 109 // AgentErrorPossibleCauses - READ-ONLY; Possible causes for the agent error. 110 AgentErrorPossibleCauses *string `json:"agentErrorPossibleCauses,omitempty"` 111 // AgentErrorRecommendedAction - READ-ONLY; Recommended action for the agent error. 112 AgentErrorRecommendedAction *string `json:"agentErrorRecommendedAction,omitempty"` 113} 114 115// MarshalJSON is the custom marshaler for ErrorDetails. 116func (ed ErrorDetails) MarshalJSON() ([]byte, error) { 117 objectMap := make(map[string]interface{}) 118 return json.Marshal(objectMap) 119} 120 121// ExchangeServer exchangeServer in the guest virtual machine. 122type ExchangeServer struct { 123 // ProductName - READ-ONLY; ProductName of the ExchangeServer. 124 ProductName *string `json:"productName,omitempty"` 125 // Edition - READ-ONLY; Edition of the ExchangeServer. 126 Edition *string `json:"edition,omitempty"` 127 // Roles - READ-ONLY; Roles of the ExchangeServer. 128 Roles *string `json:"roles,omitempty"` 129 // ServicePack - READ-ONLY; ServicePack of the ExchangeServer. 130 ServicePack *string `json:"servicePack,omitempty"` 131 // Version - READ-ONLY; Version of the ExchangeServer. 132 Version *string `json:"version,omitempty"` 133} 134 135// MarshalJSON is the custom marshaler for ExchangeServer. 136func (es ExchangeServer) MarshalJSON() ([]byte, error) { 137 objectMap := make(map[string]interface{}) 138 return json.Marshal(objectMap) 139} 140 141// Feature feature in the guest virtual machine. 142type Feature struct { 143 // Name - READ-ONLY; Name of the Feature. 144 Name *string `json:"name,omitempty"` 145 // FeatureType - READ-ONLY; FeatureType of the Feature. 146 FeatureType *string `json:"featureType,omitempty"` 147 // Parent - READ-ONLY; Parent of the Feature. 148 Parent *string `json:"parent,omitempty"` 149 // Status - READ-ONLY; Status of the Feature. 150 Status *string `json:"status,omitempty"` 151} 152 153// MarshalJSON is the custom marshaler for Feature. 154func (f Feature) MarshalJSON() ([]byte, error) { 155 objectMap := make(map[string]interface{}) 156 return json.Marshal(objectMap) 157} 158 159// GuestOSDetails data related to a machine's operating system. Serialized and stored as part of Machine 160// Rest object. 161type GuestOSDetails struct { 162 // OsType - Type of the operating system. 163 OsType *string `json:"osType,omitempty"` 164 // OsName - READ-ONLY; Name of the operating system. 165 OsName *string `json:"osName,omitempty"` 166 // OsVersion - READ-ONLY; Version of the operating system. 167 OsVersion *string `json:"osVersion,omitempty"` 168} 169 170// MarshalJSON is the custom marshaler for GuestOSDetails. 171func (god GuestOSDetails) MarshalJSON() ([]byte, error) { 172 objectMap := make(map[string]interface{}) 173 if god.OsType != nil { 174 objectMap["osType"] = god.OsType 175 } 176 return json.Marshal(objectMap) 177} 178 179// HealthErrorDetails error contract returned when some exception occurs in Rest API. 180type HealthErrorDetails struct { 181 // ID - READ-ONLY; Error ID. 182 ID *int64 `json:"id,omitempty"` 183 // Code - READ-ONLY; Error name. 184 Code *string `json:"code,omitempty"` 185 // Message - READ-ONLY; Error message. 186 Message *string `json:"message,omitempty"` 187 // PossibleCauses - READ-ONLY; Possible causes of error. 188 PossibleCauses *string `json:"possibleCauses,omitempty"` 189 // RecommendedAction - READ-ONLY; Recommended action to resolve error. 190 RecommendedAction *string `json:"recommendedAction,omitempty"` 191 // Severity - READ-ONLY; Error severity. 192 Severity *string `json:"severity,omitempty"` 193 // SummaryMessage - READ-ONLY; Error summary message. 194 SummaryMessage *string `json:"summaryMessage,omitempty"` 195 // Source - READ-ONLY; Error source. 196 Source *string `json:"source,omitempty"` 197 // MessageParameters - READ-ONLY; Message parameters. 198 MessageParameters map[string]*string `json:"messageParameters"` 199} 200 201// MarshalJSON is the custom marshaler for HealthErrorDetails. 202func (hed HealthErrorDetails) MarshalJSON() ([]byte, error) { 203 objectMap := make(map[string]interface{}) 204 return json.Marshal(objectMap) 205} 206 207// HostingConfiguration ... 208type HostingConfiguration struct { 209 Provider *string `json:"provider,omitempty"` 210} 211 212// HyperVCluster cluster REST Resource. 213type HyperVCluster struct { 214 autorest.Response `json:"-"` 215 // ID - READ-ONLY; Resource Id. 216 ID *string `json:"id,omitempty"` 217 // Name - Name of the cluster. 218 Name *string `json:"name,omitempty"` 219 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/hyperVSites/clusters. 220 Type *string `json:"type,omitempty"` 221 // Properties - Nested properties of the cluster. 222 Properties *HyperVClusterProperties `json:"properties,omitempty"` 223} 224 225// MarshalJSON is the custom marshaler for HyperVCluster. 226func (hvc HyperVCluster) MarshalJSON() ([]byte, error) { 227 objectMap := make(map[string]interface{}) 228 if hvc.Name != nil { 229 objectMap["name"] = hvc.Name 230 } 231 if hvc.Properties != nil { 232 objectMap["properties"] = hvc.Properties 233 } 234 return json.Marshal(objectMap) 235} 236 237// HyperVClusterCollection collection of Hyper-V clusters. 238type HyperVClusterCollection struct { 239 autorest.Response `json:"-"` 240 // Value - READ-ONLY; List of clusters. 241 Value *[]HyperVCluster `json:"value,omitempty"` 242 // NextLink - READ-ONLY; Value of next link. 243 NextLink *string `json:"nextLink,omitempty"` 244} 245 246// MarshalJSON is the custom marshaler for HyperVClusterCollection. 247func (hvcc HyperVClusterCollection) MarshalJSON() ([]byte, error) { 248 objectMap := make(map[string]interface{}) 249 return json.Marshal(objectMap) 250} 251 252// HyperVClusterCollectionIterator provides access to a complete listing of HyperVCluster values. 253type HyperVClusterCollectionIterator struct { 254 i int 255 page HyperVClusterCollectionPage 256} 257 258// NextWithContext advances to the next value. If there was an error making 259// the request the iterator does not advance and the error is returned. 260func (iter *HyperVClusterCollectionIterator) NextWithContext(ctx context.Context) (err error) { 261 if tracing.IsEnabled() { 262 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVClusterCollectionIterator.NextWithContext") 263 defer func() { 264 sc := -1 265 if iter.Response().Response.Response != nil { 266 sc = iter.Response().Response.Response.StatusCode 267 } 268 tracing.EndSpan(ctx, sc, err) 269 }() 270 } 271 iter.i++ 272 if iter.i < len(iter.page.Values()) { 273 return nil 274 } 275 err = iter.page.NextWithContext(ctx) 276 if err != nil { 277 iter.i-- 278 return err 279 } 280 iter.i = 0 281 return nil 282} 283 284// Next advances to the next value. If there was an error making 285// the request the iterator does not advance and the error is returned. 286// Deprecated: Use NextWithContext() instead. 287func (iter *HyperVClusterCollectionIterator) Next() error { 288 return iter.NextWithContext(context.Background()) 289} 290 291// NotDone returns true if the enumeration should be started or is not yet complete. 292func (iter HyperVClusterCollectionIterator) NotDone() bool { 293 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 294} 295 296// Response returns the raw server response from the last page request. 297func (iter HyperVClusterCollectionIterator) Response() HyperVClusterCollection { 298 return iter.page.Response() 299} 300 301// Value returns the current value or a zero-initialized value if the 302// iterator has advanced beyond the end of the collection. 303func (iter HyperVClusterCollectionIterator) Value() HyperVCluster { 304 if !iter.page.NotDone() { 305 return HyperVCluster{} 306 } 307 return iter.page.Values()[iter.i] 308} 309 310// Creates a new instance of the HyperVClusterCollectionIterator type. 311func NewHyperVClusterCollectionIterator(page HyperVClusterCollectionPage) HyperVClusterCollectionIterator { 312 return HyperVClusterCollectionIterator{page: page} 313} 314 315// IsEmpty returns true if the ListResult contains no values. 316func (hvcc HyperVClusterCollection) IsEmpty() bool { 317 return hvcc.Value == nil || len(*hvcc.Value) == 0 318} 319 320// hasNextLink returns true if the NextLink is not empty. 321func (hvcc HyperVClusterCollection) hasNextLink() bool { 322 return hvcc.NextLink != nil && len(*hvcc.NextLink) != 0 323} 324 325// hyperVClusterCollectionPreparer prepares a request to retrieve the next set of results. 326// It returns nil if no more results exist. 327func (hvcc HyperVClusterCollection) hyperVClusterCollectionPreparer(ctx context.Context) (*http.Request, error) { 328 if !hvcc.hasNextLink() { 329 return nil, nil 330 } 331 return autorest.Prepare((&http.Request{}).WithContext(ctx), 332 autorest.AsJSON(), 333 autorest.AsGet(), 334 autorest.WithBaseURL(to.String(hvcc.NextLink))) 335} 336 337// HyperVClusterCollectionPage contains a page of HyperVCluster values. 338type HyperVClusterCollectionPage struct { 339 fn func(context.Context, HyperVClusterCollection) (HyperVClusterCollection, error) 340 hvcc HyperVClusterCollection 341} 342 343// NextWithContext advances to the next page of values. If there was an error making 344// the request the page does not advance and the error is returned. 345func (page *HyperVClusterCollectionPage) NextWithContext(ctx context.Context) (err error) { 346 if tracing.IsEnabled() { 347 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVClusterCollectionPage.NextWithContext") 348 defer func() { 349 sc := -1 350 if page.Response().Response.Response != nil { 351 sc = page.Response().Response.Response.StatusCode 352 } 353 tracing.EndSpan(ctx, sc, err) 354 }() 355 } 356 for { 357 next, err := page.fn(ctx, page.hvcc) 358 if err != nil { 359 return err 360 } 361 page.hvcc = next 362 if !next.hasNextLink() || !next.IsEmpty() { 363 break 364 } 365 } 366 return nil 367} 368 369// Next advances to the next page of values. If there was an error making 370// the request the page does not advance and the error is returned. 371// Deprecated: Use NextWithContext() instead. 372func (page *HyperVClusterCollectionPage) Next() error { 373 return page.NextWithContext(context.Background()) 374} 375 376// NotDone returns true if the page enumeration should be started or is not yet complete. 377func (page HyperVClusterCollectionPage) NotDone() bool { 378 return !page.hvcc.IsEmpty() 379} 380 381// Response returns the raw server response from the last page request. 382func (page HyperVClusterCollectionPage) Response() HyperVClusterCollection { 383 return page.hvcc 384} 385 386// Values returns the slice of values for the current page or nil if there are no values. 387func (page HyperVClusterCollectionPage) Values() []HyperVCluster { 388 if page.hvcc.IsEmpty() { 389 return nil 390 } 391 return *page.hvcc.Value 392} 393 394// Creates a new instance of the HyperVClusterCollectionPage type. 395func NewHyperVClusterCollectionPage(cur HyperVClusterCollection, getNextPage func(context.Context, HyperVClusterCollection) (HyperVClusterCollection, error)) HyperVClusterCollectionPage { 396 return HyperVClusterCollectionPage{ 397 fn: getNextPage, 398 hvcc: cur, 399 } 400} 401 402// HyperVClusterProperties class for cluster properties. 403type HyperVClusterProperties struct { 404 // CreatedTimestamp - READ-ONLY; Timestamp marking Hyper-V cluster creation. 405 CreatedTimestamp *string `json:"createdTimestamp,omitempty"` 406 // UpdatedTimestamp - READ-ONLY; Timestamp marking last updated on the Hyper-V cluster. 407 UpdatedTimestamp *string `json:"updatedTimestamp,omitempty"` 408 // Fqdn - FQDN/IPAddress of the Hyper-V cluster. 409 Fqdn *string `json:"fqdn,omitempty"` 410 // FunctionalLevel - READ-ONLY; Functional level of the Hyper-V cluster. 411 FunctionalLevel *int32 `json:"functionalLevel,omitempty"` 412 // Status - READ-ONLY; Status of the Hyper-V cluster. 413 Status *string `json:"status,omitempty"` 414 // RunAsAccountID - Run as account ID of the Hyper-V cluster. 415 RunAsAccountID *string `json:"runAsAccountId,omitempty"` 416 // HostFqdnList - List of hosts (FQDN) currently being tracked by the cluster. 417 HostFqdnList *[]string `json:"hostFqdnList,omitempty"` 418 // Errors - READ-ONLY; Errors for Hyper-V clusters. 419 Errors *[]HealthErrorDetails `json:"errors,omitempty"` 420} 421 422// MarshalJSON is the custom marshaler for HyperVClusterProperties. 423func (hvcp HyperVClusterProperties) MarshalJSON() ([]byte, error) { 424 objectMap := make(map[string]interface{}) 425 if hvcp.Fqdn != nil { 426 objectMap["fqdn"] = hvcp.Fqdn 427 } 428 if hvcp.RunAsAccountID != nil { 429 objectMap["runAsAccountId"] = hvcp.RunAsAccountID 430 } 431 if hvcp.HostFqdnList != nil { 432 objectMap["hostFqdnList"] = hvcp.HostFqdnList 433 } 434 return json.Marshal(objectMap) 435} 436 437// HyperVDisk second level object returned as part of Machine REST resource. 438type HyperVDisk struct { 439 // InstanceID - READ-ONLY; Id of the disk. 440 InstanceID *string `json:"instanceId,omitempty"` 441 // VhdID - READ-ONLY; VHD Id of the disk. 442 VhdID *string `json:"vhdId,omitempty"` 443 // MaxSizeInBytes - READ-ONLY; Bytes allocated for the disk. 444 MaxSizeInBytes *int64 `json:"maxSizeInBytes,omitempty"` 445 // Name - READ-ONLY; Name of the disk. 446 Name *string `json:"name,omitempty"` 447 // DiskType - READ-ONLY; Type of the disk. 448 DiskType *string `json:"diskType,omitempty"` 449 // Lun - READ-ONLY; LUN of the disk. 450 Lun *int32 `json:"lun,omitempty"` 451 // Path - READ-ONLY; Path of the disk. 452 Path *string `json:"path,omitempty"` 453} 454 455// MarshalJSON is the custom marshaler for HyperVDisk. 456func (hvd HyperVDisk) MarshalJSON() ([]byte, error) { 457 objectMap := make(map[string]interface{}) 458 return json.Marshal(objectMap) 459} 460 461// HyperVHost host REST Resource. 462type HyperVHost struct { 463 autorest.Response `json:"-"` 464 // ID - READ-ONLY; Resource Id. 465 ID *string `json:"id,omitempty"` 466 // Name - Name of the host. 467 Name *string `json:"name,omitempty"` 468 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/hyperVSites/hosts. 469 Type *string `json:"type,omitempty"` 470 // Properties - Nested properties. 471 Properties *HyperVHostProperties `json:"properties,omitempty"` 472} 473 474// MarshalJSON is the custom marshaler for HyperVHost. 475func (hvh HyperVHost) MarshalJSON() ([]byte, error) { 476 objectMap := make(map[string]interface{}) 477 if hvh.Name != nil { 478 objectMap["name"] = hvh.Name 479 } 480 if hvh.Properties != nil { 481 objectMap["properties"] = hvh.Properties 482 } 483 return json.Marshal(objectMap) 484} 485 486// HyperVHostCollection collection of Hyper-V hosts. 487type HyperVHostCollection struct { 488 autorest.Response `json:"-"` 489 // Value - READ-ONLY; List of hosts. 490 Value *[]HyperVHost `json:"value,omitempty"` 491 // NextLink - READ-ONLY; Value of next link. 492 NextLink *string `json:"nextLink,omitempty"` 493} 494 495// MarshalJSON is the custom marshaler for HyperVHostCollection. 496func (hvhc HyperVHostCollection) MarshalJSON() ([]byte, error) { 497 objectMap := make(map[string]interface{}) 498 return json.Marshal(objectMap) 499} 500 501// HyperVHostCollectionIterator provides access to a complete listing of HyperVHost values. 502type HyperVHostCollectionIterator struct { 503 i int 504 page HyperVHostCollectionPage 505} 506 507// NextWithContext advances to the next value. If there was an error making 508// the request the iterator does not advance and the error is returned. 509func (iter *HyperVHostCollectionIterator) NextWithContext(ctx context.Context) (err error) { 510 if tracing.IsEnabled() { 511 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVHostCollectionIterator.NextWithContext") 512 defer func() { 513 sc := -1 514 if iter.Response().Response.Response != nil { 515 sc = iter.Response().Response.Response.StatusCode 516 } 517 tracing.EndSpan(ctx, sc, err) 518 }() 519 } 520 iter.i++ 521 if iter.i < len(iter.page.Values()) { 522 return nil 523 } 524 err = iter.page.NextWithContext(ctx) 525 if err != nil { 526 iter.i-- 527 return err 528 } 529 iter.i = 0 530 return nil 531} 532 533// Next advances to the next value. If there was an error making 534// the request the iterator does not advance and the error is returned. 535// Deprecated: Use NextWithContext() instead. 536func (iter *HyperVHostCollectionIterator) Next() error { 537 return iter.NextWithContext(context.Background()) 538} 539 540// NotDone returns true if the enumeration should be started or is not yet complete. 541func (iter HyperVHostCollectionIterator) NotDone() bool { 542 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 543} 544 545// Response returns the raw server response from the last page request. 546func (iter HyperVHostCollectionIterator) Response() HyperVHostCollection { 547 return iter.page.Response() 548} 549 550// Value returns the current value or a zero-initialized value if the 551// iterator has advanced beyond the end of the collection. 552func (iter HyperVHostCollectionIterator) Value() HyperVHost { 553 if !iter.page.NotDone() { 554 return HyperVHost{} 555 } 556 return iter.page.Values()[iter.i] 557} 558 559// Creates a new instance of the HyperVHostCollectionIterator type. 560func NewHyperVHostCollectionIterator(page HyperVHostCollectionPage) HyperVHostCollectionIterator { 561 return HyperVHostCollectionIterator{page: page} 562} 563 564// IsEmpty returns true if the ListResult contains no values. 565func (hvhc HyperVHostCollection) IsEmpty() bool { 566 return hvhc.Value == nil || len(*hvhc.Value) == 0 567} 568 569// hasNextLink returns true if the NextLink is not empty. 570func (hvhc HyperVHostCollection) hasNextLink() bool { 571 return hvhc.NextLink != nil && len(*hvhc.NextLink) != 0 572} 573 574// hyperVHostCollectionPreparer prepares a request to retrieve the next set of results. 575// It returns nil if no more results exist. 576func (hvhc HyperVHostCollection) hyperVHostCollectionPreparer(ctx context.Context) (*http.Request, error) { 577 if !hvhc.hasNextLink() { 578 return nil, nil 579 } 580 return autorest.Prepare((&http.Request{}).WithContext(ctx), 581 autorest.AsJSON(), 582 autorest.AsGet(), 583 autorest.WithBaseURL(to.String(hvhc.NextLink))) 584} 585 586// HyperVHostCollectionPage contains a page of HyperVHost values. 587type HyperVHostCollectionPage struct { 588 fn func(context.Context, HyperVHostCollection) (HyperVHostCollection, error) 589 hvhc HyperVHostCollection 590} 591 592// NextWithContext advances to the next page of values. If there was an error making 593// the request the page does not advance and the error is returned. 594func (page *HyperVHostCollectionPage) NextWithContext(ctx context.Context) (err error) { 595 if tracing.IsEnabled() { 596 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVHostCollectionPage.NextWithContext") 597 defer func() { 598 sc := -1 599 if page.Response().Response.Response != nil { 600 sc = page.Response().Response.Response.StatusCode 601 } 602 tracing.EndSpan(ctx, sc, err) 603 }() 604 } 605 for { 606 next, err := page.fn(ctx, page.hvhc) 607 if err != nil { 608 return err 609 } 610 page.hvhc = next 611 if !next.hasNextLink() || !next.IsEmpty() { 612 break 613 } 614 } 615 return nil 616} 617 618// Next advances to the next page of values. If there was an error making 619// the request the page does not advance and the error is returned. 620// Deprecated: Use NextWithContext() instead. 621func (page *HyperVHostCollectionPage) Next() error { 622 return page.NextWithContext(context.Background()) 623} 624 625// NotDone returns true if the page enumeration should be started or is not yet complete. 626func (page HyperVHostCollectionPage) NotDone() bool { 627 return !page.hvhc.IsEmpty() 628} 629 630// Response returns the raw server response from the last page request. 631func (page HyperVHostCollectionPage) Response() HyperVHostCollection { 632 return page.hvhc 633} 634 635// Values returns the slice of values for the current page or nil if there are no values. 636func (page HyperVHostCollectionPage) Values() []HyperVHost { 637 if page.hvhc.IsEmpty() { 638 return nil 639 } 640 return *page.hvhc.Value 641} 642 643// Creates a new instance of the HyperVHostCollectionPage type. 644func NewHyperVHostCollectionPage(cur HyperVHostCollection, getNextPage func(context.Context, HyperVHostCollection) (HyperVHostCollection, error)) HyperVHostCollectionPage { 645 return HyperVHostCollectionPage{ 646 fn: getNextPage, 647 hvhc: cur, 648 } 649} 650 651// HyperVHostProperties class for host properties. 652type HyperVHostProperties struct { 653 // CreatedTimestamp - READ-ONLY; Timestamp marking Hyper-V host creation. 654 CreatedTimestamp *string `json:"createdTimestamp,omitempty"` 655 // UpdatedTimestamp - READ-ONLY; Timestamp marking last updated on the Hyper-V host. 656 UpdatedTimestamp *string `json:"updatedTimestamp,omitempty"` 657 // Fqdn - FQDN/IPAddress of the Hyper-V host. 658 Fqdn *string `json:"fqdn,omitempty"` 659 // RunAsAccountID - Run as account ID of the Hyper-V host. 660 RunAsAccountID *string `json:"runAsAccountId,omitempty"` 661 // Version - READ-ONLY; Version of the Hyper-V host. 662 Version *string `json:"version,omitempty"` 663 // Errors - READ-ONLY; Errors for Hyper-V hosts. 664 Errors *[]HealthErrorDetails `json:"errors,omitempty"` 665} 666 667// MarshalJSON is the custom marshaler for HyperVHostProperties. 668func (hvhp HyperVHostProperties) MarshalJSON() ([]byte, error) { 669 objectMap := make(map[string]interface{}) 670 if hvhp.Fqdn != nil { 671 objectMap["fqdn"] = hvhp.Fqdn 672 } 673 if hvhp.RunAsAccountID != nil { 674 objectMap["runAsAccountId"] = hvhp.RunAsAccountID 675 } 676 return json.Marshal(objectMap) 677} 678 679// HypervisorConfiguration ... 680type HypervisorConfiguration struct { 681 // HypervisorType - Possible values include: 'HypervisorTypeUnknown', 'HypervisorTypeHyperv' 682 HypervisorType HypervisorType `json:"hypervisorType,omitempty"` 683 NativeHostMachineID *string `json:"nativeHostMachineId,omitempty"` 684} 685 686// HyperVJob job REST Resource. 687type HyperVJob struct { 688 autorest.Response `json:"-"` 689 // ID - READ-ONLY; Resource Id. 690 ID *string `json:"id,omitempty"` 691 // Name - READ-ONLY; Name of the Job. 692 Name *string `json:"name,omitempty"` 693 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/HyperVSites/Jobs. 694 Type *string `json:"type,omitempty"` 695 // Properties - READ-ONLY; nested properties of Hyper-V job. 696 Properties *JobProperties `json:"properties,omitempty"` 697} 698 699// MarshalJSON is the custom marshaler for HyperVJob. 700func (hvj HyperVJob) MarshalJSON() ([]byte, error) { 701 objectMap := make(map[string]interface{}) 702 return json.Marshal(objectMap) 703} 704 705// HyperVJobCollection collection of Hyper-V jobs. 706type HyperVJobCollection struct { 707 autorest.Response `json:"-"` 708 // Value - READ-ONLY; List of jobs. 709 Value *[]HyperVJob `json:"value,omitempty"` 710 // NextLink - READ-ONLY; Value of next link. 711 NextLink *string `json:"nextLink,omitempty"` 712} 713 714// MarshalJSON is the custom marshaler for HyperVJobCollection. 715func (hvjc HyperVJobCollection) MarshalJSON() ([]byte, error) { 716 objectMap := make(map[string]interface{}) 717 return json.Marshal(objectMap) 718} 719 720// HyperVJobCollectionIterator provides access to a complete listing of HyperVJob values. 721type HyperVJobCollectionIterator struct { 722 i int 723 page HyperVJobCollectionPage 724} 725 726// NextWithContext advances to the next value. If there was an error making 727// the request the iterator does not advance and the error is returned. 728func (iter *HyperVJobCollectionIterator) NextWithContext(ctx context.Context) (err error) { 729 if tracing.IsEnabled() { 730 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVJobCollectionIterator.NextWithContext") 731 defer func() { 732 sc := -1 733 if iter.Response().Response.Response != nil { 734 sc = iter.Response().Response.Response.StatusCode 735 } 736 tracing.EndSpan(ctx, sc, err) 737 }() 738 } 739 iter.i++ 740 if iter.i < len(iter.page.Values()) { 741 return nil 742 } 743 err = iter.page.NextWithContext(ctx) 744 if err != nil { 745 iter.i-- 746 return err 747 } 748 iter.i = 0 749 return nil 750} 751 752// Next advances to the next value. If there was an error making 753// the request the iterator does not advance and the error is returned. 754// Deprecated: Use NextWithContext() instead. 755func (iter *HyperVJobCollectionIterator) Next() error { 756 return iter.NextWithContext(context.Background()) 757} 758 759// NotDone returns true if the enumeration should be started or is not yet complete. 760func (iter HyperVJobCollectionIterator) NotDone() bool { 761 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 762} 763 764// Response returns the raw server response from the last page request. 765func (iter HyperVJobCollectionIterator) Response() HyperVJobCollection { 766 return iter.page.Response() 767} 768 769// Value returns the current value or a zero-initialized value if the 770// iterator has advanced beyond the end of the collection. 771func (iter HyperVJobCollectionIterator) Value() HyperVJob { 772 if !iter.page.NotDone() { 773 return HyperVJob{} 774 } 775 return iter.page.Values()[iter.i] 776} 777 778// Creates a new instance of the HyperVJobCollectionIterator type. 779func NewHyperVJobCollectionIterator(page HyperVJobCollectionPage) HyperVJobCollectionIterator { 780 return HyperVJobCollectionIterator{page: page} 781} 782 783// IsEmpty returns true if the ListResult contains no values. 784func (hvjc HyperVJobCollection) IsEmpty() bool { 785 return hvjc.Value == nil || len(*hvjc.Value) == 0 786} 787 788// hasNextLink returns true if the NextLink is not empty. 789func (hvjc HyperVJobCollection) hasNextLink() bool { 790 return hvjc.NextLink != nil && len(*hvjc.NextLink) != 0 791} 792 793// hyperVJobCollectionPreparer prepares a request to retrieve the next set of results. 794// It returns nil if no more results exist. 795func (hvjc HyperVJobCollection) hyperVJobCollectionPreparer(ctx context.Context) (*http.Request, error) { 796 if !hvjc.hasNextLink() { 797 return nil, nil 798 } 799 return autorest.Prepare((&http.Request{}).WithContext(ctx), 800 autorest.AsJSON(), 801 autorest.AsGet(), 802 autorest.WithBaseURL(to.String(hvjc.NextLink))) 803} 804 805// HyperVJobCollectionPage contains a page of HyperVJob values. 806type HyperVJobCollectionPage struct { 807 fn func(context.Context, HyperVJobCollection) (HyperVJobCollection, error) 808 hvjc HyperVJobCollection 809} 810 811// NextWithContext advances to the next page of values. If there was an error making 812// the request the page does not advance and the error is returned. 813func (page *HyperVJobCollectionPage) NextWithContext(ctx context.Context) (err error) { 814 if tracing.IsEnabled() { 815 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVJobCollectionPage.NextWithContext") 816 defer func() { 817 sc := -1 818 if page.Response().Response.Response != nil { 819 sc = page.Response().Response.Response.StatusCode 820 } 821 tracing.EndSpan(ctx, sc, err) 822 }() 823 } 824 for { 825 next, err := page.fn(ctx, page.hvjc) 826 if err != nil { 827 return err 828 } 829 page.hvjc = next 830 if !next.hasNextLink() || !next.IsEmpty() { 831 break 832 } 833 } 834 return nil 835} 836 837// Next advances to the next page of values. If there was an error making 838// the request the page does not advance and the error is returned. 839// Deprecated: Use NextWithContext() instead. 840func (page *HyperVJobCollectionPage) Next() error { 841 return page.NextWithContext(context.Background()) 842} 843 844// NotDone returns true if the page enumeration should be started or is not yet complete. 845func (page HyperVJobCollectionPage) NotDone() bool { 846 return !page.hvjc.IsEmpty() 847} 848 849// Response returns the raw server response from the last page request. 850func (page HyperVJobCollectionPage) Response() HyperVJobCollection { 851 return page.hvjc 852} 853 854// Values returns the slice of values for the current page or nil if there are no values. 855func (page HyperVJobCollectionPage) Values() []HyperVJob { 856 if page.hvjc.IsEmpty() { 857 return nil 858 } 859 return *page.hvjc.Value 860} 861 862// Creates a new instance of the HyperVJobCollectionPage type. 863func NewHyperVJobCollectionPage(cur HyperVJobCollection, getNextPage func(context.Context, HyperVJobCollection) (HyperVJobCollection, error)) HyperVJobCollectionPage { 864 return HyperVJobCollectionPage{ 865 fn: getNextPage, 866 hvjc: cur, 867 } 868} 869 870// HyperVMachine machine REST Resource. 871type HyperVMachine struct { 872 autorest.Response `json:"-"` 873 // ID - READ-ONLY; Resource Id. 874 ID *string `json:"id,omitempty"` 875 // Name - READ-ONLY; Name of the Sites. 876 Name *string `json:"name,omitempty"` 877 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/HyperVSites/Machines. 878 Type *string `json:"type,omitempty"` 879 // Properties - READ-ONLY; Nested properties. 880 Properties *HyperVMachineProperties `json:"properties,omitempty"` 881} 882 883// MarshalJSON is the custom marshaler for HyperVMachine. 884func (hvm HyperVMachine) MarshalJSON() ([]byte, error) { 885 objectMap := make(map[string]interface{}) 886 return json.Marshal(objectMap) 887} 888 889// HyperVMachineCollection collection of Hyper-V machines. 890type HyperVMachineCollection struct { 891 autorest.Response `json:"-"` 892 // Value - READ-ONLY; List of machines. 893 Value *[]HyperVMachine `json:"value,omitempty"` 894 // NextLink - READ-ONLY; Value of next link. 895 NextLink *string `json:"nextLink,omitempty"` 896} 897 898// MarshalJSON is the custom marshaler for HyperVMachineCollection. 899func (hvmc HyperVMachineCollection) MarshalJSON() ([]byte, error) { 900 objectMap := make(map[string]interface{}) 901 return json.Marshal(objectMap) 902} 903 904// HyperVMachineCollectionIterator provides access to a complete listing of HyperVMachine values. 905type HyperVMachineCollectionIterator struct { 906 i int 907 page HyperVMachineCollectionPage 908} 909 910// NextWithContext advances to the next value. If there was an error making 911// the request the iterator does not advance and the error is returned. 912func (iter *HyperVMachineCollectionIterator) NextWithContext(ctx context.Context) (err error) { 913 if tracing.IsEnabled() { 914 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVMachineCollectionIterator.NextWithContext") 915 defer func() { 916 sc := -1 917 if iter.Response().Response.Response != nil { 918 sc = iter.Response().Response.Response.StatusCode 919 } 920 tracing.EndSpan(ctx, sc, err) 921 }() 922 } 923 iter.i++ 924 if iter.i < len(iter.page.Values()) { 925 return nil 926 } 927 err = iter.page.NextWithContext(ctx) 928 if err != nil { 929 iter.i-- 930 return err 931 } 932 iter.i = 0 933 return nil 934} 935 936// Next advances to the next value. If there was an error making 937// the request the iterator does not advance and the error is returned. 938// Deprecated: Use NextWithContext() instead. 939func (iter *HyperVMachineCollectionIterator) Next() error { 940 return iter.NextWithContext(context.Background()) 941} 942 943// NotDone returns true if the enumeration should be started or is not yet complete. 944func (iter HyperVMachineCollectionIterator) NotDone() bool { 945 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 946} 947 948// Response returns the raw server response from the last page request. 949func (iter HyperVMachineCollectionIterator) Response() HyperVMachineCollection { 950 return iter.page.Response() 951} 952 953// Value returns the current value or a zero-initialized value if the 954// iterator has advanced beyond the end of the collection. 955func (iter HyperVMachineCollectionIterator) Value() HyperVMachine { 956 if !iter.page.NotDone() { 957 return HyperVMachine{} 958 } 959 return iter.page.Values()[iter.i] 960} 961 962// Creates a new instance of the HyperVMachineCollectionIterator type. 963func NewHyperVMachineCollectionIterator(page HyperVMachineCollectionPage) HyperVMachineCollectionIterator { 964 return HyperVMachineCollectionIterator{page: page} 965} 966 967// IsEmpty returns true if the ListResult contains no values. 968func (hvmc HyperVMachineCollection) IsEmpty() bool { 969 return hvmc.Value == nil || len(*hvmc.Value) == 0 970} 971 972// hasNextLink returns true if the NextLink is not empty. 973func (hvmc HyperVMachineCollection) hasNextLink() bool { 974 return hvmc.NextLink != nil && len(*hvmc.NextLink) != 0 975} 976 977// hyperVMachineCollectionPreparer prepares a request to retrieve the next set of results. 978// It returns nil if no more results exist. 979func (hvmc HyperVMachineCollection) hyperVMachineCollectionPreparer(ctx context.Context) (*http.Request, error) { 980 if !hvmc.hasNextLink() { 981 return nil, nil 982 } 983 return autorest.Prepare((&http.Request{}).WithContext(ctx), 984 autorest.AsJSON(), 985 autorest.AsGet(), 986 autorest.WithBaseURL(to.String(hvmc.NextLink))) 987} 988 989// HyperVMachineCollectionPage contains a page of HyperVMachine values. 990type HyperVMachineCollectionPage struct { 991 fn func(context.Context, HyperVMachineCollection) (HyperVMachineCollection, error) 992 hvmc HyperVMachineCollection 993} 994 995// NextWithContext advances to the next page of values. If there was an error making 996// the request the page does not advance and the error is returned. 997func (page *HyperVMachineCollectionPage) NextWithContext(ctx context.Context) (err error) { 998 if tracing.IsEnabled() { 999 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVMachineCollectionPage.NextWithContext") 1000 defer func() { 1001 sc := -1 1002 if page.Response().Response.Response != nil { 1003 sc = page.Response().Response.Response.StatusCode 1004 } 1005 tracing.EndSpan(ctx, sc, err) 1006 }() 1007 } 1008 for { 1009 next, err := page.fn(ctx, page.hvmc) 1010 if err != nil { 1011 return err 1012 } 1013 page.hvmc = next 1014 if !next.hasNextLink() || !next.IsEmpty() { 1015 break 1016 } 1017 } 1018 return nil 1019} 1020 1021// Next advances to the next page of values. If there was an error making 1022// the request the page does not advance and the error is returned. 1023// Deprecated: Use NextWithContext() instead. 1024func (page *HyperVMachineCollectionPage) Next() error { 1025 return page.NextWithContext(context.Background()) 1026} 1027 1028// NotDone returns true if the page enumeration should be started or is not yet complete. 1029func (page HyperVMachineCollectionPage) NotDone() bool { 1030 return !page.hvmc.IsEmpty() 1031} 1032 1033// Response returns the raw server response from the last page request. 1034func (page HyperVMachineCollectionPage) Response() HyperVMachineCollection { 1035 return page.hvmc 1036} 1037 1038// Values returns the slice of values for the current page or nil if there are no values. 1039func (page HyperVMachineCollectionPage) Values() []HyperVMachine { 1040 if page.hvmc.IsEmpty() { 1041 return nil 1042 } 1043 return *page.hvmc.Value 1044} 1045 1046// Creates a new instance of the HyperVMachineCollectionPage type. 1047func NewHyperVMachineCollectionPage(cur HyperVMachineCollection, getNextPage func(context.Context, HyperVMachineCollection) (HyperVMachineCollection, error)) HyperVMachineCollectionPage { 1048 return HyperVMachineCollectionPage{ 1049 fn: getNextPage, 1050 hvmc: cur, 1051 } 1052} 1053 1054// HyperVMachineProperties class for machine properties. 1055type HyperVMachineProperties struct { 1056 // HostFqdn - READ-ONLY; Host FQDN/IPAddress. 1057 HostFqdn *string `json:"hostFqdn,omitempty"` 1058 // HostID - READ-ONLY; Host ARM ID. 1059 HostID *string `json:"hostId,omitempty"` 1060 // ClusterFqdn - READ-ONLY; Cluster FQDN/IPAddress. 1061 ClusterFqdn *string `json:"clusterFqdn,omitempty"` 1062 // ClusterID - READ-ONLY; Cluster ARM ID. 1063 ClusterID *string `json:"clusterId,omitempty"` 1064 // ManagementServerType - READ-ONLY; Management server type of the machine. It is either Host or Cluster. 1065 ManagementServerType *string `json:"managementServerType,omitempty"` 1066 // Generation - READ-ONLY; Generation of the virtual machine. 1067 Generation *int32 `json:"generation,omitempty"` 1068 // Version - READ-ONLY; VM version. 1069 Version *string `json:"version,omitempty"` 1070 // HighAvailability - READ-ONLY; Value indicating whether the VM is highly available. Possible values include: 'HighlyAvailableUnknown', 'HighlyAvailableNo', 'HighlyAvailableYes' 1071 HighAvailability HighlyAvailable `json:"highAvailability,omitempty"` 1072 // MaxMemoryMB - READ-ONLY; Max memory of the virtual machine in MB. 1073 MaxMemoryMB *int32 `json:"maxMemoryMB,omitempty"` 1074 // Firmware - READ-ONLY; Firmware of the machine. 1075 Firmware *string `json:"firmware,omitempty"` 1076 // IsDynamicMemoryEnabled - READ-ONLY; Value indicating whether dynamic memory is enabled for the VM. 1077 IsDynamicMemoryEnabled *bool `json:"isDynamicMemoryEnabled,omitempty"` 1078 // Disks - READ-ONLY; Disks attached to the machine. 1079 Disks *[]HyperVDisk `json:"disks,omitempty"` 1080 // AppsAndRoles - READ-ONLY; Apps and Roles of the VM. 1081 AppsAndRoles *AppsAndRoles `json:"appsAndRoles,omitempty"` 1082 // NetworkAdapters - READ-ONLY; Network adapters attached to the machine. 1083 NetworkAdapters *[]HyperVNetworkAdapter `json:"networkAdapters,omitempty"` 1084 // DisplayName - READ-ONLY; Display name of the machine. 1085 DisplayName *string `json:"displayName,omitempty"` 1086 // NumberOfProcessorCore - READ-ONLY; Number of Processor Cores allocated for the machine. 1087 NumberOfProcessorCore *int32 `json:"numberOfProcessorCore,omitempty"` 1088 // AllocatedMemoryInMB - READ-ONLY; Allocated Memory in MB. 1089 AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` 1090 // VMConfigurationFileLocation - READ-ONLY; Root location of the VM configuration file. 1091 VMConfigurationFileLocation *string `json:"vmConfigurationFileLocation,omitempty"` 1092 // OperatingSystemDetails - READ-ONLY; Operating System Details installed on the machine. 1093 OperatingSystemDetails *OperatingSystem `json:"operatingSystemDetails,omitempty"` 1094 // GuestOSDetails - READ-ONLY; Operating System Details extracted from the guest by executing script inside the guest VM. 1095 GuestOSDetails *GuestOSDetails `json:"guestOSDetails,omitempty"` 1096 // NumberOfApplications - READ-ONLY; Number of applications installed in the guest VM. 1097 NumberOfApplications *int32 `json:"numberOfApplications,omitempty"` 1098 // GuestDetailsDiscoveryTimestamp - READ-ONLY; The last time at which the Guest Details of machine was discovered. 1099 GuestDetailsDiscoveryTimestamp *date.Time `json:"guestDetailsDiscoveryTimestamp,omitempty"` 1100 // IsGuestDetailsDiscoveryInProgress - READ-ONLY; Whether Refresh Fabric Layout Guest Details has been completed once. Portal will show discovery in progress, if this value is true. 1101 IsGuestDetailsDiscoveryInProgress *bool `json:"isGuestDetailsDiscoveryInProgress,omitempty"` 1102 // CreatedTimestamp - READ-ONLY; Timestamp marking machine creation. 1103 CreatedTimestamp *string `json:"createdTimestamp,omitempty"` 1104 // UpdatedTimestamp - READ-ONLY; Timestamp marking last updated on the machine. 1105 UpdatedTimestamp *string `json:"updatedTimestamp,omitempty"` 1106 // InstanceUUID - READ-ONLY; On-premise Instance UUID of the machine. 1107 InstanceUUID *string `json:"instanceUuid,omitempty"` 1108 // PowerStatus - READ-ONLY; Machine power status. 1109 PowerStatus *string `json:"powerStatus,omitempty"` 1110 // BiosSerialNumber - READ-ONLY; Machine BIOS serial number. 1111 BiosSerialNumber *string `json:"biosSerialNumber,omitempty"` 1112 // BiosGUID - READ-ONLY; Machine BIOS GUID. 1113 BiosGUID *string `json:"biosGuid,omitempty"` 1114 // VMFqdn - READ-ONLY; Machine FQDN. 1115 VMFqdn *string `json:"vmFqdn,omitempty"` 1116 // IsDeleted - READ-ONLY; Value indicating whether VM is deleted. 1117 IsDeleted *bool `json:"isDeleted,omitempty"` 1118 // Errors - READ-ONLY; Errors for machine. 1119 Errors *[]HealthErrorDetails `json:"errors,omitempty"` 1120} 1121 1122// MarshalJSON is the custom marshaler for HyperVMachineProperties. 1123func (hvmp HyperVMachineProperties) MarshalJSON() ([]byte, error) { 1124 objectMap := make(map[string]interface{}) 1125 return json.Marshal(objectMap) 1126} 1127 1128// HyperVNetworkAdapter second level object represented in responses as part of Machine REST resource. 1129type HyperVNetworkAdapter struct { 1130 // NetworkID - READ-ONLY; Network Id. 1131 NetworkID *string `json:"networkId,omitempty"` 1132 // SubnetName - READ-ONLY; Name of the VM subnet within the virtual network the NIC is attached to. 1133 SubnetName *string `json:"subnetName,omitempty"` 1134 // StaticIPAddress - READ-ONLY; Static IP address. 1135 StaticIPAddress *string `json:"staticIpAddress,omitempty"` 1136 // NicType - READ-ONLY; Mac address of the NIC. 1137 NicType *string `json:"nicType,omitempty"` 1138 // NicID - READ-ONLY; NIC Id. 1139 NicID *string `json:"nicId,omitempty"` 1140 // MacAddress - READ-ONLY; Mac address of the NIC. 1141 MacAddress *string `json:"macAddress,omitempty"` 1142 // IPAddressList - READ-ONLY; IP addresses for the machine. 1143 IPAddressList *[]string `json:"ipAddressList,omitempty"` 1144 // NetworkName - READ-ONLY; Network Name. 1145 NetworkName *string `json:"networkName,omitempty"` 1146 // IPAddressType - READ-ONLY; Type of the IP address. 1147 IPAddressType *string `json:"ipAddressType,omitempty"` 1148} 1149 1150// MarshalJSON is the custom marshaler for HyperVNetworkAdapter. 1151func (hvna HyperVNetworkAdapter) MarshalJSON() ([]byte, error) { 1152 objectMap := make(map[string]interface{}) 1153 return json.Marshal(objectMap) 1154} 1155 1156// HyperVRunAsAccount run as account REST Resource. 1157type HyperVRunAsAccount struct { 1158 autorest.Response `json:"-"` 1159 // ID - READ-ONLY; Resource Id. 1160 ID *string `json:"id,omitempty"` 1161 // Name - READ-ONLY; Name of the Sites. 1162 Name *string `json:"name,omitempty"` 1163 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/HyperVSites/RunAsAccounts. 1164 Type *string `json:"type,omitempty"` 1165 // Properties - READ-ONLY; Nested properties of run as account. 1166 Properties *RunAsAccountProperties `json:"properties,omitempty"` 1167} 1168 1169// MarshalJSON is the custom marshaler for HyperVRunAsAccount. 1170func (hvraa HyperVRunAsAccount) MarshalJSON() ([]byte, error) { 1171 objectMap := make(map[string]interface{}) 1172 return json.Marshal(objectMap) 1173} 1174 1175// HyperVRunAsAccountCollection collection of Hyper-V run as accounts. 1176type HyperVRunAsAccountCollection struct { 1177 autorest.Response `json:"-"` 1178 // Value - READ-ONLY; List of run as accounts. 1179 Value *[]HyperVRunAsAccount `json:"value,omitempty"` 1180 // NextLink - READ-ONLY; Value of next link. 1181 NextLink *string `json:"nextLink,omitempty"` 1182} 1183 1184// MarshalJSON is the custom marshaler for HyperVRunAsAccountCollection. 1185func (hvraac HyperVRunAsAccountCollection) MarshalJSON() ([]byte, error) { 1186 objectMap := make(map[string]interface{}) 1187 return json.Marshal(objectMap) 1188} 1189 1190// HyperVRunAsAccountCollectionIterator provides access to a complete listing of HyperVRunAsAccount values. 1191type HyperVRunAsAccountCollectionIterator struct { 1192 i int 1193 page HyperVRunAsAccountCollectionPage 1194} 1195 1196// NextWithContext advances to the next value. If there was an error making 1197// the request the iterator does not advance and the error is returned. 1198func (iter *HyperVRunAsAccountCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1199 if tracing.IsEnabled() { 1200 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVRunAsAccountCollectionIterator.NextWithContext") 1201 defer func() { 1202 sc := -1 1203 if iter.Response().Response.Response != nil { 1204 sc = iter.Response().Response.Response.StatusCode 1205 } 1206 tracing.EndSpan(ctx, sc, err) 1207 }() 1208 } 1209 iter.i++ 1210 if iter.i < len(iter.page.Values()) { 1211 return nil 1212 } 1213 err = iter.page.NextWithContext(ctx) 1214 if err != nil { 1215 iter.i-- 1216 return err 1217 } 1218 iter.i = 0 1219 return nil 1220} 1221 1222// Next advances to the next value. If there was an error making 1223// the request the iterator does not advance and the error is returned. 1224// Deprecated: Use NextWithContext() instead. 1225func (iter *HyperVRunAsAccountCollectionIterator) Next() error { 1226 return iter.NextWithContext(context.Background()) 1227} 1228 1229// NotDone returns true if the enumeration should be started or is not yet complete. 1230func (iter HyperVRunAsAccountCollectionIterator) NotDone() bool { 1231 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1232} 1233 1234// Response returns the raw server response from the last page request. 1235func (iter HyperVRunAsAccountCollectionIterator) Response() HyperVRunAsAccountCollection { 1236 return iter.page.Response() 1237} 1238 1239// Value returns the current value or a zero-initialized value if the 1240// iterator has advanced beyond the end of the collection. 1241func (iter HyperVRunAsAccountCollectionIterator) Value() HyperVRunAsAccount { 1242 if !iter.page.NotDone() { 1243 return HyperVRunAsAccount{} 1244 } 1245 return iter.page.Values()[iter.i] 1246} 1247 1248// Creates a new instance of the HyperVRunAsAccountCollectionIterator type. 1249func NewHyperVRunAsAccountCollectionIterator(page HyperVRunAsAccountCollectionPage) HyperVRunAsAccountCollectionIterator { 1250 return HyperVRunAsAccountCollectionIterator{page: page} 1251} 1252 1253// IsEmpty returns true if the ListResult contains no values. 1254func (hvraac HyperVRunAsAccountCollection) IsEmpty() bool { 1255 return hvraac.Value == nil || len(*hvraac.Value) == 0 1256} 1257 1258// hasNextLink returns true if the NextLink is not empty. 1259func (hvraac HyperVRunAsAccountCollection) hasNextLink() bool { 1260 return hvraac.NextLink != nil && len(*hvraac.NextLink) != 0 1261} 1262 1263// hyperVRunAsAccountCollectionPreparer prepares a request to retrieve the next set of results. 1264// It returns nil if no more results exist. 1265func (hvraac HyperVRunAsAccountCollection) hyperVRunAsAccountCollectionPreparer(ctx context.Context) (*http.Request, error) { 1266 if !hvraac.hasNextLink() { 1267 return nil, nil 1268 } 1269 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1270 autorest.AsJSON(), 1271 autorest.AsGet(), 1272 autorest.WithBaseURL(to.String(hvraac.NextLink))) 1273} 1274 1275// HyperVRunAsAccountCollectionPage contains a page of HyperVRunAsAccount values. 1276type HyperVRunAsAccountCollectionPage struct { 1277 fn func(context.Context, HyperVRunAsAccountCollection) (HyperVRunAsAccountCollection, error) 1278 hvraac HyperVRunAsAccountCollection 1279} 1280 1281// NextWithContext advances to the next page of values. If there was an error making 1282// the request the page does not advance and the error is returned. 1283func (page *HyperVRunAsAccountCollectionPage) NextWithContext(ctx context.Context) (err error) { 1284 if tracing.IsEnabled() { 1285 ctx = tracing.StartSpan(ctx, fqdn+"/HyperVRunAsAccountCollectionPage.NextWithContext") 1286 defer func() { 1287 sc := -1 1288 if page.Response().Response.Response != nil { 1289 sc = page.Response().Response.Response.StatusCode 1290 } 1291 tracing.EndSpan(ctx, sc, err) 1292 }() 1293 } 1294 for { 1295 next, err := page.fn(ctx, page.hvraac) 1296 if err != nil { 1297 return err 1298 } 1299 page.hvraac = next 1300 if !next.hasNextLink() || !next.IsEmpty() { 1301 break 1302 } 1303 } 1304 return nil 1305} 1306 1307// Next advances to the next page of values. If there was an error making 1308// the request the page does not advance and the error is returned. 1309// Deprecated: Use NextWithContext() instead. 1310func (page *HyperVRunAsAccountCollectionPage) Next() error { 1311 return page.NextWithContext(context.Background()) 1312} 1313 1314// NotDone returns true if the page enumeration should be started or is not yet complete. 1315func (page HyperVRunAsAccountCollectionPage) NotDone() bool { 1316 return !page.hvraac.IsEmpty() 1317} 1318 1319// Response returns the raw server response from the last page request. 1320func (page HyperVRunAsAccountCollectionPage) Response() HyperVRunAsAccountCollection { 1321 return page.hvraac 1322} 1323 1324// Values returns the slice of values for the current page or nil if there are no values. 1325func (page HyperVRunAsAccountCollectionPage) Values() []HyperVRunAsAccount { 1326 if page.hvraac.IsEmpty() { 1327 return nil 1328 } 1329 return *page.hvraac.Value 1330} 1331 1332// Creates a new instance of the HyperVRunAsAccountCollectionPage type. 1333func NewHyperVRunAsAccountCollectionPage(cur HyperVRunAsAccountCollection, getNextPage func(context.Context, HyperVRunAsAccountCollection) (HyperVRunAsAccountCollection, error)) HyperVRunAsAccountCollectionPage { 1334 return HyperVRunAsAccountCollectionPage{ 1335 fn: getNextPage, 1336 hvraac: cur, 1337 } 1338} 1339 1340// HyperVSite site REST Resource. 1341type HyperVSite struct { 1342 autorest.Response `json:"-"` 1343 // ID - READ-ONLY; Resource Id. 1344 ID *string `json:"id,omitempty"` 1345 // Name - Name of the Hyper-V site. 1346 Name *string `json:"name,omitempty"` 1347 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/HyperVSites. 1348 Type *string `json:"type,omitempty"` 1349 Tags map[string]*string `json:"tags"` 1350 // ETag - eTag for concurrency control. 1351 ETag *string `json:"eTag,omitempty"` 1352 // Location - Azure location in which Sites is created. 1353 Location *string `json:"location,omitempty"` 1354 // Properties - Nested properties of Hyper-V site. 1355 Properties *SiteProperties `json:"properties,omitempty"` 1356} 1357 1358// MarshalJSON is the custom marshaler for HyperVSite. 1359func (hvs HyperVSite) MarshalJSON() ([]byte, error) { 1360 objectMap := make(map[string]interface{}) 1361 if hvs.Name != nil { 1362 objectMap["name"] = hvs.Name 1363 } 1364 if hvs.Tags != nil { 1365 objectMap["tags"] = hvs.Tags 1366 } 1367 if hvs.ETag != nil { 1368 objectMap["eTag"] = hvs.ETag 1369 } 1370 if hvs.Location != nil { 1371 objectMap["location"] = hvs.Location 1372 } 1373 if hvs.Properties != nil { 1374 objectMap["properties"] = hvs.Properties 1375 } 1376 return json.Marshal(objectMap) 1377} 1378 1379// HyperVSiteUsage hyper-V site usage. 1380type HyperVSiteUsage struct { 1381 autorest.Response `json:"-"` 1382 // MachineCount - Number of machines discovered in the site. 1383 MachineCount *int32 `json:"machineCount,omitempty"` 1384 // RunAsAccountCount - Number of run as accounts in the site. 1385 RunAsAccountCount *int32 `json:"runAsAccountCount,omitempty"` 1386 // HostCount - Number of hosts part of the site. 1387 HostCount *int32 `json:"hostCount,omitempty"` 1388 // ClusterCount - Number of clusters part of the site. 1389 ClusterCount *int32 `json:"clusterCount,omitempty"` 1390} 1391 1392// Ipv4NetworkInterface ... 1393type Ipv4NetworkInterface struct { 1394 IPAddress *string `json:"ipAddress,omitempty"` 1395 SubnetMask *string `json:"subnetMask,omitempty"` 1396} 1397 1398// Ipv6NetworkInterface ... 1399type Ipv6NetworkInterface struct { 1400 IPAddress *string `json:"ipAddress,omitempty"` 1401} 1402 1403// JobProperties class for machine properties. 1404type JobProperties struct { 1405 // Status - READ-ONLY; Operation status. 1406 Status *string `json:"status,omitempty"` 1407 // StartTime - READ-ONLY; Operation start time. 1408 StartTime *string `json:"startTime,omitempty"` 1409 // EndTime - READ-ONLY; Operation end time. 1410 EndTime *string `json:"endTime,omitempty"` 1411 // DisplayName - READ-ONLY; Display name of the Job. 1412 DisplayName *string `json:"displayName,omitempty"` 1413 // ClientRequestID - READ-ONLY; Client request Id used in the operation execution context. 1414 ClientRequestID *string `json:"clientRequestId,omitempty"` 1415 // ActivityID - READ-ONLY; Activity Id used in the operation execution context. 1416 ActivityID *string `json:"activityId,omitempty"` 1417 // Errors - READ-ONLY; Errors. 1418 Errors *[]ErrorDetails `json:"errors,omitempty"` 1419} 1420 1421// MarshalJSON is the custom marshaler for JobProperties. 1422func (jp JobProperties) MarshalJSON() ([]byte, error) { 1423 objectMap := make(map[string]interface{}) 1424 return json.Marshal(objectMap) 1425} 1426 1427// Machine ... 1428type Machine struct { 1429 PropertiesTimestamp *date.Time `json:"properties.timestamp,omitempty"` 1430 // PropertiesMonitoringState - Possible values include: 'Monitored', 'Discovered' 1431 PropertiesMonitoringState PropertiesMonitoringState `json:"properties.monitoringState,omitempty"` 1432 // PropertiesVirtualizationState - Possible values include: 'PropertiesVirtualizationStateUnknown', 'PropertiesVirtualizationStatePhysical', 'PropertiesVirtualizationStateVirtual', 'PropertiesVirtualizationStateHypervisor' 1433 PropertiesVirtualizationState PropertiesVirtualizationState `json:"properties.virtualizationState,omitempty"` 1434 PropertiesDisplayName *string `json:"properties.displayName,omitempty"` 1435 PropertiesComputerName *string `json:"properties.computerName,omitempty"` 1436 PropertiesFullyQualifiedDomainName *string `json:"properties.fullyQualifiedDomainName,omitempty"` 1437 PropertiesBootTime *date.Time `json:"properties.bootTime,omitempty"` 1438 PropertiesTimezone *Timezone `json:"properties.timezone,omitempty"` 1439 PropertiesAgent *AgentConfiguration `json:"properties.agent,omitempty"` 1440 PropertiesResources *MachineResourcesConfiguration `json:"properties.resources,omitempty"` 1441 PropertiesNetworking *NetworkConfiguration `json:"properties.networking,omitempty"` 1442 PropertiesOperatingSystem *OperatingSystemConfiguration `json:"properties.operatingSystem,omitempty"` 1443 PropertiesVirtualMachine *VirtualMachineConfiguration `json:"properties.virtualMachine,omitempty"` 1444 PropertiesHypervisor *HypervisorConfiguration `json:"properties.hypervisor,omitempty"` 1445 PropertiesHosting *HostingConfiguration `json:"properties.hosting,omitempty"` 1446 Etag *string `json:"etag,omitempty"` 1447 ID *string `json:"id,omitempty"` 1448 Type *string `json:"type,omitempty"` 1449 Name *string `json:"name,omitempty"` 1450} 1451 1452// MachineResourcesConfiguration ... 1453type MachineResourcesConfiguration struct { 1454 PhysicalMemory *int32 `json:"physicalMemory,omitempty"` 1455 Cpus *int32 `json:"cpus,omitempty"` 1456 CPUSpeed *int32 `json:"cpuSpeed,omitempty"` 1457 // CPUSpeedAccuracy - Possible values include: 'Actual', 'Estimated' 1458 CPUSpeedAccuracy CPUSpeedAccuracy `json:"cpuSpeedAccuracy,omitempty"` 1459} 1460 1461// NetworkConfiguration ... 1462type NetworkConfiguration struct { 1463 Ipv4Interfaces *[]Ipv4NetworkInterface `json:"ipv4Interfaces,omitempty"` 1464 Ipv6Interfaces *[]Ipv6NetworkInterface `json:"ipv6Interfaces,omitempty"` 1465 DefaultIpv4Gateways *[]string `json:"defaultIpv4Gateways,omitempty"` 1466 MacAddresses *[]string `json:"macAddresses,omitempty"` 1467 DNSNames *[]string `json:"dnsNames,omitempty"` 1468 DNSQuestions *[]string `json:"dnsQuestions,omitempty"` 1469 DNSCanonicalNames *[]string `json:"dnsCanonicalNames,omitempty"` 1470} 1471 1472// OperatingSystem second level object returned as part of Machine REST resource. 1473type OperatingSystem struct { 1474 // OsType - READ-ONLY; Type of the operating system. 1475 OsType *string `json:"osType,omitempty"` 1476 // OsName - READ-ONLY; Name of the operating system. 1477 OsName *string `json:"osName,omitempty"` 1478 // OsVersion - READ-ONLY; Version of the operating system. 1479 OsVersion *string `json:"osVersion,omitempty"` 1480} 1481 1482// MarshalJSON is the custom marshaler for OperatingSystem. 1483func (osVar OperatingSystem) MarshalJSON() ([]byte, error) { 1484 objectMap := make(map[string]interface{}) 1485 return json.Marshal(objectMap) 1486} 1487 1488// OperatingSystemConfiguration ... 1489type OperatingSystemConfiguration struct { 1490 // Family - Possible values include: 'Unknown', 'Windows', 'Linux', 'Solaris', 'Aix' 1491 Family Family `json:"family,omitempty"` 1492 FullName *string `json:"fullName,omitempty"` 1493 // Bitness - Possible values include: 'ThreeTwobit', 'SixFourbit' 1494 Bitness Bitness `json:"bitness,omitempty"` 1495} 1496 1497// Operation a REST API operation supported by the provider. 1498type Operation struct { 1499 // Name - READ-ONLY; Name of the operation. 1500 Name *string `json:"name,omitempty"` 1501 // Display - Displayable properties of the operation. 1502 Display *OperationDisplay `json:"display,omitempty"` 1503 // Origin - READ-ONLY; Origin of the operation. 1504 Origin *string `json:"origin,omitempty"` 1505} 1506 1507// MarshalJSON is the custom marshaler for Operation. 1508func (o Operation) MarshalJSON() ([]byte, error) { 1509 objectMap := make(map[string]interface{}) 1510 if o.Display != nil { 1511 objectMap["display"] = o.Display 1512 } 1513 return json.Marshal(objectMap) 1514} 1515 1516// OperationDisplay displayable properties of the operation. 1517type OperationDisplay struct { 1518 // Provider - READ-ONLY; Provider of the operation. 1519 Provider *string `json:"provider,omitempty"` 1520 // Resource - READ-ONLY; Resource operated on by the operation. 1521 Resource *string `json:"resource,omitempty"` 1522 // Operation - READ-ONLY; Operation Type. 1523 Operation *string `json:"operation,omitempty"` 1524 // Description - READ-ONLY; Description of the operation. 1525 Description *string `json:"description,omitempty"` 1526} 1527 1528// MarshalJSON is the custom marshaler for OperationDisplay. 1529func (od OperationDisplay) MarshalJSON() ([]byte, error) { 1530 objectMap := make(map[string]interface{}) 1531 return json.Marshal(objectMap) 1532} 1533 1534// OperationResultList list of API operations. 1535type OperationResultList struct { 1536 autorest.Response `json:"-"` 1537 // Value - READ-ONLY; List of operations. 1538 Value *[]Operation `json:"value,omitempty"` 1539 // NextLink - READ-ONLY; Value of next link. 1540 NextLink *string `json:"nextLink,omitempty"` 1541} 1542 1543// MarshalJSON is the custom marshaler for OperationResultList. 1544func (orl OperationResultList) MarshalJSON() ([]byte, error) { 1545 objectMap := make(map[string]interface{}) 1546 return json.Marshal(objectMap) 1547} 1548 1549// OperationResultListIterator provides access to a complete listing of Operation values. 1550type OperationResultListIterator struct { 1551 i int 1552 page OperationResultListPage 1553} 1554 1555// NextWithContext advances to the next value. If there was an error making 1556// the request the iterator does not advance and the error is returned. 1557func (iter *OperationResultListIterator) NextWithContext(ctx context.Context) (err error) { 1558 if tracing.IsEnabled() { 1559 ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultListIterator.NextWithContext") 1560 defer func() { 1561 sc := -1 1562 if iter.Response().Response.Response != nil { 1563 sc = iter.Response().Response.Response.StatusCode 1564 } 1565 tracing.EndSpan(ctx, sc, err) 1566 }() 1567 } 1568 iter.i++ 1569 if iter.i < len(iter.page.Values()) { 1570 return nil 1571 } 1572 err = iter.page.NextWithContext(ctx) 1573 if err != nil { 1574 iter.i-- 1575 return err 1576 } 1577 iter.i = 0 1578 return nil 1579} 1580 1581// Next advances to the next value. If there was an error making 1582// the request the iterator does not advance and the error is returned. 1583// Deprecated: Use NextWithContext() instead. 1584func (iter *OperationResultListIterator) Next() error { 1585 return iter.NextWithContext(context.Background()) 1586} 1587 1588// NotDone returns true if the enumeration should be started or is not yet complete. 1589func (iter OperationResultListIterator) NotDone() bool { 1590 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1591} 1592 1593// Response returns the raw server response from the last page request. 1594func (iter OperationResultListIterator) Response() OperationResultList { 1595 return iter.page.Response() 1596} 1597 1598// Value returns the current value or a zero-initialized value if the 1599// iterator has advanced beyond the end of the collection. 1600func (iter OperationResultListIterator) Value() Operation { 1601 if !iter.page.NotDone() { 1602 return Operation{} 1603 } 1604 return iter.page.Values()[iter.i] 1605} 1606 1607// Creates a new instance of the OperationResultListIterator type. 1608func NewOperationResultListIterator(page OperationResultListPage) OperationResultListIterator { 1609 return OperationResultListIterator{page: page} 1610} 1611 1612// IsEmpty returns true if the ListResult contains no values. 1613func (orl OperationResultList) IsEmpty() bool { 1614 return orl.Value == nil || len(*orl.Value) == 0 1615} 1616 1617// hasNextLink returns true if the NextLink is not empty. 1618func (orl OperationResultList) hasNextLink() bool { 1619 return orl.NextLink != nil && len(*orl.NextLink) != 0 1620} 1621 1622// operationResultListPreparer prepares a request to retrieve the next set of results. 1623// It returns nil if no more results exist. 1624func (orl OperationResultList) operationResultListPreparer(ctx context.Context) (*http.Request, error) { 1625 if !orl.hasNextLink() { 1626 return nil, nil 1627 } 1628 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1629 autorest.AsJSON(), 1630 autorest.AsGet(), 1631 autorest.WithBaseURL(to.String(orl.NextLink))) 1632} 1633 1634// OperationResultListPage contains a page of Operation values. 1635type OperationResultListPage struct { 1636 fn func(context.Context, OperationResultList) (OperationResultList, error) 1637 orl OperationResultList 1638} 1639 1640// NextWithContext advances to the next page of values. If there was an error making 1641// the request the page does not advance and the error is returned. 1642func (page *OperationResultListPage) NextWithContext(ctx context.Context) (err error) { 1643 if tracing.IsEnabled() { 1644 ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultListPage.NextWithContext") 1645 defer func() { 1646 sc := -1 1647 if page.Response().Response.Response != nil { 1648 sc = page.Response().Response.Response.StatusCode 1649 } 1650 tracing.EndSpan(ctx, sc, err) 1651 }() 1652 } 1653 for { 1654 next, err := page.fn(ctx, page.orl) 1655 if err != nil { 1656 return err 1657 } 1658 page.orl = next 1659 if !next.hasNextLink() || !next.IsEmpty() { 1660 break 1661 } 1662 } 1663 return nil 1664} 1665 1666// Next advances to the next page of values. If there was an error making 1667// the request the page does not advance and the error is returned. 1668// Deprecated: Use NextWithContext() instead. 1669func (page *OperationResultListPage) Next() error { 1670 return page.NextWithContext(context.Background()) 1671} 1672 1673// NotDone returns true if the page enumeration should be started or is not yet complete. 1674func (page OperationResultListPage) NotDone() bool { 1675 return !page.orl.IsEmpty() 1676} 1677 1678// Response returns the raw server response from the last page request. 1679func (page OperationResultListPage) Response() OperationResultList { 1680 return page.orl 1681} 1682 1683// Values returns the slice of values for the current page or nil if there are no values. 1684func (page OperationResultListPage) Values() []Operation { 1685 if page.orl.IsEmpty() { 1686 return nil 1687 } 1688 return *page.orl.Value 1689} 1690 1691// Creates a new instance of the OperationResultListPage type. 1692func NewOperationResultListPage(cur OperationResultList, getNextPage func(context.Context, OperationResultList) (OperationResultList, error)) OperationResultListPage { 1693 return OperationResultListPage{ 1694 fn: getNextPage, 1695 orl: cur, 1696 } 1697} 1698 1699// OperationStatus operation status REST resource. 1700type OperationStatus struct { 1701 autorest.Response `json:"-"` 1702 // ID - READ-ONLY; Resource Id. 1703 ID *string `json:"id,omitempty"` 1704 // Name - READ-ONLY; Operation name. 1705 Name *string `json:"name,omitempty"` 1706 // Status - READ-ONLY; Status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/ Canceled. All other values imply that the operation is still running. 1707 Status *string `json:"status,omitempty"` 1708 // StartTime - READ-ONLY; Start time. 1709 StartTime *string `json:"startTime,omitempty"` 1710 // EndTime - READ-ONLY; End time. 1711 EndTime *string `json:"endTime,omitempty"` 1712 // Error - READ-ONLY; Error stating all error details for the operation. 1713 Error *OperationStatusError `json:"error,omitempty"` 1714 // Properties - READ-ONLY; Custom data. 1715 Properties *OperationStatusProperties `json:"properties,omitempty"` 1716} 1717 1718// MarshalJSON is the custom marshaler for OperationStatus. 1719func (osVar OperationStatus) MarshalJSON() ([]byte, error) { 1720 objectMap := make(map[string]interface{}) 1721 return json.Marshal(objectMap) 1722} 1723 1724// OperationStatusError class for operation status errors. 1725type OperationStatusError struct { 1726 // Code - READ-ONLY; Error code. 1727 Code *string `json:"code,omitempty"` 1728 // Message - READ-ONLY; Error message. 1729 Message *string `json:"message,omitempty"` 1730} 1731 1732// MarshalJSON is the custom marshaler for OperationStatusError. 1733func (ose OperationStatusError) MarshalJSON() ([]byte, error) { 1734 objectMap := make(map[string]interface{}) 1735 return json.Marshal(objectMap) 1736} 1737 1738// OperationStatusProperties class for operation result properties. 1739type OperationStatusProperties struct { 1740 // Result - Result or output of the workflow. 1741 Result *string `json:"result,omitempty"` 1742} 1743 1744// OtherDatabase otherDatabase in the guest virtual machine. 1745type OtherDatabase struct { 1746 // DatabaseType - READ-ONLY; DatabaseType of the OtherDatabase. 1747 DatabaseType *string `json:"databaseType,omitempty"` 1748 // Instance - READ-ONLY; Instance of the OtherDatabase. 1749 Instance *string `json:"instance,omitempty"` 1750 // Version - READ-ONLY; Version of the OtherDatabase. 1751 Version *string `json:"version,omitempty"` 1752} 1753 1754// MarshalJSON is the custom marshaler for OtherDatabase. 1755func (od OtherDatabase) MarshalJSON() ([]byte, error) { 1756 objectMap := make(map[string]interface{}) 1757 return json.Marshal(objectMap) 1758} 1759 1760// RunAsAccountProperties class for run as account properties. 1761type RunAsAccountProperties struct { 1762 // DisplayName - READ-ONLY; Display name of the run as account. 1763 DisplayName *string `json:"displayName,omitempty"` 1764 // CredentialType - READ-ONLY; Credential type of the run as account. Possible values include: 'VMwareFabric', 'HyperVFabric', 'LinuxGuest', 'WindowsGuest', 'LinuxServer', 'WindowsServer' 1765 CredentialType CredentialType `json:"credentialType,omitempty"` 1766 // CreatedTimestamp - READ-ONLY; Timestamp marking run as account creation. 1767 CreatedTimestamp *string `json:"createdTimestamp,omitempty"` 1768 // UpdatedTimestamp - READ-ONLY; Timestamp marking last updated on the run as account. 1769 UpdatedTimestamp *string `json:"updatedTimestamp,omitempty"` 1770} 1771 1772// MarshalJSON is the custom marshaler for RunAsAccountProperties. 1773func (raap RunAsAccountProperties) MarshalJSON() ([]byte, error) { 1774 objectMap := make(map[string]interface{}) 1775 return json.Marshal(objectMap) 1776} 1777 1778// SharePointServer sharePointServer in the guest virtual machine. 1779type SharePointServer struct { 1780 // ProductName - READ-ONLY; ProductName of the SharePointServer. 1781 ProductName *string `json:"productName,omitempty"` 1782 // IsEnterprise - READ-ONLY; Value indicating whether the SharePointServer is Enterprise. 1783 IsEnterprise *bool `json:"isEnterprise,omitempty"` 1784 // Status - READ-ONLY; Status of the SharePointServer. 1785 Status *string `json:"status,omitempty"` 1786 // Version - READ-ONLY; Version of the SharePointServer. 1787 Version *string `json:"version,omitempty"` 1788} 1789 1790// MarshalJSON is the custom marshaler for SharePointServer. 1791func (sps SharePointServer) MarshalJSON() ([]byte, error) { 1792 objectMap := make(map[string]interface{}) 1793 return json.Marshal(objectMap) 1794} 1795 1796// SiteAgentProperties class for site agent properties. 1797type SiteAgentProperties struct { 1798 // ID - READ-ONLY; ID of the agent. 1799 ID *string `json:"id,omitempty"` 1800 // Version - READ-ONLY; Version of the agent. 1801 Version *string `json:"version,omitempty"` 1802 // LastHeartBeatUtc - READ-ONLY; Last heartbeat time of the agent in UTC. 1803 LastHeartBeatUtc *date.Time `json:"lastHeartBeatUtc,omitempty"` 1804 // KeyVaultURI - Key vault URI. 1805 KeyVaultURI *string `json:"keyVaultUri,omitempty"` 1806 // KeyVaultID - Key vault ARM Id. 1807 KeyVaultID *string `json:"keyVaultId,omitempty"` 1808} 1809 1810// MarshalJSON is the custom marshaler for SiteAgentProperties. 1811func (sap SiteAgentProperties) MarshalJSON() ([]byte, error) { 1812 objectMap := make(map[string]interface{}) 1813 if sap.KeyVaultURI != nil { 1814 objectMap["keyVaultUri"] = sap.KeyVaultURI 1815 } 1816 if sap.KeyVaultID != nil { 1817 objectMap["keyVaultId"] = sap.KeyVaultID 1818 } 1819 return json.Marshal(objectMap) 1820} 1821 1822// SiteHealthSummary site health summary model. 1823type SiteHealthSummary struct { 1824 // ApplianceName - READ-ONLY; Appliance name. 1825 ApplianceName *string `json:"applianceName,omitempty"` 1826 // ErrorMessage - READ-ONLY; Error message. 1827 ErrorMessage *string `json:"errorMessage,omitempty"` 1828 // SummaryMessage - READ-ONLY; Summary message. 1829 SummaryMessage *string `json:"summaryMessage,omitempty"` 1830 // ErrorID - READ-ONLY; Error Id. 1831 ErrorID *int64 `json:"errorId,omitempty"` 1832 // ErrorCode - READ-ONLY; Error code. 1833 ErrorCode *string `json:"errorCode,omitempty"` 1834 // AffectedObjectsCount - Count of affected objects. 1835 AffectedObjectsCount *int64 `json:"affectedObjectsCount,omitempty"` 1836 // HitCount - Hit count of the error. 1837 HitCount *int64 `json:"hitCount,omitempty"` 1838 // Severity - READ-ONLY; Severity of error. 1839 Severity *string `json:"severity,omitempty"` 1840 // RemediationGuidance - READ-ONLY; Remediation guidance. 1841 RemediationGuidance *string `json:"remediationGuidance,omitempty"` 1842 // AffectedResourceType - READ-ONLY; Affected resource type. 1843 AffectedResourceType *string `json:"affectedResourceType,omitempty"` 1844 // AffectedResources - Affected resources. 1845 AffectedResources *[]string `json:"affectedResources,omitempty"` 1846} 1847 1848// MarshalJSON is the custom marshaler for SiteHealthSummary. 1849func (shs SiteHealthSummary) MarshalJSON() ([]byte, error) { 1850 objectMap := make(map[string]interface{}) 1851 if shs.AffectedObjectsCount != nil { 1852 objectMap["affectedObjectsCount"] = shs.AffectedObjectsCount 1853 } 1854 if shs.HitCount != nil { 1855 objectMap["hitCount"] = shs.HitCount 1856 } 1857 if shs.AffectedResources != nil { 1858 objectMap["affectedResources"] = shs.AffectedResources 1859 } 1860 return json.Marshal(objectMap) 1861} 1862 1863// SiteHealthSummaryCollection collection of SiteHealthSummary. 1864type SiteHealthSummaryCollection struct { 1865 autorest.Response `json:"-"` 1866 // Value - READ-ONLY; List of SiteHealthSummary. 1867 Value *[]SiteHealthSummary `json:"value,omitempty"` 1868 // NextLink - READ-ONLY; Value of next link. 1869 NextLink *string `json:"nextLink,omitempty"` 1870} 1871 1872// MarshalJSON is the custom marshaler for SiteHealthSummaryCollection. 1873func (shsc SiteHealthSummaryCollection) MarshalJSON() ([]byte, error) { 1874 objectMap := make(map[string]interface{}) 1875 return json.Marshal(objectMap) 1876} 1877 1878// SiteHealthSummaryCollectionIterator provides access to a complete listing of SiteHealthSummary values. 1879type SiteHealthSummaryCollectionIterator struct { 1880 i int 1881 page SiteHealthSummaryCollectionPage 1882} 1883 1884// NextWithContext advances to the next value. If there was an error making 1885// the request the iterator does not advance and the error is returned. 1886func (iter *SiteHealthSummaryCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1887 if tracing.IsEnabled() { 1888 ctx = tracing.StartSpan(ctx, fqdn+"/SiteHealthSummaryCollectionIterator.NextWithContext") 1889 defer func() { 1890 sc := -1 1891 if iter.Response().Response.Response != nil { 1892 sc = iter.Response().Response.Response.StatusCode 1893 } 1894 tracing.EndSpan(ctx, sc, err) 1895 }() 1896 } 1897 iter.i++ 1898 if iter.i < len(iter.page.Values()) { 1899 return nil 1900 } 1901 err = iter.page.NextWithContext(ctx) 1902 if err != nil { 1903 iter.i-- 1904 return err 1905 } 1906 iter.i = 0 1907 return nil 1908} 1909 1910// Next advances to the next value. If there was an error making 1911// the request the iterator does not advance and the error is returned. 1912// Deprecated: Use NextWithContext() instead. 1913func (iter *SiteHealthSummaryCollectionIterator) Next() error { 1914 return iter.NextWithContext(context.Background()) 1915} 1916 1917// NotDone returns true if the enumeration should be started or is not yet complete. 1918func (iter SiteHealthSummaryCollectionIterator) NotDone() bool { 1919 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1920} 1921 1922// Response returns the raw server response from the last page request. 1923func (iter SiteHealthSummaryCollectionIterator) Response() SiteHealthSummaryCollection { 1924 return iter.page.Response() 1925} 1926 1927// Value returns the current value or a zero-initialized value if the 1928// iterator has advanced beyond the end of the collection. 1929func (iter SiteHealthSummaryCollectionIterator) Value() SiteHealthSummary { 1930 if !iter.page.NotDone() { 1931 return SiteHealthSummary{} 1932 } 1933 return iter.page.Values()[iter.i] 1934} 1935 1936// Creates a new instance of the SiteHealthSummaryCollectionIterator type. 1937func NewSiteHealthSummaryCollectionIterator(page SiteHealthSummaryCollectionPage) SiteHealthSummaryCollectionIterator { 1938 return SiteHealthSummaryCollectionIterator{page: page} 1939} 1940 1941// IsEmpty returns true if the ListResult contains no values. 1942func (shsc SiteHealthSummaryCollection) IsEmpty() bool { 1943 return shsc.Value == nil || len(*shsc.Value) == 0 1944} 1945 1946// hasNextLink returns true if the NextLink is not empty. 1947func (shsc SiteHealthSummaryCollection) hasNextLink() bool { 1948 return shsc.NextLink != nil && len(*shsc.NextLink) != 0 1949} 1950 1951// siteHealthSummaryCollectionPreparer prepares a request to retrieve the next set of results. 1952// It returns nil if no more results exist. 1953func (shsc SiteHealthSummaryCollection) siteHealthSummaryCollectionPreparer(ctx context.Context) (*http.Request, error) { 1954 if !shsc.hasNextLink() { 1955 return nil, nil 1956 } 1957 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1958 autorest.AsJSON(), 1959 autorest.AsGet(), 1960 autorest.WithBaseURL(to.String(shsc.NextLink))) 1961} 1962 1963// SiteHealthSummaryCollectionPage contains a page of SiteHealthSummary values. 1964type SiteHealthSummaryCollectionPage struct { 1965 fn func(context.Context, SiteHealthSummaryCollection) (SiteHealthSummaryCollection, error) 1966 shsc SiteHealthSummaryCollection 1967} 1968 1969// NextWithContext advances to the next page of values. If there was an error making 1970// the request the page does not advance and the error is returned. 1971func (page *SiteHealthSummaryCollectionPage) NextWithContext(ctx context.Context) (err error) { 1972 if tracing.IsEnabled() { 1973 ctx = tracing.StartSpan(ctx, fqdn+"/SiteHealthSummaryCollectionPage.NextWithContext") 1974 defer func() { 1975 sc := -1 1976 if page.Response().Response.Response != nil { 1977 sc = page.Response().Response.Response.StatusCode 1978 } 1979 tracing.EndSpan(ctx, sc, err) 1980 }() 1981 } 1982 for { 1983 next, err := page.fn(ctx, page.shsc) 1984 if err != nil { 1985 return err 1986 } 1987 page.shsc = next 1988 if !next.hasNextLink() || !next.IsEmpty() { 1989 break 1990 } 1991 } 1992 return nil 1993} 1994 1995// Next advances to the next page of values. If there was an error making 1996// the request the page does not advance and the error is returned. 1997// Deprecated: Use NextWithContext() instead. 1998func (page *SiteHealthSummaryCollectionPage) Next() error { 1999 return page.NextWithContext(context.Background()) 2000} 2001 2002// NotDone returns true if the page enumeration should be started or is not yet complete. 2003func (page SiteHealthSummaryCollectionPage) NotDone() bool { 2004 return !page.shsc.IsEmpty() 2005} 2006 2007// Response returns the raw server response from the last page request. 2008func (page SiteHealthSummaryCollectionPage) Response() SiteHealthSummaryCollection { 2009 return page.shsc 2010} 2011 2012// Values returns the slice of values for the current page or nil if there are no values. 2013func (page SiteHealthSummaryCollectionPage) Values() []SiteHealthSummary { 2014 if page.shsc.IsEmpty() { 2015 return nil 2016 } 2017 return *page.shsc.Value 2018} 2019 2020// Creates a new instance of the SiteHealthSummaryCollectionPage type. 2021func NewSiteHealthSummaryCollectionPage(cur SiteHealthSummaryCollection, getNextPage func(context.Context, SiteHealthSummaryCollection) (SiteHealthSummaryCollection, error)) SiteHealthSummaryCollectionPage { 2022 return SiteHealthSummaryCollectionPage{ 2023 fn: getNextPage, 2024 shsc: cur, 2025 } 2026} 2027 2028// SiteProperties class for site properties. 2029type SiteProperties struct { 2030 // ServicePrincipalIdentityDetails - Service principal identity details used by agent for communication to the service. 2031 ServicePrincipalIdentityDetails *SiteSpnProperties `json:"servicePrincipalIdentityDetails,omitempty"` 2032 // AgentDetails - On-premises agent details. 2033 AgentDetails *SiteAgentProperties `json:"agentDetails,omitempty"` 2034 // ServiceEndpoint - READ-ONLY; Service endpoint. 2035 ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` 2036 // DiscoverySolutionID - ARM ID of migration hub solution for SDS. 2037 DiscoverySolutionID *string `json:"discoverySolutionId,omitempty"` 2038 // ApplianceName - Appliance Name. 2039 ApplianceName *string `json:"applianceName,omitempty"` 2040} 2041 2042// MarshalJSON is the custom marshaler for SiteProperties. 2043func (sp SiteProperties) MarshalJSON() ([]byte, error) { 2044 objectMap := make(map[string]interface{}) 2045 if sp.ServicePrincipalIdentityDetails != nil { 2046 objectMap["servicePrincipalIdentityDetails"] = sp.ServicePrincipalIdentityDetails 2047 } 2048 if sp.AgentDetails != nil { 2049 objectMap["agentDetails"] = sp.AgentDetails 2050 } 2051 if sp.DiscoverySolutionID != nil { 2052 objectMap["discoverySolutionId"] = sp.DiscoverySolutionID 2053 } 2054 if sp.ApplianceName != nil { 2055 objectMap["applianceName"] = sp.ApplianceName 2056 } 2057 return json.Marshal(objectMap) 2058} 2059 2060// SiteSpnProperties class for site properties. 2061type SiteSpnProperties struct { 2062 // TenantID - Tenant Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. 2063 TenantID *string `json:"tenantId,omitempty"` 2064 // ApplicationID - Application/client Id for the service principal with which the on-premise management/data plane components would communicate with our Azure services. 2065 ApplicationID *string `json:"applicationId,omitempty"` 2066 // ObjectID - Object Id of the service principal with which the on-premise management/data plane components would communicate with our Azure services. 2067 ObjectID *string `json:"objectId,omitempty"` 2068 // Audience - Intended audience for the service principal. 2069 Audience *string `json:"audience,omitempty"` 2070 // AadAuthority - AAD Authority URL which was used to request the token for the service principal. 2071 AadAuthority *string `json:"aadAuthority,omitempty"` 2072 // RawCertData - Raw certificate data for building certificate expiry flows. 2073 RawCertData *string `json:"rawCertData,omitempty"` 2074} 2075 2076// SQLServer sQLServer in the guest virtual machine. 2077type SQLServer struct { 2078 // Name - READ-ONLY; Name of the SQLServer. 2079 Name *string `json:"name,omitempty"` 2080 // Edition - READ-ONLY; Edition of the SQLServer. 2081 Edition *string `json:"edition,omitempty"` 2082 // ServicePack - READ-ONLY; ServicePack of the SQLServer. 2083 ServicePack *string `json:"servicePack,omitempty"` 2084 // Version - READ-ONLY; Version of the SQLServer. 2085 Version *string `json:"version,omitempty"` 2086 // Clustered - READ-ONLY; Clustered of the SQLServer. 2087 Clustered *string `json:"clustered,omitempty"` 2088 // ClusterName - READ-ONLY; ClusterName of the SQLServer. 2089 ClusterName *string `json:"clusterName,omitempty"` 2090} 2091 2092// MarshalJSON is the custom marshaler for SQLServer. 2093func (ss SQLServer) MarshalJSON() ([]byte, error) { 2094 objectMap := make(map[string]interface{}) 2095 return json.Marshal(objectMap) 2096} 2097 2098// SystemCenter systemCenter in the guest virtual machine. 2099type SystemCenter struct { 2100 // ProductName - READ-ONLY; ProductName of the SystemCenter. 2101 ProductName *string `json:"productName,omitempty"` 2102 // Status - READ-ONLY; Status of the SystemCenter. 2103 Status *string `json:"status,omitempty"` 2104 // Version - READ-ONLY; Version of the SystemCenter. 2105 Version *string `json:"version,omitempty"` 2106} 2107 2108// MarshalJSON is the custom marshaler for SystemCenter. 2109func (sc SystemCenter) MarshalJSON() ([]byte, error) { 2110 objectMap := make(map[string]interface{}) 2111 return json.Marshal(objectMap) 2112} 2113 2114// Timezone ... 2115type Timezone struct { 2116 FullName *string `json:"fullName,omitempty"` 2117} 2118 2119// VCenter vCenter REST Resource. 2120type VCenter struct { 2121 autorest.Response `json:"-"` 2122 // ID - READ-ONLY; Resource Id. 2123 ID *string `json:"id,omitempty"` 2124 // Name - Name of the vCenter. 2125 Name *string `json:"name,omitempty"` 2126 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/VMWareSites/VCenters. 2127 Type *string `json:"type,omitempty"` 2128 // Properties - vCenter nested properties. 2129 Properties *VCenterProperties `json:"properties,omitempty"` 2130} 2131 2132// MarshalJSON is the custom marshaler for VCenter. 2133func (vc VCenter) MarshalJSON() ([]byte, error) { 2134 objectMap := make(map[string]interface{}) 2135 if vc.Name != nil { 2136 objectMap["name"] = vc.Name 2137 } 2138 if vc.Properties != nil { 2139 objectMap["properties"] = vc.Properties 2140 } 2141 return json.Marshal(objectMap) 2142} 2143 2144// VCenterCollection collection of vCenter. 2145type VCenterCollection struct { 2146 autorest.Response `json:"-"` 2147 // Value - READ-ONLY; List of vCenter. 2148 Value *[]VCenter `json:"value,omitempty"` 2149 // NextLink - READ-ONLY; Value of next link. 2150 NextLink *string `json:"nextLink,omitempty"` 2151} 2152 2153// MarshalJSON is the custom marshaler for VCenterCollection. 2154func (vcc VCenterCollection) MarshalJSON() ([]byte, error) { 2155 objectMap := make(map[string]interface{}) 2156 return json.Marshal(objectMap) 2157} 2158 2159// VCenterCollectionIterator provides access to a complete listing of VCenter values. 2160type VCenterCollectionIterator struct { 2161 i int 2162 page VCenterCollectionPage 2163} 2164 2165// NextWithContext advances to the next value. If there was an error making 2166// the request the iterator does not advance and the error is returned. 2167func (iter *VCenterCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2168 if tracing.IsEnabled() { 2169 ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionIterator.NextWithContext") 2170 defer func() { 2171 sc := -1 2172 if iter.Response().Response.Response != nil { 2173 sc = iter.Response().Response.Response.StatusCode 2174 } 2175 tracing.EndSpan(ctx, sc, err) 2176 }() 2177 } 2178 iter.i++ 2179 if iter.i < len(iter.page.Values()) { 2180 return nil 2181 } 2182 err = iter.page.NextWithContext(ctx) 2183 if err != nil { 2184 iter.i-- 2185 return err 2186 } 2187 iter.i = 0 2188 return nil 2189} 2190 2191// Next advances to the next value. If there was an error making 2192// the request the iterator does not advance and the error is returned. 2193// Deprecated: Use NextWithContext() instead. 2194func (iter *VCenterCollectionIterator) Next() error { 2195 return iter.NextWithContext(context.Background()) 2196} 2197 2198// NotDone returns true if the enumeration should be started or is not yet complete. 2199func (iter VCenterCollectionIterator) NotDone() bool { 2200 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2201} 2202 2203// Response returns the raw server response from the last page request. 2204func (iter VCenterCollectionIterator) Response() VCenterCollection { 2205 return iter.page.Response() 2206} 2207 2208// Value returns the current value or a zero-initialized value if the 2209// iterator has advanced beyond the end of the collection. 2210func (iter VCenterCollectionIterator) Value() VCenter { 2211 if !iter.page.NotDone() { 2212 return VCenter{} 2213 } 2214 return iter.page.Values()[iter.i] 2215} 2216 2217// Creates a new instance of the VCenterCollectionIterator type. 2218func NewVCenterCollectionIterator(page VCenterCollectionPage) VCenterCollectionIterator { 2219 return VCenterCollectionIterator{page: page} 2220} 2221 2222// IsEmpty returns true if the ListResult contains no values. 2223func (vcc VCenterCollection) IsEmpty() bool { 2224 return vcc.Value == nil || len(*vcc.Value) == 0 2225} 2226 2227// hasNextLink returns true if the NextLink is not empty. 2228func (vcc VCenterCollection) hasNextLink() bool { 2229 return vcc.NextLink != nil && len(*vcc.NextLink) != 0 2230} 2231 2232// vCenterCollectionPreparer prepares a request to retrieve the next set of results. 2233// It returns nil if no more results exist. 2234func (vcc VCenterCollection) vCenterCollectionPreparer(ctx context.Context) (*http.Request, error) { 2235 if !vcc.hasNextLink() { 2236 return nil, nil 2237 } 2238 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2239 autorest.AsJSON(), 2240 autorest.AsGet(), 2241 autorest.WithBaseURL(to.String(vcc.NextLink))) 2242} 2243 2244// VCenterCollectionPage contains a page of VCenter values. 2245type VCenterCollectionPage struct { 2246 fn func(context.Context, VCenterCollection) (VCenterCollection, error) 2247 vcc VCenterCollection 2248} 2249 2250// NextWithContext advances to the next page of values. If there was an error making 2251// the request the page does not advance and the error is returned. 2252func (page *VCenterCollectionPage) NextWithContext(ctx context.Context) (err error) { 2253 if tracing.IsEnabled() { 2254 ctx = tracing.StartSpan(ctx, fqdn+"/VCenterCollectionPage.NextWithContext") 2255 defer func() { 2256 sc := -1 2257 if page.Response().Response.Response != nil { 2258 sc = page.Response().Response.Response.StatusCode 2259 } 2260 tracing.EndSpan(ctx, sc, err) 2261 }() 2262 } 2263 for { 2264 next, err := page.fn(ctx, page.vcc) 2265 if err != nil { 2266 return err 2267 } 2268 page.vcc = next 2269 if !next.hasNextLink() || !next.IsEmpty() { 2270 break 2271 } 2272 } 2273 return nil 2274} 2275 2276// Next advances to the next page of values. If there was an error making 2277// the request the page does not advance and the error is returned. 2278// Deprecated: Use NextWithContext() instead. 2279func (page *VCenterCollectionPage) Next() error { 2280 return page.NextWithContext(context.Background()) 2281} 2282 2283// NotDone returns true if the page enumeration should be started or is not yet complete. 2284func (page VCenterCollectionPage) NotDone() bool { 2285 return !page.vcc.IsEmpty() 2286} 2287 2288// Response returns the raw server response from the last page request. 2289func (page VCenterCollectionPage) Response() VCenterCollection { 2290 return page.vcc 2291} 2292 2293// Values returns the slice of values for the current page or nil if there are no values. 2294func (page VCenterCollectionPage) Values() []VCenter { 2295 if page.vcc.IsEmpty() { 2296 return nil 2297 } 2298 return *page.vcc.Value 2299} 2300 2301// Creates a new instance of the VCenterCollectionPage type. 2302func NewVCenterCollectionPage(cur VCenterCollection, getNextPage func(context.Context, VCenterCollection) (VCenterCollection, error)) VCenterCollectionPage { 2303 return VCenterCollectionPage{ 2304 fn: getNextPage, 2305 vcc: cur, 2306 } 2307} 2308 2309// VCenterProperties class for vCenter properties. 2310type VCenterProperties struct { 2311 // CreatedTimestamp - READ-ONLY; Timestamp marking vCenter creation. 2312 CreatedTimestamp *string `json:"createdTimestamp,omitempty"` 2313 // UpdatedTimestamp - READ-ONLY; Timestamp marking last updated on the vCenter. 2314 UpdatedTimestamp *string `json:"updatedTimestamp,omitempty"` 2315 // Fqdn - FQDN/IPAddress of the vCenter. 2316 Fqdn *string `json:"fqdn,omitempty"` 2317 // Port - Port of the vCenter. 2318 Port *string `json:"port,omitempty"` 2319 // RunAsAccountID - Run as account ID of the vCenter. 2320 RunAsAccountID *string `json:"runAsAccountId,omitempty"` 2321 // Version - READ-ONLY; Version of the vCenter. 2322 Version *string `json:"version,omitempty"` 2323 // PerfStatisticsLevel - READ-ONLY; Performance statistics enabled on the vCenter. 2324 PerfStatisticsLevel *string `json:"perfStatisticsLevel,omitempty"` 2325 // InstanceUUID - READ-ONLY; Instance UUID of the vCenter. 2326 InstanceUUID *string `json:"instanceUuid,omitempty"` 2327 // Errors - READ-ONLY; Error details. 2328 Errors *[]HealthErrorDetails `json:"errors,omitempty"` 2329} 2330 2331// MarshalJSON is the custom marshaler for VCenterProperties. 2332func (vcp VCenterProperties) MarshalJSON() ([]byte, error) { 2333 objectMap := make(map[string]interface{}) 2334 if vcp.Fqdn != nil { 2335 objectMap["fqdn"] = vcp.Fqdn 2336 } 2337 if vcp.Port != nil { 2338 objectMap["port"] = vcp.Port 2339 } 2340 if vcp.RunAsAccountID != nil { 2341 objectMap["runAsAccountId"] = vcp.RunAsAccountID 2342 } 2343 return json.Marshal(objectMap) 2344} 2345 2346// VirtualMachineConfiguration ... 2347type VirtualMachineConfiguration struct { 2348 // VirtualMachineType - Possible values include: 'VirtualMachineTypeUnknown', 'VirtualMachineTypeHyperv', 'VirtualMachineTypeLdom', 'VirtualMachineTypeLpar', 'VirtualMachineTypeVmware', 'VirtualMachineTypeVirtualPc', 'VirtualMachineTypeXen' 2349 VirtualMachineType VirtualMachineType `json:"virtualMachineType,omitempty"` 2350 NativeMachineID *string `json:"nativeMachineId,omitempty"` 2351 VirtualMachineName *string `json:"virtualMachineName,omitempty"` 2352 NativeHostMachineID *string `json:"nativeHostMachineId,omitempty"` 2353} 2354 2355// VMwareDisk second level object returned as part of Machine REST resource. 2356type VMwareDisk struct { 2357 // UUID - READ-ONLY; Disk UUID. 2358 UUID *string `json:"uuid,omitempty"` 2359 // Label - READ-ONLY; Label of the disk. 2360 Label *string `json:"label,omitempty"` 2361 // DiskProvisioningPolicy - READ-ONLY; The provisioning policy of the disk. It is Thin or Thick or Unknown for the VMWare. 2362 DiskProvisioningPolicy *string `json:"diskProvisioningPolicy,omitempty"` 2363 // DiskScrubbingPolicy - READ-ONLY; The scrubbing policy of disks which can be eagerly zeroed or lazily zeroed. 2364 DiskScrubbingPolicy *string `json:"diskScrubbingPolicy,omitempty"` 2365 // DiskMode - READ-ONLY; Disk mode property used for identifying independent disks. Possible values include: 'Persistent', 'IndependentPersistent', 'IndependentNonpersistent', 'Nonpersistent', 'Undoable', 'Append' 2366 DiskMode VirtualDiskMode `json:"diskMode,omitempty"` 2367 // MaxSizeInBytes - READ-ONLY; Bytes allocated for the disk. 2368 MaxSizeInBytes *int64 `json:"maxSizeInBytes,omitempty"` 2369 // Name - READ-ONLY; Name of the disk. 2370 Name *string `json:"name,omitempty"` 2371 // DiskType - READ-ONLY; Type of the disk. 2372 DiskType *string `json:"diskType,omitempty"` 2373 // Lun - READ-ONLY; LUN of the disk. 2374 Lun *int32 `json:"lun,omitempty"` 2375 // Path - READ-ONLY; Path of the disk. 2376 Path *string `json:"path,omitempty"` 2377} 2378 2379// MarshalJSON is the custom marshaler for VMwareDisk. 2380func (vmd VMwareDisk) MarshalJSON() ([]byte, error) { 2381 objectMap := make(map[string]interface{}) 2382 return json.Marshal(objectMap) 2383} 2384 2385// VMwareJob job REST Resource. 2386type VMwareJob struct { 2387 autorest.Response `json:"-"` 2388 // ID - READ-ONLY; Resource Id. 2389 ID *string `json:"id,omitempty"` 2390 // Name - READ-ONLY; Name of the job. 2391 Name *string `json:"name,omitempty"` 2392 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/VMWareSites/Jobs. 2393 Type *string `json:"type,omitempty"` 2394 // Properties - READ-ONLY; Nested properties of job. 2395 Properties *JobProperties `json:"properties,omitempty"` 2396} 2397 2398// MarshalJSON is the custom marshaler for VMwareJob. 2399func (vmj VMwareJob) MarshalJSON() ([]byte, error) { 2400 objectMap := make(map[string]interface{}) 2401 return json.Marshal(objectMap) 2402} 2403 2404// VMwareJobCollection collection of VMware jobs. 2405type VMwareJobCollection struct { 2406 autorest.Response `json:"-"` 2407 // Value - READ-ONLY; List of jobs. 2408 Value *[]VMwareJob `json:"value,omitempty"` 2409 // NextLink - READ-ONLY; Value of next link. 2410 NextLink *string `json:"nextLink,omitempty"` 2411} 2412 2413// MarshalJSON is the custom marshaler for VMwareJobCollection. 2414func (vmjc VMwareJobCollection) MarshalJSON() ([]byte, error) { 2415 objectMap := make(map[string]interface{}) 2416 return json.Marshal(objectMap) 2417} 2418 2419// VMwareJobCollectionIterator provides access to a complete listing of VMwareJob values. 2420type VMwareJobCollectionIterator struct { 2421 i int 2422 page VMwareJobCollectionPage 2423} 2424 2425// NextWithContext advances to the next value. If there was an error making 2426// the request the iterator does not advance and the error is returned. 2427func (iter *VMwareJobCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2428 if tracing.IsEnabled() { 2429 ctx = tracing.StartSpan(ctx, fqdn+"/VMwareJobCollectionIterator.NextWithContext") 2430 defer func() { 2431 sc := -1 2432 if iter.Response().Response.Response != nil { 2433 sc = iter.Response().Response.Response.StatusCode 2434 } 2435 tracing.EndSpan(ctx, sc, err) 2436 }() 2437 } 2438 iter.i++ 2439 if iter.i < len(iter.page.Values()) { 2440 return nil 2441 } 2442 err = iter.page.NextWithContext(ctx) 2443 if err != nil { 2444 iter.i-- 2445 return err 2446 } 2447 iter.i = 0 2448 return nil 2449} 2450 2451// Next advances to the next value. If there was an error making 2452// the request the iterator does not advance and the error is returned. 2453// Deprecated: Use NextWithContext() instead. 2454func (iter *VMwareJobCollectionIterator) Next() error { 2455 return iter.NextWithContext(context.Background()) 2456} 2457 2458// NotDone returns true if the enumeration should be started or is not yet complete. 2459func (iter VMwareJobCollectionIterator) NotDone() bool { 2460 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2461} 2462 2463// Response returns the raw server response from the last page request. 2464func (iter VMwareJobCollectionIterator) Response() VMwareJobCollection { 2465 return iter.page.Response() 2466} 2467 2468// Value returns the current value or a zero-initialized value if the 2469// iterator has advanced beyond the end of the collection. 2470func (iter VMwareJobCollectionIterator) Value() VMwareJob { 2471 if !iter.page.NotDone() { 2472 return VMwareJob{} 2473 } 2474 return iter.page.Values()[iter.i] 2475} 2476 2477// Creates a new instance of the VMwareJobCollectionIterator type. 2478func NewVMwareJobCollectionIterator(page VMwareJobCollectionPage) VMwareJobCollectionIterator { 2479 return VMwareJobCollectionIterator{page: page} 2480} 2481 2482// IsEmpty returns true if the ListResult contains no values. 2483func (vmjc VMwareJobCollection) IsEmpty() bool { 2484 return vmjc.Value == nil || len(*vmjc.Value) == 0 2485} 2486 2487// hasNextLink returns true if the NextLink is not empty. 2488func (vmjc VMwareJobCollection) hasNextLink() bool { 2489 return vmjc.NextLink != nil && len(*vmjc.NextLink) != 0 2490} 2491 2492// vMwareJobCollectionPreparer prepares a request to retrieve the next set of results. 2493// It returns nil if no more results exist. 2494func (vmjc VMwareJobCollection) vMwareJobCollectionPreparer(ctx context.Context) (*http.Request, error) { 2495 if !vmjc.hasNextLink() { 2496 return nil, nil 2497 } 2498 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2499 autorest.AsJSON(), 2500 autorest.AsGet(), 2501 autorest.WithBaseURL(to.String(vmjc.NextLink))) 2502} 2503 2504// VMwareJobCollectionPage contains a page of VMwareJob values. 2505type VMwareJobCollectionPage struct { 2506 fn func(context.Context, VMwareJobCollection) (VMwareJobCollection, error) 2507 vmjc VMwareJobCollection 2508} 2509 2510// NextWithContext advances to the next page of values. If there was an error making 2511// the request the page does not advance and the error is returned. 2512func (page *VMwareJobCollectionPage) NextWithContext(ctx context.Context) (err error) { 2513 if tracing.IsEnabled() { 2514 ctx = tracing.StartSpan(ctx, fqdn+"/VMwareJobCollectionPage.NextWithContext") 2515 defer func() { 2516 sc := -1 2517 if page.Response().Response.Response != nil { 2518 sc = page.Response().Response.Response.StatusCode 2519 } 2520 tracing.EndSpan(ctx, sc, err) 2521 }() 2522 } 2523 for { 2524 next, err := page.fn(ctx, page.vmjc) 2525 if err != nil { 2526 return err 2527 } 2528 page.vmjc = next 2529 if !next.hasNextLink() || !next.IsEmpty() { 2530 break 2531 } 2532 } 2533 return nil 2534} 2535 2536// Next advances to the next page of values. If there was an error making 2537// the request the page does not advance and the error is returned. 2538// Deprecated: Use NextWithContext() instead. 2539func (page *VMwareJobCollectionPage) Next() error { 2540 return page.NextWithContext(context.Background()) 2541} 2542 2543// NotDone returns true if the page enumeration should be started or is not yet complete. 2544func (page VMwareJobCollectionPage) NotDone() bool { 2545 return !page.vmjc.IsEmpty() 2546} 2547 2548// Response returns the raw server response from the last page request. 2549func (page VMwareJobCollectionPage) Response() VMwareJobCollection { 2550 return page.vmjc 2551} 2552 2553// Values returns the slice of values for the current page or nil if there are no values. 2554func (page VMwareJobCollectionPage) Values() []VMwareJob { 2555 if page.vmjc.IsEmpty() { 2556 return nil 2557 } 2558 return *page.vmjc.Value 2559} 2560 2561// Creates a new instance of the VMwareJobCollectionPage type. 2562func NewVMwareJobCollectionPage(cur VMwareJobCollection, getNextPage func(context.Context, VMwareJobCollection) (VMwareJobCollection, error)) VMwareJobCollectionPage { 2563 return VMwareJobCollectionPage{ 2564 fn: getNextPage, 2565 vmjc: cur, 2566 } 2567} 2568 2569// VMwareMachine machine REST Resource. 2570type VMwareMachine struct { 2571 autorest.Response `json:"-"` 2572 // ID - READ-ONLY; Resource Id. 2573 ID *string `json:"id,omitempty"` 2574 // Name - READ-ONLY; Name of the Sites. 2575 Name *string `json:"name,omitempty"` 2576 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/VMWareSites/Machines. 2577 Type *string `json:"type,omitempty"` 2578 // Properties - READ-ONLY; Nested properties. 2579 Properties *VMwareMachineProperties `json:"properties,omitempty"` 2580} 2581 2582// MarshalJSON is the custom marshaler for VMwareMachine. 2583func (vmm VMwareMachine) MarshalJSON() ([]byte, error) { 2584 objectMap := make(map[string]interface{}) 2585 return json.Marshal(objectMap) 2586} 2587 2588// VMwareMachineCollection collection of VMware machines. 2589type VMwareMachineCollection struct { 2590 autorest.Response `json:"-"` 2591 // Value - READ-ONLY; List of machines. 2592 Value *[]VMwareMachine `json:"value,omitempty"` 2593 // NextLink - READ-ONLY; Value of next link. 2594 NextLink *string `json:"nextLink,omitempty"` 2595} 2596 2597// MarshalJSON is the custom marshaler for VMwareMachineCollection. 2598func (vmmc VMwareMachineCollection) MarshalJSON() ([]byte, error) { 2599 objectMap := make(map[string]interface{}) 2600 return json.Marshal(objectMap) 2601} 2602 2603// VMwareMachineCollectionIterator provides access to a complete listing of VMwareMachine values. 2604type VMwareMachineCollectionIterator struct { 2605 i int 2606 page VMwareMachineCollectionPage 2607} 2608 2609// NextWithContext advances to the next value. If there was an error making 2610// the request the iterator does not advance and the error is returned. 2611func (iter *VMwareMachineCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2612 if tracing.IsEnabled() { 2613 ctx = tracing.StartSpan(ctx, fqdn+"/VMwareMachineCollectionIterator.NextWithContext") 2614 defer func() { 2615 sc := -1 2616 if iter.Response().Response.Response != nil { 2617 sc = iter.Response().Response.Response.StatusCode 2618 } 2619 tracing.EndSpan(ctx, sc, err) 2620 }() 2621 } 2622 iter.i++ 2623 if iter.i < len(iter.page.Values()) { 2624 return nil 2625 } 2626 err = iter.page.NextWithContext(ctx) 2627 if err != nil { 2628 iter.i-- 2629 return err 2630 } 2631 iter.i = 0 2632 return nil 2633} 2634 2635// Next advances to the next value. If there was an error making 2636// the request the iterator does not advance and the error is returned. 2637// Deprecated: Use NextWithContext() instead. 2638func (iter *VMwareMachineCollectionIterator) Next() error { 2639 return iter.NextWithContext(context.Background()) 2640} 2641 2642// NotDone returns true if the enumeration should be started or is not yet complete. 2643func (iter VMwareMachineCollectionIterator) NotDone() bool { 2644 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2645} 2646 2647// Response returns the raw server response from the last page request. 2648func (iter VMwareMachineCollectionIterator) Response() VMwareMachineCollection { 2649 return iter.page.Response() 2650} 2651 2652// Value returns the current value or a zero-initialized value if the 2653// iterator has advanced beyond the end of the collection. 2654func (iter VMwareMachineCollectionIterator) Value() VMwareMachine { 2655 if !iter.page.NotDone() { 2656 return VMwareMachine{} 2657 } 2658 return iter.page.Values()[iter.i] 2659} 2660 2661// Creates a new instance of the VMwareMachineCollectionIterator type. 2662func NewVMwareMachineCollectionIterator(page VMwareMachineCollectionPage) VMwareMachineCollectionIterator { 2663 return VMwareMachineCollectionIterator{page: page} 2664} 2665 2666// IsEmpty returns true if the ListResult contains no values. 2667func (vmmc VMwareMachineCollection) IsEmpty() bool { 2668 return vmmc.Value == nil || len(*vmmc.Value) == 0 2669} 2670 2671// hasNextLink returns true if the NextLink is not empty. 2672func (vmmc VMwareMachineCollection) hasNextLink() bool { 2673 return vmmc.NextLink != nil && len(*vmmc.NextLink) != 0 2674} 2675 2676// vMwareMachineCollectionPreparer prepares a request to retrieve the next set of results. 2677// It returns nil if no more results exist. 2678func (vmmc VMwareMachineCollection) vMwareMachineCollectionPreparer(ctx context.Context) (*http.Request, error) { 2679 if !vmmc.hasNextLink() { 2680 return nil, nil 2681 } 2682 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2683 autorest.AsJSON(), 2684 autorest.AsGet(), 2685 autorest.WithBaseURL(to.String(vmmc.NextLink))) 2686} 2687 2688// VMwareMachineCollectionPage contains a page of VMwareMachine values. 2689type VMwareMachineCollectionPage struct { 2690 fn func(context.Context, VMwareMachineCollection) (VMwareMachineCollection, error) 2691 vmmc VMwareMachineCollection 2692} 2693 2694// NextWithContext advances to the next page of values. If there was an error making 2695// the request the page does not advance and the error is returned. 2696func (page *VMwareMachineCollectionPage) NextWithContext(ctx context.Context) (err error) { 2697 if tracing.IsEnabled() { 2698 ctx = tracing.StartSpan(ctx, fqdn+"/VMwareMachineCollectionPage.NextWithContext") 2699 defer func() { 2700 sc := -1 2701 if page.Response().Response.Response != nil { 2702 sc = page.Response().Response.Response.StatusCode 2703 } 2704 tracing.EndSpan(ctx, sc, err) 2705 }() 2706 } 2707 for { 2708 next, err := page.fn(ctx, page.vmmc) 2709 if err != nil { 2710 return err 2711 } 2712 page.vmmc = next 2713 if !next.hasNextLink() || !next.IsEmpty() { 2714 break 2715 } 2716 } 2717 return nil 2718} 2719 2720// Next advances to the next page of values. If there was an error making 2721// the request the page does not advance and the error is returned. 2722// Deprecated: Use NextWithContext() instead. 2723func (page *VMwareMachineCollectionPage) Next() error { 2724 return page.NextWithContext(context.Background()) 2725} 2726 2727// NotDone returns true if the page enumeration should be started or is not yet complete. 2728func (page VMwareMachineCollectionPage) NotDone() bool { 2729 return !page.vmmc.IsEmpty() 2730} 2731 2732// Response returns the raw server response from the last page request. 2733func (page VMwareMachineCollectionPage) Response() VMwareMachineCollection { 2734 return page.vmmc 2735} 2736 2737// Values returns the slice of values for the current page or nil if there are no values. 2738func (page VMwareMachineCollectionPage) Values() []VMwareMachine { 2739 if page.vmmc.IsEmpty() { 2740 return nil 2741 } 2742 return *page.vmmc.Value 2743} 2744 2745// Creates a new instance of the VMwareMachineCollectionPage type. 2746func NewVMwareMachineCollectionPage(cur VMwareMachineCollection, getNextPage func(context.Context, VMwareMachineCollection) (VMwareMachineCollection, error)) VMwareMachineCollectionPage { 2747 return VMwareMachineCollectionPage{ 2748 fn: getNextPage, 2749 vmmc: cur, 2750 } 2751} 2752 2753// VMwareMachineProperties class for machine properties. 2754type VMwareMachineProperties struct { 2755 // DataCenterScope - READ-ONLY; Scope of the data center. 2756 DataCenterScope *string `json:"dataCenterScope,omitempty"` 2757 // Firmware - READ-ONLY; Firmware of the machine. 2758 Firmware *string `json:"firmware,omitempty"` 2759 // Description - READ-ONLY; User description of the machine. 2760 Description *string `json:"description,omitempty"` 2761 // VCenterFQDN - READ-ONLY; VCenter FQDN/IPAddress. 2762 VCenterFQDN *string `json:"vCenterFQDN,omitempty"` 2763 // VCenterID - READ-ONLY; VCenter ARM ID. 2764 VCenterID *string `json:"vCenterId,omitempty"` 2765 // VMwareToolsStatus - READ-ONLY; VMware tools status. 2766 VMwareToolsStatus *string `json:"vMwareToolsStatus,omitempty"` 2767 // ChangeTrackingSupported - READ-ONLY; Value indicating whether change tracking is supported. 2768 ChangeTrackingSupported *bool `json:"changeTrackingSupported,omitempty"` 2769 // ChangeTrackingEnabled - READ-ONLY; Value indicating whether change tracking is enabled. 2770 ChangeTrackingEnabled *bool `json:"changeTrackingEnabled,omitempty"` 2771 // MaxSnapshots - READ-ONLY; Maximum number of snapshots for the VM. Default value is -1. 2772 MaxSnapshots *int32 `json:"maxSnapshots,omitempty"` 2773 // Disks - READ-ONLY; Disks attached to the machine. 2774 Disks *[]VMwareDisk `json:"disks,omitempty"` 2775 // AppsAndRoles - READ-ONLY; Apps And Roles of the VM. 2776 AppsAndRoles *AppsAndRoles `json:"appsAndRoles,omitempty"` 2777 // HostInMaintenanceMode - READ-ONLY; Indicates whether the host is in maintenance mode. 2778 HostInMaintenanceMode *bool `json:"hostInMaintenanceMode,omitempty"` 2779 // HostName - READ-ONLY; The host name. 2780 HostName *string `json:"hostName,omitempty"` 2781 // HostPowerState - READ-ONLY; The host power state. 2782 HostPowerState *string `json:"hostPowerState,omitempty"` 2783 // HostVersion - READ-ONLY; The host version. 2784 HostVersion *string `json:"hostVersion,omitempty"` 2785 // NetworkAdapters - READ-ONLY; Network adapters attached to the machine. 2786 NetworkAdapters *[]VMwareNetworkAdapter `json:"networkAdapters,omitempty"` 2787 // DependencyMapping - READ-ONLY; If dependency mapping feature is enabled or not for the VM. 2788 DependencyMapping *string `json:"dependencyMapping,omitempty"` 2789 // DependencyMappingStartTime - READ-ONLY; When dependency mapping collection is last started. 2790 DependencyMappingStartTime *date.Time `json:"dependencyMappingStartTime,omitempty"` 2791 // DisplayName - READ-ONLY; Display name of the machine. 2792 DisplayName *string `json:"displayName,omitempty"` 2793 // NumberOfProcessorCore - READ-ONLY; Number of Processor Cores allocated for the machine. 2794 NumberOfProcessorCore *int32 `json:"numberOfProcessorCore,omitempty"` 2795 // AllocatedMemoryInMB - READ-ONLY; Allocated Memory in MB. 2796 AllocatedMemoryInMB *float64 `json:"allocatedMemoryInMB,omitempty"` 2797 // VMConfigurationFileLocation - READ-ONLY; Root location of the VM configuration file. 2798 VMConfigurationFileLocation *string `json:"vmConfigurationFileLocation,omitempty"` 2799 // OperatingSystemDetails - READ-ONLY; Operating System Details installed on the machine. 2800 OperatingSystemDetails *OperatingSystem `json:"operatingSystemDetails,omitempty"` 2801 // GuestOSDetails - READ-ONLY; Operating System Details extracted from the guest bu executing script inside the guest VM. 2802 GuestOSDetails *GuestOSDetails `json:"guestOSDetails,omitempty"` 2803 // NumberOfApplications - READ-ONLY; Number of applications installed in the guest VM. 2804 NumberOfApplications *int32 `json:"numberOfApplications,omitempty"` 2805 // GuestDetailsDiscoveryTimestamp - READ-ONLY; The last time at which the Guest Details was discovered or the error while discovering guest details based discovery of the machine. 2806 GuestDetailsDiscoveryTimestamp *date.Time `json:"guestDetailsDiscoveryTimestamp,omitempty"` 2807 // IsGuestDetailsDiscoveryInProgress - READ-ONLY; Whether Refresh Fabric Layout Guest Details has been completed once. Portal will show discovery in progress, if this value is true. 2808 IsGuestDetailsDiscoveryInProgress *bool `json:"isGuestDetailsDiscoveryInProgress,omitempty"` 2809 // CreatedTimestamp - READ-ONLY; Timestamp marking machine creation. 2810 CreatedTimestamp *string `json:"createdTimestamp,omitempty"` 2811 // UpdatedTimestamp - READ-ONLY; Timestamp marking last updated on the machine. 2812 UpdatedTimestamp *string `json:"updatedTimestamp,omitempty"` 2813 // InstanceUUID - READ-ONLY; On-premise Instance UUID of the machine. 2814 InstanceUUID *string `json:"instanceUuid,omitempty"` 2815 // PowerStatus - READ-ONLY; Machine power status. 2816 PowerStatus *string `json:"powerStatus,omitempty"` 2817 // BiosSerialNumber - READ-ONLY; Machine BIOS serial number. 2818 BiosSerialNumber *string `json:"biosSerialNumber,omitempty"` 2819 // BiosGUID - READ-ONLY; BIOS GUID. 2820 BiosGUID *string `json:"biosGuid,omitempty"` 2821 // VMFqdn - READ-ONLY; Machine FQDN. 2822 VMFqdn *string `json:"vmFqdn,omitempty"` 2823 // IsDeleted - READ-ONLY; Value indicating whether VM is deleted. 2824 IsDeleted *bool `json:"isDeleted,omitempty"` 2825 // Errors - READ-ONLY; Errors for machine. 2826 Errors *[]HealthErrorDetails `json:"errors,omitempty"` 2827} 2828 2829// MarshalJSON is the custom marshaler for VMwareMachineProperties. 2830func (vmmp VMwareMachineProperties) MarshalJSON() ([]byte, error) { 2831 objectMap := make(map[string]interface{}) 2832 return json.Marshal(objectMap) 2833} 2834 2835// VMwareNetworkAdapter second level object represented in responses as part of Machine REST resource. 2836type VMwareNetworkAdapter struct { 2837 // Label - READ-ONLY; Label of the NIC. 2838 Label *string `json:"label,omitempty"` 2839 // NicID - READ-ONLY; NIC Id. 2840 NicID *string `json:"nicId,omitempty"` 2841 // MacAddress - READ-ONLY; Mac address of the NIC. 2842 MacAddress *string `json:"macAddress,omitempty"` 2843 // IPAddressList - READ-ONLY; IP addresses for the machine. 2844 IPAddressList *[]string `json:"ipAddressList,omitempty"` 2845 // NetworkName - READ-ONLY; Network Name. 2846 NetworkName *string `json:"networkName,omitempty"` 2847 // IPAddressType - READ-ONLY; Type of the IP address. 2848 IPAddressType *string `json:"ipAddressType,omitempty"` 2849} 2850 2851// MarshalJSON is the custom marshaler for VMwareNetworkAdapter. 2852func (vmna VMwareNetworkAdapter) MarshalJSON() ([]byte, error) { 2853 objectMap := make(map[string]interface{}) 2854 return json.Marshal(objectMap) 2855} 2856 2857// VMwareRunAsAccount run as account REST Resource. 2858type VMwareRunAsAccount struct { 2859 autorest.Response `json:"-"` 2860 // ID - READ-ONLY; Resource Id. 2861 ID *string `json:"id,omitempty"` 2862 // Name - READ-ONLY; Name of the Run as account. 2863 Name *string `json:"name,omitempty"` 2864 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/VMWareSites/RunAsAccounts. 2865 Type *string `json:"type,omitempty"` 2866 // Properties - READ-ONLY; Nested properties of Run as account. 2867 Properties *RunAsAccountProperties `json:"properties,omitempty"` 2868} 2869 2870// MarshalJSON is the custom marshaler for VMwareRunAsAccount. 2871func (vmraa VMwareRunAsAccount) MarshalJSON() ([]byte, error) { 2872 objectMap := make(map[string]interface{}) 2873 return json.Marshal(objectMap) 2874} 2875 2876// VMwareRunAsAccountCollection collection of VMware run as accounts. 2877type VMwareRunAsAccountCollection struct { 2878 autorest.Response `json:"-"` 2879 // Value - READ-ONLY; List of run as accounts. 2880 Value *[]VMwareRunAsAccount `json:"value,omitempty"` 2881 // NextLink - READ-ONLY; Value of next link. 2882 NextLink *string `json:"nextLink,omitempty"` 2883} 2884 2885// MarshalJSON is the custom marshaler for VMwareRunAsAccountCollection. 2886func (vmraac VMwareRunAsAccountCollection) MarshalJSON() ([]byte, error) { 2887 objectMap := make(map[string]interface{}) 2888 return json.Marshal(objectMap) 2889} 2890 2891// VMwareRunAsAccountCollectionIterator provides access to a complete listing of VMwareRunAsAccount values. 2892type VMwareRunAsAccountCollectionIterator struct { 2893 i int 2894 page VMwareRunAsAccountCollectionPage 2895} 2896 2897// NextWithContext advances to the next value. If there was an error making 2898// the request the iterator does not advance and the error is returned. 2899func (iter *VMwareRunAsAccountCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2900 if tracing.IsEnabled() { 2901 ctx = tracing.StartSpan(ctx, fqdn+"/VMwareRunAsAccountCollectionIterator.NextWithContext") 2902 defer func() { 2903 sc := -1 2904 if iter.Response().Response.Response != nil { 2905 sc = iter.Response().Response.Response.StatusCode 2906 } 2907 tracing.EndSpan(ctx, sc, err) 2908 }() 2909 } 2910 iter.i++ 2911 if iter.i < len(iter.page.Values()) { 2912 return nil 2913 } 2914 err = iter.page.NextWithContext(ctx) 2915 if err != nil { 2916 iter.i-- 2917 return err 2918 } 2919 iter.i = 0 2920 return nil 2921} 2922 2923// Next advances to the next value. If there was an error making 2924// the request the iterator does not advance and the error is returned. 2925// Deprecated: Use NextWithContext() instead. 2926func (iter *VMwareRunAsAccountCollectionIterator) Next() error { 2927 return iter.NextWithContext(context.Background()) 2928} 2929 2930// NotDone returns true if the enumeration should be started or is not yet complete. 2931func (iter VMwareRunAsAccountCollectionIterator) NotDone() bool { 2932 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2933} 2934 2935// Response returns the raw server response from the last page request. 2936func (iter VMwareRunAsAccountCollectionIterator) Response() VMwareRunAsAccountCollection { 2937 return iter.page.Response() 2938} 2939 2940// Value returns the current value or a zero-initialized value if the 2941// iterator has advanced beyond the end of the collection. 2942func (iter VMwareRunAsAccountCollectionIterator) Value() VMwareRunAsAccount { 2943 if !iter.page.NotDone() { 2944 return VMwareRunAsAccount{} 2945 } 2946 return iter.page.Values()[iter.i] 2947} 2948 2949// Creates a new instance of the VMwareRunAsAccountCollectionIterator type. 2950func NewVMwareRunAsAccountCollectionIterator(page VMwareRunAsAccountCollectionPage) VMwareRunAsAccountCollectionIterator { 2951 return VMwareRunAsAccountCollectionIterator{page: page} 2952} 2953 2954// IsEmpty returns true if the ListResult contains no values. 2955func (vmraac VMwareRunAsAccountCollection) IsEmpty() bool { 2956 return vmraac.Value == nil || len(*vmraac.Value) == 0 2957} 2958 2959// hasNextLink returns true if the NextLink is not empty. 2960func (vmraac VMwareRunAsAccountCollection) hasNextLink() bool { 2961 return vmraac.NextLink != nil && len(*vmraac.NextLink) != 0 2962} 2963 2964// vMwareRunAsAccountCollectionPreparer prepares a request to retrieve the next set of results. 2965// It returns nil if no more results exist. 2966func (vmraac VMwareRunAsAccountCollection) vMwareRunAsAccountCollectionPreparer(ctx context.Context) (*http.Request, error) { 2967 if !vmraac.hasNextLink() { 2968 return nil, nil 2969 } 2970 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2971 autorest.AsJSON(), 2972 autorest.AsGet(), 2973 autorest.WithBaseURL(to.String(vmraac.NextLink))) 2974} 2975 2976// VMwareRunAsAccountCollectionPage contains a page of VMwareRunAsAccount values. 2977type VMwareRunAsAccountCollectionPage struct { 2978 fn func(context.Context, VMwareRunAsAccountCollection) (VMwareRunAsAccountCollection, error) 2979 vmraac VMwareRunAsAccountCollection 2980} 2981 2982// NextWithContext advances to the next page of values. If there was an error making 2983// the request the page does not advance and the error is returned. 2984func (page *VMwareRunAsAccountCollectionPage) NextWithContext(ctx context.Context) (err error) { 2985 if tracing.IsEnabled() { 2986 ctx = tracing.StartSpan(ctx, fqdn+"/VMwareRunAsAccountCollectionPage.NextWithContext") 2987 defer func() { 2988 sc := -1 2989 if page.Response().Response.Response != nil { 2990 sc = page.Response().Response.Response.StatusCode 2991 } 2992 tracing.EndSpan(ctx, sc, err) 2993 }() 2994 } 2995 for { 2996 next, err := page.fn(ctx, page.vmraac) 2997 if err != nil { 2998 return err 2999 } 3000 page.vmraac = next 3001 if !next.hasNextLink() || !next.IsEmpty() { 3002 break 3003 } 3004 } 3005 return nil 3006} 3007 3008// Next advances to the next page of values. If there was an error making 3009// the request the page does not advance and the error is returned. 3010// Deprecated: Use NextWithContext() instead. 3011func (page *VMwareRunAsAccountCollectionPage) Next() error { 3012 return page.NextWithContext(context.Background()) 3013} 3014 3015// NotDone returns true if the page enumeration should be started or is not yet complete. 3016func (page VMwareRunAsAccountCollectionPage) NotDone() bool { 3017 return !page.vmraac.IsEmpty() 3018} 3019 3020// Response returns the raw server response from the last page request. 3021func (page VMwareRunAsAccountCollectionPage) Response() VMwareRunAsAccountCollection { 3022 return page.vmraac 3023} 3024 3025// Values returns the slice of values for the current page or nil if there are no values. 3026func (page VMwareRunAsAccountCollectionPage) Values() []VMwareRunAsAccount { 3027 if page.vmraac.IsEmpty() { 3028 return nil 3029 } 3030 return *page.vmraac.Value 3031} 3032 3033// Creates a new instance of the VMwareRunAsAccountCollectionPage type. 3034func NewVMwareRunAsAccountCollectionPage(cur VMwareRunAsAccountCollection, getNextPage func(context.Context, VMwareRunAsAccountCollection) (VMwareRunAsAccountCollection, error)) VMwareRunAsAccountCollectionPage { 3035 return VMwareRunAsAccountCollectionPage{ 3036 fn: getNextPage, 3037 vmraac: cur, 3038 } 3039} 3040 3041// VMwareSite site REST Resource. 3042type VMwareSite struct { 3043 autorest.Response `json:"-"` 3044 // ID - READ-ONLY; Resource Id. 3045 ID *string `json:"id,omitempty"` 3046 // Name - Name of the VMware site. 3047 Name *string `json:"name,omitempty"` 3048 // Type - READ-ONLY; Type of resource. Type = Microsoft.OffAzure/VMWareSites. 3049 Type *string `json:"type,omitempty"` 3050 Tags map[string]*string `json:"tags"` 3051 // ETag - eTag for concurrency control. 3052 ETag *string `json:"eTag,omitempty"` 3053 // Location - Azure location in which Sites is created. 3054 Location *string `json:"location,omitempty"` 3055 // Properties - Nested properties of VMWare site. 3056 Properties *SiteProperties `json:"properties,omitempty"` 3057} 3058 3059// MarshalJSON is the custom marshaler for VMwareSite. 3060func (vms VMwareSite) MarshalJSON() ([]byte, error) { 3061 objectMap := make(map[string]interface{}) 3062 if vms.Name != nil { 3063 objectMap["name"] = vms.Name 3064 } 3065 if vms.Tags != nil { 3066 objectMap["tags"] = vms.Tags 3067 } 3068 if vms.ETag != nil { 3069 objectMap["eTag"] = vms.ETag 3070 } 3071 if vms.Location != nil { 3072 objectMap["location"] = vms.Location 3073 } 3074 if vms.Properties != nil { 3075 objectMap["properties"] = vms.Properties 3076 } 3077 return json.Marshal(objectMap) 3078} 3079 3080// VMwareSiteUsage vMware site usage. 3081type VMwareSiteUsage struct { 3082 autorest.Response `json:"-"` 3083 // MachineCount - Number of machines discovered in the site. 3084 MachineCount *int32 `json:"machineCount,omitempty"` 3085 // RunAsAccountCount - Number of run as accounts in the site. 3086 RunAsAccountCount *int32 `json:"runAsAccountCount,omitempty"` 3087 // VCenterCount - Number of vCenters part of the site. 3088 VCenterCount *int32 `json:"vCenterCount,omitempty"` 3089} 3090 3091// WebApplication webApplication in the guest virtual machine. 3092type WebApplication struct { 3093 // Name - READ-ONLY; Name of the WebApplication. 3094 Name *string `json:"name,omitempty"` 3095 // Status - READ-ONLY; Status of the WebApplication. 3096 Status *string `json:"status,omitempty"` 3097 // Platform - READ-ONLY; Platform of the WebApplication. 3098 Platform *string `json:"platform,omitempty"` 3099 // GroupName - READ-ONLY; GroupName of the WebApplication. 3100 GroupName *string `json:"groupName,omitempty"` 3101 // WebServer - READ-ONLY; WebServer of the WebApplication. 3102 WebServer *string `json:"webServer,omitempty"` 3103 // ApplicationPool - READ-ONLY; ApplicationPool of the WebApplication. 3104 ApplicationPool *string `json:"applicationPool,omitempty"` 3105} 3106 3107// MarshalJSON is the custom marshaler for WebApplication. 3108func (wa WebApplication) MarshalJSON() ([]byte, error) { 3109 objectMap := make(map[string]interface{}) 3110 return json.Marshal(objectMap) 3111} 3112