1package storagecache 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2021-03-01/storagecache" 22 23// APIOperation REST API operation description: see 24// https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#r3023-operationsapiimplementation 25type APIOperation struct { 26 // Display - The object that represents the operation. 27 Display *APIOperationDisplay `json:"display,omitempty"` 28 // Origin - Origin of the operation. 29 Origin *string `json:"origin,omitempty"` 30 // IsDataAction - The flag that indicates whether the operation applies to data plane. 31 IsDataAction *bool `json:"isDataAction,omitempty"` 32 // Name - Operation name: {provider}/{resource}/{operation} 33 Name *string `json:"name,omitempty"` 34 // APIOperationProperties - Additional details about an operation. 35 *APIOperationProperties `json:"properties,omitempty"` 36} 37 38// MarshalJSON is the custom marshaler for APIOperation. 39func (ao APIOperation) MarshalJSON() ([]byte, error) { 40 objectMap := make(map[string]interface{}) 41 if ao.Display != nil { 42 objectMap["display"] = ao.Display 43 } 44 if ao.Origin != nil { 45 objectMap["origin"] = ao.Origin 46 } 47 if ao.IsDataAction != nil { 48 objectMap["isDataAction"] = ao.IsDataAction 49 } 50 if ao.Name != nil { 51 objectMap["name"] = ao.Name 52 } 53 if ao.APIOperationProperties != nil { 54 objectMap["properties"] = ao.APIOperationProperties 55 } 56 return json.Marshal(objectMap) 57} 58 59// UnmarshalJSON is the custom unmarshaler for APIOperation struct. 60func (ao *APIOperation) UnmarshalJSON(body []byte) error { 61 var m map[string]*json.RawMessage 62 err := json.Unmarshal(body, &m) 63 if err != nil { 64 return err 65 } 66 for k, v := range m { 67 switch k { 68 case "display": 69 if v != nil { 70 var display APIOperationDisplay 71 err = json.Unmarshal(*v, &display) 72 if err != nil { 73 return err 74 } 75 ao.Display = &display 76 } 77 case "origin": 78 if v != nil { 79 var origin string 80 err = json.Unmarshal(*v, &origin) 81 if err != nil { 82 return err 83 } 84 ao.Origin = &origin 85 } 86 case "isDataAction": 87 if v != nil { 88 var isDataAction bool 89 err = json.Unmarshal(*v, &isDataAction) 90 if err != nil { 91 return err 92 } 93 ao.IsDataAction = &isDataAction 94 } 95 case "name": 96 if v != nil { 97 var name string 98 err = json.Unmarshal(*v, &name) 99 if err != nil { 100 return err 101 } 102 ao.Name = &name 103 } 104 case "properties": 105 if v != nil { 106 var APIOperationProperties APIOperationProperties 107 err = json.Unmarshal(*v, &APIOperationProperties) 108 if err != nil { 109 return err 110 } 111 ao.APIOperationProperties = &APIOperationProperties 112 } 113 } 114 } 115 116 return nil 117} 118 119// APIOperationDisplay the object that represents the operation. 120type APIOperationDisplay struct { 121 // Operation - Operation type: Read, write, delete, etc. 122 Operation *string `json:"operation,omitempty"` 123 // Provider - Service provider: Microsoft.StorageCache 124 Provider *string `json:"provider,omitempty"` 125 // Resource - Resource on which the operation is performed: Cache, etc. 126 Resource *string `json:"resource,omitempty"` 127 // Description - The description of the operation 128 Description *string `json:"description,omitempty"` 129} 130 131// APIOperationListResult result of the request to list Resource Provider operations. It contains a list of 132// operations and a URL link to get the next set of results. 133type APIOperationListResult struct { 134 autorest.Response `json:"-"` 135 // NextLink - URL to get the next set of operation list results if there are any. 136 NextLink *string `json:"nextLink,omitempty"` 137 // Value - List of Resource Provider operations supported by the Microsoft.StorageCache resource provider. 138 Value *[]APIOperation `json:"value,omitempty"` 139} 140 141// APIOperationListResultIterator provides access to a complete listing of APIOperation values. 142type APIOperationListResultIterator struct { 143 i int 144 page APIOperationListResultPage 145} 146 147// NextWithContext advances to the next value. If there was an error making 148// the request the iterator does not advance and the error is returned. 149func (iter *APIOperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 150 if tracing.IsEnabled() { 151 ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationListResultIterator.NextWithContext") 152 defer func() { 153 sc := -1 154 if iter.Response().Response.Response != nil { 155 sc = iter.Response().Response.Response.StatusCode 156 } 157 tracing.EndSpan(ctx, sc, err) 158 }() 159 } 160 iter.i++ 161 if iter.i < len(iter.page.Values()) { 162 return nil 163 } 164 err = iter.page.NextWithContext(ctx) 165 if err != nil { 166 iter.i-- 167 return err 168 } 169 iter.i = 0 170 return nil 171} 172 173// Next advances to the next value. If there was an error making 174// the request the iterator does not advance and the error is returned. 175// Deprecated: Use NextWithContext() instead. 176func (iter *APIOperationListResultIterator) Next() error { 177 return iter.NextWithContext(context.Background()) 178} 179 180// NotDone returns true if the enumeration should be started or is not yet complete. 181func (iter APIOperationListResultIterator) NotDone() bool { 182 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 183} 184 185// Response returns the raw server response from the last page request. 186func (iter APIOperationListResultIterator) Response() APIOperationListResult { 187 return iter.page.Response() 188} 189 190// Value returns the current value or a zero-initialized value if the 191// iterator has advanced beyond the end of the collection. 192func (iter APIOperationListResultIterator) Value() APIOperation { 193 if !iter.page.NotDone() { 194 return APIOperation{} 195 } 196 return iter.page.Values()[iter.i] 197} 198 199// Creates a new instance of the APIOperationListResultIterator type. 200func NewAPIOperationListResultIterator(page APIOperationListResultPage) APIOperationListResultIterator { 201 return APIOperationListResultIterator{page: page} 202} 203 204// IsEmpty returns true if the ListResult contains no values. 205func (aolr APIOperationListResult) IsEmpty() bool { 206 return aolr.Value == nil || len(*aolr.Value) == 0 207} 208 209// hasNextLink returns true if the NextLink is not empty. 210func (aolr APIOperationListResult) hasNextLink() bool { 211 return aolr.NextLink != nil && len(*aolr.NextLink) != 0 212} 213 214// aPIOperationListResultPreparer prepares a request to retrieve the next set of results. 215// It returns nil if no more results exist. 216func (aolr APIOperationListResult) aPIOperationListResultPreparer(ctx context.Context) (*http.Request, error) { 217 if !aolr.hasNextLink() { 218 return nil, nil 219 } 220 return autorest.Prepare((&http.Request{}).WithContext(ctx), 221 autorest.AsJSON(), 222 autorest.AsGet(), 223 autorest.WithBaseURL(to.String(aolr.NextLink))) 224} 225 226// APIOperationListResultPage contains a page of APIOperation values. 227type APIOperationListResultPage struct { 228 fn func(context.Context, APIOperationListResult) (APIOperationListResult, error) 229 aolr APIOperationListResult 230} 231 232// NextWithContext advances to the next page of values. If there was an error making 233// the request the page does not advance and the error is returned. 234func (page *APIOperationListResultPage) NextWithContext(ctx context.Context) (err error) { 235 if tracing.IsEnabled() { 236 ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationListResultPage.NextWithContext") 237 defer func() { 238 sc := -1 239 if page.Response().Response.Response != nil { 240 sc = page.Response().Response.Response.StatusCode 241 } 242 tracing.EndSpan(ctx, sc, err) 243 }() 244 } 245 for { 246 next, err := page.fn(ctx, page.aolr) 247 if err != nil { 248 return err 249 } 250 page.aolr = next 251 if !next.hasNextLink() || !next.IsEmpty() { 252 break 253 } 254 } 255 return nil 256} 257 258// Next advances to the next page of values. If there was an error making 259// the request the page does not advance and the error is returned. 260// Deprecated: Use NextWithContext() instead. 261func (page *APIOperationListResultPage) Next() error { 262 return page.NextWithContext(context.Background()) 263} 264 265// NotDone returns true if the page enumeration should be started or is not yet complete. 266func (page APIOperationListResultPage) NotDone() bool { 267 return !page.aolr.IsEmpty() 268} 269 270// Response returns the raw server response from the last page request. 271func (page APIOperationListResultPage) Response() APIOperationListResult { 272 return page.aolr 273} 274 275// Values returns the slice of values for the current page or nil if there are no values. 276func (page APIOperationListResultPage) Values() []APIOperation { 277 if page.aolr.IsEmpty() { 278 return nil 279 } 280 return *page.aolr.Value 281} 282 283// Creates a new instance of the APIOperationListResultPage type. 284func NewAPIOperationListResultPage(cur APIOperationListResult, getNextPage func(context.Context, APIOperationListResult) (APIOperationListResult, error)) APIOperationListResultPage { 285 return APIOperationListResultPage{ 286 fn: getNextPage, 287 aolr: cur, 288 } 289} 290 291// APIOperationProperties additional details about an operation. 292type APIOperationProperties struct { 293 // ServiceSpecification - Specification of the all the metrics provided for a resource type. 294 ServiceSpecification *APIOperationPropertiesServiceSpecification `json:"serviceSpecification,omitempty"` 295} 296 297// APIOperationPropertiesServiceSpecification specification of the all the metrics provided for a resource 298// type. 299type APIOperationPropertiesServiceSpecification struct { 300 // MetricSpecifications - Details about operations related to metrics. 301 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` 302} 303 304// AscOperation the status of operation. 305type AscOperation struct { 306 autorest.Response `json:"-"` 307 // ID - The operation Id. 308 ID *string `json:"id,omitempty"` 309 // Name - The operation name. 310 Name *string `json:"name,omitempty"` 311 // StartTime - The start time of the operation. 312 StartTime *string `json:"startTime,omitempty"` 313 // EndTime - The end time of the operation. 314 EndTime *string `json:"endTime,omitempty"` 315 // Status - The status of the operation. 316 Status *string `json:"status,omitempty"` 317 // Error - The error detail of the operation if any. 318 Error *ErrorResponse `json:"error,omitempty"` 319 // AscOperationProperties - Additional operation-specific properties 320 *AscOperationProperties `json:"properties,omitempty"` 321} 322 323// MarshalJSON is the custom marshaler for AscOperation. 324func (ao AscOperation) MarshalJSON() ([]byte, error) { 325 objectMap := make(map[string]interface{}) 326 if ao.ID != nil { 327 objectMap["id"] = ao.ID 328 } 329 if ao.Name != nil { 330 objectMap["name"] = ao.Name 331 } 332 if ao.StartTime != nil { 333 objectMap["startTime"] = ao.StartTime 334 } 335 if ao.EndTime != nil { 336 objectMap["endTime"] = ao.EndTime 337 } 338 if ao.Status != nil { 339 objectMap["status"] = ao.Status 340 } 341 if ao.Error != nil { 342 objectMap["error"] = ao.Error 343 } 344 if ao.AscOperationProperties != nil { 345 objectMap["properties"] = ao.AscOperationProperties 346 } 347 return json.Marshal(objectMap) 348} 349 350// UnmarshalJSON is the custom unmarshaler for AscOperation struct. 351func (ao *AscOperation) UnmarshalJSON(body []byte) error { 352 var m map[string]*json.RawMessage 353 err := json.Unmarshal(body, &m) 354 if err != nil { 355 return err 356 } 357 for k, v := range m { 358 switch k { 359 case "id": 360 if v != nil { 361 var ID string 362 err = json.Unmarshal(*v, &ID) 363 if err != nil { 364 return err 365 } 366 ao.ID = &ID 367 } 368 case "name": 369 if v != nil { 370 var name string 371 err = json.Unmarshal(*v, &name) 372 if err != nil { 373 return err 374 } 375 ao.Name = &name 376 } 377 case "startTime": 378 if v != nil { 379 var startTime string 380 err = json.Unmarshal(*v, &startTime) 381 if err != nil { 382 return err 383 } 384 ao.StartTime = &startTime 385 } 386 case "endTime": 387 if v != nil { 388 var endTime string 389 err = json.Unmarshal(*v, &endTime) 390 if err != nil { 391 return err 392 } 393 ao.EndTime = &endTime 394 } 395 case "status": 396 if v != nil { 397 var status string 398 err = json.Unmarshal(*v, &status) 399 if err != nil { 400 return err 401 } 402 ao.Status = &status 403 } 404 case "error": 405 if v != nil { 406 var errorVar ErrorResponse 407 err = json.Unmarshal(*v, &errorVar) 408 if err != nil { 409 return err 410 } 411 ao.Error = &errorVar 412 } 413 case "properties": 414 if v != nil { 415 var ascOperationProperties AscOperationProperties 416 err = json.Unmarshal(*v, &ascOperationProperties) 417 if err != nil { 418 return err 419 } 420 ao.AscOperationProperties = &ascOperationProperties 421 } 422 } 423 } 424 425 return nil 426} 427 428// AscOperationProperties additional operation-specific output. 429type AscOperationProperties struct { 430 // Output - Additional operation-specific output. 431 Output map[string]interface{} `json:"output"` 432} 433 434// MarshalJSON is the custom marshaler for AscOperationProperties. 435func (aop AscOperationProperties) MarshalJSON() ([]byte, error) { 436 objectMap := make(map[string]interface{}) 437 if aop.Output != nil { 438 objectMap["output"] = aop.Output 439 } 440 return json.Marshal(objectMap) 441} 442 443// BlobNfsTarget properties pertaining to the BlobNfsTarget. 444type BlobNfsTarget struct { 445 // Target - Resource ID of the storage container. 446 Target *string `json:"target,omitempty"` 447 // UsageModel - Identifies the StorageCache usage model to be used for this storage target. 448 UsageModel *string `json:"usageModel,omitempty"` 449} 450 451// Cache a Cache instance. Follows Azure Resource Manager standards: 452// https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md 453type Cache struct { 454 autorest.Response `json:"-"` 455 // Tags - Resource tags. 456 Tags map[string]*string `json:"tags"` 457 // ID - READ-ONLY; Resource ID of the Cache. 458 ID *string `json:"id,omitempty"` 459 // Location - Region name string. 460 Location *string `json:"location,omitempty"` 461 // Name - READ-ONLY; Name of Cache. 462 Name *string `json:"name,omitempty"` 463 // Type - READ-ONLY; Type of the Cache; Microsoft.StorageCache/Cache 464 Type *string `json:"type,omitempty"` 465 // Identity - The identity of the cache, if configured. 466 Identity *CacheIdentity `json:"identity,omitempty"` 467 // SystemData - READ-ONLY; The system meta data relating to this resource. 468 SystemData *SystemData `json:"systemData,omitempty"` 469 // CacheProperties - Properties of the Cache. 470 *CacheProperties `json:"properties,omitempty"` 471 // Sku - SKU for the Cache. 472 Sku *CacheSku `json:"sku,omitempty"` 473} 474 475// MarshalJSON is the custom marshaler for Cache. 476func (c Cache) MarshalJSON() ([]byte, error) { 477 objectMap := make(map[string]interface{}) 478 if c.Tags != nil { 479 objectMap["tags"] = c.Tags 480 } 481 if c.Location != nil { 482 objectMap["location"] = c.Location 483 } 484 if c.Identity != nil { 485 objectMap["identity"] = c.Identity 486 } 487 if c.CacheProperties != nil { 488 objectMap["properties"] = c.CacheProperties 489 } 490 if c.Sku != nil { 491 objectMap["sku"] = c.Sku 492 } 493 return json.Marshal(objectMap) 494} 495 496// UnmarshalJSON is the custom unmarshaler for Cache struct. 497func (c *Cache) UnmarshalJSON(body []byte) error { 498 var m map[string]*json.RawMessage 499 err := json.Unmarshal(body, &m) 500 if err != nil { 501 return err 502 } 503 for k, v := range m { 504 switch k { 505 case "tags": 506 if v != nil { 507 var tags map[string]*string 508 err = json.Unmarshal(*v, &tags) 509 if err != nil { 510 return err 511 } 512 c.Tags = tags 513 } 514 case "id": 515 if v != nil { 516 var ID string 517 err = json.Unmarshal(*v, &ID) 518 if err != nil { 519 return err 520 } 521 c.ID = &ID 522 } 523 case "location": 524 if v != nil { 525 var location string 526 err = json.Unmarshal(*v, &location) 527 if err != nil { 528 return err 529 } 530 c.Location = &location 531 } 532 case "name": 533 if v != nil { 534 var name string 535 err = json.Unmarshal(*v, &name) 536 if err != nil { 537 return err 538 } 539 c.Name = &name 540 } 541 case "type": 542 if v != nil { 543 var typeVar string 544 err = json.Unmarshal(*v, &typeVar) 545 if err != nil { 546 return err 547 } 548 c.Type = &typeVar 549 } 550 case "identity": 551 if v != nil { 552 var identity CacheIdentity 553 err = json.Unmarshal(*v, &identity) 554 if err != nil { 555 return err 556 } 557 c.Identity = &identity 558 } 559 case "systemData": 560 if v != nil { 561 var systemData SystemData 562 err = json.Unmarshal(*v, &systemData) 563 if err != nil { 564 return err 565 } 566 c.SystemData = &systemData 567 } 568 case "properties": 569 if v != nil { 570 var cacheProperties CacheProperties 571 err = json.Unmarshal(*v, &cacheProperties) 572 if err != nil { 573 return err 574 } 575 c.CacheProperties = &cacheProperties 576 } 577 case "sku": 578 if v != nil { 579 var sku CacheSku 580 err = json.Unmarshal(*v, &sku) 581 if err != nil { 582 return err 583 } 584 c.Sku = &sku 585 } 586 } 587 } 588 589 return nil 590} 591 592// CacheActiveDirectorySettings active Directory settings used to join a cache to a domain. 593type CacheActiveDirectorySettings struct { 594 // PrimaryDNSIPAddress - Primary DNS IP address used to resolve the Active Directory domain controller's fully qualified domain name. 595 PrimaryDNSIPAddress *string `json:"primaryDnsIpAddress,omitempty"` 596 // SecondaryDNSIPAddress - Secondary DNS IP address used to resolve the Active Directory domain controller's fully qualified domain name. 597 SecondaryDNSIPAddress *string `json:"secondaryDnsIpAddress,omitempty"` 598 // DomainName - The fully qualified domain name of the Active Directory domain controller. 599 DomainName *string `json:"domainName,omitempty"` 600 // DomainNetBiosName - The Active Directory domain's NetBIOS name. 601 DomainNetBiosName *string `json:"domainNetBiosName,omitempty"` 602 // CacheNetBiosName - The NetBIOS name to assign to the HPC Cache when it joins the Active Directory domain as a server. Length must 1-15 characters from the class [-0-9a-zA-Z]. 603 CacheNetBiosName *string `json:"cacheNetBiosName,omitempty"` 604 // DomainJoined - READ-ONLY; True if the HPC Cache is joined to the Active Directory domain. Possible values include: 'Yes', 'No', 'Error' 605 DomainJoined DomainJoinedType `json:"domainJoined,omitempty"` 606 // Credentials - Active Directory admin credentials used to join the HPC Cache to a domain. 607 Credentials *CacheActiveDirectorySettingsCredentials `json:"credentials,omitempty"` 608} 609 610// MarshalJSON is the custom marshaler for CacheActiveDirectorySettings. 611func (cads CacheActiveDirectorySettings) MarshalJSON() ([]byte, error) { 612 objectMap := make(map[string]interface{}) 613 if cads.PrimaryDNSIPAddress != nil { 614 objectMap["primaryDnsIpAddress"] = cads.PrimaryDNSIPAddress 615 } 616 if cads.SecondaryDNSIPAddress != nil { 617 objectMap["secondaryDnsIpAddress"] = cads.SecondaryDNSIPAddress 618 } 619 if cads.DomainName != nil { 620 objectMap["domainName"] = cads.DomainName 621 } 622 if cads.DomainNetBiosName != nil { 623 objectMap["domainNetBiosName"] = cads.DomainNetBiosName 624 } 625 if cads.CacheNetBiosName != nil { 626 objectMap["cacheNetBiosName"] = cads.CacheNetBiosName 627 } 628 if cads.Credentials != nil { 629 objectMap["credentials"] = cads.Credentials 630 } 631 return json.Marshal(objectMap) 632} 633 634// CacheActiveDirectorySettingsCredentials active Directory admin credentials used to join the HPC Cache to 635// a domain. 636type CacheActiveDirectorySettingsCredentials struct { 637 // Username - Username of the Active Directory domain administrator. This value is stored encrypted and not returned on response. 638 Username *string `json:"username,omitempty"` 639 // Password - Plain text password of the Active Directory domain administrator. This value is stored encrypted and not returned on response. 640 Password *string `json:"password,omitempty"` 641} 642 643// CacheDirectorySettings cache Directory Services settings. 644type CacheDirectorySettings struct { 645 // ActiveDirectory - Specifies settings for joining the HPC Cache to an Active Directory domain. 646 ActiveDirectory *CacheActiveDirectorySettings `json:"activeDirectory,omitempty"` 647 // UsernameDownload - Specifies settings for Extended Groups. Extended Groups allows users to be members of more than 16 groups. 648 UsernameDownload *CacheUsernameDownloadSettings `json:"usernameDownload,omitempty"` 649} 650 651// CacheEncryptionSettings cache encryption settings. 652type CacheEncryptionSettings struct { 653 // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. 654 KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` 655} 656 657// CacheHealth an indication of Cache health. Gives more information about health than just that related to 658// provisioning. 659type CacheHealth struct { 660 // State - List of Cache health states. Possible values include: 'Unknown', 'Healthy', 'Degraded', 'Down', 'Transitioning', 'Stopping', 'Stopped', 'Upgrading', 'Flushing' 661 State HealthStateType `json:"state,omitempty"` 662 // StatusDescription - Describes explanation of state. 663 StatusDescription *string `json:"statusDescription,omitempty"` 664 // Conditions - READ-ONLY; Outstanding conditions that need to be investigated and resolved. 665 Conditions *[]Condition `json:"conditions,omitempty"` 666} 667 668// MarshalJSON is the custom marshaler for CacheHealth. 669func (ch CacheHealth) MarshalJSON() ([]byte, error) { 670 objectMap := make(map[string]interface{}) 671 if ch.State != "" { 672 objectMap["state"] = ch.State 673 } 674 if ch.StatusDescription != nil { 675 objectMap["statusDescription"] = ch.StatusDescription 676 } 677 return json.Marshal(objectMap) 678} 679 680// CacheIdentity cache identity properties. 681type CacheIdentity struct { 682 // PrincipalID - READ-ONLY; The principal id of the cache. 683 PrincipalID *string `json:"principalId,omitempty"` 684 // TenantID - READ-ONLY; The tenant id associated with the cache. 685 TenantID *string `json:"tenantId,omitempty"` 686 // Type - The type of identity used for the cache. Possible values include: 'SystemAssigned', 'None' 687 Type CacheIdentityType `json:"type,omitempty"` 688} 689 690// MarshalJSON is the custom marshaler for CacheIdentity. 691func (ci CacheIdentity) MarshalJSON() ([]byte, error) { 692 objectMap := make(map[string]interface{}) 693 if ci.Type != "" { 694 objectMap["type"] = ci.Type 695 } 696 return json.Marshal(objectMap) 697} 698 699// CacheNetworkSettings cache network settings. 700type CacheNetworkSettings struct { 701 // Mtu - The IPv4 maximum transmission unit configured for the subnet. 702 Mtu *int32 `json:"mtu,omitempty"` 703 // UtilityAddresses - READ-ONLY; Array of additional IP addresses used by this Cache. 704 UtilityAddresses *[]string `json:"utilityAddresses,omitempty"` 705 // DNSServers - DNS servers for the cache to use. It will be set from the network configuration if no value is provided. 706 DNSServers *[]string `json:"dnsServers,omitempty"` 707 // DNSSearchDomain - DNS search domain 708 DNSSearchDomain *string `json:"dnsSearchDomain,omitempty"` 709 // NtpServer - NTP server IP Address or FQDN for the cache to use. The default is time.windows.com. 710 NtpServer *string `json:"ntpServer,omitempty"` 711} 712 713// MarshalJSON is the custom marshaler for CacheNetworkSettings. 714func (cns CacheNetworkSettings) MarshalJSON() ([]byte, error) { 715 objectMap := make(map[string]interface{}) 716 if cns.Mtu != nil { 717 objectMap["mtu"] = cns.Mtu 718 } 719 if cns.DNSServers != nil { 720 objectMap["dnsServers"] = cns.DNSServers 721 } 722 if cns.DNSSearchDomain != nil { 723 objectMap["dnsSearchDomain"] = cns.DNSSearchDomain 724 } 725 if cns.NtpServer != nil { 726 objectMap["ntpServer"] = cns.NtpServer 727 } 728 return json.Marshal(objectMap) 729} 730 731// CacheProperties properties of the Cache. 732type CacheProperties struct { 733 // CacheSizeGB - The size of this Cache, in GB. 734 CacheSizeGB *int32 `json:"cacheSizeGB,omitempty"` 735 // Health - READ-ONLY; Health of the Cache. 736 Health *CacheHealth `json:"health,omitempty"` 737 // MountAddresses - READ-ONLY; Array of IP addresses that can be used by clients mounting this Cache. 738 MountAddresses *[]string `json:"mountAddresses,omitempty"` 739 // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' 740 ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` 741 // Subnet - Subnet used for the Cache. 742 Subnet *string `json:"subnet,omitempty"` 743 // UpgradeStatus - Upgrade status of the Cache. 744 UpgradeStatus *CacheUpgradeStatus `json:"upgradeStatus,omitempty"` 745 // NetworkSettings - Specifies network settings of the cache. 746 NetworkSettings *CacheNetworkSettings `json:"networkSettings,omitempty"` 747 // EncryptionSettings - Specifies encryption settings of the cache. 748 EncryptionSettings *CacheEncryptionSettings `json:"encryptionSettings,omitempty"` 749 // SecuritySettings - Specifies security settings of the cache. 750 SecuritySettings *CacheSecuritySettings `json:"securitySettings,omitempty"` 751 // DirectoryServicesSettings - Specifies Directory Services settings of the cache. 752 DirectoryServicesSettings *CacheDirectorySettings `json:"directoryServicesSettings,omitempty"` 753} 754 755// MarshalJSON is the custom marshaler for CacheProperties. 756func (c CacheProperties) MarshalJSON() ([]byte, error) { 757 objectMap := make(map[string]interface{}) 758 if c.CacheSizeGB != nil { 759 objectMap["cacheSizeGB"] = c.CacheSizeGB 760 } 761 if c.ProvisioningState != "" { 762 objectMap["provisioningState"] = c.ProvisioningState 763 } 764 if c.Subnet != nil { 765 objectMap["subnet"] = c.Subnet 766 } 767 if c.UpgradeStatus != nil { 768 objectMap["upgradeStatus"] = c.UpgradeStatus 769 } 770 if c.NetworkSettings != nil { 771 objectMap["networkSettings"] = c.NetworkSettings 772 } 773 if c.EncryptionSettings != nil { 774 objectMap["encryptionSettings"] = c.EncryptionSettings 775 } 776 if c.SecuritySettings != nil { 777 objectMap["securitySettings"] = c.SecuritySettings 778 } 779 if c.DirectoryServicesSettings != nil { 780 objectMap["directoryServicesSettings"] = c.DirectoryServicesSettings 781 } 782 return json.Marshal(objectMap) 783} 784 785// CachesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 786// operation. 787type CachesCreateOrUpdateFuture struct { 788 azure.FutureAPI 789 // Result returns the result of the asynchronous operation. 790 // If the operation has not completed it will return an error. 791 Result func(CachesClient) (Cache, error) 792} 793 794// UnmarshalJSON is the custom unmarshaller for CreateFuture. 795func (future *CachesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 796 var azFuture azure.Future 797 if err := json.Unmarshal(body, &azFuture); err != nil { 798 return err 799 } 800 future.FutureAPI = &azFuture 801 future.Result = future.result 802 return nil 803} 804 805// result is the default implementation for CachesCreateOrUpdateFuture.Result. 806func (future *CachesCreateOrUpdateFuture) result(client CachesClient) (c Cache, err error) { 807 var done bool 808 done, err = future.DoneWithContext(context.Background(), client) 809 if err != nil { 810 err = autorest.NewErrorWithError(err, "storagecache.CachesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 811 return 812 } 813 if !done { 814 c.Response.Response = future.Response() 815 err = azure.NewAsyncOpIncompleteError("storagecache.CachesCreateOrUpdateFuture") 816 return 817 } 818 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 819 if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { 820 c, err = client.CreateOrUpdateResponder(c.Response.Response) 821 if err != nil { 822 err = autorest.NewErrorWithError(err, "storagecache.CachesCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") 823 } 824 } 825 return 826} 827 828// CachesDebugInfoFuture an abstraction for monitoring and retrieving the results of a long-running 829// operation. 830type CachesDebugInfoFuture struct { 831 azure.FutureAPI 832 // Result returns the result of the asynchronous operation. 833 // If the operation has not completed it will return an error. 834 Result func(CachesClient) (autorest.Response, error) 835} 836 837// UnmarshalJSON is the custom unmarshaller for CreateFuture. 838func (future *CachesDebugInfoFuture) UnmarshalJSON(body []byte) error { 839 var azFuture azure.Future 840 if err := json.Unmarshal(body, &azFuture); err != nil { 841 return err 842 } 843 future.FutureAPI = &azFuture 844 future.Result = future.result 845 return nil 846} 847 848// result is the default implementation for CachesDebugInfoFuture.Result. 849func (future *CachesDebugInfoFuture) result(client CachesClient) (ar autorest.Response, err error) { 850 var done bool 851 done, err = future.DoneWithContext(context.Background(), client) 852 if err != nil { 853 err = autorest.NewErrorWithError(err, "storagecache.CachesDebugInfoFuture", "Result", future.Response(), "Polling failure") 854 return 855 } 856 if !done { 857 ar.Response = future.Response() 858 err = azure.NewAsyncOpIncompleteError("storagecache.CachesDebugInfoFuture") 859 return 860 } 861 ar.Response = future.Response() 862 return 863} 864 865// CachesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 866type CachesDeleteFuture struct { 867 azure.FutureAPI 868 // Result returns the result of the asynchronous operation. 869 // If the operation has not completed it will return an error. 870 Result func(CachesClient) (autorest.Response, error) 871} 872 873// UnmarshalJSON is the custom unmarshaller for CreateFuture. 874func (future *CachesDeleteFuture) UnmarshalJSON(body []byte) error { 875 var azFuture azure.Future 876 if err := json.Unmarshal(body, &azFuture); err != nil { 877 return err 878 } 879 future.FutureAPI = &azFuture 880 future.Result = future.result 881 return nil 882} 883 884// result is the default implementation for CachesDeleteFuture.Result. 885func (future *CachesDeleteFuture) result(client CachesClient) (ar autorest.Response, err error) { 886 var done bool 887 done, err = future.DoneWithContext(context.Background(), client) 888 if err != nil { 889 err = autorest.NewErrorWithError(err, "storagecache.CachesDeleteFuture", "Result", future.Response(), "Polling failure") 890 return 891 } 892 if !done { 893 ar.Response = future.Response() 894 err = azure.NewAsyncOpIncompleteError("storagecache.CachesDeleteFuture") 895 return 896 } 897 ar.Response = future.Response() 898 return 899} 900 901// CacheSecuritySettings cache security settings. 902type CacheSecuritySettings struct { 903 // AccessPolicies - NFS access policies defined for this cache. 904 AccessPolicies *[]NfsAccessPolicy `json:"accessPolicies,omitempty"` 905} 906 907// CachesFlushFuture an abstraction for monitoring and retrieving the results of a long-running operation. 908type CachesFlushFuture struct { 909 azure.FutureAPI 910 // Result returns the result of the asynchronous operation. 911 // If the operation has not completed it will return an error. 912 Result func(CachesClient) (autorest.Response, error) 913} 914 915// UnmarshalJSON is the custom unmarshaller for CreateFuture. 916func (future *CachesFlushFuture) UnmarshalJSON(body []byte) error { 917 var azFuture azure.Future 918 if err := json.Unmarshal(body, &azFuture); err != nil { 919 return err 920 } 921 future.FutureAPI = &azFuture 922 future.Result = future.result 923 return nil 924} 925 926// result is the default implementation for CachesFlushFuture.Result. 927func (future *CachesFlushFuture) result(client CachesClient) (ar autorest.Response, err error) { 928 var done bool 929 done, err = future.DoneWithContext(context.Background(), client) 930 if err != nil { 931 err = autorest.NewErrorWithError(err, "storagecache.CachesFlushFuture", "Result", future.Response(), "Polling failure") 932 return 933 } 934 if !done { 935 ar.Response = future.Response() 936 err = azure.NewAsyncOpIncompleteError("storagecache.CachesFlushFuture") 937 return 938 } 939 ar.Response = future.Response() 940 return 941} 942 943// CacheSku SKU for the Cache. 944type CacheSku struct { 945 // Name - SKU name for this Cache. 946 Name *string `json:"name,omitempty"` 947} 948 949// CachesListResult result of the request to list Caches. It contains a list of Caches and a URL link to 950// get the next set of results. 951type CachesListResult struct { 952 autorest.Response `json:"-"` 953 // NextLink - URL to get the next set of Cache list results, if there are any. 954 NextLink *string `json:"nextLink,omitempty"` 955 // Value - List of Caches. 956 Value *[]Cache `json:"value,omitempty"` 957} 958 959// CachesListResultIterator provides access to a complete listing of Cache values. 960type CachesListResultIterator struct { 961 i int 962 page CachesListResultPage 963} 964 965// NextWithContext advances to the next value. If there was an error making 966// the request the iterator does not advance and the error is returned. 967func (iter *CachesListResultIterator) NextWithContext(ctx context.Context) (err error) { 968 if tracing.IsEnabled() { 969 ctx = tracing.StartSpan(ctx, fqdn+"/CachesListResultIterator.NextWithContext") 970 defer func() { 971 sc := -1 972 if iter.Response().Response.Response != nil { 973 sc = iter.Response().Response.Response.StatusCode 974 } 975 tracing.EndSpan(ctx, sc, err) 976 }() 977 } 978 iter.i++ 979 if iter.i < len(iter.page.Values()) { 980 return nil 981 } 982 err = iter.page.NextWithContext(ctx) 983 if err != nil { 984 iter.i-- 985 return err 986 } 987 iter.i = 0 988 return nil 989} 990 991// Next advances to the next value. If there was an error making 992// the request the iterator does not advance and the error is returned. 993// Deprecated: Use NextWithContext() instead. 994func (iter *CachesListResultIterator) Next() error { 995 return iter.NextWithContext(context.Background()) 996} 997 998// NotDone returns true if the enumeration should be started or is not yet complete. 999func (iter CachesListResultIterator) NotDone() bool { 1000 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1001} 1002 1003// Response returns the raw server response from the last page request. 1004func (iter CachesListResultIterator) Response() CachesListResult { 1005 return iter.page.Response() 1006} 1007 1008// Value returns the current value or a zero-initialized value if the 1009// iterator has advanced beyond the end of the collection. 1010func (iter CachesListResultIterator) Value() Cache { 1011 if !iter.page.NotDone() { 1012 return Cache{} 1013 } 1014 return iter.page.Values()[iter.i] 1015} 1016 1017// Creates a new instance of the CachesListResultIterator type. 1018func NewCachesListResultIterator(page CachesListResultPage) CachesListResultIterator { 1019 return CachesListResultIterator{page: page} 1020} 1021 1022// IsEmpty returns true if the ListResult contains no values. 1023func (clr CachesListResult) IsEmpty() bool { 1024 return clr.Value == nil || len(*clr.Value) == 0 1025} 1026 1027// hasNextLink returns true if the NextLink is not empty. 1028func (clr CachesListResult) hasNextLink() bool { 1029 return clr.NextLink != nil && len(*clr.NextLink) != 0 1030} 1031 1032// cachesListResultPreparer prepares a request to retrieve the next set of results. 1033// It returns nil if no more results exist. 1034func (clr CachesListResult) cachesListResultPreparer(ctx context.Context) (*http.Request, error) { 1035 if !clr.hasNextLink() { 1036 return nil, nil 1037 } 1038 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1039 autorest.AsJSON(), 1040 autorest.AsGet(), 1041 autorest.WithBaseURL(to.String(clr.NextLink))) 1042} 1043 1044// CachesListResultPage contains a page of Cache values. 1045type CachesListResultPage struct { 1046 fn func(context.Context, CachesListResult) (CachesListResult, error) 1047 clr CachesListResult 1048} 1049 1050// NextWithContext advances to the next page of values. If there was an error making 1051// the request the page does not advance and the error is returned. 1052func (page *CachesListResultPage) NextWithContext(ctx context.Context) (err error) { 1053 if tracing.IsEnabled() { 1054 ctx = tracing.StartSpan(ctx, fqdn+"/CachesListResultPage.NextWithContext") 1055 defer func() { 1056 sc := -1 1057 if page.Response().Response.Response != nil { 1058 sc = page.Response().Response.Response.StatusCode 1059 } 1060 tracing.EndSpan(ctx, sc, err) 1061 }() 1062 } 1063 for { 1064 next, err := page.fn(ctx, page.clr) 1065 if err != nil { 1066 return err 1067 } 1068 page.clr = next 1069 if !next.hasNextLink() || !next.IsEmpty() { 1070 break 1071 } 1072 } 1073 return nil 1074} 1075 1076// Next advances to the next page of values. If there was an error making 1077// the request the page does not advance and the error is returned. 1078// Deprecated: Use NextWithContext() instead. 1079func (page *CachesListResultPage) Next() error { 1080 return page.NextWithContext(context.Background()) 1081} 1082 1083// NotDone returns true if the page enumeration should be started or is not yet complete. 1084func (page CachesListResultPage) NotDone() bool { 1085 return !page.clr.IsEmpty() 1086} 1087 1088// Response returns the raw server response from the last page request. 1089func (page CachesListResultPage) Response() CachesListResult { 1090 return page.clr 1091} 1092 1093// Values returns the slice of values for the current page or nil if there are no values. 1094func (page CachesListResultPage) Values() []Cache { 1095 if page.clr.IsEmpty() { 1096 return nil 1097 } 1098 return *page.clr.Value 1099} 1100 1101// Creates a new instance of the CachesListResultPage type. 1102func NewCachesListResultPage(cur CachesListResult, getNextPage func(context.Context, CachesListResult) (CachesListResult, error)) CachesListResultPage { 1103 return CachesListResultPage{ 1104 fn: getNextPage, 1105 clr: cur, 1106 } 1107} 1108 1109// CachesStartFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1110type CachesStartFuture struct { 1111 azure.FutureAPI 1112 // Result returns the result of the asynchronous operation. 1113 // If the operation has not completed it will return an error. 1114 Result func(CachesClient) (autorest.Response, error) 1115} 1116 1117// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1118func (future *CachesStartFuture) UnmarshalJSON(body []byte) error { 1119 var azFuture azure.Future 1120 if err := json.Unmarshal(body, &azFuture); err != nil { 1121 return err 1122 } 1123 future.FutureAPI = &azFuture 1124 future.Result = future.result 1125 return nil 1126} 1127 1128// result is the default implementation for CachesStartFuture.Result. 1129func (future *CachesStartFuture) result(client CachesClient) (ar autorest.Response, err error) { 1130 var done bool 1131 done, err = future.DoneWithContext(context.Background(), client) 1132 if err != nil { 1133 err = autorest.NewErrorWithError(err, "storagecache.CachesStartFuture", "Result", future.Response(), "Polling failure") 1134 return 1135 } 1136 if !done { 1137 ar.Response = future.Response() 1138 err = azure.NewAsyncOpIncompleteError("storagecache.CachesStartFuture") 1139 return 1140 } 1141 ar.Response = future.Response() 1142 return 1143} 1144 1145// CachesStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1146type CachesStopFuture struct { 1147 azure.FutureAPI 1148 // Result returns the result of the asynchronous operation. 1149 // If the operation has not completed it will return an error. 1150 Result func(CachesClient) (autorest.Response, error) 1151} 1152 1153// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1154func (future *CachesStopFuture) UnmarshalJSON(body []byte) error { 1155 var azFuture azure.Future 1156 if err := json.Unmarshal(body, &azFuture); err != nil { 1157 return err 1158 } 1159 future.FutureAPI = &azFuture 1160 future.Result = future.result 1161 return nil 1162} 1163 1164// result is the default implementation for CachesStopFuture.Result. 1165func (future *CachesStopFuture) result(client CachesClient) (ar autorest.Response, err error) { 1166 var done bool 1167 done, err = future.DoneWithContext(context.Background(), client) 1168 if err != nil { 1169 err = autorest.NewErrorWithError(err, "storagecache.CachesStopFuture", "Result", future.Response(), "Polling failure") 1170 return 1171 } 1172 if !done { 1173 ar.Response = future.Response() 1174 err = azure.NewAsyncOpIncompleteError("storagecache.CachesStopFuture") 1175 return 1176 } 1177 ar.Response = future.Response() 1178 return 1179} 1180 1181// CachesUpgradeFirmwareFuture an abstraction for monitoring and retrieving the results of a long-running 1182// operation. 1183type CachesUpgradeFirmwareFuture struct { 1184 azure.FutureAPI 1185 // Result returns the result of the asynchronous operation. 1186 // If the operation has not completed it will return an error. 1187 Result func(CachesClient) (autorest.Response, error) 1188} 1189 1190// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1191func (future *CachesUpgradeFirmwareFuture) UnmarshalJSON(body []byte) error { 1192 var azFuture azure.Future 1193 if err := json.Unmarshal(body, &azFuture); err != nil { 1194 return err 1195 } 1196 future.FutureAPI = &azFuture 1197 future.Result = future.result 1198 return nil 1199} 1200 1201// result is the default implementation for CachesUpgradeFirmwareFuture.Result. 1202func (future *CachesUpgradeFirmwareFuture) result(client CachesClient) (ar autorest.Response, err error) { 1203 var done bool 1204 done, err = future.DoneWithContext(context.Background(), client) 1205 if err != nil { 1206 err = autorest.NewErrorWithError(err, "storagecache.CachesUpgradeFirmwareFuture", "Result", future.Response(), "Polling failure") 1207 return 1208 } 1209 if !done { 1210 ar.Response = future.Response() 1211 err = azure.NewAsyncOpIncompleteError("storagecache.CachesUpgradeFirmwareFuture") 1212 return 1213 } 1214 ar.Response = future.Response() 1215 return 1216} 1217 1218// CacheUpgradeStatus properties describing the software upgrade state of the Cache. 1219type CacheUpgradeStatus struct { 1220 // CurrentFirmwareVersion - READ-ONLY; Version string of the firmware currently installed on this Cache. 1221 CurrentFirmwareVersion *string `json:"currentFirmwareVersion,omitempty"` 1222 // FirmwareUpdateStatus - READ-ONLY; True if there is a firmware update ready to install on this Cache. The firmware will automatically be installed after firmwareUpdateDeadline if not triggered earlier via the upgrade operation. Possible values include: 'Available', 'Unavailable' 1223 FirmwareUpdateStatus FirmwareStatusType `json:"firmwareUpdateStatus,omitempty"` 1224 // FirmwareUpdateDeadline - READ-ONLY; Time at which the pending firmware update will automatically be installed on the Cache. 1225 FirmwareUpdateDeadline *date.Time `json:"firmwareUpdateDeadline,omitempty"` 1226 // LastFirmwareUpdate - READ-ONLY; Time of the last successful firmware update. 1227 LastFirmwareUpdate *date.Time `json:"lastFirmwareUpdate,omitempty"` 1228 // PendingFirmwareVersion - READ-ONLY; When firmwareUpdateAvailable is true, this field holds the version string for the update. 1229 PendingFirmwareVersion *string `json:"pendingFirmwareVersion,omitempty"` 1230} 1231 1232// MarshalJSON is the custom marshaler for CacheUpgradeStatus. 1233func (cus CacheUpgradeStatus) MarshalJSON() ([]byte, error) { 1234 objectMap := make(map[string]interface{}) 1235 return json.Marshal(objectMap) 1236} 1237 1238// CacheUsernameDownloadSettings settings for Extended Groups username and group download. 1239type CacheUsernameDownloadSettings struct { 1240 // ExtendedGroups - Whether or not Extended Groups is enabled. 1241 ExtendedGroups *bool `json:"extendedGroups,omitempty"` 1242 // UsernameSource - This setting determines how the cache gets username and group names for clients. Possible values include: 'UsernameSourceAD', 'UsernameSourceLDAP', 'UsernameSourceFile', 'UsernameSourceNone' 1243 UsernameSource UsernameSource `json:"usernameSource,omitempty"` 1244 // GroupFileURI - The URI of the file containing group information (in /etc/group file format). This field must be populated when 'usernameSource' is set to 'File'. 1245 GroupFileURI *string `json:"groupFileURI,omitempty"` 1246 // UserFileURI - The URI of the file containing user information (in /etc/passwd file format). This field must be populated when 'usernameSource' is set to 'File'. 1247 UserFileURI *string `json:"userFileURI,omitempty"` 1248 // LdapServer - The fully qualified domain name or IP address of the LDAP server to use. 1249 LdapServer *string `json:"ldapServer,omitempty"` 1250 // LdapBaseDN - The base distinguished name for the LDAP domain. 1251 LdapBaseDN *string `json:"ldapBaseDN,omitempty"` 1252 // EncryptLdapConnection - Whether or not the LDAP connection should be encrypted. 1253 EncryptLdapConnection *bool `json:"encryptLdapConnection,omitempty"` 1254 // RequireValidCertificate - Determines if the certificates must be validated by a certificate authority. When true, caCertificateURI must be provided. 1255 RequireValidCertificate *bool `json:"requireValidCertificate,omitempty"` 1256 // AutoDownloadCertificate - Determines if the certificate should be automatically downloaded. This applies to 'caCertificateURI' only if 'requireValidCertificate' is true. 1257 AutoDownloadCertificate *bool `json:"autoDownloadCertificate,omitempty"` 1258 // CaCertificateURI - The URI of the CA certificate to validate the LDAP secure connection. This field must be populated when 'requireValidCertificate' is set to true. 1259 CaCertificateURI *string `json:"caCertificateURI,omitempty"` 1260 // UsernameDownloaded - READ-ONLY; Indicates whether or not the HPC Cache has performed the username download successfully. Possible values include: 'UsernameDownloadedTypeYes', 'UsernameDownloadedTypeNo', 'UsernameDownloadedTypeError' 1261 UsernameDownloaded UsernameDownloadedType `json:"usernameDownloaded,omitempty"` 1262 // Credentials - When present, these are the credentials for the secure LDAP connection. 1263 Credentials *CacheUsernameDownloadSettingsCredentials `json:"credentials,omitempty"` 1264} 1265 1266// MarshalJSON is the custom marshaler for CacheUsernameDownloadSettings. 1267func (cuds CacheUsernameDownloadSettings) MarshalJSON() ([]byte, error) { 1268 objectMap := make(map[string]interface{}) 1269 if cuds.ExtendedGroups != nil { 1270 objectMap["extendedGroups"] = cuds.ExtendedGroups 1271 } 1272 if cuds.UsernameSource != "" { 1273 objectMap["usernameSource"] = cuds.UsernameSource 1274 } 1275 if cuds.GroupFileURI != nil { 1276 objectMap["groupFileURI"] = cuds.GroupFileURI 1277 } 1278 if cuds.UserFileURI != nil { 1279 objectMap["userFileURI"] = cuds.UserFileURI 1280 } 1281 if cuds.LdapServer != nil { 1282 objectMap["ldapServer"] = cuds.LdapServer 1283 } 1284 if cuds.LdapBaseDN != nil { 1285 objectMap["ldapBaseDN"] = cuds.LdapBaseDN 1286 } 1287 if cuds.EncryptLdapConnection != nil { 1288 objectMap["encryptLdapConnection"] = cuds.EncryptLdapConnection 1289 } 1290 if cuds.RequireValidCertificate != nil { 1291 objectMap["requireValidCertificate"] = cuds.RequireValidCertificate 1292 } 1293 if cuds.AutoDownloadCertificate != nil { 1294 objectMap["autoDownloadCertificate"] = cuds.AutoDownloadCertificate 1295 } 1296 if cuds.CaCertificateURI != nil { 1297 objectMap["caCertificateURI"] = cuds.CaCertificateURI 1298 } 1299 if cuds.Credentials != nil { 1300 objectMap["credentials"] = cuds.Credentials 1301 } 1302 return json.Marshal(objectMap) 1303} 1304 1305// CacheUsernameDownloadSettingsCredentials when present, these are the credentials for the secure LDAP 1306// connection. 1307type CacheUsernameDownloadSettingsCredentials struct { 1308 // BindDn - The Bind Distinguished Name identity to be used in the secure LDAP connection. This value is stored encrypted and not returned on response. 1309 BindDn *string `json:"bindDn,omitempty"` 1310 // BindPassword - The Bind password to be used in the secure LDAP connection. This value is stored encrypted and not returned on response. 1311 BindPassword *string `json:"bindPassword,omitempty"` 1312} 1313 1314// ClfsTarget properties pertaining to the ClfsTarget 1315type ClfsTarget struct { 1316 // Target - Resource ID of storage container. 1317 Target *string `json:"target,omitempty"` 1318} 1319 1320// CloudError an error response. 1321type CloudError struct { 1322 // Error - The body of the error. 1323 Error *CloudErrorBody `json:"error,omitempty"` 1324} 1325 1326// CloudErrorBody an error response. 1327type CloudErrorBody struct { 1328 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 1329 Code *string `json:"code,omitempty"` 1330 // Details - A list of additional details about the error. 1331 Details *[]CloudErrorBody `json:"details,omitempty"` 1332 // Message - A message describing the error, intended to be suitable for display in a user interface. 1333 Message *string `json:"message,omitempty"` 1334 // Target - The target of the particular error. For example, the name of the property in error. 1335 Target *string `json:"target,omitempty"` 1336} 1337 1338// Condition outstanding conditions that will need to be resolved. 1339type Condition struct { 1340 // Timestamp - READ-ONLY; The time when the condition was raised. 1341 Timestamp *date.Time `json:"timestamp,omitempty"` 1342 // Message - READ-ONLY; The issue requiring attention. 1343 Message *string `json:"message,omitempty"` 1344} 1345 1346// MarshalJSON is the custom marshaler for Condition. 1347func (c Condition) MarshalJSON() ([]byte, error) { 1348 objectMap := make(map[string]interface{}) 1349 return json.Marshal(objectMap) 1350} 1351 1352// ErrorResponse describes the format of Error response. 1353type ErrorResponse struct { 1354 // Code - Error code 1355 Code *string `json:"code,omitempty"` 1356 // Message - Error message indicating why the operation failed. 1357 Message *string `json:"message,omitempty"` 1358} 1359 1360// KeyVaultKeyReference describes a reference to Key Vault Key. 1361type KeyVaultKeyReference struct { 1362 // KeyURL - The URL referencing a key encryption key in Key Vault. 1363 KeyURL *string `json:"keyUrl,omitempty"` 1364 // SourceVault - Describes a resource Id to source Key Vault. 1365 SourceVault *KeyVaultKeyReferenceSourceVault `json:"sourceVault,omitempty"` 1366} 1367 1368// KeyVaultKeyReferenceSourceVault describes a resource Id to source Key Vault. 1369type KeyVaultKeyReferenceSourceVault struct { 1370 // ID - Resource Id. 1371 ID *string `json:"id,omitempty"` 1372} 1373 1374// MetricDimension specifications of the Dimension of metrics. 1375type MetricDimension struct { 1376 // Name - Name of the dimension 1377 Name *string `json:"name,omitempty"` 1378 // DisplayName - Localized friendly display name of the dimension 1379 DisplayName *string `json:"displayName,omitempty"` 1380 // InternalName - Internal name of the dimension. 1381 InternalName *string `json:"internalName,omitempty"` 1382 // ToBeExportedForShoebox - To be exported to shoe box. 1383 ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` 1384} 1385 1386// MetricSpecification details about operation related to metrics. 1387type MetricSpecification struct { 1388 // Name - The name of the metric. 1389 Name *string `json:"name,omitempty"` 1390 // DisplayName - Localized display name of the metric. 1391 DisplayName *string `json:"displayName,omitempty"` 1392 // DisplayDescription - The description of the metric. 1393 DisplayDescription *string `json:"displayDescription,omitempty"` 1394 // Unit - The unit that the metric is measured in. 1395 Unit *string `json:"unit,omitempty"` 1396 // AggregationType - The type of metric aggregation. 1397 AggregationType *string `json:"aggregationType,omitempty"` 1398 // SupportedAggregationTypes - Support metric aggregation type. 1399 SupportedAggregationTypes *[]MetricAggregationType `json:"supportedAggregationTypes,omitempty"` 1400 // MetricClass - Type of metrics. 1401 MetricClass *string `json:"metricClass,omitempty"` 1402 // Dimensions - Dimensions of the metric 1403 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 1404} 1405 1406// NamespaceJunction a namespace junction. 1407type NamespaceJunction struct { 1408 // NamespacePath - Namespace path on a Cache for a Storage Target. 1409 NamespacePath *string `json:"namespacePath,omitempty"` 1410 // TargetPath - Path in Storage Target to which namespacePath points. 1411 TargetPath *string `json:"targetPath,omitempty"` 1412 // NfsExport - NFS export where targetPath exists. 1413 NfsExport *string `json:"nfsExport,omitempty"` 1414 // NfsAccessPolicy - Name of the access policy applied to this junction. 1415 NfsAccessPolicy *string `json:"nfsAccessPolicy,omitempty"` 1416} 1417 1418// Nfs3Target properties pertaining to the Nfs3Target 1419type Nfs3Target struct { 1420 // Target - IP address or host name of an NFSv3 host (e.g., 10.0.44.44). 1421 Target *string `json:"target,omitempty"` 1422 // UsageModel - Identifies the StorageCache usage model to be used for this storage target. 1423 UsageModel *string `json:"usageModel,omitempty"` 1424} 1425 1426// NfsAccessPolicy a set of rules describing access policies applied to NFSv3 clients of the cache. 1427type NfsAccessPolicy struct { 1428 // Name - Name identifying this policy. Access Policy names are not case sensitive. 1429 Name *string `json:"name,omitempty"` 1430 // AccessRules - The set of rules describing client accesses allowed under this policy. 1431 AccessRules *[]NfsAccessRule `json:"accessRules,omitempty"` 1432} 1433 1434// NfsAccessRule rule to place restrictions on portions of the cache namespace being presented to clients. 1435type NfsAccessRule struct { 1436 // Scope - Scope for this rule. The scope and filter determine which clients match the rule. Possible values include: 'Default', 'Network', 'Host' 1437 Scope NfsAccessRuleScope `json:"scope,omitempty"` 1438 // Filter - Filter applied to the scope for this rule. The filter's format depends on its scope. 'default' scope matches all clients and has no filter value. 'network' scope takes a filter in CIDR format (for example, 10.99.1.0/24). 'host' takes an IP address or fully qualified domain name as filter. If a client does not match any filter rule and there is no default rule, access is denied. 1439 Filter *string `json:"filter,omitempty"` 1440 // Access - Access allowed by this rule. Possible values include: 'NfsAccessRuleAccessNo', 'NfsAccessRuleAccessRo', 'NfsAccessRuleAccessRw' 1441 Access NfsAccessRuleAccess `json:"access,omitempty"` 1442 // Suid - Allow SUID semantics. 1443 Suid *bool `json:"suid,omitempty"` 1444 // SubmountAccess - For the default policy, allow access to subdirectories under the root export. If this is set to no, clients can only mount the path '/'. If set to yes, clients can mount a deeper path, like '/a/b'. 1445 SubmountAccess *bool `json:"submountAccess,omitempty"` 1446 // RootSquash - Map root accesses to anonymousUID and anonymousGID. 1447 RootSquash *bool `json:"rootSquash,omitempty"` 1448 // AnonymousUID - UID value that replaces 0 when rootSquash is true. 65534 will be used if not provided. 1449 AnonymousUID *string `json:"anonymousUID,omitempty"` 1450 // AnonymousGID - GID value that replaces 0 when rootSquash is true. This will use the value of anonymousUID if not provided. 1451 AnonymousGID *string `json:"anonymousGID,omitempty"` 1452} 1453 1454// ResourceSku a resource SKU. 1455type ResourceSku struct { 1456 // ResourceType - READ-ONLY; The type of resource the SKU applies to. 1457 ResourceType *string `json:"resourceType,omitempty"` 1458 // Capabilities - A list of capabilities of this SKU, such as throughput or ops/sec. 1459 Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` 1460 // Locations - READ-ONLY; The set of locations where the SKU is available. This is the supported and registered Azure Geo Regions (e.g., West US, East US, Southeast Asia, etc.). 1461 Locations *[]string `json:"locations,omitempty"` 1462 // LocationInfo - The set of locations where the SKU is available. 1463 LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` 1464 // Name - The name of this SKU. 1465 Name *string `json:"name,omitempty"` 1466 // Restrictions - The restrictions preventing this SKU from being used. This is empty if there are no restrictions. 1467 Restrictions *[]Restriction `json:"restrictions,omitempty"` 1468} 1469 1470// MarshalJSON is the custom marshaler for ResourceSku. 1471func (rs ResourceSku) MarshalJSON() ([]byte, error) { 1472 objectMap := make(map[string]interface{}) 1473 if rs.Capabilities != nil { 1474 objectMap["capabilities"] = rs.Capabilities 1475 } 1476 if rs.LocationInfo != nil { 1477 objectMap["locationInfo"] = rs.LocationInfo 1478 } 1479 if rs.Name != nil { 1480 objectMap["name"] = rs.Name 1481 } 1482 if rs.Restrictions != nil { 1483 objectMap["restrictions"] = rs.Restrictions 1484 } 1485 return json.Marshal(objectMap) 1486} 1487 1488// ResourceSkuCapabilities a resource SKU capability. 1489type ResourceSkuCapabilities struct { 1490 // Name - Name of a capability, such as ops/sec. 1491 Name *string `json:"name,omitempty"` 1492 // Value - Quantity, if the capability is measured by quantity. 1493 Value *string `json:"value,omitempty"` 1494} 1495 1496// ResourceSkuLocationInfo resource SKU location information. 1497type ResourceSkuLocationInfo struct { 1498 // Location - Location where this SKU is available. 1499 Location *string `json:"location,omitempty"` 1500 // Zones - Zones if any. 1501 Zones *[]string `json:"zones,omitempty"` 1502} 1503 1504// ResourceSkusResult the response from the List Cache SKUs operation. 1505type ResourceSkusResult struct { 1506 autorest.Response `json:"-"` 1507 // NextLink - The URI to fetch the next page of Cache SKUs. 1508 NextLink *string `json:"nextLink,omitempty"` 1509 // Value - READ-ONLY; The list of SKUs available for the subscription. 1510 Value *[]ResourceSku `json:"value,omitempty"` 1511} 1512 1513// MarshalJSON is the custom marshaler for ResourceSkusResult. 1514func (rsr ResourceSkusResult) MarshalJSON() ([]byte, error) { 1515 objectMap := make(map[string]interface{}) 1516 if rsr.NextLink != nil { 1517 objectMap["nextLink"] = rsr.NextLink 1518 } 1519 return json.Marshal(objectMap) 1520} 1521 1522// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. 1523type ResourceSkusResultIterator struct { 1524 i int 1525 page ResourceSkusResultPage 1526} 1527 1528// NextWithContext advances to the next value. If there was an error making 1529// the request the iterator does not advance and the error is returned. 1530func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { 1531 if tracing.IsEnabled() { 1532 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") 1533 defer func() { 1534 sc := -1 1535 if iter.Response().Response.Response != nil { 1536 sc = iter.Response().Response.Response.StatusCode 1537 } 1538 tracing.EndSpan(ctx, sc, err) 1539 }() 1540 } 1541 iter.i++ 1542 if iter.i < len(iter.page.Values()) { 1543 return nil 1544 } 1545 err = iter.page.NextWithContext(ctx) 1546 if err != nil { 1547 iter.i-- 1548 return err 1549 } 1550 iter.i = 0 1551 return nil 1552} 1553 1554// Next advances to the next value. If there was an error making 1555// the request the iterator does not advance and the error is returned. 1556// Deprecated: Use NextWithContext() instead. 1557func (iter *ResourceSkusResultIterator) Next() error { 1558 return iter.NextWithContext(context.Background()) 1559} 1560 1561// NotDone returns true if the enumeration should be started or is not yet complete. 1562func (iter ResourceSkusResultIterator) NotDone() bool { 1563 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1564} 1565 1566// Response returns the raw server response from the last page request. 1567func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { 1568 return iter.page.Response() 1569} 1570 1571// Value returns the current value or a zero-initialized value if the 1572// iterator has advanced beyond the end of the collection. 1573func (iter ResourceSkusResultIterator) Value() ResourceSku { 1574 if !iter.page.NotDone() { 1575 return ResourceSku{} 1576 } 1577 return iter.page.Values()[iter.i] 1578} 1579 1580// Creates a new instance of the ResourceSkusResultIterator type. 1581func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { 1582 return ResourceSkusResultIterator{page: page} 1583} 1584 1585// IsEmpty returns true if the ListResult contains no values. 1586func (rsr ResourceSkusResult) IsEmpty() bool { 1587 return rsr.Value == nil || len(*rsr.Value) == 0 1588} 1589 1590// hasNextLink returns true if the NextLink is not empty. 1591func (rsr ResourceSkusResult) hasNextLink() bool { 1592 return rsr.NextLink != nil && len(*rsr.NextLink) != 0 1593} 1594 1595// resourceSkusResultPreparer prepares a request to retrieve the next set of results. 1596// It returns nil if no more results exist. 1597func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { 1598 if !rsr.hasNextLink() { 1599 return nil, nil 1600 } 1601 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1602 autorest.AsJSON(), 1603 autorest.AsGet(), 1604 autorest.WithBaseURL(to.String(rsr.NextLink))) 1605} 1606 1607// ResourceSkusResultPage contains a page of ResourceSku values. 1608type ResourceSkusResultPage struct { 1609 fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) 1610 rsr ResourceSkusResult 1611} 1612 1613// NextWithContext advances to the next page of values. If there was an error making 1614// the request the page does not advance and the error is returned. 1615func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { 1616 if tracing.IsEnabled() { 1617 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") 1618 defer func() { 1619 sc := -1 1620 if page.Response().Response.Response != nil { 1621 sc = page.Response().Response.Response.StatusCode 1622 } 1623 tracing.EndSpan(ctx, sc, err) 1624 }() 1625 } 1626 for { 1627 next, err := page.fn(ctx, page.rsr) 1628 if err != nil { 1629 return err 1630 } 1631 page.rsr = next 1632 if !next.hasNextLink() || !next.IsEmpty() { 1633 break 1634 } 1635 } 1636 return nil 1637} 1638 1639// Next advances to the next page of values. If there was an error making 1640// the request the page does not advance and the error is returned. 1641// Deprecated: Use NextWithContext() instead. 1642func (page *ResourceSkusResultPage) Next() error { 1643 return page.NextWithContext(context.Background()) 1644} 1645 1646// NotDone returns true if the page enumeration should be started or is not yet complete. 1647func (page ResourceSkusResultPage) NotDone() bool { 1648 return !page.rsr.IsEmpty() 1649} 1650 1651// Response returns the raw server response from the last page request. 1652func (page ResourceSkusResultPage) Response() ResourceSkusResult { 1653 return page.rsr 1654} 1655 1656// Values returns the slice of values for the current page or nil if there are no values. 1657func (page ResourceSkusResultPage) Values() []ResourceSku { 1658 if page.rsr.IsEmpty() { 1659 return nil 1660 } 1661 return *page.rsr.Value 1662} 1663 1664// Creates a new instance of the ResourceSkusResultPage type. 1665func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { 1666 return ResourceSkusResultPage{ 1667 fn: getNextPage, 1668 rsr: cur, 1669 } 1670} 1671 1672// Restriction the restrictions preventing this SKU from being used. 1673type Restriction struct { 1674 // Type - READ-ONLY; The type of restrictions. In this version, the only possible value for this is location. 1675 Type *string `json:"type,omitempty"` 1676 // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location, then this would be the different locations where the SKU is restricted. 1677 Values *[]string `json:"values,omitempty"` 1678 // ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". "QuotaId" is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. "NotAvailableForSubscription" is related to capacity at the datacenter. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 1679 ReasonCode ReasonCode `json:"reasonCode,omitempty"` 1680} 1681 1682// MarshalJSON is the custom marshaler for Restriction. 1683func (r Restriction) MarshalJSON() ([]byte, error) { 1684 objectMap := make(map[string]interface{}) 1685 if r.ReasonCode != "" { 1686 objectMap["reasonCode"] = r.ReasonCode 1687 } 1688 return json.Marshal(objectMap) 1689} 1690 1691// StorageTarget type of the Storage Target. 1692type StorageTarget struct { 1693 autorest.Response `json:"-"` 1694 // StorageTargetProperties - StorageTarget properties 1695 *StorageTargetProperties `json:"properties,omitempty"` 1696 // Name - READ-ONLY; Name of the Storage Target. 1697 Name *string `json:"name,omitempty"` 1698 // ID - READ-ONLY; Resource ID of the Storage Target. 1699 ID *string `json:"id,omitempty"` 1700 // Type - READ-ONLY; Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget 1701 Type *string `json:"type,omitempty"` 1702 // Location - READ-ONLY; Region name string. 1703 Location *string `json:"location,omitempty"` 1704 // SystemData - READ-ONLY; The system meta data relating to this resource. 1705 SystemData *SystemData `json:"systemData,omitempty"` 1706} 1707 1708// MarshalJSON is the custom marshaler for StorageTarget. 1709func (st StorageTarget) MarshalJSON() ([]byte, error) { 1710 objectMap := make(map[string]interface{}) 1711 if st.StorageTargetProperties != nil { 1712 objectMap["properties"] = st.StorageTargetProperties 1713 } 1714 return json.Marshal(objectMap) 1715} 1716 1717// UnmarshalJSON is the custom unmarshaler for StorageTarget struct. 1718func (st *StorageTarget) UnmarshalJSON(body []byte) error { 1719 var m map[string]*json.RawMessage 1720 err := json.Unmarshal(body, &m) 1721 if err != nil { 1722 return err 1723 } 1724 for k, v := range m { 1725 switch k { 1726 case "properties": 1727 if v != nil { 1728 var storageTargetProperties StorageTargetProperties 1729 err = json.Unmarshal(*v, &storageTargetProperties) 1730 if err != nil { 1731 return err 1732 } 1733 st.StorageTargetProperties = &storageTargetProperties 1734 } 1735 case "name": 1736 if v != nil { 1737 var name string 1738 err = json.Unmarshal(*v, &name) 1739 if err != nil { 1740 return err 1741 } 1742 st.Name = &name 1743 } 1744 case "id": 1745 if v != nil { 1746 var ID string 1747 err = json.Unmarshal(*v, &ID) 1748 if err != nil { 1749 return err 1750 } 1751 st.ID = &ID 1752 } 1753 case "type": 1754 if v != nil { 1755 var typeVar string 1756 err = json.Unmarshal(*v, &typeVar) 1757 if err != nil { 1758 return err 1759 } 1760 st.Type = &typeVar 1761 } 1762 case "location": 1763 if v != nil { 1764 var location string 1765 err = json.Unmarshal(*v, &location) 1766 if err != nil { 1767 return err 1768 } 1769 st.Location = &location 1770 } 1771 case "systemData": 1772 if v != nil { 1773 var systemData SystemData 1774 err = json.Unmarshal(*v, &systemData) 1775 if err != nil { 1776 return err 1777 } 1778 st.SystemData = &systemData 1779 } 1780 } 1781 } 1782 1783 return nil 1784} 1785 1786// StorageTargetProperties properties of the Storage Target. 1787type StorageTargetProperties struct { 1788 // Junctions - List of Cache namespace junctions to target for namespace associations. 1789 Junctions *[]NamespaceJunction `json:"junctions,omitempty"` 1790 // TargetType - Type of the Storage Target. Possible values include: 'StorageTargetTypeNfs3', 'StorageTargetTypeClfs', 'StorageTargetTypeUnknown', 'StorageTargetTypeBlobNfs' 1791 TargetType StorageTargetType `json:"targetType,omitempty"` 1792 // ProvisioningState - ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property. Possible values include: 'Succeeded', 'Failed', 'Cancelled', 'Creating', 'Deleting', 'Updating' 1793 ProvisioningState ProvisioningStateType `json:"provisioningState,omitempty"` 1794 // Nfs3 - Properties when targetType is nfs3. 1795 Nfs3 *Nfs3Target `json:"nfs3,omitempty"` 1796 // Clfs - Properties when targetType is clfs. 1797 Clfs *ClfsTarget `json:"clfs,omitempty"` 1798 // Unknown - Properties when targetType is unknown. 1799 Unknown *UnknownTarget `json:"unknown,omitempty"` 1800 // BlobNfs - Properties when targetType is blobNfs. 1801 BlobNfs *BlobNfsTarget `json:"blobNfs,omitempty"` 1802} 1803 1804// StorageTargetResource resource used by a Cache. 1805type StorageTargetResource struct { 1806 // Name - READ-ONLY; Name of the Storage Target. 1807 Name *string `json:"name,omitempty"` 1808 // ID - READ-ONLY; Resource ID of the Storage Target. 1809 ID *string `json:"id,omitempty"` 1810 // Type - READ-ONLY; Type of the Storage Target; Microsoft.StorageCache/Cache/StorageTarget 1811 Type *string `json:"type,omitempty"` 1812 // Location - READ-ONLY; Region name string. 1813 Location *string `json:"location,omitempty"` 1814 // SystemData - READ-ONLY; The system meta data relating to this resource. 1815 SystemData *SystemData `json:"systemData,omitempty"` 1816} 1817 1818// MarshalJSON is the custom marshaler for StorageTargetResource. 1819func (str StorageTargetResource) MarshalJSON() ([]byte, error) { 1820 objectMap := make(map[string]interface{}) 1821 return json.Marshal(objectMap) 1822} 1823 1824// StorageTargetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1825// long-running operation. 1826type StorageTargetsCreateOrUpdateFuture struct { 1827 azure.FutureAPI 1828 // Result returns the result of the asynchronous operation. 1829 // If the operation has not completed it will return an error. 1830 Result func(StorageTargetsClient) (StorageTarget, error) 1831} 1832 1833// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1834func (future *StorageTargetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1835 var azFuture azure.Future 1836 if err := json.Unmarshal(body, &azFuture); err != nil { 1837 return err 1838 } 1839 future.FutureAPI = &azFuture 1840 future.Result = future.result 1841 return nil 1842} 1843 1844// result is the default implementation for StorageTargetsCreateOrUpdateFuture.Result. 1845func (future *StorageTargetsCreateOrUpdateFuture) result(client StorageTargetsClient) (st StorageTarget, err error) { 1846 var done bool 1847 done, err = future.DoneWithContext(context.Background(), client) 1848 if err != nil { 1849 err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1850 return 1851 } 1852 if !done { 1853 st.Response.Response = future.Response() 1854 err = azure.NewAsyncOpIncompleteError("storagecache.StorageTargetsCreateOrUpdateFuture") 1855 return 1856 } 1857 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1858 if st.Response.Response, err = future.GetResult(sender); err == nil && st.Response.Response.StatusCode != http.StatusNoContent { 1859 st, err = client.CreateOrUpdateResponder(st.Response.Response) 1860 if err != nil { 1861 err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsCreateOrUpdateFuture", "Result", st.Response.Response, "Failure responding to request") 1862 } 1863 } 1864 return 1865} 1866 1867// StorageTargetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1868// operation. 1869type StorageTargetsDeleteFuture struct { 1870 azure.FutureAPI 1871 // Result returns the result of the asynchronous operation. 1872 // If the operation has not completed it will return an error. 1873 Result func(StorageTargetsClient) (autorest.Response, error) 1874} 1875 1876// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1877func (future *StorageTargetsDeleteFuture) UnmarshalJSON(body []byte) error { 1878 var azFuture azure.Future 1879 if err := json.Unmarshal(body, &azFuture); err != nil { 1880 return err 1881 } 1882 future.FutureAPI = &azFuture 1883 future.Result = future.result 1884 return nil 1885} 1886 1887// result is the default implementation for StorageTargetsDeleteFuture.Result. 1888func (future *StorageTargetsDeleteFuture) result(client StorageTargetsClient) (ar autorest.Response, err error) { 1889 var done bool 1890 done, err = future.DoneWithContext(context.Background(), client) 1891 if err != nil { 1892 err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsDeleteFuture", "Result", future.Response(), "Polling failure") 1893 return 1894 } 1895 if !done { 1896 ar.Response = future.Response() 1897 err = azure.NewAsyncOpIncompleteError("storagecache.StorageTargetsDeleteFuture") 1898 return 1899 } 1900 ar.Response = future.Response() 1901 return 1902} 1903 1904// StorageTargetsDNSRefreshFuture an abstraction for monitoring and retrieving the results of a 1905// long-running operation. 1906type StorageTargetsDNSRefreshFuture struct { 1907 azure.FutureAPI 1908 // Result returns the result of the asynchronous operation. 1909 // If the operation has not completed it will return an error. 1910 Result func(StorageTargetsClient) (autorest.Response, error) 1911} 1912 1913// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1914func (future *StorageTargetsDNSRefreshFuture) UnmarshalJSON(body []byte) error { 1915 var azFuture azure.Future 1916 if err := json.Unmarshal(body, &azFuture); err != nil { 1917 return err 1918 } 1919 future.FutureAPI = &azFuture 1920 future.Result = future.result 1921 return nil 1922} 1923 1924// result is the default implementation for StorageTargetsDNSRefreshFuture.Result. 1925func (future *StorageTargetsDNSRefreshFuture) result(client StorageTargetsClient) (ar autorest.Response, err error) { 1926 var done bool 1927 done, err = future.DoneWithContext(context.Background(), client) 1928 if err != nil { 1929 err = autorest.NewErrorWithError(err, "storagecache.StorageTargetsDNSRefreshFuture", "Result", future.Response(), "Polling failure") 1930 return 1931 } 1932 if !done { 1933 ar.Response = future.Response() 1934 err = azure.NewAsyncOpIncompleteError("storagecache.StorageTargetsDNSRefreshFuture") 1935 return 1936 } 1937 ar.Response = future.Response() 1938 return 1939} 1940 1941// StorageTargetsResult a list of Storage Targets. 1942type StorageTargetsResult struct { 1943 autorest.Response `json:"-"` 1944 // NextLink - The URI to fetch the next page of Storage Targets. 1945 NextLink *string `json:"nextLink,omitempty"` 1946 // Value - The list of Storage Targets defined for the Cache. 1947 Value *[]StorageTarget `json:"value,omitempty"` 1948} 1949 1950// StorageTargetsResultIterator provides access to a complete listing of StorageTarget values. 1951type StorageTargetsResultIterator struct { 1952 i int 1953 page StorageTargetsResultPage 1954} 1955 1956// NextWithContext advances to the next value. If there was an error making 1957// the request the iterator does not advance and the error is returned. 1958func (iter *StorageTargetsResultIterator) NextWithContext(ctx context.Context) (err error) { 1959 if tracing.IsEnabled() { 1960 ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsResultIterator.NextWithContext") 1961 defer func() { 1962 sc := -1 1963 if iter.Response().Response.Response != nil { 1964 sc = iter.Response().Response.Response.StatusCode 1965 } 1966 tracing.EndSpan(ctx, sc, err) 1967 }() 1968 } 1969 iter.i++ 1970 if iter.i < len(iter.page.Values()) { 1971 return nil 1972 } 1973 err = iter.page.NextWithContext(ctx) 1974 if err != nil { 1975 iter.i-- 1976 return err 1977 } 1978 iter.i = 0 1979 return nil 1980} 1981 1982// Next advances to the next value. If there was an error making 1983// the request the iterator does not advance and the error is returned. 1984// Deprecated: Use NextWithContext() instead. 1985func (iter *StorageTargetsResultIterator) Next() error { 1986 return iter.NextWithContext(context.Background()) 1987} 1988 1989// NotDone returns true if the enumeration should be started or is not yet complete. 1990func (iter StorageTargetsResultIterator) NotDone() bool { 1991 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1992} 1993 1994// Response returns the raw server response from the last page request. 1995func (iter StorageTargetsResultIterator) Response() StorageTargetsResult { 1996 return iter.page.Response() 1997} 1998 1999// Value returns the current value or a zero-initialized value if the 2000// iterator has advanced beyond the end of the collection. 2001func (iter StorageTargetsResultIterator) Value() StorageTarget { 2002 if !iter.page.NotDone() { 2003 return StorageTarget{} 2004 } 2005 return iter.page.Values()[iter.i] 2006} 2007 2008// Creates a new instance of the StorageTargetsResultIterator type. 2009func NewStorageTargetsResultIterator(page StorageTargetsResultPage) StorageTargetsResultIterator { 2010 return StorageTargetsResultIterator{page: page} 2011} 2012 2013// IsEmpty returns true if the ListResult contains no values. 2014func (str StorageTargetsResult) IsEmpty() bool { 2015 return str.Value == nil || len(*str.Value) == 0 2016} 2017 2018// hasNextLink returns true if the NextLink is not empty. 2019func (str StorageTargetsResult) hasNextLink() bool { 2020 return str.NextLink != nil && len(*str.NextLink) != 0 2021} 2022 2023// storageTargetsResultPreparer prepares a request to retrieve the next set of results. 2024// It returns nil if no more results exist. 2025func (str StorageTargetsResult) storageTargetsResultPreparer(ctx context.Context) (*http.Request, error) { 2026 if !str.hasNextLink() { 2027 return nil, nil 2028 } 2029 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2030 autorest.AsJSON(), 2031 autorest.AsGet(), 2032 autorest.WithBaseURL(to.String(str.NextLink))) 2033} 2034 2035// StorageTargetsResultPage contains a page of StorageTarget values. 2036type StorageTargetsResultPage struct { 2037 fn func(context.Context, StorageTargetsResult) (StorageTargetsResult, error) 2038 str StorageTargetsResult 2039} 2040 2041// NextWithContext advances to the next page of values. If there was an error making 2042// the request the page does not advance and the error is returned. 2043func (page *StorageTargetsResultPage) NextWithContext(ctx context.Context) (err error) { 2044 if tracing.IsEnabled() { 2045 ctx = tracing.StartSpan(ctx, fqdn+"/StorageTargetsResultPage.NextWithContext") 2046 defer func() { 2047 sc := -1 2048 if page.Response().Response.Response != nil { 2049 sc = page.Response().Response.Response.StatusCode 2050 } 2051 tracing.EndSpan(ctx, sc, err) 2052 }() 2053 } 2054 for { 2055 next, err := page.fn(ctx, page.str) 2056 if err != nil { 2057 return err 2058 } 2059 page.str = next 2060 if !next.hasNextLink() || !next.IsEmpty() { 2061 break 2062 } 2063 } 2064 return nil 2065} 2066 2067// Next advances to the next page of values. If there was an error making 2068// the request the page does not advance and the error is returned. 2069// Deprecated: Use NextWithContext() instead. 2070func (page *StorageTargetsResultPage) Next() error { 2071 return page.NextWithContext(context.Background()) 2072} 2073 2074// NotDone returns true if the page enumeration should be started or is not yet complete. 2075func (page StorageTargetsResultPage) NotDone() bool { 2076 return !page.str.IsEmpty() 2077} 2078 2079// Response returns the raw server response from the last page request. 2080func (page StorageTargetsResultPage) Response() StorageTargetsResult { 2081 return page.str 2082} 2083 2084// Values returns the slice of values for the current page or nil if there are no values. 2085func (page StorageTargetsResultPage) Values() []StorageTarget { 2086 if page.str.IsEmpty() { 2087 return nil 2088 } 2089 return *page.str.Value 2090} 2091 2092// Creates a new instance of the StorageTargetsResultPage type. 2093func NewStorageTargetsResultPage(cur StorageTargetsResult, getNextPage func(context.Context, StorageTargetsResult) (StorageTargetsResult, error)) StorageTargetsResultPage { 2094 return StorageTargetsResultPage{ 2095 fn: getNextPage, 2096 str: cur, 2097 } 2098} 2099 2100// SystemData metadata pertaining to creation and last modification of the resource. 2101type SystemData struct { 2102 // CreatedBy - The identity that created the resource. 2103 CreatedBy *string `json:"createdBy,omitempty"` 2104 // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' 2105 CreatedByType CreatedByType `json:"createdByType,omitempty"` 2106 // CreatedAt - The timestamp of resource creation (UTC). 2107 CreatedAt *date.Time `json:"createdAt,omitempty"` 2108 // LastModifiedBy - The identity that last modified the resource. 2109 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 2110 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' 2111 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 2112 // LastModifiedAt - The timestamp of resource last modification (UTC) 2113 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 2114} 2115 2116// UnknownTarget properties pertaining to the UnknownTarget 2117type UnknownTarget struct { 2118 // Attributes - Dictionary of string->string pairs containing information about the Storage Target. 2119 Attributes map[string]*string `json:"attributes"` 2120} 2121 2122// MarshalJSON is the custom marshaler for UnknownTarget. 2123func (ut UnknownTarget) MarshalJSON() ([]byte, error) { 2124 objectMap := make(map[string]interface{}) 2125 if ut.Attributes != nil { 2126 objectMap["attributes"] = ut.Attributes 2127 } 2128 return json.Marshal(objectMap) 2129} 2130 2131// UsageModel a usage model. 2132type UsageModel struct { 2133 // Display - Localized information describing this usage model. 2134 Display *UsageModelDisplay `json:"display,omitempty"` 2135 // ModelName - Non-localized keyword name for this usage model. 2136 ModelName *string `json:"modelName,omitempty"` 2137 // TargetType - The type of Storage Target to which this model is applicable (only nfs3 as of this version). 2138 TargetType *string `json:"targetType,omitempty"` 2139} 2140 2141// UsageModelDisplay localized information describing this usage model. 2142type UsageModelDisplay struct { 2143 // Description - String to display for this usage model. 2144 Description *string `json:"description,omitempty"` 2145} 2146 2147// UsageModelsResult a list of Cache usage models. 2148type UsageModelsResult struct { 2149 autorest.Response `json:"-"` 2150 // NextLink - The URI to fetch the next page of Cache usage models. 2151 NextLink *string `json:"nextLink,omitempty"` 2152 // Value - The list of usage models available for the subscription. 2153 Value *[]UsageModel `json:"value,omitempty"` 2154} 2155 2156// UsageModelsResultIterator provides access to a complete listing of UsageModel values. 2157type UsageModelsResultIterator struct { 2158 i int 2159 page UsageModelsResultPage 2160} 2161 2162// NextWithContext advances to the next value. If there was an error making 2163// the request the iterator does not advance and the error is returned. 2164func (iter *UsageModelsResultIterator) NextWithContext(ctx context.Context) (err error) { 2165 if tracing.IsEnabled() { 2166 ctx = tracing.StartSpan(ctx, fqdn+"/UsageModelsResultIterator.NextWithContext") 2167 defer func() { 2168 sc := -1 2169 if iter.Response().Response.Response != nil { 2170 sc = iter.Response().Response.Response.StatusCode 2171 } 2172 tracing.EndSpan(ctx, sc, err) 2173 }() 2174 } 2175 iter.i++ 2176 if iter.i < len(iter.page.Values()) { 2177 return nil 2178 } 2179 err = iter.page.NextWithContext(ctx) 2180 if err != nil { 2181 iter.i-- 2182 return err 2183 } 2184 iter.i = 0 2185 return nil 2186} 2187 2188// Next advances to the next value. If there was an error making 2189// the request the iterator does not advance and the error is returned. 2190// Deprecated: Use NextWithContext() instead. 2191func (iter *UsageModelsResultIterator) Next() error { 2192 return iter.NextWithContext(context.Background()) 2193} 2194 2195// NotDone returns true if the enumeration should be started or is not yet complete. 2196func (iter UsageModelsResultIterator) NotDone() bool { 2197 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2198} 2199 2200// Response returns the raw server response from the last page request. 2201func (iter UsageModelsResultIterator) Response() UsageModelsResult { 2202 return iter.page.Response() 2203} 2204 2205// Value returns the current value or a zero-initialized value if the 2206// iterator has advanced beyond the end of the collection. 2207func (iter UsageModelsResultIterator) Value() UsageModel { 2208 if !iter.page.NotDone() { 2209 return UsageModel{} 2210 } 2211 return iter.page.Values()[iter.i] 2212} 2213 2214// Creates a new instance of the UsageModelsResultIterator type. 2215func NewUsageModelsResultIterator(page UsageModelsResultPage) UsageModelsResultIterator { 2216 return UsageModelsResultIterator{page: page} 2217} 2218 2219// IsEmpty returns true if the ListResult contains no values. 2220func (umr UsageModelsResult) IsEmpty() bool { 2221 return umr.Value == nil || len(*umr.Value) == 0 2222} 2223 2224// hasNextLink returns true if the NextLink is not empty. 2225func (umr UsageModelsResult) hasNextLink() bool { 2226 return umr.NextLink != nil && len(*umr.NextLink) != 0 2227} 2228 2229// usageModelsResultPreparer prepares a request to retrieve the next set of results. 2230// It returns nil if no more results exist. 2231func (umr UsageModelsResult) usageModelsResultPreparer(ctx context.Context) (*http.Request, error) { 2232 if !umr.hasNextLink() { 2233 return nil, nil 2234 } 2235 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2236 autorest.AsJSON(), 2237 autorest.AsGet(), 2238 autorest.WithBaseURL(to.String(umr.NextLink))) 2239} 2240 2241// UsageModelsResultPage contains a page of UsageModel values. 2242type UsageModelsResultPage struct { 2243 fn func(context.Context, UsageModelsResult) (UsageModelsResult, error) 2244 umr UsageModelsResult 2245} 2246 2247// NextWithContext advances to the next page of values. If there was an error making 2248// the request the page does not advance and the error is returned. 2249func (page *UsageModelsResultPage) NextWithContext(ctx context.Context) (err error) { 2250 if tracing.IsEnabled() { 2251 ctx = tracing.StartSpan(ctx, fqdn+"/UsageModelsResultPage.NextWithContext") 2252 defer func() { 2253 sc := -1 2254 if page.Response().Response.Response != nil { 2255 sc = page.Response().Response.Response.StatusCode 2256 } 2257 tracing.EndSpan(ctx, sc, err) 2258 }() 2259 } 2260 for { 2261 next, err := page.fn(ctx, page.umr) 2262 if err != nil { 2263 return err 2264 } 2265 page.umr = next 2266 if !next.hasNextLink() || !next.IsEmpty() { 2267 break 2268 } 2269 } 2270 return nil 2271} 2272 2273// Next advances to the next page of values. If there was an error making 2274// the request the page does not advance and the error is returned. 2275// Deprecated: Use NextWithContext() instead. 2276func (page *UsageModelsResultPage) Next() error { 2277 return page.NextWithContext(context.Background()) 2278} 2279 2280// NotDone returns true if the page enumeration should be started or is not yet complete. 2281func (page UsageModelsResultPage) NotDone() bool { 2282 return !page.umr.IsEmpty() 2283} 2284 2285// Response returns the raw server response from the last page request. 2286func (page UsageModelsResultPage) Response() UsageModelsResult { 2287 return page.umr 2288} 2289 2290// Values returns the slice of values for the current page or nil if there are no values. 2291func (page UsageModelsResultPage) Values() []UsageModel { 2292 if page.umr.IsEmpty() { 2293 return nil 2294 } 2295 return *page.umr.Value 2296} 2297 2298// Creates a new instance of the UsageModelsResultPage type. 2299func NewUsageModelsResultPage(cur UsageModelsResult, getNextPage func(context.Context, UsageModelsResult) (UsageModelsResult, error)) UsageModelsResultPage { 2300 return UsageModelsResultPage{ 2301 fn: getNextPage, 2302 umr: cur, 2303 } 2304} 2305