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