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