1package netapp 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 "net/http" 16) 17 18// The package's fully qualified name. 19const fqdn = "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-11-01/netapp" 20 21// Account netApp account resource 22type Account struct { 23 autorest.Response `json:"-"` 24 // Location - Resource location 25 Location *string `json:"location,omitempty"` 26 // ID - READ-ONLY; Resource Id 27 ID *string `json:"id,omitempty"` 28 // Name - READ-ONLY; Resource name 29 Name *string `json:"name,omitempty"` 30 // Type - READ-ONLY; Resource type 31 Type *string `json:"type,omitempty"` 32 // Tags - Resource tags 33 Tags map[string]*string `json:"tags"` 34 // AccountProperties - NetApp Account properties 35 *AccountProperties `json:"properties,omitempty"` 36} 37 38// MarshalJSON is the custom marshaler for Account. 39func (a Account) MarshalJSON() ([]byte, error) { 40 objectMap := make(map[string]interface{}) 41 if a.Location != nil { 42 objectMap["location"] = a.Location 43 } 44 if a.Tags != nil { 45 objectMap["tags"] = a.Tags 46 } 47 if a.AccountProperties != nil { 48 objectMap["properties"] = a.AccountProperties 49 } 50 return json.Marshal(objectMap) 51} 52 53// UnmarshalJSON is the custom unmarshaler for Account struct. 54func (a *Account) UnmarshalJSON(body []byte) error { 55 var m map[string]*json.RawMessage 56 err := json.Unmarshal(body, &m) 57 if err != nil { 58 return err 59 } 60 for k, v := range m { 61 switch k { 62 case "location": 63 if v != nil { 64 var location string 65 err = json.Unmarshal(*v, &location) 66 if err != nil { 67 return err 68 } 69 a.Location = &location 70 } 71 case "id": 72 if v != nil { 73 var ID string 74 err = json.Unmarshal(*v, &ID) 75 if err != nil { 76 return err 77 } 78 a.ID = &ID 79 } 80 case "name": 81 if v != nil { 82 var name string 83 err = json.Unmarshal(*v, &name) 84 if err != nil { 85 return err 86 } 87 a.Name = &name 88 } 89 case "type": 90 if v != nil { 91 var typeVar string 92 err = json.Unmarshal(*v, &typeVar) 93 if err != nil { 94 return err 95 } 96 a.Type = &typeVar 97 } 98 case "tags": 99 if v != nil { 100 var tags map[string]*string 101 err = json.Unmarshal(*v, &tags) 102 if err != nil { 103 return err 104 } 105 a.Tags = tags 106 } 107 case "properties": 108 if v != nil { 109 var accountProperties AccountProperties 110 err = json.Unmarshal(*v, &accountProperties) 111 if err != nil { 112 return err 113 } 114 a.AccountProperties = &accountProperties 115 } 116 } 117 } 118 119 return nil 120} 121 122// AccountList list of NetApp account resources 123type AccountList struct { 124 autorest.Response `json:"-"` 125 // Value - Multiple NetApp accounts 126 Value *[]Account `json:"value,omitempty"` 127} 128 129// AccountPatch netApp account patch resource 130type AccountPatch struct { 131 // Location - Resource location 132 Location *string `json:"location,omitempty"` 133 // ID - READ-ONLY; Resource Id 134 ID *string `json:"id,omitempty"` 135 // Name - READ-ONLY; Resource name 136 Name *string `json:"name,omitempty"` 137 // Type - READ-ONLY; Resource type 138 Type *string `json:"type,omitempty"` 139 // Tags - Resource tags 140 Tags map[string]*string `json:"tags"` 141 // AccountProperties - NetApp Account properties 142 *AccountProperties `json:"properties,omitempty"` 143} 144 145// MarshalJSON is the custom marshaler for AccountPatch. 146func (ap AccountPatch) MarshalJSON() ([]byte, error) { 147 objectMap := make(map[string]interface{}) 148 if ap.Location != nil { 149 objectMap["location"] = ap.Location 150 } 151 if ap.Tags != nil { 152 objectMap["tags"] = ap.Tags 153 } 154 if ap.AccountProperties != nil { 155 objectMap["properties"] = ap.AccountProperties 156 } 157 return json.Marshal(objectMap) 158} 159 160// UnmarshalJSON is the custom unmarshaler for AccountPatch struct. 161func (ap *AccountPatch) UnmarshalJSON(body []byte) error { 162 var m map[string]*json.RawMessage 163 err := json.Unmarshal(body, &m) 164 if err != nil { 165 return err 166 } 167 for k, v := range m { 168 switch k { 169 case "location": 170 if v != nil { 171 var location string 172 err = json.Unmarshal(*v, &location) 173 if err != nil { 174 return err 175 } 176 ap.Location = &location 177 } 178 case "id": 179 if v != nil { 180 var ID string 181 err = json.Unmarshal(*v, &ID) 182 if err != nil { 183 return err 184 } 185 ap.ID = &ID 186 } 187 case "name": 188 if v != nil { 189 var name string 190 err = json.Unmarshal(*v, &name) 191 if err != nil { 192 return err 193 } 194 ap.Name = &name 195 } 196 case "type": 197 if v != nil { 198 var typeVar string 199 err = json.Unmarshal(*v, &typeVar) 200 if err != nil { 201 return err 202 } 203 ap.Type = &typeVar 204 } 205 case "tags": 206 if v != nil { 207 var tags map[string]*string 208 err = json.Unmarshal(*v, &tags) 209 if err != nil { 210 return err 211 } 212 ap.Tags = tags 213 } 214 case "properties": 215 if v != nil { 216 var accountProperties AccountProperties 217 err = json.Unmarshal(*v, &accountProperties) 218 if err != nil { 219 return err 220 } 221 ap.AccountProperties = &accountProperties 222 } 223 } 224 } 225 226 return nil 227} 228 229// AccountProperties netApp account properties 230type AccountProperties struct { 231 // ProvisioningState - READ-ONLY; Azure lifecycle management 232 ProvisioningState *string `json:"provisioningState,omitempty"` 233 // ActiveDirectories - Active Directories 234 ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` 235} 236 237// MarshalJSON is the custom marshaler for AccountProperties. 238func (ap AccountProperties) MarshalJSON() ([]byte, error) { 239 objectMap := make(map[string]interface{}) 240 if ap.ActiveDirectories != nil { 241 objectMap["activeDirectories"] = ap.ActiveDirectories 242 } 243 return json.Marshal(objectMap) 244} 245 246// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 247// operation. 248type AccountsCreateOrUpdateFuture struct { 249 azure.FutureAPI 250 // Result returns the result of the asynchronous operation. 251 // If the operation has not completed it will return an error. 252 Result func(AccountsClient) (Account, error) 253} 254 255// UnmarshalJSON is the custom unmarshaller for CreateFuture. 256func (future *AccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 257 var azFuture azure.Future 258 if err := json.Unmarshal(body, &azFuture); err != nil { 259 return err 260 } 261 future.FutureAPI = &azFuture 262 future.Result = future.result 263 return nil 264} 265 266// result is the default implementation for AccountsCreateOrUpdateFuture.Result. 267func (future *AccountsCreateOrUpdateFuture) result(client AccountsClient) (a Account, err error) { 268 var done bool 269 done, err = future.DoneWithContext(context.Background(), client) 270 if err != nil { 271 err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 272 return 273 } 274 if !done { 275 a.Response.Response = future.Response() 276 err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture") 277 return 278 } 279 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 280 if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { 281 a, err = client.CreateOrUpdateResponder(a.Response.Response) 282 if err != nil { 283 err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request") 284 } 285 } 286 return 287} 288 289// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 290// operation. 291type AccountsDeleteFuture struct { 292 azure.FutureAPI 293 // Result returns the result of the asynchronous operation. 294 // If the operation has not completed it will return an error. 295 Result func(AccountsClient) (autorest.Response, error) 296} 297 298// UnmarshalJSON is the custom unmarshaller for CreateFuture. 299func (future *AccountsDeleteFuture) UnmarshalJSON(body []byte) error { 300 var azFuture azure.Future 301 if err := json.Unmarshal(body, &azFuture); err != nil { 302 return err 303 } 304 future.FutureAPI = &azFuture 305 future.Result = future.result 306 return nil 307} 308 309// result is the default implementation for AccountsDeleteFuture.Result. 310func (future *AccountsDeleteFuture) result(client AccountsClient) (ar autorest.Response, err error) { 311 var done bool 312 done, err = future.DoneWithContext(context.Background(), client) 313 if err != nil { 314 err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure") 315 return 316 } 317 if !done { 318 ar.Response = future.Response() 319 err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture") 320 return 321 } 322 ar.Response = future.Response() 323 return 324} 325 326// ActiveDirectory active Directory 327type ActiveDirectory struct { 328 // ActiveDirectoryID - Id of the Active Directory 329 ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"` 330 // Username - Username of Active Directory domain administrator 331 Username *string `json:"username,omitempty"` 332 // Password - Plain text password of Active Directory domain administrator 333 Password *string `json:"password,omitempty"` 334 // Domain - Name of the Active Directory domain 335 Domain *string `json:"domain,omitempty"` 336 // DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain 337 DNS *string `json:"dns,omitempty"` 338 // Status - Status of the Active Directory 339 Status *string `json:"status,omitempty"` 340 // SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes 341 SmbServerName *string `json:"smbServerName,omitempty"` 342 // OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory 343 OrganizationalUnit *string `json:"organizationalUnit,omitempty"` 344 // Site - The Active Directory site the service will limit Domain Controller discovery to 345 Site *string `json:"site,omitempty"` 346} 347 348// AuthorizeRequest authorize request 349type AuthorizeRequest struct { 350 // RemoteVolumeResourceID - Resource id of the remote volume 351 RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` 352} 353 354// CapacityPool capacity pool resource 355type CapacityPool struct { 356 autorest.Response `json:"-"` 357 // Location - Resource location 358 Location *string `json:"location,omitempty"` 359 // ID - READ-ONLY; Resource Id 360 ID *string `json:"id,omitempty"` 361 // Name - READ-ONLY; Resource name 362 Name *string `json:"name,omitempty"` 363 // Type - READ-ONLY; Resource type 364 Type *string `json:"type,omitempty"` 365 // Tags - Resource tags 366 Tags map[string]*string `json:"tags"` 367 // PoolProperties - Capacity pool properties 368 *PoolProperties `json:"properties,omitempty"` 369} 370 371// MarshalJSON is the custom marshaler for CapacityPool. 372func (cp CapacityPool) MarshalJSON() ([]byte, error) { 373 objectMap := make(map[string]interface{}) 374 if cp.Location != nil { 375 objectMap["location"] = cp.Location 376 } 377 if cp.Tags != nil { 378 objectMap["tags"] = cp.Tags 379 } 380 if cp.PoolProperties != nil { 381 objectMap["properties"] = cp.PoolProperties 382 } 383 return json.Marshal(objectMap) 384} 385 386// UnmarshalJSON is the custom unmarshaler for CapacityPool struct. 387func (cp *CapacityPool) UnmarshalJSON(body []byte) error { 388 var m map[string]*json.RawMessage 389 err := json.Unmarshal(body, &m) 390 if err != nil { 391 return err 392 } 393 for k, v := range m { 394 switch k { 395 case "location": 396 if v != nil { 397 var location string 398 err = json.Unmarshal(*v, &location) 399 if err != nil { 400 return err 401 } 402 cp.Location = &location 403 } 404 case "id": 405 if v != nil { 406 var ID string 407 err = json.Unmarshal(*v, &ID) 408 if err != nil { 409 return err 410 } 411 cp.ID = &ID 412 } 413 case "name": 414 if v != nil { 415 var name string 416 err = json.Unmarshal(*v, &name) 417 if err != nil { 418 return err 419 } 420 cp.Name = &name 421 } 422 case "type": 423 if v != nil { 424 var typeVar string 425 err = json.Unmarshal(*v, &typeVar) 426 if err != nil { 427 return err 428 } 429 cp.Type = &typeVar 430 } 431 case "tags": 432 if v != nil { 433 var tags map[string]*string 434 err = json.Unmarshal(*v, &tags) 435 if err != nil { 436 return err 437 } 438 cp.Tags = tags 439 } 440 case "properties": 441 if v != nil { 442 var poolProperties PoolProperties 443 err = json.Unmarshal(*v, &poolProperties) 444 if err != nil { 445 return err 446 } 447 cp.PoolProperties = &poolProperties 448 } 449 } 450 } 451 452 return nil 453} 454 455// CapacityPoolList list of capacity pool resources 456type CapacityPoolList struct { 457 autorest.Response `json:"-"` 458 // Value - List of Capacity pools 459 Value *[]CapacityPool `json:"value,omitempty"` 460} 461 462// CapacityPoolPatch capacity pool patch resource 463type CapacityPoolPatch struct { 464 // Location - Resource location 465 Location *string `json:"location,omitempty"` 466 // ID - READ-ONLY; Resource Id 467 ID *string `json:"id,omitempty"` 468 // Name - READ-ONLY; Resource name 469 Name *string `json:"name,omitempty"` 470 // Type - READ-ONLY; Resource type 471 Type *string `json:"type,omitempty"` 472 // Tags - Resource tags 473 Tags map[string]*string `json:"tags"` 474 // PoolPatchProperties - Capacity pool properties 475 *PoolPatchProperties `json:"properties,omitempty"` 476} 477 478// MarshalJSON is the custom marshaler for CapacityPoolPatch. 479func (cpp CapacityPoolPatch) MarshalJSON() ([]byte, error) { 480 objectMap := make(map[string]interface{}) 481 if cpp.Location != nil { 482 objectMap["location"] = cpp.Location 483 } 484 if cpp.Tags != nil { 485 objectMap["tags"] = cpp.Tags 486 } 487 if cpp.PoolPatchProperties != nil { 488 objectMap["properties"] = cpp.PoolPatchProperties 489 } 490 return json.Marshal(objectMap) 491} 492 493// UnmarshalJSON is the custom unmarshaler for CapacityPoolPatch struct. 494func (cpp *CapacityPoolPatch) UnmarshalJSON(body []byte) error { 495 var m map[string]*json.RawMessage 496 err := json.Unmarshal(body, &m) 497 if err != nil { 498 return err 499 } 500 for k, v := range m { 501 switch k { 502 case "location": 503 if v != nil { 504 var location string 505 err = json.Unmarshal(*v, &location) 506 if err != nil { 507 return err 508 } 509 cpp.Location = &location 510 } 511 case "id": 512 if v != nil { 513 var ID string 514 err = json.Unmarshal(*v, &ID) 515 if err != nil { 516 return err 517 } 518 cpp.ID = &ID 519 } 520 case "name": 521 if v != nil { 522 var name string 523 err = json.Unmarshal(*v, &name) 524 if err != nil { 525 return err 526 } 527 cpp.Name = &name 528 } 529 case "type": 530 if v != nil { 531 var typeVar string 532 err = json.Unmarshal(*v, &typeVar) 533 if err != nil { 534 return err 535 } 536 cpp.Type = &typeVar 537 } 538 case "tags": 539 if v != nil { 540 var tags map[string]*string 541 err = json.Unmarshal(*v, &tags) 542 if err != nil { 543 return err 544 } 545 cpp.Tags = tags 546 } 547 case "properties": 548 if v != nil { 549 var poolPatchProperties PoolPatchProperties 550 err = json.Unmarshal(*v, &poolPatchProperties) 551 if err != nil { 552 return err 553 } 554 cpp.PoolPatchProperties = &poolPatchProperties 555 } 556 } 557 } 558 559 return nil 560} 561 562// Dimension dimension of blobs, possibly be blob type or access tier. 563type Dimension struct { 564 // Name - Display name of dimension. 565 Name *string `json:"name,omitempty"` 566 // DisplayName - Display name of dimension. 567 DisplayName *string `json:"displayName,omitempty"` 568} 569 570// ExportPolicyRule volume Export Policy Rule 571type ExportPolicyRule struct { 572 // RuleIndex - Order index 573 RuleIndex *int32 `json:"ruleIndex,omitempty"` 574 // UnixReadOnly - Read only access 575 UnixReadOnly *bool `json:"unixReadOnly,omitempty"` 576 // UnixReadWrite - Read and write access 577 UnixReadWrite *bool `json:"unixReadWrite,omitempty"` 578 // Cifs - Allows CIFS protocol 579 Cifs *bool `json:"cifs,omitempty"` 580 // Nfsv3 - Allows NFSv3 protocol 581 Nfsv3 *bool `json:"nfsv3,omitempty"` 582 // Nfsv41 - Allows NFSv4.1 protocol 583 Nfsv41 *bool `json:"nfsv41,omitempty"` 584 // AllowedClients - Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names 585 AllowedClients *string `json:"allowedClients,omitempty"` 586} 587 588// MetricSpecification metric specification of operation. 589type MetricSpecification struct { 590 // Name - Name of metric specification. 591 Name *string `json:"name,omitempty"` 592 // DisplayName - Display name of metric specification. 593 DisplayName *string `json:"displayName,omitempty"` 594 // DisplayDescription - Display description of metric specification. 595 DisplayDescription *string `json:"displayDescription,omitempty"` 596 // Unit - Unit could be Bytes or Count. 597 Unit *string `json:"unit,omitempty"` 598 // Dimensions - Dimensions of blobs, including blob type and access tier. 599 Dimensions *[]Dimension `json:"dimensions,omitempty"` 600 // AggregationType - Aggregation type could be Average. 601 AggregationType *string `json:"aggregationType,omitempty"` 602 // FillGapWithZero - The property to decide fill gap with zero or not. 603 FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` 604 // Category - The category this metric specification belong to, could be Capacity. 605 Category *string `json:"category,omitempty"` 606 // ResourceIDDimensionNameOverride - Account Resource Id. 607 ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` 608} 609 610// MountTarget mount Target 611type MountTarget struct { 612 // Location - Resource location 613 Location *string `json:"location,omitempty"` 614 // ID - READ-ONLY; Resource Id 615 ID *string `json:"id,omitempty"` 616 // Name - READ-ONLY; Resource name 617 Name *string `json:"name,omitempty"` 618 // Type - READ-ONLY; Resource type 619 Type *string `json:"type,omitempty"` 620 // Tags - Resource tags 621 Tags map[string]*string `json:"tags"` 622 // MountTargetProperties - Mount Target Properties 623 *MountTargetProperties `json:"properties,omitempty"` 624} 625 626// MarshalJSON is the custom marshaler for MountTarget. 627func (mt MountTarget) MarshalJSON() ([]byte, error) { 628 objectMap := make(map[string]interface{}) 629 if mt.Location != nil { 630 objectMap["location"] = mt.Location 631 } 632 if mt.Tags != nil { 633 objectMap["tags"] = mt.Tags 634 } 635 if mt.MountTargetProperties != nil { 636 objectMap["properties"] = mt.MountTargetProperties 637 } 638 return json.Marshal(objectMap) 639} 640 641// UnmarshalJSON is the custom unmarshaler for MountTarget struct. 642func (mt *MountTarget) UnmarshalJSON(body []byte) error { 643 var m map[string]*json.RawMessage 644 err := json.Unmarshal(body, &m) 645 if err != nil { 646 return err 647 } 648 for k, v := range m { 649 switch k { 650 case "location": 651 if v != nil { 652 var location string 653 err = json.Unmarshal(*v, &location) 654 if err != nil { 655 return err 656 } 657 mt.Location = &location 658 } 659 case "id": 660 if v != nil { 661 var ID string 662 err = json.Unmarshal(*v, &ID) 663 if err != nil { 664 return err 665 } 666 mt.ID = &ID 667 } 668 case "name": 669 if v != nil { 670 var name string 671 err = json.Unmarshal(*v, &name) 672 if err != nil { 673 return err 674 } 675 mt.Name = &name 676 } 677 case "type": 678 if v != nil { 679 var typeVar string 680 err = json.Unmarshal(*v, &typeVar) 681 if err != nil { 682 return err 683 } 684 mt.Type = &typeVar 685 } 686 case "tags": 687 if v != nil { 688 var tags map[string]*string 689 err = json.Unmarshal(*v, &tags) 690 if err != nil { 691 return err 692 } 693 mt.Tags = tags 694 } 695 case "properties": 696 if v != nil { 697 var mountTargetProperties MountTargetProperties 698 err = json.Unmarshal(*v, &mountTargetProperties) 699 if err != nil { 700 return err 701 } 702 mt.MountTargetProperties = &mountTargetProperties 703 } 704 } 705 } 706 707 return nil 708} 709 710// MountTargetProperties mount target properties 711type MountTargetProperties struct { 712 // MountTargetID - READ-ONLY; UUID v4 used to identify the MountTarget 713 MountTargetID *string `json:"mountTargetId,omitempty"` 714 // FileSystemID - UUID v4 used to identify the MountTarget 715 FileSystemID *string `json:"fileSystemId,omitempty"` 716 // IPAddress - READ-ONLY; The mount target's IPv4 address 717 IPAddress *string `json:"ipAddress,omitempty"` 718 // Subnet - The subnet 719 Subnet *string `json:"subnet,omitempty"` 720 // StartIP - The start of IPv4 address range to use when creating a new mount target 721 StartIP *string `json:"startIp,omitempty"` 722 // EndIP - The end of IPv4 address range to use when creating a new mount target 723 EndIP *string `json:"endIp,omitempty"` 724 // Gateway - The gateway of the IPv4 address range to use when creating a new mount target 725 Gateway *string `json:"gateway,omitempty"` 726 // Netmask - The netmask of the IPv4 address range to use when creating a new mount target 727 Netmask *string `json:"netmask,omitempty"` 728 // SmbServerFqdn - The SMB server's Fully Qualified Domain Name, FQDN 729 SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` 730} 731 732// MarshalJSON is the custom marshaler for MountTargetProperties. 733func (mtp MountTargetProperties) MarshalJSON() ([]byte, error) { 734 objectMap := make(map[string]interface{}) 735 if mtp.FileSystemID != nil { 736 objectMap["fileSystemId"] = mtp.FileSystemID 737 } 738 if mtp.Subnet != nil { 739 objectMap["subnet"] = mtp.Subnet 740 } 741 if mtp.StartIP != nil { 742 objectMap["startIp"] = mtp.StartIP 743 } 744 if mtp.EndIP != nil { 745 objectMap["endIp"] = mtp.EndIP 746 } 747 if mtp.Gateway != nil { 748 objectMap["gateway"] = mtp.Gateway 749 } 750 if mtp.Netmask != nil { 751 objectMap["netmask"] = mtp.Netmask 752 } 753 if mtp.SmbServerFqdn != nil { 754 objectMap["smbServerFqdn"] = mtp.SmbServerFqdn 755 } 756 return json.Marshal(objectMap) 757} 758 759// Operation microsoft.NetApp REST API operation definition. 760type Operation struct { 761 // Name - Operation name: {provider}/{resource}/{operation} 762 Name *string `json:"name,omitempty"` 763 // Display - Display metadata associated with the operation. 764 Display *OperationDisplay `json:"display,omitempty"` 765 // Origin - The origin of operations. 766 Origin *string `json:"origin,omitempty"` 767 // OperationProperties - Properties of operation, include metric specifications. 768 *OperationProperties `json:"properties,omitempty"` 769} 770 771// MarshalJSON is the custom marshaler for Operation. 772func (o Operation) MarshalJSON() ([]byte, error) { 773 objectMap := make(map[string]interface{}) 774 if o.Name != nil { 775 objectMap["name"] = o.Name 776 } 777 if o.Display != nil { 778 objectMap["display"] = o.Display 779 } 780 if o.Origin != nil { 781 objectMap["origin"] = o.Origin 782 } 783 if o.OperationProperties != nil { 784 objectMap["properties"] = o.OperationProperties 785 } 786 return json.Marshal(objectMap) 787} 788 789// UnmarshalJSON is the custom unmarshaler for Operation struct. 790func (o *Operation) UnmarshalJSON(body []byte) error { 791 var m map[string]*json.RawMessage 792 err := json.Unmarshal(body, &m) 793 if err != nil { 794 return err 795 } 796 for k, v := range m { 797 switch k { 798 case "name": 799 if v != nil { 800 var name string 801 err = json.Unmarshal(*v, &name) 802 if err != nil { 803 return err 804 } 805 o.Name = &name 806 } 807 case "display": 808 if v != nil { 809 var display OperationDisplay 810 err = json.Unmarshal(*v, &display) 811 if err != nil { 812 return err 813 } 814 o.Display = &display 815 } 816 case "origin": 817 if v != nil { 818 var origin string 819 err = json.Unmarshal(*v, &origin) 820 if err != nil { 821 return err 822 } 823 o.Origin = &origin 824 } 825 case "properties": 826 if v != nil { 827 var operationProperties OperationProperties 828 err = json.Unmarshal(*v, &operationProperties) 829 if err != nil { 830 return err 831 } 832 o.OperationProperties = &operationProperties 833 } 834 } 835 } 836 837 return nil 838} 839 840// OperationDisplay display metadata associated with the operation. 841type OperationDisplay struct { 842 // Provider - Service provider: Microsoft NetApp. 843 Provider *string `json:"provider,omitempty"` 844 // Resource - Resource on which the operation is performed etc. 845 Resource *string `json:"resource,omitempty"` 846 // Operation - Type of operation: get, read, delete, etc. 847 Operation *string `json:"operation,omitempty"` 848 // Description - Operation description. 849 Description *string `json:"description,omitempty"` 850} 851 852// OperationListResult result of the request to list Cloud Volume operations. It contains a list of 853// operations and a URL link to get the next set of results. 854type OperationListResult struct { 855 autorest.Response `json:"-"` 856 // Value - List of Storage operations supported by the Storage resource provider. 857 Value *[]Operation `json:"value,omitempty"` 858} 859 860// OperationProperties properties of operation, include metric specifications. 861type OperationProperties struct { 862 // ServiceSpecification - One property of operation, include metric specifications. 863 ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` 864} 865 866// PoolPatchProperties patchable pool properties 867type PoolPatchProperties struct { 868 // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). 869 Size *int64 `json:"size,omitempty"` 870 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 871 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 872} 873 874// PoolProperties pool properties 875type PoolProperties struct { 876 // PoolID - READ-ONLY; UUID v4 used to identify the Pool 877 PoolID *string `json:"poolId,omitempty"` 878 // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). 879 Size *int64 `json:"size,omitempty"` 880 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 881 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 882 // ProvisioningState - READ-ONLY; Azure lifecycle management 883 ProvisioningState *string `json:"provisioningState,omitempty"` 884} 885 886// MarshalJSON is the custom marshaler for PoolProperties. 887func (pp PoolProperties) MarshalJSON() ([]byte, error) { 888 objectMap := make(map[string]interface{}) 889 if pp.Size != nil { 890 objectMap["size"] = pp.Size 891 } 892 if pp.ServiceLevel != "" { 893 objectMap["serviceLevel"] = pp.ServiceLevel 894 } 895 return json.Marshal(objectMap) 896} 897 898// PoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 899// operation. 900type PoolsCreateOrUpdateFuture struct { 901 azure.FutureAPI 902 // Result returns the result of the asynchronous operation. 903 // If the operation has not completed it will return an error. 904 Result func(PoolsClient) (CapacityPool, error) 905} 906 907// UnmarshalJSON is the custom unmarshaller for CreateFuture. 908func (future *PoolsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 909 var azFuture azure.Future 910 if err := json.Unmarshal(body, &azFuture); err != nil { 911 return err 912 } 913 future.FutureAPI = &azFuture 914 future.Result = future.result 915 return nil 916} 917 918// result is the default implementation for PoolsCreateOrUpdateFuture.Result. 919func (future *PoolsCreateOrUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) { 920 var done bool 921 done, err = future.DoneWithContext(context.Background(), client) 922 if err != nil { 923 err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 924 return 925 } 926 if !done { 927 cp.Response.Response = future.Response() 928 err = azure.NewAsyncOpIncompleteError("netapp.PoolsCreateOrUpdateFuture") 929 return 930 } 931 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 932 if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { 933 cp, err = client.CreateOrUpdateResponder(cp.Response.Response) 934 if err != nil { 935 err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") 936 } 937 } 938 return 939} 940 941// PoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 942type PoolsDeleteFuture struct { 943 azure.FutureAPI 944 // Result returns the result of the asynchronous operation. 945 // If the operation has not completed it will return an error. 946 Result func(PoolsClient) (autorest.Response, error) 947} 948 949// UnmarshalJSON is the custom unmarshaller for CreateFuture. 950func (future *PoolsDeleteFuture) UnmarshalJSON(body []byte) error { 951 var azFuture azure.Future 952 if err := json.Unmarshal(body, &azFuture); err != nil { 953 return err 954 } 955 future.FutureAPI = &azFuture 956 future.Result = future.result 957 return nil 958} 959 960// result is the default implementation for PoolsDeleteFuture.Result. 961func (future *PoolsDeleteFuture) result(client PoolsClient) (ar autorest.Response, err error) { 962 var done bool 963 done, err = future.DoneWithContext(context.Background(), client) 964 if err != nil { 965 err = autorest.NewErrorWithError(err, "netapp.PoolsDeleteFuture", "Result", future.Response(), "Polling failure") 966 return 967 } 968 if !done { 969 ar.Response = future.Response() 970 err = azure.NewAsyncOpIncompleteError("netapp.PoolsDeleteFuture") 971 return 972 } 973 ar.Response = future.Response() 974 return 975} 976 977// PoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. 978type PoolsUpdateFuture struct { 979 azure.FutureAPI 980 // Result returns the result of the asynchronous operation. 981 // If the operation has not completed it will return an error. 982 Result func(PoolsClient) (CapacityPool, error) 983} 984 985// UnmarshalJSON is the custom unmarshaller for CreateFuture. 986func (future *PoolsUpdateFuture) UnmarshalJSON(body []byte) error { 987 var azFuture azure.Future 988 if err := json.Unmarshal(body, &azFuture); err != nil { 989 return err 990 } 991 future.FutureAPI = &azFuture 992 future.Result = future.result 993 return nil 994} 995 996// result is the default implementation for PoolsUpdateFuture.Result. 997func (future *PoolsUpdateFuture) result(client PoolsClient) (cp CapacityPool, err error) { 998 var done bool 999 done, err = future.DoneWithContext(context.Background(), client) 1000 if err != nil { 1001 err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", future.Response(), "Polling failure") 1002 return 1003 } 1004 if !done { 1005 cp.Response.Response = future.Response() 1006 err = azure.NewAsyncOpIncompleteError("netapp.PoolsUpdateFuture") 1007 return 1008 } 1009 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1010 if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { 1011 cp, err = client.UpdateResponder(cp.Response.Response) 1012 if err != nil { 1013 err = autorest.NewErrorWithError(err, "netapp.PoolsUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") 1014 } 1015 } 1016 return 1017} 1018 1019// ReplicationObject replication properties 1020type ReplicationObject struct { 1021 // ReplicationID - Id 1022 ReplicationID *string `json:"replicationId,omitempty"` 1023 // EndpointType - Indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'Src', 'Dst' 1024 EndpointType EndpointType `json:"endpointType,omitempty"` 1025 // ReplicationSchedule - Schedule. Possible values include: '10minutely', 'Hourly', 'Daily' 1026 ReplicationSchedule ReplicationSchedule `json:"replicationSchedule,omitempty"` 1027 // RemoteVolumeResourceID - The resource ID of the remote volume. 1028 RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` 1029 // RemoteVolumeRegion - The remote region for the other end of the Volume Replication. 1030 RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` 1031} 1032 1033// ReplicationStatus replication status 1034type ReplicationStatus struct { 1035 autorest.Response `json:"-"` 1036 // Healthy - Replication health check 1037 Healthy *bool `json:"healthy,omitempty"` 1038 // RelationshipStatus - Status of the mirror relationship. Possible values include: 'Idle', 'Transferring' 1039 RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` 1040 // MirrorState - The status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken' 1041 MirrorState MirrorState `json:"mirrorState,omitempty"` 1042 // TotalProgress - The progress of the replication 1043 TotalProgress *string `json:"totalProgress,omitempty"` 1044 // ErrorMessage - Displays error message if the replication is in an error state 1045 ErrorMessage *string `json:"errorMessage,omitempty"` 1046} 1047 1048// ResourceNameAvailability information regarding availability of a resource name. 1049type ResourceNameAvailability struct { 1050 autorest.Response `json:"-"` 1051 // IsAvailable - <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. 1052 IsAvailable *bool `json:"isAvailable,omitempty"` 1053 // Reason - <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists' 1054 Reason InAvailabilityReasonType `json:"reason,omitempty"` 1055 // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. 1056 Message *string `json:"message,omitempty"` 1057} 1058 1059// ResourceNameAvailabilityRequest resource name availability request content. 1060type ResourceNameAvailabilityRequest struct { 1061 // Name - Resource name to verify. 1062 Name *string `json:"name,omitempty"` 1063 // Type - Resource type used for verification. Possible values include: 'MicrosoftNetAppnetAppAccounts', 'MicrosoftNetAppnetAppAccountscapacityPools', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots' 1064 Type CheckNameResourceTypes `json:"type,omitempty"` 1065 // ResourceGroup - Resource group name. 1066 ResourceGroup *string `json:"resourceGroup,omitempty"` 1067} 1068 1069// ServiceSpecification one property of operation, include metric specifications. 1070type ServiceSpecification struct { 1071 // MetricSpecifications - Metric specifications of operation. 1072 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` 1073} 1074 1075// Snapshot snapshot of a Volume 1076type Snapshot struct { 1077 autorest.Response `json:"-"` 1078 // Location - Resource location 1079 Location *string `json:"location,omitempty"` 1080 // ID - READ-ONLY; Resource Id 1081 ID *string `json:"id,omitempty"` 1082 // Name - READ-ONLY; Resource name 1083 Name *string `json:"name,omitempty"` 1084 // Type - READ-ONLY; Resource type 1085 Type *string `json:"type,omitempty"` 1086 // SnapshotProperties - Snapshot Properties 1087 *SnapshotProperties `json:"properties,omitempty"` 1088} 1089 1090// MarshalJSON is the custom marshaler for Snapshot. 1091func (s Snapshot) MarshalJSON() ([]byte, error) { 1092 objectMap := make(map[string]interface{}) 1093 if s.Location != nil { 1094 objectMap["location"] = s.Location 1095 } 1096 if s.SnapshotProperties != nil { 1097 objectMap["properties"] = s.SnapshotProperties 1098 } 1099 return json.Marshal(objectMap) 1100} 1101 1102// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 1103func (s *Snapshot) UnmarshalJSON(body []byte) error { 1104 var m map[string]*json.RawMessage 1105 err := json.Unmarshal(body, &m) 1106 if err != nil { 1107 return err 1108 } 1109 for k, v := range m { 1110 switch k { 1111 case "location": 1112 if v != nil { 1113 var location string 1114 err = json.Unmarshal(*v, &location) 1115 if err != nil { 1116 return err 1117 } 1118 s.Location = &location 1119 } 1120 case "id": 1121 if v != nil { 1122 var ID string 1123 err = json.Unmarshal(*v, &ID) 1124 if err != nil { 1125 return err 1126 } 1127 s.ID = &ID 1128 } 1129 case "name": 1130 if v != nil { 1131 var name string 1132 err = json.Unmarshal(*v, &name) 1133 if err != nil { 1134 return err 1135 } 1136 s.Name = &name 1137 } 1138 case "type": 1139 if v != nil { 1140 var typeVar string 1141 err = json.Unmarshal(*v, &typeVar) 1142 if err != nil { 1143 return err 1144 } 1145 s.Type = &typeVar 1146 } 1147 case "properties": 1148 if v != nil { 1149 var snapshotProperties SnapshotProperties 1150 err = json.Unmarshal(*v, &snapshotProperties) 1151 if err != nil { 1152 return err 1153 } 1154 s.SnapshotProperties = &snapshotProperties 1155 } 1156 } 1157 } 1158 1159 return nil 1160} 1161 1162// SnapshotProperties snapshot properties 1163type SnapshotProperties struct { 1164 // SnapshotID - READ-ONLY; UUID v4 used to identify the Snapshot 1165 SnapshotID *string `json:"snapshotId,omitempty"` 1166 // FileSystemID - UUID v4 used to identify the FileSystem 1167 FileSystemID *string `json:"fileSystemId,omitempty"` 1168 // Created - READ-ONLY; The creation date of the snapshot 1169 Created *date.Time `json:"created,omitempty"` 1170 // ProvisioningState - READ-ONLY; Azure lifecycle management 1171 ProvisioningState *string `json:"provisioningState,omitempty"` 1172} 1173 1174// MarshalJSON is the custom marshaler for SnapshotProperties. 1175func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { 1176 objectMap := make(map[string]interface{}) 1177 if sp.FileSystemID != nil { 1178 objectMap["fileSystemId"] = sp.FileSystemID 1179 } 1180 return json.Marshal(objectMap) 1181} 1182 1183// SnapshotsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1184// operation. 1185type SnapshotsCreateFuture struct { 1186 azure.FutureAPI 1187 // Result returns the result of the asynchronous operation. 1188 // If the operation has not completed it will return an error. 1189 Result func(SnapshotsClient) (Snapshot, error) 1190} 1191 1192// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1193func (future *SnapshotsCreateFuture) UnmarshalJSON(body []byte) error { 1194 var azFuture azure.Future 1195 if err := json.Unmarshal(body, &azFuture); err != nil { 1196 return err 1197 } 1198 future.FutureAPI = &azFuture 1199 future.Result = future.result 1200 return nil 1201} 1202 1203// result is the default implementation for SnapshotsCreateFuture.Result. 1204func (future *SnapshotsCreateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 1205 var done bool 1206 done, err = future.DoneWithContext(context.Background(), client) 1207 if err != nil { 1208 err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", future.Response(), "Polling failure") 1209 return 1210 } 1211 if !done { 1212 s.Response.Response = future.Response() 1213 err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsCreateFuture") 1214 return 1215 } 1216 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1217 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 1218 s, err = client.CreateResponder(s.Response.Response) 1219 if err != nil { 1220 err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", s.Response.Response, "Failure responding to request") 1221 } 1222 } 1223 return 1224} 1225 1226// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1227// operation. 1228type SnapshotsDeleteFuture struct { 1229 azure.FutureAPI 1230 // Result returns the result of the asynchronous operation. 1231 // If the operation has not completed it will return an error. 1232 Result func(SnapshotsClient) (autorest.Response, error) 1233} 1234 1235// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1236func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { 1237 var azFuture azure.Future 1238 if err := json.Unmarshal(body, &azFuture); err != nil { 1239 return err 1240 } 1241 future.FutureAPI = &azFuture 1242 future.Result = future.result 1243 return nil 1244} 1245 1246// result is the default implementation for SnapshotsDeleteFuture.Result. 1247func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { 1248 var done bool 1249 done, err = future.DoneWithContext(context.Background(), client) 1250 if err != nil { 1251 err = autorest.NewErrorWithError(err, "netapp.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 1252 return 1253 } 1254 if !done { 1255 ar.Response = future.Response() 1256 err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsDeleteFuture") 1257 return 1258 } 1259 ar.Response = future.Response() 1260 return 1261} 1262 1263// SnapshotsList list of Snapshots 1264type SnapshotsList struct { 1265 autorest.Response `json:"-"` 1266 // Value - A list of Snapshots 1267 Value *[]Snapshot `json:"value,omitempty"` 1268} 1269 1270// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1271// operation. 1272type SnapshotsUpdateFuture struct { 1273 azure.FutureAPI 1274 // Result returns the result of the asynchronous operation. 1275 // If the operation has not completed it will return an error. 1276 Result func(SnapshotsClient) (Snapshot, error) 1277} 1278 1279// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1280func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { 1281 var azFuture azure.Future 1282 if err := json.Unmarshal(body, &azFuture); err != nil { 1283 return err 1284 } 1285 future.FutureAPI = &azFuture 1286 future.Result = future.result 1287 return nil 1288} 1289 1290// result is the default implementation for SnapshotsUpdateFuture.Result. 1291func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { 1292 var done bool 1293 done, err = future.DoneWithContext(context.Background(), client) 1294 if err != nil { 1295 err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") 1296 return 1297 } 1298 if !done { 1299 s.Response.Response = future.Response() 1300 err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsUpdateFuture") 1301 return 1302 } 1303 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1304 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 1305 s, err = client.UpdateResponder(s.Response.Response) 1306 if err != nil { 1307 err = autorest.NewErrorWithError(err, "netapp.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 1308 } 1309 } 1310 return 1311} 1312 1313// Volume volume resource 1314type Volume struct { 1315 autorest.Response `json:"-"` 1316 // Location - Resource location 1317 Location *string `json:"location,omitempty"` 1318 // ID - READ-ONLY; Resource Id 1319 ID *string `json:"id,omitempty"` 1320 // Name - READ-ONLY; Resource name 1321 Name *string `json:"name,omitempty"` 1322 // Type - READ-ONLY; Resource type 1323 Type *string `json:"type,omitempty"` 1324 // Tags - Resource tags 1325 Tags map[string]*string `json:"tags"` 1326 // VolumeProperties - Volume properties 1327 *VolumeProperties `json:"properties,omitempty"` 1328} 1329 1330// MarshalJSON is the custom marshaler for Volume. 1331func (vVar Volume) MarshalJSON() ([]byte, error) { 1332 objectMap := make(map[string]interface{}) 1333 if vVar.Location != nil { 1334 objectMap["location"] = vVar.Location 1335 } 1336 if vVar.Tags != nil { 1337 objectMap["tags"] = vVar.Tags 1338 } 1339 if vVar.VolumeProperties != nil { 1340 objectMap["properties"] = vVar.VolumeProperties 1341 } 1342 return json.Marshal(objectMap) 1343} 1344 1345// UnmarshalJSON is the custom unmarshaler for Volume struct. 1346func (vVar *Volume) UnmarshalJSON(body []byte) error { 1347 var m map[string]*json.RawMessage 1348 err := json.Unmarshal(body, &m) 1349 if err != nil { 1350 return err 1351 } 1352 for k, v := range m { 1353 switch k { 1354 case "location": 1355 if v != nil { 1356 var location string 1357 err = json.Unmarshal(*v, &location) 1358 if err != nil { 1359 return err 1360 } 1361 vVar.Location = &location 1362 } 1363 case "id": 1364 if v != nil { 1365 var ID string 1366 err = json.Unmarshal(*v, &ID) 1367 if err != nil { 1368 return err 1369 } 1370 vVar.ID = &ID 1371 } 1372 case "name": 1373 if v != nil { 1374 var name string 1375 err = json.Unmarshal(*v, &name) 1376 if err != nil { 1377 return err 1378 } 1379 vVar.Name = &name 1380 } 1381 case "type": 1382 if v != nil { 1383 var typeVar string 1384 err = json.Unmarshal(*v, &typeVar) 1385 if err != nil { 1386 return err 1387 } 1388 vVar.Type = &typeVar 1389 } 1390 case "tags": 1391 if v != nil { 1392 var tags map[string]*string 1393 err = json.Unmarshal(*v, &tags) 1394 if err != nil { 1395 return err 1396 } 1397 vVar.Tags = tags 1398 } 1399 case "properties": 1400 if v != nil { 1401 var volumeProperties VolumeProperties 1402 err = json.Unmarshal(*v, &volumeProperties) 1403 if err != nil { 1404 return err 1405 } 1406 vVar.VolumeProperties = &volumeProperties 1407 } 1408 } 1409 } 1410 1411 return nil 1412} 1413 1414// VolumeList list of volume resources 1415type VolumeList struct { 1416 autorest.Response `json:"-"` 1417 // Value - List of volumes 1418 Value *[]Volume `json:"value,omitempty"` 1419} 1420 1421// VolumePatch volume patch resource 1422type VolumePatch struct { 1423 // Location - Resource location 1424 Location *string `json:"location,omitempty"` 1425 // ID - READ-ONLY; Resource Id 1426 ID *string `json:"id,omitempty"` 1427 // Name - READ-ONLY; Resource name 1428 Name *string `json:"name,omitempty"` 1429 // Type - READ-ONLY; Resource type 1430 Type *string `json:"type,omitempty"` 1431 // Tags - Resource tags 1432 Tags map[string]*string `json:"tags"` 1433 // VolumePatchProperties - Patchable volume properties 1434 *VolumePatchProperties `json:"properties,omitempty"` 1435} 1436 1437// MarshalJSON is the custom marshaler for VolumePatch. 1438func (vp VolumePatch) MarshalJSON() ([]byte, error) { 1439 objectMap := make(map[string]interface{}) 1440 if vp.Location != nil { 1441 objectMap["location"] = vp.Location 1442 } 1443 if vp.Tags != nil { 1444 objectMap["tags"] = vp.Tags 1445 } 1446 if vp.VolumePatchProperties != nil { 1447 objectMap["properties"] = vp.VolumePatchProperties 1448 } 1449 return json.Marshal(objectMap) 1450} 1451 1452// UnmarshalJSON is the custom unmarshaler for VolumePatch struct. 1453func (vp *VolumePatch) UnmarshalJSON(body []byte) error { 1454 var m map[string]*json.RawMessage 1455 err := json.Unmarshal(body, &m) 1456 if err != nil { 1457 return err 1458 } 1459 for k, v := range m { 1460 switch k { 1461 case "location": 1462 if v != nil { 1463 var location string 1464 err = json.Unmarshal(*v, &location) 1465 if err != nil { 1466 return err 1467 } 1468 vp.Location = &location 1469 } 1470 case "id": 1471 if v != nil { 1472 var ID string 1473 err = json.Unmarshal(*v, &ID) 1474 if err != nil { 1475 return err 1476 } 1477 vp.ID = &ID 1478 } 1479 case "name": 1480 if v != nil { 1481 var name string 1482 err = json.Unmarshal(*v, &name) 1483 if err != nil { 1484 return err 1485 } 1486 vp.Name = &name 1487 } 1488 case "type": 1489 if v != nil { 1490 var typeVar string 1491 err = json.Unmarshal(*v, &typeVar) 1492 if err != nil { 1493 return err 1494 } 1495 vp.Type = &typeVar 1496 } 1497 case "tags": 1498 if v != nil { 1499 var tags map[string]*string 1500 err = json.Unmarshal(*v, &tags) 1501 if err != nil { 1502 return err 1503 } 1504 vp.Tags = tags 1505 } 1506 case "properties": 1507 if v != nil { 1508 var volumePatchProperties VolumePatchProperties 1509 err = json.Unmarshal(*v, &volumePatchProperties) 1510 if err != nil { 1511 return err 1512 } 1513 vp.VolumePatchProperties = &volumePatchProperties 1514 } 1515 } 1516 } 1517 1518 return nil 1519} 1520 1521// VolumePatchProperties patchable volume properties 1522type VolumePatchProperties struct { 1523 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 1524 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 1525 // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. 1526 UsageThreshold *int64 `json:"usageThreshold,omitempty"` 1527 // ExportPolicy - Set of export policy rules 1528 ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` 1529} 1530 1531// VolumePatchPropertiesExportPolicy set of export policy rules 1532type VolumePatchPropertiesExportPolicy struct { 1533 // Rules - Export policy rule 1534 Rules *[]ExportPolicyRule `json:"rules,omitempty"` 1535} 1536 1537// VolumeProperties volume properties 1538type VolumeProperties struct { 1539 // FileSystemID - READ-ONLY; Unique FileSystem Identifier. 1540 FileSystemID *string `json:"fileSystemId,omitempty"` 1541 // CreationToken - A unique file path for the volume. Used when creating mount targets 1542 CreationToken *string `json:"creationToken,omitempty"` 1543 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 1544 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 1545 // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. 1546 UsageThreshold *int64 `json:"usageThreshold,omitempty"` 1547 // ExportPolicy - Set of export policy rules 1548 ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` 1549 // ProtocolTypes - Set of protocol types 1550 ProtocolTypes *[]string `json:"protocolTypes,omitempty"` 1551 // ProvisioningState - READ-ONLY; Azure lifecycle management 1552 ProvisioningState *string `json:"provisioningState,omitempty"` 1553 // SnapshotID - UUID v4 or resource identifier used to identify the Snapshot. 1554 SnapshotID *string `json:"snapshotId,omitempty"` 1555 // BaremetalTenantID - READ-ONLY; Unique Baremetal Tenant Identifier. 1556 BaremetalTenantID *string `json:"baremetalTenantId,omitempty"` 1557 // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes 1558 SubnetID *string `json:"subnetId,omitempty"` 1559 // MountTargets - List of mount targets 1560 MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` 1561 // VolumeType - What type of volume is this 1562 VolumeType *string `json:"volumeType,omitempty"` 1563 // DataProtection - DataProtection type volumes include an object containing details of the replication 1564 DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` 1565 // IsRestoring - Restoring 1566 IsRestoring *bool `json:"isRestoring,omitempty"` 1567} 1568 1569// MarshalJSON is the custom marshaler for VolumeProperties. 1570func (vp VolumeProperties) MarshalJSON() ([]byte, error) { 1571 objectMap := make(map[string]interface{}) 1572 if vp.CreationToken != nil { 1573 objectMap["creationToken"] = vp.CreationToken 1574 } 1575 if vp.ServiceLevel != "" { 1576 objectMap["serviceLevel"] = vp.ServiceLevel 1577 } 1578 if vp.UsageThreshold != nil { 1579 objectMap["usageThreshold"] = vp.UsageThreshold 1580 } 1581 if vp.ExportPolicy != nil { 1582 objectMap["exportPolicy"] = vp.ExportPolicy 1583 } 1584 if vp.ProtocolTypes != nil { 1585 objectMap["protocolTypes"] = vp.ProtocolTypes 1586 } 1587 if vp.SnapshotID != nil { 1588 objectMap["snapshotId"] = vp.SnapshotID 1589 } 1590 if vp.SubnetID != nil { 1591 objectMap["subnetId"] = vp.SubnetID 1592 } 1593 if vp.MountTargets != nil { 1594 objectMap["mountTargets"] = vp.MountTargets 1595 } 1596 if vp.VolumeType != nil { 1597 objectMap["volumeType"] = vp.VolumeType 1598 } 1599 if vp.DataProtection != nil { 1600 objectMap["dataProtection"] = vp.DataProtection 1601 } 1602 if vp.IsRestoring != nil { 1603 objectMap["isRestoring"] = vp.IsRestoring 1604 } 1605 return json.Marshal(objectMap) 1606} 1607 1608// VolumePropertiesDataProtection dataProtection type volumes include an object containing details of the 1609// replication 1610type VolumePropertiesDataProtection struct { 1611 // Replication - Replication properties 1612 Replication *ReplicationObject `json:"replication,omitempty"` 1613} 1614 1615// VolumePropertiesExportPolicy set of export policy rules 1616type VolumePropertiesExportPolicy struct { 1617 // Rules - Export policy rule 1618 Rules *[]ExportPolicyRule `json:"rules,omitempty"` 1619} 1620 1621// VolumeRevert revert a volume to the snapshot 1622type VolumeRevert struct { 1623 // SnapshotID - Resource id of the snapshot 1624 SnapshotID *string `json:"snapshotId,omitempty"` 1625} 1626 1627// VolumesAuthorizeReplicationFuture an abstraction for monitoring and retrieving the results of a 1628// long-running operation. 1629type VolumesAuthorizeReplicationFuture struct { 1630 azure.FutureAPI 1631 // Result returns the result of the asynchronous operation. 1632 // If the operation has not completed it will return an error. 1633 Result func(VolumesClient) (autorest.Response, error) 1634} 1635 1636// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1637func (future *VolumesAuthorizeReplicationFuture) UnmarshalJSON(body []byte) error { 1638 var azFuture azure.Future 1639 if err := json.Unmarshal(body, &azFuture); err != nil { 1640 return err 1641 } 1642 future.FutureAPI = &azFuture 1643 future.Result = future.result 1644 return nil 1645} 1646 1647// result is the default implementation for VolumesAuthorizeReplicationFuture.Result. 1648func (future *VolumesAuthorizeReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { 1649 var done bool 1650 done, err = future.DoneWithContext(context.Background(), client) 1651 if err != nil { 1652 err = autorest.NewErrorWithError(err, "netapp.VolumesAuthorizeReplicationFuture", "Result", future.Response(), "Polling failure") 1653 return 1654 } 1655 if !done { 1656 ar.Response = future.Response() 1657 err = azure.NewAsyncOpIncompleteError("netapp.VolumesAuthorizeReplicationFuture") 1658 return 1659 } 1660 ar.Response = future.Response() 1661 return 1662} 1663 1664// VolumesBreakReplicationFuture an abstraction for monitoring and retrieving the results of a long-running 1665// operation. 1666type VolumesBreakReplicationFuture struct { 1667 azure.FutureAPI 1668 // Result returns the result of the asynchronous operation. 1669 // If the operation has not completed it will return an error. 1670 Result func(VolumesClient) (autorest.Response, error) 1671} 1672 1673// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1674func (future *VolumesBreakReplicationFuture) UnmarshalJSON(body []byte) error { 1675 var azFuture azure.Future 1676 if err := json.Unmarshal(body, &azFuture); err != nil { 1677 return err 1678 } 1679 future.FutureAPI = &azFuture 1680 future.Result = future.result 1681 return nil 1682} 1683 1684// result is the default implementation for VolumesBreakReplicationFuture.Result. 1685func (future *VolumesBreakReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { 1686 var done bool 1687 done, err = future.DoneWithContext(context.Background(), client) 1688 if err != nil { 1689 err = autorest.NewErrorWithError(err, "netapp.VolumesBreakReplicationFuture", "Result", future.Response(), "Polling failure") 1690 return 1691 } 1692 if !done { 1693 ar.Response = future.Response() 1694 err = azure.NewAsyncOpIncompleteError("netapp.VolumesBreakReplicationFuture") 1695 return 1696 } 1697 ar.Response = future.Response() 1698 return 1699} 1700 1701// VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1702// operation. 1703type VolumesCreateOrUpdateFuture 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(VolumesClient) (Volume, error) 1708} 1709 1710// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1711func (future *VolumesCreateOrUpdateFuture) 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 VolumesCreateOrUpdateFuture.Result. 1722func (future *VolumesCreateOrUpdateFuture) result(client VolumesClient) (vVar Volume, err error) { 1723 var done bool 1724 done, err = future.DoneWithContext(context.Background(), client) 1725 if err != nil { 1726 err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1727 return 1728 } 1729 if !done { 1730 vVar.Response.Response = future.Response() 1731 err = azure.NewAsyncOpIncompleteError("netapp.VolumesCreateOrUpdateFuture") 1732 return 1733 } 1734 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1735 if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { 1736 vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response) 1737 if err != nil { 1738 err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") 1739 } 1740 } 1741 return 1742} 1743 1744// VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1745// operation. 1746type VolumesDeleteFuture 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(VolumesClient) (autorest.Response, error) 1751} 1752 1753// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1754func (future *VolumesDeleteFuture) 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 VolumesDeleteFuture.Result. 1765func (future *VolumesDeleteFuture) result(client VolumesClient) (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, "netapp.VolumesDeleteFuture", "Result", future.Response(), "Polling failure") 1770 return 1771 } 1772 if !done { 1773 ar.Response = future.Response() 1774 err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteFuture") 1775 return 1776 } 1777 ar.Response = future.Response() 1778 return 1779} 1780 1781// VolumesDeleteReplicationFuture an abstraction for monitoring and retrieving the results of a 1782// long-running operation. 1783type VolumesDeleteReplicationFuture 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(VolumesClient) (autorest.Response, error) 1788} 1789 1790// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1791func (future *VolumesDeleteReplicationFuture) 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 VolumesDeleteReplicationFuture.Result. 1802func (future *VolumesDeleteReplicationFuture) result(client VolumesClient) (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, "netapp.VolumesDeleteReplicationFuture", "Result", future.Response(), "Polling failure") 1807 return 1808 } 1809 if !done { 1810 ar.Response = future.Response() 1811 err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteReplicationFuture") 1812 return 1813 } 1814 ar.Response = future.Response() 1815 return 1816} 1817 1818// VolumesResyncReplicationFuture an abstraction for monitoring and retrieving the results of a 1819// long-running operation. 1820type VolumesResyncReplicationFuture 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(VolumesClient) (autorest.Response, error) 1825} 1826 1827// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1828func (future *VolumesResyncReplicationFuture) 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 VolumesResyncReplicationFuture.Result. 1839func (future *VolumesResyncReplicationFuture) result(client VolumesClient) (ar autorest.Response, err error) { 1840 var done bool 1841 done, err = future.DoneWithContext(context.Background(), client) 1842 if err != nil { 1843 err = autorest.NewErrorWithError(err, "netapp.VolumesResyncReplicationFuture", "Result", future.Response(), "Polling failure") 1844 return 1845 } 1846 if !done { 1847 ar.Response = future.Response() 1848 err = azure.NewAsyncOpIncompleteError("netapp.VolumesResyncReplicationFuture") 1849 return 1850 } 1851 ar.Response = future.Response() 1852 return 1853} 1854 1855// VolumesRevertFuture an abstraction for monitoring and retrieving the results of a long-running 1856// operation. 1857type VolumesRevertFuture struct { 1858 azure.FutureAPI 1859 // Result returns the result of the asynchronous operation. 1860 // If the operation has not completed it will return an error. 1861 Result func(VolumesClient) (autorest.Response, error) 1862} 1863 1864// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1865func (future *VolumesRevertFuture) UnmarshalJSON(body []byte) error { 1866 var azFuture azure.Future 1867 if err := json.Unmarshal(body, &azFuture); err != nil { 1868 return err 1869 } 1870 future.FutureAPI = &azFuture 1871 future.Result = future.result 1872 return nil 1873} 1874 1875// result is the default implementation for VolumesRevertFuture.Result. 1876func (future *VolumesRevertFuture) result(client VolumesClient) (ar autorest.Response, err error) { 1877 var done bool 1878 done, err = future.DoneWithContext(context.Background(), client) 1879 if err != nil { 1880 err = autorest.NewErrorWithError(err, "netapp.VolumesRevertFuture", "Result", future.Response(), "Polling failure") 1881 return 1882 } 1883 if !done { 1884 ar.Response = future.Response() 1885 err = azure.NewAsyncOpIncompleteError("netapp.VolumesRevertFuture") 1886 return 1887 } 1888 ar.Response = future.Response() 1889 return 1890} 1891 1892// VolumesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1893// operation. 1894type VolumesUpdateFuture struct { 1895 azure.FutureAPI 1896 // Result returns the result of the asynchronous operation. 1897 // If the operation has not completed it will return an error. 1898 Result func(VolumesClient) (Volume, error) 1899} 1900 1901// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1902func (future *VolumesUpdateFuture) UnmarshalJSON(body []byte) error { 1903 var azFuture azure.Future 1904 if err := json.Unmarshal(body, &azFuture); err != nil { 1905 return err 1906 } 1907 future.FutureAPI = &azFuture 1908 future.Result = future.result 1909 return nil 1910} 1911 1912// result is the default implementation for VolumesUpdateFuture.Result. 1913func (future *VolumesUpdateFuture) result(client VolumesClient) (vVar Volume, err error) { 1914 var done bool 1915 done, err = future.DoneWithContext(context.Background(), client) 1916 if err != nil { 1917 err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", future.Response(), "Polling failure") 1918 return 1919 } 1920 if !done { 1921 vVar.Response.Response = future.Response() 1922 err = azure.NewAsyncOpIncompleteError("netapp.VolumesUpdateFuture") 1923 return 1924 } 1925 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1926 if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { 1927 vVar, err = client.UpdateResponder(vVar.Response.Response) 1928 if err != nil { 1929 err = autorest.NewErrorWithError(err, "netapp.VolumesUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") 1930 } 1931 } 1932 return 1933} 1934