1package storagesync 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/to" 26 "github.com/Azure/go-autorest/tracing" 27 "net/http" 28) 29 30// The package's fully qualified name. 31const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2018-04-02/storagesync" 32 33// CloudTiering enumerates the values for cloud tiering. 34type CloudTiering string 35 36const ( 37 // Off ... 38 Off CloudTiering = "off" 39 // On ... 40 On CloudTiering = "on" 41) 42 43// PossibleCloudTieringValues returns an array of possible values for the CloudTiering const type. 44func PossibleCloudTieringValues() []CloudTiering { 45 return []CloudTiering{Off, On} 46} 47 48// CloudTiering1 enumerates the values for cloud tiering 1. 49type CloudTiering1 string 50 51const ( 52 // CloudTiering1Off ... 53 CloudTiering1Off CloudTiering1 = "off" 54 // CloudTiering1On ... 55 CloudTiering1On CloudTiering1 = "on" 56) 57 58// PossibleCloudTiering1Values returns an array of possible values for the CloudTiering1 const type. 59func PossibleCloudTiering1Values() []CloudTiering1 { 60 return []CloudTiering1{CloudTiering1Off, CloudTiering1On} 61} 62 63// CloudTiering2 enumerates the values for cloud tiering 2. 64type CloudTiering2 string 65 66const ( 67 // CloudTiering2Off ... 68 CloudTiering2Off CloudTiering2 = "off" 69 // CloudTiering2On ... 70 CloudTiering2On CloudTiering2 = "on" 71) 72 73// PossibleCloudTiering2Values returns an array of possible values for the CloudTiering2 const type. 74func PossibleCloudTiering2Values() []CloudTiering2 { 75 return []CloudTiering2{CloudTiering2Off, CloudTiering2On} 76} 77 78// NameAvailabilityReason enumerates the values for name availability reason. 79type NameAvailabilityReason string 80 81const ( 82 // AlreadyExists ... 83 AlreadyExists NameAvailabilityReason = "AlreadyExists" 84 // Invalid ... 85 Invalid NameAvailabilityReason = "Invalid" 86) 87 88// PossibleNameAvailabilityReasonValues returns an array of possible values for the NameAvailabilityReason const type. 89func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { 90 return []NameAvailabilityReason{AlreadyExists, Invalid} 91} 92 93// Operation enumerates the values for operation. 94type Operation string 95 96const ( 97 // Cancel ... 98 Cancel Operation = "cancel" 99 // Do ... 100 Do Operation = "do" 101 // Undo ... 102 Undo Operation = "undo" 103) 104 105// PossibleOperationValues returns an array of possible values for the Operation const type. 106func PossibleOperationValues() []Operation { 107 return []Operation{Cancel, Do, Undo} 108} 109 110// Reason enumerates the values for reason. 111type Reason string 112 113const ( 114 // Deleted ... 115 Deleted Reason = "Deleted" 116 // Registered ... 117 Registered Reason = "Registered" 118 // Suspended ... 119 Suspended Reason = "Suspended" 120 // Unregistered ... 121 Unregistered Reason = "Unregistered" 122 // Warned ... 123 Warned Reason = "Warned" 124) 125 126// PossibleReasonValues returns an array of possible values for the Reason const type. 127func PossibleReasonValues() []Reason { 128 return []Reason{Deleted, Registered, Suspended, Unregistered, Warned} 129} 130 131// Status enumerates the values for status. 132type Status string 133 134const ( 135 // Aborted ... 136 Aborted Status = "aborted" 137 // Active ... 138 Active Status = "active" 139 // Expired ... 140 Expired Status = "expired" 141 // Failed ... 142 Failed Status = "failed" 143 // Succeeded ... 144 Succeeded Status = "succeeded" 145) 146 147// PossibleStatusValues returns an array of possible values for the Status const type. 148func PossibleStatusValues() []Status { 149 return []Status{Aborted, Active, Expired, Failed, Succeeded} 150} 151 152// APIError error type 153type APIError struct { 154 // Code - Error code of the given entry. 155 Code *string `json:"code,omitempty"` 156 // Message - Error message of the given entry. 157 Message *string `json:"message,omitempty"` 158 // Target - Target of the given error entry. 159 Target *string `json:"target,omitempty"` 160 // Details - Error details of the given entry. 161 Details *ErrorDetails `json:"details,omitempty"` 162} 163 164// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. 165type AzureEntityResource struct { 166 // Etag - READ-ONLY; Resource Etag. 167 Etag *string `json:"etag,omitempty"` 168 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 169 ID *string `json:"id,omitempty"` 170 // Name - READ-ONLY; The name of the resource 171 Name *string `json:"name,omitempty"` 172 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 173 Type *string `json:"type,omitempty"` 174} 175 176// BackupRequest backup request 177type BackupRequest struct { 178 // AzureFileShare - Azure File Share. 179 AzureFileShare *string `json:"azureFileShare,omitempty"` 180} 181 182// CheckNameAvailabilityParameters parameters for a check name availability request. 183type CheckNameAvailabilityParameters struct { 184 // Name - The name to check for availability 185 Name *string `json:"name,omitempty"` 186 // Type - The resource type. Must be set to Microsoft.StorageSync/storageSyncServices 187 Type *string `json:"type,omitempty"` 188} 189 190// CheckNameAvailabilityResult the CheckNameAvailability operation response. 191type CheckNameAvailabilityResult struct { 192 autorest.Response `json:"-"` 193 // NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used. 194 NameAvailable *bool `json:"nameAvailable,omitempty"` 195 // Reason - READ-ONLY; Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists' 196 Reason NameAvailabilityReason `json:"reason,omitempty"` 197 // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail. 198 Message *string `json:"message,omitempty"` 199} 200 201// CloudEndpoint cloud Endpoint object. 202type CloudEndpoint struct { 203 autorest.Response `json:"-"` 204 // CloudEndpointProperties - Cloud Endpoint properties. 205 *CloudEndpointProperties `json:"properties,omitempty"` 206 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 207 ID *string `json:"id,omitempty"` 208 // Name - READ-ONLY; The name of the resource 209 Name *string `json:"name,omitempty"` 210 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 211 Type *string `json:"type,omitempty"` 212} 213 214// MarshalJSON is the custom marshaler for CloudEndpoint. 215func (ce CloudEndpoint) MarshalJSON() ([]byte, error) { 216 objectMap := make(map[string]interface{}) 217 if ce.CloudEndpointProperties != nil { 218 objectMap["properties"] = ce.CloudEndpointProperties 219 } 220 return json.Marshal(objectMap) 221} 222 223// UnmarshalJSON is the custom unmarshaler for CloudEndpoint struct. 224func (ce *CloudEndpoint) UnmarshalJSON(body []byte) error { 225 var m map[string]*json.RawMessage 226 err := json.Unmarshal(body, &m) 227 if err != nil { 228 return err 229 } 230 for k, v := range m { 231 switch k { 232 case "properties": 233 if v != nil { 234 var cloudEndpointProperties CloudEndpointProperties 235 err = json.Unmarshal(*v, &cloudEndpointProperties) 236 if err != nil { 237 return err 238 } 239 ce.CloudEndpointProperties = &cloudEndpointProperties 240 } 241 case "id": 242 if v != nil { 243 var ID string 244 err = json.Unmarshal(*v, &ID) 245 if err != nil { 246 return err 247 } 248 ce.ID = &ID 249 } 250 case "name": 251 if v != nil { 252 var name string 253 err = json.Unmarshal(*v, &name) 254 if err != nil { 255 return err 256 } 257 ce.Name = &name 258 } 259 case "type": 260 if v != nil { 261 var typeVar string 262 err = json.Unmarshal(*v, &typeVar) 263 if err != nil { 264 return err 265 } 266 ce.Type = &typeVar 267 } 268 } 269 } 270 271 return nil 272} 273 274// CloudEndpointArray array of CloudEndpoint 275type CloudEndpointArray struct { 276 autorest.Response `json:"-"` 277 // Value - Collection of CloudEndpoint. 278 Value *[]CloudEndpoint `json:"value,omitempty"` 279} 280 281// CloudEndpointCreateParameters the parameters used when creating a storage sync service. 282type CloudEndpointCreateParameters struct { 283 // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. 284 Location *string `json:"location,omitempty"` 285 // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. 286 Tags map[string]*string `json:"tags"` 287 // CloudEndpointCreateParametersProperties - The parameters used to create the storage sync service. 288 *CloudEndpointCreateParametersProperties `json:"properties,omitempty"` 289} 290 291// MarshalJSON is the custom marshaler for CloudEndpointCreateParameters. 292func (cecp CloudEndpointCreateParameters) MarshalJSON() ([]byte, error) { 293 objectMap := make(map[string]interface{}) 294 if cecp.Location != nil { 295 objectMap["location"] = cecp.Location 296 } 297 if cecp.Tags != nil { 298 objectMap["tags"] = cecp.Tags 299 } 300 if cecp.CloudEndpointCreateParametersProperties != nil { 301 objectMap["properties"] = cecp.CloudEndpointCreateParametersProperties 302 } 303 return json.Marshal(objectMap) 304} 305 306// UnmarshalJSON is the custom unmarshaler for CloudEndpointCreateParameters struct. 307func (cecp *CloudEndpointCreateParameters) UnmarshalJSON(body []byte) error { 308 var m map[string]*json.RawMessage 309 err := json.Unmarshal(body, &m) 310 if err != nil { 311 return err 312 } 313 for k, v := range m { 314 switch k { 315 case "location": 316 if v != nil { 317 var location string 318 err = json.Unmarshal(*v, &location) 319 if err != nil { 320 return err 321 } 322 cecp.Location = &location 323 } 324 case "tags": 325 if v != nil { 326 var tags map[string]*string 327 err = json.Unmarshal(*v, &tags) 328 if err != nil { 329 return err 330 } 331 cecp.Tags = tags 332 } 333 case "properties": 334 if v != nil { 335 var cloudEndpointCreateParametersProperties CloudEndpointCreateParametersProperties 336 err = json.Unmarshal(*v, &cloudEndpointCreateParametersProperties) 337 if err != nil { 338 return err 339 } 340 cecp.CloudEndpointCreateParametersProperties = &cloudEndpointCreateParametersProperties 341 } 342 } 343 } 344 345 return nil 346} 347 348// CloudEndpointCreateParametersProperties cloudEndpoint Properties object. 349type CloudEndpointCreateParametersProperties struct { 350 // StorageAccountResourceID - Storage Account Resource Id 351 StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` 352 // StorageAccountShareName - Storage Account Share name 353 StorageAccountShareName *string `json:"storageAccountShareName,omitempty"` 354 // StorageAccountTenantID - Storage Account Tenant Id 355 StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"` 356} 357 358// CloudEndpointProperties cloudEndpoint Properties object. 359type CloudEndpointProperties struct { 360 // StorageAccountResourceID - Storage Account Resource Id 361 StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` 362 // StorageAccountShareName - Storage Account Share name 363 StorageAccountShareName *string `json:"storageAccountShareName,omitempty"` 364 // StorageAccountTenantID - Storage Account Tenant Id 365 StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"` 366 // PartnershipID - Partnership Id 367 PartnershipID *string `json:"partnershipId,omitempty"` 368 // FriendlyName - Friendly Name 369 FriendlyName *string `json:"friendlyName,omitempty"` 370 // BackupEnabled - READ-ONLY; Backup Enabled 371 BackupEnabled *bool `json:"backupEnabled,omitempty"` 372 // ProvisioningState - CloudEndpoint Provisioning State 373 ProvisioningState *string `json:"provisioningState,omitempty"` 374 // LastWorkflowID - CloudEndpoint lastWorkflowId 375 LastWorkflowID *string `json:"lastWorkflowId,omitempty"` 376 // LastOperationName - Resource Last Operation Name 377 LastOperationName *string `json:"lastOperationName,omitempty"` 378} 379 380// CloudEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 381// operation. 382type CloudEndpointsCreateFuture struct { 383 azure.Future 384} 385 386// Result returns the result of the asynchronous operation. 387// If the operation has not completed it will return an error. 388func (future *CloudEndpointsCreateFuture) Result(client CloudEndpointsClient) (ce CloudEndpoint, err error) { 389 var done bool 390 done, err = future.DoneWithContext(context.Background(), client) 391 if err != nil { 392 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", future.Response(), "Polling failure") 393 return 394 } 395 if !done { 396 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsCreateFuture") 397 return 398 } 399 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 400 if ce.Response.Response, err = future.GetResult(sender); err == nil && ce.Response.Response.StatusCode != http.StatusNoContent { 401 ce, err = client.CreateResponder(ce.Response.Response) 402 if err != nil { 403 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", ce.Response.Response, "Failure responding to request") 404 } 405 } 406 return 407} 408 409// CloudEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 410// operation. 411type CloudEndpointsDeleteFuture struct { 412 azure.Future 413} 414 415// Result returns the result of the asynchronous operation. 416// If the operation has not completed it will return an error. 417func (future *CloudEndpointsDeleteFuture) Result(client CloudEndpointsClient) (ar autorest.Response, err error) { 418 var done bool 419 done, err = future.DoneWithContext(context.Background(), client) 420 if err != nil { 421 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") 422 return 423 } 424 if !done { 425 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsDeleteFuture") 426 return 427 } 428 ar.Response = future.Response() 429 return 430} 431 432// CloudEndpointsPostBackupFuture an abstraction for monitoring and retrieving the results of a 433// long-running operation. 434type CloudEndpointsPostBackupFuture struct { 435 azure.Future 436} 437 438// Result returns the result of the asynchronous operation. 439// If the operation has not completed it will return an error. 440func (future *CloudEndpointsPostBackupFuture) Result(client CloudEndpointsClient) (pbr PostBackupResponse, err error) { 441 var done bool 442 done, err = future.DoneWithContext(context.Background(), client) 443 if err != nil { 444 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", future.Response(), "Polling failure") 445 return 446 } 447 if !done { 448 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostBackupFuture") 449 return 450 } 451 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 452 if pbr.Response.Response, err = future.GetResult(sender); err == nil && pbr.Response.Response.StatusCode != http.StatusNoContent { 453 pbr, err = client.PostBackupResponder(pbr.Response.Response) 454 if err != nil { 455 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", pbr.Response.Response, "Failure responding to request") 456 } 457 } 458 return 459} 460 461// CloudEndpointsPostRestoreFuture an abstraction for monitoring and retrieving the results of a 462// long-running operation. 463type CloudEndpointsPostRestoreFuture struct { 464 azure.Future 465} 466 467// Result returns the result of the asynchronous operation. 468// If the operation has not completed it will return an error. 469func (future *CloudEndpointsPostRestoreFuture) Result(client CloudEndpointsClient) (ar autorest.Response, err error) { 470 var done bool 471 done, err = future.DoneWithContext(context.Background(), client) 472 if err != nil { 473 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostRestoreFuture", "Result", future.Response(), "Polling failure") 474 return 475 } 476 if !done { 477 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostRestoreFuture") 478 return 479 } 480 ar.Response = future.Response() 481 return 482} 483 484// CloudEndpointsPreBackupFuture an abstraction for monitoring and retrieving the results of a long-running 485// operation. 486type CloudEndpointsPreBackupFuture struct { 487 azure.Future 488} 489 490// Result returns the result of the asynchronous operation. 491// If the operation has not completed it will return an error. 492func (future *CloudEndpointsPreBackupFuture) Result(client CloudEndpointsClient) (ar autorest.Response, err error) { 493 var done bool 494 done, err = future.DoneWithContext(context.Background(), client) 495 if err != nil { 496 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreBackupFuture", "Result", future.Response(), "Polling failure") 497 return 498 } 499 if !done { 500 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreBackupFuture") 501 return 502 } 503 ar.Response = future.Response() 504 return 505} 506 507// CloudEndpointsPreRestoreFuture an abstraction for monitoring and retrieving the results of a 508// long-running operation. 509type CloudEndpointsPreRestoreFuture struct { 510 azure.Future 511} 512 513// Result returns the result of the asynchronous operation. 514// If the operation has not completed it will return an error. 515func (future *CloudEndpointsPreRestoreFuture) Result(client CloudEndpointsClient) (ar autorest.Response, err error) { 516 var done bool 517 done, err = future.DoneWithContext(context.Background(), client) 518 if err != nil { 519 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreRestoreFuture", "Result", future.Response(), "Polling failure") 520 return 521 } 522 if !done { 523 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreRestoreFuture") 524 return 525 } 526 ar.Response = future.Response() 527 return 528} 529 530// Error error type 531type Error struct { 532 // Error - Error details of the given entry. 533 Error *APIError `json:"error,omitempty"` 534 // Innererror - Error details of the given entry. 535 Innererror *APIError `json:"innererror,omitempty"` 536} 537 538// ErrorDetails error Details object. 539type ErrorDetails struct { 540 // Code - Error code of the given entry. 541 Code *string `json:"code,omitempty"` 542 // Message - Error message of the given entry. 543 Message *string `json:"message,omitempty"` 544 // Target - Target of the given entry. 545 Target *string `json:"target,omitempty"` 546} 547 548// OperationDisplayInfo the operation supported by storage sync. 549type OperationDisplayInfo struct { 550 // Description - The description of the operation. 551 Description *string `json:"description,omitempty"` 552 // Operation - The action that users can perform, based on their permission level. 553 Operation *string `json:"operation,omitempty"` 554 // Provider - Service provider: Microsoft StorageSync. 555 Provider *string `json:"provider,omitempty"` 556 // Resource - Resource on which the operation is performed. 557 Resource *string `json:"resource,omitempty"` 558} 559 560// OperationDisplayResource operation Display Resource object. 561type OperationDisplayResource struct { 562 // Provider - Operation Display Resource Provider. 563 Provider *string `json:"provider,omitempty"` 564 // Resource - Operation Display Resource. 565 Resource *string `json:"resource,omitempty"` 566 // Operation - Operation Display Resource Operation. 567 Operation *string `json:"operation,omitempty"` 568 // Description - Operation Display Resource Description. 569 Description *string `json:"description,omitempty"` 570} 571 572// OperationEntity the operation supported by storage sync. 573type OperationEntity struct { 574 // Name - Operation name: {provider}/{resource}/{operation}. 575 Name *string `json:"name,omitempty"` 576 // Display - The operation supported by storage sync. 577 Display *OperationDisplayInfo `json:"display,omitempty"` 578 // Origin - The origin. 579 Origin *string `json:"origin,omitempty"` 580} 581 582// OperationEntityListResult the list of storage sync operations. 583type OperationEntityListResult struct { 584 autorest.Response `json:"-"` 585 // NextLink - The link used to get the next page of operations. 586 NextLink *string `json:"nextLink,omitempty"` 587 // Value - The list of operations. 588 Value *[]OperationEntity `json:"value,omitempty"` 589} 590 591// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values. 592type OperationEntityListResultIterator struct { 593 i int 594 page OperationEntityListResultPage 595} 596 597// NextWithContext advances to the next value. If there was an error making 598// the request the iterator does not advance and the error is returned. 599func (iter *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) { 600 if tracing.IsEnabled() { 601 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.NextWithContext") 602 defer func() { 603 sc := -1 604 if iter.Response().Response.Response != nil { 605 sc = iter.Response().Response.Response.StatusCode 606 } 607 tracing.EndSpan(ctx, sc, err) 608 }() 609 } 610 iter.i++ 611 if iter.i < len(iter.page.Values()) { 612 return nil 613 } 614 err = iter.page.NextWithContext(ctx) 615 if err != nil { 616 iter.i-- 617 return err 618 } 619 iter.i = 0 620 return nil 621} 622 623// Next advances to the next value. If there was an error making 624// the request the iterator does not advance and the error is returned. 625// Deprecated: Use NextWithContext() instead. 626func (iter *OperationEntityListResultIterator) Next() error { 627 return iter.NextWithContext(context.Background()) 628} 629 630// NotDone returns true if the enumeration should be started or is not yet complete. 631func (iter OperationEntityListResultIterator) NotDone() bool { 632 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 633} 634 635// Response returns the raw server response from the last page request. 636func (iter OperationEntityListResultIterator) Response() OperationEntityListResult { 637 return iter.page.Response() 638} 639 640// Value returns the current value or a zero-initialized value if the 641// iterator has advanced beyond the end of the collection. 642func (iter OperationEntityListResultIterator) Value() OperationEntity { 643 if !iter.page.NotDone() { 644 return OperationEntity{} 645 } 646 return iter.page.Values()[iter.i] 647} 648 649// Creates a new instance of the OperationEntityListResultIterator type. 650func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator { 651 return OperationEntityListResultIterator{page: page} 652} 653 654// IsEmpty returns true if the ListResult contains no values. 655func (oelr OperationEntityListResult) IsEmpty() bool { 656 return oelr.Value == nil || len(*oelr.Value) == 0 657} 658 659// operationEntityListResultPreparer prepares a request to retrieve the next set of results. 660// It returns nil if no more results exist. 661func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) { 662 if oelr.NextLink == nil || len(to.String(oelr.NextLink)) < 1 { 663 return nil, nil 664 } 665 return autorest.Prepare((&http.Request{}).WithContext(ctx), 666 autorest.AsJSON(), 667 autorest.AsGet(), 668 autorest.WithBaseURL(to.String(oelr.NextLink))) 669} 670 671// OperationEntityListResultPage contains a page of OperationEntity values. 672type OperationEntityListResultPage struct { 673 fn func(context.Context, OperationEntityListResult) (OperationEntityListResult, error) 674 oelr OperationEntityListResult 675} 676 677// NextWithContext advances to the next page of values. If there was an error making 678// the request the page does not advance and the error is returned. 679func (page *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) { 680 if tracing.IsEnabled() { 681 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext") 682 defer func() { 683 sc := -1 684 if page.Response().Response.Response != nil { 685 sc = page.Response().Response.Response.StatusCode 686 } 687 tracing.EndSpan(ctx, sc, err) 688 }() 689 } 690 next, err := page.fn(ctx, page.oelr) 691 if err != nil { 692 return err 693 } 694 page.oelr = next 695 return nil 696} 697 698// Next advances to the next page of values. If there was an error making 699// the request the page does not advance and the error is returned. 700// Deprecated: Use NextWithContext() instead. 701func (page *OperationEntityListResultPage) Next() error { 702 return page.NextWithContext(context.Background()) 703} 704 705// NotDone returns true if the page enumeration should be started or is not yet complete. 706func (page OperationEntityListResultPage) NotDone() bool { 707 return !page.oelr.IsEmpty() 708} 709 710// Response returns the raw server response from the last page request. 711func (page OperationEntityListResultPage) Response() OperationEntityListResult { 712 return page.oelr 713} 714 715// Values returns the slice of values for the current page or nil if there are no values. 716func (page OperationEntityListResultPage) Values() []OperationEntity { 717 if page.oelr.IsEmpty() { 718 return nil 719 } 720 return *page.oelr.Value 721} 722 723// Creates a new instance of the OperationEntityListResultPage type. 724func NewOperationEntityListResultPage(getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { 725 return OperationEntityListResultPage{fn: getNextPage} 726} 727 728// PostBackupResponse post Backup Response 729type PostBackupResponse struct { 730 autorest.Response `json:"-"` 731 // PostBackupResponseProperties - Post Backup Response Properties 732 *PostBackupResponseProperties `json:"backupMetadata,omitempty"` 733} 734 735// MarshalJSON is the custom marshaler for PostBackupResponse. 736func (pbr PostBackupResponse) MarshalJSON() ([]byte, error) { 737 objectMap := make(map[string]interface{}) 738 if pbr.PostBackupResponseProperties != nil { 739 objectMap["backupMetadata"] = pbr.PostBackupResponseProperties 740 } 741 return json.Marshal(objectMap) 742} 743 744// UnmarshalJSON is the custom unmarshaler for PostBackupResponse struct. 745func (pbr *PostBackupResponse) UnmarshalJSON(body []byte) error { 746 var m map[string]*json.RawMessage 747 err := json.Unmarshal(body, &m) 748 if err != nil { 749 return err 750 } 751 for k, v := range m { 752 switch k { 753 case "backupMetadata": 754 if v != nil { 755 var postBackupResponseProperties PostBackupResponseProperties 756 err = json.Unmarshal(*v, &postBackupResponseProperties) 757 if err != nil { 758 return err 759 } 760 pbr.PostBackupResponseProperties = &postBackupResponseProperties 761 } 762 } 763 } 764 765 return nil 766} 767 768// PostBackupResponseProperties post Backup Response Properties object. 769type PostBackupResponseProperties struct { 770 // CloudEndpointName - READ-ONLY; cloud endpoint Name. 771 CloudEndpointName *string `json:"cloudEndpointName,omitempty"` 772} 773 774// PostRestoreRequest post Restore Request 775type PostRestoreRequest struct { 776 // Partition - Post Restore partition. 777 Partition *string `json:"partition,omitempty"` 778 // ReplicaGroup - Post Restore replica group. 779 ReplicaGroup *string `json:"replicaGroup,omitempty"` 780 // RequestID - Post Restore request id. 781 RequestID *string `json:"requestId,omitempty"` 782 // AzureFileShareURI - Post Restore Azure file share uri. 783 AzureFileShareURI *string `json:"azureFileShareUri,omitempty"` 784 // Status - Post Restore Azure status. 785 Status *string `json:"status,omitempty"` 786 // SourceAzureFileShareURI - Post Restore Azure source azure file share uri. 787 SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"` 788 // FailedFileList - Post Restore Azure failed file list. 789 FailedFileList *string `json:"failedFileList,omitempty"` 790 // RestoreFileSpec - Post Restore restore file spec array. 791 RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"` 792} 793 794// PreRestoreRequest pre Restore request object. 795type PreRestoreRequest struct { 796 // Partition - Pre Restore partition. 797 Partition *string `json:"partition,omitempty"` 798 // ReplicaGroup - Pre Restore replica group. 799 ReplicaGroup *string `json:"replicaGroup,omitempty"` 800 // RequestID - Pre Restore request id. 801 RequestID *string `json:"requestId,omitempty"` 802 // AzureFileShareURI - Pre Restore Azure file share uri. 803 AzureFileShareURI *string `json:"azureFileShareUri,omitempty"` 804 // Status - Pre Restore Azure status. 805 Status *string `json:"status,omitempty"` 806 // SourceAzureFileShareURI - Pre Restore Azure source azure file share uri. 807 SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"` 808 // BackupMetadataPropertyBag - Pre Restore backup metadata property bag. 809 BackupMetadataPropertyBag *string `json:"backupMetadataPropertyBag,omitempty"` 810 // RestoreFileSpec - Pre Restore restore file spec array. 811 RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"` 812 // PauseWaitForSyncDrainTimePeriodInSeconds - Pre Restore pause wait for sync drain time period in seconds. 813 PauseWaitForSyncDrainTimePeriodInSeconds *int32 `json:"pauseWaitForSyncDrainTimePeriodInSeconds,omitempty"` 814} 815 816// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than 817// required location and tags 818type ProxyResource struct { 819 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 820 ID *string `json:"id,omitempty"` 821 // Name - READ-ONLY; The name of the resource 822 Name *string `json:"name,omitempty"` 823 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 824 Type *string `json:"type,omitempty"` 825} 826 827// RecallActionParameters the parameters used when calling recall action on server endpoint. 828type RecallActionParameters struct { 829 // Pattern - Pattern of the files. 830 Pattern *string `json:"pattern,omitempty"` 831 // RecallPath - Recall path. 832 RecallPath *string `json:"recallPath,omitempty"` 833} 834 835// RegisteredServer registered Server resource. 836type RegisteredServer struct { 837 autorest.Response `json:"-"` 838 // RegisteredServerProperties - RegisteredServer properties. 839 *RegisteredServerProperties `json:"properties,omitempty"` 840 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 841 ID *string `json:"id,omitempty"` 842 // Name - READ-ONLY; The name of the resource 843 Name *string `json:"name,omitempty"` 844 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 845 Type *string `json:"type,omitempty"` 846} 847 848// MarshalJSON is the custom marshaler for RegisteredServer. 849func (rs RegisteredServer) MarshalJSON() ([]byte, error) { 850 objectMap := make(map[string]interface{}) 851 if rs.RegisteredServerProperties != nil { 852 objectMap["properties"] = rs.RegisteredServerProperties 853 } 854 return json.Marshal(objectMap) 855} 856 857// UnmarshalJSON is the custom unmarshaler for RegisteredServer struct. 858func (rs *RegisteredServer) UnmarshalJSON(body []byte) error { 859 var m map[string]*json.RawMessage 860 err := json.Unmarshal(body, &m) 861 if err != nil { 862 return err 863 } 864 for k, v := range m { 865 switch k { 866 case "properties": 867 if v != nil { 868 var registeredServerProperties RegisteredServerProperties 869 err = json.Unmarshal(*v, ®isteredServerProperties) 870 if err != nil { 871 return err 872 } 873 rs.RegisteredServerProperties = ®isteredServerProperties 874 } 875 case "id": 876 if v != nil { 877 var ID string 878 err = json.Unmarshal(*v, &ID) 879 if err != nil { 880 return err 881 } 882 rs.ID = &ID 883 } 884 case "name": 885 if v != nil { 886 var name string 887 err = json.Unmarshal(*v, &name) 888 if err != nil { 889 return err 890 } 891 rs.Name = &name 892 } 893 case "type": 894 if v != nil { 895 var typeVar string 896 err = json.Unmarshal(*v, &typeVar) 897 if err != nil { 898 return err 899 } 900 rs.Type = &typeVar 901 } 902 } 903 } 904 905 return nil 906} 907 908// RegisteredServerArray array of RegisteredServer 909type RegisteredServerArray struct { 910 autorest.Response `json:"-"` 911 // Value - Collection of Registered Server. 912 Value *[]RegisteredServer `json:"value,omitempty"` 913} 914 915// RegisteredServerCreateParameters the parameters used when creating a storage sync service. 916type RegisteredServerCreateParameters struct { 917 // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. 918 Location *string `json:"location,omitempty"` 919 // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. 920 Tags map[string]*string `json:"tags"` 921 // RegisteredServerCreateParametersProperties - The parameters used to create the storage sync service. 922 *RegisteredServerCreateParametersProperties `json:"properties,omitempty"` 923} 924 925// MarshalJSON is the custom marshaler for RegisteredServerCreateParameters. 926func (rscp RegisteredServerCreateParameters) MarshalJSON() ([]byte, error) { 927 objectMap := make(map[string]interface{}) 928 if rscp.Location != nil { 929 objectMap["location"] = rscp.Location 930 } 931 if rscp.Tags != nil { 932 objectMap["tags"] = rscp.Tags 933 } 934 if rscp.RegisteredServerCreateParametersProperties != nil { 935 objectMap["properties"] = rscp.RegisteredServerCreateParametersProperties 936 } 937 return json.Marshal(objectMap) 938} 939 940// UnmarshalJSON is the custom unmarshaler for RegisteredServerCreateParameters struct. 941func (rscp *RegisteredServerCreateParameters) UnmarshalJSON(body []byte) error { 942 var m map[string]*json.RawMessage 943 err := json.Unmarshal(body, &m) 944 if err != nil { 945 return err 946 } 947 for k, v := range m { 948 switch k { 949 case "location": 950 if v != nil { 951 var location string 952 err = json.Unmarshal(*v, &location) 953 if err != nil { 954 return err 955 } 956 rscp.Location = &location 957 } 958 case "tags": 959 if v != nil { 960 var tags map[string]*string 961 err = json.Unmarshal(*v, &tags) 962 if err != nil { 963 return err 964 } 965 rscp.Tags = tags 966 } 967 case "properties": 968 if v != nil { 969 var registeredServerCreateParametersProperties RegisteredServerCreateParametersProperties 970 err = json.Unmarshal(*v, ®isteredServerCreateParametersProperties) 971 if err != nil { 972 return err 973 } 974 rscp.RegisteredServerCreateParametersProperties = ®isteredServerCreateParametersProperties 975 } 976 } 977 } 978 979 return nil 980} 981 982// RegisteredServerCreateParametersProperties registeredServer Properties object. 983type RegisteredServerCreateParametersProperties struct { 984 // ServerCertificate - Registered Server Certificate 985 ServerCertificate *string `json:"serverCertificate,omitempty"` 986 // AgentVersion - Registered Server Agent Version 987 AgentVersion *string `json:"agentVersion,omitempty"` 988 // ServerOSVersion - Registered Server OS Version 989 ServerOSVersion *string `json:"serverOSVersion,omitempty"` 990 // LastHeartBeat - Registered Server last heart beat 991 LastHeartBeat *string `json:"lastHeartBeat,omitempty"` 992 // ServerRole - Registered Server serverRole 993 ServerRole *string `json:"serverRole,omitempty"` 994 // ClusterID - Registered Server clusterId 995 ClusterID *string `json:"clusterId,omitempty"` 996 // ClusterName - Registered Server clusterName 997 ClusterName *string `json:"clusterName,omitempty"` 998 // ServerID - Registered Server serverId 999 ServerID *string `json:"serverId,omitempty"` 1000 // FriendlyName - Friendly Name 1001 FriendlyName *string `json:"friendlyName,omitempty"` 1002} 1003 1004// RegisteredServerProperties registeredServer Properties object. 1005type RegisteredServerProperties struct { 1006 // ServerCertificate - Registered Server Certificate 1007 ServerCertificate *string `json:"serverCertificate,omitempty"` 1008 // AgentVersion - Registered Server Agent Version 1009 AgentVersion *string `json:"agentVersion,omitempty"` 1010 // ServerOSVersion - Registered Server OS Version 1011 ServerOSVersion *string `json:"serverOSVersion,omitempty"` 1012 // ServerManagementtErrorCode - Registered Server Management Error Code 1013 ServerManagementtErrorCode *int32 `json:"serverManagementtErrorCode,omitempty"` 1014 // LastHeartBeat - Registered Server last heart beat 1015 LastHeartBeat *string `json:"lastHeartBeat,omitempty"` 1016 // ProvisioningState - Registered Server Provisioning State 1017 ProvisioningState *string `json:"provisioningState,omitempty"` 1018 // ServerRole - Registered Server serverRole 1019 ServerRole *string `json:"serverRole,omitempty"` 1020 // ClusterID - Registered Server clusterId 1021 ClusterID *string `json:"clusterId,omitempty"` 1022 // ClusterName - Registered Server clusterName 1023 ClusterName *string `json:"clusterName,omitempty"` 1024 // ServerID - Registered Server serverId 1025 ServerID *string `json:"serverId,omitempty"` 1026 // StorageSyncServiceUID - Registered Server storageSyncServiceUid 1027 StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"` 1028 // LastWorkflowID - Registered Server lastWorkflowId 1029 LastWorkflowID *string `json:"lastWorkflowId,omitempty"` 1030 // LastOperationName - Resource Last Operation Name 1031 LastOperationName *string `json:"lastOperationName,omitempty"` 1032 // DiscoveryEndpointURI - Resource discoveryEndpointUri 1033 DiscoveryEndpointURI *string `json:"discoveryEndpointUri,omitempty"` 1034 // ResourceLocation - Resource Location 1035 ResourceLocation *string `json:"resourceLocation,omitempty"` 1036 // ServiceLocation - Service Location 1037 ServiceLocation *string `json:"serviceLocation,omitempty"` 1038 // FriendlyName - Friendly Name 1039 FriendlyName *string `json:"friendlyName,omitempty"` 1040 // ManagementEndpointURI - Management Endpoint Uri 1041 ManagementEndpointURI *string `json:"managementEndpointUri,omitempty"` 1042} 1043 1044// RegisteredServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1045// operation. 1046type RegisteredServersCreateFuture struct { 1047 azure.Future 1048} 1049 1050// Result returns the result of the asynchronous operation. 1051// If the operation has not completed it will return an error. 1052func (future *RegisteredServersCreateFuture) Result(client RegisteredServersClient) (rs RegisteredServer, err error) { 1053 var done bool 1054 done, err = future.DoneWithContext(context.Background(), client) 1055 if err != nil { 1056 err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", future.Response(), "Polling failure") 1057 return 1058 } 1059 if !done { 1060 err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersCreateFuture") 1061 return 1062 } 1063 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1064 if rs.Response.Response, err = future.GetResult(sender); err == nil && rs.Response.Response.StatusCode != http.StatusNoContent { 1065 rs, err = client.CreateResponder(rs.Response.Response) 1066 if err != nil { 1067 err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", rs.Response.Response, "Failure responding to request") 1068 } 1069 } 1070 return 1071} 1072 1073// RegisteredServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1074// operation. 1075type RegisteredServersDeleteFuture struct { 1076 azure.Future 1077} 1078 1079// Result returns the result of the asynchronous operation. 1080// If the operation has not completed it will return an error. 1081func (future *RegisteredServersDeleteFuture) Result(client RegisteredServersClient) (ar autorest.Response, err error) { 1082 var done bool 1083 done, err = future.DoneWithContext(context.Background(), client) 1084 if err != nil { 1085 err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersDeleteFuture", "Result", future.Response(), "Polling failure") 1086 return 1087 } 1088 if !done { 1089 err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersDeleteFuture") 1090 return 1091 } 1092 ar.Response = future.Response() 1093 return 1094} 1095 1096// Resource ... 1097type Resource struct { 1098 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1099 ID *string `json:"id,omitempty"` 1100 // Name - READ-ONLY; The name of the resource 1101 Name *string `json:"name,omitempty"` 1102 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 1103 Type *string `json:"type,omitempty"` 1104} 1105 1106// ResourcesMoveInfo resource Move Info. 1107type ResourcesMoveInfo struct { 1108 // TargetResourceGroup - Target resource group. 1109 TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` 1110 // Resources - Collection of Resources. 1111 Resources *[]string `json:"resources,omitempty"` 1112} 1113 1114// RestoreFileSpec restore file spec. 1115type RestoreFileSpec struct { 1116 // Path - Restore file spec path 1117 Path *string `json:"path,omitempty"` 1118 // Isdir - READ-ONLY; Restore file spec isdir 1119 Isdir *bool `json:"isdir,omitempty"` 1120} 1121 1122// ServerEndpoint server Endpoint object. 1123type ServerEndpoint struct { 1124 autorest.Response `json:"-"` 1125 // ServerEndpointProperties - Server Endpoint properties. 1126 *ServerEndpointProperties `json:"properties,omitempty"` 1127 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1128 ID *string `json:"id,omitempty"` 1129 // Name - READ-ONLY; The name of the resource 1130 Name *string `json:"name,omitempty"` 1131 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 1132 Type *string `json:"type,omitempty"` 1133} 1134 1135// MarshalJSON is the custom marshaler for ServerEndpoint. 1136func (se ServerEndpoint) MarshalJSON() ([]byte, error) { 1137 objectMap := make(map[string]interface{}) 1138 if se.ServerEndpointProperties != nil { 1139 objectMap["properties"] = se.ServerEndpointProperties 1140 } 1141 return json.Marshal(objectMap) 1142} 1143 1144// UnmarshalJSON is the custom unmarshaler for ServerEndpoint struct. 1145func (se *ServerEndpoint) UnmarshalJSON(body []byte) error { 1146 var m map[string]*json.RawMessage 1147 err := json.Unmarshal(body, &m) 1148 if err != nil { 1149 return err 1150 } 1151 for k, v := range m { 1152 switch k { 1153 case "properties": 1154 if v != nil { 1155 var serverEndpointProperties ServerEndpointProperties 1156 err = json.Unmarshal(*v, &serverEndpointProperties) 1157 if err != nil { 1158 return err 1159 } 1160 se.ServerEndpointProperties = &serverEndpointProperties 1161 } 1162 case "id": 1163 if v != nil { 1164 var ID string 1165 err = json.Unmarshal(*v, &ID) 1166 if err != nil { 1167 return err 1168 } 1169 se.ID = &ID 1170 } 1171 case "name": 1172 if v != nil { 1173 var name string 1174 err = json.Unmarshal(*v, &name) 1175 if err != nil { 1176 return err 1177 } 1178 se.Name = &name 1179 } 1180 case "type": 1181 if v != nil { 1182 var typeVar string 1183 err = json.Unmarshal(*v, &typeVar) 1184 if err != nil { 1185 return err 1186 } 1187 se.Type = &typeVar 1188 } 1189 } 1190 } 1191 1192 return nil 1193} 1194 1195// ServerEndpointArray array of ServerEndpoint 1196type ServerEndpointArray struct { 1197 autorest.Response `json:"-"` 1198 // Value - Collection of ServerEndpoint. 1199 Value *[]ServerEndpoint `json:"value,omitempty"` 1200} 1201 1202// ServerEndpointCreateParameters the parameters used when creating a storage sync service. 1203type ServerEndpointCreateParameters struct { 1204 // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. 1205 Location *string `json:"location,omitempty"` 1206 // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. 1207 Tags map[string]*string `json:"tags"` 1208 // ServerEndpointCreateParametersProperties - The parameters used to create the storage sync service. 1209 *ServerEndpointCreateParametersProperties `json:"properties,omitempty"` 1210} 1211 1212// MarshalJSON is the custom marshaler for ServerEndpointCreateParameters. 1213func (secp ServerEndpointCreateParameters) MarshalJSON() ([]byte, error) { 1214 objectMap := make(map[string]interface{}) 1215 if secp.Location != nil { 1216 objectMap["location"] = secp.Location 1217 } 1218 if secp.Tags != nil { 1219 objectMap["tags"] = secp.Tags 1220 } 1221 if secp.ServerEndpointCreateParametersProperties != nil { 1222 objectMap["properties"] = secp.ServerEndpointCreateParametersProperties 1223 } 1224 return json.Marshal(objectMap) 1225} 1226 1227// UnmarshalJSON is the custom unmarshaler for ServerEndpointCreateParameters struct. 1228func (secp *ServerEndpointCreateParameters) UnmarshalJSON(body []byte) error { 1229 var m map[string]*json.RawMessage 1230 err := json.Unmarshal(body, &m) 1231 if err != nil { 1232 return err 1233 } 1234 for k, v := range m { 1235 switch k { 1236 case "location": 1237 if v != nil { 1238 var location string 1239 err = json.Unmarshal(*v, &location) 1240 if err != nil { 1241 return err 1242 } 1243 secp.Location = &location 1244 } 1245 case "tags": 1246 if v != nil { 1247 var tags map[string]*string 1248 err = json.Unmarshal(*v, &tags) 1249 if err != nil { 1250 return err 1251 } 1252 secp.Tags = tags 1253 } 1254 case "properties": 1255 if v != nil { 1256 var serverEndpointCreateParametersProperties ServerEndpointCreateParametersProperties 1257 err = json.Unmarshal(*v, &serverEndpointCreateParametersProperties) 1258 if err != nil { 1259 return err 1260 } 1261 secp.ServerEndpointCreateParametersProperties = &serverEndpointCreateParametersProperties 1262 } 1263 } 1264 } 1265 1266 return nil 1267} 1268 1269// ServerEndpointCreateParametersProperties serverEndpoint Properties object. 1270type ServerEndpointCreateParametersProperties struct { 1271 // ServerLocalPath - Server Local path. 1272 ServerLocalPath *string `json:"serverLocalPath,omitempty"` 1273 // CloudTiering - Cloud Tiering. Possible values include: 'On', 'Off' 1274 CloudTiering CloudTiering `json:"cloudTiering,omitempty"` 1275 // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. 1276 VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` 1277 // FriendlyName - Friendly Name 1278 FriendlyName *string `json:"friendlyName,omitempty"` 1279 // ServerResourceID - Server Resource Id. 1280 ServerResourceID *string `json:"serverResourceId,omitempty"` 1281} 1282 1283// ServerEndpointProperties serverEndpoint Properties object. 1284type ServerEndpointProperties struct { 1285 // ServerLocalPath - Server Local path. 1286 ServerLocalPath *string `json:"serverLocalPath,omitempty"` 1287 // CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering2On', 'CloudTiering2Off' 1288 CloudTiering CloudTiering2 `json:"cloudTiering,omitempty"` 1289 // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. 1290 VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` 1291 // FriendlyName - Friendly Name 1292 FriendlyName *string `json:"friendlyName,omitempty"` 1293 // ServerResourceID - Server Resource Id. 1294 ServerResourceID *string `json:"serverResourceId,omitempty"` 1295 // ProvisioningState - ServerEndpoint Provisioning State 1296 ProvisioningState *string `json:"provisioningState,omitempty"` 1297 // LastWorkflowID - ServerEndpoint lastWorkflowId 1298 LastWorkflowID *string `json:"lastWorkflowId,omitempty"` 1299 // LastOperationName - Resource Last Operation Name 1300 LastOperationName *string `json:"lastOperationName,omitempty"` 1301 // SyncStatus - Sync Health Status 1302 SyncStatus interface{} `json:"syncStatus,omitempty"` 1303} 1304 1305// ServerEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1306// operation. 1307type ServerEndpointsCreateFuture struct { 1308 azure.Future 1309} 1310 1311// Result returns the result of the asynchronous operation. 1312// If the operation has not completed it will return an error. 1313func (future *ServerEndpointsCreateFuture) Result(client ServerEndpointsClient) (se ServerEndpoint, err error) { 1314 var done bool 1315 done, err = future.DoneWithContext(context.Background(), client) 1316 if err != nil { 1317 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", future.Response(), "Polling failure") 1318 return 1319 } 1320 if !done { 1321 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsCreateFuture") 1322 return 1323 } 1324 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1325 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { 1326 se, err = client.CreateResponder(se.Response.Response) 1327 if err != nil { 1328 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request") 1329 } 1330 } 1331 return 1332} 1333 1334// ServerEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1335// operation. 1336type ServerEndpointsDeleteFuture struct { 1337 azure.Future 1338} 1339 1340// Result returns the result of the asynchronous operation. 1341// If the operation has not completed it will return an error. 1342func (future *ServerEndpointsDeleteFuture) Result(client ServerEndpointsClient) (ar autorest.Response, err error) { 1343 var done bool 1344 done, err = future.DoneWithContext(context.Background(), client) 1345 if err != nil { 1346 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") 1347 return 1348 } 1349 if !done { 1350 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsDeleteFuture") 1351 return 1352 } 1353 ar.Response = future.Response() 1354 return 1355} 1356 1357// ServerEndpointsRecallActionFuture an abstraction for monitoring and retrieving the results of a 1358// long-running operation. 1359type ServerEndpointsRecallActionFuture struct { 1360 azure.Future 1361} 1362 1363// Result returns the result of the asynchronous operation. 1364// If the operation has not completed it will return an error. 1365func (future *ServerEndpointsRecallActionFuture) Result(client ServerEndpointsClient) (ar autorest.Response, err error) { 1366 var done bool 1367 done, err = future.DoneWithContext(context.Background(), client) 1368 if err != nil { 1369 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsRecallActionFuture", "Result", future.Response(), "Polling failure") 1370 return 1371 } 1372 if !done { 1373 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsRecallActionFuture") 1374 return 1375 } 1376 ar.Response = future.Response() 1377 return 1378} 1379 1380// ServerEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1381// operation. 1382type ServerEndpointsUpdateFuture struct { 1383 azure.Future 1384} 1385 1386// Result returns the result of the asynchronous operation. 1387// If the operation has not completed it will return an error. 1388func (future *ServerEndpointsUpdateFuture) Result(client ServerEndpointsClient) (se ServerEndpoint, err error) { 1389 var done bool 1390 done, err = future.DoneWithContext(context.Background(), client) 1391 if err != nil { 1392 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", future.Response(), "Polling failure") 1393 return 1394 } 1395 if !done { 1396 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsUpdateFuture") 1397 return 1398 } 1399 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1400 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { 1401 se, err = client.UpdateResponder(se.Response.Response) 1402 if err != nil { 1403 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request") 1404 } 1405 } 1406 return 1407} 1408 1409// ServerEndpointUpdateParameters parameters for updating an Server Endpoint. 1410type ServerEndpointUpdateParameters struct { 1411 // Tags - The user-specified tags associated with the server endpoint. 1412 Tags map[string]*string `json:"tags"` 1413 // ServerEndpointUpdateProperties - The properties of the server endpoint. 1414 *ServerEndpointUpdateProperties `json:"properties,omitempty"` 1415} 1416 1417// MarshalJSON is the custom marshaler for ServerEndpointUpdateParameters. 1418func (seup ServerEndpointUpdateParameters) MarshalJSON() ([]byte, error) { 1419 objectMap := make(map[string]interface{}) 1420 if seup.Tags != nil { 1421 objectMap["tags"] = seup.Tags 1422 } 1423 if seup.ServerEndpointUpdateProperties != nil { 1424 objectMap["properties"] = seup.ServerEndpointUpdateProperties 1425 } 1426 return json.Marshal(objectMap) 1427} 1428 1429// UnmarshalJSON is the custom unmarshaler for ServerEndpointUpdateParameters struct. 1430func (seup *ServerEndpointUpdateParameters) UnmarshalJSON(body []byte) error { 1431 var m map[string]*json.RawMessage 1432 err := json.Unmarshal(body, &m) 1433 if err != nil { 1434 return err 1435 } 1436 for k, v := range m { 1437 switch k { 1438 case "tags": 1439 if v != nil { 1440 var tags map[string]*string 1441 err = json.Unmarshal(*v, &tags) 1442 if err != nil { 1443 return err 1444 } 1445 seup.Tags = tags 1446 } 1447 case "properties": 1448 if v != nil { 1449 var serverEndpointUpdateProperties ServerEndpointUpdateProperties 1450 err = json.Unmarshal(*v, &serverEndpointUpdateProperties) 1451 if err != nil { 1452 return err 1453 } 1454 seup.ServerEndpointUpdateProperties = &serverEndpointUpdateProperties 1455 } 1456 } 1457 } 1458 1459 return nil 1460} 1461 1462// ServerEndpointUpdateProperties serverEndpoint Update Properties object. 1463type ServerEndpointUpdateProperties struct { 1464 // CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering1On', 'CloudTiering1Off' 1465 CloudTiering CloudTiering1 `json:"cloudTiering,omitempty"` 1466 // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. 1467 VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` 1468} 1469 1470// Service storage Sync Service object. 1471type Service struct { 1472 autorest.Response `json:"-"` 1473 // ServiceProperties - Storage Sync Service properties. 1474 *ServiceProperties `json:"properties,omitempty"` 1475 // Tags - Resource tags. 1476 Tags map[string]*string `json:"tags"` 1477 // Location - The geo-location where the resource lives 1478 Location *string `json:"location,omitempty"` 1479 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1480 ID *string `json:"id,omitempty"` 1481 // Name - READ-ONLY; The name of the resource 1482 Name *string `json:"name,omitempty"` 1483 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 1484 Type *string `json:"type,omitempty"` 1485} 1486 1487// MarshalJSON is the custom marshaler for Service. 1488func (s Service) MarshalJSON() ([]byte, error) { 1489 objectMap := make(map[string]interface{}) 1490 if s.ServiceProperties != nil { 1491 objectMap["properties"] = s.ServiceProperties 1492 } 1493 if s.Tags != nil { 1494 objectMap["tags"] = s.Tags 1495 } 1496 if s.Location != nil { 1497 objectMap["location"] = s.Location 1498 } 1499 return json.Marshal(objectMap) 1500} 1501 1502// UnmarshalJSON is the custom unmarshaler for Service struct. 1503func (s *Service) UnmarshalJSON(body []byte) error { 1504 var m map[string]*json.RawMessage 1505 err := json.Unmarshal(body, &m) 1506 if err != nil { 1507 return err 1508 } 1509 for k, v := range m { 1510 switch k { 1511 case "properties": 1512 if v != nil { 1513 var serviceProperties ServiceProperties 1514 err = json.Unmarshal(*v, &serviceProperties) 1515 if err != nil { 1516 return err 1517 } 1518 s.ServiceProperties = &serviceProperties 1519 } 1520 case "tags": 1521 if v != nil { 1522 var tags map[string]*string 1523 err = json.Unmarshal(*v, &tags) 1524 if err != nil { 1525 return err 1526 } 1527 s.Tags = tags 1528 } 1529 case "location": 1530 if v != nil { 1531 var location string 1532 err = json.Unmarshal(*v, &location) 1533 if err != nil { 1534 return err 1535 } 1536 s.Location = &location 1537 } 1538 case "id": 1539 if v != nil { 1540 var ID string 1541 err = json.Unmarshal(*v, &ID) 1542 if err != nil { 1543 return err 1544 } 1545 s.ID = &ID 1546 } 1547 case "name": 1548 if v != nil { 1549 var name string 1550 err = json.Unmarshal(*v, &name) 1551 if err != nil { 1552 return err 1553 } 1554 s.Name = &name 1555 } 1556 case "type": 1557 if v != nil { 1558 var typeVar string 1559 err = json.Unmarshal(*v, &typeVar) 1560 if err != nil { 1561 return err 1562 } 1563 s.Type = &typeVar 1564 } 1565 } 1566 } 1567 1568 return nil 1569} 1570 1571// ServiceArray array of StorageSyncServices 1572type ServiceArray struct { 1573 autorest.Response `json:"-"` 1574 // Value - Collection of StorageSyncServices. 1575 Value *[]Service `json:"value,omitempty"` 1576} 1577 1578// ServiceCreateParameters the parameters used when creating a storage sync service. 1579type ServiceCreateParameters struct { 1580 // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. 1581 Location *string `json:"location,omitempty"` 1582 // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. 1583 Tags map[string]*string `json:"tags"` 1584} 1585 1586// MarshalJSON is the custom marshaler for ServiceCreateParameters. 1587func (scp ServiceCreateParameters) MarshalJSON() ([]byte, error) { 1588 objectMap := make(map[string]interface{}) 1589 if scp.Location != nil { 1590 objectMap["location"] = scp.Location 1591 } 1592 if scp.Tags != nil { 1593 objectMap["tags"] = scp.Tags 1594 } 1595 return json.Marshal(objectMap) 1596} 1597 1598// ServiceProperties storage Sync Service Properties object. 1599type ServiceProperties struct { 1600 // StorageSyncServiceStatus - READ-ONLY; Storage Sync service status. 1601 StorageSyncServiceStatus *int32 `json:"storageSyncServiceStatus,omitempty"` 1602 // StorageSyncServiceUID - READ-ONLY; Storage Sync service Uid 1603 StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"` 1604} 1605 1606// ServiceUpdateParameters parameters for updating an Storage sync service. 1607type ServiceUpdateParameters struct { 1608 // Tags - The user-specified tags associated with the storage sync service. 1609 Tags map[string]*string `json:"tags"` 1610 // Properties - The properties of the storage sync service. 1611 Properties interface{} `json:"properties,omitempty"` 1612} 1613 1614// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 1615func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 1616 objectMap := make(map[string]interface{}) 1617 if sup.Tags != nil { 1618 objectMap["tags"] = sup.Tags 1619 } 1620 if sup.Properties != nil { 1621 objectMap["properties"] = sup.Properties 1622 } 1623 return json.Marshal(objectMap) 1624} 1625 1626// SubscriptionState subscription State object. 1627type SubscriptionState struct { 1628 // State - State of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted' 1629 State Reason `json:"state,omitempty"` 1630 // Istransitioning - READ-ONLY; Is Transitioning 1631 Istransitioning *bool `json:"istransitioning,omitempty"` 1632 // Properties - Subscription state properties. 1633 Properties interface{} `json:"properties,omitempty"` 1634} 1635 1636// SyncGroup sync Group object. 1637type SyncGroup struct { 1638 autorest.Response `json:"-"` 1639 // SyncGroupProperties - SyncGroup properties. 1640 *SyncGroupProperties `json:"properties,omitempty"` 1641 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1642 ID *string `json:"id,omitempty"` 1643 // Name - READ-ONLY; The name of the resource 1644 Name *string `json:"name,omitempty"` 1645 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 1646 Type *string `json:"type,omitempty"` 1647} 1648 1649// MarshalJSON is the custom marshaler for SyncGroup. 1650func (sg SyncGroup) MarshalJSON() ([]byte, error) { 1651 objectMap := make(map[string]interface{}) 1652 if sg.SyncGroupProperties != nil { 1653 objectMap["properties"] = sg.SyncGroupProperties 1654 } 1655 return json.Marshal(objectMap) 1656} 1657 1658// UnmarshalJSON is the custom unmarshaler for SyncGroup struct. 1659func (sg *SyncGroup) UnmarshalJSON(body []byte) error { 1660 var m map[string]*json.RawMessage 1661 err := json.Unmarshal(body, &m) 1662 if err != nil { 1663 return err 1664 } 1665 for k, v := range m { 1666 switch k { 1667 case "properties": 1668 if v != nil { 1669 var syncGroupProperties SyncGroupProperties 1670 err = json.Unmarshal(*v, &syncGroupProperties) 1671 if err != nil { 1672 return err 1673 } 1674 sg.SyncGroupProperties = &syncGroupProperties 1675 } 1676 case "id": 1677 if v != nil { 1678 var ID string 1679 err = json.Unmarshal(*v, &ID) 1680 if err != nil { 1681 return err 1682 } 1683 sg.ID = &ID 1684 } 1685 case "name": 1686 if v != nil { 1687 var name string 1688 err = json.Unmarshal(*v, &name) 1689 if err != nil { 1690 return err 1691 } 1692 sg.Name = &name 1693 } 1694 case "type": 1695 if v != nil { 1696 var typeVar string 1697 err = json.Unmarshal(*v, &typeVar) 1698 if err != nil { 1699 return err 1700 } 1701 sg.Type = &typeVar 1702 } 1703 } 1704 } 1705 1706 return nil 1707} 1708 1709// SyncGroupArray array of SyncGroup 1710type SyncGroupArray struct { 1711 autorest.Response `json:"-"` 1712 // Value - Collection of SyncGroup. 1713 Value *[]SyncGroup `json:"value,omitempty"` 1714} 1715 1716// SyncGroupCreateParameters the parameters used when creating a sync group. 1717type SyncGroupCreateParameters struct { 1718 // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. 1719 Location *string `json:"location,omitempty"` 1720 // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. 1721 Tags map[string]*string `json:"tags"` 1722 // Properties - The parameters used to create the sync group 1723 Properties interface{} `json:"properties,omitempty"` 1724} 1725 1726// MarshalJSON is the custom marshaler for SyncGroupCreateParameters. 1727func (sgcp SyncGroupCreateParameters) MarshalJSON() ([]byte, error) { 1728 objectMap := make(map[string]interface{}) 1729 if sgcp.Location != nil { 1730 objectMap["location"] = sgcp.Location 1731 } 1732 if sgcp.Tags != nil { 1733 objectMap["tags"] = sgcp.Tags 1734 } 1735 if sgcp.Properties != nil { 1736 objectMap["properties"] = sgcp.Properties 1737 } 1738 return json.Marshal(objectMap) 1739} 1740 1741// SyncGroupProperties syncGroup Properties object. 1742type SyncGroupProperties struct { 1743 // UniqueID - Unique Id 1744 UniqueID *string `json:"uniqueId,omitempty"` 1745 // SyncGroupStatus - READ-ONLY; Sync group status 1746 SyncGroupStatus *string `json:"syncGroupStatus,omitempty"` 1747} 1748 1749// TrackedResource the resource model definition for a ARM tracked top level resource 1750type TrackedResource struct { 1751 // Tags - Resource tags. 1752 Tags map[string]*string `json:"tags"` 1753 // Location - The geo-location where the resource lives 1754 Location *string `json:"location,omitempty"` 1755 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1756 ID *string `json:"id,omitempty"` 1757 // Name - READ-ONLY; The name of the resource 1758 Name *string `json:"name,omitempty"` 1759 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 1760 Type *string `json:"type,omitempty"` 1761} 1762 1763// MarshalJSON is the custom marshaler for TrackedResource. 1764func (tr TrackedResource) MarshalJSON() ([]byte, error) { 1765 objectMap := make(map[string]interface{}) 1766 if tr.Tags != nil { 1767 objectMap["tags"] = tr.Tags 1768 } 1769 if tr.Location != nil { 1770 objectMap["location"] = tr.Location 1771 } 1772 return json.Marshal(objectMap) 1773} 1774 1775// Workflow workflow resource. 1776type Workflow struct { 1777 autorest.Response `json:"-"` 1778 // WorkflowProperties - Workflow properties. 1779 *WorkflowProperties `json:"properties,omitempty"` 1780 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1781 ID *string `json:"id,omitempty"` 1782 // Name - READ-ONLY; The name of the resource 1783 Name *string `json:"name,omitempty"` 1784 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 1785 Type *string `json:"type,omitempty"` 1786} 1787 1788// MarshalJSON is the custom marshaler for Workflow. 1789func (w Workflow) MarshalJSON() ([]byte, error) { 1790 objectMap := make(map[string]interface{}) 1791 if w.WorkflowProperties != nil { 1792 objectMap["properties"] = w.WorkflowProperties 1793 } 1794 return json.Marshal(objectMap) 1795} 1796 1797// UnmarshalJSON is the custom unmarshaler for Workflow struct. 1798func (w *Workflow) UnmarshalJSON(body []byte) error { 1799 var m map[string]*json.RawMessage 1800 err := json.Unmarshal(body, &m) 1801 if err != nil { 1802 return err 1803 } 1804 for k, v := range m { 1805 switch k { 1806 case "properties": 1807 if v != nil { 1808 var workflowProperties WorkflowProperties 1809 err = json.Unmarshal(*v, &workflowProperties) 1810 if err != nil { 1811 return err 1812 } 1813 w.WorkflowProperties = &workflowProperties 1814 } 1815 case "id": 1816 if v != nil { 1817 var ID string 1818 err = json.Unmarshal(*v, &ID) 1819 if err != nil { 1820 return err 1821 } 1822 w.ID = &ID 1823 } 1824 case "name": 1825 if v != nil { 1826 var name string 1827 err = json.Unmarshal(*v, &name) 1828 if err != nil { 1829 return err 1830 } 1831 w.Name = &name 1832 } 1833 case "type": 1834 if v != nil { 1835 var typeVar string 1836 err = json.Unmarshal(*v, &typeVar) 1837 if err != nil { 1838 return err 1839 } 1840 w.Type = &typeVar 1841 } 1842 } 1843 } 1844 1845 return nil 1846} 1847 1848// WorkflowArray array of Workflow 1849type WorkflowArray struct { 1850 // Value - Collection of workflow items. 1851 Value *[]Workflow `json:"value,omitempty"` 1852} 1853 1854// WorkflowProperties workflow Properties object. 1855type WorkflowProperties struct { 1856 // LastStepName - last step name 1857 LastStepName *string `json:"lastStepName,omitempty"` 1858 // Status - workflow status. Possible values include: 'Active', 'Expired', 'Succeeded', 'Aborted', 'Failed' 1859 Status Status `json:"status,omitempty"` 1860 // Operation - operation direction. Possible values include: 'Do', 'Undo', 'Cancel' 1861 Operation Operation `json:"operation,omitempty"` 1862 // Steps - workflow steps 1863 Steps *string `json:"steps,omitempty"` 1864 // LastOperationID - workflow last operation identifier. 1865 LastOperationID *string `json:"lastOperationId,omitempty"` 1866} 1867