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