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