1package storagesync
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"encoding/json"
23	"github.com/Azure/go-autorest/autorest"
24	"github.com/Azure/go-autorest/autorest/azure"
25	"github.com/Azure/go-autorest/autorest/to"
26	"github.com/Azure/go-autorest/tracing"
27	"net/http"
28)
29
30// The package's fully qualified name.
31const fqdn = "github.com/Azure/azure-sdk-for-go/services/storagesync/mgmt/2018-04-02/storagesync"
32
33// APIError error type
34type APIError struct {
35	// Code - Error code of the given entry.
36	Code *string `json:"code,omitempty"`
37	// Message - Error message of the given entry.
38	Message *string `json:"message,omitempty"`
39	// Target - Target of the given error entry.
40	Target *string `json:"target,omitempty"`
41	// Details - Error details of the given entry.
42	Details *ErrorDetails `json:"details,omitempty"`
43}
44
45// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
46type AzureEntityResource struct {
47	// Etag - READ-ONLY; Resource Etag.
48	Etag *string `json:"etag,omitempty"`
49	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
50	ID *string `json:"id,omitempty"`
51	// Name - READ-ONLY; The name of the resource
52	Name *string `json:"name,omitempty"`
53	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
54	Type *string `json:"type,omitempty"`
55}
56
57// BackupRequest backup request
58type BackupRequest struct {
59	// AzureFileShare - Azure File Share.
60	AzureFileShare *string `json:"azureFileShare,omitempty"`
61}
62
63// CheckNameAvailabilityParameters parameters for a check name availability request.
64type CheckNameAvailabilityParameters struct {
65	// Name - The name to check for availability
66	Name *string `json:"name,omitempty"`
67	// Type - The resource type. Must be set to Microsoft.StorageSync/storageSyncServices
68	Type *string `json:"type,omitempty"`
69}
70
71// CheckNameAvailabilityResult the CheckNameAvailability operation response.
72type CheckNameAvailabilityResult struct {
73	autorest.Response `json:"-"`
74	// 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.
75	NameAvailable *bool `json:"nameAvailable,omitempty"`
76	// 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'
77	Reason NameAvailabilityReason `json:"reason,omitempty"`
78	// Message - READ-ONLY; Gets an error message explaining the Reason value in more detail.
79	Message *string `json:"message,omitempty"`
80}
81
82// CloudEndpoint cloud Endpoint object.
83type CloudEndpoint struct {
84	autorest.Response `json:"-"`
85	// CloudEndpointProperties - Cloud Endpoint properties.
86	*CloudEndpointProperties `json:"properties,omitempty"`
87	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
88	ID *string `json:"id,omitempty"`
89	// Name - READ-ONLY; The name of the resource
90	Name *string `json:"name,omitempty"`
91	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
92	Type *string `json:"type,omitempty"`
93}
94
95// MarshalJSON is the custom marshaler for CloudEndpoint.
96func (ce CloudEndpoint) MarshalJSON() ([]byte, error) {
97	objectMap := make(map[string]interface{})
98	if ce.CloudEndpointProperties != nil {
99		objectMap["properties"] = ce.CloudEndpointProperties
100	}
101	return json.Marshal(objectMap)
102}
103
104// UnmarshalJSON is the custom unmarshaler for CloudEndpoint struct.
105func (ce *CloudEndpoint) UnmarshalJSON(body []byte) error {
106	var m map[string]*json.RawMessage
107	err := json.Unmarshal(body, &m)
108	if err != nil {
109		return err
110	}
111	for k, v := range m {
112		switch k {
113		case "properties":
114			if v != nil {
115				var cloudEndpointProperties CloudEndpointProperties
116				err = json.Unmarshal(*v, &cloudEndpointProperties)
117				if err != nil {
118					return err
119				}
120				ce.CloudEndpointProperties = &cloudEndpointProperties
121			}
122		case "id":
123			if v != nil {
124				var ID string
125				err = json.Unmarshal(*v, &ID)
126				if err != nil {
127					return err
128				}
129				ce.ID = &ID
130			}
131		case "name":
132			if v != nil {
133				var name string
134				err = json.Unmarshal(*v, &name)
135				if err != nil {
136					return err
137				}
138				ce.Name = &name
139			}
140		case "type":
141			if v != nil {
142				var typeVar string
143				err = json.Unmarshal(*v, &typeVar)
144				if err != nil {
145					return err
146				}
147				ce.Type = &typeVar
148			}
149		}
150	}
151
152	return nil
153}
154
155// CloudEndpointArray array of CloudEndpoint
156type CloudEndpointArray struct {
157	autorest.Response `json:"-"`
158	// Value - Collection of CloudEndpoint.
159	Value *[]CloudEndpoint `json:"value,omitempty"`
160}
161
162// CloudEndpointCreateParameters the parameters used when creating a storage sync service.
163type CloudEndpointCreateParameters struct {
164	// 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.
165	Location *string `json:"location,omitempty"`
166	// 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.
167	Tags map[string]*string `json:"tags"`
168	// CloudEndpointCreateParametersProperties - The parameters used to create the storage sync service.
169	*CloudEndpointCreateParametersProperties `json:"properties,omitempty"`
170}
171
172// MarshalJSON is the custom marshaler for CloudEndpointCreateParameters.
173func (cecp CloudEndpointCreateParameters) MarshalJSON() ([]byte, error) {
174	objectMap := make(map[string]interface{})
175	if cecp.Location != nil {
176		objectMap["location"] = cecp.Location
177	}
178	if cecp.Tags != nil {
179		objectMap["tags"] = cecp.Tags
180	}
181	if cecp.CloudEndpointCreateParametersProperties != nil {
182		objectMap["properties"] = cecp.CloudEndpointCreateParametersProperties
183	}
184	return json.Marshal(objectMap)
185}
186
187// UnmarshalJSON is the custom unmarshaler for CloudEndpointCreateParameters struct.
188func (cecp *CloudEndpointCreateParameters) UnmarshalJSON(body []byte) error {
189	var m map[string]*json.RawMessage
190	err := json.Unmarshal(body, &m)
191	if err != nil {
192		return err
193	}
194	for k, v := range m {
195		switch k {
196		case "location":
197			if v != nil {
198				var location string
199				err = json.Unmarshal(*v, &location)
200				if err != nil {
201					return err
202				}
203				cecp.Location = &location
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				cecp.Tags = tags
213			}
214		case "properties":
215			if v != nil {
216				var cloudEndpointCreateParametersProperties CloudEndpointCreateParametersProperties
217				err = json.Unmarshal(*v, &cloudEndpointCreateParametersProperties)
218				if err != nil {
219					return err
220				}
221				cecp.CloudEndpointCreateParametersProperties = &cloudEndpointCreateParametersProperties
222			}
223		}
224	}
225
226	return nil
227}
228
229// CloudEndpointCreateParametersProperties cloudEndpoint Properties object.
230type CloudEndpointCreateParametersProperties struct {
231	// StorageAccountResourceID - Storage Account Resource Id
232	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
233	// StorageAccountShareName - Storage Account Share name
234	StorageAccountShareName *string `json:"storageAccountShareName,omitempty"`
235	// StorageAccountTenantID - Storage Account Tenant Id
236	StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"`
237}
238
239// CloudEndpointProperties cloudEndpoint Properties object.
240type CloudEndpointProperties struct {
241	// StorageAccountResourceID - Storage Account Resource Id
242	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
243	// StorageAccountShareName - Storage Account Share name
244	StorageAccountShareName *string `json:"storageAccountShareName,omitempty"`
245	// StorageAccountTenantID - Storage Account Tenant Id
246	StorageAccountTenantID *string `json:"storageAccountTenantId,omitempty"`
247	// PartnershipID - Partnership Id
248	PartnershipID *string `json:"partnershipId,omitempty"`
249	// FriendlyName - Friendly Name
250	FriendlyName *string `json:"friendlyName,omitempty"`
251	// BackupEnabled - READ-ONLY; Backup Enabled
252	BackupEnabled *bool `json:"backupEnabled,omitempty"`
253	// ProvisioningState - CloudEndpoint Provisioning State
254	ProvisioningState *string `json:"provisioningState,omitempty"`
255	// LastWorkflowID - CloudEndpoint lastWorkflowId
256	LastWorkflowID *string `json:"lastWorkflowId,omitempty"`
257	// LastOperationName - Resource Last Operation Name
258	LastOperationName *string `json:"lastOperationName,omitempty"`
259}
260
261// MarshalJSON is the custom marshaler for CloudEndpointProperties.
262func (cep CloudEndpointProperties) MarshalJSON() ([]byte, error) {
263	objectMap := make(map[string]interface{})
264	if cep.StorageAccountResourceID != nil {
265		objectMap["storageAccountResourceId"] = cep.StorageAccountResourceID
266	}
267	if cep.StorageAccountShareName != nil {
268		objectMap["storageAccountShareName"] = cep.StorageAccountShareName
269	}
270	if cep.StorageAccountTenantID != nil {
271		objectMap["storageAccountTenantId"] = cep.StorageAccountTenantID
272	}
273	if cep.PartnershipID != nil {
274		objectMap["partnershipId"] = cep.PartnershipID
275	}
276	if cep.FriendlyName != nil {
277		objectMap["friendlyName"] = cep.FriendlyName
278	}
279	if cep.ProvisioningState != nil {
280		objectMap["provisioningState"] = cep.ProvisioningState
281	}
282	if cep.LastWorkflowID != nil {
283		objectMap["lastWorkflowId"] = cep.LastWorkflowID
284	}
285	if cep.LastOperationName != nil {
286		objectMap["lastOperationName"] = cep.LastOperationName
287	}
288	return json.Marshal(objectMap)
289}
290
291// CloudEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
292// operation.
293type CloudEndpointsCreateFuture struct {
294	azure.FutureAPI
295	// Result returns the result of the asynchronous operation.
296	// If the operation has not completed it will return an error.
297	Result func(CloudEndpointsClient) (CloudEndpoint, error)
298}
299
300// CloudEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
301// operation.
302type CloudEndpointsDeleteFuture struct {
303	azure.FutureAPI
304	// Result returns the result of the asynchronous operation.
305	// If the operation has not completed it will return an error.
306	Result func(CloudEndpointsClient) (autorest.Response, error)
307}
308
309// CloudEndpointsPostBackupFuture an abstraction for monitoring and retrieving the results of a
310// long-running operation.
311type CloudEndpointsPostBackupFuture struct {
312	azure.FutureAPI
313	// Result returns the result of the asynchronous operation.
314	// If the operation has not completed it will return an error.
315	Result func(CloudEndpointsClient) (PostBackupResponse, error)
316}
317
318// CloudEndpointsPostRestoreFuture an abstraction for monitoring and retrieving the results of a
319// long-running operation.
320type CloudEndpointsPostRestoreFuture struct {
321	azure.FutureAPI
322	// Result returns the result of the asynchronous operation.
323	// If the operation has not completed it will return an error.
324	Result func(CloudEndpointsClient) (autorest.Response, error)
325}
326
327// CloudEndpointsPreBackupFuture an abstraction for monitoring and retrieving the results of a long-running
328// operation.
329type CloudEndpointsPreBackupFuture struct {
330	azure.FutureAPI
331	// Result returns the result of the asynchronous operation.
332	// If the operation has not completed it will return an error.
333	Result func(CloudEndpointsClient) (autorest.Response, error)
334}
335
336// CloudEndpointsPreRestoreFuture an abstraction for monitoring and retrieving the results of a
337// long-running operation.
338type CloudEndpointsPreRestoreFuture struct {
339	azure.FutureAPI
340	// Result returns the result of the asynchronous operation.
341	// If the operation has not completed it will return an error.
342	Result func(CloudEndpointsClient) (autorest.Response, error)
343}
344
345// Error error type
346type Error struct {
347	// Error - Error details of the given entry.
348	Error *APIError `json:"error,omitempty"`
349	// Innererror - Error details of the given entry.
350	Innererror *APIError `json:"innererror,omitempty"`
351}
352
353// ErrorDetails error Details object.
354type ErrorDetails struct {
355	// Code - Error code of the given entry.
356	Code *string `json:"code,omitempty"`
357	// Message - Error message of the given entry.
358	Message *string `json:"message,omitempty"`
359	// Target - Target of the given entry.
360	Target *string `json:"target,omitempty"`
361}
362
363// OperationDisplayInfo the operation supported by storage sync.
364type OperationDisplayInfo struct {
365	// Description - The description of the operation.
366	Description *string `json:"description,omitempty"`
367	// Operation - The action that users can perform, based on their permission level.
368	Operation *string `json:"operation,omitempty"`
369	// Provider - Service provider: Microsoft StorageSync.
370	Provider *string `json:"provider,omitempty"`
371	// Resource - Resource on which the operation is performed.
372	Resource *string `json:"resource,omitempty"`
373}
374
375// OperationDisplayResource operation Display Resource object.
376type OperationDisplayResource struct {
377	// Provider - Operation Display Resource Provider.
378	Provider *string `json:"provider,omitempty"`
379	// Resource - Operation Display Resource.
380	Resource *string `json:"resource,omitempty"`
381	// Operation - Operation Display Resource Operation.
382	Operation *string `json:"operation,omitempty"`
383	// Description - Operation Display Resource Description.
384	Description *string `json:"description,omitempty"`
385}
386
387// OperationEntity the operation supported by storage sync.
388type OperationEntity struct {
389	// Name - Operation name: {provider}/{resource}/{operation}.
390	Name *string `json:"name,omitempty"`
391	// Display - The operation supported by storage sync.
392	Display *OperationDisplayInfo `json:"display,omitempty"`
393	// Origin - The origin.
394	Origin *string `json:"origin,omitempty"`
395}
396
397// OperationEntityListResult the list of storage sync operations.
398type OperationEntityListResult struct {
399	autorest.Response `json:"-"`
400	// NextLink - The link used to get the next page of operations.
401	NextLink *string `json:"nextLink,omitempty"`
402	// Value - The list of operations.
403	Value *[]OperationEntity `json:"value,omitempty"`
404}
405
406// OperationEntityListResultIterator provides access to a complete listing of OperationEntity values.
407type OperationEntityListResultIterator struct {
408	i    int
409	page OperationEntityListResultPage
410}
411
412// NextWithContext advances to the next value.  If there was an error making
413// the request the iterator does not advance and the error is returned.
414func (iter *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) {
415	if tracing.IsEnabled() {
416		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.NextWithContext")
417		defer func() {
418			sc := -1
419			if iter.Response().Response.Response != nil {
420				sc = iter.Response().Response.Response.StatusCode
421			}
422			tracing.EndSpan(ctx, sc, err)
423		}()
424	}
425	iter.i++
426	if iter.i < len(iter.page.Values()) {
427		return nil
428	}
429	err = iter.page.NextWithContext(ctx)
430	if err != nil {
431		iter.i--
432		return err
433	}
434	iter.i = 0
435	return nil
436}
437
438// Next advances to the next value.  If there was an error making
439// the request the iterator does not advance and the error is returned.
440// Deprecated: Use NextWithContext() instead.
441func (iter *OperationEntityListResultIterator) Next() error {
442	return iter.NextWithContext(context.Background())
443}
444
445// NotDone returns true if the enumeration should be started or is not yet complete.
446func (iter OperationEntityListResultIterator) NotDone() bool {
447	return iter.page.NotDone() && iter.i < len(iter.page.Values())
448}
449
450// Response returns the raw server response from the last page request.
451func (iter OperationEntityListResultIterator) Response() OperationEntityListResult {
452	return iter.page.Response()
453}
454
455// Value returns the current value or a zero-initialized value if the
456// iterator has advanced beyond the end of the collection.
457func (iter OperationEntityListResultIterator) Value() OperationEntity {
458	if !iter.page.NotDone() {
459		return OperationEntity{}
460	}
461	return iter.page.Values()[iter.i]
462}
463
464// Creates a new instance of the OperationEntityListResultIterator type.
465func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator {
466	return OperationEntityListResultIterator{page: page}
467}
468
469// IsEmpty returns true if the ListResult contains no values.
470func (oelr OperationEntityListResult) IsEmpty() bool {
471	return oelr.Value == nil || len(*oelr.Value) == 0
472}
473
474// hasNextLink returns true if the NextLink is not empty.
475func (oelr OperationEntityListResult) hasNextLink() bool {
476	return oelr.NextLink != nil && len(*oelr.NextLink) != 0
477}
478
479// operationEntityListResultPreparer prepares a request to retrieve the next set of results.
480// It returns nil if no more results exist.
481func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) {
482	if !oelr.hasNextLink() {
483		return nil, nil
484	}
485	return autorest.Prepare((&http.Request{}).WithContext(ctx),
486		autorest.AsJSON(),
487		autorest.AsGet(),
488		autorest.WithBaseURL(to.String(oelr.NextLink)))
489}
490
491// OperationEntityListResultPage contains a page of OperationEntity values.
492type OperationEntityListResultPage struct {
493	fn   func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)
494	oelr OperationEntityListResult
495}
496
497// NextWithContext advances to the next page of values.  If there was an error making
498// the request the page does not advance and the error is returned.
499func (page *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) {
500	if tracing.IsEnabled() {
501		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext")
502		defer func() {
503			sc := -1
504			if page.Response().Response.Response != nil {
505				sc = page.Response().Response.Response.StatusCode
506			}
507			tracing.EndSpan(ctx, sc, err)
508		}()
509	}
510	for {
511		next, err := page.fn(ctx, page.oelr)
512		if err != nil {
513			return err
514		}
515		page.oelr = next
516		if !next.hasNextLink() || !next.IsEmpty() {
517			break
518		}
519	}
520	return nil
521}
522
523// Next advances to the next page of values.  If there was an error making
524// the request the page does not advance and the error is returned.
525// Deprecated: Use NextWithContext() instead.
526func (page *OperationEntityListResultPage) Next() error {
527	return page.NextWithContext(context.Background())
528}
529
530// NotDone returns true if the page enumeration should be started or is not yet complete.
531func (page OperationEntityListResultPage) NotDone() bool {
532	return !page.oelr.IsEmpty()
533}
534
535// Response returns the raw server response from the last page request.
536func (page OperationEntityListResultPage) Response() OperationEntityListResult {
537	return page.oelr
538}
539
540// Values returns the slice of values for the current page or nil if there are no values.
541func (page OperationEntityListResultPage) Values() []OperationEntity {
542	if page.oelr.IsEmpty() {
543		return nil
544	}
545	return *page.oelr.Value
546}
547
548// Creates a new instance of the OperationEntityListResultPage type.
549func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage {
550	return OperationEntityListResultPage{
551		fn:   getNextPage,
552		oelr: cur,
553	}
554}
555
556// PostBackupResponse post Backup Response
557type PostBackupResponse struct {
558	autorest.Response `json:"-"`
559	// PostBackupResponseProperties - Post Backup Response Properties
560	*PostBackupResponseProperties `json:"backupMetadata,omitempty"`
561}
562
563// MarshalJSON is the custom marshaler for PostBackupResponse.
564func (pbr PostBackupResponse) MarshalJSON() ([]byte, error) {
565	objectMap := make(map[string]interface{})
566	if pbr.PostBackupResponseProperties != nil {
567		objectMap["backupMetadata"] = pbr.PostBackupResponseProperties
568	}
569	return json.Marshal(objectMap)
570}
571
572// UnmarshalJSON is the custom unmarshaler for PostBackupResponse struct.
573func (pbr *PostBackupResponse) UnmarshalJSON(body []byte) error {
574	var m map[string]*json.RawMessage
575	err := json.Unmarshal(body, &m)
576	if err != nil {
577		return err
578	}
579	for k, v := range m {
580		switch k {
581		case "backupMetadata":
582			if v != nil {
583				var postBackupResponseProperties PostBackupResponseProperties
584				err = json.Unmarshal(*v, &postBackupResponseProperties)
585				if err != nil {
586					return err
587				}
588				pbr.PostBackupResponseProperties = &postBackupResponseProperties
589			}
590		}
591	}
592
593	return nil
594}
595
596// PostBackupResponseProperties post Backup Response Properties object.
597type PostBackupResponseProperties struct {
598	// CloudEndpointName - READ-ONLY; cloud endpoint Name.
599	CloudEndpointName *string `json:"cloudEndpointName,omitempty"`
600}
601
602// PostRestoreRequest post Restore Request
603type PostRestoreRequest struct {
604	// Partition - Post Restore partition.
605	Partition *string `json:"partition,omitempty"`
606	// ReplicaGroup - Post Restore replica group.
607	ReplicaGroup *string `json:"replicaGroup,omitempty"`
608	// RequestID - Post Restore request id.
609	RequestID *string `json:"requestId,omitempty"`
610	// AzureFileShareURI - Post Restore Azure file share uri.
611	AzureFileShareURI *string `json:"azureFileShareUri,omitempty"`
612	// Status - Post Restore Azure status.
613	Status *string `json:"status,omitempty"`
614	// SourceAzureFileShareURI - Post Restore Azure source azure file share uri.
615	SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"`
616	// FailedFileList - Post Restore Azure failed file list.
617	FailedFileList *string `json:"failedFileList,omitempty"`
618	// RestoreFileSpec - Post Restore restore file spec array.
619	RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"`
620}
621
622// PreRestoreRequest pre Restore request object.
623type PreRestoreRequest struct {
624	// Partition - Pre Restore partition.
625	Partition *string `json:"partition,omitempty"`
626	// ReplicaGroup - Pre Restore replica group.
627	ReplicaGroup *string `json:"replicaGroup,omitempty"`
628	// RequestID - Pre Restore request id.
629	RequestID *string `json:"requestId,omitempty"`
630	// AzureFileShareURI - Pre Restore Azure file share uri.
631	AzureFileShareURI *string `json:"azureFileShareUri,omitempty"`
632	// Status - Pre Restore Azure status.
633	Status *string `json:"status,omitempty"`
634	// SourceAzureFileShareURI - Pre Restore Azure source azure file share uri.
635	SourceAzureFileShareURI *string `json:"sourceAzureFileShareUri,omitempty"`
636	// BackupMetadataPropertyBag - Pre Restore backup metadata property bag.
637	BackupMetadataPropertyBag *string `json:"backupMetadataPropertyBag,omitempty"`
638	// RestoreFileSpec - Pre Restore restore file spec array.
639	RestoreFileSpec *[]RestoreFileSpec `json:"restoreFileSpec,omitempty"`
640	// PauseWaitForSyncDrainTimePeriodInSeconds - Pre Restore pause wait for sync drain time period in seconds.
641	PauseWaitForSyncDrainTimePeriodInSeconds *int32 `json:"pauseWaitForSyncDrainTimePeriodInSeconds,omitempty"`
642}
643
644// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
645// have tags and a location
646type ProxyResource struct {
647	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
648	ID *string `json:"id,omitempty"`
649	// Name - READ-ONLY; The name of the resource
650	Name *string `json:"name,omitempty"`
651	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
652	Type *string `json:"type,omitempty"`
653}
654
655// RecallActionParameters the parameters used when calling recall action on server endpoint.
656type RecallActionParameters struct {
657	// Pattern - Pattern of the files.
658	Pattern *string `json:"pattern,omitempty"`
659	// RecallPath - Recall path.
660	RecallPath *string `json:"recallPath,omitempty"`
661}
662
663// RegisteredServer registered Server resource.
664type RegisteredServer struct {
665	autorest.Response `json:"-"`
666	// RegisteredServerProperties - RegisteredServer properties.
667	*RegisteredServerProperties `json:"properties,omitempty"`
668	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
669	ID *string `json:"id,omitempty"`
670	// Name - READ-ONLY; The name of the resource
671	Name *string `json:"name,omitempty"`
672	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
673	Type *string `json:"type,omitempty"`
674}
675
676// MarshalJSON is the custom marshaler for RegisteredServer.
677func (rs RegisteredServer) MarshalJSON() ([]byte, error) {
678	objectMap := make(map[string]interface{})
679	if rs.RegisteredServerProperties != nil {
680		objectMap["properties"] = rs.RegisteredServerProperties
681	}
682	return json.Marshal(objectMap)
683}
684
685// UnmarshalJSON is the custom unmarshaler for RegisteredServer struct.
686func (rs *RegisteredServer) UnmarshalJSON(body []byte) error {
687	var m map[string]*json.RawMessage
688	err := json.Unmarshal(body, &m)
689	if err != nil {
690		return err
691	}
692	for k, v := range m {
693		switch k {
694		case "properties":
695			if v != nil {
696				var registeredServerProperties RegisteredServerProperties
697				err = json.Unmarshal(*v, &registeredServerProperties)
698				if err != nil {
699					return err
700				}
701				rs.RegisteredServerProperties = &registeredServerProperties
702			}
703		case "id":
704			if v != nil {
705				var ID string
706				err = json.Unmarshal(*v, &ID)
707				if err != nil {
708					return err
709				}
710				rs.ID = &ID
711			}
712		case "name":
713			if v != nil {
714				var name string
715				err = json.Unmarshal(*v, &name)
716				if err != nil {
717					return err
718				}
719				rs.Name = &name
720			}
721		case "type":
722			if v != nil {
723				var typeVar string
724				err = json.Unmarshal(*v, &typeVar)
725				if err != nil {
726					return err
727				}
728				rs.Type = &typeVar
729			}
730		}
731	}
732
733	return nil
734}
735
736// RegisteredServerArray array of RegisteredServer
737type RegisteredServerArray struct {
738	autorest.Response `json:"-"`
739	// Value - Collection of Registered Server.
740	Value *[]RegisteredServer `json:"value,omitempty"`
741}
742
743// RegisteredServerCreateParameters the parameters used when creating a storage sync service.
744type RegisteredServerCreateParameters struct {
745	// 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.
746	Location *string `json:"location,omitempty"`
747	// 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.
748	Tags map[string]*string `json:"tags"`
749	// RegisteredServerCreateParametersProperties - The parameters used to create the storage sync service.
750	*RegisteredServerCreateParametersProperties `json:"properties,omitempty"`
751}
752
753// MarshalJSON is the custom marshaler for RegisteredServerCreateParameters.
754func (rscp RegisteredServerCreateParameters) MarshalJSON() ([]byte, error) {
755	objectMap := make(map[string]interface{})
756	if rscp.Location != nil {
757		objectMap["location"] = rscp.Location
758	}
759	if rscp.Tags != nil {
760		objectMap["tags"] = rscp.Tags
761	}
762	if rscp.RegisteredServerCreateParametersProperties != nil {
763		objectMap["properties"] = rscp.RegisteredServerCreateParametersProperties
764	}
765	return json.Marshal(objectMap)
766}
767
768// UnmarshalJSON is the custom unmarshaler for RegisteredServerCreateParameters struct.
769func (rscp *RegisteredServerCreateParameters) UnmarshalJSON(body []byte) error {
770	var m map[string]*json.RawMessage
771	err := json.Unmarshal(body, &m)
772	if err != nil {
773		return err
774	}
775	for k, v := range m {
776		switch k {
777		case "location":
778			if v != nil {
779				var location string
780				err = json.Unmarshal(*v, &location)
781				if err != nil {
782					return err
783				}
784				rscp.Location = &location
785			}
786		case "tags":
787			if v != nil {
788				var tags map[string]*string
789				err = json.Unmarshal(*v, &tags)
790				if err != nil {
791					return err
792				}
793				rscp.Tags = tags
794			}
795		case "properties":
796			if v != nil {
797				var registeredServerCreateParametersProperties RegisteredServerCreateParametersProperties
798				err = json.Unmarshal(*v, &registeredServerCreateParametersProperties)
799				if err != nil {
800					return err
801				}
802				rscp.RegisteredServerCreateParametersProperties = &registeredServerCreateParametersProperties
803			}
804		}
805	}
806
807	return nil
808}
809
810// RegisteredServerCreateParametersProperties registeredServer Properties object.
811type RegisteredServerCreateParametersProperties struct {
812	// ServerCertificate - Registered Server Certificate
813	ServerCertificate *string `json:"serverCertificate,omitempty"`
814	// AgentVersion - Registered Server Agent Version
815	AgentVersion *string `json:"agentVersion,omitempty"`
816	// ServerOSVersion - Registered Server OS Version
817	ServerOSVersion *string `json:"serverOSVersion,omitempty"`
818	// LastHeartBeat - Registered Server last heart beat
819	LastHeartBeat *string `json:"lastHeartBeat,omitempty"`
820	// ServerRole - Registered Server serverRole
821	ServerRole *string `json:"serverRole,omitempty"`
822	// ClusterID - Registered Server clusterId
823	ClusterID *string `json:"clusterId,omitempty"`
824	// ClusterName - Registered Server clusterName
825	ClusterName *string `json:"clusterName,omitempty"`
826	// ServerID - Registered Server serverId
827	ServerID *string `json:"serverId,omitempty"`
828	// FriendlyName - Friendly Name
829	FriendlyName *string `json:"friendlyName,omitempty"`
830}
831
832// RegisteredServerProperties registeredServer Properties object.
833type RegisteredServerProperties struct {
834	// ServerCertificate - Registered Server Certificate
835	ServerCertificate *string `json:"serverCertificate,omitempty"`
836	// AgentVersion - Registered Server Agent Version
837	AgentVersion *string `json:"agentVersion,omitempty"`
838	// ServerOSVersion - Registered Server OS Version
839	ServerOSVersion *string `json:"serverOSVersion,omitempty"`
840	// ServerManagementtErrorCode - Registered Server Management Error Code
841	ServerManagementtErrorCode *int32 `json:"serverManagementtErrorCode,omitempty"`
842	// LastHeartBeat - Registered Server last heart beat
843	LastHeartBeat *string `json:"lastHeartBeat,omitempty"`
844	// ProvisioningState - Registered Server Provisioning State
845	ProvisioningState *string `json:"provisioningState,omitempty"`
846	// ServerRole - Registered Server serverRole
847	ServerRole *string `json:"serverRole,omitempty"`
848	// ClusterID - Registered Server clusterId
849	ClusterID *string `json:"clusterId,omitempty"`
850	// ClusterName - Registered Server clusterName
851	ClusterName *string `json:"clusterName,omitempty"`
852	// ServerID - Registered Server serverId
853	ServerID *string `json:"serverId,omitempty"`
854	// StorageSyncServiceUID - Registered Server storageSyncServiceUid
855	StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"`
856	// LastWorkflowID - Registered Server lastWorkflowId
857	LastWorkflowID *string `json:"lastWorkflowId,omitempty"`
858	// LastOperationName - Resource Last Operation Name
859	LastOperationName *string `json:"lastOperationName,omitempty"`
860	// DiscoveryEndpointURI - Resource discoveryEndpointUri
861	DiscoveryEndpointURI *string `json:"discoveryEndpointUri,omitempty"`
862	// ResourceLocation - Resource Location
863	ResourceLocation *string `json:"resourceLocation,omitempty"`
864	// ServiceLocation - Service Location
865	ServiceLocation *string `json:"serviceLocation,omitempty"`
866	// FriendlyName - Friendly Name
867	FriendlyName *string `json:"friendlyName,omitempty"`
868	// ManagementEndpointURI - Management Endpoint Uri
869	ManagementEndpointURI *string `json:"managementEndpointUri,omitempty"`
870}
871
872// RegisteredServersCreateFuture an abstraction for monitoring and retrieving the results of a long-running
873// operation.
874type RegisteredServersCreateFuture struct {
875	azure.FutureAPI
876	// Result returns the result of the asynchronous operation.
877	// If the operation has not completed it will return an error.
878	Result func(RegisteredServersClient) (RegisteredServer, error)
879}
880
881// RegisteredServersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
882// operation.
883type RegisteredServersDeleteFuture struct {
884	azure.FutureAPI
885	// Result returns the result of the asynchronous operation.
886	// If the operation has not completed it will return an error.
887	Result func(RegisteredServersClient) (autorest.Response, error)
888}
889
890// Resource common fields that are returned in the response for all Azure Resource Manager resources
891type Resource struct {
892	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
893	ID *string `json:"id,omitempty"`
894	// Name - READ-ONLY; The name of the resource
895	Name *string `json:"name,omitempty"`
896	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
897	Type *string `json:"type,omitempty"`
898}
899
900// ResourcesMoveInfo resource Move Info.
901type ResourcesMoveInfo struct {
902	// TargetResourceGroup - Target resource group.
903	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
904	// Resources - Collection of Resources.
905	Resources *[]string `json:"resources,omitempty"`
906}
907
908// RestoreFileSpec restore file spec.
909type RestoreFileSpec struct {
910	// Path - Restore file spec path
911	Path *string `json:"path,omitempty"`
912	// Isdir - READ-ONLY; Restore file spec isdir
913	Isdir *bool `json:"isdir,omitempty"`
914}
915
916// MarshalJSON is the custom marshaler for RestoreFileSpec.
917func (rfs RestoreFileSpec) MarshalJSON() ([]byte, error) {
918	objectMap := make(map[string]interface{})
919	if rfs.Path != nil {
920		objectMap["path"] = rfs.Path
921	}
922	return json.Marshal(objectMap)
923}
924
925// ServerEndpoint server Endpoint object.
926type ServerEndpoint struct {
927	autorest.Response `json:"-"`
928	// ServerEndpointProperties - Server Endpoint properties.
929	*ServerEndpointProperties `json:"properties,omitempty"`
930	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
931	ID *string `json:"id,omitempty"`
932	// Name - READ-ONLY; The name of the resource
933	Name *string `json:"name,omitempty"`
934	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
935	Type *string `json:"type,omitempty"`
936}
937
938// MarshalJSON is the custom marshaler for ServerEndpoint.
939func (se ServerEndpoint) MarshalJSON() ([]byte, error) {
940	objectMap := make(map[string]interface{})
941	if se.ServerEndpointProperties != nil {
942		objectMap["properties"] = se.ServerEndpointProperties
943	}
944	return json.Marshal(objectMap)
945}
946
947// UnmarshalJSON is the custom unmarshaler for ServerEndpoint struct.
948func (se *ServerEndpoint) UnmarshalJSON(body []byte) error {
949	var m map[string]*json.RawMessage
950	err := json.Unmarshal(body, &m)
951	if err != nil {
952		return err
953	}
954	for k, v := range m {
955		switch k {
956		case "properties":
957			if v != nil {
958				var serverEndpointProperties ServerEndpointProperties
959				err = json.Unmarshal(*v, &serverEndpointProperties)
960				if err != nil {
961					return err
962				}
963				se.ServerEndpointProperties = &serverEndpointProperties
964			}
965		case "id":
966			if v != nil {
967				var ID string
968				err = json.Unmarshal(*v, &ID)
969				if err != nil {
970					return err
971				}
972				se.ID = &ID
973			}
974		case "name":
975			if v != nil {
976				var name string
977				err = json.Unmarshal(*v, &name)
978				if err != nil {
979					return err
980				}
981				se.Name = &name
982			}
983		case "type":
984			if v != nil {
985				var typeVar string
986				err = json.Unmarshal(*v, &typeVar)
987				if err != nil {
988					return err
989				}
990				se.Type = &typeVar
991			}
992		}
993	}
994
995	return nil
996}
997
998// ServerEndpointArray array of ServerEndpoint
999type ServerEndpointArray struct {
1000	autorest.Response `json:"-"`
1001	// Value - Collection of ServerEndpoint.
1002	Value *[]ServerEndpoint `json:"value,omitempty"`
1003}
1004
1005// ServerEndpointCreateParameters the parameters used when creating a storage sync service.
1006type ServerEndpointCreateParameters struct {
1007	// 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.
1008	Location *string `json:"location,omitempty"`
1009	// 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.
1010	Tags map[string]*string `json:"tags"`
1011	// ServerEndpointCreateParametersProperties - The parameters used to create the storage sync service.
1012	*ServerEndpointCreateParametersProperties `json:"properties,omitempty"`
1013}
1014
1015// MarshalJSON is the custom marshaler for ServerEndpointCreateParameters.
1016func (secp ServerEndpointCreateParameters) MarshalJSON() ([]byte, error) {
1017	objectMap := make(map[string]interface{})
1018	if secp.Location != nil {
1019		objectMap["location"] = secp.Location
1020	}
1021	if secp.Tags != nil {
1022		objectMap["tags"] = secp.Tags
1023	}
1024	if secp.ServerEndpointCreateParametersProperties != nil {
1025		objectMap["properties"] = secp.ServerEndpointCreateParametersProperties
1026	}
1027	return json.Marshal(objectMap)
1028}
1029
1030// UnmarshalJSON is the custom unmarshaler for ServerEndpointCreateParameters struct.
1031func (secp *ServerEndpointCreateParameters) UnmarshalJSON(body []byte) error {
1032	var m map[string]*json.RawMessage
1033	err := json.Unmarshal(body, &m)
1034	if err != nil {
1035		return err
1036	}
1037	for k, v := range m {
1038		switch k {
1039		case "location":
1040			if v != nil {
1041				var location string
1042				err = json.Unmarshal(*v, &location)
1043				if err != nil {
1044					return err
1045				}
1046				secp.Location = &location
1047			}
1048		case "tags":
1049			if v != nil {
1050				var tags map[string]*string
1051				err = json.Unmarshal(*v, &tags)
1052				if err != nil {
1053					return err
1054				}
1055				secp.Tags = tags
1056			}
1057		case "properties":
1058			if v != nil {
1059				var serverEndpointCreateParametersProperties ServerEndpointCreateParametersProperties
1060				err = json.Unmarshal(*v, &serverEndpointCreateParametersProperties)
1061				if err != nil {
1062					return err
1063				}
1064				secp.ServerEndpointCreateParametersProperties = &serverEndpointCreateParametersProperties
1065			}
1066		}
1067	}
1068
1069	return nil
1070}
1071
1072// ServerEndpointCreateParametersProperties serverEndpoint Properties object.
1073type ServerEndpointCreateParametersProperties struct {
1074	// ServerLocalPath - Server Local path.
1075	ServerLocalPath *string `json:"serverLocalPath,omitempty"`
1076	// CloudTiering - Cloud Tiering. Possible values include: 'On', 'Off'
1077	CloudTiering CloudTiering `json:"cloudTiering,omitempty"`
1078	// VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled.
1079	VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"`
1080	// FriendlyName - Friendly Name
1081	FriendlyName *string `json:"friendlyName,omitempty"`
1082	// ServerResourceID - Server Resource Id.
1083	ServerResourceID *string `json:"serverResourceId,omitempty"`
1084}
1085
1086// ServerEndpointProperties serverEndpoint Properties object.
1087type ServerEndpointProperties struct {
1088	// ServerLocalPath - Server Local path.
1089	ServerLocalPath *string `json:"serverLocalPath,omitempty"`
1090	// CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering2On', 'CloudTiering2Off'
1091	CloudTiering CloudTiering2 `json:"cloudTiering,omitempty"`
1092	// VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled.
1093	VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"`
1094	// FriendlyName - Friendly Name
1095	FriendlyName *string `json:"friendlyName,omitempty"`
1096	// ServerResourceID - Server Resource Id.
1097	ServerResourceID *string `json:"serverResourceId,omitempty"`
1098	// ProvisioningState - ServerEndpoint Provisioning State
1099	ProvisioningState *string `json:"provisioningState,omitempty"`
1100	// LastWorkflowID - ServerEndpoint lastWorkflowId
1101	LastWorkflowID *string `json:"lastWorkflowId,omitempty"`
1102	// LastOperationName - Resource Last Operation Name
1103	LastOperationName *string `json:"lastOperationName,omitempty"`
1104	// SyncStatus - Sync Health Status
1105	SyncStatus interface{} `json:"syncStatus,omitempty"`
1106}
1107
1108// ServerEndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
1109// operation.
1110type ServerEndpointsCreateFuture struct {
1111	azure.FutureAPI
1112	// Result returns the result of the asynchronous operation.
1113	// If the operation has not completed it will return an error.
1114	Result func(ServerEndpointsClient) (ServerEndpoint, error)
1115}
1116
1117// ServerEndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1118// operation.
1119type ServerEndpointsDeleteFuture struct {
1120	azure.FutureAPI
1121	// Result returns the result of the asynchronous operation.
1122	// If the operation has not completed it will return an error.
1123	Result func(ServerEndpointsClient) (autorest.Response, error)
1124}
1125
1126// ServerEndpointsRecallActionFuture an abstraction for monitoring and retrieving the results of a
1127// long-running operation.
1128type ServerEndpointsRecallActionFuture struct {
1129	azure.FutureAPI
1130	// Result returns the result of the asynchronous operation.
1131	// If the operation has not completed it will return an error.
1132	Result func(ServerEndpointsClient) (autorest.Response, error)
1133}
1134
1135// ServerEndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1136// operation.
1137type ServerEndpointsUpdateFuture struct {
1138	azure.FutureAPI
1139	// Result returns the result of the asynchronous operation.
1140	// If the operation has not completed it will return an error.
1141	Result func(ServerEndpointsClient) (ServerEndpoint, error)
1142}
1143
1144// ServerEndpointUpdateParameters parameters for updating an Server Endpoint.
1145type ServerEndpointUpdateParameters struct {
1146	// Tags - The user-specified tags associated with the server endpoint.
1147	Tags map[string]*string `json:"tags"`
1148	// ServerEndpointUpdateProperties - The properties of the server endpoint.
1149	*ServerEndpointUpdateProperties `json:"properties,omitempty"`
1150}
1151
1152// MarshalJSON is the custom marshaler for ServerEndpointUpdateParameters.
1153func (seup ServerEndpointUpdateParameters) MarshalJSON() ([]byte, error) {
1154	objectMap := make(map[string]interface{})
1155	if seup.Tags != nil {
1156		objectMap["tags"] = seup.Tags
1157	}
1158	if seup.ServerEndpointUpdateProperties != nil {
1159		objectMap["properties"] = seup.ServerEndpointUpdateProperties
1160	}
1161	return json.Marshal(objectMap)
1162}
1163
1164// UnmarshalJSON is the custom unmarshaler for ServerEndpointUpdateParameters struct.
1165func (seup *ServerEndpointUpdateParameters) UnmarshalJSON(body []byte) error {
1166	var m map[string]*json.RawMessage
1167	err := json.Unmarshal(body, &m)
1168	if err != nil {
1169		return err
1170	}
1171	for k, v := range m {
1172		switch k {
1173		case "tags":
1174			if v != nil {
1175				var tags map[string]*string
1176				err = json.Unmarshal(*v, &tags)
1177				if err != nil {
1178					return err
1179				}
1180				seup.Tags = tags
1181			}
1182		case "properties":
1183			if v != nil {
1184				var serverEndpointUpdateProperties ServerEndpointUpdateProperties
1185				err = json.Unmarshal(*v, &serverEndpointUpdateProperties)
1186				if err != nil {
1187					return err
1188				}
1189				seup.ServerEndpointUpdateProperties = &serverEndpointUpdateProperties
1190			}
1191		}
1192	}
1193
1194	return nil
1195}
1196
1197// ServerEndpointUpdateProperties serverEndpoint Update Properties object.
1198type ServerEndpointUpdateProperties struct {
1199	// CloudTiering - Cloud Tiering. Possible values include: 'CloudTiering1On', 'CloudTiering1Off'
1200	CloudTiering CloudTiering1 `json:"cloudTiering,omitempty"`
1201	// VolumeFreeSpacePercent - Level of free space to be maintained by Cloud Tiering if it is enabled.
1202	VolumeFreeSpacePercent *int32 `json:"volumeFreeSpacePercent,omitempty"`
1203}
1204
1205// Service storage Sync Service object.
1206type Service struct {
1207	autorest.Response `json:"-"`
1208	// ServiceProperties - Storage Sync Service properties.
1209	*ServiceProperties `json:"properties,omitempty"`
1210	// Tags - Resource tags.
1211	Tags map[string]*string `json:"tags"`
1212	// Location - The geo-location where the resource lives
1213	Location *string `json:"location,omitempty"`
1214	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1215	ID *string `json:"id,omitempty"`
1216	// Name - READ-ONLY; The name of the resource
1217	Name *string `json:"name,omitempty"`
1218	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1219	Type *string `json:"type,omitempty"`
1220}
1221
1222// MarshalJSON is the custom marshaler for Service.
1223func (s Service) MarshalJSON() ([]byte, error) {
1224	objectMap := make(map[string]interface{})
1225	if s.ServiceProperties != nil {
1226		objectMap["properties"] = s.ServiceProperties
1227	}
1228	if s.Tags != nil {
1229		objectMap["tags"] = s.Tags
1230	}
1231	if s.Location != nil {
1232		objectMap["location"] = s.Location
1233	}
1234	return json.Marshal(objectMap)
1235}
1236
1237// UnmarshalJSON is the custom unmarshaler for Service struct.
1238func (s *Service) UnmarshalJSON(body []byte) error {
1239	var m map[string]*json.RawMessage
1240	err := json.Unmarshal(body, &m)
1241	if err != nil {
1242		return err
1243	}
1244	for k, v := range m {
1245		switch k {
1246		case "properties":
1247			if v != nil {
1248				var serviceProperties ServiceProperties
1249				err = json.Unmarshal(*v, &serviceProperties)
1250				if err != nil {
1251					return err
1252				}
1253				s.ServiceProperties = &serviceProperties
1254			}
1255		case "tags":
1256			if v != nil {
1257				var tags map[string]*string
1258				err = json.Unmarshal(*v, &tags)
1259				if err != nil {
1260					return err
1261				}
1262				s.Tags = tags
1263			}
1264		case "location":
1265			if v != nil {
1266				var location string
1267				err = json.Unmarshal(*v, &location)
1268				if err != nil {
1269					return err
1270				}
1271				s.Location = &location
1272			}
1273		case "id":
1274			if v != nil {
1275				var ID string
1276				err = json.Unmarshal(*v, &ID)
1277				if err != nil {
1278					return err
1279				}
1280				s.ID = &ID
1281			}
1282		case "name":
1283			if v != nil {
1284				var name string
1285				err = json.Unmarshal(*v, &name)
1286				if err != nil {
1287					return err
1288				}
1289				s.Name = &name
1290			}
1291		case "type":
1292			if v != nil {
1293				var typeVar string
1294				err = json.Unmarshal(*v, &typeVar)
1295				if err != nil {
1296					return err
1297				}
1298				s.Type = &typeVar
1299			}
1300		}
1301	}
1302
1303	return nil
1304}
1305
1306// ServiceArray array of StorageSyncServices
1307type ServiceArray struct {
1308	autorest.Response `json:"-"`
1309	// Value - Collection of StorageSyncServices.
1310	Value *[]Service `json:"value,omitempty"`
1311}
1312
1313// ServiceCreateParameters the parameters used when creating a storage sync service.
1314type ServiceCreateParameters struct {
1315	// 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.
1316	Location *string `json:"location,omitempty"`
1317	// 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.
1318	Tags map[string]*string `json:"tags"`
1319}
1320
1321// MarshalJSON is the custom marshaler for ServiceCreateParameters.
1322func (scp ServiceCreateParameters) MarshalJSON() ([]byte, error) {
1323	objectMap := make(map[string]interface{})
1324	if scp.Location != nil {
1325		objectMap["location"] = scp.Location
1326	}
1327	if scp.Tags != nil {
1328		objectMap["tags"] = scp.Tags
1329	}
1330	return json.Marshal(objectMap)
1331}
1332
1333// ServiceProperties storage Sync Service Properties object.
1334type ServiceProperties struct {
1335	// StorageSyncServiceStatus - READ-ONLY; Storage Sync service status.
1336	StorageSyncServiceStatus *int32 `json:"storageSyncServiceStatus,omitempty"`
1337	// StorageSyncServiceUID - READ-ONLY; Storage Sync service Uid
1338	StorageSyncServiceUID *string `json:"storageSyncServiceUid,omitempty"`
1339}
1340
1341// ServiceUpdateParameters parameters for updating an Storage sync service.
1342type ServiceUpdateParameters struct {
1343	// Tags - The user-specified tags associated with the storage sync service.
1344	Tags map[string]*string `json:"tags"`
1345	// Properties - The properties of the storage sync service.
1346	Properties interface{} `json:"properties,omitempty"`
1347}
1348
1349// MarshalJSON is the custom marshaler for ServiceUpdateParameters.
1350func (sup ServiceUpdateParameters) MarshalJSON() ([]byte, error) {
1351	objectMap := make(map[string]interface{})
1352	if sup.Tags != nil {
1353		objectMap["tags"] = sup.Tags
1354	}
1355	if sup.Properties != nil {
1356		objectMap["properties"] = sup.Properties
1357	}
1358	return json.Marshal(objectMap)
1359}
1360
1361// SubscriptionState subscription State object.
1362type SubscriptionState struct {
1363	// State - State of Azure Subscription. Possible values include: 'Registered', 'Unregistered', 'Warned', 'Suspended', 'Deleted'
1364	State Reason `json:"state,omitempty"`
1365	// Istransitioning - READ-ONLY; Is Transitioning
1366	Istransitioning *bool `json:"istransitioning,omitempty"`
1367	// Properties - Subscription state properties.
1368	Properties interface{} `json:"properties,omitempty"`
1369}
1370
1371// MarshalJSON is the custom marshaler for SubscriptionState.
1372func (ss SubscriptionState) MarshalJSON() ([]byte, error) {
1373	objectMap := make(map[string]interface{})
1374	if ss.State != "" {
1375		objectMap["state"] = ss.State
1376	}
1377	if ss.Properties != nil {
1378		objectMap["properties"] = ss.Properties
1379	}
1380	return json.Marshal(objectMap)
1381}
1382
1383// SyncGroup sync Group object.
1384type SyncGroup struct {
1385	autorest.Response `json:"-"`
1386	// SyncGroupProperties - SyncGroup properties.
1387	*SyncGroupProperties `json:"properties,omitempty"`
1388	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1389	ID *string `json:"id,omitempty"`
1390	// Name - READ-ONLY; The name of the resource
1391	Name *string `json:"name,omitempty"`
1392	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1393	Type *string `json:"type,omitempty"`
1394}
1395
1396// MarshalJSON is the custom marshaler for SyncGroup.
1397func (sg SyncGroup) MarshalJSON() ([]byte, error) {
1398	objectMap := make(map[string]interface{})
1399	if sg.SyncGroupProperties != nil {
1400		objectMap["properties"] = sg.SyncGroupProperties
1401	}
1402	return json.Marshal(objectMap)
1403}
1404
1405// UnmarshalJSON is the custom unmarshaler for SyncGroup struct.
1406func (sg *SyncGroup) UnmarshalJSON(body []byte) error {
1407	var m map[string]*json.RawMessage
1408	err := json.Unmarshal(body, &m)
1409	if err != nil {
1410		return err
1411	}
1412	for k, v := range m {
1413		switch k {
1414		case "properties":
1415			if v != nil {
1416				var syncGroupProperties SyncGroupProperties
1417				err = json.Unmarshal(*v, &syncGroupProperties)
1418				if err != nil {
1419					return err
1420				}
1421				sg.SyncGroupProperties = &syncGroupProperties
1422			}
1423		case "id":
1424			if v != nil {
1425				var ID string
1426				err = json.Unmarshal(*v, &ID)
1427				if err != nil {
1428					return err
1429				}
1430				sg.ID = &ID
1431			}
1432		case "name":
1433			if v != nil {
1434				var name string
1435				err = json.Unmarshal(*v, &name)
1436				if err != nil {
1437					return err
1438				}
1439				sg.Name = &name
1440			}
1441		case "type":
1442			if v != nil {
1443				var typeVar string
1444				err = json.Unmarshal(*v, &typeVar)
1445				if err != nil {
1446					return err
1447				}
1448				sg.Type = &typeVar
1449			}
1450		}
1451	}
1452
1453	return nil
1454}
1455
1456// SyncGroupArray array of SyncGroup
1457type SyncGroupArray struct {
1458	autorest.Response `json:"-"`
1459	// Value - Collection of SyncGroup.
1460	Value *[]SyncGroup `json:"value,omitempty"`
1461}
1462
1463// SyncGroupCreateParameters the parameters used when creating a sync group.
1464type SyncGroupCreateParameters struct {
1465	// 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.
1466	Location *string `json:"location,omitempty"`
1467	// 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.
1468	Tags map[string]*string `json:"tags"`
1469	// Properties - The parameters used to create the sync group
1470	Properties interface{} `json:"properties,omitempty"`
1471}
1472
1473// MarshalJSON is the custom marshaler for SyncGroupCreateParameters.
1474func (sgcp SyncGroupCreateParameters) MarshalJSON() ([]byte, error) {
1475	objectMap := make(map[string]interface{})
1476	if sgcp.Location != nil {
1477		objectMap["location"] = sgcp.Location
1478	}
1479	if sgcp.Tags != nil {
1480		objectMap["tags"] = sgcp.Tags
1481	}
1482	if sgcp.Properties != nil {
1483		objectMap["properties"] = sgcp.Properties
1484	}
1485	return json.Marshal(objectMap)
1486}
1487
1488// SyncGroupProperties syncGroup Properties object.
1489type SyncGroupProperties struct {
1490	// UniqueID - Unique Id
1491	UniqueID *string `json:"uniqueId,omitempty"`
1492	// SyncGroupStatus - READ-ONLY; Sync group status
1493	SyncGroupStatus *string `json:"syncGroupStatus,omitempty"`
1494}
1495
1496// MarshalJSON is the custom marshaler for SyncGroupProperties.
1497func (sgp SyncGroupProperties) MarshalJSON() ([]byte, error) {
1498	objectMap := make(map[string]interface{})
1499	if sgp.UniqueID != nil {
1500		objectMap["uniqueId"] = sgp.UniqueID
1501	}
1502	return json.Marshal(objectMap)
1503}
1504
1505// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
1506// which has 'tags' and a 'location'
1507type TrackedResource struct {
1508	// Tags - Resource tags.
1509	Tags map[string]*string `json:"tags"`
1510	// Location - The geo-location where the resource lives
1511	Location *string `json:"location,omitempty"`
1512	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1513	ID *string `json:"id,omitempty"`
1514	// Name - READ-ONLY; The name of the resource
1515	Name *string `json:"name,omitempty"`
1516	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1517	Type *string `json:"type,omitempty"`
1518}
1519
1520// MarshalJSON is the custom marshaler for TrackedResource.
1521func (tr TrackedResource) MarshalJSON() ([]byte, error) {
1522	objectMap := make(map[string]interface{})
1523	if tr.Tags != nil {
1524		objectMap["tags"] = tr.Tags
1525	}
1526	if tr.Location != nil {
1527		objectMap["location"] = tr.Location
1528	}
1529	return json.Marshal(objectMap)
1530}
1531
1532// Workflow workflow resource.
1533type Workflow struct {
1534	autorest.Response `json:"-"`
1535	// WorkflowProperties - Workflow properties.
1536	*WorkflowProperties `json:"properties,omitempty"`
1537	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1538	ID *string `json:"id,omitempty"`
1539	// Name - READ-ONLY; The name of the resource
1540	Name *string `json:"name,omitempty"`
1541	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1542	Type *string `json:"type,omitempty"`
1543}
1544
1545// MarshalJSON is the custom marshaler for Workflow.
1546func (w Workflow) MarshalJSON() ([]byte, error) {
1547	objectMap := make(map[string]interface{})
1548	if w.WorkflowProperties != nil {
1549		objectMap["properties"] = w.WorkflowProperties
1550	}
1551	return json.Marshal(objectMap)
1552}
1553
1554// UnmarshalJSON is the custom unmarshaler for Workflow struct.
1555func (w *Workflow) UnmarshalJSON(body []byte) error {
1556	var m map[string]*json.RawMessage
1557	err := json.Unmarshal(body, &m)
1558	if err != nil {
1559		return err
1560	}
1561	for k, v := range m {
1562		switch k {
1563		case "properties":
1564			if v != nil {
1565				var workflowProperties WorkflowProperties
1566				err = json.Unmarshal(*v, &workflowProperties)
1567				if err != nil {
1568					return err
1569				}
1570				w.WorkflowProperties = &workflowProperties
1571			}
1572		case "id":
1573			if v != nil {
1574				var ID string
1575				err = json.Unmarshal(*v, &ID)
1576				if err != nil {
1577					return err
1578				}
1579				w.ID = &ID
1580			}
1581		case "name":
1582			if v != nil {
1583				var name string
1584				err = json.Unmarshal(*v, &name)
1585				if err != nil {
1586					return err
1587				}
1588				w.Name = &name
1589			}
1590		case "type":
1591			if v != nil {
1592				var typeVar string
1593				err = json.Unmarshal(*v, &typeVar)
1594				if err != nil {
1595					return err
1596				}
1597				w.Type = &typeVar
1598			}
1599		}
1600	}
1601
1602	return nil
1603}
1604
1605// WorkflowArray array of Workflow
1606type WorkflowArray struct {
1607	// Value - Collection of workflow items.
1608	Value *[]Workflow `json:"value,omitempty"`
1609}
1610
1611// WorkflowProperties workflow Properties object.
1612type WorkflowProperties struct {
1613	// LastStepName - last step name
1614	LastStepName *string `json:"lastStepName,omitempty"`
1615	// Status - workflow status. Possible values include: 'Active', 'Expired', 'Succeeded', 'Aborted', 'Failed'
1616	Status Status `json:"status,omitempty"`
1617	// Operation - operation direction. Possible values include: 'Do', 'Undo', 'Cancel'
1618	Operation Operation `json:"operation,omitempty"`
1619	// Steps - workflow steps
1620	Steps *string `json:"steps,omitempty"`
1621	// LastOperationID - workflow last operation identifier.
1622	LastOperationID *string `json:"lastOperationId,omitempty"`
1623}
1624