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