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/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2019-10-01/storagesync" 22 23// APIError error type 24type APIError struct { 25 // Code - Error code of the given entry. 26 Code *string `json:"code,omitempty"` 27 // Message - Error message of the given entry. 28 Message *string `json:"message,omitempty"` 29 // Target - Target of the given error entry. 30 Target *string `json:"target,omitempty"` 31 // Details - Error details of the given entry. 32 Details *ErrorDetails `json:"details,omitempty"` 33} 34 35// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. 36type AzureEntityResource struct { 37 // Etag - READ-ONLY; Resource Etag. 38 Etag *string `json:"etag,omitempty"` 39 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 40 ID *string `json:"id,omitempty"` 41 // Name - READ-ONLY; The name of the resource 42 Name *string `json:"name,omitempty"` 43 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 44 Type *string `json:"type,omitempty"` 45} 46 47// MarshalJSON is the custom marshaler for AzureEntityResource. 48func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { 49 objectMap := make(map[string]interface{}) 50 return json.Marshal(objectMap) 51} 52 53// BackupRequest backup request 54type BackupRequest struct { 55 // AzureFileShare - Azure File Share. 56 AzureFileShare *string `json:"azureFileShare,omitempty"` 57} 58 59// CheckNameAvailabilityParameters parameters for a check name availability request. 60type CheckNameAvailabilityParameters struct { 61 // Name - The name to check for availability 62 Name *string `json:"name,omitempty"` 63 // Type - The resource type. Must be set to Microsoft.StorageSync/storageSyncServices 64 Type *string `json:"type,omitempty"` 65} 66 67// CheckNameAvailabilityResult the CheckNameAvailability operation response. 68type CheckNameAvailabilityResult struct { 69 autorest.Response `json:"-"` 70 // 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. 71 NameAvailable *bool `json:"nameAvailable,omitempty"` 72 // 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' 73 Reason NameAvailabilityReason `json:"reason,omitempty"` 74 // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail. 75 Message *string `json:"message,omitempty"` 76} 77 78// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult. 79func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { 80 objectMap := make(map[string]interface{}) 81 return json.Marshal(objectMap) 82} 83 84// CloudEndpoint cloud Endpoint object. 85type CloudEndpoint struct { 86 autorest.Response `json:"-"` 87 // CloudEndpointProperties - Cloud Endpoint properties. 88 *CloudEndpointProperties `json:"properties,omitempty"` 89 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 90 ID *string `json:"id,omitempty"` 91 // Name - READ-ONLY; The name of the resource 92 Name *string `json:"name,omitempty"` 93 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 94 Type *string `json:"type,omitempty"` 95} 96 97// MarshalJSON is the custom marshaler for CloudEndpoint. 98func (ce CloudEndpoint) MarshalJSON() ([]byte, error) { 99 objectMap := make(map[string]interface{}) 100 if ce.CloudEndpointProperties != nil { 101 objectMap["properties"] = ce.CloudEndpointProperties 102 } 103 return json.Marshal(objectMap) 104} 105 106// UnmarshalJSON is the custom unmarshaler for CloudEndpoint struct. 107func (ce *CloudEndpoint) UnmarshalJSON(body []byte) error { 108 var m map[string]*json.RawMessage 109 err := json.Unmarshal(body, &m) 110 if err != nil { 111 return err 112 } 113 for k, v := range m { 114 switch k { 115 case "properties": 116 if v != nil { 117 var cloudEndpointProperties CloudEndpointProperties 118 err = json.Unmarshal(*v, &cloudEndpointProperties) 119 if err != nil { 120 return err 121 } 122 ce.CloudEndpointProperties = &cloudEndpointProperties 123 } 124 case "id": 125 if v != nil { 126 var ID string 127 err = json.Unmarshal(*v, &ID) 128 if err != nil { 129 return err 130 } 131 ce.ID = &ID 132 } 133 case "name": 134 if v != nil { 135 var name string 136 err = json.Unmarshal(*v, &name) 137 if err != nil { 138 return err 139 } 140 ce.Name = &name 141 } 142 case "type": 143 if v != nil { 144 var typeVar string 145 err = json.Unmarshal(*v, &typeVar) 146 if err != nil { 147 return err 148 } 149 ce.Type = &typeVar 150 } 151 } 152 } 153 154 return nil 155} 156 157// CloudEndpointArray array of CloudEndpoint 158type CloudEndpointArray struct { 159 autorest.Response `json:"-"` 160 // Value - Collection of CloudEndpoint. 161 Value *[]CloudEndpoint `json:"value,omitempty"` 162} 163 164// CloudEndpointCreateParameters the parameters used when creating a cloud endpoint. 165type CloudEndpointCreateParameters struct { 166 // CloudEndpointCreateParametersProperties - The parameters used to create the cloud endpoint. 167 *CloudEndpointCreateParametersProperties `json:"properties,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. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 173 Type *string `json:"type,omitempty"` 174} 175 176// MarshalJSON is the custom marshaler for CloudEndpointCreateParameters. 177func (cecp CloudEndpointCreateParameters) MarshalJSON() ([]byte, error) { 178 objectMap := make(map[string]interface{}) 179 if cecp.CloudEndpointCreateParametersProperties != nil { 180 objectMap["properties"] = cecp.CloudEndpointCreateParametersProperties 181 } 182 return json.Marshal(objectMap) 183} 184 185// UnmarshalJSON is the custom unmarshaler for CloudEndpointCreateParameters struct. 186func (cecp *CloudEndpointCreateParameters) UnmarshalJSON(body []byte) error { 187 var m map[string]*json.RawMessage 188 err := json.Unmarshal(body, &m) 189 if err != nil { 190 return err 191 } 192 for k, v := range m { 193 switch k { 194 case "properties": 195 if v != nil { 196 var cloudEndpointCreateParametersProperties CloudEndpointCreateParametersProperties 197 err = json.Unmarshal(*v, &cloudEndpointCreateParametersProperties) 198 if err != nil { 199 return err 200 } 201 cecp.CloudEndpointCreateParametersProperties = &cloudEndpointCreateParametersProperties 202 } 203 case "id": 204 if v != nil { 205 var ID string 206 err = json.Unmarshal(*v, &ID) 207 if err != nil { 208 return err 209 } 210 cecp.ID = &ID 211 } 212 case "name": 213 if v != nil { 214 var name string 215 err = json.Unmarshal(*v, &name) 216 if err != nil { 217 return err 218 } 219 cecp.Name = &name 220 } 221 case "type": 222 if v != nil { 223 var typeVar string 224 err = json.Unmarshal(*v, &typeVar) 225 if err != nil { 226 return err 227 } 228 cecp.Type = &typeVar 229 } 230 } 231 } 232 233 return nil 234} 235 236// CloudEndpointCreateParametersProperties cloudEndpoint Properties object. 237type CloudEndpointCreateParametersProperties struct { 238 // StorageAccountResourceID - Storage Account Resource Id 239 StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` 240 // AzureFileShareName - Azure file share name 241 AzureFileShareName *string `json:"azureFileShareName,omitempty"` 242 // StorageAccountTenantID - Storage Account Tenant Id 243 StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"` 244 // FriendlyName - Friendly Name 245 FriendlyName *string `json:"friendlyName,omitempty"` 246} 247 248// CloudEndpointProperties cloudEndpoint Properties object. 249type CloudEndpointProperties struct { 250 // StorageAccountResourceID - Storage Account Resource Id 251 StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` 252 // AzureFileShareName - Azure file share name 253 AzureFileShareName *string `json:"azureFileShareName,omitempty"` 254 // StorageAccountTenantID - Storage Account Tenant Id 255 StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"` 256 // PartnershipID - Partnership Id 257 PartnershipID *string `json:"partnershipId,omitempty"` 258 // FriendlyName - Friendly Name 259 FriendlyName *string `json:"friendlyName,omitempty"` 260 // BackupEnabled - READ-ONLY; Backup Enabled 261 BackupEnabled *string `json:"backupEnabled,omitempty"` 262 // ProvisioningState - CloudEndpoint Provisioning State 263 ProvisioningState *string `json:"provisioningState,omitempty"` 264 // LastWorkflowID - CloudEndpoint lastWorkflowId 265 LastWorkflowID *string `json:"lastWorkflowId,omitempty"` 266 // LastOperationName - Resource Last Operation Name 267 LastOperationName *string `json:"lastOperationName,omitempty"` 268} 269 270// MarshalJSON is the custom marshaler for CloudEndpointProperties. 271func (cep CloudEndpointProperties) MarshalJSON() ([]byte, error) { 272 objectMap := make(map[string]interface{}) 273 if cep.StorageAccountResourceID != nil { 274 objectMap["storageAccountResourceId"] = cep.StorageAccountResourceID 275 } 276 if cep.AzureFileShareName != nil { 277 objectMap["azureFileShareName"] = cep.AzureFileShareName 278 } 279 if cep.StorageAccountTenantID != nil { 280 objectMap["storageAccountTenantId"] = cep.StorageAccountTenantID 281 } 282 if cep.PartnershipID != nil { 283 objectMap["partnershipId"] = cep.PartnershipID 284 } 285 if cep.FriendlyName != nil { 286 objectMap["friendlyName"] = cep.FriendlyName 287 } 288 if cep.ProvisioningState != nil { 289 objectMap["provisioningState"] = cep.ProvisioningState 290 } 291 if cep.LastWorkflowID != nil { 292 objectMap["lastWorkflowId"] = cep.LastWorkflowID 293 } 294 if cep.LastOperationName != nil { 295 objectMap["lastOperationName"] = cep.LastOperationName 296 } 297 return json.Marshal(objectMap) 298} 299 300// CloudEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 301// operation. 302type CloudEndpointsCreateFuture struct { 303 azure.FutureAPI 304 // Result returns the result of the asynchronous operation. 305 // If the operation has not completed it will return an error. 306 Result func(CloudEndpointsClient) (CloudEndpoint, error) 307} 308 309// UnmarshalJSON is the custom unmarshaller for CreateFuture. 310func (future *CloudEndpointsCreateFuture) UnmarshalJSON(body []byte) error { 311 var azFuture azure.Future 312 if err := json.Unmarshal(body, &azFuture); err != nil { 313 return err 314 } 315 future.FutureAPI = &azFuture 316 future.Result = future.result 317 return nil 318} 319 320// result is the default implementation for CloudEndpointsCreateFuture.Result. 321func (future *CloudEndpointsCreateFuture) result(client CloudEndpointsClient) (ce CloudEndpoint, err error) { 322 var done bool 323 done, err = future.DoneWithContext(context.Background(), client) 324 if err != nil { 325 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", future.Response(), "Polling failure") 326 return 327 } 328 if !done { 329 ce.Response.Response = future.Response() 330 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsCreateFuture") 331 return 332 } 333 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 334 if ce.Response.Response, err = future.GetResult(sender); err == nil && ce.Response.Response.StatusCode != http.StatusNoContent { 335 ce, err = client.CreateResponder(ce.Response.Response) 336 if err != nil { 337 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", ce.Response.Response, "Failure responding to request") 338 } 339 } 340 return 341} 342 343// CloudEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 344// operation. 345type CloudEndpointsDeleteFuture struct { 346 azure.FutureAPI 347 // Result returns the result of the asynchronous operation. 348 // If the operation has not completed it will return an error. 349 Result func(CloudEndpointsClient) (autorest.Response, error) 350} 351 352// UnmarshalJSON is the custom unmarshaller for CreateFuture. 353func (future *CloudEndpointsDeleteFuture) UnmarshalJSON(body []byte) error { 354 var azFuture azure.Future 355 if err := json.Unmarshal(body, &azFuture); err != nil { 356 return err 357 } 358 future.FutureAPI = &azFuture 359 future.Result = future.result 360 return nil 361} 362 363// result is the default implementation for CloudEndpointsDeleteFuture.Result. 364func (future *CloudEndpointsDeleteFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { 365 var done bool 366 done, err = future.DoneWithContext(context.Background(), client) 367 if err != nil { 368 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") 369 return 370 } 371 if !done { 372 ar.Response = future.Response() 373 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsDeleteFuture") 374 return 375 } 376 ar.Response = future.Response() 377 return 378} 379 380// CloudEndpointsPostBackupFuture an abstraction for monitoring and retrieving the results of a 381// long-running operation. 382type CloudEndpointsPostBackupFuture struct { 383 azure.FutureAPI 384 // Result returns the result of the asynchronous operation. 385 // If the operation has not completed it will return an error. 386 Result func(CloudEndpointsClient) (PostBackupResponse, error) 387} 388 389// UnmarshalJSON is the custom unmarshaller for CreateFuture. 390func (future *CloudEndpointsPostBackupFuture) UnmarshalJSON(body []byte) error { 391 var azFuture azure.Future 392 if err := json.Unmarshal(body, &azFuture); err != nil { 393 return err 394 } 395 future.FutureAPI = &azFuture 396 future.Result = future.result 397 return nil 398} 399 400// result is the default implementation for CloudEndpointsPostBackupFuture.Result. 401func (future *CloudEndpointsPostBackupFuture) result(client CloudEndpointsClient) (pbr PostBackupResponse, err error) { 402 var done bool 403 done, err = future.DoneWithContext(context.Background(), client) 404 if err != nil { 405 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", future.Response(), "Polling failure") 406 return 407 } 408 if !done { 409 pbr.Response.Response = future.Response() 410 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostBackupFuture") 411 return 412 } 413 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 414 if pbr.Response.Response, err = future.GetResult(sender); err == nil && pbr.Response.Response.StatusCode != http.StatusNoContent { 415 pbr, err = client.PostBackupResponder(pbr.Response.Response) 416 if err != nil { 417 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", pbr.Response.Response, "Failure responding to request") 418 } 419 } 420 return 421} 422 423// CloudEndpointsPostRestoreFuture an abstraction for monitoring and retrieving the results of a 424// long-running operation. 425type CloudEndpointsPostRestoreFuture struct { 426 azure.FutureAPI 427 // Result returns the result of the asynchronous operation. 428 // If the operation has not completed it will return an error. 429 Result func(CloudEndpointsClient) (autorest.Response, error) 430} 431 432// UnmarshalJSON is the custom unmarshaller for CreateFuture. 433func (future *CloudEndpointsPostRestoreFuture) UnmarshalJSON(body []byte) error { 434 var azFuture azure.Future 435 if err := json.Unmarshal(body, &azFuture); err != nil { 436 return err 437 } 438 future.FutureAPI = &azFuture 439 future.Result = future.result 440 return nil 441} 442 443// result is the default implementation for CloudEndpointsPostRestoreFuture.Result. 444func (future *CloudEndpointsPostRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { 445 var done bool 446 done, err = future.DoneWithContext(context.Background(), client) 447 if err != nil { 448 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostRestoreFuture", "Result", future.Response(), "Polling failure") 449 return 450 } 451 if !done { 452 ar.Response = future.Response() 453 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostRestoreFuture") 454 return 455 } 456 ar.Response = future.Response() 457 return 458} 459 460// CloudEndpointsPreBackupFuture an abstraction for monitoring and retrieving the results of a long-running 461// operation. 462type CloudEndpointsPreBackupFuture struct { 463 azure.FutureAPI 464 // Result returns the result of the asynchronous operation. 465 // If the operation has not completed it will return an error. 466 Result func(CloudEndpointsClient) (autorest.Response, error) 467} 468 469// UnmarshalJSON is the custom unmarshaller for CreateFuture. 470func (future *CloudEndpointsPreBackupFuture) UnmarshalJSON(body []byte) error { 471 var azFuture azure.Future 472 if err := json.Unmarshal(body, &azFuture); err != nil { 473 return err 474 } 475 future.FutureAPI = &azFuture 476 future.Result = future.result 477 return nil 478} 479 480// result is the default implementation for CloudEndpointsPreBackupFuture.Result. 481func (future *CloudEndpointsPreBackupFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { 482 var done bool 483 done, err = future.DoneWithContext(context.Background(), client) 484 if err != nil { 485 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreBackupFuture", "Result", future.Response(), "Polling failure") 486 return 487 } 488 if !done { 489 ar.Response = future.Response() 490 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreBackupFuture") 491 return 492 } 493 ar.Response = future.Response() 494 return 495} 496 497// CloudEndpointsPreRestoreFuture an abstraction for monitoring and retrieving the results of a 498// long-running operation. 499type CloudEndpointsPreRestoreFuture struct { 500 azure.FutureAPI 501 // Result returns the result of the asynchronous operation. 502 // If the operation has not completed it will return an error. 503 Result func(CloudEndpointsClient) (autorest.Response, error) 504} 505 506// UnmarshalJSON is the custom unmarshaller for CreateFuture. 507func (future *CloudEndpointsPreRestoreFuture) UnmarshalJSON(body []byte) error { 508 var azFuture azure.Future 509 if err := json.Unmarshal(body, &azFuture); err != nil { 510 return err 511 } 512 future.FutureAPI = &azFuture 513 future.Result = future.result 514 return nil 515} 516 517// result is the default implementation for CloudEndpointsPreRestoreFuture.Result. 518func (future *CloudEndpointsPreRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { 519 var done bool 520 done, err = future.DoneWithContext(context.Background(), client) 521 if err != nil { 522 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreRestoreFuture", "Result", future.Response(), "Polling failure") 523 return 524 } 525 if !done { 526 ar.Response = future.Response() 527 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreRestoreFuture") 528 return 529 } 530 ar.Response = future.Response() 531 return 532} 533 534// CloudEndpointsTriggerChangeDetectionFuture an abstraction for monitoring and retrieving the results of a 535// long-running operation. 536type CloudEndpointsTriggerChangeDetectionFuture struct { 537 azure.FutureAPI 538 // Result returns the result of the asynchronous operation. 539 // If the operation has not completed it will return an error. 540 Result func(CloudEndpointsClient) (autorest.Response, error) 541} 542 543// UnmarshalJSON is the custom unmarshaller for CreateFuture. 544func (future *CloudEndpointsTriggerChangeDetectionFuture) UnmarshalJSON(body []byte) error { 545 var azFuture azure.Future 546 if err := json.Unmarshal(body, &azFuture); err != nil { 547 return err 548 } 549 future.FutureAPI = &azFuture 550 future.Result = future.result 551 return nil 552} 553 554// result is the default implementation for CloudEndpointsTriggerChangeDetectionFuture.Result. 555func (future *CloudEndpointsTriggerChangeDetectionFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) { 556 var done bool 557 done, err = future.DoneWithContext(context.Background(), client) 558 if err != nil { 559 err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsTriggerChangeDetectionFuture", "Result", future.Response(), "Polling failure") 560 return 561 } 562 if !done { 563 ar.Response = future.Response() 564 err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsTriggerChangeDetectionFuture") 565 return 566 } 567 ar.Response = future.Response() 568 return 569} 570 571// CloudTieringCachePerformance server endpoint cloud tiering status object. 572type CloudTieringCachePerformance struct { 573 // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp 574 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 575 // CacheHitBytes - READ-ONLY; Count of bytes that were served from the local server 576 CacheHitBytes *int64 `json:"cacheHitBytes,omitempty"` 577 // CacheMissBytes - READ-ONLY; Count of bytes that were served from the cloud 578 CacheMissBytes *int64 `json:"cacheMissBytes,omitempty"` 579 // CacheHitBytesPercent - READ-ONLY; Percentage of total bytes (hit + miss) that were served from the local server 580 CacheHitBytesPercent *int32 `json:"cacheHitBytesPercent,omitempty"` 581} 582 583// MarshalJSON is the custom marshaler for CloudTieringCachePerformance. 584func (ctcp CloudTieringCachePerformance) MarshalJSON() ([]byte, error) { 585 objectMap := make(map[string]interface{}) 586 return json.Marshal(objectMap) 587} 588 589// CloudTieringDatePolicyStatus status of the date policy 590type CloudTieringDatePolicyStatus struct { 591 // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp 592 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 593 // TieredFilesMostRecentAccessTimestamp - READ-ONLY; Most recent access time of tiered files 594 TieredFilesMostRecentAccessTimestamp *date.Time `json:"tieredFilesMostRecentAccessTimestamp,omitempty"` 595} 596 597// MarshalJSON is the custom marshaler for CloudTieringDatePolicyStatus. 598func (ctdps CloudTieringDatePolicyStatus) MarshalJSON() ([]byte, error) { 599 objectMap := make(map[string]interface{}) 600 return json.Marshal(objectMap) 601} 602 603// CloudTieringFilesNotTiering server endpoint cloud tiering status object. 604type CloudTieringFilesNotTiering struct { 605 // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp 606 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 607 // TotalFileCount - READ-ONLY; Last cloud tiering result (HResult) 608 TotalFileCount *int64 `json:"totalFileCount,omitempty"` 609 // Errors - READ-ONLY; Array of tiering errors 610 Errors *[]FilesNotTieringError `json:"errors,omitempty"` 611} 612 613// MarshalJSON is the custom marshaler for CloudTieringFilesNotTiering. 614func (ctfnt CloudTieringFilesNotTiering) MarshalJSON() ([]byte, error) { 615 objectMap := make(map[string]interface{}) 616 return json.Marshal(objectMap) 617} 618 619// CloudTieringSpaceSavings server endpoint cloud tiering status object. 620type CloudTieringSpaceSavings struct { 621 // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp 622 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 623 // VolumeSizeBytes - READ-ONLY; Volume size 624 VolumeSizeBytes *int64 `json:"volumeSizeBytes,omitempty"` 625 // TotalSizeCloudBytes - READ-ONLY; Total size of content in the azure file share 626 TotalSizeCloudBytes *int64 `json:"totalSizeCloudBytes,omitempty"` 627 // CachedSizeBytes - READ-ONLY; Cached content size on the server 628 CachedSizeBytes *int64 `json:"cachedSizeBytes,omitempty"` 629 // SpaceSavingsPercent - READ-ONLY; Percentage of cached size over total size 630 SpaceSavingsPercent *int32 `json:"spaceSavingsPercent,omitempty"` 631 // SpaceSavingsBytes - READ-ONLY; Count of bytes saved on the server 632 SpaceSavingsBytes *int64 `json:"spaceSavingsBytes,omitempty"` 633} 634 635// MarshalJSON is the custom marshaler for CloudTieringSpaceSavings. 636func (ctss CloudTieringSpaceSavings) MarshalJSON() ([]byte, error) { 637 objectMap := make(map[string]interface{}) 638 return json.Marshal(objectMap) 639} 640 641// CloudTieringVolumeFreeSpacePolicyStatus status of the volume free space policy 642type CloudTieringVolumeFreeSpacePolicyStatus struct { 643 // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp 644 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 645 // EffectiveVolumeFreeSpacePolicy - READ-ONLY; In the case where multiple server endpoints are present in a volume, an effective free space policy is applied. 646 EffectiveVolumeFreeSpacePolicy *int32 `json:"effectiveVolumeFreeSpacePolicy,omitempty"` 647 // CurrentVolumeFreeSpacePercent - READ-ONLY; Current volume free space percentage. 648 CurrentVolumeFreeSpacePercent *int32 `json:"currentVolumeFreeSpacePercent,omitempty"` 649} 650 651// MarshalJSON is the custom marshaler for CloudTieringVolumeFreeSpacePolicyStatus. 652func (ctvfsps CloudTieringVolumeFreeSpacePolicyStatus) MarshalJSON() ([]byte, error) { 653 objectMap := make(map[string]interface{}) 654 return json.Marshal(objectMap) 655} 656 657// Error error type 658type Error struct { 659 // Error - Error details of the given entry. 660 Error *APIError `json:"error,omitempty"` 661 // Innererror - Error details of the given entry. 662 Innererror *APIError `json:"innererror,omitempty"` 663} 664 665// ErrorDetails error Details object. 666type ErrorDetails struct { 667 // Code - Error code of the given entry. 668 Code *string `json:"code,omitempty"` 669 // Message - Error message of the given entry. 670 Message *string `json:"message,omitempty"` 671 // Target - Target of the given entry. 672 Target *string `json:"target,omitempty"` 673} 674 675// FilesNotTieringError files not tiering error object 676type FilesNotTieringError struct { 677 // ErrorCode - READ-ONLY; Error code (HResult) 678 ErrorCode *int32 `json:"errorCode,omitempty"` 679 // FileCount - READ-ONLY; Count of files with this error 680 FileCount *int64 `json:"fileCount,omitempty"` 681} 682 683// MarshalJSON is the custom marshaler for FilesNotTieringError. 684func (fnte FilesNotTieringError) MarshalJSON() ([]byte, error) { 685 objectMap := make(map[string]interface{}) 686 return json.Marshal(objectMap) 687} 688 689// OperationDisplayInfo the operation supported by storage sync. 690type OperationDisplayInfo struct { 691 // Description - The description of the operation. 692 Description *string `json:"description,omitempty"` 693 // Operation - The action that users can perform, based on their permission level. 694 Operation *string `json:"operation,omitempty"` 695 // Provider - Service provider: Microsoft StorageSync. 696 Provider *string `json:"provider,omitempty"` 697 // Resource - Resource on which the operation is performed. 698 Resource *string `json:"resource,omitempty"` 699} 700 701// OperationDisplayResource operation Display Resource object. 702type OperationDisplayResource struct { 703 // Provider - Operation Display Resource Provider. 704 Provider *string `json:"provider,omitempty"` 705 // Resource - Operation Display Resource. 706 Resource *string `json:"resource,omitempty"` 707 // Operation - Operation Display Resource Operation. 708 Operation *string `json:"operation,omitempty"` 709 // Description - Operation Display Resource Description. 710 Description *string `json:"description,omitempty"` 711} 712 713// OperationEntity the operation supported by storage sync. 714type OperationEntity struct { 715 // Name - Operation name: {provider}/{resource}/{operation}. 716 Name *string `json:"name,omitempty"` 717 // Display - The operation supported by storage sync. 718 Display *OperationDisplayInfo `json:"display,omitempty"` 719 // Origin - The origin. 720 Origin *string `json:"origin,omitempty"` 721} 722 723// OperationEntityListResult the list of storage sync operations. 724type OperationEntityListResult struct { 725 autorest.Response `json:"-"` 726 // NextLink - The link used to get the next page of operations. 727 NextLink *string `json:"nextLink,omitempty"` 728 // Value - The list of operations. 729 Value *[]OperationEntity `json:"value,omitempty"` 730} 731 732// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values. 733type OperationEntityListResultIterator struct { 734 i int 735 page OperationEntityListResultPage 736} 737 738// NextWithContext advances to the next value. If there was an error making 739// the request the iterator does not advance and the error is returned. 740func (iter *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) { 741 if tracing.IsEnabled() { 742 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.NextWithContext") 743 defer func() { 744 sc := -1 745 if iter.Response().Response.Response != nil { 746 sc = iter.Response().Response.Response.StatusCode 747 } 748 tracing.EndSpan(ctx, sc, err) 749 }() 750 } 751 iter.i++ 752 if iter.i < len(iter.page.Values()) { 753 return nil 754 } 755 err = iter.page.NextWithContext(ctx) 756 if err != nil { 757 iter.i-- 758 return err 759 } 760 iter.i = 0 761 return nil 762} 763 764// Next advances to the next value. If there was an error making 765// the request the iterator does not advance and the error is returned. 766// Deprecated: Use NextWithContext() instead. 767func (iter *OperationEntityListResultIterator) Next() error { 768 return iter.NextWithContext(context.Background()) 769} 770 771// NotDone returns true if the enumeration should be started or is not yet complete. 772func (iter OperationEntityListResultIterator) NotDone() bool { 773 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 774} 775 776// Response returns the raw server response from the last page request. 777func (iter OperationEntityListResultIterator) Response() OperationEntityListResult { 778 return iter.page.Response() 779} 780 781// Value returns the current value or a zero-initialized value if the 782// iterator has advanced beyond the end of the collection. 783func (iter OperationEntityListResultIterator) Value() OperationEntity { 784 if !iter.page.NotDone() { 785 return OperationEntity{} 786 } 787 return iter.page.Values()[iter.i] 788} 789 790// Creates a new instance of the OperationEntityListResultIterator type. 791func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator { 792 return OperationEntityListResultIterator{page: page} 793} 794 795// IsEmpty returns true if the ListResult contains no values. 796func (oelr OperationEntityListResult) IsEmpty() bool { 797 return oelr.Value == nil || len(*oelr.Value) == 0 798} 799 800// hasNextLink returns true if the NextLink is not empty. 801func (oelr OperationEntityListResult) hasNextLink() bool { 802 return oelr.NextLink != nil && len(*oelr.NextLink) != 0 803} 804 805// operationEntityListResultPreparer prepares a request to retrieve the next set of results. 806// It returns nil if no more results exist. 807func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) { 808 if !oelr.hasNextLink() { 809 return nil, nil 810 } 811 return autorest.Prepare((&http.Request{}).WithContext(ctx), 812 autorest.AsJSON(), 813 autorest.AsGet(), 814 autorest.WithBaseURL(to.String(oelr.NextLink))) 815} 816 817// OperationEntityListResultPage contains a page of OperationEntity values. 818type OperationEntityListResultPage struct { 819 fn func(context.Context, OperationEntityListResult) (OperationEntityListResult, error) 820 oelr OperationEntityListResult 821} 822 823// NextWithContext advances to the next page of values. If there was an error making 824// the request the page does not advance and the error is returned. 825func (page *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) { 826 if tracing.IsEnabled() { 827 ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext") 828 defer func() { 829 sc := -1 830 if page.Response().Response.Response != nil { 831 sc = page.Response().Response.Response.StatusCode 832 } 833 tracing.EndSpan(ctx, sc, err) 834 }() 835 } 836 for { 837 next, err := page.fn(ctx, page.oelr) 838 if err != nil { 839 return err 840 } 841 page.oelr = next 842 if !next.hasNextLink() || !next.IsEmpty() { 843 break 844 } 845 } 846 return nil 847} 848 849// Next advances to the next page of values. If there was an error making 850// the request the page does not advance and the error is returned. 851// Deprecated: Use NextWithContext() instead. 852func (page *OperationEntityListResultPage) Next() error { 853 return page.NextWithContext(context.Background()) 854} 855 856// NotDone returns true if the page enumeration should be started or is not yet complete. 857func (page OperationEntityListResultPage) NotDone() bool { 858 return !page.oelr.IsEmpty() 859} 860 861// Response returns the raw server response from the last page request. 862func (page OperationEntityListResultPage) Response() OperationEntityListResult { 863 return page.oelr 864} 865 866// Values returns the slice of values for the current page or nil if there are no values. 867func (page OperationEntityListResultPage) Values() []OperationEntity { 868 if page.oelr.IsEmpty() { 869 return nil 870 } 871 return *page.oelr.Value 872} 873 874// Creates a new instance of the OperationEntityListResultPage type. 875func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage { 876 return OperationEntityListResultPage{ 877 fn: getNextPage, 878 oelr: cur, 879 } 880} 881 882// OperationStatus operation status object 883type OperationStatus struct { 884 autorest.Response `json:"-"` 885 // Name - READ-ONLY; Operation Id 886 Name *string `json:"name,omitempty"` 887 // Status - READ-ONLY; Operation status 888 Status *string `json:"status,omitempty"` 889 // StartTime - READ-ONLY; Start time of the operation 890 StartTime *date.Time `json:"startTime,omitempty"` 891 // EndTime - READ-ONLY; End time of the operation 892 EndTime *date.Time `json:"endTime,omitempty"` 893 // Error - READ-ONLY; Error details. 894 Error *APIError `json:"error,omitempty"` 895} 896 897// MarshalJSON is the custom marshaler for OperationStatus. 898func (osVar OperationStatus) MarshalJSON() ([]byte, error) { 899 objectMap := make(map[string]interface{}) 900 return json.Marshal(objectMap) 901} 902 903// PostBackupResponse post Backup Response 904type PostBackupResponse struct { 905 autorest.Response `json:"-"` 906 // PostBackupResponseProperties - Post Backup Response Properties 907 *PostBackupResponseProperties `json:"backupMetadata,omitempty"` 908} 909 910// MarshalJSON is the custom marshaler for PostBackupResponse. 911func (pbr PostBackupResponse) MarshalJSON() ([]byte, error) { 912 objectMap := make(map[string]interface{}) 913 if pbr.PostBackupResponseProperties != nil { 914 objectMap["backupMetadata"] = pbr.PostBackupResponseProperties 915 } 916 return json.Marshal(objectMap) 917} 918 919// UnmarshalJSON is the custom unmarshaler for PostBackupResponse struct. 920func (pbr *PostBackupResponse) UnmarshalJSON(body []byte) error { 921 var m map[string]*json.RawMessage 922 err := json.Unmarshal(body, &m) 923 if err != nil { 924 return err 925 } 926 for k, v := range m { 927 switch k { 928 case "backupMetadata": 929 if v != nil { 930 var postBackupResponseProperties PostBackupResponseProperties 931 err = json.Unmarshal(*v, &postBackupResponseProperties) 932 if err != nil { 933 return err 934 } 935 pbr.PostBackupResponseProperties = &postBackupResponseProperties 936 } 937 } 938 } 939 940 return nil 941} 942 943// PostBackupResponseProperties post Backup Response Properties object. 944type PostBackupResponseProperties struct { 945 // CloudEndpointName - READ-ONLY; cloud endpoint Name. 946 CloudEndpointName *string `json:"cloudEndpointName,omitempty"` 947} 948 949// MarshalJSON is the custom marshaler for PostBackupResponseProperties. 950func (pbrp PostBackupResponseProperties) MarshalJSON() ([]byte, error) { 951 objectMap := make(map[string]interface{}) 952 return json.Marshal(objectMap) 953} 954 955// PostRestoreRequest post Restore Request 956type PostRestoreRequest struct { 957 // Partition - Post Restore partition. 958 Partition *string `json:"partition,omitempty"` 959 // ReplicaGroup - Post Restore replica group. 960 ReplicaGroup *string `json:"replicaGroup,omitempty"` 961 // RequestID - Post Restore request id. 962 RequestID *string `json:"requestId,omitempty"` 963 // AzureFileShareURI - Post Restore Azure file share uri. 964 AzureFileShareURI *string `json:"azureFileShareUri,omitempty"` 965 // Status - Post Restore Azure status. 966 Status *string `json:"status,omitempty"` 967 // SourceAzureFileShareURI - Post Restore Azure source azure file share uri. 968 SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"` 969 // FailedFileList - Post Restore Azure failed file list. 970 FailedFileList *string `json:"failedFileList,omitempty"` 971 // RestoreFileSpec - Post Restore restore file spec array. 972 RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"` 973} 974 975// PreRestoreRequest pre Restore request object. 976type PreRestoreRequest struct { 977 // Partition - Pre Restore partition. 978 Partition *string `json:"partition,omitempty"` 979 // ReplicaGroup - Pre Restore replica group. 980 ReplicaGroup *string `json:"replicaGroup,omitempty"` 981 // RequestID - Pre Restore request id. 982 RequestID *string `json:"requestId,omitempty"` 983 // AzureFileShareURI - Pre Restore Azure file share uri. 984 AzureFileShareURI *string `json:"azureFileShareUri,omitempty"` 985 // Status - Pre Restore Azure status. 986 Status *string `json:"status,omitempty"` 987 // SourceAzureFileShareURI - Pre Restore Azure source azure file share uri. 988 SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"` 989 // BackupMetadataPropertyBag - Pre Restore backup metadata property bag. 990 BackupMetadataPropertyBag *string `json:"backupMetadataPropertyBag,omitempty"` 991 // RestoreFileSpec - Pre Restore restore file spec array. 992 RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"` 993 // PauseWaitForSyncDrainTimePeriodInSeconds - Pre Restore pause wait for sync drain time period in seconds. 994 PauseWaitForSyncDrainTimePeriodInSeconds *int32 `json:"pauseWaitForSyncDrainTimePeriodInSeconds,omitempty"` 995} 996 997// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not 998// have tags and a location 999type ProxyResource struct { 1000 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1001 ID *string `json:"id,omitempty"` 1002 // Name - READ-ONLY; The name of the resource 1003 Name *string `json:"name,omitempty"` 1004 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1005 Type *string `json:"type,omitempty"` 1006} 1007 1008// MarshalJSON is the custom marshaler for ProxyResource. 1009func (pr ProxyResource) MarshalJSON() ([]byte, error) { 1010 objectMap := make(map[string]interface{}) 1011 return json.Marshal(objectMap) 1012} 1013 1014// RecallActionParameters the parameters used when calling recall action on server endpoint. 1015type RecallActionParameters struct { 1016 // Pattern - Pattern of the files. 1017 Pattern *string `json:"pattern,omitempty"` 1018 // RecallPath - Recall path. 1019 RecallPath *string `json:"recallPath,omitempty"` 1020} 1021 1022// RegisteredServer registered Server resource. 1023type RegisteredServer struct { 1024 autorest.Response `json:"-"` 1025 // RegisteredServerProperties - RegisteredServer properties. 1026 *RegisteredServerProperties `json:"properties,omitempty"` 1027 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1028 ID *string `json:"id,omitempty"` 1029 // Name - READ-ONLY; The name of the resource 1030 Name *string `json:"name,omitempty"` 1031 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1032 Type *string `json:"type,omitempty"` 1033} 1034 1035// MarshalJSON is the custom marshaler for RegisteredServer. 1036func (rs RegisteredServer) MarshalJSON() ([]byte, error) { 1037 objectMap := make(map[string]interface{}) 1038 if rs.RegisteredServerProperties != nil { 1039 objectMap["properties"] = rs.RegisteredServerProperties 1040 } 1041 return json.Marshal(objectMap) 1042} 1043 1044// UnmarshalJSON is the custom unmarshaler for RegisteredServer struct. 1045func (rs *RegisteredServer) UnmarshalJSON(body []byte) error { 1046 var m map[string]*json.RawMessage 1047 err := json.Unmarshal(body, &m) 1048 if err != nil { 1049 return err 1050 } 1051 for k, v := range m { 1052 switch k { 1053 case "properties": 1054 if v != nil { 1055 var registeredServerProperties RegisteredServerProperties 1056 err = json.Unmarshal(*v, ®isteredServerProperties) 1057 if err != nil { 1058 return err 1059 } 1060 rs.RegisteredServerProperties = ®isteredServerProperties 1061 } 1062 case "id": 1063 if v != nil { 1064 var ID string 1065 err = json.Unmarshal(*v, &ID) 1066 if err != nil { 1067 return err 1068 } 1069 rs.ID = &ID 1070 } 1071 case "name": 1072 if v != nil { 1073 var name string 1074 err = json.Unmarshal(*v, &name) 1075 if err != nil { 1076 return err 1077 } 1078 rs.Name = &name 1079 } 1080 case "type": 1081 if v != nil { 1082 var typeVar string 1083 err = json.Unmarshal(*v, &typeVar) 1084 if err != nil { 1085 return err 1086 } 1087 rs.Type = &typeVar 1088 } 1089 } 1090 } 1091 1092 return nil 1093} 1094 1095// RegisteredServerArray array of RegisteredServer 1096type RegisteredServerArray struct { 1097 autorest.Response `json:"-"` 1098 // Value - Collection of Registered Server. 1099 Value *[]RegisteredServer `json:"value,omitempty"` 1100} 1101 1102// RegisteredServerCreateParameters the parameters used when creating a registered server. 1103type RegisteredServerCreateParameters struct { 1104 // RegisteredServerCreateParametersProperties - The parameters used to create the registered server. 1105 *RegisteredServerCreateParametersProperties `json:"properties,omitempty"` 1106 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1107 ID *string `json:"id,omitempty"` 1108 // Name - READ-ONLY; The name of the resource 1109 Name *string `json:"name,omitempty"` 1110 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1111 Type *string `json:"type,omitempty"` 1112} 1113 1114// MarshalJSON is the custom marshaler for RegisteredServerCreateParameters. 1115func (rscp RegisteredServerCreateParameters) MarshalJSON() ([]byte, error) { 1116 objectMap := make(map[string]interface{}) 1117 if rscp.RegisteredServerCreateParametersProperties != nil { 1118 objectMap["properties"] = rscp.RegisteredServerCreateParametersProperties 1119 } 1120 return json.Marshal(objectMap) 1121} 1122 1123// UnmarshalJSON is the custom unmarshaler for RegisteredServerCreateParameters struct. 1124func (rscp *RegisteredServerCreateParameters) UnmarshalJSON(body []byte) error { 1125 var m map[string]*json.RawMessage 1126 err := json.Unmarshal(body, &m) 1127 if err != nil { 1128 return err 1129 } 1130 for k, v := range m { 1131 switch k { 1132 case "properties": 1133 if v != nil { 1134 var registeredServerCreateParametersProperties RegisteredServerCreateParametersProperties 1135 err = json.Unmarshal(*v, ®isteredServerCreateParametersProperties) 1136 if err != nil { 1137 return err 1138 } 1139 rscp.RegisteredServerCreateParametersProperties = ®isteredServerCreateParametersProperties 1140 } 1141 case "id": 1142 if v != nil { 1143 var ID string 1144 err = json.Unmarshal(*v, &ID) 1145 if err != nil { 1146 return err 1147 } 1148 rscp.ID = &ID 1149 } 1150 case "name": 1151 if v != nil { 1152 var name string 1153 err = json.Unmarshal(*v, &name) 1154 if err != nil { 1155 return err 1156 } 1157 rscp.Name = &name 1158 } 1159 case "type": 1160 if v != nil { 1161 var typeVar string 1162 err = json.Unmarshal(*v, &typeVar) 1163 if err != nil { 1164 return err 1165 } 1166 rscp.Type = &typeVar 1167 } 1168 } 1169 } 1170 1171 return nil 1172} 1173 1174// RegisteredServerCreateParametersProperties ... 1175type RegisteredServerCreateParametersProperties struct { 1176 // ServerCertificate - Registered Server Certificate 1177 ServerCertificate *string `json:"serverCertificate,omitempty"` 1178 // AgentVersion - Registered Server Agent Version 1179 AgentVersion *string `json:"agentVersion,omitempty"` 1180 // ServerOSVersion - Registered Server OS Version 1181 ServerOSVersion *string `json:"serverOSVersion,omitempty"` 1182 // LastHeartBeat - Registered Server last heart beat 1183 LastHeartBeat *string `json:"lastHeartBeat,omitempty"` 1184 // ServerRole - Registered Server serverRole 1185 ServerRole *string `json:"serverRole,omitempty"` 1186 // ClusterID - Registered Server clusterId 1187 ClusterID *string `json:"clusterId,omitempty"` 1188 // ClusterName - Registered Server clusterName 1189 ClusterName *string `json:"clusterName,omitempty"` 1190 // ServerID - Registered Server serverId 1191 ServerID *string `json:"serverId,omitempty"` 1192 // FriendlyName - Friendly Name 1193 FriendlyName *string `json:"friendlyName,omitempty"` 1194} 1195 1196// RegisteredServerProperties registeredServer Properties object. 1197type RegisteredServerProperties struct { 1198 // ServerCertificate - Registered Server Certificate 1199 ServerCertificate *string `json:"serverCertificate,omitempty"` 1200 // AgentVersion - Registered Server Agent Version 1201 AgentVersion *string `json:"agentVersion,omitempty"` 1202 // ServerOSVersion - Registered Server OS Version 1203 ServerOSVersion *string `json:"serverOSVersion,omitempty"` 1204 // ServerManagementErrorCode - Registered Server Management Error Code 1205 ServerManagementErrorCode *int32 `json:"serverManagementErrorCode,omitempty"` 1206 // LastHeartBeat - Registered Server last heart beat 1207 LastHeartBeat *string `json:"lastHeartBeat,omitempty"` 1208 // ProvisioningState - Registered Server Provisioning State 1209 ProvisioningState *string `json:"provisioningState,omitempty"` 1210 // ServerRole - Registered Server serverRole 1211 ServerRole *string `json:"serverRole,omitempty"` 1212 // ClusterID - Registered Server clusterId 1213 ClusterID *string `json:"clusterId,omitempty"` 1214 // ClusterName - Registered Server clusterName 1215 ClusterName *string `json:"clusterName,omitempty"` 1216 // ServerID - Registered Server serverId 1217 ServerID *string `json:"serverId,omitempty"` 1218 // StorageSyncServiceUID - Registered Server storageSyncServiceUid 1219 StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"` 1220 // LastWorkflowID - Registered Server lastWorkflowId 1221 LastWorkflowID *string `json:"lastWorkflowId,omitempty"` 1222 // LastOperationName - Resource Last Operation Name 1223 LastOperationName *string `json:"lastOperationName,omitempty"` 1224 // DiscoveryEndpointURI - Resource discoveryEndpointUri 1225 DiscoveryEndpointURI *string `json:"discoveryEndpointUri,omitempty"` 1226 // ResourceLocation - Resource Location 1227 ResourceLocation *string `json:"resourceLocation,omitempty"` 1228 // ServiceLocation - Service Location 1229 ServiceLocation *string `json:"serviceLocation,omitempty"` 1230 // FriendlyName - Friendly Name 1231 FriendlyName *string `json:"friendlyName,omitempty"` 1232 // ManagementEndpointURI - Management Endpoint Uri 1233 ManagementEndpointURI *string `json:"managementEndpointUri,omitempty"` 1234 // MonitoringConfiguration - Monitoring Configuration 1235 MonitoringConfiguration *string `json:"monitoringConfiguration,omitempty"` 1236} 1237 1238// RegisteredServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1239// operation. 1240type RegisteredServersCreateFuture struct { 1241 azure.FutureAPI 1242 // Result returns the result of the asynchronous operation. 1243 // If the operation has not completed it will return an error. 1244 Result func(RegisteredServersClient) (RegisteredServer, error) 1245} 1246 1247// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1248func (future *RegisteredServersCreateFuture) UnmarshalJSON(body []byte) error { 1249 var azFuture azure.Future 1250 if err := json.Unmarshal(body, &azFuture); err != nil { 1251 return err 1252 } 1253 future.FutureAPI = &azFuture 1254 future.Result = future.result 1255 return nil 1256} 1257 1258// result is the default implementation for RegisteredServersCreateFuture.Result. 1259func (future *RegisteredServersCreateFuture) result(client RegisteredServersClient) (rs RegisteredServer, err error) { 1260 var done bool 1261 done, err = future.DoneWithContext(context.Background(), client) 1262 if err != nil { 1263 err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", future.Response(), "Polling failure") 1264 return 1265 } 1266 if !done { 1267 rs.Response.Response = future.Response() 1268 err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersCreateFuture") 1269 return 1270 } 1271 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1272 if rs.Response.Response, err = future.GetResult(sender); err == nil && rs.Response.Response.StatusCode != http.StatusNoContent { 1273 rs, err = client.CreateResponder(rs.Response.Response) 1274 if err != nil { 1275 err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", rs.Response.Response, "Failure responding to request") 1276 } 1277 } 1278 return 1279} 1280 1281// RegisteredServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1282// operation. 1283type RegisteredServersDeleteFuture struct { 1284 azure.FutureAPI 1285 // Result returns the result of the asynchronous operation. 1286 // If the operation has not completed it will return an error. 1287 Result func(RegisteredServersClient) (autorest.Response, error) 1288} 1289 1290// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1291func (future *RegisteredServersDeleteFuture) UnmarshalJSON(body []byte) error { 1292 var azFuture azure.Future 1293 if err := json.Unmarshal(body, &azFuture); err != nil { 1294 return err 1295 } 1296 future.FutureAPI = &azFuture 1297 future.Result = future.result 1298 return nil 1299} 1300 1301// result is the default implementation for RegisteredServersDeleteFuture.Result. 1302func (future *RegisteredServersDeleteFuture) result(client RegisteredServersClient) (ar autorest.Response, err error) { 1303 var done bool 1304 done, err = future.DoneWithContext(context.Background(), client) 1305 if err != nil { 1306 err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersDeleteFuture", "Result", future.Response(), "Polling failure") 1307 return 1308 } 1309 if !done { 1310 ar.Response = future.Response() 1311 err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersDeleteFuture") 1312 return 1313 } 1314 ar.Response = future.Response() 1315 return 1316} 1317 1318// RegisteredServersTriggerRolloverFuture an abstraction for monitoring and retrieving the results of a 1319// long-running operation. 1320type RegisteredServersTriggerRolloverFuture struct { 1321 azure.FutureAPI 1322 // Result returns the result of the asynchronous operation. 1323 // If the operation has not completed it will return an error. 1324 Result func(RegisteredServersClient) (autorest.Response, error) 1325} 1326 1327// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1328func (future *RegisteredServersTriggerRolloverFuture) UnmarshalJSON(body []byte) error { 1329 var azFuture azure.Future 1330 if err := json.Unmarshal(body, &azFuture); err != nil { 1331 return err 1332 } 1333 future.FutureAPI = &azFuture 1334 future.Result = future.result 1335 return nil 1336} 1337 1338// result is the default implementation for RegisteredServersTriggerRolloverFuture.Result. 1339func (future *RegisteredServersTriggerRolloverFuture) result(client RegisteredServersClient) (ar autorest.Response, err error) { 1340 var done bool 1341 done, err = future.DoneWithContext(context.Background(), client) 1342 if err != nil { 1343 err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersTriggerRolloverFuture", "Result", future.Response(), "Polling failure") 1344 return 1345 } 1346 if !done { 1347 ar.Response = future.Response() 1348 err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersTriggerRolloverFuture") 1349 return 1350 } 1351 ar.Response = future.Response() 1352 return 1353} 1354 1355// Resource common fields that are returned in the response for all Azure Resource Manager resources 1356type Resource struct { 1357 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1358 ID *string `json:"id,omitempty"` 1359 // Name - READ-ONLY; The name of the resource 1360 Name *string `json:"name,omitempty"` 1361 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1362 Type *string `json:"type,omitempty"` 1363} 1364 1365// MarshalJSON is the custom marshaler for Resource. 1366func (r Resource) MarshalJSON() ([]byte, error) { 1367 objectMap := make(map[string]interface{}) 1368 return json.Marshal(objectMap) 1369} 1370 1371// ResourcesMoveInfo resource Move Info. 1372type ResourcesMoveInfo struct { 1373 // TargetResourceGroup - Target resource group. 1374 TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` 1375 // Resources - Collection of Resources. 1376 Resources *[]string `json:"resources,omitempty"` 1377} 1378 1379// RestoreFileSpec restore file spec. 1380type RestoreFileSpec struct { 1381 // Path - Restore file spec path 1382 Path *string `json:"path,omitempty"` 1383 // Isdir - Restore file spec isdir 1384 Isdir *bool `json:"isdir,omitempty"` 1385} 1386 1387// ServerEndpoint server Endpoint object. 1388type ServerEndpoint struct { 1389 autorest.Response `json:"-"` 1390 // ServerEndpointProperties - Server Endpoint properties. 1391 *ServerEndpointProperties `json:"properties,omitempty"` 1392 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1393 ID *string `json:"id,omitempty"` 1394 // Name - READ-ONLY; The name of the resource 1395 Name *string `json:"name,omitempty"` 1396 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1397 Type *string `json:"type,omitempty"` 1398} 1399 1400// MarshalJSON is the custom marshaler for ServerEndpoint. 1401func (se ServerEndpoint) MarshalJSON() ([]byte, error) { 1402 objectMap := make(map[string]interface{}) 1403 if se.ServerEndpointProperties != nil { 1404 objectMap["properties"] = se.ServerEndpointProperties 1405 } 1406 return json.Marshal(objectMap) 1407} 1408 1409// UnmarshalJSON is the custom unmarshaler for ServerEndpoint struct. 1410func (se *ServerEndpoint) UnmarshalJSON(body []byte) error { 1411 var m map[string]*json.RawMessage 1412 err := json.Unmarshal(body, &m) 1413 if err != nil { 1414 return err 1415 } 1416 for k, v := range m { 1417 switch k { 1418 case "properties": 1419 if v != nil { 1420 var serverEndpointProperties ServerEndpointProperties 1421 err = json.Unmarshal(*v, &serverEndpointProperties) 1422 if err != nil { 1423 return err 1424 } 1425 se.ServerEndpointProperties = &serverEndpointProperties 1426 } 1427 case "id": 1428 if v != nil { 1429 var ID string 1430 err = json.Unmarshal(*v, &ID) 1431 if err != nil { 1432 return err 1433 } 1434 se.ID = &ID 1435 } 1436 case "name": 1437 if v != nil { 1438 var name string 1439 err = json.Unmarshal(*v, &name) 1440 if err != nil { 1441 return err 1442 } 1443 se.Name = &name 1444 } 1445 case "type": 1446 if v != nil { 1447 var typeVar string 1448 err = json.Unmarshal(*v, &typeVar) 1449 if err != nil { 1450 return err 1451 } 1452 se.Type = &typeVar 1453 } 1454 } 1455 } 1456 1457 return nil 1458} 1459 1460// ServerEndpointArray array of ServerEndpoint 1461type ServerEndpointArray struct { 1462 autorest.Response `json:"-"` 1463 // Value - Collection of ServerEndpoint. 1464 Value *[]ServerEndpoint `json:"value,omitempty"` 1465} 1466 1467// ServerEndpointCloudTieringStatus server endpoint cloud tiering status object. 1468type ServerEndpointCloudTieringStatus struct { 1469 // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp 1470 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 1471 // Health - READ-ONLY; Cloud tiering health state. Possible values include: 'HealthHealthy', 'HealthError' 1472 Health Health `json:"health,omitempty"` 1473 // HealthLastUpdatedTimestamp - READ-ONLY; The last updated timestamp of health state 1474 HealthLastUpdatedTimestamp *date.Time `json:"healthLastUpdatedTimestamp,omitempty"` 1475 // LastCloudTieringResult - READ-ONLY; Last cloud tiering result (HResult) 1476 LastCloudTieringResult *int32 `json:"lastCloudTieringResult,omitempty"` 1477 // LastSuccessTimestamp - READ-ONLY; Last cloud tiering success timestamp 1478 LastSuccessTimestamp *date.Time `json:"lastSuccessTimestamp,omitempty"` 1479 // SpaceSavings - READ-ONLY; Information regarding how much local space cloud tiering is saving. 1480 SpaceSavings *CloudTieringSpaceSavings `json:"spaceSavings,omitempty"` 1481 // CachePerformance - READ-ONLY; Information regarding how well the local cache on the server is performing. 1482 CachePerformance *CloudTieringCachePerformance `json:"cachePerformance,omitempty"` 1483 // FilesNotTiering - READ-ONLY; Information regarding files that failed to be tiered 1484 FilesNotTiering *CloudTieringFilesNotTiering `json:"filesNotTiering,omitempty"` 1485 // VolumeFreeSpacePolicyStatus - READ-ONLY; Status of the volume free space policy 1486 VolumeFreeSpacePolicyStatus *CloudTieringVolumeFreeSpacePolicyStatus `json:"volumeFreeSpacePolicyStatus,omitempty"` 1487 // DatePolicyStatus - READ-ONLY; Status of the date policy 1488 DatePolicyStatus *CloudTieringDatePolicyStatus `json:"datePolicyStatus,omitempty"` 1489} 1490 1491// MarshalJSON is the custom marshaler for ServerEndpointCloudTieringStatus. 1492func (sects ServerEndpointCloudTieringStatus) MarshalJSON() ([]byte, error) { 1493 objectMap := make(map[string]interface{}) 1494 return json.Marshal(objectMap) 1495} 1496 1497// ServerEndpointCreateParameters the parameters used when creating a server endpoint. 1498type ServerEndpointCreateParameters struct { 1499 // ServerEndpointCreateParametersProperties - The parameters used to create the server endpoint. 1500 *ServerEndpointCreateParametersProperties `json:"properties,omitempty"` 1501 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1502 ID *string `json:"id,omitempty"` 1503 // Name - READ-ONLY; The name of the resource 1504 Name *string `json:"name,omitempty"` 1505 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1506 Type *string `json:"type,omitempty"` 1507} 1508 1509// MarshalJSON is the custom marshaler for ServerEndpointCreateParameters. 1510func (secp ServerEndpointCreateParameters) MarshalJSON() ([]byte, error) { 1511 objectMap := make(map[string]interface{}) 1512 if secp.ServerEndpointCreateParametersProperties != nil { 1513 objectMap["properties"] = secp.ServerEndpointCreateParametersProperties 1514 } 1515 return json.Marshal(objectMap) 1516} 1517 1518// UnmarshalJSON is the custom unmarshaler for ServerEndpointCreateParameters struct. 1519func (secp *ServerEndpointCreateParameters) UnmarshalJSON(body []byte) error { 1520 var m map[string]*json.RawMessage 1521 err := json.Unmarshal(body, &m) 1522 if err != nil { 1523 return err 1524 } 1525 for k, v := range m { 1526 switch k { 1527 case "properties": 1528 if v != nil { 1529 var serverEndpointCreateParametersProperties ServerEndpointCreateParametersProperties 1530 err = json.Unmarshal(*v, &serverEndpointCreateParametersProperties) 1531 if err != nil { 1532 return err 1533 } 1534 secp.ServerEndpointCreateParametersProperties = &serverEndpointCreateParametersProperties 1535 } 1536 case "id": 1537 if v != nil { 1538 var ID string 1539 err = json.Unmarshal(*v, &ID) 1540 if err != nil { 1541 return err 1542 } 1543 secp.ID = &ID 1544 } 1545 case "name": 1546 if v != nil { 1547 var name string 1548 err = json.Unmarshal(*v, &name) 1549 if err != nil { 1550 return err 1551 } 1552 secp.Name = &name 1553 } 1554 case "type": 1555 if v != nil { 1556 var typeVar string 1557 err = json.Unmarshal(*v, &typeVar) 1558 if err != nil { 1559 return err 1560 } 1561 secp.Type = &typeVar 1562 } 1563 } 1564 } 1565 1566 return nil 1567} 1568 1569// ServerEndpointCreateParametersProperties serverEndpoint Properties object. 1570type ServerEndpointCreateParametersProperties struct { 1571 // ServerLocalPath - Server Local path. 1572 ServerLocalPath *string `json:"serverLocalPath,omitempty"` 1573 // CloudTiering - Cloud Tiering. Possible values include: 'On', 'Off' 1574 CloudTiering CloudTiering `json:"cloudTiering,omitempty"` 1575 // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. 1576 VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` 1577 // TierFilesOlderThanDays - Tier files older than days. 1578 TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"` 1579 // FriendlyName - Friendly Name 1580 FriendlyName *string `json:"friendlyName,omitempty"` 1581 // ServerResourceID - Server Resource Id. 1582 ServerResourceID *string `json:"serverResourceId,omitempty"` 1583 // OfflineDataTransfer - Offline data transfer. Possible values include: 'OfflineDataTransferOn', 'OfflineDataTransferOff' 1584 OfflineDataTransfer OfflineDataTransfer `json:"offlineDataTransfer,omitempty"` 1585 // OfflineDataTransferShareName - Offline data transfer share name 1586 OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"` 1587} 1588 1589// ServerEndpointFilesNotSyncingError files not syncing error object 1590type ServerEndpointFilesNotSyncingError struct { 1591 // ErrorCode - READ-ONLY; Error code (HResult) 1592 ErrorCode *int32 `json:"errorCode,omitempty"` 1593 // PersistentCount - READ-ONLY; Count of persistent files not syncing with the specified error code 1594 PersistentCount *int64 `json:"persistentCount,omitempty"` 1595 // TransientCount - READ-ONLY; Count of transient files not syncing with the specified error code 1596 TransientCount *int64 `json:"transientCount,omitempty"` 1597} 1598 1599// MarshalJSON is the custom marshaler for ServerEndpointFilesNotSyncingError. 1600func (sefnse ServerEndpointFilesNotSyncingError) MarshalJSON() ([]byte, error) { 1601 objectMap := make(map[string]interface{}) 1602 return json.Marshal(objectMap) 1603} 1604 1605// ServerEndpointProperties serverEndpoint Properties object. 1606type ServerEndpointProperties struct { 1607 // ServerLocalPath - Server Local path. 1608 ServerLocalPath *string `json:"serverLocalPath,omitempty"` 1609 // CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering2On', 'CloudTiering2Off' 1610 CloudTiering CloudTiering2 `json:"cloudTiering,omitempty"` 1611 // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. 1612 VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` 1613 // TierFilesOlderThanDays - Tier files older than days. 1614 TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"` 1615 // FriendlyName - Friendly Name 1616 FriendlyName *string `json:"friendlyName,omitempty"` 1617 // ServerResourceID - Server Resource Id. 1618 ServerResourceID *string `json:"serverResourceId,omitempty"` 1619 // ProvisioningState - READ-ONLY; ServerEndpoint Provisioning State 1620 ProvisioningState *string `json:"provisioningState,omitempty"` 1621 // LastWorkflowID - READ-ONLY; ServerEndpoint lastWorkflowId 1622 LastWorkflowID *string `json:"lastWorkflowId,omitempty"` 1623 // LastOperationName - READ-ONLY; Resource Last Operation Name 1624 LastOperationName *string `json:"lastOperationName,omitempty"` 1625 // SyncStatus - READ-ONLY; Server Endpoint sync status 1626 SyncStatus *ServerEndpointSyncStatus `json:"syncStatus,omitempty"` 1627 // OfflineDataTransfer - Offline data transfer. Possible values include: 'OfflineDataTransfer2On', 'OfflineDataTransfer2Off' 1628 OfflineDataTransfer OfflineDataTransfer2 `json:"offlineDataTransfer,omitempty"` 1629 // OfflineDataTransferStorageAccountResourceID - READ-ONLY; Offline data transfer storage account resource ID 1630 OfflineDataTransferStorageAccountResourceID *string `json:"offlineDataTransferStorageAccountResourceId,omitempty"` 1631 // OfflineDataTransferStorageAccountTenantID - READ-ONLY; Offline data transfer storage account tenant ID 1632 OfflineDataTransferStorageAccountTenantID *string `json:"offlineDataTransferStorageAccountTenantId,omitempty"` 1633 // OfflineDataTransferShareName - Offline data transfer share name 1634 OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"` 1635 // CloudTieringStatus - READ-ONLY; Cloud tiering status. Only populated if cloud tiering is enabled. 1636 CloudTieringStatus *ServerEndpointCloudTieringStatus `json:"cloudTieringStatus,omitempty"` 1637 // RecallStatus - READ-ONLY; Recall status. Only populated if cloud tiering is enabled. 1638 RecallStatus *ServerEndpointRecallStatus `json:"recallStatus,omitempty"` 1639} 1640 1641// MarshalJSON is the custom marshaler for ServerEndpointProperties. 1642func (sep ServerEndpointProperties) MarshalJSON() ([]byte, error) { 1643 objectMap := make(map[string]interface{}) 1644 if sep.ServerLocalPath != nil { 1645 objectMap["serverLocalPath"] = sep.ServerLocalPath 1646 } 1647 if sep.CloudTiering != "" { 1648 objectMap["cloudTiering"] = sep.CloudTiering 1649 } 1650 if sep.VolumeFreeSpacePercent != nil { 1651 objectMap["volumeFreeSpacePercent"] = sep.VolumeFreeSpacePercent 1652 } 1653 if sep.TierFilesOlderThanDays != nil { 1654 objectMap["tierFilesOlderThanDays"] = sep.TierFilesOlderThanDays 1655 } 1656 if sep.FriendlyName != nil { 1657 objectMap["friendlyName"] = sep.FriendlyName 1658 } 1659 if sep.ServerResourceID != nil { 1660 objectMap["serverResourceId"] = sep.ServerResourceID 1661 } 1662 if sep.OfflineDataTransfer != "" { 1663 objectMap["offlineDataTransfer"] = sep.OfflineDataTransfer 1664 } 1665 if sep.OfflineDataTransferShareName != nil { 1666 objectMap["offlineDataTransferShareName"] = sep.OfflineDataTransferShareName 1667 } 1668 return json.Marshal(objectMap) 1669} 1670 1671// ServerEndpointRecallError server endpoint recall error object 1672type ServerEndpointRecallError struct { 1673 // ErrorCode - READ-ONLY; Error code (HResult) 1674 ErrorCode *int32 `json:"errorCode,omitempty"` 1675 // Count - READ-ONLY; Count of occurences of the error 1676 Count *int64 `json:"count,omitempty"` 1677} 1678 1679// MarshalJSON is the custom marshaler for ServerEndpointRecallError. 1680func (sere ServerEndpointRecallError) MarshalJSON() ([]byte, error) { 1681 objectMap := make(map[string]interface{}) 1682 return json.Marshal(objectMap) 1683} 1684 1685// ServerEndpointRecallStatus server endpoint recall status object. 1686type ServerEndpointRecallStatus struct { 1687 // LastUpdatedTimestamp - READ-ONLY; Last updated timestamp 1688 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 1689 // TotalRecallErrorsCount - READ-ONLY; Total count of recall errors. 1690 TotalRecallErrorsCount *int64 `json:"totalRecallErrorsCount,omitempty"` 1691 // RecallErrors - READ-ONLY; Array of recall errors 1692 RecallErrors *[]ServerEndpointRecallError `json:"recallErrors,omitempty"` 1693} 1694 1695// MarshalJSON is the custom marshaler for ServerEndpointRecallStatus. 1696func (sers ServerEndpointRecallStatus) MarshalJSON() ([]byte, error) { 1697 objectMap := make(map[string]interface{}) 1698 return json.Marshal(objectMap) 1699} 1700 1701// ServerEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1702// operation. 1703type ServerEndpointsCreateFuture struct { 1704 azure.FutureAPI 1705 // Result returns the result of the asynchronous operation. 1706 // If the operation has not completed it will return an error. 1707 Result func(ServerEndpointsClient) (ServerEndpoint, error) 1708} 1709 1710// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1711func (future *ServerEndpointsCreateFuture) UnmarshalJSON(body []byte) error { 1712 var azFuture azure.Future 1713 if err := json.Unmarshal(body, &azFuture); err != nil { 1714 return err 1715 } 1716 future.FutureAPI = &azFuture 1717 future.Result = future.result 1718 return nil 1719} 1720 1721// result is the default implementation for ServerEndpointsCreateFuture.Result. 1722func (future *ServerEndpointsCreateFuture) result(client ServerEndpointsClient) (se ServerEndpoint, err error) { 1723 var done bool 1724 done, err = future.DoneWithContext(context.Background(), client) 1725 if err != nil { 1726 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", future.Response(), "Polling failure") 1727 return 1728 } 1729 if !done { 1730 se.Response.Response = future.Response() 1731 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsCreateFuture") 1732 return 1733 } 1734 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1735 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { 1736 se, err = client.CreateResponder(se.Response.Response) 1737 if err != nil { 1738 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request") 1739 } 1740 } 1741 return 1742} 1743 1744// ServerEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1745// operation. 1746type ServerEndpointsDeleteFuture struct { 1747 azure.FutureAPI 1748 // Result returns the result of the asynchronous operation. 1749 // If the operation has not completed it will return an error. 1750 Result func(ServerEndpointsClient) (autorest.Response, error) 1751} 1752 1753// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1754func (future *ServerEndpointsDeleteFuture) UnmarshalJSON(body []byte) error { 1755 var azFuture azure.Future 1756 if err := json.Unmarshal(body, &azFuture); err != nil { 1757 return err 1758 } 1759 future.FutureAPI = &azFuture 1760 future.Result = future.result 1761 return nil 1762} 1763 1764// result is the default implementation for ServerEndpointsDeleteFuture.Result. 1765func (future *ServerEndpointsDeleteFuture) result(client ServerEndpointsClient) (ar autorest.Response, err error) { 1766 var done bool 1767 done, err = future.DoneWithContext(context.Background(), client) 1768 if err != nil { 1769 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsDeleteFuture", "Result", future.Response(), "Polling failure") 1770 return 1771 } 1772 if !done { 1773 ar.Response = future.Response() 1774 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsDeleteFuture") 1775 return 1776 } 1777 ar.Response = future.Response() 1778 return 1779} 1780 1781// ServerEndpointsRecallActionFuture an abstraction for monitoring and retrieving the results of a 1782// long-running operation. 1783type ServerEndpointsRecallActionFuture struct { 1784 azure.FutureAPI 1785 // Result returns the result of the asynchronous operation. 1786 // If the operation has not completed it will return an error. 1787 Result func(ServerEndpointsClient) (autorest.Response, error) 1788} 1789 1790// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1791func (future *ServerEndpointsRecallActionFuture) UnmarshalJSON(body []byte) error { 1792 var azFuture azure.Future 1793 if err := json.Unmarshal(body, &azFuture); err != nil { 1794 return err 1795 } 1796 future.FutureAPI = &azFuture 1797 future.Result = future.result 1798 return nil 1799} 1800 1801// result is the default implementation for ServerEndpointsRecallActionFuture.Result. 1802func (future *ServerEndpointsRecallActionFuture) result(client ServerEndpointsClient) (ar autorest.Response, err error) { 1803 var done bool 1804 done, err = future.DoneWithContext(context.Background(), client) 1805 if err != nil { 1806 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsRecallActionFuture", "Result", future.Response(), "Polling failure") 1807 return 1808 } 1809 if !done { 1810 ar.Response = future.Response() 1811 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsRecallActionFuture") 1812 return 1813 } 1814 ar.Response = future.Response() 1815 return 1816} 1817 1818// ServerEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1819// operation. 1820type ServerEndpointsUpdateFuture struct { 1821 azure.FutureAPI 1822 // Result returns the result of the asynchronous operation. 1823 // If the operation has not completed it will return an error. 1824 Result func(ServerEndpointsClient) (ServerEndpoint, error) 1825} 1826 1827// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1828func (future *ServerEndpointsUpdateFuture) UnmarshalJSON(body []byte) error { 1829 var azFuture azure.Future 1830 if err := json.Unmarshal(body, &azFuture); err != nil { 1831 return err 1832 } 1833 future.FutureAPI = &azFuture 1834 future.Result = future.result 1835 return nil 1836} 1837 1838// result is the default implementation for ServerEndpointsUpdateFuture.Result. 1839func (future *ServerEndpointsUpdateFuture) result(client ServerEndpointsClient) (se ServerEndpoint, err error) { 1840 var done bool 1841 done, err = future.DoneWithContext(context.Background(), client) 1842 if err != nil { 1843 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", future.Response(), "Polling failure") 1844 return 1845 } 1846 if !done { 1847 se.Response.Response = future.Response() 1848 err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsUpdateFuture") 1849 return 1850 } 1851 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1852 if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent { 1853 se, err = client.UpdateResponder(se.Response.Response) 1854 if err != nil { 1855 err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request") 1856 } 1857 } 1858 return 1859} 1860 1861// ServerEndpointSyncStatus server Endpoint sync status 1862type ServerEndpointSyncStatus struct { 1863 // DownloadHealth - READ-ONLY; Download Health Status. Possible values include: 'DownloadHealthHealthy', 'DownloadHealthError', 'DownloadHealthSyncBlockedForRestore', 'DownloadHealthSyncBlockedForChangeDetectionPostRestore', 'DownloadHealthNoActivity' 1864 DownloadHealth DownloadHealth `json:"downloadHealth,omitempty"` 1865 // UploadHealth - READ-ONLY; Upload Health Status. Possible values include: 'UploadHealthHealthy', 'UploadHealthError', 'UploadHealthSyncBlockedForRestore', 'UploadHealthSyncBlockedForChangeDetectionPostRestore', 'UploadHealthNoActivity' 1866 UploadHealth UploadHealth `json:"uploadHealth,omitempty"` 1867 // CombinedHealth - READ-ONLY; Combined Health Status. Possible values include: 'CombinedHealthHealthy', 'CombinedHealthError', 'CombinedHealthSyncBlockedForRestore', 'CombinedHealthSyncBlockedForChangeDetectionPostRestore', 'CombinedHealthNoActivity' 1868 CombinedHealth CombinedHealth `json:"combinedHealth,omitempty"` 1869 // SyncActivity - READ-ONLY; Sync activity. Possible values include: 'Upload', 'Download', 'UploadAndDownload' 1870 SyncActivity SyncActivity `json:"syncActivity,omitempty"` 1871 // TotalPersistentFilesNotSyncingCount - READ-ONLY; Total count of persistent files not syncing (combined upload + download). 1872 TotalPersistentFilesNotSyncingCount *int64 `json:"totalPersistentFilesNotSyncingCount,omitempty"` 1873 // LastUpdatedTimestamp - READ-ONLY; Last Updated Timestamp 1874 LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` 1875 // UploadStatus - READ-ONLY; Upload Status 1876 UploadStatus *SyncSessionStatus `json:"uploadStatus,omitempty"` 1877 // DownloadStatus - READ-ONLY; Download Status 1878 DownloadStatus *SyncSessionStatus `json:"downloadStatus,omitempty"` 1879 // UploadActivity - READ-ONLY; Upload sync activity 1880 UploadActivity *SyncActivityStatus `json:"uploadActivity,omitempty"` 1881 // DownloadActivity - READ-ONLY; Download sync activity 1882 DownloadActivity *SyncActivityStatus `json:"downloadActivity,omitempty"` 1883 // OfflineDataTransferStatus - READ-ONLY; Offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' 1884 OfflineDataTransferStatus OfflineDataTransferStatus `json:"offlineDataTransferStatus,omitempty"` 1885} 1886 1887// MarshalJSON is the custom marshaler for ServerEndpointSyncStatus. 1888func (sess ServerEndpointSyncStatus) MarshalJSON() ([]byte, error) { 1889 objectMap := make(map[string]interface{}) 1890 return json.Marshal(objectMap) 1891} 1892 1893// ServerEndpointUpdateParameters parameters for updating an Server Endpoint. 1894type ServerEndpointUpdateParameters struct { 1895 // ServerEndpointUpdateProperties - The properties of the server endpoint. 1896 *ServerEndpointUpdateProperties `json:"properties,omitempty"` 1897} 1898 1899// MarshalJSON is the custom marshaler for ServerEndpointUpdateParameters. 1900func (seup ServerEndpointUpdateParameters) MarshalJSON() ([]byte, error) { 1901 objectMap := make(map[string]interface{}) 1902 if seup.ServerEndpointUpdateProperties != nil { 1903 objectMap["properties"] = seup.ServerEndpointUpdateProperties 1904 } 1905 return json.Marshal(objectMap) 1906} 1907 1908// UnmarshalJSON is the custom unmarshaler for ServerEndpointUpdateParameters struct. 1909func (seup *ServerEndpointUpdateParameters) UnmarshalJSON(body []byte) error { 1910 var m map[string]*json.RawMessage 1911 err := json.Unmarshal(body, &m) 1912 if err != nil { 1913 return err 1914 } 1915 for k, v := range m { 1916 switch k { 1917 case "properties": 1918 if v != nil { 1919 var serverEndpointUpdateProperties ServerEndpointUpdateProperties 1920 err = json.Unmarshal(*v, &serverEndpointUpdateProperties) 1921 if err != nil { 1922 return err 1923 } 1924 seup.ServerEndpointUpdateProperties = &serverEndpointUpdateProperties 1925 } 1926 } 1927 } 1928 1929 return nil 1930} 1931 1932// ServerEndpointUpdateProperties serverEndpoint Update Properties object. 1933type ServerEndpointUpdateProperties struct { 1934 // CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering1On', 'CloudTiering1Off' 1935 CloudTiering CloudTiering1 `json:"cloudTiering,omitempty"` 1936 // VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled. 1937 VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"` 1938 // TierFilesOlderThanDays - Tier files older than days. 1939 TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"` 1940 // OfflineDataTransfer - Offline data transfer. Possible values include: 'OfflineDataTransfer1On', 'OfflineDataTransfer1Off' 1941 OfflineDataTransfer OfflineDataTransfer1 `json:"offlineDataTransfer,omitempty"` 1942 // OfflineDataTransferShareName - Offline data transfer share name 1943 OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"` 1944} 1945 1946// Service storage Sync Service object. 1947type Service struct { 1948 autorest.Response `json:"-"` 1949 // ServiceProperties - Storage Sync Service properties. 1950 *ServiceProperties `json:"properties,omitempty"` 1951 // Tags - Resource tags. 1952 Tags map[string]*string `json:"tags"` 1953 // Location - The geo-location where the resource lives 1954 Location *string `json:"location,omitempty"` 1955 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1956 ID *string `json:"id,omitempty"` 1957 // Name - READ-ONLY; The name of the resource 1958 Name *string `json:"name,omitempty"` 1959 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1960 Type *string `json:"type,omitempty"` 1961} 1962 1963// MarshalJSON is the custom marshaler for Service. 1964func (s Service) MarshalJSON() ([]byte, error) { 1965 objectMap := make(map[string]interface{}) 1966 if s.ServiceProperties != nil { 1967 objectMap["properties"] = s.ServiceProperties 1968 } 1969 if s.Tags != nil { 1970 objectMap["tags"] = s.Tags 1971 } 1972 if s.Location != nil { 1973 objectMap["location"] = s.Location 1974 } 1975 return json.Marshal(objectMap) 1976} 1977 1978// UnmarshalJSON is the custom unmarshaler for Service struct. 1979func (s *Service) UnmarshalJSON(body []byte) error { 1980 var m map[string]*json.RawMessage 1981 err := json.Unmarshal(body, &m) 1982 if err != nil { 1983 return err 1984 } 1985 for k, v := range m { 1986 switch k { 1987 case "properties": 1988 if v != nil { 1989 var serviceProperties ServiceProperties 1990 err = json.Unmarshal(*v, &serviceProperties) 1991 if err != nil { 1992 return err 1993 } 1994 s.ServiceProperties = &serviceProperties 1995 } 1996 case "tags": 1997 if v != nil { 1998 var tags map[string]*string 1999 err = json.Unmarshal(*v, &tags) 2000 if err != nil { 2001 return err 2002 } 2003 s.Tags = tags 2004 } 2005 case "location": 2006 if v != nil { 2007 var location string 2008 err = json.Unmarshal(*v, &location) 2009 if err != nil { 2010 return err 2011 } 2012 s.Location = &location 2013 } 2014 case "id": 2015 if v != nil { 2016 var ID string 2017 err = json.Unmarshal(*v, &ID) 2018 if err != nil { 2019 return err 2020 } 2021 s.ID = &ID 2022 } 2023 case "name": 2024 if v != nil { 2025 var name string 2026 err = json.Unmarshal(*v, &name) 2027 if err != nil { 2028 return err 2029 } 2030 s.Name = &name 2031 } 2032 case "type": 2033 if v != nil { 2034 var typeVar string 2035 err = json.Unmarshal(*v, &typeVar) 2036 if err != nil { 2037 return err 2038 } 2039 s.Type = &typeVar 2040 } 2041 } 2042 } 2043 2044 return nil 2045} 2046 2047// ServiceArray array of StorageSyncServices 2048type ServiceArray struct { 2049 autorest.Response `json:"-"` 2050 // Value - Collection of StorageSyncServices. 2051 Value *[]Service `json:"value,omitempty"` 2052} 2053 2054// ServiceCreateParameters the parameters used when creating a storage sync service. 2055type ServiceCreateParameters struct { 2056 // 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. 2057 Location *string `json:"location,omitempty"` 2058 // 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. 2059 Tags map[string]*string `json:"tags"` 2060 Properties interface{} `json:"properties,omitempty"` 2061} 2062 2063// MarshalJSON is the custom marshaler for ServiceCreateParameters. 2064func (scp ServiceCreateParameters) MarshalJSON() ([]byte, error) { 2065 objectMap := make(map[string]interface{}) 2066 if scp.Location != nil { 2067 objectMap["location"] = scp.Location 2068 } 2069 if scp.Tags != nil { 2070 objectMap["tags"] = scp.Tags 2071 } 2072 if scp.Properties != nil { 2073 objectMap["properties"] = scp.Properties 2074 } 2075 return json.Marshal(objectMap) 2076} 2077 2078// ServiceProperties storage Sync Service Properties object. 2079type ServiceProperties struct { 2080 // StorageSyncServiceStatus - READ-ONLY; Storage Sync service status. 2081 StorageSyncServiceStatus *int32 `json:"storageSyncServiceStatus,omitempty"` 2082 // StorageSyncServiceUID - READ-ONLY; Storage Sync service Uid 2083 StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"` 2084} 2085 2086// MarshalJSON is the custom marshaler for ServiceProperties. 2087func (sp ServiceProperties) MarshalJSON() ([]byte, error) { 2088 objectMap := make(map[string]interface{}) 2089 return json.Marshal(objectMap) 2090} 2091 2092// ServiceUpdateParameters parameters for updating an Storage sync service. 2093type ServiceUpdateParameters struct { 2094 // Tags - The user-specified tags associated with the storage sync service. 2095 Tags map[string]*string `json:"tags"` 2096 // Properties - The properties of the storage sync service. 2097 Properties interface{} `json:"properties,omitempty"` 2098} 2099 2100// MarshalJSON is the custom marshaler for ServiceUpdateParameters. 2101func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) { 2102 objectMap := make(map[string]interface{}) 2103 if sup.Tags != nil { 2104 objectMap["tags"] = sup.Tags 2105 } 2106 if sup.Properties != nil { 2107 objectMap["properties"] = sup.Properties 2108 } 2109 return json.Marshal(objectMap) 2110} 2111 2112// SubscriptionState subscription State object. 2113type SubscriptionState struct { 2114 // State - State of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted' 2115 State Reason `json:"state,omitempty"` 2116 // Istransitioning - READ-ONLY; Is Transitioning 2117 Istransitioning *bool `json:"istransitioning,omitempty"` 2118 // Properties - Subscription state properties. 2119 Properties interface{} `json:"properties,omitempty"` 2120} 2121 2122// MarshalJSON is the custom marshaler for SubscriptionState. 2123func (ss SubscriptionState) MarshalJSON() ([]byte, error) { 2124 objectMap := make(map[string]interface{}) 2125 if ss.State != "" { 2126 objectMap["state"] = ss.State 2127 } 2128 if ss.Properties != nil { 2129 objectMap["properties"] = ss.Properties 2130 } 2131 return json.Marshal(objectMap) 2132} 2133 2134// SyncActivityStatus sync Session status object. 2135type SyncActivityStatus struct { 2136 // Timestamp - READ-ONLY; Timestamp when properties were updated 2137 Timestamp *date.Time `json:"timestamp,omitempty"` 2138 // PerItemErrorCount - READ-ONLY; Per item error count 2139 PerItemErrorCount *int64 `json:"perItemErrorCount,omitempty"` 2140 // AppliedItemCount - READ-ONLY; Applied item count. 2141 AppliedItemCount *int64 `json:"appliedItemCount,omitempty"` 2142 // TotalItemCount - READ-ONLY; Total item count (if available) 2143 TotalItemCount *int64 `json:"totalItemCount,omitempty"` 2144 // AppliedBytes - READ-ONLY; Applied bytes 2145 AppliedBytes *int64 `json:"appliedBytes,omitempty"` 2146 // TotalBytes - READ-ONLY; Total bytes (if available) 2147 TotalBytes *int64 `json:"totalBytes,omitempty"` 2148} 2149 2150// MarshalJSON is the custom marshaler for SyncActivityStatus. 2151func (sas SyncActivityStatus) MarshalJSON() ([]byte, error) { 2152 objectMap := make(map[string]interface{}) 2153 return json.Marshal(objectMap) 2154} 2155 2156// SyncGroup sync Group object. 2157type SyncGroup struct { 2158 autorest.Response `json:"-"` 2159 // SyncGroupProperties - SyncGroup properties. 2160 *SyncGroupProperties `json:"properties,omitempty"` 2161 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2162 ID *string `json:"id,omitempty"` 2163 // Name - READ-ONLY; The name of the resource 2164 Name *string `json:"name,omitempty"` 2165 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2166 Type *string `json:"type,omitempty"` 2167} 2168 2169// MarshalJSON is the custom marshaler for SyncGroup. 2170func (sg SyncGroup) MarshalJSON() ([]byte, error) { 2171 objectMap := make(map[string]interface{}) 2172 if sg.SyncGroupProperties != nil { 2173 objectMap["properties"] = sg.SyncGroupProperties 2174 } 2175 return json.Marshal(objectMap) 2176} 2177 2178// UnmarshalJSON is the custom unmarshaler for SyncGroup struct. 2179func (sg *SyncGroup) UnmarshalJSON(body []byte) error { 2180 var m map[string]*json.RawMessage 2181 err := json.Unmarshal(body, &m) 2182 if err != nil { 2183 return err 2184 } 2185 for k, v := range m { 2186 switch k { 2187 case "properties": 2188 if v != nil { 2189 var syncGroupProperties SyncGroupProperties 2190 err = json.Unmarshal(*v, &syncGroupProperties) 2191 if err != nil { 2192 return err 2193 } 2194 sg.SyncGroupProperties = &syncGroupProperties 2195 } 2196 case "id": 2197 if v != nil { 2198 var ID string 2199 err = json.Unmarshal(*v, &ID) 2200 if err != nil { 2201 return err 2202 } 2203 sg.ID = &ID 2204 } 2205 case "name": 2206 if v != nil { 2207 var name string 2208 err = json.Unmarshal(*v, &name) 2209 if err != nil { 2210 return err 2211 } 2212 sg.Name = &name 2213 } 2214 case "type": 2215 if v != nil { 2216 var typeVar string 2217 err = json.Unmarshal(*v, &typeVar) 2218 if err != nil { 2219 return err 2220 } 2221 sg.Type = &typeVar 2222 } 2223 } 2224 } 2225 2226 return nil 2227} 2228 2229// SyncGroupArray array of SyncGroup 2230type SyncGroupArray struct { 2231 autorest.Response `json:"-"` 2232 // Value - Collection of SyncGroup. 2233 Value *[]SyncGroup `json:"value,omitempty"` 2234} 2235 2236// SyncGroupCreateParameters the parameters used when creating a sync group. 2237type SyncGroupCreateParameters struct { 2238 // Properties - The parameters used to create the sync group 2239 Properties interface{} `json:"properties,omitempty"` 2240 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2241 ID *string `json:"id,omitempty"` 2242 // Name - READ-ONLY; The name of the resource 2243 Name *string `json:"name,omitempty"` 2244 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2245 Type *string `json:"type,omitempty"` 2246} 2247 2248// MarshalJSON is the custom marshaler for SyncGroupCreateParameters. 2249func (sgcp SyncGroupCreateParameters) MarshalJSON() ([]byte, error) { 2250 objectMap := make(map[string]interface{}) 2251 if sgcp.Properties != nil { 2252 objectMap["properties"] = sgcp.Properties 2253 } 2254 return json.Marshal(objectMap) 2255} 2256 2257// SyncGroupProperties syncGroup Properties object. 2258type SyncGroupProperties struct { 2259 // UniqueID - READ-ONLY; Unique Id 2260 UniqueID *string `json:"uniqueId,omitempty"` 2261 // SyncGroupStatus - READ-ONLY; Sync group status 2262 SyncGroupStatus *string `json:"syncGroupStatus,omitempty"` 2263} 2264 2265// MarshalJSON is the custom marshaler for SyncGroupProperties. 2266func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) { 2267 objectMap := make(map[string]interface{}) 2268 return json.Marshal(objectMap) 2269} 2270 2271// SyncSessionStatus sync Session status object. 2272type SyncSessionStatus struct { 2273 // LastSyncResult - READ-ONLY; Last sync result (HResult) 2274 LastSyncResult *int32 `json:"lastSyncResult,omitempty"` 2275 // LastSyncTimestamp - READ-ONLY; Last sync timestamp 2276 LastSyncTimestamp *date.Time `json:"lastSyncTimestamp,omitempty"` 2277 // LastSyncSuccessTimestamp - READ-ONLY; Last sync success timestamp 2278 LastSyncSuccessTimestamp *date.Time `json:"lastSyncSuccessTimestamp,omitempty"` 2279 // LastSyncPerItemErrorCount - READ-ONLY; Last sync per item error count. 2280 LastSyncPerItemErrorCount *int64 `json:"lastSyncPerItemErrorCount,omitempty"` 2281 // PersistentFilesNotSyncingCount - READ-ONLY; Count of persistent files not syncing. 2282 PersistentFilesNotSyncingCount *int64 `json:"persistentFilesNotSyncingCount,omitempty"` 2283 // TransientFilesNotSyncingCount - READ-ONLY; Count of transient files not syncing. 2284 TransientFilesNotSyncingCount *int64 `json:"transientFilesNotSyncingCount,omitempty"` 2285 // FilesNotSyncingErrors - READ-ONLY; Array of per-item errors coming from the last sync session. 2286 FilesNotSyncingErrors *[]ServerEndpointFilesNotSyncingError `json:"filesNotSyncingErrors,omitempty"` 2287} 2288 2289// MarshalJSON is the custom marshaler for SyncSessionStatus. 2290func (sss SyncSessionStatus) MarshalJSON() ([]byte, error) { 2291 objectMap := make(map[string]interface{}) 2292 return json.Marshal(objectMap) 2293} 2294 2295// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 2296// which has 'tags' and a 'location' 2297type TrackedResource struct { 2298 // Tags - Resource tags. 2299 Tags map[string]*string `json:"tags"` 2300 // Location - The geo-location where the resource lives 2301 Location *string `json:"location,omitempty"` 2302 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2303 ID *string `json:"id,omitempty"` 2304 // Name - READ-ONLY; The name of the resource 2305 Name *string `json:"name,omitempty"` 2306 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2307 Type *string `json:"type,omitempty"` 2308} 2309 2310// MarshalJSON is the custom marshaler for TrackedResource. 2311func (tr TrackedResource) MarshalJSON() ([]byte, error) { 2312 objectMap := make(map[string]interface{}) 2313 if tr.Tags != nil { 2314 objectMap["tags"] = tr.Tags 2315 } 2316 if tr.Location != nil { 2317 objectMap["location"] = tr.Location 2318 } 2319 return json.Marshal(objectMap) 2320} 2321 2322// TriggerChangeDetectionParameters the parameters used when calling trigger change detection action on 2323// cloud endpoint. 2324type TriggerChangeDetectionParameters struct { 2325 // DirectoryPath - Relative path to a directory Azure File share for which change detection is to be performed. 2326 DirectoryPath *string `json:"directoryPath,omitempty"` 2327 // ChangeDetectionMode - Change Detection Mode. Applies to a directory specified in directoryPath parameter. Possible values include: 'Default', 'Recursive' 2328 ChangeDetectionMode ChangeDetectionMode `json:"changeDetectionMode,omitempty"` 2329 // Paths - Array of relative paths on the Azure File share to be included in the change detection. Can be files and directories. 2330 Paths *[]string `json:"paths,omitempty"` 2331} 2332 2333// TriggerRolloverRequest trigger Rollover Request. 2334type TriggerRolloverRequest struct { 2335 // ServerCertificate - Certificate Data 2336 ServerCertificate *string `json:"serverCertificate,omitempty"` 2337} 2338 2339// Workflow workflow resource. 2340type Workflow struct { 2341 autorest.Response `json:"-"` 2342 // WorkflowProperties - Workflow properties. 2343 *WorkflowProperties `json:"properties,omitempty"` 2344 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2345 ID *string `json:"id,omitempty"` 2346 // Name - READ-ONLY; The name of the resource 2347 Name *string `json:"name,omitempty"` 2348 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2349 Type *string `json:"type,omitempty"` 2350} 2351 2352// MarshalJSON is the custom marshaler for Workflow. 2353func (w Workflow) MarshalJSON() ([]byte, error) { 2354 objectMap := make(map[string]interface{}) 2355 if w.WorkflowProperties != nil { 2356 objectMap["properties"] = w.WorkflowProperties 2357 } 2358 return json.Marshal(objectMap) 2359} 2360 2361// UnmarshalJSON is the custom unmarshaler for Workflow struct. 2362func (w *Workflow) UnmarshalJSON(body []byte) error { 2363 var m map[string]*json.RawMessage 2364 err := json.Unmarshal(body, &m) 2365 if err != nil { 2366 return err 2367 } 2368 for k, v := range m { 2369 switch k { 2370 case "properties": 2371 if v != nil { 2372 var workflowProperties WorkflowProperties 2373 err = json.Unmarshal(*v, &workflowProperties) 2374 if err != nil { 2375 return err 2376 } 2377 w.WorkflowProperties = &workflowProperties 2378 } 2379 case "id": 2380 if v != nil { 2381 var ID string 2382 err = json.Unmarshal(*v, &ID) 2383 if err != nil { 2384 return err 2385 } 2386 w.ID = &ID 2387 } 2388 case "name": 2389 if v != nil { 2390 var name string 2391 err = json.Unmarshal(*v, &name) 2392 if err != nil { 2393 return err 2394 } 2395 w.Name = &name 2396 } 2397 case "type": 2398 if v != nil { 2399 var typeVar string 2400 err = json.Unmarshal(*v, &typeVar) 2401 if err != nil { 2402 return err 2403 } 2404 w.Type = &typeVar 2405 } 2406 } 2407 } 2408 2409 return nil 2410} 2411 2412// WorkflowArray array of Workflow 2413type WorkflowArray struct { 2414 autorest.Response `json:"-"` 2415 // Value - Collection of workflow items. 2416 Value *[]Workflow `json:"value,omitempty"` 2417} 2418 2419// WorkflowProperties workflow Properties object. 2420type WorkflowProperties struct { 2421 // LastStepName - last step name 2422 LastStepName *string `json:"lastStepName,omitempty"` 2423 // Status - workflow status. Possible values include: 'Active', 'Expired', 'Succeeded', 'Aborted', 'Failed' 2424 Status Status `json:"status,omitempty"` 2425 // Operation - operation direction. Possible values include: 'Do', 'Undo', 'Cancel' 2426 Operation Operation `json:"operation,omitempty"` 2427 // Steps - workflow steps 2428 Steps *string `json:"steps,omitempty"` 2429 // LastOperationID - workflow last operation identifier. 2430 LastOperationID *string `json:"lastOperationId,omitempty"` 2431} 2432