1package storagesync
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"net/http"
18)
19
20// The package's fully qualified name.
21const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2019-02-01/storagesync"
22
23// APIError error type
24type APIError struct {
25	// Code - Error code of the given entry.
26	Code *string `json:"code,omitempty"`
27	// Message - Error message of the given entry.
28	Message *string `json:"message,omitempty"`
29	// Target - Target of the given error entry.
30	Target *string `json:"target,omitempty"`
31	// Details - Error details of the given entry.
32	Details *ErrorDetails `json:"details,omitempty"`
33}
34
35// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
36type AzureEntityResource struct {
37	// Etag - READ-ONLY; Resource Etag.
38	Etag *string `json:"etag,omitempty"`
39	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
40	ID *string `json:"id,omitempty"`
41	// Name - READ-ONLY; The name of the resource
42	Name *string `json:"name,omitempty"`
43	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
44	Type *string `json:"type,omitempty"`
45}
46
47// MarshalJSON is the custom marshaler for AzureEntityResource.
48func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
49	objectMap := make(map[string]interface{})
50	return json.Marshal(objectMap)
51}
52
53// BackupRequest backup request
54type BackupRequest struct {
55	// AzureFileShare - Azure File Share.
56	AzureFileShare *string `json:"azureFileShare,omitempty"`
57}
58
59// CheckNameAvailabilityParameters parameters for a check name availability request.
60type CheckNameAvailabilityParameters struct {
61	// Name - The name to check for availability
62	Name *string `json:"name,omitempty"`
63	// Type - The resource type. Must be set to Microsoft.StorageSync/storageSyncServices
64	Type *string `json:"type,omitempty"`
65}
66
67// CheckNameAvailabilityResult the CheckNameAvailability operation response.
68type CheckNameAvailabilityResult struct {
69	autorest.Response `json:"-"`
70	// NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used.
71	NameAvailable *bool `json:"nameAvailable,omitempty"`
72	// Reason - READ-ONLY; Gets the reason that a Storage Sync Service name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'Invalid', 'AlreadyExists'
73	Reason NameAvailabilityReason `json:"reason,omitempty"`
74	// Message - READ-ONLY; Gets an error message explaining the Reason value in more detail.
75	Message *string `json:"message,omitempty"`
76}
77
78// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult.
79func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
80	objectMap := make(map[string]interface{})
81	return json.Marshal(objectMap)
82}
83
84// CloudEndpoint cloud Endpoint object.
85type CloudEndpoint struct {
86	autorest.Response `json:"-"`
87	// CloudEndpointProperties - Cloud Endpoint properties.
88	*CloudEndpointProperties `json:"properties,omitempty"`
89	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
90	ID *string `json:"id,omitempty"`
91	// Name - READ-ONLY; The name of the resource
92	Name *string `json:"name,omitempty"`
93	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
94	Type *string `json:"type,omitempty"`
95}
96
97// MarshalJSON is the custom marshaler for CloudEndpoint.
98func (ce CloudEndpoint) MarshalJSON() ([]byte, error) {
99	objectMap := make(map[string]interface{})
100	if ce.CloudEndpointProperties != nil {
101		objectMap["properties"] = ce.CloudEndpointProperties
102	}
103	return json.Marshal(objectMap)
104}
105
106// UnmarshalJSON is the custom unmarshaler for CloudEndpoint struct.
107func (ce *CloudEndpoint) UnmarshalJSON(body []byte) error {
108	var m map[string]*json.RawMessage
109	err := json.Unmarshal(body, &m)
110	if err != nil {
111		return err
112	}
113	for k, v := range m {
114		switch k {
115		case "properties":
116			if v != nil {
117				var cloudEndpointProperties CloudEndpointProperties
118				err = json.Unmarshal(*v, &cloudEndpointProperties)
119				if err != nil {
120					return err
121				}
122				ce.CloudEndpointProperties = &cloudEndpointProperties
123			}
124		case "id":
125			if v != nil {
126				var ID string
127				err = json.Unmarshal(*v, &ID)
128				if err != nil {
129					return err
130				}
131				ce.ID = &ID
132			}
133		case "name":
134			if v != nil {
135				var name string
136				err = json.Unmarshal(*v, &name)
137				if err != nil {
138					return err
139				}
140				ce.Name = &name
141			}
142		case "type":
143			if v != nil {
144				var typeVar string
145				err = json.Unmarshal(*v, &typeVar)
146				if err != nil {
147					return err
148				}
149				ce.Type = &typeVar
150			}
151		}
152	}
153
154	return nil
155}
156
157// CloudEndpointArray array of CloudEndpoint
158type CloudEndpointArray struct {
159	autorest.Response `json:"-"`
160	// Value - Collection of CloudEndpoint.
161	Value *[]CloudEndpoint `json:"value,omitempty"`
162}
163
164// CloudEndpointCreateParameters the parameters used when creating a cloud endpoint.
165type CloudEndpointCreateParameters struct {
166	// CloudEndpointCreateParametersProperties - The parameters used to create the cloud endpoint.
167	*CloudEndpointCreateParametersProperties `json:"properties,omitempty"`
168	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
169	ID *string `json:"id,omitempty"`
170	// Name - READ-ONLY; The name of the resource
171	Name *string `json:"name,omitempty"`
172	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
173	Type *string `json:"type,omitempty"`
174}
175
176// MarshalJSON is the custom marshaler for CloudEndpointCreateParameters.
177func (cecp CloudEndpointCreateParameters) MarshalJSON() ([]byte, error) {
178	objectMap := make(map[string]interface{})
179	if cecp.CloudEndpointCreateParametersProperties != nil {
180		objectMap["properties"] = cecp.CloudEndpointCreateParametersProperties
181	}
182	return json.Marshal(objectMap)
183}
184
185// UnmarshalJSON is the custom unmarshaler for CloudEndpointCreateParameters struct.
186func (cecp *CloudEndpointCreateParameters) UnmarshalJSON(body []byte) error {
187	var m map[string]*json.RawMessage
188	err := json.Unmarshal(body, &m)
189	if err != nil {
190		return err
191	}
192	for k, v := range m {
193		switch k {
194		case "properties":
195			if v != nil {
196				var cloudEndpointCreateParametersProperties CloudEndpointCreateParametersProperties
197				err = json.Unmarshal(*v, &cloudEndpointCreateParametersProperties)
198				if err != nil {
199					return err
200				}
201				cecp.CloudEndpointCreateParametersProperties = &cloudEndpointCreateParametersProperties
202			}
203		case "id":
204			if v != nil {
205				var ID string
206				err = json.Unmarshal(*v, &ID)
207				if err != nil {
208					return err
209				}
210				cecp.ID = &ID
211			}
212		case "name":
213			if v != nil {
214				var name string
215				err = json.Unmarshal(*v, &name)
216				if err != nil {
217					return err
218				}
219				cecp.Name = &name
220			}
221		case "type":
222			if v != nil {
223				var typeVar string
224				err = json.Unmarshal(*v, &typeVar)
225				if err != nil {
226					return err
227				}
228				cecp.Type = &typeVar
229			}
230		}
231	}
232
233	return nil
234}
235
236// CloudEndpointCreateParametersProperties cloudEndpoint Properties object.
237type CloudEndpointCreateParametersProperties struct {
238	// StorageAccountResourceID - Storage Account Resource Id
239	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
240	// AzureFileShareName - Azure file share name
241	AzureFileShareName *string `json:"azureFileShareName,omitempty"`
242	// StorageAccountTenantID - Storage Account Tenant Id
243	StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"`
244}
245
246// CloudEndpointProperties cloudEndpoint Properties object.
247type CloudEndpointProperties struct {
248	// StorageAccountResourceID - Storage Account Resource Id
249	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
250	// AzureFileShareName - Azure file share name
251	AzureFileShareName *string `json:"azureFileShareName,omitempty"`
252	// StorageAccountTenantID - Storage Account Tenant Id
253	StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"`
254	// PartnershipID - Partnership Id
255	PartnershipID *string `json:"partnershipId,omitempty"`
256	// FriendlyName - Friendly Name
257	FriendlyName *string `json:"friendlyName,omitempty"`
258	// BackupEnabled - READ-ONLY; Backup Enabled
259	BackupEnabled *string `json:"backupEnabled,omitempty"`
260	// ProvisioningState - CloudEndpoint Provisioning State
261	ProvisioningState *string `json:"provisioningState,omitempty"`
262	// LastWorkflowID - CloudEndpoint lastWorkflowId
263	LastWorkflowID *string `json:"lastWorkflowId,omitempty"`
264	// LastOperationName - Resource Last Operation Name
265	LastOperationName *string `json:"lastOperationName,omitempty"`
266}
267
268// MarshalJSON is the custom marshaler for CloudEndpointProperties.
269func (cep CloudEndpointProperties) MarshalJSON() ([]byte, error) {
270	objectMap := make(map[string]interface{})
271	if cep.StorageAccountResourceID != nil {
272		objectMap["storageAccountResourceId"] = cep.StorageAccountResourceID
273	}
274	if cep.AzureFileShareName != nil {
275		objectMap["azureFileShareName"] = cep.AzureFileShareName
276	}
277	if cep.StorageAccountTenantID != nil {
278		objectMap["storageAccountTenantId"] = cep.StorageAccountTenantID
279	}
280	if cep.PartnershipID != nil {
281		objectMap["partnershipId"] = cep.PartnershipID
282	}
283	if cep.FriendlyName != nil {
284		objectMap["friendlyName"] = cep.FriendlyName
285	}
286	if cep.ProvisioningState != nil {
287		objectMap["provisioningState"] = cep.ProvisioningState
288	}
289	if cep.LastWorkflowID != nil {
290		objectMap["lastWorkflowId"] = cep.LastWorkflowID
291	}
292	if cep.LastOperationName != nil {
293		objectMap["lastOperationName"] = cep.LastOperationName
294	}
295	return json.Marshal(objectMap)
296}
297
298// CloudEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
299// operation.
300type CloudEndpointsCreateFuture struct {
301	azure.FutureAPI
302	// Result returns the result of the asynchronous operation.
303	// If the operation has not completed it will return an error.
304	Result func(CloudEndpointsClient) (CloudEndpoint, error)
305}
306
307// UnmarshalJSON is the custom unmarshaller for CreateFuture.
308func (future *CloudEndpointsCreateFuture) UnmarshalJSON(body []byte) error {
309	var azFuture azure.Future
310	if err := json.Unmarshal(body, &azFuture); err != nil {
311		return err
312	}
313	future.FutureAPI = &azFuture
314	future.Result = future.result
315	return nil
316}
317
318// result is the default implementation for CloudEndpointsCreateFuture.Result.
319func (future *CloudEndpointsCreateFuture) result(client CloudEndpointsClient) (ce CloudEndpoint, err error) {
320	var done bool
321	done, err = future.DoneWithContext(context.Background(), client)
322	if err != nil {
323		err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
324		return
325	}
326	if !done {
327		ce.Response.Response = future.Response()
328		err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsCreateFuture")
329		return
330	}
331	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
332	if ce.Response.Response, err = future.GetResult(sender); err == nil && ce.Response.Response.StatusCode != http.StatusNoContent {
333		ce, err = client.CreateResponder(ce.Response.Response)
334		if err != nil {
335			err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsCreateFuture", "Result", ce.Response.Response, "Failure responding to request")
336		}
337	}
338	return
339}
340
341// CloudEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
342// operation.
343type CloudEndpointsDeleteFuture struct {
344	azure.FutureAPI
345	// Result returns the result of the asynchronous operation.
346	// If the operation has not completed it will return an error.
347	Result func(CloudEndpointsClient) (autorest.Response, error)
348}
349
350// UnmarshalJSON is the custom unmarshaller for CreateFuture.
351func (future *CloudEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
352	var azFuture azure.Future
353	if err := json.Unmarshal(body, &azFuture); err != nil {
354		return err
355	}
356	future.FutureAPI = &azFuture
357	future.Result = future.result
358	return nil
359}
360
361// result is the default implementation for CloudEndpointsDeleteFuture.Result.
362func (future *CloudEndpointsDeleteFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
363	var done bool
364	done, err = future.DoneWithContext(context.Background(), client)
365	if err != nil {
366		err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
367		return
368	}
369	if !done {
370		ar.Response = future.Response()
371		err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsDeleteFuture")
372		return
373	}
374	ar.Response = future.Response()
375	return
376}
377
378// CloudEndpointsPostBackupFuture an abstraction for monitoring and retrieving the results of a
379// long-running operation.
380type CloudEndpointsPostBackupFuture struct {
381	azure.FutureAPI
382	// Result returns the result of the asynchronous operation.
383	// If the operation has not completed it will return an error.
384	Result func(CloudEndpointsClient) (PostBackupResponse, error)
385}
386
387// UnmarshalJSON is the custom unmarshaller for CreateFuture.
388func (future *CloudEndpointsPostBackupFuture) UnmarshalJSON(body []byte) error {
389	var azFuture azure.Future
390	if err := json.Unmarshal(body, &azFuture); err != nil {
391		return err
392	}
393	future.FutureAPI = &azFuture
394	future.Result = future.result
395	return nil
396}
397
398// result is the default implementation for CloudEndpointsPostBackupFuture.Result.
399func (future *CloudEndpointsPostBackupFuture) result(client CloudEndpointsClient) (pbr PostBackupResponse, err error) {
400	var done bool
401	done, err = future.DoneWithContext(context.Background(), client)
402	if err != nil {
403		err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", future.Response(), "Polling failure")
404		return
405	}
406	if !done {
407		pbr.Response.Response = future.Response()
408		err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostBackupFuture")
409		return
410	}
411	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
412	if pbr.Response.Response, err = future.GetResult(sender); err == nil && pbr.Response.Response.StatusCode != http.StatusNoContent {
413		pbr, err = client.PostBackupResponder(pbr.Response.Response)
414		if err != nil {
415			err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostBackupFuture", "Result", pbr.Response.Response, "Failure responding to request")
416		}
417	}
418	return
419}
420
421// CloudEndpointsPostRestoreFuture an abstraction for monitoring and retrieving the results of a
422// long-running operation.
423type CloudEndpointsPostRestoreFuture struct {
424	azure.FutureAPI
425	// Result returns the result of the asynchronous operation.
426	// If the operation has not completed it will return an error.
427	Result func(CloudEndpointsClient) (autorest.Response, error)
428}
429
430// UnmarshalJSON is the custom unmarshaller for CreateFuture.
431func (future *CloudEndpointsPostRestoreFuture) UnmarshalJSON(body []byte) error {
432	var azFuture azure.Future
433	if err := json.Unmarshal(body, &azFuture); err != nil {
434		return err
435	}
436	future.FutureAPI = &azFuture
437	future.Result = future.result
438	return nil
439}
440
441// result is the default implementation for CloudEndpointsPostRestoreFuture.Result.
442func (future *CloudEndpointsPostRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
443	var done bool
444	done, err = future.DoneWithContext(context.Background(), client)
445	if err != nil {
446		err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPostRestoreFuture", "Result", future.Response(), "Polling failure")
447		return
448	}
449	if !done {
450		ar.Response = future.Response()
451		err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPostRestoreFuture")
452		return
453	}
454	ar.Response = future.Response()
455	return
456}
457
458// CloudEndpointsPreBackupFuture an abstraction for monitoring and retrieving the results of a long-running
459// operation.
460type CloudEndpointsPreBackupFuture struct {
461	azure.FutureAPI
462	// Result returns the result of the asynchronous operation.
463	// If the operation has not completed it will return an error.
464	Result func(CloudEndpointsClient) (autorest.Response, error)
465}
466
467// UnmarshalJSON is the custom unmarshaller for CreateFuture.
468func (future *CloudEndpointsPreBackupFuture) UnmarshalJSON(body []byte) error {
469	var azFuture azure.Future
470	if err := json.Unmarshal(body, &azFuture); err != nil {
471		return err
472	}
473	future.FutureAPI = &azFuture
474	future.Result = future.result
475	return nil
476}
477
478// result is the default implementation for CloudEndpointsPreBackupFuture.Result.
479func (future *CloudEndpointsPreBackupFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
480	var done bool
481	done, err = future.DoneWithContext(context.Background(), client)
482	if err != nil {
483		err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreBackupFuture", "Result", future.Response(), "Polling failure")
484		return
485	}
486	if !done {
487		ar.Response = future.Response()
488		err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreBackupFuture")
489		return
490	}
491	ar.Response = future.Response()
492	return
493}
494
495// CloudEndpointsPreRestoreFuture an abstraction for monitoring and retrieving the results of a
496// long-running operation.
497type CloudEndpointsPreRestoreFuture struct {
498	azure.FutureAPI
499	// Result returns the result of the asynchronous operation.
500	// If the operation has not completed it will return an error.
501	Result func(CloudEndpointsClient) (autorest.Response, error)
502}
503
504// UnmarshalJSON is the custom unmarshaller for CreateFuture.
505func (future *CloudEndpointsPreRestoreFuture) UnmarshalJSON(body []byte) error {
506	var azFuture azure.Future
507	if err := json.Unmarshal(body, &azFuture); err != nil {
508		return err
509	}
510	future.FutureAPI = &azFuture
511	future.Result = future.result
512	return nil
513}
514
515// result is the default implementation for CloudEndpointsPreRestoreFuture.Result.
516func (future *CloudEndpointsPreRestoreFuture) result(client CloudEndpointsClient) (ar autorest.Response, err error) {
517	var done bool
518	done, err = future.DoneWithContext(context.Background(), client)
519	if err != nil {
520		err = autorest.NewErrorWithError(err, "storagesync.CloudEndpointsPreRestoreFuture", "Result", future.Response(), "Polling failure")
521		return
522	}
523	if !done {
524		ar.Response = future.Response()
525		err = azure.NewAsyncOpIncompleteError("storagesync.CloudEndpointsPreRestoreFuture")
526		return
527	}
528	ar.Response = future.Response()
529	return
530}
531
532// Error error type
533type Error struct {
534	// Error - Error details of the given entry.
535	Error *APIError `json:"error,omitempty"`
536	// Innererror - Error details of the given entry.
537	Innererror *APIError `json:"innererror,omitempty"`
538}
539
540// ErrorDetails error Details object.
541type ErrorDetails struct {
542	// Code - Error code of the given entry.
543	Code *string `json:"code,omitempty"`
544	// Message - Error message of the given entry.
545	Message *string `json:"message,omitempty"`
546	// Target - Target of the given entry.
547	Target *string `json:"target,omitempty"`
548}
549
550// FilesNotSyncingError files not syncing error object
551type FilesNotSyncingError struct {
552	// ErrorCode - READ-ONLY; Error code (HResult)
553	ErrorCode *int32 `json:"errorCode,omitempty"`
554	// PersistentCount - READ-ONLY; Count of persistent files not syncing with the specified error code
555	PersistentCount *int64 `json:"persistentCount,omitempty"`
556	// TransientCount - READ-ONLY; Count of transient files not syncing with the specified error code
557	TransientCount *int64 `json:"transientCount,omitempty"`
558}
559
560// MarshalJSON is the custom marshaler for FilesNotSyncingError.
561func (fnse FilesNotSyncingError) MarshalJSON() ([]byte, error) {
562	objectMap := make(map[string]interface{})
563	return json.Marshal(objectMap)
564}
565
566// OperationDisplayInfo the operation supported by storage sync.
567type OperationDisplayInfo struct {
568	// Description - The description of the operation.
569	Description *string `json:"description,omitempty"`
570	// Operation - The action that users can perform, based on their permission level.
571	Operation *string `json:"operation,omitempty"`
572	// Provider - Service provider: Microsoft StorageSync.
573	Provider *string `json:"provider,omitempty"`
574	// Resource - Resource on which the operation is performed.
575	Resource *string `json:"resource,omitempty"`
576}
577
578// OperationDisplayResource operation Display Resource object.
579type OperationDisplayResource struct {
580	// Provider - Operation Display Resource Provider.
581	Provider *string `json:"provider,omitempty"`
582	// Resource - Operation Display Resource.
583	Resource *string `json:"resource,omitempty"`
584	// Operation - Operation Display Resource Operation.
585	Operation *string `json:"operation,omitempty"`
586	// Description - Operation Display Resource Description.
587	Description *string `json:"description,omitempty"`
588}
589
590// OperationEntity the operation supported by storage sync.
591type OperationEntity struct {
592	// Name - Operation name: {provider}/{resource}/{operation}.
593	Name *string `json:"name,omitempty"`
594	// Display - The operation supported by storage sync.
595	Display *OperationDisplayInfo `json:"display,omitempty"`
596	// Origin - The origin.
597	Origin *string `json:"origin,omitempty"`
598}
599
600// OperationEntityListResult the list of storage sync operations.
601type OperationEntityListResult struct {
602	autorest.Response `json:"-"`
603	// NextLink - The link used to get the next page of operations.
604	NextLink *string `json:"nextLink,omitempty"`
605	// Value - The list of operations.
606	Value *[]OperationEntity `json:"value,omitempty"`
607}
608
609// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values.
610type OperationEntityListResultIterator struct {
611	i    int
612	page OperationEntityListResultPage
613}
614
615// NextWithContext advances to the next value.  If there was an error making
616// the request the iterator does not advance and the error is returned.
617func (iter *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) {
618	if tracing.IsEnabled() {
619		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.NextWithContext")
620		defer func() {
621			sc := -1
622			if iter.Response().Response.Response != nil {
623				sc = iter.Response().Response.Response.StatusCode
624			}
625			tracing.EndSpan(ctx, sc, err)
626		}()
627	}
628	iter.i++
629	if iter.i < len(iter.page.Values()) {
630		return nil
631	}
632	err = iter.page.NextWithContext(ctx)
633	if err != nil {
634		iter.i--
635		return err
636	}
637	iter.i = 0
638	return nil
639}
640
641// Next advances to the next value.  If there was an error making
642// the request the iterator does not advance and the error is returned.
643// Deprecated: Use NextWithContext() instead.
644func (iter *OperationEntityListResultIterator) Next() error {
645	return iter.NextWithContext(context.Background())
646}
647
648// NotDone returns true if the enumeration should be started or is not yet complete.
649func (iter OperationEntityListResultIterator) NotDone() bool {
650	return iter.page.NotDone() && iter.i < len(iter.page.Values())
651}
652
653// Response returns the raw server response from the last page request.
654func (iter OperationEntityListResultIterator) Response() OperationEntityListResult {
655	return iter.page.Response()
656}
657
658// Value returns the current value or a zero-initialized value if the
659// iterator has advanced beyond the end of the collection.
660func (iter OperationEntityListResultIterator) Value() OperationEntity {
661	if !iter.page.NotDone() {
662		return OperationEntity{}
663	}
664	return iter.page.Values()[iter.i]
665}
666
667// Creates a new instance of the OperationEntityListResultIterator type.
668func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator {
669	return OperationEntityListResultIterator{page: page}
670}
671
672// IsEmpty returns true if the ListResult contains no values.
673func (oelr OperationEntityListResult) IsEmpty() bool {
674	return oelr.Value == nil || len(*oelr.Value) == 0
675}
676
677// hasNextLink returns true if the NextLink is not empty.
678func (oelr OperationEntityListResult) hasNextLink() bool {
679	return oelr.NextLink != nil && len(*oelr.NextLink) != 0
680}
681
682// operationEntityListResultPreparer prepares a request to retrieve the next set of results.
683// It returns nil if no more results exist.
684func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) {
685	if !oelr.hasNextLink() {
686		return nil, nil
687	}
688	return autorest.Prepare((&http.Request{}).WithContext(ctx),
689		autorest.AsJSON(),
690		autorest.AsGet(),
691		autorest.WithBaseURL(to.String(oelr.NextLink)))
692}
693
694// OperationEntityListResultPage contains a page of OperationEntity values.
695type OperationEntityListResultPage struct {
696	fn   func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)
697	oelr OperationEntityListResult
698}
699
700// NextWithContext advances to the next page of values.  If there was an error making
701// the request the page does not advance and the error is returned.
702func (page *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) {
703	if tracing.IsEnabled() {
704		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext")
705		defer func() {
706			sc := -1
707			if page.Response().Response.Response != nil {
708				sc = page.Response().Response.Response.StatusCode
709			}
710			tracing.EndSpan(ctx, sc, err)
711		}()
712	}
713	for {
714		next, err := page.fn(ctx, page.oelr)
715		if err != nil {
716			return err
717		}
718		page.oelr = next
719		if !next.hasNextLink() || !next.IsEmpty() {
720			break
721		}
722	}
723	return nil
724}
725
726// Next advances to the next page of values.  If there was an error making
727// the request the page does not advance and the error is returned.
728// Deprecated: Use NextWithContext() instead.
729func (page *OperationEntityListResultPage) Next() error {
730	return page.NextWithContext(context.Background())
731}
732
733// NotDone returns true if the page enumeration should be started or is not yet complete.
734func (page OperationEntityListResultPage) NotDone() bool {
735	return !page.oelr.IsEmpty()
736}
737
738// Response returns the raw server response from the last page request.
739func (page OperationEntityListResultPage) Response() OperationEntityListResult {
740	return page.oelr
741}
742
743// Values returns the slice of values for the current page or nil if there are no values.
744func (page OperationEntityListResultPage) Values() []OperationEntity {
745	if page.oelr.IsEmpty() {
746		return nil
747	}
748	return *page.oelr.Value
749}
750
751// Creates a new instance of the OperationEntityListResultPage type.
752func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage {
753	return OperationEntityListResultPage{
754		fn:   getNextPage,
755		oelr: cur,
756	}
757}
758
759// PostBackupResponse post Backup Response
760type PostBackupResponse struct {
761	autorest.Response `json:"-"`
762	// PostBackupResponseProperties - Post Backup Response Properties
763	*PostBackupResponseProperties `json:"backupMetadata,omitempty"`
764}
765
766// MarshalJSON is the custom marshaler for PostBackupResponse.
767func (pbr PostBackupResponse) MarshalJSON() ([]byte, error) {
768	objectMap := make(map[string]interface{})
769	if pbr.PostBackupResponseProperties != nil {
770		objectMap["backupMetadata"] = pbr.PostBackupResponseProperties
771	}
772	return json.Marshal(objectMap)
773}
774
775// UnmarshalJSON is the custom unmarshaler for PostBackupResponse struct.
776func (pbr *PostBackupResponse) UnmarshalJSON(body []byte) error {
777	var m map[string]*json.RawMessage
778	err := json.Unmarshal(body, &m)
779	if err != nil {
780		return err
781	}
782	for k, v := range m {
783		switch k {
784		case "backupMetadata":
785			if v != nil {
786				var postBackupResponseProperties PostBackupResponseProperties
787				err = json.Unmarshal(*v, &postBackupResponseProperties)
788				if err != nil {
789					return err
790				}
791				pbr.PostBackupResponseProperties = &postBackupResponseProperties
792			}
793		}
794	}
795
796	return nil
797}
798
799// PostBackupResponseProperties post Backup Response Properties object.
800type PostBackupResponseProperties struct {
801	// CloudEndpointName - READ-ONLY; cloud endpoint Name.
802	CloudEndpointName *string `json:"cloudEndpointName,omitempty"`
803}
804
805// MarshalJSON is the custom marshaler for PostBackupResponseProperties.
806func (pbrp PostBackupResponseProperties) MarshalJSON() ([]byte, error) {
807	objectMap := make(map[string]interface{})
808	return json.Marshal(objectMap)
809}
810
811// PostRestoreRequest post Restore Request
812type PostRestoreRequest struct {
813	// Partition - Post Restore partition.
814	Partition *string `json:"partition,omitempty"`
815	// ReplicaGroup - Post Restore replica group.
816	ReplicaGroup *string `json:"replicaGroup,omitempty"`
817	// RequestID - Post Restore request id.
818	RequestID *string `json:"requestId,omitempty"`
819	// AzureFileShareURI - Post Restore Azure file share uri.
820	AzureFileShareURI *string `json:"azureFileShareUri,omitempty"`
821	// Status - Post Restore Azure status.
822	Status *string `json:"status,omitempty"`
823	// SourceAzureFileShareURI - Post Restore Azure source azure file share uri.
824	SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"`
825	// FailedFileList - Post Restore Azure failed file list.
826	FailedFileList *string `json:"failedFileList,omitempty"`
827	// RestoreFileSpec - Post Restore restore file spec array.
828	RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"`
829}
830
831// PreRestoreRequest pre Restore request object.
832type PreRestoreRequest struct {
833	// Partition - Pre Restore partition.
834	Partition *string `json:"partition,omitempty"`
835	// ReplicaGroup - Pre Restore replica group.
836	ReplicaGroup *string `json:"replicaGroup,omitempty"`
837	// RequestID - Pre Restore request id.
838	RequestID *string `json:"requestId,omitempty"`
839	// AzureFileShareURI - Pre Restore Azure file share uri.
840	AzureFileShareURI *string `json:"azureFileShareUri,omitempty"`
841	// Status - Pre Restore Azure status.
842	Status *string `json:"status,omitempty"`
843	// SourceAzureFileShareURI - Pre Restore Azure source azure file share uri.
844	SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"`
845	// BackupMetadataPropertyBag - Pre Restore backup metadata property bag.
846	BackupMetadataPropertyBag *string `json:"backupMetadataPropertyBag,omitempty"`
847	// RestoreFileSpec - Pre Restore restore file spec array.
848	RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"`
849	// PauseWaitForSyncDrainTimePeriodInSeconds - Pre Restore pause wait for sync drain time period in seconds.
850	PauseWaitForSyncDrainTimePeriodInSeconds *int32 `json:"pauseWaitForSyncDrainTimePeriodInSeconds,omitempty"`
851}
852
853// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
854// have tags and a location
855type ProxyResource struct {
856	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
857	ID *string `json:"id,omitempty"`
858	// Name - READ-ONLY; The name of the resource
859	Name *string `json:"name,omitempty"`
860	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
861	Type *string `json:"type,omitempty"`
862}
863
864// MarshalJSON is the custom marshaler for ProxyResource.
865func (pr ProxyResource) MarshalJSON() ([]byte, error) {
866	objectMap := make(map[string]interface{})
867	return json.Marshal(objectMap)
868}
869
870// RecallActionParameters the parameters used when calling recall action on server endpoint.
871type RecallActionParameters struct {
872	// Pattern - Pattern of the files.
873	Pattern *string `json:"pattern,omitempty"`
874	// RecallPath - Recall path.
875	RecallPath *string `json:"recallPath,omitempty"`
876}
877
878// RegisteredServer registered Server resource.
879type RegisteredServer struct {
880	autorest.Response `json:"-"`
881	// RegisteredServerProperties - RegisteredServer properties.
882	*RegisteredServerProperties `json:"properties,omitempty"`
883	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
884	ID *string `json:"id,omitempty"`
885	// Name - READ-ONLY; The name of the resource
886	Name *string `json:"name,omitempty"`
887	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
888	Type *string `json:"type,omitempty"`
889}
890
891// MarshalJSON is the custom marshaler for RegisteredServer.
892func (rs RegisteredServer) MarshalJSON() ([]byte, error) {
893	objectMap := make(map[string]interface{})
894	if rs.RegisteredServerProperties != nil {
895		objectMap["properties"] = rs.RegisteredServerProperties
896	}
897	return json.Marshal(objectMap)
898}
899
900// UnmarshalJSON is the custom unmarshaler for RegisteredServer struct.
901func (rs *RegisteredServer) UnmarshalJSON(body []byte) error {
902	var m map[string]*json.RawMessage
903	err := json.Unmarshal(body, &m)
904	if err != nil {
905		return err
906	}
907	for k, v := range m {
908		switch k {
909		case "properties":
910			if v != nil {
911				var registeredServerProperties RegisteredServerProperties
912				err = json.Unmarshal(*v, &registeredServerProperties)
913				if err != nil {
914					return err
915				}
916				rs.RegisteredServerProperties = &registeredServerProperties
917			}
918		case "id":
919			if v != nil {
920				var ID string
921				err = json.Unmarshal(*v, &ID)
922				if err != nil {
923					return err
924				}
925				rs.ID = &ID
926			}
927		case "name":
928			if v != nil {
929				var name string
930				err = json.Unmarshal(*v, &name)
931				if err != nil {
932					return err
933				}
934				rs.Name = &name
935			}
936		case "type":
937			if v != nil {
938				var typeVar string
939				err = json.Unmarshal(*v, &typeVar)
940				if err != nil {
941					return err
942				}
943				rs.Type = &typeVar
944			}
945		}
946	}
947
948	return nil
949}
950
951// RegisteredServerArray array of RegisteredServer
952type RegisteredServerArray struct {
953	autorest.Response `json:"-"`
954	// Value - Collection of Registered Server.
955	Value *[]RegisteredServer `json:"value,omitempty"`
956}
957
958// RegisteredServerCreateParameters the parameters used when creating a registered server.
959type RegisteredServerCreateParameters struct {
960	// RegisteredServerCreateParametersProperties - The parameters used to create the registered server.
961	*RegisteredServerCreateParametersProperties `json:"properties,omitempty"`
962	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
963	ID *string `json:"id,omitempty"`
964	// Name - READ-ONLY; The name of the resource
965	Name *string `json:"name,omitempty"`
966	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
967	Type *string `json:"type,omitempty"`
968}
969
970// MarshalJSON is the custom marshaler for RegisteredServerCreateParameters.
971func (rscp RegisteredServerCreateParameters) MarshalJSON() ([]byte, error) {
972	objectMap := make(map[string]interface{})
973	if rscp.RegisteredServerCreateParametersProperties != nil {
974		objectMap["properties"] = rscp.RegisteredServerCreateParametersProperties
975	}
976	return json.Marshal(objectMap)
977}
978
979// UnmarshalJSON is the custom unmarshaler for RegisteredServerCreateParameters struct.
980func (rscp *RegisteredServerCreateParameters) UnmarshalJSON(body []byte) error {
981	var m map[string]*json.RawMessage
982	err := json.Unmarshal(body, &m)
983	if err != nil {
984		return err
985	}
986	for k, v := range m {
987		switch k {
988		case "properties":
989			if v != nil {
990				var registeredServerCreateParametersProperties RegisteredServerCreateParametersProperties
991				err = json.Unmarshal(*v, &registeredServerCreateParametersProperties)
992				if err != nil {
993					return err
994				}
995				rscp.RegisteredServerCreateParametersProperties = &registeredServerCreateParametersProperties
996			}
997		case "id":
998			if v != nil {
999				var ID string
1000				err = json.Unmarshal(*v, &ID)
1001				if err != nil {
1002					return err
1003				}
1004				rscp.ID = &ID
1005			}
1006		case "name":
1007			if v != nil {
1008				var name string
1009				err = json.Unmarshal(*v, &name)
1010				if err != nil {
1011					return err
1012				}
1013				rscp.Name = &name
1014			}
1015		case "type":
1016			if v != nil {
1017				var typeVar string
1018				err = json.Unmarshal(*v, &typeVar)
1019				if err != nil {
1020					return err
1021				}
1022				rscp.Type = &typeVar
1023			}
1024		}
1025	}
1026
1027	return nil
1028}
1029
1030// RegisteredServerCreateParametersProperties ...
1031type RegisteredServerCreateParametersProperties struct {
1032	// ServerCertificate - Registered Server Certificate
1033	ServerCertificate *string `json:"serverCertificate,omitempty"`
1034	// AgentVersion - Registered Server Agent Version
1035	AgentVersion *string `json:"agentVersion,omitempty"`
1036	// ServerOSVersion - Registered Server OS Version
1037	ServerOSVersion *string `json:"serverOSVersion,omitempty"`
1038	// LastHeartBeat - Registered Server last heart beat
1039	LastHeartBeat *string `json:"lastHeartBeat,omitempty"`
1040	// ServerRole - Registered Server serverRole
1041	ServerRole *string `json:"serverRole,omitempty"`
1042	// ClusterID - Registered Server clusterId
1043	ClusterID *string `json:"clusterId,omitempty"`
1044	// ClusterName - Registered Server clusterName
1045	ClusterName *string `json:"clusterName,omitempty"`
1046	// ServerID - Registered Server serverId
1047	ServerID *string `json:"serverId,omitempty"`
1048	// FriendlyName - Friendly Name
1049	FriendlyName *string `json:"friendlyName,omitempty"`
1050}
1051
1052// RegisteredServerProperties registeredServer Properties object.
1053type RegisteredServerProperties struct {
1054	// ServerCertificate - Registered Server Certificate
1055	ServerCertificate *string `json:"serverCertificate,omitempty"`
1056	// AgentVersion - Registered Server Agent Version
1057	AgentVersion *string `json:"agentVersion,omitempty"`
1058	// ServerOSVersion - Registered Server OS Version
1059	ServerOSVersion *string `json:"serverOSVersion,omitempty"`
1060	// ServerManagementErrorCode - Registered Server Management Error Code
1061	ServerManagementErrorCode *int32 `json:"serverManagementErrorCode,omitempty"`
1062	// LastHeartBeat - Registered Server last heart beat
1063	LastHeartBeat *string `json:"lastHeartBeat,omitempty"`
1064	// ProvisioningState - Registered Server Provisioning State
1065	ProvisioningState *string `json:"provisioningState,omitempty"`
1066	// ServerRole - Registered Server serverRole
1067	ServerRole *string `json:"serverRole,omitempty"`
1068	// ClusterID - Registered Server clusterId
1069	ClusterID *string `json:"clusterId,omitempty"`
1070	// ClusterName - Registered Server clusterName
1071	ClusterName *string `json:"clusterName,omitempty"`
1072	// ServerID - Registered Server serverId
1073	ServerID *string `json:"serverId,omitempty"`
1074	// StorageSyncServiceUID - Registered Server storageSyncServiceUid
1075	StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"`
1076	// LastWorkflowID - Registered Server lastWorkflowId
1077	LastWorkflowID *string `json:"lastWorkflowId,omitempty"`
1078	// LastOperationName - Resource Last Operation Name
1079	LastOperationName *string `json:"lastOperationName,omitempty"`
1080	// DiscoveryEndpointURI - Resource discoveryEndpointUri
1081	DiscoveryEndpointURI *string `json:"discoveryEndpointUri,omitempty"`
1082	// ResourceLocation - Resource Location
1083	ResourceLocation *string `json:"resourceLocation,omitempty"`
1084	// ServiceLocation - Service Location
1085	ServiceLocation *string `json:"serviceLocation,omitempty"`
1086	// FriendlyName - Friendly Name
1087	FriendlyName *string `json:"friendlyName,omitempty"`
1088	// ManagementEndpointURI - Management Endpoint Uri
1089	ManagementEndpointURI *string `json:"managementEndpointUri,omitempty"`
1090	// MonitoringConfiguration - Monitoring Configuration
1091	MonitoringConfiguration *string `json:"monitoringConfiguration,omitempty"`
1092}
1093
1094// RegisteredServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running
1095// operation.
1096type RegisteredServersCreateFuture struct {
1097	azure.FutureAPI
1098	// Result returns the result of the asynchronous operation.
1099	// If the operation has not completed it will return an error.
1100	Result func(RegisteredServersClient) (RegisteredServer, error)
1101}
1102
1103// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1104func (future *RegisteredServersCreateFuture) UnmarshalJSON(body []byte) error {
1105	var azFuture azure.Future
1106	if err := json.Unmarshal(body, &azFuture); err != nil {
1107		return err
1108	}
1109	future.FutureAPI = &azFuture
1110	future.Result = future.result
1111	return nil
1112}
1113
1114// result is the default implementation for RegisteredServersCreateFuture.Result.
1115func (future *RegisteredServersCreateFuture) result(client RegisteredServersClient) (rs RegisteredServer, err error) {
1116	var done bool
1117	done, err = future.DoneWithContext(context.Background(), client)
1118	if err != nil {
1119		err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", future.Response(), "Polling failure")
1120		return
1121	}
1122	if !done {
1123		rs.Response.Response = future.Response()
1124		err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersCreateFuture")
1125		return
1126	}
1127	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1128	if rs.Response.Response, err = future.GetResult(sender); err == nil && rs.Response.Response.StatusCode != http.StatusNoContent {
1129		rs, err = client.CreateResponder(rs.Response.Response)
1130		if err != nil {
1131			err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersCreateFuture", "Result", rs.Response.Response, "Failure responding to request")
1132		}
1133	}
1134	return
1135}
1136
1137// RegisteredServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1138// operation.
1139type RegisteredServersDeleteFuture struct {
1140	azure.FutureAPI
1141	// Result returns the result of the asynchronous operation.
1142	// If the operation has not completed it will return an error.
1143	Result func(RegisteredServersClient) (autorest.Response, error)
1144}
1145
1146// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1147func (future *RegisteredServersDeleteFuture) UnmarshalJSON(body []byte) error {
1148	var azFuture azure.Future
1149	if err := json.Unmarshal(body, &azFuture); err != nil {
1150		return err
1151	}
1152	future.FutureAPI = &azFuture
1153	future.Result = future.result
1154	return nil
1155}
1156
1157// result is the default implementation for RegisteredServersDeleteFuture.Result.
1158func (future *RegisteredServersDeleteFuture) result(client RegisteredServersClient) (ar autorest.Response, err error) {
1159	var done bool
1160	done, err = future.DoneWithContext(context.Background(), client)
1161	if err != nil {
1162		err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersDeleteFuture", "Result", future.Response(), "Polling failure")
1163		return
1164	}
1165	if !done {
1166		ar.Response = future.Response()
1167		err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersDeleteFuture")
1168		return
1169	}
1170	ar.Response = future.Response()
1171	return
1172}
1173
1174// RegisteredServersTriggerRolloverFuture an abstraction for monitoring and retrieving the results of a
1175// long-running operation.
1176type RegisteredServersTriggerRolloverFuture struct {
1177	azure.FutureAPI
1178	// Result returns the result of the asynchronous operation.
1179	// If the operation has not completed it will return an error.
1180	Result func(RegisteredServersClient) (autorest.Response, error)
1181}
1182
1183// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1184func (future *RegisteredServersTriggerRolloverFuture) UnmarshalJSON(body []byte) error {
1185	var azFuture azure.Future
1186	if err := json.Unmarshal(body, &azFuture); err != nil {
1187		return err
1188	}
1189	future.FutureAPI = &azFuture
1190	future.Result = future.result
1191	return nil
1192}
1193
1194// result is the default implementation for RegisteredServersTriggerRolloverFuture.Result.
1195func (future *RegisteredServersTriggerRolloverFuture) result(client RegisteredServersClient) (ar autorest.Response, err error) {
1196	var done bool
1197	done, err = future.DoneWithContext(context.Background(), client)
1198	if err != nil {
1199		err = autorest.NewErrorWithError(err, "storagesync.RegisteredServersTriggerRolloverFuture", "Result", future.Response(), "Polling failure")
1200		return
1201	}
1202	if !done {
1203		ar.Response = future.Response()
1204		err = azure.NewAsyncOpIncompleteError("storagesync.RegisteredServersTriggerRolloverFuture")
1205		return
1206	}
1207	ar.Response = future.Response()
1208	return
1209}
1210
1211// Resource common fields that are returned in the response for all Azure Resource Manager resources
1212type Resource struct {
1213	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1214	ID *string `json:"id,omitempty"`
1215	// Name - READ-ONLY; The name of the resource
1216	Name *string `json:"name,omitempty"`
1217	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1218	Type *string `json:"type,omitempty"`
1219}
1220
1221// MarshalJSON is the custom marshaler for Resource.
1222func (r Resource) MarshalJSON() ([]byte, error) {
1223	objectMap := make(map[string]interface{})
1224	return json.Marshal(objectMap)
1225}
1226
1227// ResourcesMoveInfo resource Move Info.
1228type ResourcesMoveInfo struct {
1229	// TargetResourceGroup - Target resource group.
1230	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
1231	// Resources - Collection of Resources.
1232	Resources *[]string `json:"resources,omitempty"`
1233}
1234
1235// RestoreFileSpec restore file spec.
1236type RestoreFileSpec struct {
1237	// Path - Restore file spec path
1238	Path *string `json:"path,omitempty"`
1239	// Isdir - READ-ONLY; Restore file spec isdir
1240	Isdir *bool `json:"isdir,omitempty"`
1241}
1242
1243// MarshalJSON is the custom marshaler for RestoreFileSpec.
1244func (rfs RestoreFileSpec) MarshalJSON() ([]byte, error) {
1245	objectMap := make(map[string]interface{})
1246	if rfs.Path != nil {
1247		objectMap["path"] = rfs.Path
1248	}
1249	return json.Marshal(objectMap)
1250}
1251
1252// ServerEndpoint server Endpoint object.
1253type ServerEndpoint struct {
1254	autorest.Response `json:"-"`
1255	// ServerEndpointProperties - Server Endpoint properties.
1256	*ServerEndpointProperties `json:"properties,omitempty"`
1257	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1258	ID *string `json:"id,omitempty"`
1259	// Name - READ-ONLY; The name of the resource
1260	Name *string `json:"name,omitempty"`
1261	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1262	Type *string `json:"type,omitempty"`
1263}
1264
1265// MarshalJSON is the custom marshaler for ServerEndpoint.
1266func (se ServerEndpoint) MarshalJSON() ([]byte, error) {
1267	objectMap := make(map[string]interface{})
1268	if se.ServerEndpointProperties != nil {
1269		objectMap["properties"] = se.ServerEndpointProperties
1270	}
1271	return json.Marshal(objectMap)
1272}
1273
1274// UnmarshalJSON is the custom unmarshaler for ServerEndpoint struct.
1275func (se *ServerEndpoint) UnmarshalJSON(body []byte) error {
1276	var m map[string]*json.RawMessage
1277	err := json.Unmarshal(body, &m)
1278	if err != nil {
1279		return err
1280	}
1281	for k, v := range m {
1282		switch k {
1283		case "properties":
1284			if v != nil {
1285				var serverEndpointProperties ServerEndpointProperties
1286				err = json.Unmarshal(*v, &serverEndpointProperties)
1287				if err != nil {
1288					return err
1289				}
1290				se.ServerEndpointProperties = &serverEndpointProperties
1291			}
1292		case "id":
1293			if v != nil {
1294				var ID string
1295				err = json.Unmarshal(*v, &ID)
1296				if err != nil {
1297					return err
1298				}
1299				se.ID = &ID
1300			}
1301		case "name":
1302			if v != nil {
1303				var name string
1304				err = json.Unmarshal(*v, &name)
1305				if err != nil {
1306					return err
1307				}
1308				se.Name = &name
1309			}
1310		case "type":
1311			if v != nil {
1312				var typeVar string
1313				err = json.Unmarshal(*v, &typeVar)
1314				if err != nil {
1315					return err
1316				}
1317				se.Type = &typeVar
1318			}
1319		}
1320	}
1321
1322	return nil
1323}
1324
1325// ServerEndpointArray array of ServerEndpoint
1326type ServerEndpointArray struct {
1327	autorest.Response `json:"-"`
1328	// Value - Collection of ServerEndpoint.
1329	Value *[]ServerEndpoint `json:"value,omitempty"`
1330}
1331
1332// ServerEndpointCreateParameters the parameters used when creating a server endpoint.
1333type ServerEndpointCreateParameters struct {
1334	// ServerEndpointCreateParametersProperties - The parameters used to create the server endpoint.
1335	*ServerEndpointCreateParametersProperties `json:"properties,omitempty"`
1336	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1337	ID *string `json:"id,omitempty"`
1338	// Name - READ-ONLY; The name of the resource
1339	Name *string `json:"name,omitempty"`
1340	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1341	Type *string `json:"type,omitempty"`
1342}
1343
1344// MarshalJSON is the custom marshaler for ServerEndpointCreateParameters.
1345func (secp ServerEndpointCreateParameters) MarshalJSON() ([]byte, error) {
1346	objectMap := make(map[string]interface{})
1347	if secp.ServerEndpointCreateParametersProperties != nil {
1348		objectMap["properties"] = secp.ServerEndpointCreateParametersProperties
1349	}
1350	return json.Marshal(objectMap)
1351}
1352
1353// UnmarshalJSON is the custom unmarshaler for ServerEndpointCreateParameters struct.
1354func (secp *ServerEndpointCreateParameters) UnmarshalJSON(body []byte) error {
1355	var m map[string]*json.RawMessage
1356	err := json.Unmarshal(body, &m)
1357	if err != nil {
1358		return err
1359	}
1360	for k, v := range m {
1361		switch k {
1362		case "properties":
1363			if v != nil {
1364				var serverEndpointCreateParametersProperties ServerEndpointCreateParametersProperties
1365				err = json.Unmarshal(*v, &serverEndpointCreateParametersProperties)
1366				if err != nil {
1367					return err
1368				}
1369				secp.ServerEndpointCreateParametersProperties = &serverEndpointCreateParametersProperties
1370			}
1371		case "id":
1372			if v != nil {
1373				var ID string
1374				err = json.Unmarshal(*v, &ID)
1375				if err != nil {
1376					return err
1377				}
1378				secp.ID = &ID
1379			}
1380		case "name":
1381			if v != nil {
1382				var name string
1383				err = json.Unmarshal(*v, &name)
1384				if err != nil {
1385					return err
1386				}
1387				secp.Name = &name
1388			}
1389		case "type":
1390			if v != nil {
1391				var typeVar string
1392				err = json.Unmarshal(*v, &typeVar)
1393				if err != nil {
1394					return err
1395				}
1396				secp.Type = &typeVar
1397			}
1398		}
1399	}
1400
1401	return nil
1402}
1403
1404// ServerEndpointCreateParametersProperties serverEndpoint Properties object.
1405type ServerEndpointCreateParametersProperties struct {
1406	// ServerLocalPath - Server Local path.
1407	ServerLocalPath *string `json:"serverLocalPath,omitempty"`
1408	// CloudTiering - Cloud Tiering. Possible values include: 'On', 'Off'
1409	CloudTiering CloudTiering `json:"cloudTiering,omitempty"`
1410	// VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled.
1411	VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"`
1412	// TierFilesOlderThanDays - Tier files older than days.
1413	TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"`
1414	// FriendlyName - Friendly Name
1415	FriendlyName *string `json:"friendlyName,omitempty"`
1416	// ServerResourceID - Server Resource Id.
1417	ServerResourceID *string `json:"serverResourceId,omitempty"`
1418	// OfflineDataTransfer - Offline data transfer. Possible values include: 'OfflineDataTransferOn', 'OfflineDataTransferOff'
1419	OfflineDataTransfer OfflineDataTransfer `json:"offlineDataTransfer,omitempty"`
1420	// OfflineDataTransferShareName - Offline data transfer share name
1421	OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"`
1422}
1423
1424// ServerEndpointProperties serverEndpoint Properties object.
1425type ServerEndpointProperties struct {
1426	// ServerLocalPath - Server Local path.
1427	ServerLocalPath *string `json:"serverLocalPath,omitempty"`
1428	// CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering2On', 'CloudTiering2Off'
1429	CloudTiering CloudTiering2 `json:"cloudTiering,omitempty"`
1430	// VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled.
1431	VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"`
1432	// TierFilesOlderThanDays - Tier files older than days.
1433	TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"`
1434	// FriendlyName - Friendly Name
1435	FriendlyName *string `json:"friendlyName,omitempty"`
1436	// ServerResourceID - Server Resource Id.
1437	ServerResourceID *string `json:"serverResourceId,omitempty"`
1438	// ProvisioningState - READ-ONLY; ServerEndpoint Provisioning State
1439	ProvisioningState *string `json:"provisioningState,omitempty"`
1440	// LastWorkflowID - READ-ONLY; ServerEndpoint lastWorkflowId
1441	LastWorkflowID *string `json:"lastWorkflowId,omitempty"`
1442	// LastOperationName - READ-ONLY; Resource Last Operation Name
1443	LastOperationName *string `json:"lastOperationName,omitempty"`
1444	// SyncStatus - READ-ONLY; Server Endpoint sync status
1445	SyncStatus *ServerEndpointSyncStatus `json:"syncStatus,omitempty"`
1446	// OfflineDataTransfer - Offline data transfer. Possible values include: 'OfflineDataTransfer2On', 'OfflineDataTransfer2Off'
1447	OfflineDataTransfer OfflineDataTransfer2 `json:"offlineDataTransfer,omitempty"`
1448	// OfflineDataTransferStorageAccountResourceID - READ-ONLY; Offline data transfer storage account resource ID
1449	OfflineDataTransferStorageAccountResourceID *string `json:"offlineDataTransferStorageAccountResourceId,omitempty"`
1450	// OfflineDataTransferStorageAccountTenantID - READ-ONLY; Offline data transfer storage account tenant ID
1451	OfflineDataTransferStorageAccountTenantID *string `json:"offlineDataTransferStorageAccountTenantId,omitempty"`
1452	// OfflineDataTransferShareName - Offline data transfer share name
1453	OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"`
1454}
1455
1456// MarshalJSON is the custom marshaler for ServerEndpointProperties.
1457func (sep ServerEndpointProperties) MarshalJSON() ([]byte, error) {
1458	objectMap := make(map[string]interface{})
1459	if sep.ServerLocalPath != nil {
1460		objectMap["serverLocalPath"] = sep.ServerLocalPath
1461	}
1462	if sep.CloudTiering != "" {
1463		objectMap["cloudTiering"] = sep.CloudTiering
1464	}
1465	if sep.VolumeFreeSpacePercent != nil {
1466		objectMap["volumeFreeSpacePercent"] = sep.VolumeFreeSpacePercent
1467	}
1468	if sep.TierFilesOlderThanDays != nil {
1469		objectMap["tierFilesOlderThanDays"] = sep.TierFilesOlderThanDays
1470	}
1471	if sep.FriendlyName != nil {
1472		objectMap["friendlyName"] = sep.FriendlyName
1473	}
1474	if sep.ServerResourceID != nil {
1475		objectMap["serverResourceId"] = sep.ServerResourceID
1476	}
1477	if sep.OfflineDataTransfer != "" {
1478		objectMap["offlineDataTransfer"] = sep.OfflineDataTransfer
1479	}
1480	if sep.OfflineDataTransferShareName != nil {
1481		objectMap["offlineDataTransferShareName"] = sep.OfflineDataTransferShareName
1482	}
1483	return json.Marshal(objectMap)
1484}
1485
1486// ServerEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
1487// operation.
1488type ServerEndpointsCreateFuture struct {
1489	azure.FutureAPI
1490	// Result returns the result of the asynchronous operation.
1491	// If the operation has not completed it will return an error.
1492	Result func(ServerEndpointsClient) (ServerEndpoint, error)
1493}
1494
1495// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1496func (future *ServerEndpointsCreateFuture) UnmarshalJSON(body []byte) error {
1497	var azFuture azure.Future
1498	if err := json.Unmarshal(body, &azFuture); err != nil {
1499		return err
1500	}
1501	future.FutureAPI = &azFuture
1502	future.Result = future.result
1503	return nil
1504}
1505
1506// result is the default implementation for ServerEndpointsCreateFuture.Result.
1507func (future *ServerEndpointsCreateFuture) result(client ServerEndpointsClient) (se ServerEndpoint, err error) {
1508	var done bool
1509	done, err = future.DoneWithContext(context.Background(), client)
1510	if err != nil {
1511		err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", future.Response(), "Polling failure")
1512		return
1513	}
1514	if !done {
1515		se.Response.Response = future.Response()
1516		err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsCreateFuture")
1517		return
1518	}
1519	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1520	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
1521		se, err = client.CreateResponder(se.Response.Response)
1522		if err != nil {
1523			err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsCreateFuture", "Result", se.Response.Response, "Failure responding to request")
1524		}
1525	}
1526	return
1527}
1528
1529// ServerEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1530// operation.
1531type ServerEndpointsDeleteFuture struct {
1532	azure.FutureAPI
1533	// Result returns the result of the asynchronous operation.
1534	// If the operation has not completed it will return an error.
1535	Result func(ServerEndpointsClient) (autorest.Response, error)
1536}
1537
1538// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1539func (future *ServerEndpointsDeleteFuture) UnmarshalJSON(body []byte) error {
1540	var azFuture azure.Future
1541	if err := json.Unmarshal(body, &azFuture); err != nil {
1542		return err
1543	}
1544	future.FutureAPI = &azFuture
1545	future.Result = future.result
1546	return nil
1547}
1548
1549// result is the default implementation for ServerEndpointsDeleteFuture.Result.
1550func (future *ServerEndpointsDeleteFuture) result(client ServerEndpointsClient) (ar autorest.Response, err error) {
1551	var done bool
1552	done, err = future.DoneWithContext(context.Background(), client)
1553	if err != nil {
1554		err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsDeleteFuture", "Result", future.Response(), "Polling failure")
1555		return
1556	}
1557	if !done {
1558		ar.Response = future.Response()
1559		err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsDeleteFuture")
1560		return
1561	}
1562	ar.Response = future.Response()
1563	return
1564}
1565
1566// ServerEndpointsRecallActionFuture an abstraction for monitoring and retrieving the results of a
1567// long-running operation.
1568type ServerEndpointsRecallActionFuture struct {
1569	azure.FutureAPI
1570	// Result returns the result of the asynchronous operation.
1571	// If the operation has not completed it will return an error.
1572	Result func(ServerEndpointsClient) (autorest.Response, error)
1573}
1574
1575// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1576func (future *ServerEndpointsRecallActionFuture) UnmarshalJSON(body []byte) error {
1577	var azFuture azure.Future
1578	if err := json.Unmarshal(body, &azFuture); err != nil {
1579		return err
1580	}
1581	future.FutureAPI = &azFuture
1582	future.Result = future.result
1583	return nil
1584}
1585
1586// result is the default implementation for ServerEndpointsRecallActionFuture.Result.
1587func (future *ServerEndpointsRecallActionFuture) result(client ServerEndpointsClient) (ar autorest.Response, err error) {
1588	var done bool
1589	done, err = future.DoneWithContext(context.Background(), client)
1590	if err != nil {
1591		err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsRecallActionFuture", "Result", future.Response(), "Polling failure")
1592		return
1593	}
1594	if !done {
1595		ar.Response = future.Response()
1596		err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsRecallActionFuture")
1597		return
1598	}
1599	ar.Response = future.Response()
1600	return
1601}
1602
1603// ServerEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1604// operation.
1605type ServerEndpointsUpdateFuture struct {
1606	azure.FutureAPI
1607	// Result returns the result of the asynchronous operation.
1608	// If the operation has not completed it will return an error.
1609	Result func(ServerEndpointsClient) (ServerEndpoint, error)
1610}
1611
1612// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1613func (future *ServerEndpointsUpdateFuture) UnmarshalJSON(body []byte) error {
1614	var azFuture azure.Future
1615	if err := json.Unmarshal(body, &azFuture); err != nil {
1616		return err
1617	}
1618	future.FutureAPI = &azFuture
1619	future.Result = future.result
1620	return nil
1621}
1622
1623// result is the default implementation for ServerEndpointsUpdateFuture.Result.
1624func (future *ServerEndpointsUpdateFuture) result(client ServerEndpointsClient) (se ServerEndpoint, err error) {
1625	var done bool
1626	done, err = future.DoneWithContext(context.Background(), client)
1627	if err != nil {
1628		err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", future.Response(), "Polling failure")
1629		return
1630	}
1631	if !done {
1632		se.Response.Response = future.Response()
1633		err = azure.NewAsyncOpIncompleteError("storagesync.ServerEndpointsUpdateFuture")
1634		return
1635	}
1636	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1637	if se.Response.Response, err = future.GetResult(sender); err == nil && se.Response.Response.StatusCode != http.StatusNoContent {
1638		se, err = client.UpdateResponder(se.Response.Response)
1639		if err != nil {
1640			err = autorest.NewErrorWithError(err, "storagesync.ServerEndpointsUpdateFuture", "Result", se.Response.Response, "Failure responding to request")
1641		}
1642	}
1643	return
1644}
1645
1646// ServerEndpointSyncStatus server Endpoint sync status
1647type ServerEndpointSyncStatus struct {
1648	// DownloadHealth - READ-ONLY; Download Health Status. Possible values include: 'DownloadHealthHealthy', 'DownloadHealthError', 'DownloadHealthSyncBlockedForRestore', 'DownloadHealthSyncBlockedForChangeDetectionPostRestore', 'DownloadHealthNoActivity'
1649	DownloadHealth DownloadHealth `json:"downloadHealth,omitempty"`
1650	// UploadHealth - READ-ONLY; Upload Health Status. Possible values include: 'UploadHealthHealthy', 'UploadHealthError', 'UploadHealthSyncBlockedForRestore', 'UploadHealthSyncBlockedForChangeDetectionPostRestore', 'UploadHealthNoActivity'
1651	UploadHealth UploadHealth `json:"uploadHealth,omitempty"`
1652	// CombinedHealth - READ-ONLY; Combined Health Status. Possible values include: 'CombinedHealthHealthy', 'CombinedHealthError', 'CombinedHealthSyncBlockedForRestore', 'CombinedHealthSyncBlockedForChangeDetectionPostRestore', 'CombinedHealthNoActivity'
1653	CombinedHealth CombinedHealth `json:"combinedHealth,omitempty"`
1654	// SyncActivity - READ-ONLY; Sync activity. Possible values include: 'Upload', 'Download', 'UploadAndDownload'
1655	SyncActivity SyncActivity `json:"syncActivity,omitempty"`
1656	// TotalPersistentFilesNotSyncingCount - READ-ONLY; Total count of persistent files not syncing (combined upload + download). Reserved for future use.
1657	TotalPersistentFilesNotSyncingCount *int64 `json:"totalPersistentFilesNotSyncingCount,omitempty"`
1658	// LastUpdatedTimestamp - READ-ONLY; Last Updated Timestamp
1659	LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"`
1660	// UploadStatus - READ-ONLY; Upload Status
1661	UploadStatus *SyncSessionStatus `json:"uploadStatus,omitempty"`
1662	// DownloadStatus - READ-ONLY; Download Status
1663	DownloadStatus *SyncSessionStatus `json:"downloadStatus,omitempty"`
1664	// UploadActivity - READ-ONLY; Upload sync activity
1665	UploadActivity *SyncActivityStatus `json:"uploadActivity,omitempty"`
1666	// DownloadActivity - READ-ONLY; Download sync activity
1667	DownloadActivity *SyncActivityStatus `json:"downloadActivity,omitempty"`
1668	// OfflineDataTransferStatus - READ-ONLY; Offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete'
1669	OfflineDataTransferStatus OfflineDataTransferStatus `json:"offlineDataTransferStatus,omitempty"`
1670}
1671
1672// MarshalJSON is the custom marshaler for ServerEndpointSyncStatus.
1673func (sess ServerEndpointSyncStatus) MarshalJSON() ([]byte, error) {
1674	objectMap := make(map[string]interface{})
1675	return json.Marshal(objectMap)
1676}
1677
1678// ServerEndpointUpdateParameters parameters for updating an Server Endpoint.
1679type ServerEndpointUpdateParameters struct {
1680	// ServerEndpointUpdateProperties - The properties of the server endpoint.
1681	*ServerEndpointUpdateProperties `json:"properties,omitempty"`
1682}
1683
1684// MarshalJSON is the custom marshaler for ServerEndpointUpdateParameters.
1685func (seup ServerEndpointUpdateParameters) MarshalJSON() ([]byte, error) {
1686	objectMap := make(map[string]interface{})
1687	if seup.ServerEndpointUpdateProperties != nil {
1688		objectMap["properties"] = seup.ServerEndpointUpdateProperties
1689	}
1690	return json.Marshal(objectMap)
1691}
1692
1693// UnmarshalJSON is the custom unmarshaler for ServerEndpointUpdateParameters struct.
1694func (seup *ServerEndpointUpdateParameters) UnmarshalJSON(body []byte) error {
1695	var m map[string]*json.RawMessage
1696	err := json.Unmarshal(body, &m)
1697	if err != nil {
1698		return err
1699	}
1700	for k, v := range m {
1701		switch k {
1702		case "properties":
1703			if v != nil {
1704				var serverEndpointUpdateProperties ServerEndpointUpdateProperties
1705				err = json.Unmarshal(*v, &serverEndpointUpdateProperties)
1706				if err != nil {
1707					return err
1708				}
1709				seup.ServerEndpointUpdateProperties = &serverEndpointUpdateProperties
1710			}
1711		}
1712	}
1713
1714	return nil
1715}
1716
1717// ServerEndpointUpdateProperties serverEndpoint Update Properties object.
1718type ServerEndpointUpdateProperties struct {
1719	// CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering1On', 'CloudTiering1Off'
1720	CloudTiering CloudTiering1 `json:"cloudTiering,omitempty"`
1721	// VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled.
1722	VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"`
1723	// TierFilesOlderThanDays - Tier files older than days.
1724	TierFilesOlderThanDays *int32 `json:"tierFilesOlderThanDays,omitempty"`
1725	// OfflineDataTransfer - Offline data transfer. Possible values include: 'OfflineDataTransfer1On', 'OfflineDataTransfer1Off'
1726	OfflineDataTransfer OfflineDataTransfer1 `json:"offlineDataTransfer,omitempty"`
1727	// OfflineDataTransferShareName - Offline data transfer share name
1728	OfflineDataTransferShareName *string `json:"offlineDataTransferShareName,omitempty"`
1729}
1730
1731// Service storage Sync Service object.
1732type Service struct {
1733	autorest.Response `json:"-"`
1734	// ServiceProperties - Storage Sync Service properties.
1735	*ServiceProperties `json:"properties,omitempty"`
1736	// Tags - Resource tags.
1737	Tags map[string]*string `json:"tags"`
1738	// Location - The geo-location where the resource lives
1739	Location *string `json:"location,omitempty"`
1740	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1741	ID *string `json:"id,omitempty"`
1742	// Name - READ-ONLY; The name of the resource
1743	Name *string `json:"name,omitempty"`
1744	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1745	Type *string `json:"type,omitempty"`
1746}
1747
1748// MarshalJSON is the custom marshaler for Service.
1749func (s Service) MarshalJSON() ([]byte, error) {
1750	objectMap := make(map[string]interface{})
1751	if s.ServiceProperties != nil {
1752		objectMap["properties"] = s.ServiceProperties
1753	}
1754	if s.Tags != nil {
1755		objectMap["tags"] = s.Tags
1756	}
1757	if s.Location != nil {
1758		objectMap["location"] = s.Location
1759	}
1760	return json.Marshal(objectMap)
1761}
1762
1763// UnmarshalJSON is the custom unmarshaler for Service struct.
1764func (s *Service) UnmarshalJSON(body []byte) error {
1765	var m map[string]*json.RawMessage
1766	err := json.Unmarshal(body, &m)
1767	if err != nil {
1768		return err
1769	}
1770	for k, v := range m {
1771		switch k {
1772		case "properties":
1773			if v != nil {
1774				var serviceProperties ServiceProperties
1775				err = json.Unmarshal(*v, &serviceProperties)
1776				if err != nil {
1777					return err
1778				}
1779				s.ServiceProperties = &serviceProperties
1780			}
1781		case "tags":
1782			if v != nil {
1783				var tags map[string]*string
1784				err = json.Unmarshal(*v, &tags)
1785				if err != nil {
1786					return err
1787				}
1788				s.Tags = tags
1789			}
1790		case "location":
1791			if v != nil {
1792				var location string
1793				err = json.Unmarshal(*v, &location)
1794				if err != nil {
1795					return err
1796				}
1797				s.Location = &location
1798			}
1799		case "id":
1800			if v != nil {
1801				var ID string
1802				err = json.Unmarshal(*v, &ID)
1803				if err != nil {
1804					return err
1805				}
1806				s.ID = &ID
1807			}
1808		case "name":
1809			if v != nil {
1810				var name string
1811				err = json.Unmarshal(*v, &name)
1812				if err != nil {
1813					return err
1814				}
1815				s.Name = &name
1816			}
1817		case "type":
1818			if v != nil {
1819				var typeVar string
1820				err = json.Unmarshal(*v, &typeVar)
1821				if err != nil {
1822					return err
1823				}
1824				s.Type = &typeVar
1825			}
1826		}
1827	}
1828
1829	return nil
1830}
1831
1832// ServiceArray array of StorageSyncServices
1833type ServiceArray struct {
1834	autorest.Response `json:"-"`
1835	// Value - Collection of StorageSyncServices.
1836	Value *[]Service `json:"value,omitempty"`
1837}
1838
1839// ServiceCreateParameters the parameters used when creating a storage sync service.
1840type ServiceCreateParameters struct {
1841	// Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.
1842	Location *string `json:"location,omitempty"`
1843	// Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.
1844	Tags       map[string]*string `json:"tags"`
1845	Properties interface{}        `json:"properties,omitempty"`
1846}
1847
1848// MarshalJSON is the custom marshaler for ServiceCreateParameters.
1849func (scp ServiceCreateParameters) MarshalJSON() ([]byte, error) {
1850	objectMap := make(map[string]interface{})
1851	if scp.Location != nil {
1852		objectMap["location"] = scp.Location
1853	}
1854	if scp.Tags != nil {
1855		objectMap["tags"] = scp.Tags
1856	}
1857	if scp.Properties != nil {
1858		objectMap["properties"] = scp.Properties
1859	}
1860	return json.Marshal(objectMap)
1861}
1862
1863// ServiceProperties storage Sync Service Properties object.
1864type ServiceProperties struct {
1865	// StorageSyncServiceStatus - READ-ONLY; Storage Sync service status.
1866	StorageSyncServiceStatus *int32 `json:"storageSyncServiceStatus,omitempty"`
1867	// StorageSyncServiceUID - READ-ONLY; Storage Sync service Uid
1868	StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"`
1869}
1870
1871// MarshalJSON is the custom marshaler for ServiceProperties.
1872func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
1873	objectMap := make(map[string]interface{})
1874	return json.Marshal(objectMap)
1875}
1876
1877// ServiceUpdateParameters parameters for updating an Storage sync service.
1878type ServiceUpdateParameters struct {
1879	// Tags - The user-specified tags associated with the storage sync service.
1880	Tags map[string]*string `json:"tags"`
1881	// Properties - The properties of the storage sync service.
1882	Properties interface{} `json:"properties,omitempty"`
1883}
1884
1885// MarshalJSON is the custom marshaler for ServiceUpdateParameters.
1886func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) {
1887	objectMap := make(map[string]interface{})
1888	if sup.Tags != nil {
1889		objectMap["tags"] = sup.Tags
1890	}
1891	if sup.Properties != nil {
1892		objectMap["properties"] = sup.Properties
1893	}
1894	return json.Marshal(objectMap)
1895}
1896
1897// SubscriptionState subscription State object.
1898type SubscriptionState struct {
1899	// State - State of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted'
1900	State Reason `json:"state,omitempty"`
1901	// Istransitioning - READ-ONLY; Is Transitioning
1902	Istransitioning *bool `json:"istransitioning,omitempty"`
1903	// Properties - Subscription state properties.
1904	Properties interface{} `json:"properties,omitempty"`
1905}
1906
1907// MarshalJSON is the custom marshaler for SubscriptionState.
1908func (ss SubscriptionState) MarshalJSON() ([]byte, error) {
1909	objectMap := make(map[string]interface{})
1910	if ss.State != "" {
1911		objectMap["state"] = ss.State
1912	}
1913	if ss.Properties != nil {
1914		objectMap["properties"] = ss.Properties
1915	}
1916	return json.Marshal(objectMap)
1917}
1918
1919// SyncActivityStatus sync Session status object.
1920type SyncActivityStatus struct {
1921	// Timestamp - READ-ONLY; Timestamp when properties were updated
1922	Timestamp *date.Time `json:"timestamp,omitempty"`
1923	// PerItemErrorCount - READ-ONLY; Per item error count
1924	PerItemErrorCount *int64 `json:"perItemErrorCount,omitempty"`
1925	// AppliedItemCount - READ-ONLY; Applied item count.
1926	AppliedItemCount *int64 `json:"appliedItemCount,omitempty"`
1927	// TotalItemCount - READ-ONLY; Total item count (if available)
1928	TotalItemCount *int64 `json:"totalItemCount,omitempty"`
1929	// AppliedBytes - READ-ONLY; Applied bytes
1930	AppliedBytes *int64 `json:"appliedBytes,omitempty"`
1931	// TotalBytes - READ-ONLY; Total bytes (if available)
1932	TotalBytes *int64 `json:"totalBytes,omitempty"`
1933}
1934
1935// MarshalJSON is the custom marshaler for SyncActivityStatus.
1936func (sas SyncActivityStatus) MarshalJSON() ([]byte, error) {
1937	objectMap := make(map[string]interface{})
1938	return json.Marshal(objectMap)
1939}
1940
1941// SyncGroup sync Group object.
1942type SyncGroup struct {
1943	autorest.Response `json:"-"`
1944	// SyncGroupProperties - SyncGroup properties.
1945	*SyncGroupProperties `json:"properties,omitempty"`
1946	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1947	ID *string `json:"id,omitempty"`
1948	// Name - READ-ONLY; The name of the resource
1949	Name *string `json:"name,omitempty"`
1950	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1951	Type *string `json:"type,omitempty"`
1952}
1953
1954// MarshalJSON is the custom marshaler for SyncGroup.
1955func (sg SyncGroup) MarshalJSON() ([]byte, error) {
1956	objectMap := make(map[string]interface{})
1957	if sg.SyncGroupProperties != nil {
1958		objectMap["properties"] = sg.SyncGroupProperties
1959	}
1960	return json.Marshal(objectMap)
1961}
1962
1963// UnmarshalJSON is the custom unmarshaler for SyncGroup struct.
1964func (sg *SyncGroup) UnmarshalJSON(body []byte) error {
1965	var m map[string]*json.RawMessage
1966	err := json.Unmarshal(body, &m)
1967	if err != nil {
1968		return err
1969	}
1970	for k, v := range m {
1971		switch k {
1972		case "properties":
1973			if v != nil {
1974				var syncGroupProperties SyncGroupProperties
1975				err = json.Unmarshal(*v, &syncGroupProperties)
1976				if err != nil {
1977					return err
1978				}
1979				sg.SyncGroupProperties = &syncGroupProperties
1980			}
1981		case "id":
1982			if v != nil {
1983				var ID string
1984				err = json.Unmarshal(*v, &ID)
1985				if err != nil {
1986					return err
1987				}
1988				sg.ID = &ID
1989			}
1990		case "name":
1991			if v != nil {
1992				var name string
1993				err = json.Unmarshal(*v, &name)
1994				if err != nil {
1995					return err
1996				}
1997				sg.Name = &name
1998			}
1999		case "type":
2000			if v != nil {
2001				var typeVar string
2002				err = json.Unmarshal(*v, &typeVar)
2003				if err != nil {
2004					return err
2005				}
2006				sg.Type = &typeVar
2007			}
2008		}
2009	}
2010
2011	return nil
2012}
2013
2014// SyncGroupArray array of SyncGroup
2015type SyncGroupArray struct {
2016	autorest.Response `json:"-"`
2017	// Value - Collection of SyncGroup.
2018	Value *[]SyncGroup `json:"value,omitempty"`
2019}
2020
2021// SyncGroupCreateParameters the parameters used when creating a sync group.
2022type SyncGroupCreateParameters struct {
2023	// Properties - The parameters used to create the sync group
2024	Properties interface{} `json:"properties,omitempty"`
2025	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2026	ID *string `json:"id,omitempty"`
2027	// Name - READ-ONLY; The name of the resource
2028	Name *string `json:"name,omitempty"`
2029	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2030	Type *string `json:"type,omitempty"`
2031}
2032
2033// MarshalJSON is the custom marshaler for SyncGroupCreateParameters.
2034func (sgcp SyncGroupCreateParameters) MarshalJSON() ([]byte, error) {
2035	objectMap := make(map[string]interface{})
2036	if sgcp.Properties != nil {
2037		objectMap["properties"] = sgcp.Properties
2038	}
2039	return json.Marshal(objectMap)
2040}
2041
2042// SyncGroupProperties syncGroup Properties object.
2043type SyncGroupProperties struct {
2044	// UniqueID - Unique Id
2045	UniqueID *string `json:"uniqueId,omitempty"`
2046	// SyncGroupStatus - READ-ONLY; Sync group status
2047	SyncGroupStatus *string `json:"syncGroupStatus,omitempty"`
2048}
2049
2050// MarshalJSON is the custom marshaler for SyncGroupProperties.
2051func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) {
2052	objectMap := make(map[string]interface{})
2053	if sgp.UniqueID != nil {
2054		objectMap["uniqueId"] = sgp.UniqueID
2055	}
2056	return json.Marshal(objectMap)
2057}
2058
2059// SyncSessionStatus sync Session status object.
2060type SyncSessionStatus struct {
2061	// LastSyncResult - READ-ONLY; Last sync result (HResult)
2062	LastSyncResult *int32 `json:"lastSyncResult,omitempty"`
2063	// LastSyncTimestamp - READ-ONLY; Last sync timestamp
2064	LastSyncTimestamp *date.Time `json:"lastSyncTimestamp,omitempty"`
2065	// LastSyncSuccessTimestamp - READ-ONLY; Last sync success timestamp
2066	LastSyncSuccessTimestamp *date.Time `json:"lastSyncSuccessTimestamp,omitempty"`
2067	// LastSyncPerItemErrorCount - READ-ONLY; Last sync per item error count.
2068	LastSyncPerItemErrorCount *int64 `json:"lastSyncPerItemErrorCount,omitempty"`
2069	// PersistentFilesNotSyncingCount - READ-ONLY; Count of persistent files not syncing. Reserved for future use.
2070	PersistentFilesNotSyncingCount *int64 `json:"persistentFilesNotSyncingCount,omitempty"`
2071	// TransientFilesNotSyncingCount - READ-ONLY; Count of transient files not syncing. Reserved for future use.
2072	TransientFilesNotSyncingCount *int64 `json:"transientFilesNotSyncingCount,omitempty"`
2073	// FilesNotSyncingErrors - READ-ONLY; Array of per-item errors coming from the last sync session. Reserved for future use.
2074	FilesNotSyncingErrors *[]FilesNotSyncingError `json:"filesNotSyncingErrors,omitempty"`
2075}
2076
2077// MarshalJSON is the custom marshaler for SyncSessionStatus.
2078func (sss SyncSessionStatus) MarshalJSON() ([]byte, error) {
2079	objectMap := make(map[string]interface{})
2080	return json.Marshal(objectMap)
2081}
2082
2083// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
2084// which has 'tags' and a 'location'
2085type TrackedResource struct {
2086	// Tags - Resource tags.
2087	Tags map[string]*string `json:"tags"`
2088	// Location - The geo-location where the resource lives
2089	Location *string `json:"location,omitempty"`
2090	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2091	ID *string `json:"id,omitempty"`
2092	// Name - READ-ONLY; The name of the resource
2093	Name *string `json:"name,omitempty"`
2094	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2095	Type *string `json:"type,omitempty"`
2096}
2097
2098// MarshalJSON is the custom marshaler for TrackedResource.
2099func (tr TrackedResource) MarshalJSON() ([]byte, error) {
2100	objectMap := make(map[string]interface{})
2101	if tr.Tags != nil {
2102		objectMap["tags"] = tr.Tags
2103	}
2104	if tr.Location != nil {
2105		objectMap["location"] = tr.Location
2106	}
2107	return json.Marshal(objectMap)
2108}
2109
2110// TriggerRolloverRequest trigger Rollover Request.
2111type TriggerRolloverRequest struct {
2112	// ServerCertificate - Certificate Data
2113	ServerCertificate *string `json:"serverCertificate,omitempty"`
2114}
2115
2116// Workflow workflow resource.
2117type Workflow struct {
2118	autorest.Response `json:"-"`
2119	// WorkflowProperties - Workflow properties.
2120	*WorkflowProperties `json:"properties,omitempty"`
2121	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2122	ID *string `json:"id,omitempty"`
2123	// Name - READ-ONLY; The name of the resource
2124	Name *string `json:"name,omitempty"`
2125	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2126	Type *string `json:"type,omitempty"`
2127}
2128
2129// MarshalJSON is the custom marshaler for Workflow.
2130func (w Workflow) MarshalJSON() ([]byte, error) {
2131	objectMap := make(map[string]interface{})
2132	if w.WorkflowProperties != nil {
2133		objectMap["properties"] = w.WorkflowProperties
2134	}
2135	return json.Marshal(objectMap)
2136}
2137
2138// UnmarshalJSON is the custom unmarshaler for Workflow struct.
2139func (w *Workflow) UnmarshalJSON(body []byte) error {
2140	var m map[string]*json.RawMessage
2141	err := json.Unmarshal(body, &m)
2142	if err != nil {
2143		return err
2144	}
2145	for k, v := range m {
2146		switch k {
2147		case "properties":
2148			if v != nil {
2149				var workflowProperties WorkflowProperties
2150				err = json.Unmarshal(*v, &workflowProperties)
2151				if err != nil {
2152					return err
2153				}
2154				w.WorkflowProperties = &workflowProperties
2155			}
2156		case "id":
2157			if v != nil {
2158				var ID string
2159				err = json.Unmarshal(*v, &ID)
2160				if err != nil {
2161					return err
2162				}
2163				w.ID = &ID
2164			}
2165		case "name":
2166			if v != nil {
2167				var name string
2168				err = json.Unmarshal(*v, &name)
2169				if err != nil {
2170					return err
2171				}
2172				w.Name = &name
2173			}
2174		case "type":
2175			if v != nil {
2176				var typeVar string
2177				err = json.Unmarshal(*v, &typeVar)
2178				if err != nil {
2179					return err
2180				}
2181				w.Type = &typeVar
2182			}
2183		}
2184	}
2185
2186	return nil
2187}
2188
2189// WorkflowArray array of Workflow
2190type WorkflowArray struct {
2191	autorest.Response `json:"-"`
2192	// Value - Collection of workflow items.
2193	Value *[]Workflow `json:"value,omitempty"`
2194}
2195
2196// WorkflowProperties workflow Properties object.
2197type WorkflowProperties struct {
2198	// LastStepName - last step name
2199	LastStepName *string `json:"lastStepName,omitempty"`
2200	// Status - workflow status. Possible values include: 'Active', 'Expired', 'Succeeded', 'Aborted', 'Failed'
2201	Status Status `json:"status,omitempty"`
2202	// Operation - operation direction. Possible values include: 'Do', 'Undo', 'Cancel'
2203	Operation Operation `json:"operation,omitempty"`
2204	// Steps - workflow steps
2205	Steps *string `json:"steps,omitempty"`
2206	// LastOperationID - workflow last operation identifier.
2207	LastOperationID *string `json:"lastOperationId,omitempty"`
2208}
2209