1package backup
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/date"
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/recoveryservices/mgmt/2016-06-01/backup"
32
33// DataSourceType enumerates the values for data source type.
34type DataSourceType string
35
36const (
37	// AzureSQLDb ...
38	AzureSQLDb DataSourceType = "AzureSqlDb"
39	// DPMUnknown ...
40	DPMUnknown DataSourceType = "DPMUnknown"
41	// Exchange ...
42	Exchange DataSourceType = "Exchange"
43	// FileFolder ...
44	FileFolder DataSourceType = "FileFolder"
45	// Invalid ...
46	Invalid DataSourceType = "Invalid"
47	// Sharepoint ...
48	Sharepoint DataSourceType = "Sharepoint"
49	// SQLDB ...
50	SQLDB DataSourceType = "SQLDB"
51	// VM ...
52	VM DataSourceType = "VM"
53)
54
55// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type.
56func PossibleDataSourceTypeValues() []DataSourceType {
57	return []DataSourceType{AzureSQLDb, DPMUnknown, Exchange, FileFolder, Invalid, Sharepoint, SQLDB, VM}
58}
59
60// DayOfWeek enumerates the values for day of week.
61type DayOfWeek string
62
63const (
64	// Friday ...
65	Friday DayOfWeek = "Friday"
66	// Monday ...
67	Monday DayOfWeek = "Monday"
68	// Saturday ...
69	Saturday DayOfWeek = "Saturday"
70	// Sunday ...
71	Sunday DayOfWeek = "Sunday"
72	// Thursday ...
73	Thursday DayOfWeek = "Thursday"
74	// Tuesday ...
75	Tuesday DayOfWeek = "Tuesday"
76	// Wednesday ...
77	Wednesday DayOfWeek = "Wednesday"
78)
79
80// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type.
81func PossibleDayOfWeekValues() []DayOfWeek {
82	return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday}
83}
84
85// EngineType enumerates the values for engine type.
86type EngineType string
87
88const (
89	// BackupEngineTypeAzureBackupServerEngine ...
90	BackupEngineTypeAzureBackupServerEngine EngineType = "AzureBackupServerEngine"
91	// BackupEngineTypeBackupEngineBase ...
92	BackupEngineTypeBackupEngineBase EngineType = "BackupEngineBase"
93	// BackupEngineTypeDpmBackupEngine ...
94	BackupEngineTypeDpmBackupEngine EngineType = "DpmBackupEngine"
95)
96
97// PossibleEngineTypeValues returns an array of possible values for the EngineType const type.
98func PossibleEngineTypeValues() []EngineType {
99	return []EngineType{BackupEngineTypeAzureBackupServerEngine, BackupEngineTypeBackupEngineBase, BackupEngineTypeDpmBackupEngine}
100}
101
102// HTTPStatusCode enumerates the values for http status code.
103type HTTPStatusCode string
104
105const (
106	// Accepted ...
107	Accepted HTTPStatusCode = "Accepted"
108	// Ambiguous ...
109	Ambiguous HTTPStatusCode = "Ambiguous"
110	// BadGateway ...
111	BadGateway HTTPStatusCode = "BadGateway"
112	// BadRequest ...
113	BadRequest HTTPStatusCode = "BadRequest"
114	// Conflict ...
115	Conflict HTTPStatusCode = "Conflict"
116	// Continue ...
117	Continue HTTPStatusCode = "Continue"
118	// Created ...
119	Created HTTPStatusCode = "Created"
120	// ExpectationFailed ...
121	ExpectationFailed HTTPStatusCode = "ExpectationFailed"
122	// Forbidden ...
123	Forbidden HTTPStatusCode = "Forbidden"
124	// Found ...
125	Found HTTPStatusCode = "Found"
126	// GatewayTimeout ...
127	GatewayTimeout HTTPStatusCode = "GatewayTimeout"
128	// Gone ...
129	Gone HTTPStatusCode = "Gone"
130	// HTTPVersionNotSupported ...
131	HTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported"
132	// InternalServerError ...
133	InternalServerError HTTPStatusCode = "InternalServerError"
134	// LengthRequired ...
135	LengthRequired HTTPStatusCode = "LengthRequired"
136	// MethodNotAllowed ...
137	MethodNotAllowed HTTPStatusCode = "MethodNotAllowed"
138	// Moved ...
139	Moved HTTPStatusCode = "Moved"
140	// MovedPermanently ...
141	MovedPermanently HTTPStatusCode = "MovedPermanently"
142	// MultipleChoices ...
143	MultipleChoices HTTPStatusCode = "MultipleChoices"
144	// NoContent ...
145	NoContent HTTPStatusCode = "NoContent"
146	// NonAuthoritativeInformation ...
147	NonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation"
148	// NotAcceptable ...
149	NotAcceptable HTTPStatusCode = "NotAcceptable"
150	// NotFound ...
151	NotFound HTTPStatusCode = "NotFound"
152	// NotImplemented ...
153	NotImplemented HTTPStatusCode = "NotImplemented"
154	// NotModified ...
155	NotModified HTTPStatusCode = "NotModified"
156	// OK ...
157	OK HTTPStatusCode = "OK"
158	// PartialContent ...
159	PartialContent HTTPStatusCode = "PartialContent"
160	// PaymentRequired ...
161	PaymentRequired HTTPStatusCode = "PaymentRequired"
162	// PreconditionFailed ...
163	PreconditionFailed HTTPStatusCode = "PreconditionFailed"
164	// ProxyAuthenticationRequired ...
165	ProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired"
166	// Redirect ...
167	Redirect HTTPStatusCode = "Redirect"
168	// RedirectKeepVerb ...
169	RedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb"
170	// RedirectMethod ...
171	RedirectMethod HTTPStatusCode = "RedirectMethod"
172	// RequestedRangeNotSatisfiable ...
173	RequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable"
174	// RequestEntityTooLarge ...
175	RequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge"
176	// RequestTimeout ...
177	RequestTimeout HTTPStatusCode = "RequestTimeout"
178	// RequestURITooLong ...
179	RequestURITooLong HTTPStatusCode = "RequestUriTooLong"
180	// ResetContent ...
181	ResetContent HTTPStatusCode = "ResetContent"
182	// SeeOther ...
183	SeeOther HTTPStatusCode = "SeeOther"
184	// ServiceUnavailable ...
185	ServiceUnavailable HTTPStatusCode = "ServiceUnavailable"
186	// SwitchingProtocols ...
187	SwitchingProtocols HTTPStatusCode = "SwitchingProtocols"
188	// TemporaryRedirect ...
189	TemporaryRedirect HTTPStatusCode = "TemporaryRedirect"
190	// Unauthorized ...
191	Unauthorized HTTPStatusCode = "Unauthorized"
192	// UnsupportedMediaType ...
193	UnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType"
194	// Unused ...
195	Unused HTTPStatusCode = "Unused"
196	// UpgradeRequired ...
197	UpgradeRequired HTTPStatusCode = "UpgradeRequired"
198	// UseProxy ...
199	UseProxy HTTPStatusCode = "UseProxy"
200)
201
202// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type.
203func PossibleHTTPStatusCodeValues() []HTTPStatusCode {
204	return []HTTPStatusCode{Accepted, Ambiguous, BadGateway, BadRequest, Conflict, Continue, Created, ExpectationFailed, Forbidden, Found, GatewayTimeout, Gone, HTTPVersionNotSupported, InternalServerError, LengthRequired, MethodNotAllowed, Moved, MovedPermanently, MultipleChoices, NoContent, NonAuthoritativeInformation, NotAcceptable, NotFound, NotImplemented, NotModified, OK, PartialContent, PaymentRequired, PreconditionFailed, ProxyAuthenticationRequired, Redirect, RedirectKeepVerb, RedirectMethod, RequestedRangeNotSatisfiable, RequestEntityTooLarge, RequestTimeout, RequestURITooLong, ResetContent, SeeOther, ServiceUnavailable, SwitchingProtocols, TemporaryRedirect, Unauthorized, UnsupportedMediaType, Unused, UpgradeRequired, UseProxy}
205}
206
207// ItemType enumerates the values for item type.
208type ItemType string
209
210const (
211	// ItemTypeAzureSQLDb ...
212	ItemTypeAzureSQLDb ItemType = "AzureSqlDb"
213	// ItemTypeDPMUnknown ...
214	ItemTypeDPMUnknown ItemType = "DPMUnknown"
215	// ItemTypeExchange ...
216	ItemTypeExchange ItemType = "Exchange"
217	// ItemTypeFileFolder ...
218	ItemTypeFileFolder ItemType = "FileFolder"
219	// ItemTypeInvalid ...
220	ItemTypeInvalid ItemType = "Invalid"
221	// ItemTypeSharepoint ...
222	ItemTypeSharepoint ItemType = "Sharepoint"
223	// ItemTypeSQLDB ...
224	ItemTypeSQLDB ItemType = "SQLDB"
225	// ItemTypeVM ...
226	ItemTypeVM ItemType = "VM"
227)
228
229// PossibleItemTypeValues returns an array of possible values for the ItemType const type.
230func PossibleItemTypeValues() []ItemType {
231	return []ItemType{ItemTypeAzureSQLDb, ItemTypeDPMUnknown, ItemTypeExchange, ItemTypeFileFolder, ItemTypeInvalid, ItemTypeSharepoint, ItemTypeSQLDB, ItemTypeVM}
232}
233
234// JobOperationType enumerates the values for job operation type.
235type JobOperationType string
236
237const (
238	// JobOperationTypeBackup ...
239	JobOperationTypeBackup JobOperationType = "Backup"
240	// JobOperationTypeConfigureBackup ...
241	JobOperationTypeConfigureBackup JobOperationType = "ConfigureBackup"
242	// JobOperationTypeDeleteBackupData ...
243	JobOperationTypeDeleteBackupData JobOperationType = "DeleteBackupData"
244	// JobOperationTypeDisableBackup ...
245	JobOperationTypeDisableBackup JobOperationType = "DisableBackup"
246	// JobOperationTypeInvalid ...
247	JobOperationTypeInvalid JobOperationType = "Invalid"
248	// JobOperationTypeRestore ...
249	JobOperationTypeRestore JobOperationType = "Restore"
250)
251
252// PossibleJobOperationTypeValues returns an array of possible values for the JobOperationType const type.
253func PossibleJobOperationTypeValues() []JobOperationType {
254	return []JobOperationType{JobOperationTypeBackup, JobOperationTypeConfigureBackup, JobOperationTypeDeleteBackupData, JobOperationTypeDisableBackup, JobOperationTypeInvalid, JobOperationTypeRestore}
255}
256
257// JobStatus enumerates the values for job status.
258type JobStatus string
259
260const (
261	// JobStatusCancelled ...
262	JobStatusCancelled JobStatus = "Cancelled"
263	// JobStatusCancelling ...
264	JobStatusCancelling JobStatus = "Cancelling"
265	// JobStatusCompleted ...
266	JobStatusCompleted JobStatus = "Completed"
267	// JobStatusCompletedWithWarnings ...
268	JobStatusCompletedWithWarnings JobStatus = "CompletedWithWarnings"
269	// JobStatusFailed ...
270	JobStatusFailed JobStatus = "Failed"
271	// JobStatusInProgress ...
272	JobStatusInProgress JobStatus = "InProgress"
273	// JobStatusInvalid ...
274	JobStatusInvalid JobStatus = "Invalid"
275)
276
277// PossibleJobStatusValues returns an array of possible values for the JobStatus const type.
278func PossibleJobStatusValues() []JobStatus {
279	return []JobStatus{JobStatusCancelled, JobStatusCancelling, JobStatusCompleted, JobStatusCompletedWithWarnings, JobStatusFailed, JobStatusInProgress, JobStatusInvalid}
280}
281
282// JobSupportedAction enumerates the values for job supported action.
283type JobSupportedAction string
284
285const (
286	// JobSupportedActionCancellable ...
287	JobSupportedActionCancellable JobSupportedAction = "Cancellable"
288	// JobSupportedActionInvalid ...
289	JobSupportedActionInvalid JobSupportedAction = "Invalid"
290	// JobSupportedActionRetriable ...
291	JobSupportedActionRetriable JobSupportedAction = "Retriable"
292)
293
294// PossibleJobSupportedActionValues returns an array of possible values for the JobSupportedAction const type.
295func PossibleJobSupportedActionValues() []JobSupportedAction {
296	return []JobSupportedAction{JobSupportedActionCancellable, JobSupportedActionInvalid, JobSupportedActionRetriable}
297}
298
299// JobType enumerates the values for job type.
300type JobType string
301
302const (
303	// JobTypeAzureIaaSVMJob ...
304	JobTypeAzureIaaSVMJob JobType = "AzureIaaSVMJob"
305	// JobTypeDpmJob ...
306	JobTypeDpmJob JobType = "DpmJob"
307	// JobTypeJob ...
308	JobTypeJob JobType = "Job"
309	// JobTypeMabJob ...
310	JobTypeMabJob JobType = "MabJob"
311)
312
313// PossibleJobTypeValues returns an array of possible values for the JobType const type.
314func PossibleJobTypeValues() []JobType {
315	return []JobType{JobTypeAzureIaaSVMJob, JobTypeDpmJob, JobTypeJob, JobTypeMabJob}
316}
317
318// MabServerType enumerates the values for mab server type.
319type MabServerType string
320
321const (
322	// MabServerTypeAzureSQLContainer ...
323	MabServerTypeAzureSQLContainer MabServerType = "AzureSqlContainer"
324	// MabServerTypeClusterResource ...
325	MabServerTypeClusterResource MabServerType = "ClusterResource"
326	// MabServerTypeDPMContainer ...
327	MabServerTypeDPMContainer MabServerType = "DPMContainer"
328	// MabServerTypeDPMVenusContainer ...
329	MabServerTypeDPMVenusContainer MabServerType = "DPMVenusContainer"
330	// MabServerTypeIaasVMContainer ...
331	MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer"
332	// MabServerTypeIaasVMServiceContainer ...
333	MabServerTypeIaasVMServiceContainer MabServerType = "IaasVMServiceContainer"
334	// MabServerTypeInvalid ...
335	MabServerTypeInvalid MabServerType = "Invalid"
336	// MabServerTypeMABContainer ...
337	MabServerTypeMABContainer MabServerType = "MABContainer"
338	// MabServerTypeUnknown ...
339	MabServerTypeUnknown MabServerType = "Unknown"
340	// MabServerTypeWindows ...
341	MabServerTypeWindows MabServerType = "Windows"
342	// MabServerTypeWindowsServer ...
343	MabServerTypeWindowsServer MabServerType = "WindowsServer"
344)
345
346// PossibleMabServerTypeValues returns an array of possible values for the MabServerType const type.
347func PossibleMabServerTypeValues() []MabServerType {
348	return []MabServerType{MabServerTypeAzureSQLContainer, MabServerTypeClusterResource, MabServerTypeDPMContainer, MabServerTypeDPMVenusContainer, MabServerTypeIaasVMContainer, MabServerTypeIaasVMServiceContainer, MabServerTypeInvalid, MabServerTypeMABContainer, MabServerTypeUnknown, MabServerTypeWindows, MabServerTypeWindowsServer}
349}
350
351// ManagementType enumerates the values for management type.
352type ManagementType string
353
354const (
355	// ManagementTypeAzureBackupServer ...
356	ManagementTypeAzureBackupServer ManagementType = "AzureBackupServer"
357	// ManagementTypeAzureIaasVM ...
358	ManagementTypeAzureIaasVM ManagementType = "AzureIaasVM"
359	// ManagementTypeAzureSQL ...
360	ManagementTypeAzureSQL ManagementType = "AzureSql"
361	// ManagementTypeDPM ...
362	ManagementTypeDPM ManagementType = "DPM"
363	// ManagementTypeInvalid ...
364	ManagementTypeInvalid ManagementType = "Invalid"
365	// ManagementTypeMAB ...
366	ManagementTypeMAB ManagementType = "MAB"
367)
368
369// PossibleManagementTypeValues returns an array of possible values for the ManagementType const type.
370func PossibleManagementTypeValues() []ManagementType {
371	return []ManagementType{ManagementTypeAzureBackupServer, ManagementTypeAzureIaasVM, ManagementTypeAzureSQL, ManagementTypeDPM, ManagementTypeInvalid, ManagementTypeMAB}
372}
373
374// ManagementTypeBasicProtectionPolicy enumerates the values for management type basic protection policy.
375type ManagementTypeBasicProtectionPolicy string
376
377const (
378	// BackupManagementTypeAzureIaasVM ...
379	BackupManagementTypeAzureIaasVM ManagementTypeBasicProtectionPolicy = "AzureIaasVM"
380	// BackupManagementTypeAzureSQL ...
381	BackupManagementTypeAzureSQL ManagementTypeBasicProtectionPolicy = "AzureSql"
382	// BackupManagementTypeMAB ...
383	BackupManagementTypeMAB ManagementTypeBasicProtectionPolicy = "MAB"
384	// BackupManagementTypeProtectionPolicy ...
385	BackupManagementTypeProtectionPolicy ManagementTypeBasicProtectionPolicy = "ProtectionPolicy"
386)
387
388// PossibleManagementTypeBasicProtectionPolicyValues returns an array of possible values for the ManagementTypeBasicProtectionPolicy const type.
389func PossibleManagementTypeBasicProtectionPolicyValues() []ManagementTypeBasicProtectionPolicy {
390	return []ManagementTypeBasicProtectionPolicy{BackupManagementTypeAzureIaasVM, BackupManagementTypeAzureSQL, BackupManagementTypeMAB, BackupManagementTypeProtectionPolicy}
391}
392
393// MonthOfYear enumerates the values for month of year.
394type MonthOfYear string
395
396const (
397	// MonthOfYearApril ...
398	MonthOfYearApril MonthOfYear = "April"
399	// MonthOfYearAugust ...
400	MonthOfYearAugust MonthOfYear = "August"
401	// MonthOfYearDecember ...
402	MonthOfYearDecember MonthOfYear = "December"
403	// MonthOfYearFebruary ...
404	MonthOfYearFebruary MonthOfYear = "February"
405	// MonthOfYearInvalid ...
406	MonthOfYearInvalid MonthOfYear = "Invalid"
407	// MonthOfYearJanuary ...
408	MonthOfYearJanuary MonthOfYear = "January"
409	// MonthOfYearJuly ...
410	MonthOfYearJuly MonthOfYear = "July"
411	// MonthOfYearJune ...
412	MonthOfYearJune MonthOfYear = "June"
413	// MonthOfYearMarch ...
414	MonthOfYearMarch MonthOfYear = "March"
415	// MonthOfYearMay ...
416	MonthOfYearMay MonthOfYear = "May"
417	// MonthOfYearNovember ...
418	MonthOfYearNovember MonthOfYear = "November"
419	// MonthOfYearOctober ...
420	MonthOfYearOctober MonthOfYear = "October"
421	// MonthOfYearSeptember ...
422	MonthOfYearSeptember MonthOfYear = "September"
423)
424
425// PossibleMonthOfYearValues returns an array of possible values for the MonthOfYear const type.
426func PossibleMonthOfYearValues() []MonthOfYear {
427	return []MonthOfYear{MonthOfYearApril, MonthOfYearAugust, MonthOfYearDecember, MonthOfYearFebruary, MonthOfYearInvalid, MonthOfYearJanuary, MonthOfYearJuly, MonthOfYearJune, MonthOfYearMarch, MonthOfYearMay, MonthOfYearNovember, MonthOfYearOctober, MonthOfYearSeptember}
428}
429
430// ObjectType enumerates the values for object type.
431type ObjectType string
432
433const (
434	// ObjectTypeOperationStatusExtendedInfo ...
435	ObjectTypeOperationStatusExtendedInfo ObjectType = "OperationStatusExtendedInfo"
436	// ObjectTypeOperationStatusJobExtendedInfo ...
437	ObjectTypeOperationStatusJobExtendedInfo ObjectType = "OperationStatusJobExtendedInfo"
438	// ObjectTypeOperationStatusJobsExtendedInfo ...
439	ObjectTypeOperationStatusJobsExtendedInfo ObjectType = "OperationStatusJobsExtendedInfo"
440	// ObjectTypeOperationStatusProvisionILRExtendedInfo ...
441	ObjectTypeOperationStatusProvisionILRExtendedInfo ObjectType = "OperationStatusProvisionILRExtendedInfo"
442)
443
444// PossibleObjectTypeValues returns an array of possible values for the ObjectType const type.
445func PossibleObjectTypeValues() []ObjectType {
446	return []ObjectType{ObjectTypeOperationStatusExtendedInfo, ObjectTypeOperationStatusJobExtendedInfo, ObjectTypeOperationStatusJobsExtendedInfo, ObjectTypeOperationStatusProvisionILRExtendedInfo}
447}
448
449// ObjectTypeBasicILRRequest enumerates the values for object type basic ilr request.
450type ObjectTypeBasicILRRequest string
451
452const (
453	// ObjectTypeIaasVMILRRegistrationRequest ...
454	ObjectTypeIaasVMILRRegistrationRequest ObjectTypeBasicILRRequest = "IaasVMILRRegistrationRequest"
455	// ObjectTypeILRRequest ...
456	ObjectTypeILRRequest ObjectTypeBasicILRRequest = "ILRRequest"
457)
458
459// PossibleObjectTypeBasicILRRequestValues returns an array of possible values for the ObjectTypeBasicILRRequest const type.
460func PossibleObjectTypeBasicILRRequestValues() []ObjectTypeBasicILRRequest {
461	return []ObjectTypeBasicILRRequest{ObjectTypeIaasVMILRRegistrationRequest, ObjectTypeILRRequest}
462}
463
464// ObjectTypeBasicOperationResultInfoBase enumerates the values for object type basic operation result info
465// base.
466type ObjectTypeBasicOperationResultInfoBase string
467
468const (
469	// ObjectTypeExportJobsOperationResultInfo ...
470	ObjectTypeExportJobsOperationResultInfo ObjectTypeBasicOperationResultInfoBase = "ExportJobsOperationResultInfo"
471	// ObjectTypeOperationResultInfo ...
472	ObjectTypeOperationResultInfo ObjectTypeBasicOperationResultInfoBase = "OperationResultInfo"
473	// ObjectTypeOperationResultInfoBase ...
474	ObjectTypeOperationResultInfoBase ObjectTypeBasicOperationResultInfoBase = "OperationResultInfoBase"
475)
476
477// PossibleObjectTypeBasicOperationResultInfoBaseValues returns an array of possible values for the ObjectTypeBasicOperationResultInfoBase const type.
478func PossibleObjectTypeBasicOperationResultInfoBaseValues() []ObjectTypeBasicOperationResultInfoBase {
479	return []ObjectTypeBasicOperationResultInfoBase{ObjectTypeExportJobsOperationResultInfo, ObjectTypeOperationResultInfo, ObjectTypeOperationResultInfoBase}
480}
481
482// ObjectTypeBasicRecoveryPoint enumerates the values for object type basic recovery point.
483type ObjectTypeBasicRecoveryPoint string
484
485const (
486	// ObjectTypeGenericRecoveryPoint ...
487	ObjectTypeGenericRecoveryPoint ObjectTypeBasicRecoveryPoint = "GenericRecoveryPoint"
488	// ObjectTypeIaasVMRecoveryPoint ...
489	ObjectTypeIaasVMRecoveryPoint ObjectTypeBasicRecoveryPoint = "IaasVMRecoveryPoint"
490	// ObjectTypeRecoveryPoint ...
491	ObjectTypeRecoveryPoint ObjectTypeBasicRecoveryPoint = "RecoveryPoint"
492)
493
494// PossibleObjectTypeBasicRecoveryPointValues returns an array of possible values for the ObjectTypeBasicRecoveryPoint const type.
495func PossibleObjectTypeBasicRecoveryPointValues() []ObjectTypeBasicRecoveryPoint {
496	return []ObjectTypeBasicRecoveryPoint{ObjectTypeGenericRecoveryPoint, ObjectTypeIaasVMRecoveryPoint, ObjectTypeRecoveryPoint}
497}
498
499// ObjectTypeBasicRequest enumerates the values for object type basic request.
500type ObjectTypeBasicRequest string
501
502const (
503	// ObjectTypeBackupRequest ...
504	ObjectTypeBackupRequest ObjectTypeBasicRequest = "BackupRequest"
505	// ObjectTypeIaasVMBackupRequest ...
506	ObjectTypeIaasVMBackupRequest ObjectTypeBasicRequest = "IaasVMBackupRequest"
507)
508
509// PossibleObjectTypeBasicRequestValues returns an array of possible values for the ObjectTypeBasicRequest const type.
510func PossibleObjectTypeBasicRequestValues() []ObjectTypeBasicRequest {
511	return []ObjectTypeBasicRequest{ObjectTypeBackupRequest, ObjectTypeIaasVMBackupRequest}
512}
513
514// ObjectTypeBasicRestoreRequest enumerates the values for object type basic restore request.
515type ObjectTypeBasicRestoreRequest string
516
517const (
518	// ObjectTypeIaasVMRestoreRequest ...
519	ObjectTypeIaasVMRestoreRequest ObjectTypeBasicRestoreRequest = "IaasVMRestoreRequest"
520	// ObjectTypeRestoreRequest ...
521	ObjectTypeRestoreRequest ObjectTypeBasicRestoreRequest = "RestoreRequest"
522)
523
524// PossibleObjectTypeBasicRestoreRequestValues returns an array of possible values for the ObjectTypeBasicRestoreRequest const type.
525func PossibleObjectTypeBasicRestoreRequestValues() []ObjectTypeBasicRestoreRequest {
526	return []ObjectTypeBasicRestoreRequest{ObjectTypeIaasVMRestoreRequest, ObjectTypeRestoreRequest}
527}
528
529// OperationStatusValues enumerates the values for operation status values.
530type OperationStatusValues string
531
532const (
533	// OperationStatusValuesCanceled ...
534	OperationStatusValuesCanceled OperationStatusValues = "Canceled"
535	// OperationStatusValuesFailed ...
536	OperationStatusValuesFailed OperationStatusValues = "Failed"
537	// OperationStatusValuesInProgress ...
538	OperationStatusValuesInProgress OperationStatusValues = "InProgress"
539	// OperationStatusValuesInvalid ...
540	OperationStatusValuesInvalid OperationStatusValues = "Invalid"
541	// OperationStatusValuesSucceeded ...
542	OperationStatusValuesSucceeded OperationStatusValues = "Succeeded"
543)
544
545// PossibleOperationStatusValuesValues returns an array of possible values for the OperationStatusValues const type.
546func PossibleOperationStatusValuesValues() []OperationStatusValues {
547	return []OperationStatusValues{OperationStatusValuesCanceled, OperationStatusValuesFailed, OperationStatusValuesInProgress, OperationStatusValuesInvalid, OperationStatusValuesSucceeded}
548}
549
550// ProtectableItemType enumerates the values for protectable item type.
551type ProtectableItemType string
552
553const (
554	// ProtectableItemTypeIaaSVMProtectableItem ...
555	ProtectableItemTypeIaaSVMProtectableItem ProtectableItemType = "IaaSVMProtectableItem"
556	// ProtectableItemTypeMicrosoftClassicComputevirtualMachines ...
557	ProtectableItemTypeMicrosoftClassicComputevirtualMachines ProtectableItemType = "Microsoft.ClassicCompute/virtualMachines"
558	// ProtectableItemTypeMicrosoftComputevirtualMachines ...
559	ProtectableItemTypeMicrosoftComputevirtualMachines ProtectableItemType = "Microsoft.Compute/virtualMachines"
560	// ProtectableItemTypeWorkloadProtectableItem ...
561	ProtectableItemTypeWorkloadProtectableItem ProtectableItemType = "WorkloadProtectableItem"
562)
563
564// PossibleProtectableItemTypeValues returns an array of possible values for the ProtectableItemType const type.
565func PossibleProtectableItemTypeValues() []ProtectableItemType {
566	return []ProtectableItemType{ProtectableItemTypeIaaSVMProtectableItem, ProtectableItemTypeMicrosoftClassicComputevirtualMachines, ProtectableItemTypeMicrosoftComputevirtualMachines, ProtectableItemTypeWorkloadProtectableItem}
567}
568
569// ProtectableObjectType enumerates the values for protectable object type.
570type ProtectableObjectType string
571
572const (
573	// ProtectableObjectTypeAzureSQLContainer ...
574	ProtectableObjectTypeAzureSQLContainer ProtectableObjectType = "AzureSqlContainer"
575	// ProtectableObjectTypeIaaSVMContainer ...
576	ProtectableObjectTypeIaaSVMContainer ProtectableObjectType = "IaaSVMContainer"
577	// ProtectableObjectTypeMABWindowsContainer ...
578	ProtectableObjectTypeMABWindowsContainer ProtectableObjectType = "MABWindowsContainer"
579	// ProtectableObjectTypeMicrosoftClassicComputevirtualMachines ...
580	ProtectableObjectTypeMicrosoftClassicComputevirtualMachines ProtectableObjectType = "Microsoft.ClassicCompute/virtualMachines"
581	// ProtectableObjectTypeMicrosoftComputevirtualMachines ...
582	ProtectableObjectTypeMicrosoftComputevirtualMachines ProtectableObjectType = "Microsoft.Compute/virtualMachines"
583	// ProtectableObjectTypeProtectionContainer ...
584	ProtectableObjectTypeProtectionContainer ProtectableObjectType = "ProtectionContainer"
585)
586
587// PossibleProtectableObjectTypeValues returns an array of possible values for the ProtectableObjectType const type.
588func PossibleProtectableObjectTypeValues() []ProtectableObjectType {
589	return []ProtectableObjectType{ProtectableObjectTypeAzureSQLContainer, ProtectableObjectTypeIaaSVMContainer, ProtectableObjectTypeMABWindowsContainer, ProtectableObjectTypeMicrosoftClassicComputevirtualMachines, ProtectableObjectTypeMicrosoftComputevirtualMachines, ProtectableObjectTypeProtectionContainer}
590}
591
592// ProtectedItemState enumerates the values for protected item state.
593type ProtectedItemState string
594
595const (
596	// ProtectedItemStateInvalid ...
597	ProtectedItemStateInvalid ProtectedItemState = "Invalid"
598	// ProtectedItemStateIRPending ...
599	ProtectedItemStateIRPending ProtectedItemState = "IRPending"
600	// ProtectedItemStateProtected ...
601	ProtectedItemStateProtected ProtectedItemState = "Protected"
602	// ProtectedItemStateProtectionError ...
603	ProtectedItemStateProtectionError ProtectedItemState = "ProtectionError"
604	// ProtectedItemStateProtectionPaused ...
605	ProtectedItemStateProtectionPaused ProtectedItemState = "ProtectionPaused"
606	// ProtectedItemStateProtectionStopped ...
607	ProtectedItemStateProtectionStopped ProtectedItemState = "ProtectionStopped"
608)
609
610// PossibleProtectedItemStateValues returns an array of possible values for the ProtectedItemState const type.
611func PossibleProtectedItemStateValues() []ProtectedItemState {
612	return []ProtectedItemState{ProtectedItemStateInvalid, ProtectedItemStateIRPending, ProtectedItemStateProtected, ProtectedItemStateProtectionError, ProtectedItemStateProtectionPaused, ProtectedItemStateProtectionStopped}
613}
614
615// ProtectedItemType enumerates the values for protected item type.
616type ProtectedItemType string
617
618const (
619	// ProtectedItemTypeAzureIaaSVMProtectedItem ...
620	ProtectedItemTypeAzureIaaSVMProtectedItem ProtectedItemType = "AzureIaaSVMProtectedItem"
621	// ProtectedItemTypeMabFileFolderProtectedItem ...
622	ProtectedItemTypeMabFileFolderProtectedItem ProtectedItemType = "MabFileFolderProtectedItem"
623	// ProtectedItemTypeMicrosoftClassicComputevirtualMachines ...
624	ProtectedItemTypeMicrosoftClassicComputevirtualMachines ProtectedItemType = "Microsoft.ClassicCompute/virtualMachines"
625	// ProtectedItemTypeMicrosoftComputevirtualMachines ...
626	ProtectedItemTypeMicrosoftComputevirtualMachines ProtectedItemType = "Microsoft.Compute/virtualMachines"
627	// ProtectedItemTypeMicrosoftSqlserversdatabases ...
628	ProtectedItemTypeMicrosoftSqlserversdatabases ProtectedItemType = "Microsoft.Sql/servers/databases"
629	// ProtectedItemTypeProtectedItem ...
630	ProtectedItemTypeProtectedItem ProtectedItemType = "ProtectedItem"
631)
632
633// PossibleProtectedItemTypeValues returns an array of possible values for the ProtectedItemType const type.
634func PossibleProtectedItemTypeValues() []ProtectedItemType {
635	return []ProtectedItemType{ProtectedItemTypeAzureIaaSVMProtectedItem, ProtectedItemTypeMabFileFolderProtectedItem, ProtectedItemTypeMicrosoftClassicComputevirtualMachines, ProtectedItemTypeMicrosoftComputevirtualMachines, ProtectedItemTypeMicrosoftSqlserversdatabases, ProtectedItemTypeProtectedItem}
636}
637
638// ProtectionState enumerates the values for protection state.
639type ProtectionState string
640
641const (
642	// ProtectionStateInvalid ...
643	ProtectionStateInvalid ProtectionState = "Invalid"
644	// ProtectionStateIRPending ...
645	ProtectionStateIRPending ProtectionState = "IRPending"
646	// ProtectionStateProtected ...
647	ProtectionStateProtected ProtectionState = "Protected"
648	// ProtectionStateProtectionError ...
649	ProtectionStateProtectionError ProtectionState = "ProtectionError"
650	// ProtectionStateProtectionPaused ...
651	ProtectionStateProtectionPaused ProtectionState = "ProtectionPaused"
652	// ProtectionStateProtectionStopped ...
653	ProtectionStateProtectionStopped ProtectionState = "ProtectionStopped"
654)
655
656// PossibleProtectionStateValues returns an array of possible values for the ProtectionState const type.
657func PossibleProtectionStateValues() []ProtectionState {
658	return []ProtectionState{ProtectionStateInvalid, ProtectionStateIRPending, ProtectionStateProtected, ProtectionStateProtectionError, ProtectionStateProtectionPaused, ProtectionStateProtectionStopped}
659}
660
661// ProtectionStatus enumerates the values for protection status.
662type ProtectionStatus string
663
664const (
665	// ProtectionStatusInvalid ...
666	ProtectionStatusInvalid ProtectionStatus = "Invalid"
667	// ProtectionStatusNotProtected ...
668	ProtectionStatusNotProtected ProtectionStatus = "NotProtected"
669	// ProtectionStatusProtected ...
670	ProtectionStatusProtected ProtectionStatus = "Protected"
671	// ProtectionStatusProtecting ...
672	ProtectionStatusProtecting ProtectionStatus = "Protecting"
673)
674
675// PossibleProtectionStatusValues returns an array of possible values for the ProtectionStatus const type.
676func PossibleProtectionStatusValues() []ProtectionStatus {
677	return []ProtectionStatus{ProtectionStatusInvalid, ProtectionStatusNotProtected, ProtectionStatusProtected, ProtectionStatusProtecting}
678}
679
680// RecoveryType enumerates the values for recovery type.
681type RecoveryType string
682
683const (
684	// RecoveryTypeAlternateLocation ...
685	RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation"
686	// RecoveryTypeInvalid ...
687	RecoveryTypeInvalid RecoveryType = "Invalid"
688	// RecoveryTypeOriginalLocation ...
689	RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation"
690	// RecoveryTypeRestoreDisks ...
691	RecoveryTypeRestoreDisks RecoveryType = "RestoreDisks"
692)
693
694// PossibleRecoveryTypeValues returns an array of possible values for the RecoveryType const type.
695func PossibleRecoveryTypeValues() []RecoveryType {
696	return []RecoveryType{RecoveryTypeAlternateLocation, RecoveryTypeInvalid, RecoveryTypeOriginalLocation, RecoveryTypeRestoreDisks}
697}
698
699// RetentionDurationType enumerates the values for retention duration type.
700type RetentionDurationType string
701
702const (
703	// RetentionDurationTypeDays ...
704	RetentionDurationTypeDays RetentionDurationType = "Days"
705	// RetentionDurationTypeInvalid ...
706	RetentionDurationTypeInvalid RetentionDurationType = "Invalid"
707	// RetentionDurationTypeMonths ...
708	RetentionDurationTypeMonths RetentionDurationType = "Months"
709	// RetentionDurationTypeWeeks ...
710	RetentionDurationTypeWeeks RetentionDurationType = "Weeks"
711	// RetentionDurationTypeYears ...
712	RetentionDurationTypeYears RetentionDurationType = "Years"
713)
714
715// PossibleRetentionDurationTypeValues returns an array of possible values for the RetentionDurationType const type.
716func PossibleRetentionDurationTypeValues() []RetentionDurationType {
717	return []RetentionDurationType{RetentionDurationTypeDays, RetentionDurationTypeInvalid, RetentionDurationTypeMonths, RetentionDurationTypeWeeks, RetentionDurationTypeYears}
718}
719
720// RetentionPolicyType enumerates the values for retention policy type.
721type RetentionPolicyType string
722
723const (
724	// RetentionPolicyTypeLongTermRetentionPolicy ...
725	RetentionPolicyTypeLongTermRetentionPolicy RetentionPolicyType = "LongTermRetentionPolicy"
726	// RetentionPolicyTypeRetentionPolicy ...
727	RetentionPolicyTypeRetentionPolicy RetentionPolicyType = "RetentionPolicy"
728	// RetentionPolicyTypeSimpleRetentionPolicy ...
729	RetentionPolicyTypeSimpleRetentionPolicy RetentionPolicyType = "SimpleRetentionPolicy"
730)
731
732// PossibleRetentionPolicyTypeValues returns an array of possible values for the RetentionPolicyType const type.
733func PossibleRetentionPolicyTypeValues() []RetentionPolicyType {
734	return []RetentionPolicyType{RetentionPolicyTypeLongTermRetentionPolicy, RetentionPolicyTypeRetentionPolicy, RetentionPolicyTypeSimpleRetentionPolicy}
735}
736
737// RetentionScheduleFormat enumerates the values for retention schedule format.
738type RetentionScheduleFormat string
739
740const (
741	// RetentionScheduleFormatDaily ...
742	RetentionScheduleFormatDaily RetentionScheduleFormat = "Daily"
743	// RetentionScheduleFormatInvalid ...
744	RetentionScheduleFormatInvalid RetentionScheduleFormat = "Invalid"
745	// RetentionScheduleFormatWeekly ...
746	RetentionScheduleFormatWeekly RetentionScheduleFormat = "Weekly"
747)
748
749// PossibleRetentionScheduleFormatValues returns an array of possible values for the RetentionScheduleFormat const type.
750func PossibleRetentionScheduleFormatValues() []RetentionScheduleFormat {
751	return []RetentionScheduleFormat{RetentionScheduleFormatDaily, RetentionScheduleFormatInvalid, RetentionScheduleFormatWeekly}
752}
753
754// SchedulePolicyType enumerates the values for schedule policy type.
755type SchedulePolicyType string
756
757const (
758	// SchedulePolicyTypeLongTermSchedulePolicy ...
759	SchedulePolicyTypeLongTermSchedulePolicy SchedulePolicyType = "LongTermSchedulePolicy"
760	// SchedulePolicyTypeSchedulePolicy ...
761	SchedulePolicyTypeSchedulePolicy SchedulePolicyType = "SchedulePolicy"
762	// SchedulePolicyTypeSimpleSchedulePolicy ...
763	SchedulePolicyTypeSimpleSchedulePolicy SchedulePolicyType = "SimpleSchedulePolicy"
764)
765
766// PossibleSchedulePolicyTypeValues returns an array of possible values for the SchedulePolicyType const type.
767func PossibleSchedulePolicyTypeValues() []SchedulePolicyType {
768	return []SchedulePolicyType{SchedulePolicyTypeLongTermSchedulePolicy, SchedulePolicyTypeSchedulePolicy, SchedulePolicyTypeSimpleSchedulePolicy}
769}
770
771// ScheduleRunType enumerates the values for schedule run type.
772type ScheduleRunType string
773
774const (
775	// ScheduleRunTypeDaily ...
776	ScheduleRunTypeDaily ScheduleRunType = "Daily"
777	// ScheduleRunTypeInvalid ...
778	ScheduleRunTypeInvalid ScheduleRunType = "Invalid"
779	// ScheduleRunTypeWeekly ...
780	ScheduleRunTypeWeekly ScheduleRunType = "Weekly"
781)
782
783// PossibleScheduleRunTypeValues returns an array of possible values for the ScheduleRunType const type.
784func PossibleScheduleRunTypeValues() []ScheduleRunType {
785	return []ScheduleRunType{ScheduleRunTypeDaily, ScheduleRunTypeInvalid, ScheduleRunTypeWeekly}
786}
787
788// WeekOfMonth enumerates the values for week of month.
789type WeekOfMonth string
790
791const (
792	// First ...
793	First WeekOfMonth = "First"
794	// Fourth ...
795	Fourth WeekOfMonth = "Fourth"
796	// Last ...
797	Last WeekOfMonth = "Last"
798	// Second ...
799	Second WeekOfMonth = "Second"
800	// Third ...
801	Third WeekOfMonth = "Third"
802)
803
804// PossibleWeekOfMonthValues returns an array of possible values for the WeekOfMonth const type.
805func PossibleWeekOfMonthValues() []WeekOfMonth {
806	return []WeekOfMonth{First, Fourth, Last, Second, Third}
807}
808
809// WorkloadType enumerates the values for workload type.
810type WorkloadType string
811
812const (
813	// WorkloadTypeAzureSQLDb ...
814	WorkloadTypeAzureSQLDb WorkloadType = "AzureSqlDb"
815	// WorkloadTypeDPMUnknown ...
816	WorkloadTypeDPMUnknown WorkloadType = "DPMUnknown"
817	// WorkloadTypeExchange ...
818	WorkloadTypeExchange WorkloadType = "Exchange"
819	// WorkloadTypeFileFolder ...
820	WorkloadTypeFileFolder WorkloadType = "FileFolder"
821	// WorkloadTypeInvalid ...
822	WorkloadTypeInvalid WorkloadType = "Invalid"
823	// WorkloadTypeSharepoint ...
824	WorkloadTypeSharepoint WorkloadType = "Sharepoint"
825	// WorkloadTypeSQLDB ...
826	WorkloadTypeSQLDB WorkloadType = "SQLDB"
827	// WorkloadTypeVM ...
828	WorkloadTypeVM WorkloadType = "VM"
829)
830
831// PossibleWorkloadTypeValues returns an array of possible values for the WorkloadType const type.
832func PossibleWorkloadTypeValues() []WorkloadType {
833	return []WorkloadType{WorkloadTypeAzureSQLDb, WorkloadTypeDPMUnknown, WorkloadTypeExchange, WorkloadTypeFileFolder, WorkloadTypeInvalid, WorkloadTypeSharepoint, WorkloadTypeSQLDB, WorkloadTypeVM}
834}
835
836// AzureBackupServerEngine the backup engine type when Azure Backup Server is used to manage the backups.
837type AzureBackupServerEngine struct {
838	// FriendlyName - The friendly name of the backup engine.
839	FriendlyName *string `json:"friendlyName,omitempty"`
840	// BackupManagementType - The type of backup management associated with the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
841	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
842	// RegistrationStatus - The status of the backup engine registration with the Recovery Services vault.
843	RegistrationStatus *string `json:"registrationStatus,omitempty"`
844	// HealthStatus - The backup status of the backup engine.
845	HealthStatus *string `json:"healthStatus,omitempty"`
846	// CanReRegister - The flag indicating whether the backup engine be registered again, once the engine has been initially registered.
847	CanReRegister *bool `json:"canReRegister,omitempty"`
848	// BackupEngineID - The ID of the backup engine.
849	BackupEngineID *string `json:"backupEngineId,omitempty"`
850	// BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine'
851	BackupEngineType EngineType `json:"backupEngineType,omitempty"`
852}
853
854// MarshalJSON is the custom marshaler for AzureBackupServerEngine.
855func (abse AzureBackupServerEngine) MarshalJSON() ([]byte, error) {
856	abse.BackupEngineType = BackupEngineTypeAzureBackupServerEngine
857	objectMap := make(map[string]interface{})
858	if abse.FriendlyName != nil {
859		objectMap["friendlyName"] = abse.FriendlyName
860	}
861	if abse.BackupManagementType != "" {
862		objectMap["backupManagementType"] = abse.BackupManagementType
863	}
864	if abse.RegistrationStatus != nil {
865		objectMap["registrationStatus"] = abse.RegistrationStatus
866	}
867	if abse.HealthStatus != nil {
868		objectMap["healthStatus"] = abse.HealthStatus
869	}
870	if abse.CanReRegister != nil {
871		objectMap["canReRegister"] = abse.CanReRegister
872	}
873	if abse.BackupEngineID != nil {
874		objectMap["backupEngineId"] = abse.BackupEngineID
875	}
876	if abse.BackupEngineType != "" {
877		objectMap["backupEngineType"] = abse.BackupEngineType
878	}
879	return json.Marshal(objectMap)
880}
881
882// AsAzureBackupServerEngine is the BasicEngineBase implementation for AzureBackupServerEngine.
883func (abse AzureBackupServerEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) {
884	return &abse, true
885}
886
887// AsDpmBackupEngine is the BasicEngineBase implementation for AzureBackupServerEngine.
888func (abse AzureBackupServerEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) {
889	return nil, false
890}
891
892// AsEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine.
893func (abse AzureBackupServerEngine) AsEngineBase() (*EngineBase, bool) {
894	return nil, false
895}
896
897// AsBasicEngineBase is the BasicEngineBase implementation for AzureBackupServerEngine.
898func (abse AzureBackupServerEngine) AsBasicEngineBase() (BasicEngineBase, bool) {
899	return &abse, true
900}
901
902// AzureIaaSClassicComputeVMContainer iaaS VM workload-specific backup item representing a classic-deployed
903// virtual machine.
904type AzureIaaSClassicComputeVMContainer struct {
905	// VirtualMachineID - The fully qualified Resource Manager URL of the virtual machine represented by this Azure IaaS VM container.
906	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
907	// VirtualMachineVersion - Specifies whether the container represents a classic or a Resource Manager-deployed virtual machine.
908	VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"`
909	// ResourceGroup - The resource group name associated with the Recovery Services vault.
910	ResourceGroup *string `json:"resourceGroup,omitempty"`
911	// FriendlyName - Friendly name of the container.
912	FriendlyName *string `json:"friendlyName,omitempty"`
913	// BackupManagementType - The backup management type for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
914	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
915	// RegistrationStatus - The container's registration status with the Recovery Services vault.
916	RegistrationStatus *string `json:"registrationStatus,omitempty"`
917	// HealthStatus - The status of the container's health.
918	HealthStatus *string `json:"healthStatus,omitempty"`
919	// ContainerType - READ-ONLY; The type assigned to the container. The values to use for each of these properties are:<br/> 1. Compute Azure VM is Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows machines (like Azure Backup Server and DPM) is Windows<br/> 4. Azure SQL instance is AzureSqlContainer.
920	ContainerType *string `json:"containerType,omitempty"`
921	// ProtectableObjectType - Possible values include: 'ProtectableObjectTypeProtectionContainer', 'ProtectableObjectTypeAzureSQLContainer', 'ProtectableObjectTypeIaaSVMContainer', 'ProtectableObjectTypeMABWindowsContainer', 'ProtectableObjectTypeMicrosoftComputevirtualMachines', 'ProtectableObjectTypeMicrosoftClassicComputevirtualMachines'
922	ProtectableObjectType ProtectableObjectType `json:"protectableObjectType,omitempty"`
923}
924
925// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMContainer.
926func (aisccvc AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) {
927	aisccvc.ProtectableObjectType = ProtectableObjectTypeMicrosoftClassicComputevirtualMachines
928	objectMap := make(map[string]interface{})
929	if aisccvc.VirtualMachineID != nil {
930		objectMap["virtualMachineId"] = aisccvc.VirtualMachineID
931	}
932	if aisccvc.VirtualMachineVersion != nil {
933		objectMap["virtualMachineVersion"] = aisccvc.VirtualMachineVersion
934	}
935	if aisccvc.ResourceGroup != nil {
936		objectMap["resourceGroup"] = aisccvc.ResourceGroup
937	}
938	if aisccvc.FriendlyName != nil {
939		objectMap["friendlyName"] = aisccvc.FriendlyName
940	}
941	if aisccvc.BackupManagementType != "" {
942		objectMap["backupManagementType"] = aisccvc.BackupManagementType
943	}
944	if aisccvc.RegistrationStatus != nil {
945		objectMap["registrationStatus"] = aisccvc.RegistrationStatus
946	}
947	if aisccvc.HealthStatus != nil {
948		objectMap["healthStatus"] = aisccvc.HealthStatus
949	}
950	if aisccvc.ProtectableObjectType != "" {
951		objectMap["protectableObjectType"] = aisccvc.ProtectableObjectType
952	}
953	return json.Marshal(objectMap)
954}
955
956// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
957func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) {
958	return nil, false
959}
960
961// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
962func (aisccvc AzureIaaSClassicComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) {
963	return nil, false
964}
965
966// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
967func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) {
968	return &aisccvc, true
969}
970
971// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
972func (aisccvc AzureIaaSClassicComputeVMContainer) AsMabContainer() (*MabContainer, bool) {
973	return nil, false
974}
975
976// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
977func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) {
978	return nil, false
979}
980
981// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
982func (aisccvc AzureIaaSClassicComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) {
983	return &aisccvc, true
984}
985
986// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
987func (aisccvc AzureIaaSClassicComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) {
988	return nil, false
989}
990
991// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSClassicComputeVMContainer.
992func (aisccvc AzureIaaSClassicComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) {
993	return &aisccvc, true
994}
995
996// AzureIaaSClassicComputeVMProtectableItem iaaS VM workload-specific backup item representing a classic
997// VM.
998type AzureIaaSClassicComputeVMProtectableItem struct {
999	// VirtualMachineID - The fully qualified Resource Manager ID of the virtual machine.
1000	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
1001	// BackupManagementType - The backup management type.
1002	BackupManagementType *string `json:"backupManagementType,omitempty"`
1003	// FriendlyName - The friendly name of the backup item.
1004	FriendlyName *string `json:"friendlyName,omitempty"`
1005	// ProtectionState - The state of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected'
1006	ProtectionState ProtectionStatus `json:"protectionState,omitempty"`
1007	// ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeIaaSVMProtectableItem', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines'
1008	ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"`
1009}
1010
1011// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectableItem.
1012func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) {
1013	aisccvpi.ProtectableItemType = ProtectableItemTypeMicrosoftClassicComputevirtualMachines
1014	objectMap := make(map[string]interface{})
1015	if aisccvpi.VirtualMachineID != nil {
1016		objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID
1017	}
1018	if aisccvpi.BackupManagementType != nil {
1019		objectMap["backupManagementType"] = aisccvpi.BackupManagementType
1020	}
1021	if aisccvpi.FriendlyName != nil {
1022		objectMap["friendlyName"] = aisccvpi.FriendlyName
1023	}
1024	if aisccvpi.ProtectionState != "" {
1025		objectMap["protectionState"] = aisccvpi.ProtectionState
1026	}
1027	if aisccvpi.ProtectableItemType != "" {
1028		objectMap["protectableItemType"] = aisccvpi.ProtectableItemType
1029	}
1030	return json.Marshal(objectMap)
1031}
1032
1033// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem.
1034func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) {
1035	return nil, false
1036}
1037
1038// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem.
1039func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) {
1040	return &aisccvpi, true
1041}
1042
1043// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem.
1044func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) {
1045	return nil, false
1046}
1047
1048// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem.
1049func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) {
1050	return &aisccvpi, true
1051}
1052
1053// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem.
1054func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) {
1055	return nil, false
1056}
1057
1058// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSClassicComputeVMProtectableItem.
1059func (aisccvpi AzureIaaSClassicComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) {
1060	return &aisccvpi, true
1061}
1062
1063// AzureIaaSClassicComputeVMProtectedItem iaaS VM workload-specific backup item representing the classic
1064// VM.
1065type AzureIaaSClassicComputeVMProtectedItem struct {
1066	// FriendlyName - The friendly name of the VM represented by this backup item.
1067	FriendlyName *string `json:"friendlyName,omitempty"`
1068	// VirtualMachineID - The fully qualified Resource Manager ID of the virtual machine represented by this item.
1069	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
1070	// ProtectionStatus - The backup status of this backup item.
1071	ProtectionStatus *string `json:"protectionStatus,omitempty"`
1072	// ProtectionState - The backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused'
1073	ProtectionState ProtectionState `json:"protectionState,omitempty"`
1074	// LastBackupStatus - The last backup operation status. The possible values are: Healthy or Unhealthy.
1075	LastBackupStatus *string `json:"lastBackupStatus,omitempty"`
1076	// LastBackupTime - The timestamp of the last backup operation for this backup item.
1077	LastBackupTime *date.Time `json:"lastBackupTime,omitempty"`
1078	// ExtendedInfo - Additional information for this backup item.
1079	ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"`
1080	// BackupManagementType - The backup management type associated with the backup item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
1081	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
1082	// WorkloadType - The workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'
1083	WorkloadType DataSourceType `json:"workloadType,omitempty"`
1084	// SourceResourceID - The ID of the resource to be backed up.
1085	SourceResourceID *string `json:"sourceResourceId,omitempty"`
1086	// PolicyID - The ID of the backup policy associated with this backup item.
1087	PolicyID *string `json:"policyId,omitempty"`
1088	// LastRecoveryPoint - The timestamp when the most recent backup copy was created for this backup item.
1089	LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"`
1090	// ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines'
1091	ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"`
1092}
1093
1094// MarshalJSON is the custom marshaler for AzureIaaSClassicComputeVMProtectedItem.
1095func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) {
1096	aisccvpi.ProtectedItemType = ProtectedItemTypeMicrosoftClassicComputevirtualMachines
1097	objectMap := make(map[string]interface{})
1098	if aisccvpi.FriendlyName != nil {
1099		objectMap["friendlyName"] = aisccvpi.FriendlyName
1100	}
1101	if aisccvpi.VirtualMachineID != nil {
1102		objectMap["virtualMachineId"] = aisccvpi.VirtualMachineID
1103	}
1104	if aisccvpi.ProtectionStatus != nil {
1105		objectMap["protectionStatus"] = aisccvpi.ProtectionStatus
1106	}
1107	if aisccvpi.ProtectionState != "" {
1108		objectMap["protectionState"] = aisccvpi.ProtectionState
1109	}
1110	if aisccvpi.LastBackupStatus != nil {
1111		objectMap["lastBackupStatus"] = aisccvpi.LastBackupStatus
1112	}
1113	if aisccvpi.LastBackupTime != nil {
1114		objectMap["lastBackupTime"] = aisccvpi.LastBackupTime
1115	}
1116	if aisccvpi.ExtendedInfo != nil {
1117		objectMap["extendedInfo"] = aisccvpi.ExtendedInfo
1118	}
1119	if aisccvpi.BackupManagementType != "" {
1120		objectMap["backupManagementType"] = aisccvpi.BackupManagementType
1121	}
1122	if aisccvpi.WorkloadType != "" {
1123		objectMap["workloadType"] = aisccvpi.WorkloadType
1124	}
1125	if aisccvpi.SourceResourceID != nil {
1126		objectMap["sourceResourceId"] = aisccvpi.SourceResourceID
1127	}
1128	if aisccvpi.PolicyID != nil {
1129		objectMap["policyId"] = aisccvpi.PolicyID
1130	}
1131	if aisccvpi.LastRecoveryPoint != nil {
1132		objectMap["lastRecoveryPoint"] = aisccvpi.LastRecoveryPoint
1133	}
1134	if aisccvpi.ProtectedItemType != "" {
1135		objectMap["protectedItemType"] = aisccvpi.ProtectedItemType
1136	}
1137	return json.Marshal(objectMap)
1138}
1139
1140// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1141func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) {
1142	return nil, false
1143}
1144
1145// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1146func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) {
1147	return &aisccvpi, true
1148}
1149
1150// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1151func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) {
1152	return nil, false
1153}
1154
1155// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1156func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) {
1157	return nil, false
1158}
1159
1160// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1161func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) {
1162	return nil, false
1163}
1164
1165// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1166func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) {
1167	return &aisccvpi, true
1168}
1169
1170// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1171func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) {
1172	return nil, false
1173}
1174
1175// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSClassicComputeVMProtectedItem.
1176func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) {
1177	return &aisccvpi, true
1178}
1179
1180// AzureIaaSComputeVMContainer iaaS VM workload-specific backup item representing a Resource
1181// Manager-deployed virtual machine.
1182type AzureIaaSComputeVMContainer struct {
1183	// VirtualMachineID - The fully qualified Resource Manager URL of the virtual machine represented by this Azure IaaS VM container.
1184	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
1185	// VirtualMachineVersion - Specifies whether the container represents a classic or a Resource Manager-deployed virtual machine.
1186	VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"`
1187	// ResourceGroup - The resource group name associated with the Recovery Services vault.
1188	ResourceGroup *string `json:"resourceGroup,omitempty"`
1189	// FriendlyName - Friendly name of the container.
1190	FriendlyName *string `json:"friendlyName,omitempty"`
1191	// BackupManagementType - The backup management type for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
1192	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
1193	// RegistrationStatus - The container's registration status with the Recovery Services vault.
1194	RegistrationStatus *string `json:"registrationStatus,omitempty"`
1195	// HealthStatus - The status of the container's health.
1196	HealthStatus *string `json:"healthStatus,omitempty"`
1197	// ContainerType - READ-ONLY; The type assigned to the container. The values to use for each of these properties are:<br/> 1. Compute Azure VM is Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows machines (like Azure Backup Server and DPM) is Windows<br/> 4. Azure SQL instance is AzureSqlContainer.
1198	ContainerType *string `json:"containerType,omitempty"`
1199	// ProtectableObjectType - Possible values include: 'ProtectableObjectTypeProtectionContainer', 'ProtectableObjectTypeAzureSQLContainer', 'ProtectableObjectTypeIaaSVMContainer', 'ProtectableObjectTypeMABWindowsContainer', 'ProtectableObjectTypeMicrosoftComputevirtualMachines', 'ProtectableObjectTypeMicrosoftClassicComputevirtualMachines'
1200	ProtectableObjectType ProtectableObjectType `json:"protectableObjectType,omitempty"`
1201}
1202
1203// MarshalJSON is the custom marshaler for AzureIaaSComputeVMContainer.
1204func (aiscvc AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) {
1205	aiscvc.ProtectableObjectType = ProtectableObjectTypeMicrosoftComputevirtualMachines
1206	objectMap := make(map[string]interface{})
1207	if aiscvc.VirtualMachineID != nil {
1208		objectMap["virtualMachineId"] = aiscvc.VirtualMachineID
1209	}
1210	if aiscvc.VirtualMachineVersion != nil {
1211		objectMap["virtualMachineVersion"] = aiscvc.VirtualMachineVersion
1212	}
1213	if aiscvc.ResourceGroup != nil {
1214		objectMap["resourceGroup"] = aiscvc.ResourceGroup
1215	}
1216	if aiscvc.FriendlyName != nil {
1217		objectMap["friendlyName"] = aiscvc.FriendlyName
1218	}
1219	if aiscvc.BackupManagementType != "" {
1220		objectMap["backupManagementType"] = aiscvc.BackupManagementType
1221	}
1222	if aiscvc.RegistrationStatus != nil {
1223		objectMap["registrationStatus"] = aiscvc.RegistrationStatus
1224	}
1225	if aiscvc.HealthStatus != nil {
1226		objectMap["healthStatus"] = aiscvc.HealthStatus
1227	}
1228	if aiscvc.ProtectableObjectType != "" {
1229		objectMap["protectableObjectType"] = aiscvc.ProtectableObjectType
1230	}
1231	return json.Marshal(objectMap)
1232}
1233
1234// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1235func (aiscvc AzureIaaSComputeVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) {
1236	return nil, false
1237}
1238
1239// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1240func (aiscvc AzureIaaSComputeVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) {
1241	return nil, false
1242}
1243
1244// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1245func (aiscvc AzureIaaSComputeVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) {
1246	return &aiscvc, true
1247}
1248
1249// AsMabContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1250func (aiscvc AzureIaaSComputeVMContainer) AsMabContainer() (*MabContainer, bool) {
1251	return nil, false
1252}
1253
1254// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1255func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) {
1256	return &aiscvc, true
1257}
1258
1259// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1260func (aiscvc AzureIaaSComputeVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) {
1261	return nil, false
1262}
1263
1264// AsProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1265func (aiscvc AzureIaaSComputeVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) {
1266	return nil, false
1267}
1268
1269// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureIaaSComputeVMContainer.
1270func (aiscvc AzureIaaSComputeVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) {
1271	return &aiscvc, true
1272}
1273
1274// AzureIaaSComputeVMProtectableItem iaaS VM workload-specific backup item representing a Resource Manager
1275// VM.
1276type AzureIaaSComputeVMProtectableItem struct {
1277	// VirtualMachineID - The fully qualified Resource Manager ID of the virtual machine.
1278	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
1279	// BackupManagementType - The backup management type.
1280	BackupManagementType *string `json:"backupManagementType,omitempty"`
1281	// FriendlyName - The friendly name of the backup item.
1282	FriendlyName *string `json:"friendlyName,omitempty"`
1283	// ProtectionState - The state of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected'
1284	ProtectionState ProtectionStatus `json:"protectionState,omitempty"`
1285	// ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeIaaSVMProtectableItem', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines'
1286	ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"`
1287}
1288
1289// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectableItem.
1290func (aiscvpi AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) {
1291	aiscvpi.ProtectableItemType = ProtectableItemTypeMicrosoftComputevirtualMachines
1292	objectMap := make(map[string]interface{})
1293	if aiscvpi.VirtualMachineID != nil {
1294		objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID
1295	}
1296	if aiscvpi.BackupManagementType != nil {
1297		objectMap["backupManagementType"] = aiscvpi.BackupManagementType
1298	}
1299	if aiscvpi.FriendlyName != nil {
1300		objectMap["friendlyName"] = aiscvpi.FriendlyName
1301	}
1302	if aiscvpi.ProtectionState != "" {
1303		objectMap["protectionState"] = aiscvpi.ProtectionState
1304	}
1305	if aiscvpi.ProtectableItemType != "" {
1306		objectMap["protectableItemType"] = aiscvpi.ProtectableItemType
1307	}
1308	return json.Marshal(objectMap)
1309}
1310
1311// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem.
1312func (aiscvpi AzureIaaSComputeVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) {
1313	return nil, false
1314}
1315
1316// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem.
1317func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) {
1318	return &aiscvpi, true
1319}
1320
1321// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem.
1322func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) {
1323	return &aiscvpi, true
1324}
1325
1326// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem.
1327func (aiscvpi AzureIaaSComputeVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) {
1328	return nil, false
1329}
1330
1331// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem.
1332func (aiscvpi AzureIaaSComputeVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) {
1333	return nil, false
1334}
1335
1336// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for AzureIaaSComputeVMProtectableItem.
1337func (aiscvpi AzureIaaSComputeVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) {
1338	return &aiscvpi, true
1339}
1340
1341// AzureIaaSComputeVMProtectedItem iaaS VM workload-specific backup item representing the Resource Manager
1342// VM.
1343type AzureIaaSComputeVMProtectedItem struct {
1344	// FriendlyName - The friendly name of the VM represented by this backup item.
1345	FriendlyName *string `json:"friendlyName,omitempty"`
1346	// VirtualMachineID - The fully qualified Resource Manager ID of the virtual machine represented by this item.
1347	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
1348	// ProtectionStatus - The backup status of this backup item.
1349	ProtectionStatus *string `json:"protectionStatus,omitempty"`
1350	// ProtectionState - The backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused'
1351	ProtectionState ProtectionState `json:"protectionState,omitempty"`
1352	// LastBackupStatus - The last backup operation status. The possible values are: Healthy or Unhealthy.
1353	LastBackupStatus *string `json:"lastBackupStatus,omitempty"`
1354	// LastBackupTime - The timestamp of the last backup operation for this backup item.
1355	LastBackupTime *date.Time `json:"lastBackupTime,omitempty"`
1356	// ExtendedInfo - Additional information for this backup item.
1357	ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"`
1358	// BackupManagementType - The backup management type associated with the backup item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
1359	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
1360	// WorkloadType - The workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'
1361	WorkloadType DataSourceType `json:"workloadType,omitempty"`
1362	// SourceResourceID - The ID of the resource to be backed up.
1363	SourceResourceID *string `json:"sourceResourceId,omitempty"`
1364	// PolicyID - The ID of the backup policy associated with this backup item.
1365	PolicyID *string `json:"policyId,omitempty"`
1366	// LastRecoveryPoint - The timestamp when the most recent backup copy was created for this backup item.
1367	LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"`
1368	// ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines'
1369	ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"`
1370}
1371
1372// MarshalJSON is the custom marshaler for AzureIaaSComputeVMProtectedItem.
1373func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) {
1374	aiscvpi.ProtectedItemType = ProtectedItemTypeMicrosoftComputevirtualMachines
1375	objectMap := make(map[string]interface{})
1376	if aiscvpi.FriendlyName != nil {
1377		objectMap["friendlyName"] = aiscvpi.FriendlyName
1378	}
1379	if aiscvpi.VirtualMachineID != nil {
1380		objectMap["virtualMachineId"] = aiscvpi.VirtualMachineID
1381	}
1382	if aiscvpi.ProtectionStatus != nil {
1383		objectMap["protectionStatus"] = aiscvpi.ProtectionStatus
1384	}
1385	if aiscvpi.ProtectionState != "" {
1386		objectMap["protectionState"] = aiscvpi.ProtectionState
1387	}
1388	if aiscvpi.LastBackupStatus != nil {
1389		objectMap["lastBackupStatus"] = aiscvpi.LastBackupStatus
1390	}
1391	if aiscvpi.LastBackupTime != nil {
1392		objectMap["lastBackupTime"] = aiscvpi.LastBackupTime
1393	}
1394	if aiscvpi.ExtendedInfo != nil {
1395		objectMap["extendedInfo"] = aiscvpi.ExtendedInfo
1396	}
1397	if aiscvpi.BackupManagementType != "" {
1398		objectMap["backupManagementType"] = aiscvpi.BackupManagementType
1399	}
1400	if aiscvpi.WorkloadType != "" {
1401		objectMap["workloadType"] = aiscvpi.WorkloadType
1402	}
1403	if aiscvpi.SourceResourceID != nil {
1404		objectMap["sourceResourceId"] = aiscvpi.SourceResourceID
1405	}
1406	if aiscvpi.PolicyID != nil {
1407		objectMap["policyId"] = aiscvpi.PolicyID
1408	}
1409	if aiscvpi.LastRecoveryPoint != nil {
1410		objectMap["lastRecoveryPoint"] = aiscvpi.LastRecoveryPoint
1411	}
1412	if aiscvpi.ProtectedItemType != "" {
1413		objectMap["protectedItemType"] = aiscvpi.ProtectedItemType
1414	}
1415	return json.Marshal(objectMap)
1416}
1417
1418// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1419func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) {
1420	return nil, false
1421}
1422
1423// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1424func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) {
1425	return &aiscvpi, true
1426}
1427
1428// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1429func (aiscvpi AzureIaaSComputeVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) {
1430	return nil, false
1431}
1432
1433// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1434func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) {
1435	return nil, false
1436}
1437
1438// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1439func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) {
1440	return &aiscvpi, true
1441}
1442
1443// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1444func (aiscvpi AzureIaaSComputeVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) {
1445	return nil, false
1446}
1447
1448// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1449func (aiscvpi AzureIaaSComputeVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) {
1450	return nil, false
1451}
1452
1453// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSComputeVMProtectedItem.
1454func (aiscvpi AzureIaaSComputeVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) {
1455	return &aiscvpi, true
1456}
1457
1458// AzureIaaSVMErrorInfo azure IaaS VM workload-specific error information.
1459type AzureIaaSVMErrorInfo struct {
1460	// ErrorCode - Error code.
1461	ErrorCode *int32 `json:"errorCode,omitempty"`
1462	// ErrorTitle - Title: typically, the entity associated the error.
1463	ErrorTitle *string `json:"errorTitle,omitempty"`
1464	// ErrorString - Localized error string.
1465	ErrorString *string `json:"errorString,omitempty"`
1466	// Recommendations - List of localized recommendations for the error string.
1467	Recommendations *[]string `json:"recommendations,omitempty"`
1468}
1469
1470// AzureIaaSVMJob the Azure IaaS VM workload-specific job object.
1471type AzureIaaSVMJob struct {
1472	// Duration - The time that elapsed during the execution of this job.
1473	Duration *string `json:"duration,omitempty"`
1474	// ActionsInfo - Gets or sets the state, or actions, applicable on this job. Examples of the actions are: Cancel or Retry.
1475	ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"`
1476	// ErrorDetails - Error details about this job.
1477	ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"`
1478	// VirtualMachineVersion - Specifies whether the backup item is a Classic VM or a Resource Manager VM.
1479	VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"`
1480	// ExtendedInfo - Additional information for this job.
1481	ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"`
1482	// EntityFriendlyName - The friendly name of the entity on which the current job is executing.
1483	EntityFriendlyName *string `json:"entityFriendlyName,omitempty"`
1484	// BackupManagementType - The backup management type for the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
1485	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
1486	// Operation - The operation name.
1487	Operation *string `json:"operation,omitempty"`
1488	// Status - The job status.
1489	Status *string `json:"status,omitempty"`
1490	// StartTime - The start time.
1491	StartTime *date.Time `json:"startTime,omitempty"`
1492	// EndTime - The end time.
1493	EndTime *date.Time `json:"endTime,omitempty"`
1494	// ActivityID - ActivityId of job.
1495	ActivityID *string `json:"activityId,omitempty"`
1496	// JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeDpmJob', 'JobTypeMabJob'
1497	JobType JobType `json:"jobType,omitempty"`
1498}
1499
1500// MarshalJSON is the custom marshaler for AzureIaaSVMJob.
1501func (aisj AzureIaaSVMJob) MarshalJSON() ([]byte, error) {
1502	aisj.JobType = JobTypeAzureIaaSVMJob
1503	objectMap := make(map[string]interface{})
1504	if aisj.Duration != nil {
1505		objectMap["duration"] = aisj.Duration
1506	}
1507	if aisj.ActionsInfo != nil {
1508		objectMap["actionsInfo"] = aisj.ActionsInfo
1509	}
1510	if aisj.ErrorDetails != nil {
1511		objectMap["errorDetails"] = aisj.ErrorDetails
1512	}
1513	if aisj.VirtualMachineVersion != nil {
1514		objectMap["virtualMachineVersion"] = aisj.VirtualMachineVersion
1515	}
1516	if aisj.ExtendedInfo != nil {
1517		objectMap["extendedInfo"] = aisj.ExtendedInfo
1518	}
1519	if aisj.EntityFriendlyName != nil {
1520		objectMap["entityFriendlyName"] = aisj.EntityFriendlyName
1521	}
1522	if aisj.BackupManagementType != "" {
1523		objectMap["backupManagementType"] = aisj.BackupManagementType
1524	}
1525	if aisj.Operation != nil {
1526		objectMap["operation"] = aisj.Operation
1527	}
1528	if aisj.Status != nil {
1529		objectMap["status"] = aisj.Status
1530	}
1531	if aisj.StartTime != nil {
1532		objectMap["startTime"] = aisj.StartTime
1533	}
1534	if aisj.EndTime != nil {
1535		objectMap["endTime"] = aisj.EndTime
1536	}
1537	if aisj.ActivityID != nil {
1538		objectMap["activityId"] = aisj.ActivityID
1539	}
1540	if aisj.JobType != "" {
1541		objectMap["jobType"] = aisj.JobType
1542	}
1543	return json.Marshal(objectMap)
1544}
1545
1546// AsAzureIaaSVMJob is the BasicJob implementation for AzureIaaSVMJob.
1547func (aisj AzureIaaSVMJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) {
1548	return &aisj, true
1549}
1550
1551// AsDpmJob is the BasicJob implementation for AzureIaaSVMJob.
1552func (aisj AzureIaaSVMJob) AsDpmJob() (*DpmJob, bool) {
1553	return nil, false
1554}
1555
1556// AsMabJob is the BasicJob implementation for AzureIaaSVMJob.
1557func (aisj AzureIaaSVMJob) AsMabJob() (*MabJob, bool) {
1558	return nil, false
1559}
1560
1561// AsJob is the BasicJob implementation for AzureIaaSVMJob.
1562func (aisj AzureIaaSVMJob) AsJob() (*Job, bool) {
1563	return nil, false
1564}
1565
1566// AsBasicJob is the BasicJob implementation for AzureIaaSVMJob.
1567func (aisj AzureIaaSVMJob) AsBasicJob() (BasicJob, bool) {
1568	return &aisj, true
1569}
1570
1571// AzureIaaSVMJobExtendedInfo additional information for the Azure IaaS VM workload-specific job.
1572type AzureIaaSVMJobExtendedInfo struct {
1573	// TasksList - List of tasks associated with this job.
1574	TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"`
1575	// PropertyBag - Job properties.
1576	PropertyBag map[string]*string `json:"propertyBag"`
1577	// ProgressPercentage - Indicates progress of the job. Null if it has not started or completed.
1578	ProgressPercentage *float64 `json:"progressPercentage,omitempty"`
1579	// DynamicErrorMessage - Non-localized error message for job execution.
1580	DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"`
1581}
1582
1583// MarshalJSON is the custom marshaler for AzureIaaSVMJobExtendedInfo.
1584func (aisjei AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) {
1585	objectMap := make(map[string]interface{})
1586	if aisjei.TasksList != nil {
1587		objectMap["tasksList"] = aisjei.TasksList
1588	}
1589	if aisjei.PropertyBag != nil {
1590		objectMap["propertyBag"] = aisjei.PropertyBag
1591	}
1592	if aisjei.ProgressPercentage != nil {
1593		objectMap["progressPercentage"] = aisjei.ProgressPercentage
1594	}
1595	if aisjei.DynamicErrorMessage != nil {
1596		objectMap["dynamicErrorMessage"] = aisjei.DynamicErrorMessage
1597	}
1598	return json.Marshal(objectMap)
1599}
1600
1601// AzureIaaSVMJobTaskDetails azure IaaS VM workload-specific job task details.
1602type AzureIaaSVMJobTaskDetails struct {
1603	// TaskID - The task display name.
1604	TaskID *string `json:"taskId,omitempty"`
1605	// StartTime - The start time.
1606	StartTime *date.Time `json:"startTime,omitempty"`
1607	// EndTime - The end time.
1608	EndTime *date.Time `json:"endTime,omitempty"`
1609	// InstanceID - The instance ID.
1610	InstanceID *string `json:"instanceId,omitempty"`
1611	// Duration - The time elapsed for the task.
1612	Duration *string `json:"duration,omitempty"`
1613	// Status - The status.
1614	Status *string `json:"status,omitempty"`
1615	// ProgressPercentage - The progress of the task, as a percentage.
1616	ProgressPercentage *float64 `json:"progressPercentage,omitempty"`
1617}
1618
1619// BasicAzureIaaSVMProtectedItem this Azure VM workload-specific (also known as IaaS VM workload-specific) backup item
1620// has been backed up.
1621type BasicAzureIaaSVMProtectedItem interface {
1622	AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool)
1623	AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool)
1624	AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool)
1625}
1626
1627// AzureIaaSVMProtectedItem this Azure VM workload-specific (also known as IaaS VM workload-specific) backup
1628// item has been backed up.
1629type AzureIaaSVMProtectedItem struct {
1630	// FriendlyName - The friendly name of the VM represented by this backup item.
1631	FriendlyName *string `json:"friendlyName,omitempty"`
1632	// VirtualMachineID - The fully qualified Resource Manager ID of the virtual machine represented by this item.
1633	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
1634	// ProtectionStatus - The backup status of this backup item.
1635	ProtectionStatus *string `json:"protectionStatus,omitempty"`
1636	// ProtectionState - The backup state of this backup item. Possible values include: 'ProtectionStateInvalid', 'ProtectionStateIRPending', 'ProtectionStateProtected', 'ProtectionStateProtectionError', 'ProtectionStateProtectionStopped', 'ProtectionStateProtectionPaused'
1637	ProtectionState ProtectionState `json:"protectionState,omitempty"`
1638	// LastBackupStatus - The last backup operation status. The possible values are: Healthy or Unhealthy.
1639	LastBackupStatus *string `json:"lastBackupStatus,omitempty"`
1640	// LastBackupTime - The timestamp of the last backup operation for this backup item.
1641	LastBackupTime *date.Time `json:"lastBackupTime,omitempty"`
1642	// ExtendedInfo - Additional information for this backup item.
1643	ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"`
1644	// BackupManagementType - The backup management type associated with the backup item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
1645	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
1646	// WorkloadType - The workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'
1647	WorkloadType DataSourceType `json:"workloadType,omitempty"`
1648	// SourceResourceID - The ID of the resource to be backed up.
1649	SourceResourceID *string `json:"sourceResourceId,omitempty"`
1650	// PolicyID - The ID of the backup policy associated with this backup item.
1651	PolicyID *string `json:"policyId,omitempty"`
1652	// LastRecoveryPoint - The timestamp when the most recent backup copy was created for this backup item.
1653	LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"`
1654	// ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines'
1655	ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"`
1656}
1657
1658func unmarshalBasicAzureIaaSVMProtectedItem(body []byte) (BasicAzureIaaSVMProtectedItem, error) {
1659	var m map[string]interface{}
1660	err := json.Unmarshal(body, &m)
1661	if err != nil {
1662		return nil, err
1663	}
1664
1665	switch m["protectedItemType"] {
1666	case string(ProtectedItemTypeMicrosoftComputevirtualMachines):
1667		var aiscvpi AzureIaaSComputeVMProtectedItem
1668		err := json.Unmarshal(body, &aiscvpi)
1669		return aiscvpi, err
1670	case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines):
1671		var aisccvpi AzureIaaSClassicComputeVMProtectedItem
1672		err := json.Unmarshal(body, &aisccvpi)
1673		return aisccvpi, err
1674	default:
1675		var aispi AzureIaaSVMProtectedItem
1676		err := json.Unmarshal(body, &aispi)
1677		return aispi, err
1678	}
1679}
1680func unmarshalBasicAzureIaaSVMProtectedItemArray(body []byte) ([]BasicAzureIaaSVMProtectedItem, error) {
1681	var rawMessages []*json.RawMessage
1682	err := json.Unmarshal(body, &rawMessages)
1683	if err != nil {
1684		return nil, err
1685	}
1686
1687	aispiArray := make([]BasicAzureIaaSVMProtectedItem, len(rawMessages))
1688
1689	for index, rawMessage := range rawMessages {
1690		aispi, err := unmarshalBasicAzureIaaSVMProtectedItem(*rawMessage)
1691		if err != nil {
1692			return nil, err
1693		}
1694		aispiArray[index] = aispi
1695	}
1696	return aispiArray, nil
1697}
1698
1699// MarshalJSON is the custom marshaler for AzureIaaSVMProtectedItem.
1700func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) {
1701	aispi.ProtectedItemType = ProtectedItemTypeAzureIaaSVMProtectedItem
1702	objectMap := make(map[string]interface{})
1703	if aispi.FriendlyName != nil {
1704		objectMap["friendlyName"] = aispi.FriendlyName
1705	}
1706	if aispi.VirtualMachineID != nil {
1707		objectMap["virtualMachineId"] = aispi.VirtualMachineID
1708	}
1709	if aispi.ProtectionStatus != nil {
1710		objectMap["protectionStatus"] = aispi.ProtectionStatus
1711	}
1712	if aispi.ProtectionState != "" {
1713		objectMap["protectionState"] = aispi.ProtectionState
1714	}
1715	if aispi.LastBackupStatus != nil {
1716		objectMap["lastBackupStatus"] = aispi.LastBackupStatus
1717	}
1718	if aispi.LastBackupTime != nil {
1719		objectMap["lastBackupTime"] = aispi.LastBackupTime
1720	}
1721	if aispi.ExtendedInfo != nil {
1722		objectMap["extendedInfo"] = aispi.ExtendedInfo
1723	}
1724	if aispi.BackupManagementType != "" {
1725		objectMap["backupManagementType"] = aispi.BackupManagementType
1726	}
1727	if aispi.WorkloadType != "" {
1728		objectMap["workloadType"] = aispi.WorkloadType
1729	}
1730	if aispi.SourceResourceID != nil {
1731		objectMap["sourceResourceId"] = aispi.SourceResourceID
1732	}
1733	if aispi.PolicyID != nil {
1734		objectMap["policyId"] = aispi.PolicyID
1735	}
1736	if aispi.LastRecoveryPoint != nil {
1737		objectMap["lastRecoveryPoint"] = aispi.LastRecoveryPoint
1738	}
1739	if aispi.ProtectedItemType != "" {
1740		objectMap["protectedItemType"] = aispi.ProtectedItemType
1741	}
1742	return json.Marshal(objectMap)
1743}
1744
1745// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1746func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) {
1747	return &aispi, true
1748}
1749
1750// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1751func (aispi AzureIaaSVMProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) {
1752	return &aispi, true
1753}
1754
1755// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1756func (aispi AzureIaaSVMProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) {
1757	return nil, false
1758}
1759
1760// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1761func (aispi AzureIaaSVMProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) {
1762	return nil, false
1763}
1764
1765// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1766func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) {
1767	return nil, false
1768}
1769
1770// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1771func (aispi AzureIaaSVMProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) {
1772	return nil, false
1773}
1774
1775// AsProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1776func (aispi AzureIaaSVMProtectedItem) AsProtectedItem() (*ProtectedItem, bool) {
1777	return nil, false
1778}
1779
1780// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureIaaSVMProtectedItem.
1781func (aispi AzureIaaSVMProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) {
1782	return &aispi, true
1783}
1784
1785// AzureIaaSVMProtectedItemExtendedInfo additional information for the Azure VM (also known as IaaS
1786// VM)-specific backup item.
1787type AzureIaaSVMProtectedItemExtendedInfo struct {
1788	// OldestRecoveryPoint - The oldest backup copy available for this backup item.
1789	OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"`
1790	// RecoveryPointCount - The number of backup copies available for this backup item.
1791	RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"`
1792	// PolicyInconsistent - Specifies if the backup policy associated with the backup item is inconsistent.
1793	PolicyInconsistent *bool `json:"policyInconsistent,omitempty"`
1794}
1795
1796// AzureIaaSVMProtectionPolicy azure VM (also known as IaaS VM) workload-specific backup policy.
1797type AzureIaaSVMProtectionPolicy struct {
1798	// SchedulePolicy - The backup schedule specified as part of backup policy.
1799	SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"`
1800	// RetentionPolicy - The retention policy with the details on backup copy retention ranges.
1801	RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"`
1802	// ProtectedItemsCount - The number of items associated with this policy.
1803	ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"`
1804	// BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeMAB', 'BackupManagementTypeAzureSQL'
1805	BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"`
1806}
1807
1808// MarshalJSON is the custom marshaler for AzureIaaSVMProtectionPolicy.
1809func (aispp AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) {
1810	aispp.BackupManagementType = BackupManagementTypeAzureIaasVM
1811	objectMap := make(map[string]interface{})
1812	objectMap["schedulePolicy"] = aispp.SchedulePolicy
1813	objectMap["retentionPolicy"] = aispp.RetentionPolicy
1814	if aispp.ProtectedItemsCount != nil {
1815		objectMap["protectedItemsCount"] = aispp.ProtectedItemsCount
1816	}
1817	if aispp.BackupManagementType != "" {
1818		objectMap["backupManagementType"] = aispp.BackupManagementType
1819	}
1820	return json.Marshal(objectMap)
1821}
1822
1823// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy.
1824func (aispp AzureIaaSVMProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) {
1825	return &aispp, true
1826}
1827
1828// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy.
1829func (aispp AzureIaaSVMProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) {
1830	return nil, false
1831}
1832
1833// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy.
1834func (aispp AzureIaaSVMProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) {
1835	return nil, false
1836}
1837
1838// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy.
1839func (aispp AzureIaaSVMProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) {
1840	return nil, false
1841}
1842
1843// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureIaaSVMProtectionPolicy.
1844func (aispp AzureIaaSVMProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) {
1845	return &aispp, true
1846}
1847
1848// UnmarshalJSON is the custom unmarshaler for AzureIaaSVMProtectionPolicy struct.
1849func (aispp *AzureIaaSVMProtectionPolicy) UnmarshalJSON(body []byte) error {
1850	var m map[string]*json.RawMessage
1851	err := json.Unmarshal(body, &m)
1852	if err != nil {
1853		return err
1854	}
1855	for k, v := range m {
1856		switch k {
1857		case "schedulePolicy":
1858			if v != nil {
1859				schedulePolicy, err := unmarshalBasicSchedulePolicy(*v)
1860				if err != nil {
1861					return err
1862				}
1863				aispp.SchedulePolicy = schedulePolicy
1864			}
1865		case "retentionPolicy":
1866			if v != nil {
1867				retentionPolicy, err := unmarshalBasicRetentionPolicy(*v)
1868				if err != nil {
1869					return err
1870				}
1871				aispp.RetentionPolicy = retentionPolicy
1872			}
1873		case "protectedItemsCount":
1874			if v != nil {
1875				var protectedItemsCount int32
1876				err = json.Unmarshal(*v, &protectedItemsCount)
1877				if err != nil {
1878					return err
1879				}
1880				aispp.ProtectedItemsCount = &protectedItemsCount
1881			}
1882		case "backupManagementType":
1883			if v != nil {
1884				var backupManagementType ManagementTypeBasicProtectionPolicy
1885				err = json.Unmarshal(*v, &backupManagementType)
1886				if err != nil {
1887					return err
1888				}
1889				aispp.BackupManagementType = backupManagementType
1890			}
1891		}
1892	}
1893
1894	return nil
1895}
1896
1897// AzureSQLContainer azure SQL workload-specific container.
1898type AzureSQLContainer struct {
1899	// FriendlyName - Friendly name of the container.
1900	FriendlyName *string `json:"friendlyName,omitempty"`
1901	// BackupManagementType - The backup management type for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
1902	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
1903	// RegistrationStatus - The container's registration status with the Recovery Services vault.
1904	RegistrationStatus *string `json:"registrationStatus,omitempty"`
1905	// HealthStatus - The status of the container's health.
1906	HealthStatus *string `json:"healthStatus,omitempty"`
1907	// ContainerType - READ-ONLY; The type assigned to the container. The values to use for each of these properties are:<br/> 1. Compute Azure VM is Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows machines (like Azure Backup Server and DPM) is Windows<br/> 4. Azure SQL instance is AzureSqlContainer.
1908	ContainerType *string `json:"containerType,omitempty"`
1909	// ProtectableObjectType - Possible values include: 'ProtectableObjectTypeProtectionContainer', 'ProtectableObjectTypeAzureSQLContainer', 'ProtectableObjectTypeIaaSVMContainer', 'ProtectableObjectTypeMABWindowsContainer', 'ProtectableObjectTypeMicrosoftComputevirtualMachines', 'ProtectableObjectTypeMicrosoftClassicComputevirtualMachines'
1910	ProtectableObjectType ProtectableObjectType `json:"protectableObjectType,omitempty"`
1911}
1912
1913// MarshalJSON is the custom marshaler for AzureSQLContainer.
1914func (asc AzureSQLContainer) MarshalJSON() ([]byte, error) {
1915	asc.ProtectableObjectType = ProtectableObjectTypeAzureSQLContainer
1916	objectMap := make(map[string]interface{})
1917	if asc.FriendlyName != nil {
1918		objectMap["friendlyName"] = asc.FriendlyName
1919	}
1920	if asc.BackupManagementType != "" {
1921		objectMap["backupManagementType"] = asc.BackupManagementType
1922	}
1923	if asc.RegistrationStatus != nil {
1924		objectMap["registrationStatus"] = asc.RegistrationStatus
1925	}
1926	if asc.HealthStatus != nil {
1927		objectMap["healthStatus"] = asc.HealthStatus
1928	}
1929	if asc.ProtectableObjectType != "" {
1930		objectMap["protectableObjectType"] = asc.ProtectableObjectType
1931	}
1932	return json.Marshal(objectMap)
1933}
1934
1935// AsAzureSQLContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1936func (asc AzureSQLContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) {
1937	return &asc, true
1938}
1939
1940// AsIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1941func (asc AzureSQLContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) {
1942	return nil, false
1943}
1944
1945// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1946func (asc AzureSQLContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) {
1947	return nil, false
1948}
1949
1950// AsMabContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1951func (asc AzureSQLContainer) AsMabContainer() (*MabContainer, bool) {
1952	return nil, false
1953}
1954
1955// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1956func (asc AzureSQLContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) {
1957	return nil, false
1958}
1959
1960// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1961func (asc AzureSQLContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) {
1962	return nil, false
1963}
1964
1965// AsProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1966func (asc AzureSQLContainer) AsProtectionContainer() (*ProtectionContainer, bool) {
1967	return nil, false
1968}
1969
1970// AsBasicProtectionContainer is the BasicProtectionContainer implementation for AzureSQLContainer.
1971func (asc AzureSQLContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) {
1972	return &asc, true
1973}
1974
1975// AzureSQLProtectedItem this is an Azure SQL workload-specific backup item.
1976type AzureSQLProtectedItem struct {
1977	// ProtectedItemDataID - The internal ID of a backup item. The internal ID is used by the Azure SQL Backup engine to contact Recovery Services.
1978	ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"`
1979	// ProtectionState - The backup state of the backup item. Possible values include: 'ProtectedItemStateInvalid', 'ProtectedItemStateIRPending', 'ProtectedItemStateProtected', 'ProtectedItemStateProtectionError', 'ProtectedItemStateProtectionStopped', 'ProtectedItemStateProtectionPaused'
1980	ProtectionState ProtectedItemState `json:"protectionState,omitempty"`
1981	// ExtendedInfo - Additional information for this backup item.
1982	ExtendedInfo *AzureSQLProtectedItemExtendedInfo `json:"extendedInfo,omitempty"`
1983	// BackupManagementType - The backup management type associated with the backup item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
1984	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
1985	// WorkloadType - The workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'
1986	WorkloadType DataSourceType `json:"workloadType,omitempty"`
1987	// SourceResourceID - The ID of the resource to be backed up.
1988	SourceResourceID *string `json:"sourceResourceId,omitempty"`
1989	// PolicyID - The ID of the backup policy associated with this backup item.
1990	PolicyID *string `json:"policyId,omitempty"`
1991	// LastRecoveryPoint - The timestamp when the most recent backup copy was created for this backup item.
1992	LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"`
1993	// ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines'
1994	ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"`
1995}
1996
1997// MarshalJSON is the custom marshaler for AzureSQLProtectedItem.
1998func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) {
1999	aspi.ProtectedItemType = ProtectedItemTypeMicrosoftSqlserversdatabases
2000	objectMap := make(map[string]interface{})
2001	if aspi.ProtectedItemDataID != nil {
2002		objectMap["protectedItemDataId"] = aspi.ProtectedItemDataID
2003	}
2004	if aspi.ProtectionState != "" {
2005		objectMap["protectionState"] = aspi.ProtectionState
2006	}
2007	if aspi.ExtendedInfo != nil {
2008		objectMap["extendedInfo"] = aspi.ExtendedInfo
2009	}
2010	if aspi.BackupManagementType != "" {
2011		objectMap["backupManagementType"] = aspi.BackupManagementType
2012	}
2013	if aspi.WorkloadType != "" {
2014		objectMap["workloadType"] = aspi.WorkloadType
2015	}
2016	if aspi.SourceResourceID != nil {
2017		objectMap["sourceResourceId"] = aspi.SourceResourceID
2018	}
2019	if aspi.PolicyID != nil {
2020		objectMap["policyId"] = aspi.PolicyID
2021	}
2022	if aspi.LastRecoveryPoint != nil {
2023		objectMap["lastRecoveryPoint"] = aspi.LastRecoveryPoint
2024	}
2025	if aspi.ProtectedItemType != "" {
2026		objectMap["protectedItemType"] = aspi.ProtectedItemType
2027	}
2028	return json.Marshal(objectMap)
2029}
2030
2031// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2032func (aspi AzureSQLProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) {
2033	return nil, false
2034}
2035
2036// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2037func (aspi AzureSQLProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) {
2038	return nil, false
2039}
2040
2041// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2042func (aspi AzureSQLProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) {
2043	return nil, false
2044}
2045
2046// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2047func (aspi AzureSQLProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) {
2048	return &aspi, true
2049}
2050
2051// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2052func (aspi AzureSQLProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) {
2053	return nil, false
2054}
2055
2056// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2057func (aspi AzureSQLProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) {
2058	return nil, false
2059}
2060
2061// AsProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2062func (aspi AzureSQLProtectedItem) AsProtectedItem() (*ProtectedItem, bool) {
2063	return nil, false
2064}
2065
2066// AsBasicProtectedItem is the BasicProtectedItem implementation for AzureSQLProtectedItem.
2067func (aspi AzureSQLProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) {
2068	return &aspi, true
2069}
2070
2071// AzureSQLProtectedItemExtendedInfo additional information for the Azure SQL specific backup item.
2072type AzureSQLProtectedItemExtendedInfo struct {
2073	// OldestRecoveryPoint - The oldest backup copy available for this item in the service.
2074	OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"`
2075	// RecoveryPointCount - The number of available backup copies for this backup item.
2076	RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"`
2077	// PolicyState - The state of the backup policy associated with this backup item.
2078	PolicyState *string `json:"policyState,omitempty"`
2079}
2080
2081// AzureSQLProtectionPolicy the Azure SQL workload-specific backup policy.
2082type AzureSQLProtectionPolicy struct {
2083	// RetentionPolicy - The retention policy details.
2084	RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"`
2085	// ProtectedItemsCount - The number of items associated with this policy.
2086	ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"`
2087	// BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeMAB', 'BackupManagementTypeAzureSQL'
2088	BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"`
2089}
2090
2091// MarshalJSON is the custom marshaler for AzureSQLProtectionPolicy.
2092func (aspp AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) {
2093	aspp.BackupManagementType = BackupManagementTypeAzureSQL
2094	objectMap := make(map[string]interface{})
2095	objectMap["retentionPolicy"] = aspp.RetentionPolicy
2096	if aspp.ProtectedItemsCount != nil {
2097		objectMap["protectedItemsCount"] = aspp.ProtectedItemsCount
2098	}
2099	if aspp.BackupManagementType != "" {
2100		objectMap["backupManagementType"] = aspp.BackupManagementType
2101	}
2102	return json.Marshal(objectMap)
2103}
2104
2105// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy.
2106func (aspp AzureSQLProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) {
2107	return nil, false
2108}
2109
2110// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy.
2111func (aspp AzureSQLProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) {
2112	return nil, false
2113}
2114
2115// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy.
2116func (aspp AzureSQLProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) {
2117	return &aspp, true
2118}
2119
2120// AsProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy.
2121func (aspp AzureSQLProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) {
2122	return nil, false
2123}
2124
2125// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for AzureSQLProtectionPolicy.
2126func (aspp AzureSQLProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) {
2127	return &aspp, true
2128}
2129
2130// UnmarshalJSON is the custom unmarshaler for AzureSQLProtectionPolicy struct.
2131func (aspp *AzureSQLProtectionPolicy) UnmarshalJSON(body []byte) error {
2132	var m map[string]*json.RawMessage
2133	err := json.Unmarshal(body, &m)
2134	if err != nil {
2135		return err
2136	}
2137	for k, v := range m {
2138		switch k {
2139		case "retentionPolicy":
2140			if v != nil {
2141				retentionPolicy, err := unmarshalBasicRetentionPolicy(*v)
2142				if err != nil {
2143					return err
2144				}
2145				aspp.RetentionPolicy = retentionPolicy
2146			}
2147		case "protectedItemsCount":
2148			if v != nil {
2149				var protectedItemsCount int32
2150				err = json.Unmarshal(*v, &protectedItemsCount)
2151				if err != nil {
2152					return err
2153				}
2154				aspp.ProtectedItemsCount = &protectedItemsCount
2155			}
2156		case "backupManagementType":
2157			if v != nil {
2158				var backupManagementType ManagementTypeBasicProtectionPolicy
2159				err = json.Unmarshal(*v, &backupManagementType)
2160				if err != nil {
2161					return err
2162				}
2163				aspp.BackupManagementType = backupManagementType
2164			}
2165		}
2166	}
2167
2168	return nil
2169}
2170
2171// BEKDetails BEK is Bitlocker Encryption Key.
2172type BEKDetails struct {
2173	// SecretURL - Secret refers to Bitlocker Encryption Key (BEK). The Secret can be unlocked by the key (or KEK).
2174	SecretURL *string `json:"secretUrl,omitempty"`
2175	// SecretVaultID - ID of the Key Vault where this Secret is stored.
2176	SecretVaultID *string `json:"secretVaultId,omitempty"`
2177	// SecretData - Bitlocker Encryption Key (BEK) data.
2178	SecretData *string `json:"secretData,omitempty"`
2179}
2180
2181// BMSBackupEngineQueryObject the query parameters used to GET the list of backup engines.
2182type BMSBackupEngineQueryObject struct {
2183	// BackupManagementType - The backup management type associated with the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
2184	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
2185}
2186
2187// BMSContainerQueryObject the query filters that can be used with the list containers API.
2188type BMSContainerQueryObject struct {
2189	// BackupManagementType - The backup management type for this container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
2190	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
2191	// Status - The status of the container's registration with the Recovery Services vault.
2192	Status *string `json:"status,omitempty"`
2193	// FriendlyName - The friendly name of the container.
2194	FriendlyName *string `json:"friendlyName,omitempty"`
2195}
2196
2197// BMSPOQueryObject filters the list of backup items.
2198type BMSPOQueryObject struct {
2199	// BackupManagementType - The backup management type. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
2200	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
2201	// Status - The backup status query parameter.
2202	Status *string `json:"status,omitempty"`
2203	// FriendlyName - The friendly name for the item.
2204	FriendlyName *string `json:"friendlyName,omitempty"`
2205}
2206
2207// BMSRPQueryObject filters the list of backup copies based on the property.
2208type BMSRPQueryObject struct {
2209	// StartDate - Use backup copies created after this time.
2210	StartDate *date.Time `json:"startDate,omitempty"`
2211	// EndDate - Use backup copies created before this time.
2212	EndDate *date.Time `json:"endDate,omitempty"`
2213}
2214
2215// ClientScriptForConnect client script details for the file or folder restore.
2216type ClientScriptForConnect struct {
2217	// ScriptContent - File content of the client script for file or folder restore.
2218	ScriptContent *string `json:"scriptContent,omitempty"`
2219	// ScriptExtension - File extension of the client script for the file or folder restore. Some examples of the extension are: .ps1 and .sh.
2220	ScriptExtension *string `json:"scriptExtension,omitempty"`
2221	// OsType - The operating system platform ("Windows" or "Linux") for which this file or folder restore client script works.
2222	OsType *string `json:"osType,omitempty"`
2223}
2224
2225// DailyRetentionFormat daily retention format.
2226type DailyRetentionFormat struct {
2227	// DaysOfTheMonth - List of days of the month.
2228	DaysOfTheMonth *[]Day `json:"daysOfTheMonth,omitempty"`
2229}
2230
2231// DailyRetentionSchedule daily retention schedule.
2232type DailyRetentionSchedule struct {
2233	// RetentionTimes - The retention times of retention policy.
2234	RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"`
2235	// RetentionDuration - The retention duration of retention policy.
2236	RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"`
2237}
2238
2239// Day day of the week.
2240type Day struct {
2241	Date   *int32 `json:"date,omitempty"`
2242	IsLast *bool  `json:"isLast,omitempty"`
2243}
2244
2245// DpmBackupEngine the backup engine type when Data Protection Manager (DPM) is used to manage backups.
2246type DpmBackupEngine struct {
2247	// FriendlyName - The friendly name of the backup engine.
2248	FriendlyName *string `json:"friendlyName,omitempty"`
2249	// BackupManagementType - The type of backup management associated with the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
2250	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
2251	// RegistrationStatus - The status of the backup engine registration with the Recovery Services vault.
2252	RegistrationStatus *string `json:"registrationStatus,omitempty"`
2253	// HealthStatus - The backup status of the backup engine.
2254	HealthStatus *string `json:"healthStatus,omitempty"`
2255	// CanReRegister - The flag indicating whether the backup engine be registered again, once the engine has been initially registered.
2256	CanReRegister *bool `json:"canReRegister,omitempty"`
2257	// BackupEngineID - The ID of the backup engine.
2258	BackupEngineID *string `json:"backupEngineId,omitempty"`
2259	// BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine'
2260	BackupEngineType EngineType `json:"backupEngineType,omitempty"`
2261}
2262
2263// MarshalJSON is the custom marshaler for DpmBackupEngine.
2264func (dbe DpmBackupEngine) MarshalJSON() ([]byte, error) {
2265	dbe.BackupEngineType = BackupEngineTypeDpmBackupEngine
2266	objectMap := make(map[string]interface{})
2267	if dbe.FriendlyName != nil {
2268		objectMap["friendlyName"] = dbe.FriendlyName
2269	}
2270	if dbe.BackupManagementType != "" {
2271		objectMap["backupManagementType"] = dbe.BackupManagementType
2272	}
2273	if dbe.RegistrationStatus != nil {
2274		objectMap["registrationStatus"] = dbe.RegistrationStatus
2275	}
2276	if dbe.HealthStatus != nil {
2277		objectMap["healthStatus"] = dbe.HealthStatus
2278	}
2279	if dbe.CanReRegister != nil {
2280		objectMap["canReRegister"] = dbe.CanReRegister
2281	}
2282	if dbe.BackupEngineID != nil {
2283		objectMap["backupEngineId"] = dbe.BackupEngineID
2284	}
2285	if dbe.BackupEngineType != "" {
2286		objectMap["backupEngineType"] = dbe.BackupEngineType
2287	}
2288	return json.Marshal(objectMap)
2289}
2290
2291// AsAzureBackupServerEngine is the BasicEngineBase implementation for DpmBackupEngine.
2292func (dbe DpmBackupEngine) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) {
2293	return nil, false
2294}
2295
2296// AsDpmBackupEngine is the BasicEngineBase implementation for DpmBackupEngine.
2297func (dbe DpmBackupEngine) AsDpmBackupEngine() (*DpmBackupEngine, bool) {
2298	return &dbe, true
2299}
2300
2301// AsEngineBase is the BasicEngineBase implementation for DpmBackupEngine.
2302func (dbe DpmBackupEngine) AsEngineBase() (*EngineBase, bool) {
2303	return nil, false
2304}
2305
2306// AsBasicEngineBase is the BasicEngineBase implementation for DpmBackupEngine.
2307func (dbe DpmBackupEngine) AsBasicEngineBase() (BasicEngineBase, bool) {
2308	return &dbe, true
2309}
2310
2311// DpmErrorInfo DPM workload-specific error information.
2312type DpmErrorInfo struct {
2313	// ErrorString - Localized error string.
2314	ErrorString *string `json:"errorString,omitempty"`
2315	// Recommendations - The list of localized recommendations for the error string.
2316	Recommendations *[]string `json:"recommendations,omitempty"`
2317}
2318
2319// DpmJob the DPM workload-specific job object.
2320type DpmJob struct {
2321	// Duration - The time elapsed for the job.
2322	Duration *string `json:"duration,omitempty"`
2323	// DpmServerName - DPM server name managing the backup item or backup job.
2324	DpmServerName *string `json:"dpmServerName,omitempty"`
2325	// ContainerName - The name of the cluster or server protecting the current backup item, if any.
2326	ContainerName *string `json:"containerName,omitempty"`
2327	// ContainerType - The type of container.
2328	ContainerType *string `json:"containerType,omitempty"`
2329	// WorkloadType - The type of backup item.
2330	WorkloadType *string `json:"workloadType,omitempty"`
2331	// ActionsInfo - The state or actions applicable on this job, such as Cancel or Retry.
2332	ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"`
2333	// ErrorDetails - The errors.
2334	ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"`
2335	// ExtendedInfo - Additional information for this job.
2336	ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"`
2337	// EntityFriendlyName - The friendly name of the entity on which the current job is executing.
2338	EntityFriendlyName *string `json:"entityFriendlyName,omitempty"`
2339	// BackupManagementType - The backup management type for the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
2340	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
2341	// Operation - The operation name.
2342	Operation *string `json:"operation,omitempty"`
2343	// Status - The job status.
2344	Status *string `json:"status,omitempty"`
2345	// StartTime - The start time.
2346	StartTime *date.Time `json:"startTime,omitempty"`
2347	// EndTime - The end time.
2348	EndTime *date.Time `json:"endTime,omitempty"`
2349	// ActivityID - ActivityId of job.
2350	ActivityID *string `json:"activityId,omitempty"`
2351	// JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeDpmJob', 'JobTypeMabJob'
2352	JobType JobType `json:"jobType,omitempty"`
2353}
2354
2355// MarshalJSON is the custom marshaler for DpmJob.
2356func (dj DpmJob) MarshalJSON() ([]byte, error) {
2357	dj.JobType = JobTypeDpmJob
2358	objectMap := make(map[string]interface{})
2359	if dj.Duration != nil {
2360		objectMap["duration"] = dj.Duration
2361	}
2362	if dj.DpmServerName != nil {
2363		objectMap["dpmServerName"] = dj.DpmServerName
2364	}
2365	if dj.ContainerName != nil {
2366		objectMap["containerName"] = dj.ContainerName
2367	}
2368	if dj.ContainerType != nil {
2369		objectMap["containerType"] = dj.ContainerType
2370	}
2371	if dj.WorkloadType != nil {
2372		objectMap["workloadType"] = dj.WorkloadType
2373	}
2374	if dj.ActionsInfo != nil {
2375		objectMap["actionsInfo"] = dj.ActionsInfo
2376	}
2377	if dj.ErrorDetails != nil {
2378		objectMap["errorDetails"] = dj.ErrorDetails
2379	}
2380	if dj.ExtendedInfo != nil {
2381		objectMap["extendedInfo"] = dj.ExtendedInfo
2382	}
2383	if dj.EntityFriendlyName != nil {
2384		objectMap["entityFriendlyName"] = dj.EntityFriendlyName
2385	}
2386	if dj.BackupManagementType != "" {
2387		objectMap["backupManagementType"] = dj.BackupManagementType
2388	}
2389	if dj.Operation != nil {
2390		objectMap["operation"] = dj.Operation
2391	}
2392	if dj.Status != nil {
2393		objectMap["status"] = dj.Status
2394	}
2395	if dj.StartTime != nil {
2396		objectMap["startTime"] = dj.StartTime
2397	}
2398	if dj.EndTime != nil {
2399		objectMap["endTime"] = dj.EndTime
2400	}
2401	if dj.ActivityID != nil {
2402		objectMap["activityId"] = dj.ActivityID
2403	}
2404	if dj.JobType != "" {
2405		objectMap["jobType"] = dj.JobType
2406	}
2407	return json.Marshal(objectMap)
2408}
2409
2410// AsAzureIaaSVMJob is the BasicJob implementation for DpmJob.
2411func (dj DpmJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) {
2412	return nil, false
2413}
2414
2415// AsDpmJob is the BasicJob implementation for DpmJob.
2416func (dj DpmJob) AsDpmJob() (*DpmJob, bool) {
2417	return &dj, true
2418}
2419
2420// AsMabJob is the BasicJob implementation for DpmJob.
2421func (dj DpmJob) AsMabJob() (*MabJob, bool) {
2422	return nil, false
2423}
2424
2425// AsJob is the BasicJob implementation for DpmJob.
2426func (dj DpmJob) AsJob() (*Job, bool) {
2427	return nil, false
2428}
2429
2430// AsBasicJob is the BasicJob implementation for DpmJob.
2431func (dj DpmJob) AsBasicJob() (BasicJob, bool) {
2432	return &dj, true
2433}
2434
2435// DpmJobExtendedInfo additional information on the DPM workload-specific job.
2436type DpmJobExtendedInfo struct {
2437	// TasksList - List of tasks associated with this job.
2438	TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"`
2439	// PropertyBag - The job properties.
2440	PropertyBag map[string]*string `json:"propertyBag"`
2441	// DynamicErrorMessage - Non-localized error message on job execution.
2442	DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"`
2443}
2444
2445// MarshalJSON is the custom marshaler for DpmJobExtendedInfo.
2446func (djei DpmJobExtendedInfo) MarshalJSON() ([]byte, error) {
2447	objectMap := make(map[string]interface{})
2448	if djei.TasksList != nil {
2449		objectMap["tasksList"] = djei.TasksList
2450	}
2451	if djei.PropertyBag != nil {
2452		objectMap["propertyBag"] = djei.PropertyBag
2453	}
2454	if djei.DynamicErrorMessage != nil {
2455		objectMap["dynamicErrorMessage"] = djei.DynamicErrorMessage
2456	}
2457	return json.Marshal(objectMap)
2458}
2459
2460// DpmJobTaskDetails DPM workload-specific job task details.
2461type DpmJobTaskDetails struct {
2462	// TaskID - The task display name.
2463	TaskID *string `json:"taskId,omitempty"`
2464	// StartTime - The start time.
2465	StartTime *date.Time `json:"startTime,omitempty"`
2466	// EndTime - The end time.
2467	EndTime *date.Time `json:"endTime,omitempty"`
2468	// Duration - The time elapsed for task.
2469	Duration *string `json:"duration,omitempty"`
2470	// Status - The status.
2471	Status *string `json:"status,omitempty"`
2472}
2473
2474// EncryptionDetails details needed if the VM was encrypted at the time of backup.
2475type EncryptionDetails struct {
2476	// EncryptionEnabled - Identifies whether the backup copy represents an encrypted VM at the time of backup.
2477	EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"`
2478	// KekURL - URL of the Key Encryption Key (KEK).
2479	KekURL *string `json:"kekUrl,omitempty"`
2480	// SecretKeyURL - URL of the Bitlocker Encryption Key (BEK).
2481	SecretKeyURL *string `json:"secretKeyUrl,omitempty"`
2482	// KekVaultID - The ID of Key Vault where the Key Encryption Key (KEK) is stored.
2483	KekVaultID *string `json:"kekVaultId,omitempty"`
2484	// SecretKeyVaultID - The ID of Key Vault where the Bitlocker Encryption Key (BEK), or Secret, is stored.
2485	SecretKeyVaultID *string `json:"secretKeyVaultId,omitempty"`
2486}
2487
2488// BasicEngineBase the base backup engine class. All workload-specific backup engines derive from this class.
2489type BasicEngineBase interface {
2490	AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool)
2491	AsDpmBackupEngine() (*DpmBackupEngine, bool)
2492	AsEngineBase() (*EngineBase, bool)
2493}
2494
2495// EngineBase the base backup engine class. All workload-specific backup engines derive from this class.
2496type EngineBase struct {
2497	// FriendlyName - The friendly name of the backup engine.
2498	FriendlyName *string `json:"friendlyName,omitempty"`
2499	// BackupManagementType - The type of backup management associated with the backup engine. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
2500	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
2501	// RegistrationStatus - The status of the backup engine registration with the Recovery Services vault.
2502	RegistrationStatus *string `json:"registrationStatus,omitempty"`
2503	// HealthStatus - The backup status of the backup engine.
2504	HealthStatus *string `json:"healthStatus,omitempty"`
2505	// CanReRegister - The flag indicating whether the backup engine be registered again, once the engine has been initially registered.
2506	CanReRegister *bool `json:"canReRegister,omitempty"`
2507	// BackupEngineID - The ID of the backup engine.
2508	BackupEngineID *string `json:"backupEngineId,omitempty"`
2509	// BackupEngineType - Possible values include: 'BackupEngineTypeBackupEngineBase', 'BackupEngineTypeAzureBackupServerEngine', 'BackupEngineTypeDpmBackupEngine'
2510	BackupEngineType EngineType `json:"backupEngineType,omitempty"`
2511}
2512
2513func unmarshalBasicEngineBase(body []byte) (BasicEngineBase, error) {
2514	var m map[string]interface{}
2515	err := json.Unmarshal(body, &m)
2516	if err != nil {
2517		return nil, err
2518	}
2519
2520	switch m["backupEngineType"] {
2521	case string(BackupEngineTypeAzureBackupServerEngine):
2522		var abse AzureBackupServerEngine
2523		err := json.Unmarshal(body, &abse)
2524		return abse, err
2525	case string(BackupEngineTypeDpmBackupEngine):
2526		var dbe DpmBackupEngine
2527		err := json.Unmarshal(body, &dbe)
2528		return dbe, err
2529	default:
2530		var eb EngineBase
2531		err := json.Unmarshal(body, &eb)
2532		return eb, err
2533	}
2534}
2535func unmarshalBasicEngineBaseArray(body []byte) ([]BasicEngineBase, error) {
2536	var rawMessages []*json.RawMessage
2537	err := json.Unmarshal(body, &rawMessages)
2538	if err != nil {
2539		return nil, err
2540	}
2541
2542	ebArray := make([]BasicEngineBase, len(rawMessages))
2543
2544	for index, rawMessage := range rawMessages {
2545		eb, err := unmarshalBasicEngineBase(*rawMessage)
2546		if err != nil {
2547			return nil, err
2548		}
2549		ebArray[index] = eb
2550	}
2551	return ebArray, nil
2552}
2553
2554// MarshalJSON is the custom marshaler for EngineBase.
2555func (eb EngineBase) MarshalJSON() ([]byte, error) {
2556	eb.BackupEngineType = BackupEngineTypeBackupEngineBase
2557	objectMap := make(map[string]interface{})
2558	if eb.FriendlyName != nil {
2559		objectMap["friendlyName"] = eb.FriendlyName
2560	}
2561	if eb.BackupManagementType != "" {
2562		objectMap["backupManagementType"] = eb.BackupManagementType
2563	}
2564	if eb.RegistrationStatus != nil {
2565		objectMap["registrationStatus"] = eb.RegistrationStatus
2566	}
2567	if eb.HealthStatus != nil {
2568		objectMap["healthStatus"] = eb.HealthStatus
2569	}
2570	if eb.CanReRegister != nil {
2571		objectMap["canReRegister"] = eb.CanReRegister
2572	}
2573	if eb.BackupEngineID != nil {
2574		objectMap["backupEngineId"] = eb.BackupEngineID
2575	}
2576	if eb.BackupEngineType != "" {
2577		objectMap["backupEngineType"] = eb.BackupEngineType
2578	}
2579	return json.Marshal(objectMap)
2580}
2581
2582// AsAzureBackupServerEngine is the BasicEngineBase implementation for EngineBase.
2583func (eb EngineBase) AsAzureBackupServerEngine() (*AzureBackupServerEngine, bool) {
2584	return nil, false
2585}
2586
2587// AsDpmBackupEngine is the BasicEngineBase implementation for EngineBase.
2588func (eb EngineBase) AsDpmBackupEngine() (*DpmBackupEngine, bool) {
2589	return nil, false
2590}
2591
2592// AsEngineBase is the BasicEngineBase implementation for EngineBase.
2593func (eb EngineBase) AsEngineBase() (*EngineBase, bool) {
2594	return &eb, true
2595}
2596
2597// AsBasicEngineBase is the BasicEngineBase implementation for EngineBase.
2598func (eb EngineBase) AsBasicEngineBase() (BasicEngineBase, bool) {
2599	return &eb, true
2600}
2601
2602// EngineBaseResource the base backup engine class. All workload-specific backup engines derive from this
2603// class.
2604type EngineBaseResource struct {
2605	Properties BasicEngineBase `json:"properties,omitempty"`
2606	// ID - Resource ID represents the complete path to the resource.
2607	ID *string `json:"id,omitempty"`
2608	// Name - Resource name associated with the resource.
2609	Name *string `json:"name,omitempty"`
2610	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
2611	Type *string `json:"type,omitempty"`
2612	// Location - Resource location.
2613	Location *string `json:"location,omitempty"`
2614	// Tags - Resource tags.
2615	Tags map[string]*string `json:"tags"`
2616	// ETag - Optional ETag.
2617	ETag *string `json:"eTag,omitempty"`
2618}
2619
2620// MarshalJSON is the custom marshaler for EngineBaseResource.
2621func (ebr EngineBaseResource) MarshalJSON() ([]byte, error) {
2622	objectMap := make(map[string]interface{})
2623	objectMap["properties"] = ebr.Properties
2624	if ebr.ID != nil {
2625		objectMap["id"] = ebr.ID
2626	}
2627	if ebr.Name != nil {
2628		objectMap["name"] = ebr.Name
2629	}
2630	if ebr.Type != nil {
2631		objectMap["type"] = ebr.Type
2632	}
2633	if ebr.Location != nil {
2634		objectMap["location"] = ebr.Location
2635	}
2636	if ebr.Tags != nil {
2637		objectMap["tags"] = ebr.Tags
2638	}
2639	if ebr.ETag != nil {
2640		objectMap["eTag"] = ebr.ETag
2641	}
2642	return json.Marshal(objectMap)
2643}
2644
2645// UnmarshalJSON is the custom unmarshaler for EngineBaseResource struct.
2646func (ebr *EngineBaseResource) UnmarshalJSON(body []byte) error {
2647	var m map[string]*json.RawMessage
2648	err := json.Unmarshal(body, &m)
2649	if err != nil {
2650		return err
2651	}
2652	for k, v := range m {
2653		switch k {
2654		case "properties":
2655			if v != nil {
2656				properties, err := unmarshalBasicEngineBase(*v)
2657				if err != nil {
2658					return err
2659				}
2660				ebr.Properties = properties
2661			}
2662		case "id":
2663			if v != nil {
2664				var ID string
2665				err = json.Unmarshal(*v, &ID)
2666				if err != nil {
2667					return err
2668				}
2669				ebr.ID = &ID
2670			}
2671		case "name":
2672			if v != nil {
2673				var name string
2674				err = json.Unmarshal(*v, &name)
2675				if err != nil {
2676					return err
2677				}
2678				ebr.Name = &name
2679			}
2680		case "type":
2681			if v != nil {
2682				var typeVar string
2683				err = json.Unmarshal(*v, &typeVar)
2684				if err != nil {
2685					return err
2686				}
2687				ebr.Type = &typeVar
2688			}
2689		case "location":
2690			if v != nil {
2691				var location string
2692				err = json.Unmarshal(*v, &location)
2693				if err != nil {
2694					return err
2695				}
2696				ebr.Location = &location
2697			}
2698		case "tags":
2699			if v != nil {
2700				var tags map[string]*string
2701				err = json.Unmarshal(*v, &tags)
2702				if err != nil {
2703					return err
2704				}
2705				ebr.Tags = tags
2706			}
2707		case "eTag":
2708			if v != nil {
2709				var eTag string
2710				err = json.Unmarshal(*v, &eTag)
2711				if err != nil {
2712					return err
2713				}
2714				ebr.ETag = &eTag
2715			}
2716		}
2717	}
2718
2719	return nil
2720}
2721
2722// EngineBaseResourceList list of BackupEngineBase resources
2723type EngineBaseResourceList struct {
2724	autorest.Response `json:"-"`
2725	// Value - List of resources.
2726	Value *[]EngineBaseResource `json:"value,omitempty"`
2727	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
2728	NextLink *string `json:"nextLink,omitempty"`
2729}
2730
2731// EngineBaseResourceListIterator provides access to a complete listing of EngineBaseResource values.
2732type EngineBaseResourceListIterator struct {
2733	i    int
2734	page EngineBaseResourceListPage
2735}
2736
2737// NextWithContext advances to the next value.  If there was an error making
2738// the request the iterator does not advance and the error is returned.
2739func (iter *EngineBaseResourceListIterator) NextWithContext(ctx context.Context) (err error) {
2740	if tracing.IsEnabled() {
2741		ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListIterator.NextWithContext")
2742		defer func() {
2743			sc := -1
2744			if iter.Response().Response.Response != nil {
2745				sc = iter.Response().Response.Response.StatusCode
2746			}
2747			tracing.EndSpan(ctx, sc, err)
2748		}()
2749	}
2750	iter.i++
2751	if iter.i < len(iter.page.Values()) {
2752		return nil
2753	}
2754	err = iter.page.NextWithContext(ctx)
2755	if err != nil {
2756		iter.i--
2757		return err
2758	}
2759	iter.i = 0
2760	return nil
2761}
2762
2763// Next advances to the next value.  If there was an error making
2764// the request the iterator does not advance and the error is returned.
2765// Deprecated: Use NextWithContext() instead.
2766func (iter *EngineBaseResourceListIterator) Next() error {
2767	return iter.NextWithContext(context.Background())
2768}
2769
2770// NotDone returns true if the enumeration should be started or is not yet complete.
2771func (iter EngineBaseResourceListIterator) NotDone() bool {
2772	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2773}
2774
2775// Response returns the raw server response from the last page request.
2776func (iter EngineBaseResourceListIterator) Response() EngineBaseResourceList {
2777	return iter.page.Response()
2778}
2779
2780// Value returns the current value or a zero-initialized value if the
2781// iterator has advanced beyond the end of the collection.
2782func (iter EngineBaseResourceListIterator) Value() EngineBaseResource {
2783	if !iter.page.NotDone() {
2784		return EngineBaseResource{}
2785	}
2786	return iter.page.Values()[iter.i]
2787}
2788
2789// Creates a new instance of the EngineBaseResourceListIterator type.
2790func NewEngineBaseResourceListIterator(page EngineBaseResourceListPage) EngineBaseResourceListIterator {
2791	return EngineBaseResourceListIterator{page: page}
2792}
2793
2794// IsEmpty returns true if the ListResult contains no values.
2795func (ebrl EngineBaseResourceList) IsEmpty() bool {
2796	return ebrl.Value == nil || len(*ebrl.Value) == 0
2797}
2798
2799// engineBaseResourceListPreparer prepares a request to retrieve the next set of results.
2800// It returns nil if no more results exist.
2801func (ebrl EngineBaseResourceList) engineBaseResourceListPreparer(ctx context.Context) (*http.Request, error) {
2802	if ebrl.NextLink == nil || len(to.String(ebrl.NextLink)) < 1 {
2803		return nil, nil
2804	}
2805	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2806		autorest.AsJSON(),
2807		autorest.AsGet(),
2808		autorest.WithBaseURL(to.String(ebrl.NextLink)))
2809}
2810
2811// EngineBaseResourceListPage contains a page of EngineBaseResource values.
2812type EngineBaseResourceListPage struct {
2813	fn   func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)
2814	ebrl EngineBaseResourceList
2815}
2816
2817// NextWithContext advances to the next page of values.  If there was an error making
2818// the request the page does not advance and the error is returned.
2819func (page *EngineBaseResourceListPage) NextWithContext(ctx context.Context) (err error) {
2820	if tracing.IsEnabled() {
2821		ctx = tracing.StartSpan(ctx, fqdn+"/EngineBaseResourceListPage.NextWithContext")
2822		defer func() {
2823			sc := -1
2824			if page.Response().Response.Response != nil {
2825				sc = page.Response().Response.Response.StatusCode
2826			}
2827			tracing.EndSpan(ctx, sc, err)
2828		}()
2829	}
2830	next, err := page.fn(ctx, page.ebrl)
2831	if err != nil {
2832		return err
2833	}
2834	page.ebrl = next
2835	return nil
2836}
2837
2838// Next advances to the next page of values.  If there was an error making
2839// the request the page does not advance and the error is returned.
2840// Deprecated: Use NextWithContext() instead.
2841func (page *EngineBaseResourceListPage) Next() error {
2842	return page.NextWithContext(context.Background())
2843}
2844
2845// NotDone returns true if the page enumeration should be started or is not yet complete.
2846func (page EngineBaseResourceListPage) NotDone() bool {
2847	return !page.ebrl.IsEmpty()
2848}
2849
2850// Response returns the raw server response from the last page request.
2851func (page EngineBaseResourceListPage) Response() EngineBaseResourceList {
2852	return page.ebrl
2853}
2854
2855// Values returns the slice of values for the current page or nil if there are no values.
2856func (page EngineBaseResourceListPage) Values() []EngineBaseResource {
2857	if page.ebrl.IsEmpty() {
2858		return nil
2859	}
2860	return *page.ebrl.Value
2861}
2862
2863// Creates a new instance of the EngineBaseResourceListPage type.
2864func NewEngineBaseResourceListPage(getNextPage func(context.Context, EngineBaseResourceList) (EngineBaseResourceList, error)) EngineBaseResourceListPage {
2865	return EngineBaseResourceListPage{fn: getNextPage}
2866}
2867
2868// ExportJobsOperationResultInfo this class is used to send blob details after exporting jobs.
2869type ExportJobsOperationResultInfo struct {
2870	// BlobURL - The URL of the blob. The serialized string, which is the list of jobs, is exported to this URL.
2871	BlobURL *string `json:"blobUrl,omitempty"`
2872	// BlobSasKey - The Shared Access Signatures (SAS) key used to access the blob. The key expires after 15 minutes.
2873	BlobSasKey *string `json:"blobSasKey,omitempty"`
2874	// ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeOperationResultInfo', 'ObjectTypeExportJobsOperationResultInfo'
2875	ObjectType ObjectTypeBasicOperationResultInfoBase `json:"objectType,omitempty"`
2876}
2877
2878// MarshalJSON is the custom marshaler for ExportJobsOperationResultInfo.
2879func (ejori ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) {
2880	ejori.ObjectType = ObjectTypeExportJobsOperationResultInfo
2881	objectMap := make(map[string]interface{})
2882	if ejori.BlobURL != nil {
2883		objectMap["blobUrl"] = ejori.BlobURL
2884	}
2885	if ejori.BlobSasKey != nil {
2886		objectMap["blobSasKey"] = ejori.BlobSasKey
2887	}
2888	if ejori.ObjectType != "" {
2889		objectMap["objectType"] = ejori.ObjectType
2890	}
2891	return json.Marshal(objectMap)
2892}
2893
2894// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo.
2895func (ejori ExportJobsOperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) {
2896	return nil, false
2897}
2898
2899// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo.
2900func (ejori ExportJobsOperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) {
2901	return &ejori, true
2902}
2903
2904// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo.
2905func (ejori ExportJobsOperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) {
2906	return nil, false
2907}
2908
2909// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for ExportJobsOperationResultInfo.
2910func (ejori ExportJobsOperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) {
2911	return &ejori, true
2912}
2913
2914// GenericRecoveryPoint generic backup copy.
2915type GenericRecoveryPoint struct {
2916	// FriendlyName - Friendly name of the backup copy.
2917	FriendlyName *string `json:"friendlyName,omitempty"`
2918	// RecoveryPointType - Type of the backup copy.
2919	RecoveryPointType *string `json:"recoveryPointType,omitempty"`
2920	// RecoveryPointTime - The time when this backup copy was created.
2921	RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"`
2922	// RecoveryPointAdditionalInfo - Additional information associated with this backup copy.
2923	RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"`
2924	// ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint', 'ObjectTypeGenericRecoveryPoint'
2925	ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"`
2926}
2927
2928// MarshalJSON is the custom marshaler for GenericRecoveryPoint.
2929func (grp GenericRecoveryPoint) MarshalJSON() ([]byte, error) {
2930	grp.ObjectType = ObjectTypeGenericRecoveryPoint
2931	objectMap := make(map[string]interface{})
2932	if grp.FriendlyName != nil {
2933		objectMap["friendlyName"] = grp.FriendlyName
2934	}
2935	if grp.RecoveryPointType != nil {
2936		objectMap["recoveryPointType"] = grp.RecoveryPointType
2937	}
2938	if grp.RecoveryPointTime != nil {
2939		objectMap["recoveryPointTime"] = grp.RecoveryPointTime
2940	}
2941	if grp.RecoveryPointAdditionalInfo != nil {
2942		objectMap["recoveryPointAdditionalInfo"] = grp.RecoveryPointAdditionalInfo
2943	}
2944	if grp.ObjectType != "" {
2945		objectMap["objectType"] = grp.ObjectType
2946	}
2947	return json.Marshal(objectMap)
2948}
2949
2950// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint.
2951func (grp GenericRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) {
2952	return nil, false
2953}
2954
2955// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint.
2956func (grp GenericRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) {
2957	return &grp, true
2958}
2959
2960// AsRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint.
2961func (grp GenericRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) {
2962	return nil, false
2963}
2964
2965// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for GenericRecoveryPoint.
2966func (grp GenericRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) {
2967	return &grp, true
2968}
2969
2970// GetProtectedItemQueryObject this object filters the list of backup items.
2971type GetProtectedItemQueryObject struct {
2972	// Expand - Specifies if the additional information should be provided for this item.
2973	Expand *string `json:"expand,omitempty"`
2974}
2975
2976// IaasVMBackupRequest this is an Azure VM (also known as IaaS VM) workload-specific backup request.
2977type IaasVMBackupRequest struct {
2978	// RecoveryPointExpiryTimeInUTC - The backup copy will expire after the time specified. The time is in UTC format.
2979	RecoveryPointExpiryTimeInUTC *date.Time `json:"recoveryPointExpiryTimeInUTC,omitempty"`
2980	// ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeIaasVMBackupRequest'
2981	ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"`
2982}
2983
2984// MarshalJSON is the custom marshaler for IaasVMBackupRequest.
2985func (ivbr IaasVMBackupRequest) MarshalJSON() ([]byte, error) {
2986	ivbr.ObjectType = ObjectTypeIaasVMBackupRequest
2987	objectMap := make(map[string]interface{})
2988	if ivbr.RecoveryPointExpiryTimeInUTC != nil {
2989		objectMap["recoveryPointExpiryTimeInUTC"] = ivbr.RecoveryPointExpiryTimeInUTC
2990	}
2991	if ivbr.ObjectType != "" {
2992		objectMap["objectType"] = ivbr.ObjectType
2993	}
2994	return json.Marshal(objectMap)
2995}
2996
2997// AsIaasVMBackupRequest is the BasicRequest implementation for IaasVMBackupRequest.
2998func (ivbr IaasVMBackupRequest) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) {
2999	return &ivbr, true
3000}
3001
3002// AsRequest is the BasicRequest implementation for IaasVMBackupRequest.
3003func (ivbr IaasVMBackupRequest) AsRequest() (*Request, bool) {
3004	return nil, false
3005}
3006
3007// AsBasicRequest is the BasicRequest implementation for IaasVMBackupRequest.
3008func (ivbr IaasVMBackupRequest) AsBasicRequest() (BasicRequest, bool) {
3009	return &ivbr, true
3010}
3011
3012// BasicIaaSVMContainer iaaS VM workload-specific container.
3013type BasicIaaSVMContainer interface {
3014	AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool)
3015	AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool)
3016	AsIaaSVMContainer() (*IaaSVMContainer, bool)
3017}
3018
3019// IaaSVMContainer iaaS VM workload-specific container.
3020type IaaSVMContainer struct {
3021	// VirtualMachineID - The fully qualified Resource Manager URL of the virtual machine represented by this Azure IaaS VM container.
3022	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
3023	// VirtualMachineVersion - Specifies whether the container represents a classic or a Resource Manager-deployed virtual machine.
3024	VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"`
3025	// ResourceGroup - The resource group name associated with the Recovery Services vault.
3026	ResourceGroup *string `json:"resourceGroup,omitempty"`
3027	// FriendlyName - Friendly name of the container.
3028	FriendlyName *string `json:"friendlyName,omitempty"`
3029	// BackupManagementType - The backup management type for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
3030	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
3031	// RegistrationStatus - The container's registration status with the Recovery Services vault.
3032	RegistrationStatus *string `json:"registrationStatus,omitempty"`
3033	// HealthStatus - The status of the container's health.
3034	HealthStatus *string `json:"healthStatus,omitempty"`
3035	// ContainerType - READ-ONLY; The type assigned to the container. The values to use for each of these properties are:<br/> 1. Compute Azure VM is Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows machines (like Azure Backup Server and DPM) is Windows<br/> 4. Azure SQL instance is AzureSqlContainer.
3036	ContainerType *string `json:"containerType,omitempty"`
3037	// ProtectableObjectType - Possible values include: 'ProtectableObjectTypeProtectionContainer', 'ProtectableObjectTypeAzureSQLContainer', 'ProtectableObjectTypeIaaSVMContainer', 'ProtectableObjectTypeMABWindowsContainer', 'ProtectableObjectTypeMicrosoftComputevirtualMachines', 'ProtectableObjectTypeMicrosoftClassicComputevirtualMachines'
3038	ProtectableObjectType ProtectableObjectType `json:"protectableObjectType,omitempty"`
3039}
3040
3041func unmarshalBasicIaaSVMContainer(body []byte) (BasicIaaSVMContainer, error) {
3042	var m map[string]interface{}
3043	err := json.Unmarshal(body, &m)
3044	if err != nil {
3045		return nil, err
3046	}
3047
3048	switch m["protectableObjectType"] {
3049	case string(ProtectableObjectTypeMicrosoftComputevirtualMachines):
3050		var aiscvc AzureIaaSComputeVMContainer
3051		err := json.Unmarshal(body, &aiscvc)
3052		return aiscvc, err
3053	case string(ProtectableObjectTypeMicrosoftClassicComputevirtualMachines):
3054		var aisccvc AzureIaaSClassicComputeVMContainer
3055		err := json.Unmarshal(body, &aisccvc)
3056		return aisccvc, err
3057	default:
3058		var isc IaaSVMContainer
3059		err := json.Unmarshal(body, &isc)
3060		return isc, err
3061	}
3062}
3063func unmarshalBasicIaaSVMContainerArray(body []byte) ([]BasicIaaSVMContainer, error) {
3064	var rawMessages []*json.RawMessage
3065	err := json.Unmarshal(body, &rawMessages)
3066	if err != nil {
3067		return nil, err
3068	}
3069
3070	iscArray := make([]BasicIaaSVMContainer, len(rawMessages))
3071
3072	for index, rawMessage := range rawMessages {
3073		isc, err := unmarshalBasicIaaSVMContainer(*rawMessage)
3074		if err != nil {
3075			return nil, err
3076		}
3077		iscArray[index] = isc
3078	}
3079	return iscArray, nil
3080}
3081
3082// MarshalJSON is the custom marshaler for IaaSVMContainer.
3083func (isc IaaSVMContainer) MarshalJSON() ([]byte, error) {
3084	isc.ProtectableObjectType = ProtectableObjectTypeIaaSVMContainer
3085	objectMap := make(map[string]interface{})
3086	if isc.VirtualMachineID != nil {
3087		objectMap["virtualMachineId"] = isc.VirtualMachineID
3088	}
3089	if isc.VirtualMachineVersion != nil {
3090		objectMap["virtualMachineVersion"] = isc.VirtualMachineVersion
3091	}
3092	if isc.ResourceGroup != nil {
3093		objectMap["resourceGroup"] = isc.ResourceGroup
3094	}
3095	if isc.FriendlyName != nil {
3096		objectMap["friendlyName"] = isc.FriendlyName
3097	}
3098	if isc.BackupManagementType != "" {
3099		objectMap["backupManagementType"] = isc.BackupManagementType
3100	}
3101	if isc.RegistrationStatus != nil {
3102		objectMap["registrationStatus"] = isc.RegistrationStatus
3103	}
3104	if isc.HealthStatus != nil {
3105		objectMap["healthStatus"] = isc.HealthStatus
3106	}
3107	if isc.ProtectableObjectType != "" {
3108		objectMap["protectableObjectType"] = isc.ProtectableObjectType
3109	}
3110	return json.Marshal(objectMap)
3111}
3112
3113// AsAzureSQLContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3114func (isc IaaSVMContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) {
3115	return nil, false
3116}
3117
3118// AsIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3119func (isc IaaSVMContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) {
3120	return &isc, true
3121}
3122
3123// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3124func (isc IaaSVMContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) {
3125	return &isc, true
3126}
3127
3128// AsMabContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3129func (isc IaaSVMContainer) AsMabContainer() (*MabContainer, bool) {
3130	return nil, false
3131}
3132
3133// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3134func (isc IaaSVMContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) {
3135	return nil, false
3136}
3137
3138// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3139func (isc IaaSVMContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) {
3140	return nil, false
3141}
3142
3143// AsProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3144func (isc IaaSVMContainer) AsProtectionContainer() (*ProtectionContainer, bool) {
3145	return nil, false
3146}
3147
3148// AsBasicProtectionContainer is the BasicProtectionContainer implementation for IaaSVMContainer.
3149func (isc IaaSVMContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) {
3150	return &isc, true
3151}
3152
3153// IaasVMILRRegistrationRequest restore files or folders from a backup copy, or recovery point, of an IaaS
3154// (or Azure) VM.
3155type IaasVMILRRegistrationRequest struct {
3156	// RecoveryPointID - The ID of the IaaS VM recovery point used to restore the files or folders.
3157	RecoveryPointID *string `json:"recoveryPointId,omitempty"`
3158	// VirtualMachineID - The fully qualified Resource Manager ID of the VM used to restore the files or folders.
3159	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
3160	// InitiatorName - The iSCSI initiator name.
3161	InitiatorName *string `json:"initiatorName,omitempty"`
3162	// RenewExistingRegistration - Whether to renew the existing registration with the iSCSI server.
3163	RenewExistingRegistration *bool `json:"renewExistingRegistration,omitempty"`
3164	// ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest'
3165	ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"`
3166}
3167
3168// MarshalJSON is the custom marshaler for IaasVMILRRegistrationRequest.
3169func (ivrr IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) {
3170	ivrr.ObjectType = ObjectTypeIaasVMILRRegistrationRequest
3171	objectMap := make(map[string]interface{})
3172	if ivrr.RecoveryPointID != nil {
3173		objectMap["recoveryPointId"] = ivrr.RecoveryPointID
3174	}
3175	if ivrr.VirtualMachineID != nil {
3176		objectMap["virtualMachineId"] = ivrr.VirtualMachineID
3177	}
3178	if ivrr.InitiatorName != nil {
3179		objectMap["initiatorName"] = ivrr.InitiatorName
3180	}
3181	if ivrr.RenewExistingRegistration != nil {
3182		objectMap["renewExistingRegistration"] = ivrr.RenewExistingRegistration
3183	}
3184	if ivrr.ObjectType != "" {
3185		objectMap["objectType"] = ivrr.ObjectType
3186	}
3187	return json.Marshal(objectMap)
3188}
3189
3190// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest.
3191func (ivrr IaasVMILRRegistrationRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) {
3192	return &ivrr, true
3193}
3194
3195// AsILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest.
3196func (ivrr IaasVMILRRegistrationRequest) AsILRRequest() (*ILRRequest, bool) {
3197	return nil, false
3198}
3199
3200// AsBasicILRRequest is the BasicILRRequest implementation for IaasVMILRRegistrationRequest.
3201func (ivrr IaasVMILRRegistrationRequest) AsBasicILRRequest() (BasicILRRequest, bool) {
3202	return &ivrr, true
3203}
3204
3205// BasicIaaSVMProtectableItem this Azure VM workload-specific (also known as IaaS VM workload-specific) backup item can
3206// be backed up.
3207type BasicIaaSVMProtectableItem interface {
3208	AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool)
3209	AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool)
3210	AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool)
3211}
3212
3213// IaaSVMProtectableItem this Azure VM workload-specific (also known as IaaS VM workload-specific) backup item
3214// can be backed up.
3215type IaaSVMProtectableItem struct {
3216	// VirtualMachineID - The fully qualified Resource Manager ID of the virtual machine.
3217	VirtualMachineID *string `json:"virtualMachineId,omitempty"`
3218	// BackupManagementType - The backup management type.
3219	BackupManagementType *string `json:"backupManagementType,omitempty"`
3220	// FriendlyName - The friendly name of the backup item.
3221	FriendlyName *string `json:"friendlyName,omitempty"`
3222	// ProtectionState - The state of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected'
3223	ProtectionState ProtectionStatus `json:"protectionState,omitempty"`
3224	// ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeIaaSVMProtectableItem', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines'
3225	ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"`
3226}
3227
3228func unmarshalBasicIaaSVMProtectableItem(body []byte) (BasicIaaSVMProtectableItem, error) {
3229	var m map[string]interface{}
3230	err := json.Unmarshal(body, &m)
3231	if err != nil {
3232		return nil, err
3233	}
3234
3235	switch m["protectableItemType"] {
3236	case string(ProtectableItemTypeMicrosoftComputevirtualMachines):
3237		var aiscvpi AzureIaaSComputeVMProtectableItem
3238		err := json.Unmarshal(body, &aiscvpi)
3239		return aiscvpi, err
3240	case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines):
3241		var aisccvpi AzureIaaSClassicComputeVMProtectableItem
3242		err := json.Unmarshal(body, &aisccvpi)
3243		return aisccvpi, err
3244	default:
3245		var ispi IaaSVMProtectableItem
3246		err := json.Unmarshal(body, &ispi)
3247		return ispi, err
3248	}
3249}
3250func unmarshalBasicIaaSVMProtectableItemArray(body []byte) ([]BasicIaaSVMProtectableItem, error) {
3251	var rawMessages []*json.RawMessage
3252	err := json.Unmarshal(body, &rawMessages)
3253	if err != nil {
3254		return nil, err
3255	}
3256
3257	ispiArray := make([]BasicIaaSVMProtectableItem, len(rawMessages))
3258
3259	for index, rawMessage := range rawMessages {
3260		ispi, err := unmarshalBasicIaaSVMProtectableItem(*rawMessage)
3261		if err != nil {
3262			return nil, err
3263		}
3264		ispiArray[index] = ispi
3265	}
3266	return ispiArray, nil
3267}
3268
3269// MarshalJSON is the custom marshaler for IaaSVMProtectableItem.
3270func (ispi IaaSVMProtectableItem) MarshalJSON() ([]byte, error) {
3271	ispi.ProtectableItemType = ProtectableItemTypeIaaSVMProtectableItem
3272	objectMap := make(map[string]interface{})
3273	if ispi.VirtualMachineID != nil {
3274		objectMap["virtualMachineId"] = ispi.VirtualMachineID
3275	}
3276	if ispi.BackupManagementType != nil {
3277		objectMap["backupManagementType"] = ispi.BackupManagementType
3278	}
3279	if ispi.FriendlyName != nil {
3280		objectMap["friendlyName"] = ispi.FriendlyName
3281	}
3282	if ispi.ProtectionState != "" {
3283		objectMap["protectionState"] = ispi.ProtectionState
3284	}
3285	if ispi.ProtectableItemType != "" {
3286		objectMap["protectableItemType"] = ispi.ProtectableItemType
3287	}
3288	return json.Marshal(objectMap)
3289}
3290
3291// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem.
3292func (ispi IaaSVMProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) {
3293	return &ispi, true
3294}
3295
3296// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem.
3297func (ispi IaaSVMProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) {
3298	return &ispi, true
3299}
3300
3301// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem.
3302func (ispi IaaSVMProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) {
3303	return nil, false
3304}
3305
3306// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem.
3307func (ispi IaaSVMProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) {
3308	return nil, false
3309}
3310
3311// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem.
3312func (ispi IaaSVMProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) {
3313	return nil, false
3314}
3315
3316// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for IaaSVMProtectableItem.
3317func (ispi IaaSVMProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) {
3318	return &ispi, true
3319}
3320
3321// IaasVMRecoveryPoint azure VM (also known as IaaS VM) workload-specific backup copy.
3322type IaasVMRecoveryPoint struct {
3323	// RecoveryPointType - Type of the backup copy.
3324	RecoveryPointType *string `json:"recoveryPointType,omitempty"`
3325	// RecoveryPointTime - The date and time when the backup copy was created.
3326	RecoveryPointTime *date.Time `json:"recoveryPointTime,omitempty"`
3327	// RecoveryPointAdditionalInfo - Additional information associated with this backup copy.
3328	RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"`
3329	// SourceVMStorageType - The storage type for the VM whose backup copy was created.
3330	SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"`
3331	// IsSourceVMEncrypted - Identifies whether the VM was encrypted when the backup copy is created.
3332	IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"`
3333	// KeyAndSecret - Required details for recovering an encrypted VM. Applicable only when IsSourceVMEncrypted is true.
3334	KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"`
3335	// IsInstantILRSessionActive - Answer to the question - Is the session to recover items from this backup copy still active.
3336	IsInstantILRSessionActive *bool `json:"isInstantILRSessionActive,omitempty"`
3337	// ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint', 'ObjectTypeGenericRecoveryPoint'
3338	ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"`
3339}
3340
3341// MarshalJSON is the custom marshaler for IaasVMRecoveryPoint.
3342func (ivrp IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) {
3343	ivrp.ObjectType = ObjectTypeIaasVMRecoveryPoint
3344	objectMap := make(map[string]interface{})
3345	if ivrp.RecoveryPointType != nil {
3346		objectMap["recoveryPointType"] = ivrp.RecoveryPointType
3347	}
3348	if ivrp.RecoveryPointTime != nil {
3349		objectMap["recoveryPointTime"] = ivrp.RecoveryPointTime
3350	}
3351	if ivrp.RecoveryPointAdditionalInfo != nil {
3352		objectMap["recoveryPointAdditionalInfo"] = ivrp.RecoveryPointAdditionalInfo
3353	}
3354	if ivrp.SourceVMStorageType != nil {
3355		objectMap["sourceVMStorageType"] = ivrp.SourceVMStorageType
3356	}
3357	if ivrp.IsSourceVMEncrypted != nil {
3358		objectMap["isSourceVMEncrypted"] = ivrp.IsSourceVMEncrypted
3359	}
3360	if ivrp.KeyAndSecret != nil {
3361		objectMap["keyAndSecret"] = ivrp.KeyAndSecret
3362	}
3363	if ivrp.IsInstantILRSessionActive != nil {
3364		objectMap["isInstantILRSessionActive"] = ivrp.IsInstantILRSessionActive
3365	}
3366	if ivrp.ObjectType != "" {
3367		objectMap["objectType"] = ivrp.ObjectType
3368	}
3369	return json.Marshal(objectMap)
3370}
3371
3372// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint.
3373func (ivrp IaasVMRecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) {
3374	return &ivrp, true
3375}
3376
3377// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint.
3378func (ivrp IaasVMRecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) {
3379	return nil, false
3380}
3381
3382// AsRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint.
3383func (ivrp IaasVMRecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) {
3384	return nil, false
3385}
3386
3387// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for IaasVMRecoveryPoint.
3388func (ivrp IaasVMRecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) {
3389	return &ivrp, true
3390}
3391
3392// IaasVMRestoreRequest iaaS VM workload-specific restore.
3393type IaasVMRestoreRequest struct {
3394	// RecoveryPointID - The ID of the backup copy to be recovered.
3395	RecoveryPointID *string `json:"recoveryPointId,omitempty"`
3396	// RecoveryType - The type of this recovery. Possible values include: 'RecoveryTypeInvalid', 'RecoveryTypeOriginalLocation', 'RecoveryTypeAlternateLocation', 'RecoveryTypeRestoreDisks'
3397	RecoveryType RecoveryType `json:"recoveryType,omitempty"`
3398	// SourceResourceID - The fully qualified Resource Manager ID of the VM being recovered.
3399	SourceResourceID *string `json:"sourceResourceId,omitempty"`
3400	// TargetVirtualMachineID - The complete Resource Manager ID of the VM that will be created.
3401	//             For example: /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}
3402	TargetVirtualMachineID *string `json:"targetVirtualMachineId,omitempty"`
3403	// TargetResourceGroupID - The Resource Manager ID of the resource group you're creating for this VM and other artifacts.
3404	//     For example: /subscriptions/{subId}/resourcegroups/{rg}
3405	TargetResourceGroupID *string `json:"targetResourceGroupId,omitempty"`
3406	// StorageAccountID - The fully qualified Resource Manager ID of the storage account where the VM will be restored.
3407	StorageAccountID *string `json:"storageAccountId,omitempty"`
3408	// VirtualNetworkID - This is the virtual network ID of the vnet that is attached to the virtual machine.
3409	//             Your join action permissions are validated during the linked access.
3410	VirtualNetworkID *string `json:"virtualNetworkId,omitempty"`
3411	// SubnetID - Subnet ID is the identifier for the VM to be restored. For Classic VMs the subnet ID would be {VnetID}/Subnet/{SubnetName}, and for the Resource Manager VMs, the subnet ID would be the Resource Manager resource ID used to represent the subnet.
3412	SubnetID *string `json:"subnetId,omitempty"`
3413	// TargetDomainNameID - The fully qualified Resource Manager ID of the domain name to be associated with the VM being restored. Use the Resource Manager ID to identify the domain, only for Classic-deployed virtual machines.
3414	TargetDomainNameID *string `json:"targetDomainNameId,omitempty"`
3415	// Region - The region where the virtual machine is restored.
3416	Region *string `json:"region,omitempty"`
3417	// AffinityGroup - The affinity group associated with the VM to be restored. Affinity groups are used only for Classic-deployed virtual machines.
3418	AffinityGroup *string `json:"affinityGroup,omitempty"`
3419	// CreateNewCloudService - Asks the question if a new cloud service should be created while restoring the VM. If the answer is false, the VM is restored to the same cloud service.
3420	CreateNewCloudService *bool `json:"createNewCloudService,omitempty"`
3421	// EncryptionDetails - If the VM was encrypted at the time of backup, these details are needed.
3422	EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"`
3423	// ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeIaasVMRestoreRequest'
3424	ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"`
3425}
3426
3427// MarshalJSON is the custom marshaler for IaasVMRestoreRequest.
3428func (ivrr IaasVMRestoreRequest) MarshalJSON() ([]byte, error) {
3429	ivrr.ObjectType = ObjectTypeIaasVMRestoreRequest
3430	objectMap := make(map[string]interface{})
3431	if ivrr.RecoveryPointID != nil {
3432		objectMap["recoveryPointId"] = ivrr.RecoveryPointID
3433	}
3434	if ivrr.RecoveryType != "" {
3435		objectMap["recoveryType"] = ivrr.RecoveryType
3436	}
3437	if ivrr.SourceResourceID != nil {
3438		objectMap["sourceResourceId"] = ivrr.SourceResourceID
3439	}
3440	if ivrr.TargetVirtualMachineID != nil {
3441		objectMap["targetVirtualMachineId"] = ivrr.TargetVirtualMachineID
3442	}
3443	if ivrr.TargetResourceGroupID != nil {
3444		objectMap["targetResourceGroupId"] = ivrr.TargetResourceGroupID
3445	}
3446	if ivrr.StorageAccountID != nil {
3447		objectMap["storageAccountId"] = ivrr.StorageAccountID
3448	}
3449	if ivrr.VirtualNetworkID != nil {
3450		objectMap["virtualNetworkId"] = ivrr.VirtualNetworkID
3451	}
3452	if ivrr.SubnetID != nil {
3453		objectMap["subnetId"] = ivrr.SubnetID
3454	}
3455	if ivrr.TargetDomainNameID != nil {
3456		objectMap["targetDomainNameId"] = ivrr.TargetDomainNameID
3457	}
3458	if ivrr.Region != nil {
3459		objectMap["region"] = ivrr.Region
3460	}
3461	if ivrr.AffinityGroup != nil {
3462		objectMap["affinityGroup"] = ivrr.AffinityGroup
3463	}
3464	if ivrr.CreateNewCloudService != nil {
3465		objectMap["createNewCloudService"] = ivrr.CreateNewCloudService
3466	}
3467	if ivrr.EncryptionDetails != nil {
3468		objectMap["encryptionDetails"] = ivrr.EncryptionDetails
3469	}
3470	if ivrr.ObjectType != "" {
3471		objectMap["objectType"] = ivrr.ObjectType
3472	}
3473	return json.Marshal(objectMap)
3474}
3475
3476// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest.
3477func (ivrr IaasVMRestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) {
3478	return &ivrr, true
3479}
3480
3481// AsRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest.
3482func (ivrr IaasVMRestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) {
3483	return nil, false
3484}
3485
3486// AsBasicRestoreRequest is the BasicRestoreRequest implementation for IaasVMRestoreRequest.
3487func (ivrr IaasVMRestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) {
3488	return &ivrr, true
3489}
3490
3491// BasicILRRequest parameters to restore file or folders API.
3492type BasicILRRequest interface {
3493	AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool)
3494	AsILRRequest() (*ILRRequest, bool)
3495}
3496
3497// ILRRequest parameters to restore file or folders API.
3498type ILRRequest struct {
3499	// ObjectType - Possible values include: 'ObjectTypeILRRequest', 'ObjectTypeIaasVMILRRegistrationRequest'
3500	ObjectType ObjectTypeBasicILRRequest `json:"objectType,omitempty"`
3501}
3502
3503func unmarshalBasicILRRequest(body []byte) (BasicILRRequest, error) {
3504	var m map[string]interface{}
3505	err := json.Unmarshal(body, &m)
3506	if err != nil {
3507		return nil, err
3508	}
3509
3510	switch m["objectType"] {
3511	case string(ObjectTypeIaasVMILRRegistrationRequest):
3512		var ivrr IaasVMILRRegistrationRequest
3513		err := json.Unmarshal(body, &ivrr)
3514		return ivrr, err
3515	default:
3516		var ir ILRRequest
3517		err := json.Unmarshal(body, &ir)
3518		return ir, err
3519	}
3520}
3521func unmarshalBasicILRRequestArray(body []byte) ([]BasicILRRequest, error) {
3522	var rawMessages []*json.RawMessage
3523	err := json.Unmarshal(body, &rawMessages)
3524	if err != nil {
3525		return nil, err
3526	}
3527
3528	irArray := make([]BasicILRRequest, len(rawMessages))
3529
3530	for index, rawMessage := range rawMessages {
3531		ir, err := unmarshalBasicILRRequest(*rawMessage)
3532		if err != nil {
3533			return nil, err
3534		}
3535		irArray[index] = ir
3536	}
3537	return irArray, nil
3538}
3539
3540// MarshalJSON is the custom marshaler for ILRRequest.
3541func (ir ILRRequest) MarshalJSON() ([]byte, error) {
3542	ir.ObjectType = ObjectTypeILRRequest
3543	objectMap := make(map[string]interface{})
3544	if ir.ObjectType != "" {
3545		objectMap["objectType"] = ir.ObjectType
3546	}
3547	return json.Marshal(objectMap)
3548}
3549
3550// AsIaasVMILRRegistrationRequest is the BasicILRRequest implementation for ILRRequest.
3551func (ir ILRRequest) AsIaasVMILRRegistrationRequest() (*IaasVMILRRegistrationRequest, bool) {
3552	return nil, false
3553}
3554
3555// AsILRRequest is the BasicILRRequest implementation for ILRRequest.
3556func (ir ILRRequest) AsILRRequest() (*ILRRequest, bool) {
3557	return &ir, true
3558}
3559
3560// AsBasicILRRequest is the BasicILRRequest implementation for ILRRequest.
3561func (ir ILRRequest) AsBasicILRRequest() (BasicILRRequest, bool) {
3562	return &ir, true
3563}
3564
3565// ILRRequestResource the parameters to restore files or folders.
3566type ILRRequestResource struct {
3567	Properties BasicILRRequest `json:"properties,omitempty"`
3568	// ID - Resource ID represents the complete path to the resource.
3569	ID *string `json:"id,omitempty"`
3570	// Name - Resource name associated with the resource.
3571	Name *string `json:"name,omitempty"`
3572	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
3573	Type *string `json:"type,omitempty"`
3574	// Location - Resource location.
3575	Location *string `json:"location,omitempty"`
3576	// Tags - Resource tags.
3577	Tags map[string]*string `json:"tags"`
3578	// ETag - Optional ETag.
3579	ETag *string `json:"eTag,omitempty"`
3580}
3581
3582// MarshalJSON is the custom marshaler for ILRRequestResource.
3583func (irr ILRRequestResource) MarshalJSON() ([]byte, error) {
3584	objectMap := make(map[string]interface{})
3585	objectMap["properties"] = irr.Properties
3586	if irr.ID != nil {
3587		objectMap["id"] = irr.ID
3588	}
3589	if irr.Name != nil {
3590		objectMap["name"] = irr.Name
3591	}
3592	if irr.Type != nil {
3593		objectMap["type"] = irr.Type
3594	}
3595	if irr.Location != nil {
3596		objectMap["location"] = irr.Location
3597	}
3598	if irr.Tags != nil {
3599		objectMap["tags"] = irr.Tags
3600	}
3601	if irr.ETag != nil {
3602		objectMap["eTag"] = irr.ETag
3603	}
3604	return json.Marshal(objectMap)
3605}
3606
3607// UnmarshalJSON is the custom unmarshaler for ILRRequestResource struct.
3608func (irr *ILRRequestResource) UnmarshalJSON(body []byte) error {
3609	var m map[string]*json.RawMessage
3610	err := json.Unmarshal(body, &m)
3611	if err != nil {
3612		return err
3613	}
3614	for k, v := range m {
3615		switch k {
3616		case "properties":
3617			if v != nil {
3618				properties, err := unmarshalBasicILRRequest(*v)
3619				if err != nil {
3620					return err
3621				}
3622				irr.Properties = properties
3623			}
3624		case "id":
3625			if v != nil {
3626				var ID string
3627				err = json.Unmarshal(*v, &ID)
3628				if err != nil {
3629					return err
3630				}
3631				irr.ID = &ID
3632			}
3633		case "name":
3634			if v != nil {
3635				var name string
3636				err = json.Unmarshal(*v, &name)
3637				if err != nil {
3638					return err
3639				}
3640				irr.Name = &name
3641			}
3642		case "type":
3643			if v != nil {
3644				var typeVar string
3645				err = json.Unmarshal(*v, &typeVar)
3646				if err != nil {
3647					return err
3648				}
3649				irr.Type = &typeVar
3650			}
3651		case "location":
3652			if v != nil {
3653				var location string
3654				err = json.Unmarshal(*v, &location)
3655				if err != nil {
3656					return err
3657				}
3658				irr.Location = &location
3659			}
3660		case "tags":
3661			if v != nil {
3662				var tags map[string]*string
3663				err = json.Unmarshal(*v, &tags)
3664				if err != nil {
3665					return err
3666				}
3667				irr.Tags = tags
3668			}
3669		case "eTag":
3670			if v != nil {
3671				var eTag string
3672				err = json.Unmarshal(*v, &eTag)
3673				if err != nil {
3674					return err
3675				}
3676				irr.ETag = &eTag
3677			}
3678		}
3679	}
3680
3681	return nil
3682}
3683
3684// InstantItemRecoveryTarget target details for the file or folder restore.
3685type InstantItemRecoveryTarget struct {
3686	// ClientScripts - List of client scripts.
3687	ClientScripts *[]ClientScriptForConnect `json:"clientScripts,omitempty"`
3688}
3689
3690// BasicJob defines workload-agnostic properties for a job.
3691type BasicJob interface {
3692	AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool)
3693	AsDpmJob() (*DpmJob, bool)
3694	AsMabJob() (*MabJob, bool)
3695	AsJob() (*Job, bool)
3696}
3697
3698// Job defines workload-agnostic properties for a job.
3699type Job struct {
3700	// EntityFriendlyName - The friendly name of the entity on which the current job is executing.
3701	EntityFriendlyName *string `json:"entityFriendlyName,omitempty"`
3702	// BackupManagementType - The backup management type for the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
3703	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
3704	// Operation - The operation name.
3705	Operation *string `json:"operation,omitempty"`
3706	// Status - The job status.
3707	Status *string `json:"status,omitempty"`
3708	// StartTime - The start time.
3709	StartTime *date.Time `json:"startTime,omitempty"`
3710	// EndTime - The end time.
3711	EndTime *date.Time `json:"endTime,omitempty"`
3712	// ActivityID - ActivityId of job.
3713	ActivityID *string `json:"activityId,omitempty"`
3714	// JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeDpmJob', 'JobTypeMabJob'
3715	JobType JobType `json:"jobType,omitempty"`
3716}
3717
3718func unmarshalBasicJob(body []byte) (BasicJob, error) {
3719	var m map[string]interface{}
3720	err := json.Unmarshal(body, &m)
3721	if err != nil {
3722		return nil, err
3723	}
3724
3725	switch m["jobType"] {
3726	case string(JobTypeAzureIaaSVMJob):
3727		var aisj AzureIaaSVMJob
3728		err := json.Unmarshal(body, &aisj)
3729		return aisj, err
3730	case string(JobTypeDpmJob):
3731		var dj DpmJob
3732		err := json.Unmarshal(body, &dj)
3733		return dj, err
3734	case string(JobTypeMabJob):
3735		var mj MabJob
3736		err := json.Unmarshal(body, &mj)
3737		return mj, err
3738	default:
3739		var j Job
3740		err := json.Unmarshal(body, &j)
3741		return j, err
3742	}
3743}
3744func unmarshalBasicJobArray(body []byte) ([]BasicJob, error) {
3745	var rawMessages []*json.RawMessage
3746	err := json.Unmarshal(body, &rawMessages)
3747	if err != nil {
3748		return nil, err
3749	}
3750
3751	jArray := make([]BasicJob, len(rawMessages))
3752
3753	for index, rawMessage := range rawMessages {
3754		j, err := unmarshalBasicJob(*rawMessage)
3755		if err != nil {
3756			return nil, err
3757		}
3758		jArray[index] = j
3759	}
3760	return jArray, nil
3761}
3762
3763// MarshalJSON is the custom marshaler for Job.
3764func (j Job) MarshalJSON() ([]byte, error) {
3765	j.JobType = JobTypeJob
3766	objectMap := make(map[string]interface{})
3767	if j.EntityFriendlyName != nil {
3768		objectMap["entityFriendlyName"] = j.EntityFriendlyName
3769	}
3770	if j.BackupManagementType != "" {
3771		objectMap["backupManagementType"] = j.BackupManagementType
3772	}
3773	if j.Operation != nil {
3774		objectMap["operation"] = j.Operation
3775	}
3776	if j.Status != nil {
3777		objectMap["status"] = j.Status
3778	}
3779	if j.StartTime != nil {
3780		objectMap["startTime"] = j.StartTime
3781	}
3782	if j.EndTime != nil {
3783		objectMap["endTime"] = j.EndTime
3784	}
3785	if j.ActivityID != nil {
3786		objectMap["activityId"] = j.ActivityID
3787	}
3788	if j.JobType != "" {
3789		objectMap["jobType"] = j.JobType
3790	}
3791	return json.Marshal(objectMap)
3792}
3793
3794// AsAzureIaaSVMJob is the BasicJob implementation for Job.
3795func (j Job) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) {
3796	return nil, false
3797}
3798
3799// AsDpmJob is the BasicJob implementation for Job.
3800func (j Job) AsDpmJob() (*DpmJob, bool) {
3801	return nil, false
3802}
3803
3804// AsMabJob is the BasicJob implementation for Job.
3805func (j Job) AsMabJob() (*MabJob, bool) {
3806	return nil, false
3807}
3808
3809// AsJob is the BasicJob implementation for Job.
3810func (j Job) AsJob() (*Job, bool) {
3811	return &j, true
3812}
3813
3814// AsBasicJob is the BasicJob implementation for Job.
3815func (j Job) AsBasicJob() (BasicJob, bool) {
3816	return &j, true
3817}
3818
3819// JobQueryObject the filters to list the jobs.
3820type JobQueryObject struct {
3821	// Status - Status of the job. Possible values include: 'JobStatusInvalid', 'JobStatusInProgress', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCompletedWithWarnings', 'JobStatusCancelled', 'JobStatusCancelling'
3822	Status JobStatus `json:"status,omitempty"`
3823	// BackupManagementType - Type of backup management for the job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
3824	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
3825	// Operation - The type of operation. Possible values include: 'JobOperationTypeInvalid', 'JobOperationTypeConfigureBackup', 'JobOperationTypeBackup', 'JobOperationTypeRestore', 'JobOperationTypeDisableBackup', 'JobOperationTypeDeleteBackupData'
3826	Operation JobOperationType `json:"operation,omitempty"`
3827	// JobID - The ID of the job. Each jobID is unique.
3828	JobID *string `json:"jobId,omitempty"`
3829	// StartTime - The time when the job starts. The value is in UTC.
3830	StartTime *date.Time `json:"startTime,omitempty"`
3831	// EndTime - The time when the job ends. The value is in UTC.
3832	EndTime *date.Time `json:"endTime,omitempty"`
3833}
3834
3835// JobResource defines the workload-agnostic properties for a job.
3836type JobResource struct {
3837	autorest.Response `json:"-"`
3838	Properties        BasicJob `json:"properties,omitempty"`
3839	// ID - Resource ID represents the complete path to the resource.
3840	ID *string `json:"id,omitempty"`
3841	// Name - Resource name associated with the resource.
3842	Name *string `json:"name,omitempty"`
3843	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
3844	Type *string `json:"type,omitempty"`
3845	// Location - Resource location.
3846	Location *string `json:"location,omitempty"`
3847	// Tags - Resource tags.
3848	Tags map[string]*string `json:"tags"`
3849	// ETag - Optional ETag.
3850	ETag *string `json:"eTag,omitempty"`
3851}
3852
3853// MarshalJSON is the custom marshaler for JobResource.
3854func (jr JobResource) MarshalJSON() ([]byte, error) {
3855	objectMap := make(map[string]interface{})
3856	objectMap["properties"] = jr.Properties
3857	if jr.ID != nil {
3858		objectMap["id"] = jr.ID
3859	}
3860	if jr.Name != nil {
3861		objectMap["name"] = jr.Name
3862	}
3863	if jr.Type != nil {
3864		objectMap["type"] = jr.Type
3865	}
3866	if jr.Location != nil {
3867		objectMap["location"] = jr.Location
3868	}
3869	if jr.Tags != nil {
3870		objectMap["tags"] = jr.Tags
3871	}
3872	if jr.ETag != nil {
3873		objectMap["eTag"] = jr.ETag
3874	}
3875	return json.Marshal(objectMap)
3876}
3877
3878// UnmarshalJSON is the custom unmarshaler for JobResource struct.
3879func (jr *JobResource) UnmarshalJSON(body []byte) error {
3880	var m map[string]*json.RawMessage
3881	err := json.Unmarshal(body, &m)
3882	if err != nil {
3883		return err
3884	}
3885	for k, v := range m {
3886		switch k {
3887		case "properties":
3888			if v != nil {
3889				properties, err := unmarshalBasicJob(*v)
3890				if err != nil {
3891					return err
3892				}
3893				jr.Properties = properties
3894			}
3895		case "id":
3896			if v != nil {
3897				var ID string
3898				err = json.Unmarshal(*v, &ID)
3899				if err != nil {
3900					return err
3901				}
3902				jr.ID = &ID
3903			}
3904		case "name":
3905			if v != nil {
3906				var name string
3907				err = json.Unmarshal(*v, &name)
3908				if err != nil {
3909					return err
3910				}
3911				jr.Name = &name
3912			}
3913		case "type":
3914			if v != nil {
3915				var typeVar string
3916				err = json.Unmarshal(*v, &typeVar)
3917				if err != nil {
3918					return err
3919				}
3920				jr.Type = &typeVar
3921			}
3922		case "location":
3923			if v != nil {
3924				var location string
3925				err = json.Unmarshal(*v, &location)
3926				if err != nil {
3927					return err
3928				}
3929				jr.Location = &location
3930			}
3931		case "tags":
3932			if v != nil {
3933				var tags map[string]*string
3934				err = json.Unmarshal(*v, &tags)
3935				if err != nil {
3936					return err
3937				}
3938				jr.Tags = tags
3939			}
3940		case "eTag":
3941			if v != nil {
3942				var eTag string
3943				err = json.Unmarshal(*v, &eTag)
3944				if err != nil {
3945					return err
3946				}
3947				jr.ETag = &eTag
3948			}
3949		}
3950	}
3951
3952	return nil
3953}
3954
3955// JobResourceList list of Job resources.
3956type JobResourceList struct {
3957	autorest.Response `json:"-"`
3958	// Value - List of resources.
3959	Value *[]JobResource `json:"value,omitempty"`
3960	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
3961	NextLink *string `json:"nextLink,omitempty"`
3962}
3963
3964// JobResourceListIterator provides access to a complete listing of JobResource values.
3965type JobResourceListIterator struct {
3966	i    int
3967	page JobResourceListPage
3968}
3969
3970// NextWithContext advances to the next value.  If there was an error making
3971// the request the iterator does not advance and the error is returned.
3972func (iter *JobResourceListIterator) NextWithContext(ctx context.Context) (err error) {
3973	if tracing.IsEnabled() {
3974		ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListIterator.NextWithContext")
3975		defer func() {
3976			sc := -1
3977			if iter.Response().Response.Response != nil {
3978				sc = iter.Response().Response.Response.StatusCode
3979			}
3980			tracing.EndSpan(ctx, sc, err)
3981		}()
3982	}
3983	iter.i++
3984	if iter.i < len(iter.page.Values()) {
3985		return nil
3986	}
3987	err = iter.page.NextWithContext(ctx)
3988	if err != nil {
3989		iter.i--
3990		return err
3991	}
3992	iter.i = 0
3993	return nil
3994}
3995
3996// Next advances to the next value.  If there was an error making
3997// the request the iterator does not advance and the error is returned.
3998// Deprecated: Use NextWithContext() instead.
3999func (iter *JobResourceListIterator) Next() error {
4000	return iter.NextWithContext(context.Background())
4001}
4002
4003// NotDone returns true if the enumeration should be started or is not yet complete.
4004func (iter JobResourceListIterator) NotDone() bool {
4005	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4006}
4007
4008// Response returns the raw server response from the last page request.
4009func (iter JobResourceListIterator) Response() JobResourceList {
4010	return iter.page.Response()
4011}
4012
4013// Value returns the current value or a zero-initialized value if the
4014// iterator has advanced beyond the end of the collection.
4015func (iter JobResourceListIterator) Value() JobResource {
4016	if !iter.page.NotDone() {
4017		return JobResource{}
4018	}
4019	return iter.page.Values()[iter.i]
4020}
4021
4022// Creates a new instance of the JobResourceListIterator type.
4023func NewJobResourceListIterator(page JobResourceListPage) JobResourceListIterator {
4024	return JobResourceListIterator{page: page}
4025}
4026
4027// IsEmpty returns true if the ListResult contains no values.
4028func (jrl JobResourceList) IsEmpty() bool {
4029	return jrl.Value == nil || len(*jrl.Value) == 0
4030}
4031
4032// jobResourceListPreparer prepares a request to retrieve the next set of results.
4033// It returns nil if no more results exist.
4034func (jrl JobResourceList) jobResourceListPreparer(ctx context.Context) (*http.Request, error) {
4035	if jrl.NextLink == nil || len(to.String(jrl.NextLink)) < 1 {
4036		return nil, nil
4037	}
4038	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4039		autorest.AsJSON(),
4040		autorest.AsGet(),
4041		autorest.WithBaseURL(to.String(jrl.NextLink)))
4042}
4043
4044// JobResourceListPage contains a page of JobResource values.
4045type JobResourceListPage struct {
4046	fn  func(context.Context, JobResourceList) (JobResourceList, error)
4047	jrl JobResourceList
4048}
4049
4050// NextWithContext advances to the next page of values.  If there was an error making
4051// the request the page does not advance and the error is returned.
4052func (page *JobResourceListPage) NextWithContext(ctx context.Context) (err error) {
4053	if tracing.IsEnabled() {
4054		ctx = tracing.StartSpan(ctx, fqdn+"/JobResourceListPage.NextWithContext")
4055		defer func() {
4056			sc := -1
4057			if page.Response().Response.Response != nil {
4058				sc = page.Response().Response.Response.StatusCode
4059			}
4060			tracing.EndSpan(ctx, sc, err)
4061		}()
4062	}
4063	next, err := page.fn(ctx, page.jrl)
4064	if err != nil {
4065		return err
4066	}
4067	page.jrl = next
4068	return nil
4069}
4070
4071// Next advances to the next page of values.  If there was an error making
4072// the request the page does not advance and the error is returned.
4073// Deprecated: Use NextWithContext() instead.
4074func (page *JobResourceListPage) Next() error {
4075	return page.NextWithContext(context.Background())
4076}
4077
4078// NotDone returns true if the page enumeration should be started or is not yet complete.
4079func (page JobResourceListPage) NotDone() bool {
4080	return !page.jrl.IsEmpty()
4081}
4082
4083// Response returns the raw server response from the last page request.
4084func (page JobResourceListPage) Response() JobResourceList {
4085	return page.jrl
4086}
4087
4088// Values returns the slice of values for the current page or nil if there are no values.
4089func (page JobResourceListPage) Values() []JobResource {
4090	if page.jrl.IsEmpty() {
4091		return nil
4092	}
4093	return *page.jrl.Value
4094}
4095
4096// Creates a new instance of the JobResourceListPage type.
4097func NewJobResourceListPage(getNextPage func(context.Context, JobResourceList) (JobResourceList, error)) JobResourceListPage {
4098	return JobResourceListPage{fn: getNextPage}
4099}
4100
4101// KEKDetails the Key Encryption Key (KEK) is the encryption key for the Bitlocker Encryption Key (BEK).
4102type KEKDetails struct {
4103	// KeyURL - Key refers to the Key Encryption Key (KEK). The KEK is the Key to unlock the Secret.
4104	KeyURL *string `json:"keyUrl,omitempty"`
4105	// KeyVaultID - Key Vault ID identifies where the KEK is stored.
4106	KeyVaultID *string `json:"keyVaultId,omitempty"`
4107	// KeyBackupData - Key Backup Data refers to Key Encryption Key (KEK) data.
4108	KeyBackupData *string `json:"keyBackupData,omitempty"`
4109}
4110
4111// KeyAndSecretDetails BEK stands for Bitlocker Encryption Key.
4112// KEK stands for Key Encryption Key. KEK is the encryption key used to protect the Secret for the BEK
4113// If the VM is encrypted, then the service stores the following details :
4114// 1. Secret(BEK) - Url + Backup Data + vaultID.
4115// 2. Key(KEK) - Url + Backup Data + vaultID.
4116// It is possible for the BEK and KEK to have different vaultIDs.
4117type KeyAndSecretDetails struct {
4118	// KekDetails - The Key Encryption Key (KEK) is the encryption key for the Bitlocker Encryption Key (BEK).
4119	KekDetails *KEKDetails `json:"kekDetails,omitempty"`
4120	// BekDetails - BEK is Bitlocker Encryption Key.
4121	BekDetails *BEKDetails `json:"bekDetails,omitempty"`
4122}
4123
4124// LongTermRetentionPolicy long-term retention policy.
4125type LongTermRetentionPolicy struct {
4126	// DailySchedule - Daily retention schedule of the backup policy.
4127	DailySchedule *DailyRetentionSchedule `json:"dailySchedule,omitempty"`
4128	// WeeklySchedule - Weekly retention schedule of the backup policy.
4129	WeeklySchedule *WeeklyRetentionSchedule `json:"weeklySchedule,omitempty"`
4130	// MonthlySchedule - Monthly retention schedule of the backup policy.
4131	MonthlySchedule *MonthlyRetentionSchedule `json:"monthlySchedule,omitempty"`
4132	// YearlySchedule - Yearly retention schedule of the backup policy.
4133	YearlySchedule *YearlyRetentionSchedule `json:"yearlySchedule,omitempty"`
4134	// RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy'
4135	RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"`
4136}
4137
4138// MarshalJSON is the custom marshaler for LongTermRetentionPolicy.
4139func (ltrp LongTermRetentionPolicy) MarshalJSON() ([]byte, error) {
4140	ltrp.RetentionPolicyType = RetentionPolicyTypeLongTermRetentionPolicy
4141	objectMap := make(map[string]interface{})
4142	if ltrp.DailySchedule != nil {
4143		objectMap["dailySchedule"] = ltrp.DailySchedule
4144	}
4145	if ltrp.WeeklySchedule != nil {
4146		objectMap["weeklySchedule"] = ltrp.WeeklySchedule
4147	}
4148	if ltrp.MonthlySchedule != nil {
4149		objectMap["monthlySchedule"] = ltrp.MonthlySchedule
4150	}
4151	if ltrp.YearlySchedule != nil {
4152		objectMap["yearlySchedule"] = ltrp.YearlySchedule
4153	}
4154	if ltrp.RetentionPolicyType != "" {
4155		objectMap["retentionPolicyType"] = ltrp.RetentionPolicyType
4156	}
4157	return json.Marshal(objectMap)
4158}
4159
4160// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy.
4161func (ltrp LongTermRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) {
4162	return nil, false
4163}
4164
4165// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy.
4166func (ltrp LongTermRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) {
4167	return &ltrp, true
4168}
4169
4170// AsRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy.
4171func (ltrp LongTermRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) {
4172	return nil, false
4173}
4174
4175// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for LongTermRetentionPolicy.
4176func (ltrp LongTermRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) {
4177	return &ltrp, true
4178}
4179
4180// LongTermSchedulePolicy long-term policy schedule.
4181type LongTermSchedulePolicy struct {
4182	// SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy'
4183	SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"`
4184}
4185
4186// MarshalJSON is the custom marshaler for LongTermSchedulePolicy.
4187func (ltsp LongTermSchedulePolicy) MarshalJSON() ([]byte, error) {
4188	ltsp.SchedulePolicyType = SchedulePolicyTypeLongTermSchedulePolicy
4189	objectMap := make(map[string]interface{})
4190	if ltsp.SchedulePolicyType != "" {
4191		objectMap["schedulePolicyType"] = ltsp.SchedulePolicyType
4192	}
4193	return json.Marshal(objectMap)
4194}
4195
4196// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy.
4197func (ltsp LongTermSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) {
4198	return &ltsp, true
4199}
4200
4201// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy.
4202func (ltsp LongTermSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) {
4203	return nil, false
4204}
4205
4206// AsSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy.
4207func (ltsp LongTermSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) {
4208	return nil, false
4209}
4210
4211// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for LongTermSchedulePolicy.
4212func (ltsp LongTermSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) {
4213	return &ltsp, true
4214}
4215
4216// MabContainer the container associated with items backed up using Azure Backup Server.
4217type MabContainer struct {
4218	// CanReRegister - The container can be registered one more time.
4219	CanReRegister *bool `json:"canReRegister,omitempty"`
4220	// ContainerID - The ID for the container.
4221	ContainerID *int64 `json:"containerId,omitempty"`
4222	// ProtectedItemCount - The number of backup items in the container.
4223	ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"`
4224	// AgentVersion - The version of the agent used with this container.
4225	AgentVersion *string `json:"agentVersion,omitempty"`
4226	// ExtendedInfo - Additional information for the container.
4227	ExtendedInfo *MabContainerExtendedInfo `json:"extendedInfo,omitempty"`
4228	// FriendlyName - Friendly name of the container.
4229	FriendlyName *string `json:"friendlyName,omitempty"`
4230	// BackupManagementType - The backup management type for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
4231	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
4232	// RegistrationStatus - The container's registration status with the Recovery Services vault.
4233	RegistrationStatus *string `json:"registrationStatus,omitempty"`
4234	// HealthStatus - The status of the container's health.
4235	HealthStatus *string `json:"healthStatus,omitempty"`
4236	// ContainerType - READ-ONLY; The type assigned to the container. The values to use for each of these properties are:<br/> 1. Compute Azure VM is Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows machines (like Azure Backup Server and DPM) is Windows<br/> 4. Azure SQL instance is AzureSqlContainer.
4237	ContainerType *string `json:"containerType,omitempty"`
4238	// ProtectableObjectType - Possible values include: 'ProtectableObjectTypeProtectionContainer', 'ProtectableObjectTypeAzureSQLContainer', 'ProtectableObjectTypeIaaSVMContainer', 'ProtectableObjectTypeMABWindowsContainer', 'ProtectableObjectTypeMicrosoftComputevirtualMachines', 'ProtectableObjectTypeMicrosoftClassicComputevirtualMachines'
4239	ProtectableObjectType ProtectableObjectType `json:"protectableObjectType,omitempty"`
4240}
4241
4242// MarshalJSON is the custom marshaler for MabContainer.
4243func (mc MabContainer) MarshalJSON() ([]byte, error) {
4244	mc.ProtectableObjectType = ProtectableObjectTypeMABWindowsContainer
4245	objectMap := make(map[string]interface{})
4246	if mc.CanReRegister != nil {
4247		objectMap["canReRegister"] = mc.CanReRegister
4248	}
4249	if mc.ContainerID != nil {
4250		objectMap["containerId"] = mc.ContainerID
4251	}
4252	if mc.ProtectedItemCount != nil {
4253		objectMap["protectedItemCount"] = mc.ProtectedItemCount
4254	}
4255	if mc.AgentVersion != nil {
4256		objectMap["agentVersion"] = mc.AgentVersion
4257	}
4258	if mc.ExtendedInfo != nil {
4259		objectMap["extendedInfo"] = mc.ExtendedInfo
4260	}
4261	if mc.FriendlyName != nil {
4262		objectMap["friendlyName"] = mc.FriendlyName
4263	}
4264	if mc.BackupManagementType != "" {
4265		objectMap["backupManagementType"] = mc.BackupManagementType
4266	}
4267	if mc.RegistrationStatus != nil {
4268		objectMap["registrationStatus"] = mc.RegistrationStatus
4269	}
4270	if mc.HealthStatus != nil {
4271		objectMap["healthStatus"] = mc.HealthStatus
4272	}
4273	if mc.ProtectableObjectType != "" {
4274		objectMap["protectableObjectType"] = mc.ProtectableObjectType
4275	}
4276	return json.Marshal(objectMap)
4277}
4278
4279// AsAzureSQLContainer is the BasicProtectionContainer implementation for MabContainer.
4280func (mc MabContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) {
4281	return nil, false
4282}
4283
4284// AsIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer.
4285func (mc MabContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) {
4286	return nil, false
4287}
4288
4289// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for MabContainer.
4290func (mc MabContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) {
4291	return nil, false
4292}
4293
4294// AsMabContainer is the BasicProtectionContainer implementation for MabContainer.
4295func (mc MabContainer) AsMabContainer() (*MabContainer, bool) {
4296	return &mc, true
4297}
4298
4299// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for MabContainer.
4300func (mc MabContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) {
4301	return nil, false
4302}
4303
4304// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for MabContainer.
4305func (mc MabContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) {
4306	return nil, false
4307}
4308
4309// AsProtectionContainer is the BasicProtectionContainer implementation for MabContainer.
4310func (mc MabContainer) AsProtectionContainer() (*ProtectionContainer, bool) {
4311	return nil, false
4312}
4313
4314// AsBasicProtectionContainer is the BasicProtectionContainer implementation for MabContainer.
4315func (mc MabContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) {
4316	return &mc, true
4317}
4318
4319// MabContainerExtendedInfo additional information for the container.
4320type MabContainerExtendedInfo struct {
4321	// LastRefreshedAt - The time stamp when this container was refreshed.
4322	LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"`
4323	// BackupItemType - The type of backup items associated with this container. Possible values include: 'ItemTypeInvalid', 'ItemTypeVM', 'ItemTypeFileFolder', 'ItemTypeAzureSQLDb', 'ItemTypeSQLDB', 'ItemTypeExchange', 'ItemTypeSharepoint', 'ItemTypeDPMUnknown'
4324	BackupItemType ItemType `json:"backupItemType,omitempty"`
4325	// BackupItems - The list of backup items associated with this container.
4326	BackupItems *[]string `json:"backupItems,omitempty"`
4327	// PolicyName - The backup policy associated with this container.
4328	PolicyName *string `json:"policyName,omitempty"`
4329	// LastBackupStatus - The latest backup status of this container.
4330	LastBackupStatus *string `json:"lastBackupStatus,omitempty"`
4331}
4332
4333// MabErrorInfo azure Backup Server workload-specific error information.
4334type MabErrorInfo struct {
4335	// ErrorString - Localized error string.
4336	ErrorString *string `json:"errorString,omitempty"`
4337	// Recommendations - List of localized recommendations.
4338	Recommendations *[]string `json:"recommendations,omitempty"`
4339}
4340
4341// MabFileFolderProtectedItem this is a file or folder workload-specific backup item.
4342type MabFileFolderProtectedItem struct {
4343	// FriendlyName - The friendly name of this backup item.
4344	FriendlyName *string `json:"friendlyName,omitempty"`
4345	// ComputerName - The name of the computer associated with this backup item.
4346	ComputerName *string `json:"computerName,omitempty"`
4347	// LastBackupStatus - The status of last backup operation.
4348	LastBackupStatus *string `json:"lastBackupStatus,omitempty"`
4349	// ProtectionState - The states for this property are: Protected, ProtectionStopped, IRPending, or ProtectionError.
4350	ProtectionState              *string `json:"protectionState,omitempty"`
4351	IsScheduledForDeferredDelete *bool   `json:"isScheduledForDeferredDelete,omitempty"`
4352	// ExtendedInfo - Additional information for this backup item.
4353	ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"`
4354	// BackupManagementType - The backup management type associated with the backup item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
4355	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
4356	// WorkloadType - The workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'
4357	WorkloadType DataSourceType `json:"workloadType,omitempty"`
4358	// SourceResourceID - The ID of the resource to be backed up.
4359	SourceResourceID *string `json:"sourceResourceId,omitempty"`
4360	// PolicyID - The ID of the backup policy associated with this backup item.
4361	PolicyID *string `json:"policyId,omitempty"`
4362	// LastRecoveryPoint - The timestamp when the most recent backup copy was created for this backup item.
4363	LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"`
4364	// ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines'
4365	ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"`
4366}
4367
4368// MarshalJSON is the custom marshaler for MabFileFolderProtectedItem.
4369func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) {
4370	mffpi.ProtectedItemType = ProtectedItemTypeMabFileFolderProtectedItem
4371	objectMap := make(map[string]interface{})
4372	if mffpi.FriendlyName != nil {
4373		objectMap["friendlyName"] = mffpi.FriendlyName
4374	}
4375	if mffpi.ComputerName != nil {
4376		objectMap["computerName"] = mffpi.ComputerName
4377	}
4378	if mffpi.LastBackupStatus != nil {
4379		objectMap["lastBackupStatus"] = mffpi.LastBackupStatus
4380	}
4381	if mffpi.ProtectionState != nil {
4382		objectMap["protectionState"] = mffpi.ProtectionState
4383	}
4384	if mffpi.IsScheduledForDeferredDelete != nil {
4385		objectMap["isScheduledForDeferredDelete"] = mffpi.IsScheduledForDeferredDelete
4386	}
4387	if mffpi.ExtendedInfo != nil {
4388		objectMap["extendedInfo"] = mffpi.ExtendedInfo
4389	}
4390	if mffpi.BackupManagementType != "" {
4391		objectMap["backupManagementType"] = mffpi.BackupManagementType
4392	}
4393	if mffpi.WorkloadType != "" {
4394		objectMap["workloadType"] = mffpi.WorkloadType
4395	}
4396	if mffpi.SourceResourceID != nil {
4397		objectMap["sourceResourceId"] = mffpi.SourceResourceID
4398	}
4399	if mffpi.PolicyID != nil {
4400		objectMap["policyId"] = mffpi.PolicyID
4401	}
4402	if mffpi.LastRecoveryPoint != nil {
4403		objectMap["lastRecoveryPoint"] = mffpi.LastRecoveryPoint
4404	}
4405	if mffpi.ProtectedItemType != "" {
4406		objectMap["protectedItemType"] = mffpi.ProtectedItemType
4407	}
4408	return json.Marshal(objectMap)
4409}
4410
4411// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4412func (mffpi MabFileFolderProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) {
4413	return nil, false
4414}
4415
4416// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4417func (mffpi MabFileFolderProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) {
4418	return nil, false
4419}
4420
4421// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4422func (mffpi MabFileFolderProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) {
4423	return &mffpi, true
4424}
4425
4426// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4427func (mffpi MabFileFolderProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) {
4428	return nil, false
4429}
4430
4431// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4432func (mffpi MabFileFolderProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) {
4433	return nil, false
4434}
4435
4436// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4437func (mffpi MabFileFolderProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) {
4438	return nil, false
4439}
4440
4441// AsProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4442func (mffpi MabFileFolderProtectedItem) AsProtectedItem() (*ProtectedItem, bool) {
4443	return nil, false
4444}
4445
4446// AsBasicProtectedItem is the BasicProtectedItem implementation for MabFileFolderProtectedItem.
4447func (mffpi MabFileFolderProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) {
4448	return &mffpi, true
4449}
4450
4451// MabFileFolderProtectedItemExtendedInfo additional information for the backup item.
4452type MabFileFolderProtectedItemExtendedInfo struct {
4453	// LastRefreshedAt - The last day and time the agent synced with the service.
4454	LastRefreshedAt *date.Time `json:"lastRefreshedAt,omitempty"`
4455	// OldestRecoveryPoint - The oldest backup copy available.
4456	OldestRecoveryPoint *date.Time `json:"oldestRecoveryPoint,omitempty"`
4457	// RecoveryPointCount - The number of backup copies associated with the backup item.
4458	RecoveryPointCount *int32 `json:"recoveryPointCount,omitempty"`
4459}
4460
4461// MabJob the Azure Backup Server workload-specific job.
4462type MabJob struct {
4463	// Duration - The time required for the job to run.
4464	Duration *string `json:"duration,omitempty"`
4465	// ActionsInfo - The state or actions applicable on jobs such as Cancel or Retry.
4466	ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"`
4467	// MabServerName - The name of server protecting the data store.
4468	MabServerName *string `json:"mabServerName,omitempty"`
4469	// MabServerType - Server type of the Azure Backup Server container. Possible values include: 'MabServerTypeInvalid', 'MabServerTypeUnknown', 'MabServerTypeIaasVMContainer', 'MabServerTypeIaasVMServiceContainer', 'MabServerTypeDPMContainer', 'MabServerTypeDPMVenusContainer', 'MabServerTypeMABContainer', 'MabServerTypeClusterResource', 'MabServerTypeAzureSQLContainer', 'MabServerTypeWindowsServer', 'MabServerTypeWindows'
4470	MabServerType MabServerType `json:"mabServerType,omitempty"`
4471	// WorkloadType - Workload type of backup item. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeDPMUnknown'
4472	WorkloadType WorkloadType `json:"workloadType,omitempty"`
4473	// ErrorDetails - The errors.
4474	ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"`
4475	// ExtendedInfo - Additional information on the job.
4476	ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"`
4477	// EntityFriendlyName - The friendly name of the entity on which the current job is executing.
4478	EntityFriendlyName *string `json:"entityFriendlyName,omitempty"`
4479	// BackupManagementType - The backup management type for the current job. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
4480	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
4481	// Operation - The operation name.
4482	Operation *string `json:"operation,omitempty"`
4483	// Status - The job status.
4484	Status *string `json:"status,omitempty"`
4485	// StartTime - The start time.
4486	StartTime *date.Time `json:"startTime,omitempty"`
4487	// EndTime - The end time.
4488	EndTime *date.Time `json:"endTime,omitempty"`
4489	// ActivityID - ActivityId of job.
4490	ActivityID *string `json:"activityId,omitempty"`
4491	// JobType - Possible values include: 'JobTypeJob', 'JobTypeAzureIaaSVMJob', 'JobTypeDpmJob', 'JobTypeMabJob'
4492	JobType JobType `json:"jobType,omitempty"`
4493}
4494
4495// MarshalJSON is the custom marshaler for MabJob.
4496func (mj MabJob) MarshalJSON() ([]byte, error) {
4497	mj.JobType = JobTypeMabJob
4498	objectMap := make(map[string]interface{})
4499	if mj.Duration != nil {
4500		objectMap["duration"] = mj.Duration
4501	}
4502	if mj.ActionsInfo != nil {
4503		objectMap["actionsInfo"] = mj.ActionsInfo
4504	}
4505	if mj.MabServerName != nil {
4506		objectMap["mabServerName"] = mj.MabServerName
4507	}
4508	if mj.MabServerType != "" {
4509		objectMap["mabServerType"] = mj.MabServerType
4510	}
4511	if mj.WorkloadType != "" {
4512		objectMap["workloadType"] = mj.WorkloadType
4513	}
4514	if mj.ErrorDetails != nil {
4515		objectMap["errorDetails"] = mj.ErrorDetails
4516	}
4517	if mj.ExtendedInfo != nil {
4518		objectMap["extendedInfo"] = mj.ExtendedInfo
4519	}
4520	if mj.EntityFriendlyName != nil {
4521		objectMap["entityFriendlyName"] = mj.EntityFriendlyName
4522	}
4523	if mj.BackupManagementType != "" {
4524		objectMap["backupManagementType"] = mj.BackupManagementType
4525	}
4526	if mj.Operation != nil {
4527		objectMap["operation"] = mj.Operation
4528	}
4529	if mj.Status != nil {
4530		objectMap["status"] = mj.Status
4531	}
4532	if mj.StartTime != nil {
4533		objectMap["startTime"] = mj.StartTime
4534	}
4535	if mj.EndTime != nil {
4536		objectMap["endTime"] = mj.EndTime
4537	}
4538	if mj.ActivityID != nil {
4539		objectMap["activityId"] = mj.ActivityID
4540	}
4541	if mj.JobType != "" {
4542		objectMap["jobType"] = mj.JobType
4543	}
4544	return json.Marshal(objectMap)
4545}
4546
4547// AsAzureIaaSVMJob is the BasicJob implementation for MabJob.
4548func (mj MabJob) AsAzureIaaSVMJob() (*AzureIaaSVMJob, bool) {
4549	return nil, false
4550}
4551
4552// AsDpmJob is the BasicJob implementation for MabJob.
4553func (mj MabJob) AsDpmJob() (*DpmJob, bool) {
4554	return nil, false
4555}
4556
4557// AsMabJob is the BasicJob implementation for MabJob.
4558func (mj MabJob) AsMabJob() (*MabJob, bool) {
4559	return &mj, true
4560}
4561
4562// AsJob is the BasicJob implementation for MabJob.
4563func (mj MabJob) AsJob() (*Job, bool) {
4564	return nil, false
4565}
4566
4567// AsBasicJob is the BasicJob implementation for MabJob.
4568func (mj MabJob) AsBasicJob() (BasicJob, bool) {
4569	return &mj, true
4570}
4571
4572// MabJobExtendedInfo additional information for the Azure Backup Server workload-specific job.
4573type MabJobExtendedInfo struct {
4574	// TasksList - List of tasks for this job.
4575	TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"`
4576	// PropertyBag - The job properties.
4577	PropertyBag map[string]*string `json:"propertyBag"`
4578	// DynamicErrorMessage - Non-localized error message specific to this job.
4579	DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"`
4580}
4581
4582// MarshalJSON is the custom marshaler for MabJobExtendedInfo.
4583func (mjei MabJobExtendedInfo) MarshalJSON() ([]byte, error) {
4584	objectMap := make(map[string]interface{})
4585	if mjei.TasksList != nil {
4586		objectMap["tasksList"] = mjei.TasksList
4587	}
4588	if mjei.PropertyBag != nil {
4589		objectMap["propertyBag"] = mjei.PropertyBag
4590	}
4591	if mjei.DynamicErrorMessage != nil {
4592		objectMap["dynamicErrorMessage"] = mjei.DynamicErrorMessage
4593	}
4594	return json.Marshal(objectMap)
4595}
4596
4597// MabJobTaskDetails azure Backup Server workload-specific job task details.
4598type MabJobTaskDetails struct {
4599	// TaskID - The task display name.
4600	TaskID *string `json:"taskId,omitempty"`
4601	// StartTime - The start time.
4602	StartTime *date.Time `json:"startTime,omitempty"`
4603	// EndTime - The end time.
4604	EndTime *date.Time `json:"endTime,omitempty"`
4605	// Duration - Time elapsed for task.
4606	Duration *string `json:"duration,omitempty"`
4607	// Status - The status.
4608	Status *string `json:"status,omitempty"`
4609}
4610
4611// MabProtectionPolicy the backup policy for the file or folder container.
4612type MabProtectionPolicy struct {
4613	// SchedulePolicy - The schedule specified in the backup policy.
4614	SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"`
4615	// RetentionPolicy - The details specified in the Retention policy.
4616	RetentionPolicy BasicRetentionPolicy `json:"retentionPolicy,omitempty"`
4617	// ProtectedItemsCount - The number of items associated with this policy.
4618	ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"`
4619	// BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeMAB', 'BackupManagementTypeAzureSQL'
4620	BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"`
4621}
4622
4623// MarshalJSON is the custom marshaler for MabProtectionPolicy.
4624func (mpp MabProtectionPolicy) MarshalJSON() ([]byte, error) {
4625	mpp.BackupManagementType = BackupManagementTypeMAB
4626	objectMap := make(map[string]interface{})
4627	objectMap["schedulePolicy"] = mpp.SchedulePolicy
4628	objectMap["retentionPolicy"] = mpp.RetentionPolicy
4629	if mpp.ProtectedItemsCount != nil {
4630		objectMap["protectedItemsCount"] = mpp.ProtectedItemsCount
4631	}
4632	if mpp.BackupManagementType != "" {
4633		objectMap["backupManagementType"] = mpp.BackupManagementType
4634	}
4635	return json.Marshal(objectMap)
4636}
4637
4638// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy.
4639func (mpp MabProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) {
4640	return nil, false
4641}
4642
4643// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy.
4644func (mpp MabProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) {
4645	return &mpp, true
4646}
4647
4648// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy.
4649func (mpp MabProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) {
4650	return nil, false
4651}
4652
4653// AsProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy.
4654func (mpp MabProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) {
4655	return nil, false
4656}
4657
4658// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for MabProtectionPolicy.
4659func (mpp MabProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) {
4660	return &mpp, true
4661}
4662
4663// UnmarshalJSON is the custom unmarshaler for MabProtectionPolicy struct.
4664func (mpp *MabProtectionPolicy) UnmarshalJSON(body []byte) error {
4665	var m map[string]*json.RawMessage
4666	err := json.Unmarshal(body, &m)
4667	if err != nil {
4668		return err
4669	}
4670	for k, v := range m {
4671		switch k {
4672		case "schedulePolicy":
4673			if v != nil {
4674				schedulePolicy, err := unmarshalBasicSchedulePolicy(*v)
4675				if err != nil {
4676					return err
4677				}
4678				mpp.SchedulePolicy = schedulePolicy
4679			}
4680		case "retentionPolicy":
4681			if v != nil {
4682				retentionPolicy, err := unmarshalBasicRetentionPolicy(*v)
4683				if err != nil {
4684					return err
4685				}
4686				mpp.RetentionPolicy = retentionPolicy
4687			}
4688		case "protectedItemsCount":
4689			if v != nil {
4690				var protectedItemsCount int32
4691				err = json.Unmarshal(*v, &protectedItemsCount)
4692				if err != nil {
4693					return err
4694				}
4695				mpp.ProtectedItemsCount = &protectedItemsCount
4696			}
4697		case "backupManagementType":
4698			if v != nil {
4699				var backupManagementType ManagementTypeBasicProtectionPolicy
4700				err = json.Unmarshal(*v, &backupManagementType)
4701				if err != nil {
4702					return err
4703				}
4704				mpp.BackupManagementType = backupManagementType
4705			}
4706		}
4707	}
4708
4709	return nil
4710}
4711
4712// MonthlyRetentionSchedule the monthly retention schedule.
4713type MonthlyRetentionSchedule struct {
4714	// RetentionScheduleFormatType - Retention schedule format type for monthly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly'
4715	RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"`
4716	// RetentionScheduleDaily - Daily retention format for the monthly retention policy.
4717	RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"`
4718	// RetentionScheduleWeekly - Weekly retention format for the monthly retention policy.
4719	RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"`
4720	// RetentionTimes - Retention times of the retention policy.
4721	RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"`
4722	// RetentionDuration - Retention duration of the retention policy.
4723	RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"`
4724}
4725
4726// OperationResultInfo information about the result of the operation.
4727type OperationResultInfo struct {
4728	// JobList - List of jobs created by this operation.
4729	JobList *[]string `json:"jobList,omitempty"`
4730	// ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeOperationResultInfo', 'ObjectTypeExportJobsOperationResultInfo'
4731	ObjectType ObjectTypeBasicOperationResultInfoBase `json:"objectType,omitempty"`
4732}
4733
4734// MarshalJSON is the custom marshaler for OperationResultInfo.
4735func (ori OperationResultInfo) MarshalJSON() ([]byte, error) {
4736	ori.ObjectType = ObjectTypeOperationResultInfo
4737	objectMap := make(map[string]interface{})
4738	if ori.JobList != nil {
4739		objectMap["jobList"] = ori.JobList
4740	}
4741	if ori.ObjectType != "" {
4742		objectMap["objectType"] = ori.ObjectType
4743	}
4744	return json.Marshal(objectMap)
4745}
4746
4747// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo.
4748func (ori OperationResultInfo) AsOperationResultInfo() (*OperationResultInfo, bool) {
4749	return &ori, true
4750}
4751
4752// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfo.
4753func (ori OperationResultInfo) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) {
4754	return nil, false
4755}
4756
4757// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo.
4758func (ori OperationResultInfo) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) {
4759	return nil, false
4760}
4761
4762// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfo.
4763func (ori OperationResultInfo) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) {
4764	return &ori, true
4765}
4766
4767// BasicOperationResultInfoBase the base class for operation result information.
4768type BasicOperationResultInfoBase interface {
4769	AsOperationResultInfo() (*OperationResultInfo, bool)
4770	AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool)
4771	AsOperationResultInfoBase() (*OperationResultInfoBase, bool)
4772}
4773
4774// OperationResultInfoBase the base class for operation result information.
4775type OperationResultInfoBase struct {
4776	// ObjectType - Possible values include: 'ObjectTypeOperationResultInfoBase', 'ObjectTypeOperationResultInfo', 'ObjectTypeExportJobsOperationResultInfo'
4777	ObjectType ObjectTypeBasicOperationResultInfoBase `json:"objectType,omitempty"`
4778}
4779
4780func unmarshalBasicOperationResultInfoBase(body []byte) (BasicOperationResultInfoBase, error) {
4781	var m map[string]interface{}
4782	err := json.Unmarshal(body, &m)
4783	if err != nil {
4784		return nil, err
4785	}
4786
4787	switch m["objectType"] {
4788	case string(ObjectTypeOperationResultInfo):
4789		var ori OperationResultInfo
4790		err := json.Unmarshal(body, &ori)
4791		return ori, err
4792	case string(ObjectTypeExportJobsOperationResultInfo):
4793		var ejori ExportJobsOperationResultInfo
4794		err := json.Unmarshal(body, &ejori)
4795		return ejori, err
4796	default:
4797		var orib OperationResultInfoBase
4798		err := json.Unmarshal(body, &orib)
4799		return orib, err
4800	}
4801}
4802func unmarshalBasicOperationResultInfoBaseArray(body []byte) ([]BasicOperationResultInfoBase, error) {
4803	var rawMessages []*json.RawMessage
4804	err := json.Unmarshal(body, &rawMessages)
4805	if err != nil {
4806		return nil, err
4807	}
4808
4809	oribArray := make([]BasicOperationResultInfoBase, len(rawMessages))
4810
4811	for index, rawMessage := range rawMessages {
4812		orib, err := unmarshalBasicOperationResultInfoBase(*rawMessage)
4813		if err != nil {
4814			return nil, err
4815		}
4816		oribArray[index] = orib
4817	}
4818	return oribArray, nil
4819}
4820
4821// MarshalJSON is the custom marshaler for OperationResultInfoBase.
4822func (orib OperationResultInfoBase) MarshalJSON() ([]byte, error) {
4823	orib.ObjectType = ObjectTypeOperationResultInfoBase
4824	objectMap := make(map[string]interface{})
4825	if orib.ObjectType != "" {
4826		objectMap["objectType"] = orib.ObjectType
4827	}
4828	return json.Marshal(objectMap)
4829}
4830
4831// AsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase.
4832func (orib OperationResultInfoBase) AsOperationResultInfo() (*OperationResultInfo, bool) {
4833	return nil, false
4834}
4835
4836// AsExportJobsOperationResultInfo is the BasicOperationResultInfoBase implementation for OperationResultInfoBase.
4837func (orib OperationResultInfoBase) AsExportJobsOperationResultInfo() (*ExportJobsOperationResultInfo, bool) {
4838	return nil, false
4839}
4840
4841// AsOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase.
4842func (orib OperationResultInfoBase) AsOperationResultInfoBase() (*OperationResultInfoBase, bool) {
4843	return &orib, true
4844}
4845
4846// AsBasicOperationResultInfoBase is the BasicOperationResultInfoBase implementation for OperationResultInfoBase.
4847func (orib OperationResultInfoBase) AsBasicOperationResultInfoBase() (BasicOperationResultInfoBase, bool) {
4848	return &orib, true
4849}
4850
4851// OperationResultInfoBaseResource base class for operation result information.
4852type OperationResultInfoBaseResource struct {
4853	autorest.Response `json:"-"`
4854	Properties        BasicOperationResultInfoBase `json:"properties,omitempty"`
4855	// StatusCode - The HTTP status code of the operation. Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported'
4856	StatusCode HTTPStatusCode `json:"statusCode,omitempty"`
4857	// Headers - The HTTP headers associated with this operation.
4858	Headers map[string][]string `json:"Headers"`
4859}
4860
4861// MarshalJSON is the custom marshaler for OperationResultInfoBaseResource.
4862func (oribr OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) {
4863	objectMap := make(map[string]interface{})
4864	objectMap["properties"] = oribr.Properties
4865	if oribr.StatusCode != "" {
4866		objectMap["statusCode"] = oribr.StatusCode
4867	}
4868	if oribr.Headers != nil {
4869		objectMap["Headers"] = oribr.Headers
4870	}
4871	return json.Marshal(objectMap)
4872}
4873
4874// UnmarshalJSON is the custom unmarshaler for OperationResultInfoBaseResource struct.
4875func (oribr *OperationResultInfoBaseResource) UnmarshalJSON(body []byte) error {
4876	var m map[string]*json.RawMessage
4877	err := json.Unmarshal(body, &m)
4878	if err != nil {
4879		return err
4880	}
4881	for k, v := range m {
4882		switch k {
4883		case "properties":
4884			if v != nil {
4885				properties, err := unmarshalBasicOperationResultInfoBase(*v)
4886				if err != nil {
4887					return err
4888				}
4889				oribr.Properties = properties
4890			}
4891		case "statusCode":
4892			if v != nil {
4893				var statusCode HTTPStatusCode
4894				err = json.Unmarshal(*v, &statusCode)
4895				if err != nil {
4896					return err
4897				}
4898				oribr.StatusCode = statusCode
4899			}
4900		case "Headers":
4901			if v != nil {
4902				var headers map[string][]string
4903				err = json.Unmarshal(*v, &headers)
4904				if err != nil {
4905					return err
4906				}
4907				oribr.Headers = headers
4908			}
4909		}
4910	}
4911
4912	return nil
4913}
4914
4915// OperationStatus operation status.
4916type OperationStatus struct {
4917	autorest.Response `json:"-"`
4918	// ID - ID of the operation.
4919	ID *string `json:"id,omitempty"`
4920	// Name - Name of the operation.
4921	Name *string `json:"name,omitempty"`
4922	// Status - Operation status. Possible values include: 'OperationStatusValuesInvalid', 'OperationStatusValuesInProgress', 'OperationStatusValuesSucceeded', 'OperationStatusValuesFailed', 'OperationStatusValuesCanceled'
4923	Status OperationStatusValues `json:"status,omitempty"`
4924	// StartTime - The operation start time. The format of the time is ISO-8601.
4925	StartTime *date.Time `json:"startTime,omitempty"`
4926	// EndTime - The operation end time. The format of the time is ISO-8601.
4927	EndTime *date.Time `json:"endTime,omitempty"`
4928	// Error - Error information related to this operation.
4929	Error *OperationStatusError `json:"error,omitempty"`
4930	// Properties - Additional information associated with this operation.
4931	Properties BasicOperationStatusExtendedInfo `json:"properties,omitempty"`
4932}
4933
4934// UnmarshalJSON is the custom unmarshaler for OperationStatus struct.
4935func (osVar *OperationStatus) UnmarshalJSON(body []byte) error {
4936	var m map[string]*json.RawMessage
4937	err := json.Unmarshal(body, &m)
4938	if err != nil {
4939		return err
4940	}
4941	for k, v := range m {
4942		switch k {
4943		case "id":
4944			if v != nil {
4945				var ID string
4946				err = json.Unmarshal(*v, &ID)
4947				if err != nil {
4948					return err
4949				}
4950				osVar.ID = &ID
4951			}
4952		case "name":
4953			if v != nil {
4954				var name string
4955				err = json.Unmarshal(*v, &name)
4956				if err != nil {
4957					return err
4958				}
4959				osVar.Name = &name
4960			}
4961		case "status":
4962			if v != nil {
4963				var status OperationStatusValues
4964				err = json.Unmarshal(*v, &status)
4965				if err != nil {
4966					return err
4967				}
4968				osVar.Status = status
4969			}
4970		case "startTime":
4971			if v != nil {
4972				var startTime date.Time
4973				err = json.Unmarshal(*v, &startTime)
4974				if err != nil {
4975					return err
4976				}
4977				osVar.StartTime = &startTime
4978			}
4979		case "endTime":
4980			if v != nil {
4981				var endTime date.Time
4982				err = json.Unmarshal(*v, &endTime)
4983				if err != nil {
4984					return err
4985				}
4986				osVar.EndTime = &endTime
4987			}
4988		case "error":
4989			if v != nil {
4990				var errorVar OperationStatusError
4991				err = json.Unmarshal(*v, &errorVar)
4992				if err != nil {
4993					return err
4994				}
4995				osVar.Error = &errorVar
4996			}
4997		case "properties":
4998			if v != nil {
4999				properties, err := unmarshalBasicOperationStatusExtendedInfo(*v)
5000				if err != nil {
5001					return err
5002				}
5003				osVar.Properties = properties
5004			}
5005		}
5006	}
5007
5008	return nil
5009}
5010
5011// OperationStatusError error information associated with the operation status call.
5012type OperationStatusError struct {
5013	// Code - The error code for the failed operation.
5014	Code *string `json:"code,omitempty"`
5015	// Message - The error message for the failed operation.
5016	Message *string `json:"message,omitempty"`
5017}
5018
5019// BasicOperationStatusExtendedInfo the base class for additional information about the operation status.
5020type BasicOperationStatusExtendedInfo interface {
5021	AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool)
5022	AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool)
5023	AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool)
5024	AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool)
5025}
5026
5027// OperationStatusExtendedInfo the base class for additional information about the operation status.
5028type OperationStatusExtendedInfo struct {
5029	// ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo'
5030	ObjectType ObjectType `json:"objectType,omitempty"`
5031}
5032
5033func unmarshalBasicOperationStatusExtendedInfo(body []byte) (BasicOperationStatusExtendedInfo, error) {
5034	var m map[string]interface{}
5035	err := json.Unmarshal(body, &m)
5036	if err != nil {
5037		return nil, err
5038	}
5039
5040	switch m["objectType"] {
5041	case string(ObjectTypeOperationStatusJobExtendedInfo):
5042		var osjei OperationStatusJobExtendedInfo
5043		err := json.Unmarshal(body, &osjei)
5044		return osjei, err
5045	case string(ObjectTypeOperationStatusProvisionILRExtendedInfo):
5046		var ospiei OperationStatusProvisionILRExtendedInfo
5047		err := json.Unmarshal(body, &ospiei)
5048		return ospiei, err
5049	case string(ObjectTypeOperationStatusJobsExtendedInfo):
5050		var osjei OperationStatusJobsExtendedInfo
5051		err := json.Unmarshal(body, &osjei)
5052		return osjei, err
5053	default:
5054		var osei OperationStatusExtendedInfo
5055		err := json.Unmarshal(body, &osei)
5056		return osei, err
5057	}
5058}
5059func unmarshalBasicOperationStatusExtendedInfoArray(body []byte) ([]BasicOperationStatusExtendedInfo, error) {
5060	var rawMessages []*json.RawMessage
5061	err := json.Unmarshal(body, &rawMessages)
5062	if err != nil {
5063		return nil, err
5064	}
5065
5066	oseiArray := make([]BasicOperationStatusExtendedInfo, len(rawMessages))
5067
5068	for index, rawMessage := range rawMessages {
5069		osei, err := unmarshalBasicOperationStatusExtendedInfo(*rawMessage)
5070		if err != nil {
5071			return nil, err
5072		}
5073		oseiArray[index] = osei
5074	}
5075	return oseiArray, nil
5076}
5077
5078// MarshalJSON is the custom marshaler for OperationStatusExtendedInfo.
5079func (osei OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) {
5080	osei.ObjectType = ObjectTypeOperationStatusExtendedInfo
5081	objectMap := make(map[string]interface{})
5082	if osei.ObjectType != "" {
5083		objectMap["objectType"] = osei.ObjectType
5084	}
5085	return json.Marshal(objectMap)
5086}
5087
5088// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo.
5089func (osei OperationStatusExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) {
5090	return nil, false
5091}
5092
5093// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo.
5094func (osei OperationStatusExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) {
5095	return nil, false
5096}
5097
5098// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo.
5099func (osei OperationStatusExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) {
5100	return nil, false
5101}
5102
5103// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo.
5104func (osei OperationStatusExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) {
5105	return &osei, true
5106}
5107
5108// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusExtendedInfo.
5109func (osei OperationStatusExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) {
5110	return &osei, true
5111}
5112
5113// OperationStatusJobExtendedInfo extended information about the operation status job.
5114type OperationStatusJobExtendedInfo struct {
5115	// JobID - ID of the job created for this backup item.
5116	JobID *string `json:"jobId,omitempty"`
5117	// ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo'
5118	ObjectType ObjectType `json:"objectType,omitempty"`
5119}
5120
5121// MarshalJSON is the custom marshaler for OperationStatusJobExtendedInfo.
5122func (osjei OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) {
5123	osjei.ObjectType = ObjectTypeOperationStatusJobExtendedInfo
5124	objectMap := make(map[string]interface{})
5125	if osjei.JobID != nil {
5126		objectMap["jobId"] = osjei.JobID
5127	}
5128	if osjei.ObjectType != "" {
5129		objectMap["objectType"] = osjei.ObjectType
5130	}
5131	return json.Marshal(objectMap)
5132}
5133
5134// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo.
5135func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) {
5136	return &osjei, true
5137}
5138
5139// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo.
5140func (osjei OperationStatusJobExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) {
5141	return nil, false
5142}
5143
5144// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo.
5145func (osjei OperationStatusJobExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) {
5146	return nil, false
5147}
5148
5149// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo.
5150func (osjei OperationStatusJobExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) {
5151	return nil, false
5152}
5153
5154// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobExtendedInfo.
5155func (osjei OperationStatusJobExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) {
5156	return &osjei, true
5157}
5158
5159// OperationStatusJobsExtendedInfo operation status extended info for the job list.
5160type OperationStatusJobsExtendedInfo struct {
5161	// JobIds - IDs of the jobs created for the backup item.
5162	JobIds *[]string `json:"jobIds,omitempty"`
5163	// FailedJobsError - Stores all the failed jobs along with the corresponding error codes.
5164	FailedJobsError map[string]*string `json:"failedJobsError"`
5165	// ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo'
5166	ObjectType ObjectType `json:"objectType,omitempty"`
5167}
5168
5169// MarshalJSON is the custom marshaler for OperationStatusJobsExtendedInfo.
5170func (osjei OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) {
5171	osjei.ObjectType = ObjectTypeOperationStatusJobsExtendedInfo
5172	objectMap := make(map[string]interface{})
5173	if osjei.JobIds != nil {
5174		objectMap["jobIds"] = osjei.JobIds
5175	}
5176	if osjei.FailedJobsError != nil {
5177		objectMap["failedJobsError"] = osjei.FailedJobsError
5178	}
5179	if osjei.ObjectType != "" {
5180		objectMap["objectType"] = osjei.ObjectType
5181	}
5182	return json.Marshal(objectMap)
5183}
5184
5185// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo.
5186func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) {
5187	return nil, false
5188}
5189
5190// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo.
5191func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) {
5192	return nil, false
5193}
5194
5195// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo.
5196func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) {
5197	return &osjei, true
5198}
5199
5200// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo.
5201func (osjei OperationStatusJobsExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) {
5202	return nil, false
5203}
5204
5205// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusJobsExtendedInfo.
5206func (osjei OperationStatusJobsExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) {
5207	return &osjei, true
5208}
5209
5210// OperationStatusProvisionILRExtendedInfo extended information about the Item Level Recovery (ILR)
5211// provision action, operation status.
5212type OperationStatusProvisionILRExtendedInfo struct {
5213	// RecoveryTarget - Target details for the file or folder restore.
5214	RecoveryTarget *InstantItemRecoveryTarget `json:"recoveryTarget,omitempty"`
5215	// ObjectType - Possible values include: 'ObjectTypeOperationStatusExtendedInfo', 'ObjectTypeOperationStatusJobExtendedInfo', 'ObjectTypeOperationStatusProvisionILRExtendedInfo', 'ObjectTypeOperationStatusJobsExtendedInfo'
5216	ObjectType ObjectType `json:"objectType,omitempty"`
5217}
5218
5219// MarshalJSON is the custom marshaler for OperationStatusProvisionILRExtendedInfo.
5220func (ospiei OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) {
5221	ospiei.ObjectType = ObjectTypeOperationStatusProvisionILRExtendedInfo
5222	objectMap := make(map[string]interface{})
5223	if ospiei.RecoveryTarget != nil {
5224		objectMap["recoveryTarget"] = ospiei.RecoveryTarget
5225	}
5226	if ospiei.ObjectType != "" {
5227		objectMap["objectType"] = ospiei.ObjectType
5228	}
5229	return json.Marshal(objectMap)
5230}
5231
5232// AsOperationStatusJobExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo.
5233func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobExtendedInfo() (*OperationStatusJobExtendedInfo, bool) {
5234	return nil, false
5235}
5236
5237// AsOperationStatusProvisionILRExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo.
5238func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusProvisionILRExtendedInfo() (*OperationStatusProvisionILRExtendedInfo, bool) {
5239	return &ospiei, true
5240}
5241
5242// AsOperationStatusJobsExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo.
5243func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusJobsExtendedInfo() (*OperationStatusJobsExtendedInfo, bool) {
5244	return nil, false
5245}
5246
5247// AsOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo.
5248func (ospiei OperationStatusProvisionILRExtendedInfo) AsOperationStatusExtendedInfo() (*OperationStatusExtendedInfo, bool) {
5249	return nil, false
5250}
5251
5252// AsBasicOperationStatusExtendedInfo is the BasicOperationStatusExtendedInfo implementation for OperationStatusProvisionILRExtendedInfo.
5253func (ospiei OperationStatusProvisionILRExtendedInfo) AsBasicOperationStatusExtendedInfo() (BasicOperationStatusExtendedInfo, bool) {
5254	return &ospiei, true
5255}
5256
5257// OperationWorkerResponse the base class for operation result responses.
5258type OperationWorkerResponse struct {
5259	// StatusCode - The HTTP status code of the operation. Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported'
5260	StatusCode HTTPStatusCode `json:"statusCode,omitempty"`
5261	// Headers - The HTTP headers associated with this operation.
5262	Headers map[string][]string `json:"Headers"`
5263}
5264
5265// MarshalJSON is the custom marshaler for OperationWorkerResponse.
5266func (owr OperationWorkerResponse) MarshalJSON() ([]byte, error) {
5267	objectMap := make(map[string]interface{})
5268	if owr.StatusCode != "" {
5269		objectMap["statusCode"] = owr.StatusCode
5270	}
5271	if owr.Headers != nil {
5272		objectMap["Headers"] = owr.Headers
5273	}
5274	return json.Marshal(objectMap)
5275}
5276
5277// BasicProtectedItem the base class for backup items.
5278type BasicProtectedItem interface {
5279	AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool)
5280	AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool)
5281	AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool)
5282	AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool)
5283	AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool)
5284	AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool)
5285	AsProtectedItem() (*ProtectedItem, bool)
5286}
5287
5288// ProtectedItem the base class for backup items.
5289type ProtectedItem struct {
5290	// BackupManagementType - The backup management type associated with the backup item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
5291	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
5292	// WorkloadType - The workload type for this item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'
5293	WorkloadType DataSourceType `json:"workloadType,omitempty"`
5294	// SourceResourceID - The ID of the resource to be backed up.
5295	SourceResourceID *string `json:"sourceResourceId,omitempty"`
5296	// PolicyID - The ID of the backup policy associated with this backup item.
5297	PolicyID *string `json:"policyId,omitempty"`
5298	// LastRecoveryPoint - The timestamp when the most recent backup copy was created for this backup item.
5299	LastRecoveryPoint *date.Time `json:"lastRecoveryPoint,omitempty"`
5300	// ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines'
5301	ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"`
5302}
5303
5304func unmarshalBasicProtectedItem(body []byte) (BasicProtectedItem, error) {
5305	var m map[string]interface{}
5306	err := json.Unmarshal(body, &m)
5307	if err != nil {
5308		return nil, err
5309	}
5310
5311	switch m["protectedItemType"] {
5312	case string(ProtectedItemTypeAzureIaaSVMProtectedItem):
5313		var aispi AzureIaaSVMProtectedItem
5314		err := json.Unmarshal(body, &aispi)
5315		return aispi, err
5316	case string(ProtectedItemTypeMabFileFolderProtectedItem):
5317		var mffpi MabFileFolderProtectedItem
5318		err := json.Unmarshal(body, &mffpi)
5319		return mffpi, err
5320	case string(ProtectedItemTypeMicrosoftSqlserversdatabases):
5321		var aspi AzureSQLProtectedItem
5322		err := json.Unmarshal(body, &aspi)
5323		return aspi, err
5324	case string(ProtectedItemTypeMicrosoftComputevirtualMachines):
5325		var aiscvpi AzureIaaSComputeVMProtectedItem
5326		err := json.Unmarshal(body, &aiscvpi)
5327		return aiscvpi, err
5328	case string(ProtectedItemTypeMicrosoftClassicComputevirtualMachines):
5329		var aisccvpi AzureIaaSClassicComputeVMProtectedItem
5330		err := json.Unmarshal(body, &aisccvpi)
5331		return aisccvpi, err
5332	default:
5333		var pi ProtectedItem
5334		err := json.Unmarshal(body, &pi)
5335		return pi, err
5336	}
5337}
5338func unmarshalBasicProtectedItemArray(body []byte) ([]BasicProtectedItem, error) {
5339	var rawMessages []*json.RawMessage
5340	err := json.Unmarshal(body, &rawMessages)
5341	if err != nil {
5342		return nil, err
5343	}
5344
5345	piArray := make([]BasicProtectedItem, len(rawMessages))
5346
5347	for index, rawMessage := range rawMessages {
5348		pi, err := unmarshalBasicProtectedItem(*rawMessage)
5349		if err != nil {
5350			return nil, err
5351		}
5352		piArray[index] = pi
5353	}
5354	return piArray, nil
5355}
5356
5357// MarshalJSON is the custom marshaler for ProtectedItem.
5358func (pi ProtectedItem) MarshalJSON() ([]byte, error) {
5359	pi.ProtectedItemType = ProtectedItemTypeProtectedItem
5360	objectMap := make(map[string]interface{})
5361	if pi.BackupManagementType != "" {
5362		objectMap["backupManagementType"] = pi.BackupManagementType
5363	}
5364	if pi.WorkloadType != "" {
5365		objectMap["workloadType"] = pi.WorkloadType
5366	}
5367	if pi.SourceResourceID != nil {
5368		objectMap["sourceResourceId"] = pi.SourceResourceID
5369	}
5370	if pi.PolicyID != nil {
5371		objectMap["policyId"] = pi.PolicyID
5372	}
5373	if pi.LastRecoveryPoint != nil {
5374		objectMap["lastRecoveryPoint"] = pi.LastRecoveryPoint
5375	}
5376	if pi.ProtectedItemType != "" {
5377		objectMap["protectedItemType"] = pi.ProtectedItemType
5378	}
5379	return json.Marshal(objectMap)
5380}
5381
5382// AsAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5383func (pi ProtectedItem) AsAzureIaaSVMProtectedItem() (*AzureIaaSVMProtectedItem, bool) {
5384	return nil, false
5385}
5386
5387// AsBasicAzureIaaSVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5388func (pi ProtectedItem) AsBasicAzureIaaSVMProtectedItem() (BasicAzureIaaSVMProtectedItem, bool) {
5389	return nil, false
5390}
5391
5392// AsMabFileFolderProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5393func (pi ProtectedItem) AsMabFileFolderProtectedItem() (*MabFileFolderProtectedItem, bool) {
5394	return nil, false
5395}
5396
5397// AsAzureSQLProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5398func (pi ProtectedItem) AsAzureSQLProtectedItem() (*AzureSQLProtectedItem, bool) {
5399	return nil, false
5400}
5401
5402// AsAzureIaaSComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5403func (pi ProtectedItem) AsAzureIaaSComputeVMProtectedItem() (*AzureIaaSComputeVMProtectedItem, bool) {
5404	return nil, false
5405}
5406
5407// AsAzureIaaSClassicComputeVMProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5408func (pi ProtectedItem) AsAzureIaaSClassicComputeVMProtectedItem() (*AzureIaaSClassicComputeVMProtectedItem, bool) {
5409	return nil, false
5410}
5411
5412// AsProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5413func (pi ProtectedItem) AsProtectedItem() (*ProtectedItem, bool) {
5414	return &pi, true
5415}
5416
5417// AsBasicProtectedItem is the BasicProtectedItem implementation for ProtectedItem.
5418func (pi ProtectedItem) AsBasicProtectedItem() (BasicProtectedItem, bool) {
5419	return &pi, true
5420}
5421
5422// ProtectedItemQueryObject filters the list of backup items.
5423type ProtectedItemQueryObject struct {
5424	// BackupManagementType - The backup management type associated with an item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
5425	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
5426	// ItemType - The workload type associated with an item. Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSQLDb', 'SQLDB', 'Exchange', 'Sharepoint', 'DPMUnknown'
5427	ItemType DataSourceType `json:"itemType,omitempty"`
5428	// PolicyName - The name of the backup policy associated with the item.
5429	PolicyName *string `json:"policyName,omitempty"`
5430	// ContainerName - The name of the container.
5431	ContainerName *string `json:"containerName,omitempty"`
5432}
5433
5434// ProtectedItemResource the base class for backup items.
5435type ProtectedItemResource struct {
5436	autorest.Response `json:"-"`
5437	Properties        BasicProtectedItem `json:"properties,omitempty"`
5438	// ID - Resource ID represents the complete path to the resource.
5439	ID *string `json:"id,omitempty"`
5440	// Name - Resource name associated with the resource.
5441	Name *string `json:"name,omitempty"`
5442	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
5443	Type *string `json:"type,omitempty"`
5444	// Location - Resource location.
5445	Location *string `json:"location,omitempty"`
5446	// Tags - Resource tags.
5447	Tags map[string]*string `json:"tags"`
5448	// ETag - Optional ETag.
5449	ETag *string `json:"eTag,omitempty"`
5450}
5451
5452// MarshalJSON is the custom marshaler for ProtectedItemResource.
5453func (pir ProtectedItemResource) MarshalJSON() ([]byte, error) {
5454	objectMap := make(map[string]interface{})
5455	objectMap["properties"] = pir.Properties
5456	if pir.ID != nil {
5457		objectMap["id"] = pir.ID
5458	}
5459	if pir.Name != nil {
5460		objectMap["name"] = pir.Name
5461	}
5462	if pir.Type != nil {
5463		objectMap["type"] = pir.Type
5464	}
5465	if pir.Location != nil {
5466		objectMap["location"] = pir.Location
5467	}
5468	if pir.Tags != nil {
5469		objectMap["tags"] = pir.Tags
5470	}
5471	if pir.ETag != nil {
5472		objectMap["eTag"] = pir.ETag
5473	}
5474	return json.Marshal(objectMap)
5475}
5476
5477// UnmarshalJSON is the custom unmarshaler for ProtectedItemResource struct.
5478func (pir *ProtectedItemResource) UnmarshalJSON(body []byte) error {
5479	var m map[string]*json.RawMessage
5480	err := json.Unmarshal(body, &m)
5481	if err != nil {
5482		return err
5483	}
5484	for k, v := range m {
5485		switch k {
5486		case "properties":
5487			if v != nil {
5488				properties, err := unmarshalBasicProtectedItem(*v)
5489				if err != nil {
5490					return err
5491				}
5492				pir.Properties = properties
5493			}
5494		case "id":
5495			if v != nil {
5496				var ID string
5497				err = json.Unmarshal(*v, &ID)
5498				if err != nil {
5499					return err
5500				}
5501				pir.ID = &ID
5502			}
5503		case "name":
5504			if v != nil {
5505				var name string
5506				err = json.Unmarshal(*v, &name)
5507				if err != nil {
5508					return err
5509				}
5510				pir.Name = &name
5511			}
5512		case "type":
5513			if v != nil {
5514				var typeVar string
5515				err = json.Unmarshal(*v, &typeVar)
5516				if err != nil {
5517					return err
5518				}
5519				pir.Type = &typeVar
5520			}
5521		case "location":
5522			if v != nil {
5523				var location string
5524				err = json.Unmarshal(*v, &location)
5525				if err != nil {
5526					return err
5527				}
5528				pir.Location = &location
5529			}
5530		case "tags":
5531			if v != nil {
5532				var tags map[string]*string
5533				err = json.Unmarshal(*v, &tags)
5534				if err != nil {
5535					return err
5536				}
5537				pir.Tags = tags
5538			}
5539		case "eTag":
5540			if v != nil {
5541				var eTag string
5542				err = json.Unmarshal(*v, &eTag)
5543				if err != nil {
5544					return err
5545				}
5546				pir.ETag = &eTag
5547			}
5548		}
5549	}
5550
5551	return nil
5552}
5553
5554// ProtectedItemResourceList the list of ProtectedItem resources.
5555type ProtectedItemResourceList struct {
5556	autorest.Response `json:"-"`
5557	// Value - The list of resources.
5558	Value *[]ProtectedItemResource `json:"value,omitempty"`
5559	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
5560	NextLink *string `json:"nextLink,omitempty"`
5561}
5562
5563// ProtectedItemResourceListIterator provides access to a complete listing of ProtectedItemResource values.
5564type ProtectedItemResourceListIterator struct {
5565	i    int
5566	page ProtectedItemResourceListPage
5567}
5568
5569// NextWithContext advances to the next value.  If there was an error making
5570// the request the iterator does not advance and the error is returned.
5571func (iter *ProtectedItemResourceListIterator) NextWithContext(ctx context.Context) (err error) {
5572	if tracing.IsEnabled() {
5573		ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListIterator.NextWithContext")
5574		defer func() {
5575			sc := -1
5576			if iter.Response().Response.Response != nil {
5577				sc = iter.Response().Response.Response.StatusCode
5578			}
5579			tracing.EndSpan(ctx, sc, err)
5580		}()
5581	}
5582	iter.i++
5583	if iter.i < len(iter.page.Values()) {
5584		return nil
5585	}
5586	err = iter.page.NextWithContext(ctx)
5587	if err != nil {
5588		iter.i--
5589		return err
5590	}
5591	iter.i = 0
5592	return nil
5593}
5594
5595// Next advances to the next value.  If there was an error making
5596// the request the iterator does not advance and the error is returned.
5597// Deprecated: Use NextWithContext() instead.
5598func (iter *ProtectedItemResourceListIterator) Next() error {
5599	return iter.NextWithContext(context.Background())
5600}
5601
5602// NotDone returns true if the enumeration should be started or is not yet complete.
5603func (iter ProtectedItemResourceListIterator) NotDone() bool {
5604	return iter.page.NotDone() && iter.i < len(iter.page.Values())
5605}
5606
5607// Response returns the raw server response from the last page request.
5608func (iter ProtectedItemResourceListIterator) Response() ProtectedItemResourceList {
5609	return iter.page.Response()
5610}
5611
5612// Value returns the current value or a zero-initialized value if the
5613// iterator has advanced beyond the end of the collection.
5614func (iter ProtectedItemResourceListIterator) Value() ProtectedItemResource {
5615	if !iter.page.NotDone() {
5616		return ProtectedItemResource{}
5617	}
5618	return iter.page.Values()[iter.i]
5619}
5620
5621// Creates a new instance of the ProtectedItemResourceListIterator type.
5622func NewProtectedItemResourceListIterator(page ProtectedItemResourceListPage) ProtectedItemResourceListIterator {
5623	return ProtectedItemResourceListIterator{page: page}
5624}
5625
5626// IsEmpty returns true if the ListResult contains no values.
5627func (pirl ProtectedItemResourceList) IsEmpty() bool {
5628	return pirl.Value == nil || len(*pirl.Value) == 0
5629}
5630
5631// protectedItemResourceListPreparer prepares a request to retrieve the next set of results.
5632// It returns nil if no more results exist.
5633func (pirl ProtectedItemResourceList) protectedItemResourceListPreparer(ctx context.Context) (*http.Request, error) {
5634	if pirl.NextLink == nil || len(to.String(pirl.NextLink)) < 1 {
5635		return nil, nil
5636	}
5637	return autorest.Prepare((&http.Request{}).WithContext(ctx),
5638		autorest.AsJSON(),
5639		autorest.AsGet(),
5640		autorest.WithBaseURL(to.String(pirl.NextLink)))
5641}
5642
5643// ProtectedItemResourceListPage contains a page of ProtectedItemResource values.
5644type ProtectedItemResourceListPage struct {
5645	fn   func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)
5646	pirl ProtectedItemResourceList
5647}
5648
5649// NextWithContext advances to the next page of values.  If there was an error making
5650// the request the page does not advance and the error is returned.
5651func (page *ProtectedItemResourceListPage) NextWithContext(ctx context.Context) (err error) {
5652	if tracing.IsEnabled() {
5653		ctx = tracing.StartSpan(ctx, fqdn+"/ProtectedItemResourceListPage.NextWithContext")
5654		defer func() {
5655			sc := -1
5656			if page.Response().Response.Response != nil {
5657				sc = page.Response().Response.Response.StatusCode
5658			}
5659			tracing.EndSpan(ctx, sc, err)
5660		}()
5661	}
5662	next, err := page.fn(ctx, page.pirl)
5663	if err != nil {
5664		return err
5665	}
5666	page.pirl = next
5667	return nil
5668}
5669
5670// Next advances to the next page of values.  If there was an error making
5671// the request the page does not advance and the error is returned.
5672// Deprecated: Use NextWithContext() instead.
5673func (page *ProtectedItemResourceListPage) Next() error {
5674	return page.NextWithContext(context.Background())
5675}
5676
5677// NotDone returns true if the page enumeration should be started or is not yet complete.
5678func (page ProtectedItemResourceListPage) NotDone() bool {
5679	return !page.pirl.IsEmpty()
5680}
5681
5682// Response returns the raw server response from the last page request.
5683func (page ProtectedItemResourceListPage) Response() ProtectedItemResourceList {
5684	return page.pirl
5685}
5686
5687// Values returns the slice of values for the current page or nil if there are no values.
5688func (page ProtectedItemResourceListPage) Values() []ProtectedItemResource {
5689	if page.pirl.IsEmpty() {
5690		return nil
5691	}
5692	return *page.pirl.Value
5693}
5694
5695// Creates a new instance of the ProtectedItemResourceListPage type.
5696func NewProtectedItemResourceListPage(getNextPage func(context.Context, ProtectedItemResourceList) (ProtectedItemResourceList, error)) ProtectedItemResourceListPage {
5697	return ProtectedItemResourceListPage{fn: getNextPage}
5698}
5699
5700// BasicProtectionContainer the base class for a container with backup items. Containers with specific workloads are
5701// derived from this class.
5702type BasicProtectionContainer interface {
5703	AsAzureSQLContainer() (*AzureSQLContainer, bool)
5704	AsIaaSVMContainer() (*IaaSVMContainer, bool)
5705	AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool)
5706	AsMabContainer() (*MabContainer, bool)
5707	AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool)
5708	AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool)
5709	AsProtectionContainer() (*ProtectionContainer, bool)
5710}
5711
5712// ProtectionContainer the base class for a container with backup items. Containers with specific workloads are
5713// derived from this class.
5714type ProtectionContainer struct {
5715	// FriendlyName - Friendly name of the container.
5716	FriendlyName *string `json:"friendlyName,omitempty"`
5717	// BackupManagementType - The backup management type for the container. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
5718	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
5719	// RegistrationStatus - The container's registration status with the Recovery Services vault.
5720	RegistrationStatus *string `json:"registrationStatus,omitempty"`
5721	// HealthStatus - The status of the container's health.
5722	HealthStatus *string `json:"healthStatus,omitempty"`
5723	// ContainerType - READ-ONLY; The type assigned to the container. The values to use for each of these properties are:<br/> 1. Compute Azure VM is Microsoft.Compute/virtualMachines<br/> 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines<br/> 3. Windows machines (like Azure Backup Server and DPM) is Windows<br/> 4. Azure SQL instance is AzureSqlContainer.
5724	ContainerType *string `json:"containerType,omitempty"`
5725	// ProtectableObjectType - Possible values include: 'ProtectableObjectTypeProtectionContainer', 'ProtectableObjectTypeAzureSQLContainer', 'ProtectableObjectTypeIaaSVMContainer', 'ProtectableObjectTypeMABWindowsContainer', 'ProtectableObjectTypeMicrosoftComputevirtualMachines', 'ProtectableObjectTypeMicrosoftClassicComputevirtualMachines'
5726	ProtectableObjectType ProtectableObjectType `json:"protectableObjectType,omitempty"`
5727}
5728
5729func unmarshalBasicProtectionContainer(body []byte) (BasicProtectionContainer, error) {
5730	var m map[string]interface{}
5731	err := json.Unmarshal(body, &m)
5732	if err != nil {
5733		return nil, err
5734	}
5735
5736	switch m["protectableObjectType"] {
5737	case string(ProtectableObjectTypeAzureSQLContainer):
5738		var asc AzureSQLContainer
5739		err := json.Unmarshal(body, &asc)
5740		return asc, err
5741	case string(ProtectableObjectTypeIaaSVMContainer):
5742		var isc IaaSVMContainer
5743		err := json.Unmarshal(body, &isc)
5744		return isc, err
5745	case string(ProtectableObjectTypeMABWindowsContainer):
5746		var mc MabContainer
5747		err := json.Unmarshal(body, &mc)
5748		return mc, err
5749	case string(ProtectableObjectTypeMicrosoftComputevirtualMachines):
5750		var aiscvc AzureIaaSComputeVMContainer
5751		err := json.Unmarshal(body, &aiscvc)
5752		return aiscvc, err
5753	case string(ProtectableObjectTypeMicrosoftClassicComputevirtualMachines):
5754		var aisccvc AzureIaaSClassicComputeVMContainer
5755		err := json.Unmarshal(body, &aisccvc)
5756		return aisccvc, err
5757	default:
5758		var pc ProtectionContainer
5759		err := json.Unmarshal(body, &pc)
5760		return pc, err
5761	}
5762}
5763func unmarshalBasicProtectionContainerArray(body []byte) ([]BasicProtectionContainer, error) {
5764	var rawMessages []*json.RawMessage
5765	err := json.Unmarshal(body, &rawMessages)
5766	if err != nil {
5767		return nil, err
5768	}
5769
5770	pcArray := make([]BasicProtectionContainer, len(rawMessages))
5771
5772	for index, rawMessage := range rawMessages {
5773		pc, err := unmarshalBasicProtectionContainer(*rawMessage)
5774		if err != nil {
5775			return nil, err
5776		}
5777		pcArray[index] = pc
5778	}
5779	return pcArray, nil
5780}
5781
5782// MarshalJSON is the custom marshaler for ProtectionContainer.
5783func (pc ProtectionContainer) MarshalJSON() ([]byte, error) {
5784	pc.ProtectableObjectType = ProtectableObjectTypeProtectionContainer
5785	objectMap := make(map[string]interface{})
5786	if pc.FriendlyName != nil {
5787		objectMap["friendlyName"] = pc.FriendlyName
5788	}
5789	if pc.BackupManagementType != "" {
5790		objectMap["backupManagementType"] = pc.BackupManagementType
5791	}
5792	if pc.RegistrationStatus != nil {
5793		objectMap["registrationStatus"] = pc.RegistrationStatus
5794	}
5795	if pc.HealthStatus != nil {
5796		objectMap["healthStatus"] = pc.HealthStatus
5797	}
5798	if pc.ProtectableObjectType != "" {
5799		objectMap["protectableObjectType"] = pc.ProtectableObjectType
5800	}
5801	return json.Marshal(objectMap)
5802}
5803
5804// AsAzureSQLContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5805func (pc ProtectionContainer) AsAzureSQLContainer() (*AzureSQLContainer, bool) {
5806	return nil, false
5807}
5808
5809// AsIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5810func (pc ProtectionContainer) AsIaaSVMContainer() (*IaaSVMContainer, bool) {
5811	return nil, false
5812}
5813
5814// AsBasicIaaSVMContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5815func (pc ProtectionContainer) AsBasicIaaSVMContainer() (BasicIaaSVMContainer, bool) {
5816	return nil, false
5817}
5818
5819// AsMabContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5820func (pc ProtectionContainer) AsMabContainer() (*MabContainer, bool) {
5821	return nil, false
5822}
5823
5824// AsAzureIaaSComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5825func (pc ProtectionContainer) AsAzureIaaSComputeVMContainer() (*AzureIaaSComputeVMContainer, bool) {
5826	return nil, false
5827}
5828
5829// AsAzureIaaSClassicComputeVMContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5830func (pc ProtectionContainer) AsAzureIaaSClassicComputeVMContainer() (*AzureIaaSClassicComputeVMContainer, bool) {
5831	return nil, false
5832}
5833
5834// AsProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5835func (pc ProtectionContainer) AsProtectionContainer() (*ProtectionContainer, bool) {
5836	return &pc, true
5837}
5838
5839// AsBasicProtectionContainer is the BasicProtectionContainer implementation for ProtectionContainer.
5840func (pc ProtectionContainer) AsBasicProtectionContainer() (BasicProtectionContainer, bool) {
5841	return &pc, true
5842}
5843
5844// ProtectionContainerResource base class for a container with backup items. Containers with specific
5845// workloads are derived from this class.
5846type ProtectionContainerResource struct {
5847	autorest.Response `json:"-"`
5848	Properties        BasicProtectionContainer `json:"properties,omitempty"`
5849	// ID - Resource ID represents the complete path to the resource.
5850	ID *string `json:"id,omitempty"`
5851	// Name - Resource name associated with the resource.
5852	Name *string `json:"name,omitempty"`
5853	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
5854	Type *string `json:"type,omitempty"`
5855	// Location - Resource location.
5856	Location *string `json:"location,omitempty"`
5857	// Tags - Resource tags.
5858	Tags map[string]*string `json:"tags"`
5859	// ETag - Optional ETag.
5860	ETag *string `json:"eTag,omitempty"`
5861}
5862
5863// MarshalJSON is the custom marshaler for ProtectionContainerResource.
5864func (pcr ProtectionContainerResource) MarshalJSON() ([]byte, error) {
5865	objectMap := make(map[string]interface{})
5866	objectMap["properties"] = pcr.Properties
5867	if pcr.ID != nil {
5868		objectMap["id"] = pcr.ID
5869	}
5870	if pcr.Name != nil {
5871		objectMap["name"] = pcr.Name
5872	}
5873	if pcr.Type != nil {
5874		objectMap["type"] = pcr.Type
5875	}
5876	if pcr.Location != nil {
5877		objectMap["location"] = pcr.Location
5878	}
5879	if pcr.Tags != nil {
5880		objectMap["tags"] = pcr.Tags
5881	}
5882	if pcr.ETag != nil {
5883		objectMap["eTag"] = pcr.ETag
5884	}
5885	return json.Marshal(objectMap)
5886}
5887
5888// UnmarshalJSON is the custom unmarshaler for ProtectionContainerResource struct.
5889func (pcr *ProtectionContainerResource) UnmarshalJSON(body []byte) error {
5890	var m map[string]*json.RawMessage
5891	err := json.Unmarshal(body, &m)
5892	if err != nil {
5893		return err
5894	}
5895	for k, v := range m {
5896		switch k {
5897		case "properties":
5898			if v != nil {
5899				properties, err := unmarshalBasicProtectionContainer(*v)
5900				if err != nil {
5901					return err
5902				}
5903				pcr.Properties = properties
5904			}
5905		case "id":
5906			if v != nil {
5907				var ID string
5908				err = json.Unmarshal(*v, &ID)
5909				if err != nil {
5910					return err
5911				}
5912				pcr.ID = &ID
5913			}
5914		case "name":
5915			if v != nil {
5916				var name string
5917				err = json.Unmarshal(*v, &name)
5918				if err != nil {
5919					return err
5920				}
5921				pcr.Name = &name
5922			}
5923		case "type":
5924			if v != nil {
5925				var typeVar string
5926				err = json.Unmarshal(*v, &typeVar)
5927				if err != nil {
5928					return err
5929				}
5930				pcr.Type = &typeVar
5931			}
5932		case "location":
5933			if v != nil {
5934				var location string
5935				err = json.Unmarshal(*v, &location)
5936				if err != nil {
5937					return err
5938				}
5939				pcr.Location = &location
5940			}
5941		case "tags":
5942			if v != nil {
5943				var tags map[string]*string
5944				err = json.Unmarshal(*v, &tags)
5945				if err != nil {
5946					return err
5947				}
5948				pcr.Tags = tags
5949			}
5950		case "eTag":
5951			if v != nil {
5952				var eTag string
5953				err = json.Unmarshal(*v, &eTag)
5954				if err != nil {
5955					return err
5956				}
5957				pcr.ETag = &eTag
5958			}
5959		}
5960	}
5961
5962	return nil
5963}
5964
5965// ProtectionContainerResourceList the list of ProtectionContainer resources.
5966type ProtectionContainerResourceList struct {
5967	autorest.Response `json:"-"`
5968	// Value - The list of resources.
5969	Value *[]ProtectionContainerResource `json:"value,omitempty"`
5970	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
5971	NextLink *string `json:"nextLink,omitempty"`
5972}
5973
5974// BasicProtectionPolicy the base class for a backup policy. Workload-specific backup policies are derived from this
5975// class.
5976type BasicProtectionPolicy interface {
5977	AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool)
5978	AsMabProtectionPolicy() (*MabProtectionPolicy, bool)
5979	AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool)
5980	AsProtectionPolicy() (*ProtectionPolicy, bool)
5981}
5982
5983// ProtectionPolicy the base class for a backup policy. Workload-specific backup policies are derived from this
5984// class.
5985type ProtectionPolicy struct {
5986	// ProtectedItemsCount - The number of items associated with this policy.
5987	ProtectedItemsCount *int32 `json:"protectedItemsCount,omitempty"`
5988	// BackupManagementType - Possible values include: 'BackupManagementTypeProtectionPolicy', 'BackupManagementTypeAzureIaasVM', 'BackupManagementTypeMAB', 'BackupManagementTypeAzureSQL'
5989	BackupManagementType ManagementTypeBasicProtectionPolicy `json:"backupManagementType,omitempty"`
5990}
5991
5992func unmarshalBasicProtectionPolicy(body []byte) (BasicProtectionPolicy, error) {
5993	var m map[string]interface{}
5994	err := json.Unmarshal(body, &m)
5995	if err != nil {
5996		return nil, err
5997	}
5998
5999	switch m["backupManagementType"] {
6000	case string(BackupManagementTypeAzureIaasVM):
6001		var aispp AzureIaaSVMProtectionPolicy
6002		err := json.Unmarshal(body, &aispp)
6003		return aispp, err
6004	case string(BackupManagementTypeMAB):
6005		var mpp MabProtectionPolicy
6006		err := json.Unmarshal(body, &mpp)
6007		return mpp, err
6008	case string(BackupManagementTypeAzureSQL):
6009		var aspp AzureSQLProtectionPolicy
6010		err := json.Unmarshal(body, &aspp)
6011		return aspp, err
6012	default:
6013		var pp ProtectionPolicy
6014		err := json.Unmarshal(body, &pp)
6015		return pp, err
6016	}
6017}
6018func unmarshalBasicProtectionPolicyArray(body []byte) ([]BasicProtectionPolicy, error) {
6019	var rawMessages []*json.RawMessage
6020	err := json.Unmarshal(body, &rawMessages)
6021	if err != nil {
6022		return nil, err
6023	}
6024
6025	ppArray := make([]BasicProtectionPolicy, len(rawMessages))
6026
6027	for index, rawMessage := range rawMessages {
6028		pp, err := unmarshalBasicProtectionPolicy(*rawMessage)
6029		if err != nil {
6030			return nil, err
6031		}
6032		ppArray[index] = pp
6033	}
6034	return ppArray, nil
6035}
6036
6037// MarshalJSON is the custom marshaler for ProtectionPolicy.
6038func (pp ProtectionPolicy) MarshalJSON() ([]byte, error) {
6039	pp.BackupManagementType = BackupManagementTypeProtectionPolicy
6040	objectMap := make(map[string]interface{})
6041	if pp.ProtectedItemsCount != nil {
6042		objectMap["protectedItemsCount"] = pp.ProtectedItemsCount
6043	}
6044	if pp.BackupManagementType != "" {
6045		objectMap["backupManagementType"] = pp.BackupManagementType
6046	}
6047	return json.Marshal(objectMap)
6048}
6049
6050// AsAzureIaaSVMProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy.
6051func (pp ProtectionPolicy) AsAzureIaaSVMProtectionPolicy() (*AzureIaaSVMProtectionPolicy, bool) {
6052	return nil, false
6053}
6054
6055// AsMabProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy.
6056func (pp ProtectionPolicy) AsMabProtectionPolicy() (*MabProtectionPolicy, bool) {
6057	return nil, false
6058}
6059
6060// AsAzureSQLProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy.
6061func (pp ProtectionPolicy) AsAzureSQLProtectionPolicy() (*AzureSQLProtectionPolicy, bool) {
6062	return nil, false
6063}
6064
6065// AsProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy.
6066func (pp ProtectionPolicy) AsProtectionPolicy() (*ProtectionPolicy, bool) {
6067	return &pp, true
6068}
6069
6070// AsBasicProtectionPolicy is the BasicProtectionPolicy implementation for ProtectionPolicy.
6071func (pp ProtectionPolicy) AsBasicProtectionPolicy() (BasicProtectionPolicy, bool) {
6072	return &pp, true
6073}
6074
6075// ProtectionPolicyQueryObject this object filters the list of backup policies.
6076type ProtectionPolicyQueryObject struct {
6077	// BackupManagementType - The backup management type associated with the backup policy. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL'
6078	BackupManagementType ManagementType `json:"backupManagementType,omitempty"`
6079}
6080
6081// ProtectionPolicyResource the base class for backup policy. Workload-specific backup policies are derived
6082// from this class.
6083type ProtectionPolicyResource struct {
6084	autorest.Response `json:"-"`
6085	Properties        BasicProtectionPolicy `json:"properties,omitempty"`
6086	// ID - Resource ID represents the complete path to the resource.
6087	ID *string `json:"id,omitempty"`
6088	// Name - Resource name associated with the resource.
6089	Name *string `json:"name,omitempty"`
6090	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
6091	Type *string `json:"type,omitempty"`
6092	// Location - Resource location.
6093	Location *string `json:"location,omitempty"`
6094	// Tags - Resource tags.
6095	Tags map[string]*string `json:"tags"`
6096	// ETag - Optional ETag.
6097	ETag *string `json:"eTag,omitempty"`
6098}
6099
6100// MarshalJSON is the custom marshaler for ProtectionPolicyResource.
6101func (ppr ProtectionPolicyResource) MarshalJSON() ([]byte, error) {
6102	objectMap := make(map[string]interface{})
6103	objectMap["properties"] = ppr.Properties
6104	if ppr.ID != nil {
6105		objectMap["id"] = ppr.ID
6106	}
6107	if ppr.Name != nil {
6108		objectMap["name"] = ppr.Name
6109	}
6110	if ppr.Type != nil {
6111		objectMap["type"] = ppr.Type
6112	}
6113	if ppr.Location != nil {
6114		objectMap["location"] = ppr.Location
6115	}
6116	if ppr.Tags != nil {
6117		objectMap["tags"] = ppr.Tags
6118	}
6119	if ppr.ETag != nil {
6120		objectMap["eTag"] = ppr.ETag
6121	}
6122	return json.Marshal(objectMap)
6123}
6124
6125// UnmarshalJSON is the custom unmarshaler for ProtectionPolicyResource struct.
6126func (ppr *ProtectionPolicyResource) UnmarshalJSON(body []byte) error {
6127	var m map[string]*json.RawMessage
6128	err := json.Unmarshal(body, &m)
6129	if err != nil {
6130		return err
6131	}
6132	for k, v := range m {
6133		switch k {
6134		case "properties":
6135			if v != nil {
6136				properties, err := unmarshalBasicProtectionPolicy(*v)
6137				if err != nil {
6138					return err
6139				}
6140				ppr.Properties = properties
6141			}
6142		case "id":
6143			if v != nil {
6144				var ID string
6145				err = json.Unmarshal(*v, &ID)
6146				if err != nil {
6147					return err
6148				}
6149				ppr.ID = &ID
6150			}
6151		case "name":
6152			if v != nil {
6153				var name string
6154				err = json.Unmarshal(*v, &name)
6155				if err != nil {
6156					return err
6157				}
6158				ppr.Name = &name
6159			}
6160		case "type":
6161			if v != nil {
6162				var typeVar string
6163				err = json.Unmarshal(*v, &typeVar)
6164				if err != nil {
6165					return err
6166				}
6167				ppr.Type = &typeVar
6168			}
6169		case "location":
6170			if v != nil {
6171				var location string
6172				err = json.Unmarshal(*v, &location)
6173				if err != nil {
6174					return err
6175				}
6176				ppr.Location = &location
6177			}
6178		case "tags":
6179			if v != nil {
6180				var tags map[string]*string
6181				err = json.Unmarshal(*v, &tags)
6182				if err != nil {
6183					return err
6184				}
6185				ppr.Tags = tags
6186			}
6187		case "eTag":
6188			if v != nil {
6189				var eTag string
6190				err = json.Unmarshal(*v, &eTag)
6191				if err != nil {
6192					return err
6193				}
6194				ppr.ETag = &eTag
6195			}
6196		}
6197	}
6198
6199	return nil
6200}
6201
6202// ProtectionPolicyResourceList the list of ProtectionPolicy resources.
6203type ProtectionPolicyResourceList struct {
6204	autorest.Response `json:"-"`
6205	// Value - The list of resources.
6206	Value *[]ProtectionPolicyResource `json:"value,omitempty"`
6207	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
6208	NextLink *string `json:"nextLink,omitempty"`
6209}
6210
6211// BasicRecoveryPoint the base class for backup copies. Workload-specific backup copies are derived from this class.
6212type BasicRecoveryPoint interface {
6213	AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool)
6214	AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool)
6215	AsRecoveryPoint() (*RecoveryPoint, bool)
6216}
6217
6218// RecoveryPoint the base class for backup copies. Workload-specific backup copies are derived from this class.
6219type RecoveryPoint struct {
6220	// ObjectType - Possible values include: 'ObjectTypeRecoveryPoint', 'ObjectTypeIaasVMRecoveryPoint', 'ObjectTypeGenericRecoveryPoint'
6221	ObjectType ObjectTypeBasicRecoveryPoint `json:"objectType,omitempty"`
6222}
6223
6224func unmarshalBasicRecoveryPoint(body []byte) (BasicRecoveryPoint, error) {
6225	var m map[string]interface{}
6226	err := json.Unmarshal(body, &m)
6227	if err != nil {
6228		return nil, err
6229	}
6230
6231	switch m["objectType"] {
6232	case string(ObjectTypeIaasVMRecoveryPoint):
6233		var ivrp IaasVMRecoveryPoint
6234		err := json.Unmarshal(body, &ivrp)
6235		return ivrp, err
6236	case string(ObjectTypeGenericRecoveryPoint):
6237		var grp GenericRecoveryPoint
6238		err := json.Unmarshal(body, &grp)
6239		return grp, err
6240	default:
6241		var rp RecoveryPoint
6242		err := json.Unmarshal(body, &rp)
6243		return rp, err
6244	}
6245}
6246func unmarshalBasicRecoveryPointArray(body []byte) ([]BasicRecoveryPoint, error) {
6247	var rawMessages []*json.RawMessage
6248	err := json.Unmarshal(body, &rawMessages)
6249	if err != nil {
6250		return nil, err
6251	}
6252
6253	rpArray := make([]BasicRecoveryPoint, len(rawMessages))
6254
6255	for index, rawMessage := range rawMessages {
6256		rp, err := unmarshalBasicRecoveryPoint(*rawMessage)
6257		if err != nil {
6258			return nil, err
6259		}
6260		rpArray[index] = rp
6261	}
6262	return rpArray, nil
6263}
6264
6265// MarshalJSON is the custom marshaler for RecoveryPoint.
6266func (rp RecoveryPoint) MarshalJSON() ([]byte, error) {
6267	rp.ObjectType = ObjectTypeRecoveryPoint
6268	objectMap := make(map[string]interface{})
6269	if rp.ObjectType != "" {
6270		objectMap["objectType"] = rp.ObjectType
6271	}
6272	return json.Marshal(objectMap)
6273}
6274
6275// AsIaasVMRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint.
6276func (rp RecoveryPoint) AsIaasVMRecoveryPoint() (*IaasVMRecoveryPoint, bool) {
6277	return nil, false
6278}
6279
6280// AsGenericRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint.
6281func (rp RecoveryPoint) AsGenericRecoveryPoint() (*GenericRecoveryPoint, bool) {
6282	return nil, false
6283}
6284
6285// AsRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint.
6286func (rp RecoveryPoint) AsRecoveryPoint() (*RecoveryPoint, bool) {
6287	return &rp, true
6288}
6289
6290// AsBasicRecoveryPoint is the BasicRecoveryPoint implementation for RecoveryPoint.
6291func (rp RecoveryPoint) AsBasicRecoveryPoint() (BasicRecoveryPoint, bool) {
6292	return &rp, true
6293}
6294
6295// RecoveryPointResource the base class for backup copies. Workload-specific backup copies are derived from
6296// this class.
6297type RecoveryPointResource struct {
6298	autorest.Response `json:"-"`
6299	Properties        BasicRecoveryPoint `json:"properties,omitempty"`
6300	// ID - Resource ID represents the complete path to the resource.
6301	ID *string `json:"id,omitempty"`
6302	// Name - Resource name associated with the resource.
6303	Name *string `json:"name,omitempty"`
6304	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
6305	Type *string `json:"type,omitempty"`
6306	// Location - Resource location.
6307	Location *string `json:"location,omitempty"`
6308	// Tags - Resource tags.
6309	Tags map[string]*string `json:"tags"`
6310	// ETag - Optional ETag.
6311	ETag *string `json:"eTag,omitempty"`
6312}
6313
6314// MarshalJSON is the custom marshaler for RecoveryPointResource.
6315func (rpr RecoveryPointResource) MarshalJSON() ([]byte, error) {
6316	objectMap := make(map[string]interface{})
6317	objectMap["properties"] = rpr.Properties
6318	if rpr.ID != nil {
6319		objectMap["id"] = rpr.ID
6320	}
6321	if rpr.Name != nil {
6322		objectMap["name"] = rpr.Name
6323	}
6324	if rpr.Type != nil {
6325		objectMap["type"] = rpr.Type
6326	}
6327	if rpr.Location != nil {
6328		objectMap["location"] = rpr.Location
6329	}
6330	if rpr.Tags != nil {
6331		objectMap["tags"] = rpr.Tags
6332	}
6333	if rpr.ETag != nil {
6334		objectMap["eTag"] = rpr.ETag
6335	}
6336	return json.Marshal(objectMap)
6337}
6338
6339// UnmarshalJSON is the custom unmarshaler for RecoveryPointResource struct.
6340func (rpr *RecoveryPointResource) UnmarshalJSON(body []byte) error {
6341	var m map[string]*json.RawMessage
6342	err := json.Unmarshal(body, &m)
6343	if err != nil {
6344		return err
6345	}
6346	for k, v := range m {
6347		switch k {
6348		case "properties":
6349			if v != nil {
6350				properties, err := unmarshalBasicRecoveryPoint(*v)
6351				if err != nil {
6352					return err
6353				}
6354				rpr.Properties = properties
6355			}
6356		case "id":
6357			if v != nil {
6358				var ID string
6359				err = json.Unmarshal(*v, &ID)
6360				if err != nil {
6361					return err
6362				}
6363				rpr.ID = &ID
6364			}
6365		case "name":
6366			if v != nil {
6367				var name string
6368				err = json.Unmarshal(*v, &name)
6369				if err != nil {
6370					return err
6371				}
6372				rpr.Name = &name
6373			}
6374		case "type":
6375			if v != nil {
6376				var typeVar string
6377				err = json.Unmarshal(*v, &typeVar)
6378				if err != nil {
6379					return err
6380				}
6381				rpr.Type = &typeVar
6382			}
6383		case "location":
6384			if v != nil {
6385				var location string
6386				err = json.Unmarshal(*v, &location)
6387				if err != nil {
6388					return err
6389				}
6390				rpr.Location = &location
6391			}
6392		case "tags":
6393			if v != nil {
6394				var tags map[string]*string
6395				err = json.Unmarshal(*v, &tags)
6396				if err != nil {
6397					return err
6398				}
6399				rpr.Tags = tags
6400			}
6401		case "eTag":
6402			if v != nil {
6403				var eTag string
6404				err = json.Unmarshal(*v, &eTag)
6405				if err != nil {
6406					return err
6407				}
6408				rpr.ETag = &eTag
6409			}
6410		}
6411	}
6412
6413	return nil
6414}
6415
6416// RecoveryPointResourceList the list of RecoveryPoint resources.
6417type RecoveryPointResourceList struct {
6418	autorest.Response `json:"-"`
6419	// Value - The list of resources.
6420	Value *[]RecoveryPointResource `json:"value,omitempty"`
6421	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
6422	NextLink *string `json:"nextLink,omitempty"`
6423}
6424
6425// BasicRequest the base class for a backup request. Workload-specific backup requests are derived from this class.
6426type BasicRequest interface {
6427	AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool)
6428	AsRequest() (*Request, bool)
6429}
6430
6431// Request the base class for a backup request. Workload-specific backup requests are derived from this class.
6432type Request struct {
6433	// ObjectType - Possible values include: 'ObjectTypeBackupRequest', 'ObjectTypeIaasVMBackupRequest'
6434	ObjectType ObjectTypeBasicRequest `json:"objectType,omitempty"`
6435}
6436
6437func unmarshalBasicRequest(body []byte) (BasicRequest, error) {
6438	var m map[string]interface{}
6439	err := json.Unmarshal(body, &m)
6440	if err != nil {
6441		return nil, err
6442	}
6443
6444	switch m["objectType"] {
6445	case string(ObjectTypeIaasVMBackupRequest):
6446		var ivbr IaasVMBackupRequest
6447		err := json.Unmarshal(body, &ivbr)
6448		return ivbr, err
6449	default:
6450		var r Request
6451		err := json.Unmarshal(body, &r)
6452		return r, err
6453	}
6454}
6455func unmarshalBasicRequestArray(body []byte) ([]BasicRequest, error) {
6456	var rawMessages []*json.RawMessage
6457	err := json.Unmarshal(body, &rawMessages)
6458	if err != nil {
6459		return nil, err
6460	}
6461
6462	rArray := make([]BasicRequest, len(rawMessages))
6463
6464	for index, rawMessage := range rawMessages {
6465		r, err := unmarshalBasicRequest(*rawMessage)
6466		if err != nil {
6467			return nil, err
6468		}
6469		rArray[index] = r
6470	}
6471	return rArray, nil
6472}
6473
6474// MarshalJSON is the custom marshaler for Request.
6475func (r Request) MarshalJSON() ([]byte, error) {
6476	r.ObjectType = ObjectTypeBackupRequest
6477	objectMap := make(map[string]interface{})
6478	if r.ObjectType != "" {
6479		objectMap["objectType"] = r.ObjectType
6480	}
6481	return json.Marshal(objectMap)
6482}
6483
6484// AsIaasVMBackupRequest is the BasicRequest implementation for Request.
6485func (r Request) AsIaasVMBackupRequest() (*IaasVMBackupRequest, bool) {
6486	return nil, false
6487}
6488
6489// AsRequest is the BasicRequest implementation for Request.
6490func (r Request) AsRequest() (*Request, bool) {
6491	return &r, true
6492}
6493
6494// AsBasicRequest is the BasicRequest implementation for Request.
6495func (r Request) AsBasicRequest() (BasicRequest, bool) {
6496	return &r, true
6497}
6498
6499// RequestResource base class for the backup request. Workload-specific backup requests are derived from
6500// this class.
6501type RequestResource struct {
6502	Properties BasicRequest `json:"properties,omitempty"`
6503	// ID - Resource ID represents the complete path to the resource.
6504	ID *string `json:"id,omitempty"`
6505	// Name - Resource name associated with the resource.
6506	Name *string `json:"name,omitempty"`
6507	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
6508	Type *string `json:"type,omitempty"`
6509	// Location - Resource location.
6510	Location *string `json:"location,omitempty"`
6511	// Tags - Resource tags.
6512	Tags map[string]*string `json:"tags"`
6513	// ETag - Optional ETag.
6514	ETag *string `json:"eTag,omitempty"`
6515}
6516
6517// MarshalJSON is the custom marshaler for RequestResource.
6518func (rr RequestResource) MarshalJSON() ([]byte, error) {
6519	objectMap := make(map[string]interface{})
6520	objectMap["properties"] = rr.Properties
6521	if rr.ID != nil {
6522		objectMap["id"] = rr.ID
6523	}
6524	if rr.Name != nil {
6525		objectMap["name"] = rr.Name
6526	}
6527	if rr.Type != nil {
6528		objectMap["type"] = rr.Type
6529	}
6530	if rr.Location != nil {
6531		objectMap["location"] = rr.Location
6532	}
6533	if rr.Tags != nil {
6534		objectMap["tags"] = rr.Tags
6535	}
6536	if rr.ETag != nil {
6537		objectMap["eTag"] = rr.ETag
6538	}
6539	return json.Marshal(objectMap)
6540}
6541
6542// UnmarshalJSON is the custom unmarshaler for RequestResource struct.
6543func (rr *RequestResource) UnmarshalJSON(body []byte) error {
6544	var m map[string]*json.RawMessage
6545	err := json.Unmarshal(body, &m)
6546	if err != nil {
6547		return err
6548	}
6549	for k, v := range m {
6550		switch k {
6551		case "properties":
6552			if v != nil {
6553				properties, err := unmarshalBasicRequest(*v)
6554				if err != nil {
6555					return err
6556				}
6557				rr.Properties = properties
6558			}
6559		case "id":
6560			if v != nil {
6561				var ID string
6562				err = json.Unmarshal(*v, &ID)
6563				if err != nil {
6564					return err
6565				}
6566				rr.ID = &ID
6567			}
6568		case "name":
6569			if v != nil {
6570				var name string
6571				err = json.Unmarshal(*v, &name)
6572				if err != nil {
6573					return err
6574				}
6575				rr.Name = &name
6576			}
6577		case "type":
6578			if v != nil {
6579				var typeVar string
6580				err = json.Unmarshal(*v, &typeVar)
6581				if err != nil {
6582					return err
6583				}
6584				rr.Type = &typeVar
6585			}
6586		case "location":
6587			if v != nil {
6588				var location string
6589				err = json.Unmarshal(*v, &location)
6590				if err != nil {
6591					return err
6592				}
6593				rr.Location = &location
6594			}
6595		case "tags":
6596			if v != nil {
6597				var tags map[string]*string
6598				err = json.Unmarshal(*v, &tags)
6599				if err != nil {
6600					return err
6601				}
6602				rr.Tags = tags
6603			}
6604		case "eTag":
6605			if v != nil {
6606				var eTag string
6607				err = json.Unmarshal(*v, &eTag)
6608				if err != nil {
6609					return err
6610				}
6611				rr.ETag = &eTag
6612			}
6613		}
6614	}
6615
6616	return nil
6617}
6618
6619// Resource base for all resources.
6620type Resource struct {
6621	// ID - Resource ID represents the complete path to the resource.
6622	ID *string `json:"id,omitempty"`
6623	// Name - Resource name associated with the resource.
6624	Name *string `json:"name,omitempty"`
6625	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
6626	Type *string `json:"type,omitempty"`
6627	// Location - Resource location.
6628	Location *string `json:"location,omitempty"`
6629	// Tags - Resource tags.
6630	Tags map[string]*string `json:"tags"`
6631	// ETag - Optional ETag.
6632	ETag *string `json:"eTag,omitempty"`
6633}
6634
6635// MarshalJSON is the custom marshaler for Resource.
6636func (r Resource) MarshalJSON() ([]byte, error) {
6637	objectMap := make(map[string]interface{})
6638	if r.ID != nil {
6639		objectMap["id"] = r.ID
6640	}
6641	if r.Name != nil {
6642		objectMap["name"] = r.Name
6643	}
6644	if r.Type != nil {
6645		objectMap["type"] = r.Type
6646	}
6647	if r.Location != nil {
6648		objectMap["location"] = r.Location
6649	}
6650	if r.Tags != nil {
6651		objectMap["tags"] = r.Tags
6652	}
6653	if r.ETag != nil {
6654		objectMap["eTag"] = r.ETag
6655	}
6656	return json.Marshal(objectMap)
6657}
6658
6659// ResourceList base for all lists of resources.
6660type ResourceList struct {
6661	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
6662	NextLink *string `json:"nextLink,omitempty"`
6663}
6664
6665// BasicRestoreRequest the base class for restore requests. Workload-specific restore requests are derived from this
6666// class.
6667type BasicRestoreRequest interface {
6668	AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool)
6669	AsRestoreRequest() (*RestoreRequest, bool)
6670}
6671
6672// RestoreRequest the base class for restore requests. Workload-specific restore requests are derived from this
6673// class.
6674type RestoreRequest struct {
6675	// ObjectType - Possible values include: 'ObjectTypeRestoreRequest', 'ObjectTypeIaasVMRestoreRequest'
6676	ObjectType ObjectTypeBasicRestoreRequest `json:"objectType,omitempty"`
6677}
6678
6679func unmarshalBasicRestoreRequest(body []byte) (BasicRestoreRequest, error) {
6680	var m map[string]interface{}
6681	err := json.Unmarshal(body, &m)
6682	if err != nil {
6683		return nil, err
6684	}
6685
6686	switch m["objectType"] {
6687	case string(ObjectTypeIaasVMRestoreRequest):
6688		var ivrr IaasVMRestoreRequest
6689		err := json.Unmarshal(body, &ivrr)
6690		return ivrr, err
6691	default:
6692		var rr RestoreRequest
6693		err := json.Unmarshal(body, &rr)
6694		return rr, err
6695	}
6696}
6697func unmarshalBasicRestoreRequestArray(body []byte) ([]BasicRestoreRequest, error) {
6698	var rawMessages []*json.RawMessage
6699	err := json.Unmarshal(body, &rawMessages)
6700	if err != nil {
6701		return nil, err
6702	}
6703
6704	rrArray := make([]BasicRestoreRequest, len(rawMessages))
6705
6706	for index, rawMessage := range rawMessages {
6707		rr, err := unmarshalBasicRestoreRequest(*rawMessage)
6708		if err != nil {
6709			return nil, err
6710		}
6711		rrArray[index] = rr
6712	}
6713	return rrArray, nil
6714}
6715
6716// MarshalJSON is the custom marshaler for RestoreRequest.
6717func (rr RestoreRequest) MarshalJSON() ([]byte, error) {
6718	rr.ObjectType = ObjectTypeRestoreRequest
6719	objectMap := make(map[string]interface{})
6720	if rr.ObjectType != "" {
6721		objectMap["objectType"] = rr.ObjectType
6722	}
6723	return json.Marshal(objectMap)
6724}
6725
6726// AsIaasVMRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest.
6727func (rr RestoreRequest) AsIaasVMRestoreRequest() (*IaasVMRestoreRequest, bool) {
6728	return nil, false
6729}
6730
6731// AsRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest.
6732func (rr RestoreRequest) AsRestoreRequest() (*RestoreRequest, bool) {
6733	return &rr, true
6734}
6735
6736// AsBasicRestoreRequest is the BasicRestoreRequest implementation for RestoreRequest.
6737func (rr RestoreRequest) AsBasicRestoreRequest() (BasicRestoreRequest, bool) {
6738	return &rr, true
6739}
6740
6741// RestoreRequestResource the base class for a restore request. Workload-specific restore requests are
6742// derived from this class.
6743type RestoreRequestResource struct {
6744	Properties BasicRestoreRequest `json:"properties,omitempty"`
6745	// ID - Resource ID represents the complete path to the resource.
6746	ID *string `json:"id,omitempty"`
6747	// Name - Resource name associated with the resource.
6748	Name *string `json:"name,omitempty"`
6749	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
6750	Type *string `json:"type,omitempty"`
6751	// Location - Resource location.
6752	Location *string `json:"location,omitempty"`
6753	// Tags - Resource tags.
6754	Tags map[string]*string `json:"tags"`
6755	// ETag - Optional ETag.
6756	ETag *string `json:"eTag,omitempty"`
6757}
6758
6759// MarshalJSON is the custom marshaler for RestoreRequestResource.
6760func (rrr RestoreRequestResource) MarshalJSON() ([]byte, error) {
6761	objectMap := make(map[string]interface{})
6762	objectMap["properties"] = rrr.Properties
6763	if rrr.ID != nil {
6764		objectMap["id"] = rrr.ID
6765	}
6766	if rrr.Name != nil {
6767		objectMap["name"] = rrr.Name
6768	}
6769	if rrr.Type != nil {
6770		objectMap["type"] = rrr.Type
6771	}
6772	if rrr.Location != nil {
6773		objectMap["location"] = rrr.Location
6774	}
6775	if rrr.Tags != nil {
6776		objectMap["tags"] = rrr.Tags
6777	}
6778	if rrr.ETag != nil {
6779		objectMap["eTag"] = rrr.ETag
6780	}
6781	return json.Marshal(objectMap)
6782}
6783
6784// UnmarshalJSON is the custom unmarshaler for RestoreRequestResource struct.
6785func (rrr *RestoreRequestResource) UnmarshalJSON(body []byte) error {
6786	var m map[string]*json.RawMessage
6787	err := json.Unmarshal(body, &m)
6788	if err != nil {
6789		return err
6790	}
6791	for k, v := range m {
6792		switch k {
6793		case "properties":
6794			if v != nil {
6795				properties, err := unmarshalBasicRestoreRequest(*v)
6796				if err != nil {
6797					return err
6798				}
6799				rrr.Properties = properties
6800			}
6801		case "id":
6802			if v != nil {
6803				var ID string
6804				err = json.Unmarshal(*v, &ID)
6805				if err != nil {
6806					return err
6807				}
6808				rrr.ID = &ID
6809			}
6810		case "name":
6811			if v != nil {
6812				var name string
6813				err = json.Unmarshal(*v, &name)
6814				if err != nil {
6815					return err
6816				}
6817				rrr.Name = &name
6818			}
6819		case "type":
6820			if v != nil {
6821				var typeVar string
6822				err = json.Unmarshal(*v, &typeVar)
6823				if err != nil {
6824					return err
6825				}
6826				rrr.Type = &typeVar
6827			}
6828		case "location":
6829			if v != nil {
6830				var location string
6831				err = json.Unmarshal(*v, &location)
6832				if err != nil {
6833					return err
6834				}
6835				rrr.Location = &location
6836			}
6837		case "tags":
6838			if v != nil {
6839				var tags map[string]*string
6840				err = json.Unmarshal(*v, &tags)
6841				if err != nil {
6842					return err
6843				}
6844				rrr.Tags = tags
6845			}
6846		case "eTag":
6847			if v != nil {
6848				var eTag string
6849				err = json.Unmarshal(*v, &eTag)
6850				if err != nil {
6851					return err
6852				}
6853				rrr.ETag = &eTag
6854			}
6855		}
6856	}
6857
6858	return nil
6859}
6860
6861// RetentionDuration retention duration.
6862type RetentionDuration struct {
6863	// Count - Count of the duration types. Retention duration is determined by the combining the Count times and durationType.
6864	//    For example, if Count = 3 and durationType = Weeks, then the retention duration is three weeks.
6865	Count *int32 `json:"count,omitempty"`
6866	// DurationType - The retention duration type of the retention policy. Possible values include: 'RetentionDurationTypeInvalid', 'RetentionDurationTypeDays', 'RetentionDurationTypeWeeks', 'RetentionDurationTypeMonths', 'RetentionDurationTypeYears'
6867	DurationType RetentionDurationType `json:"durationType,omitempty"`
6868}
6869
6870// BasicRetentionPolicy the base class for retention policy.
6871type BasicRetentionPolicy interface {
6872	AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool)
6873	AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool)
6874	AsRetentionPolicy() (*RetentionPolicy, bool)
6875}
6876
6877// RetentionPolicy the base class for retention policy.
6878type RetentionPolicy struct {
6879	// RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy'
6880	RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"`
6881}
6882
6883func unmarshalBasicRetentionPolicy(body []byte) (BasicRetentionPolicy, error) {
6884	var m map[string]interface{}
6885	err := json.Unmarshal(body, &m)
6886	if err != nil {
6887		return nil, err
6888	}
6889
6890	switch m["retentionPolicyType"] {
6891	case string(RetentionPolicyTypeSimpleRetentionPolicy):
6892		var srp SimpleRetentionPolicy
6893		err := json.Unmarshal(body, &srp)
6894		return srp, err
6895	case string(RetentionPolicyTypeLongTermRetentionPolicy):
6896		var ltrp LongTermRetentionPolicy
6897		err := json.Unmarshal(body, &ltrp)
6898		return ltrp, err
6899	default:
6900		var rp RetentionPolicy
6901		err := json.Unmarshal(body, &rp)
6902		return rp, err
6903	}
6904}
6905func unmarshalBasicRetentionPolicyArray(body []byte) ([]BasicRetentionPolicy, error) {
6906	var rawMessages []*json.RawMessage
6907	err := json.Unmarshal(body, &rawMessages)
6908	if err != nil {
6909		return nil, err
6910	}
6911
6912	rpArray := make([]BasicRetentionPolicy, len(rawMessages))
6913
6914	for index, rawMessage := range rawMessages {
6915		rp, err := unmarshalBasicRetentionPolicy(*rawMessage)
6916		if err != nil {
6917			return nil, err
6918		}
6919		rpArray[index] = rp
6920	}
6921	return rpArray, nil
6922}
6923
6924// MarshalJSON is the custom marshaler for RetentionPolicy.
6925func (rp RetentionPolicy) MarshalJSON() ([]byte, error) {
6926	rp.RetentionPolicyType = RetentionPolicyTypeRetentionPolicy
6927	objectMap := make(map[string]interface{})
6928	if rp.RetentionPolicyType != "" {
6929		objectMap["retentionPolicyType"] = rp.RetentionPolicyType
6930	}
6931	return json.Marshal(objectMap)
6932}
6933
6934// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy.
6935func (rp RetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) {
6936	return nil, false
6937}
6938
6939// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy.
6940func (rp RetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) {
6941	return nil, false
6942}
6943
6944// AsRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy.
6945func (rp RetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) {
6946	return &rp, true
6947}
6948
6949// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for RetentionPolicy.
6950func (rp RetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) {
6951	return &rp, true
6952}
6953
6954// BasicSchedulePolicy the base class for backup schedules.
6955type BasicSchedulePolicy interface {
6956	AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool)
6957	AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool)
6958	AsSchedulePolicy() (*SchedulePolicy, bool)
6959}
6960
6961// SchedulePolicy the base class for backup schedules.
6962type SchedulePolicy struct {
6963	// SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy'
6964	SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"`
6965}
6966
6967func unmarshalBasicSchedulePolicy(body []byte) (BasicSchedulePolicy, error) {
6968	var m map[string]interface{}
6969	err := json.Unmarshal(body, &m)
6970	if err != nil {
6971		return nil, err
6972	}
6973
6974	switch m["schedulePolicyType"] {
6975	case string(SchedulePolicyTypeLongTermSchedulePolicy):
6976		var ltsp LongTermSchedulePolicy
6977		err := json.Unmarshal(body, &ltsp)
6978		return ltsp, err
6979	case string(SchedulePolicyTypeSimpleSchedulePolicy):
6980		var ssp SimpleSchedulePolicy
6981		err := json.Unmarshal(body, &ssp)
6982		return ssp, err
6983	default:
6984		var sp SchedulePolicy
6985		err := json.Unmarshal(body, &sp)
6986		return sp, err
6987	}
6988}
6989func unmarshalBasicSchedulePolicyArray(body []byte) ([]BasicSchedulePolicy, error) {
6990	var rawMessages []*json.RawMessage
6991	err := json.Unmarshal(body, &rawMessages)
6992	if err != nil {
6993		return nil, err
6994	}
6995
6996	spArray := make([]BasicSchedulePolicy, len(rawMessages))
6997
6998	for index, rawMessage := range rawMessages {
6999		sp, err := unmarshalBasicSchedulePolicy(*rawMessage)
7000		if err != nil {
7001			return nil, err
7002		}
7003		spArray[index] = sp
7004	}
7005	return spArray, nil
7006}
7007
7008// MarshalJSON is the custom marshaler for SchedulePolicy.
7009func (sp SchedulePolicy) MarshalJSON() ([]byte, error) {
7010	sp.SchedulePolicyType = SchedulePolicyTypeSchedulePolicy
7011	objectMap := make(map[string]interface{})
7012	if sp.SchedulePolicyType != "" {
7013		objectMap["schedulePolicyType"] = sp.SchedulePolicyType
7014	}
7015	return json.Marshal(objectMap)
7016}
7017
7018// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy.
7019func (sp SchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) {
7020	return nil, false
7021}
7022
7023// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy.
7024func (sp SchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) {
7025	return nil, false
7026}
7027
7028// AsSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy.
7029func (sp SchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) {
7030	return &sp, true
7031}
7032
7033// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SchedulePolicy.
7034func (sp SchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) {
7035	return &sp, true
7036}
7037
7038// SimpleRetentionPolicy simple policy retention.
7039type SimpleRetentionPolicy struct {
7040	// RetentionDuration - Retention duration of the protection policy.
7041	RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"`
7042	// RetentionPolicyType - Possible values include: 'RetentionPolicyTypeRetentionPolicy', 'RetentionPolicyTypeSimpleRetentionPolicy', 'RetentionPolicyTypeLongTermRetentionPolicy'
7043	RetentionPolicyType RetentionPolicyType `json:"retentionPolicyType,omitempty"`
7044}
7045
7046// MarshalJSON is the custom marshaler for SimpleRetentionPolicy.
7047func (srp SimpleRetentionPolicy) MarshalJSON() ([]byte, error) {
7048	srp.RetentionPolicyType = RetentionPolicyTypeSimpleRetentionPolicy
7049	objectMap := make(map[string]interface{})
7050	if srp.RetentionDuration != nil {
7051		objectMap["retentionDuration"] = srp.RetentionDuration
7052	}
7053	if srp.RetentionPolicyType != "" {
7054		objectMap["retentionPolicyType"] = srp.RetentionPolicyType
7055	}
7056	return json.Marshal(objectMap)
7057}
7058
7059// AsSimpleRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy.
7060func (srp SimpleRetentionPolicy) AsSimpleRetentionPolicy() (*SimpleRetentionPolicy, bool) {
7061	return &srp, true
7062}
7063
7064// AsLongTermRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy.
7065func (srp SimpleRetentionPolicy) AsLongTermRetentionPolicy() (*LongTermRetentionPolicy, bool) {
7066	return nil, false
7067}
7068
7069// AsRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy.
7070func (srp SimpleRetentionPolicy) AsRetentionPolicy() (*RetentionPolicy, bool) {
7071	return nil, false
7072}
7073
7074// AsBasicRetentionPolicy is the BasicRetentionPolicy implementation for SimpleRetentionPolicy.
7075func (srp SimpleRetentionPolicy) AsBasicRetentionPolicy() (BasicRetentionPolicy, bool) {
7076	return &srp, true
7077}
7078
7079// SimpleSchedulePolicy simple policy schedule.
7080type SimpleSchedulePolicy struct {
7081	// ScheduleRunFrequency - Defines the frequency interval (daily or weekly) for the schedule policy. Possible values include: 'ScheduleRunTypeInvalid', 'ScheduleRunTypeDaily', 'ScheduleRunTypeWeekly'
7082	ScheduleRunFrequency ScheduleRunType `json:"scheduleRunFrequency,omitempty"`
7083	// ScheduleRunDays - This list is the days of the week when the schedule runs.
7084	ScheduleRunDays *[]DayOfWeek `json:"scheduleRunDays,omitempty"`
7085	// ScheduleRunTimes - List of times, during a day, when the schedule runs.
7086	ScheduleRunTimes *[]date.Time `json:"scheduleRunTimes,omitempty"`
7087	// ScheduleWeeklyFrequency - The number of times per week the schedule runs.
7088	ScheduleWeeklyFrequency *int32 `json:"scheduleWeeklyFrequency,omitempty"`
7089	// SchedulePolicyType - Possible values include: 'SchedulePolicyTypeSchedulePolicy', 'SchedulePolicyTypeLongTermSchedulePolicy', 'SchedulePolicyTypeSimpleSchedulePolicy'
7090	SchedulePolicyType SchedulePolicyType `json:"schedulePolicyType,omitempty"`
7091}
7092
7093// MarshalJSON is the custom marshaler for SimpleSchedulePolicy.
7094func (ssp SimpleSchedulePolicy) MarshalJSON() ([]byte, error) {
7095	ssp.SchedulePolicyType = SchedulePolicyTypeSimpleSchedulePolicy
7096	objectMap := make(map[string]interface{})
7097	if ssp.ScheduleRunFrequency != "" {
7098		objectMap["scheduleRunFrequency"] = ssp.ScheduleRunFrequency
7099	}
7100	if ssp.ScheduleRunDays != nil {
7101		objectMap["scheduleRunDays"] = ssp.ScheduleRunDays
7102	}
7103	if ssp.ScheduleRunTimes != nil {
7104		objectMap["scheduleRunTimes"] = ssp.ScheduleRunTimes
7105	}
7106	if ssp.ScheduleWeeklyFrequency != nil {
7107		objectMap["scheduleWeeklyFrequency"] = ssp.ScheduleWeeklyFrequency
7108	}
7109	if ssp.SchedulePolicyType != "" {
7110		objectMap["schedulePolicyType"] = ssp.SchedulePolicyType
7111	}
7112	return json.Marshal(objectMap)
7113}
7114
7115// AsLongTermSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy.
7116func (ssp SimpleSchedulePolicy) AsLongTermSchedulePolicy() (*LongTermSchedulePolicy, bool) {
7117	return nil, false
7118}
7119
7120// AsSimpleSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy.
7121func (ssp SimpleSchedulePolicy) AsSimpleSchedulePolicy() (*SimpleSchedulePolicy, bool) {
7122	return &ssp, true
7123}
7124
7125// AsSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy.
7126func (ssp SimpleSchedulePolicy) AsSchedulePolicy() (*SchedulePolicy, bool) {
7127	return nil, false
7128}
7129
7130// AsBasicSchedulePolicy is the BasicSchedulePolicy implementation for SimpleSchedulePolicy.
7131func (ssp SimpleSchedulePolicy) AsBasicSchedulePolicy() (BasicSchedulePolicy, bool) {
7132	return &ssp, true
7133}
7134
7135// WeeklyRetentionFormat weekly retention format.
7136type WeeklyRetentionFormat struct {
7137	// DaysOfTheWeek - List of days of the week.
7138	DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"`
7139	// WeeksOfTheMonth - List of weeks of the month.
7140	WeeksOfTheMonth *[]WeekOfMonth `json:"weeksOfTheMonth,omitempty"`
7141}
7142
7143// WeeklyRetentionSchedule weekly retention schedule.
7144type WeeklyRetentionSchedule struct {
7145	// DaysOfTheWeek - List of the days of the week for the weekly retention policy.
7146	DaysOfTheWeek *[]DayOfWeek `json:"daysOfTheWeek,omitempty"`
7147	// RetentionTimes - Retention times of the retention policy.
7148	RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"`
7149	// RetentionDuration - Retention duration of retention policy.
7150	RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"`
7151}
7152
7153// BasicWorkloadProtectableItem the base class for backup item. Workload-specific backup items are derived from this
7154// class.
7155type BasicWorkloadProtectableItem interface {
7156	AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool)
7157	AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool)
7158	AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool)
7159	AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool)
7160	AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool)
7161}
7162
7163// WorkloadProtectableItem the base class for backup item. Workload-specific backup items are derived from this
7164// class.
7165type WorkloadProtectableItem struct {
7166	// BackupManagementType - The backup management type.
7167	BackupManagementType *string `json:"backupManagementType,omitempty"`
7168	// FriendlyName - The friendly name of the backup item.
7169	FriendlyName *string `json:"friendlyName,omitempty"`
7170	// ProtectionState - The state of the back up item. Possible values include: 'ProtectionStatusInvalid', 'ProtectionStatusNotProtected', 'ProtectionStatusProtecting', 'ProtectionStatusProtected'
7171	ProtectionState ProtectionStatus `json:"protectionState,omitempty"`
7172	// ProtectableItemType - Possible values include: 'ProtectableItemTypeWorkloadProtectableItem', 'ProtectableItemTypeIaaSVMProtectableItem', 'ProtectableItemTypeMicrosoftComputevirtualMachines', 'ProtectableItemTypeMicrosoftClassicComputevirtualMachines'
7173	ProtectableItemType ProtectableItemType `json:"protectableItemType,omitempty"`
7174}
7175
7176func unmarshalBasicWorkloadProtectableItem(body []byte) (BasicWorkloadProtectableItem, error) {
7177	var m map[string]interface{}
7178	err := json.Unmarshal(body, &m)
7179	if err != nil {
7180		return nil, err
7181	}
7182
7183	switch m["protectableItemType"] {
7184	case string(ProtectableItemTypeIaaSVMProtectableItem):
7185		var ispi IaaSVMProtectableItem
7186		err := json.Unmarshal(body, &ispi)
7187		return ispi, err
7188	case string(ProtectableItemTypeMicrosoftComputevirtualMachines):
7189		var aiscvpi AzureIaaSComputeVMProtectableItem
7190		err := json.Unmarshal(body, &aiscvpi)
7191		return aiscvpi, err
7192	case string(ProtectableItemTypeMicrosoftClassicComputevirtualMachines):
7193		var aisccvpi AzureIaaSClassicComputeVMProtectableItem
7194		err := json.Unmarshal(body, &aisccvpi)
7195		return aisccvpi, err
7196	default:
7197		var wpi WorkloadProtectableItem
7198		err := json.Unmarshal(body, &wpi)
7199		return wpi, err
7200	}
7201}
7202func unmarshalBasicWorkloadProtectableItemArray(body []byte) ([]BasicWorkloadProtectableItem, error) {
7203	var rawMessages []*json.RawMessage
7204	err := json.Unmarshal(body, &rawMessages)
7205	if err != nil {
7206		return nil, err
7207	}
7208
7209	wpiArray := make([]BasicWorkloadProtectableItem, len(rawMessages))
7210
7211	for index, rawMessage := range rawMessages {
7212		wpi, err := unmarshalBasicWorkloadProtectableItem(*rawMessage)
7213		if err != nil {
7214			return nil, err
7215		}
7216		wpiArray[index] = wpi
7217	}
7218	return wpiArray, nil
7219}
7220
7221// MarshalJSON is the custom marshaler for WorkloadProtectableItem.
7222func (wpi WorkloadProtectableItem) MarshalJSON() ([]byte, error) {
7223	wpi.ProtectableItemType = ProtectableItemTypeWorkloadProtectableItem
7224	objectMap := make(map[string]interface{})
7225	if wpi.BackupManagementType != nil {
7226		objectMap["backupManagementType"] = wpi.BackupManagementType
7227	}
7228	if wpi.FriendlyName != nil {
7229		objectMap["friendlyName"] = wpi.FriendlyName
7230	}
7231	if wpi.ProtectionState != "" {
7232		objectMap["protectionState"] = wpi.ProtectionState
7233	}
7234	if wpi.ProtectableItemType != "" {
7235		objectMap["protectableItemType"] = wpi.ProtectableItemType
7236	}
7237	return json.Marshal(objectMap)
7238}
7239
7240// AsIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem.
7241func (wpi WorkloadProtectableItem) AsIaaSVMProtectableItem() (*IaaSVMProtectableItem, bool) {
7242	return nil, false
7243}
7244
7245// AsBasicIaaSVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem.
7246func (wpi WorkloadProtectableItem) AsBasicIaaSVMProtectableItem() (BasicIaaSVMProtectableItem, bool) {
7247	return nil, false
7248}
7249
7250// AsAzureIaaSComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem.
7251func (wpi WorkloadProtectableItem) AsAzureIaaSComputeVMProtectableItem() (*AzureIaaSComputeVMProtectableItem, bool) {
7252	return nil, false
7253}
7254
7255// AsAzureIaaSClassicComputeVMProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem.
7256func (wpi WorkloadProtectableItem) AsAzureIaaSClassicComputeVMProtectableItem() (*AzureIaaSClassicComputeVMProtectableItem, bool) {
7257	return nil, false
7258}
7259
7260// AsWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem.
7261func (wpi WorkloadProtectableItem) AsWorkloadProtectableItem() (*WorkloadProtectableItem, bool) {
7262	return &wpi, true
7263}
7264
7265// AsBasicWorkloadProtectableItem is the BasicWorkloadProtectableItem implementation for WorkloadProtectableItem.
7266func (wpi WorkloadProtectableItem) AsBasicWorkloadProtectableItem() (BasicWorkloadProtectableItem, bool) {
7267	return &wpi, true
7268}
7269
7270// WorkloadProtectableItemResource the base class for the backup item. Workload-specific backup items are
7271// derived from this class.
7272type WorkloadProtectableItemResource struct {
7273	Properties BasicWorkloadProtectableItem `json:"properties,omitempty"`
7274	// ID - Resource ID represents the complete path to the resource.
7275	ID *string `json:"id,omitempty"`
7276	// Name - Resource name associated with the resource.
7277	Name *string `json:"name,omitempty"`
7278	// Type - Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
7279	Type *string `json:"type,omitempty"`
7280	// Location - Resource location.
7281	Location *string `json:"location,omitempty"`
7282	// Tags - Resource tags.
7283	Tags map[string]*string `json:"tags"`
7284	// ETag - Optional ETag.
7285	ETag *string `json:"eTag,omitempty"`
7286}
7287
7288// MarshalJSON is the custom marshaler for WorkloadProtectableItemResource.
7289func (wpir WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) {
7290	objectMap := make(map[string]interface{})
7291	objectMap["properties"] = wpir.Properties
7292	if wpir.ID != nil {
7293		objectMap["id"] = wpir.ID
7294	}
7295	if wpir.Name != nil {
7296		objectMap["name"] = wpir.Name
7297	}
7298	if wpir.Type != nil {
7299		objectMap["type"] = wpir.Type
7300	}
7301	if wpir.Location != nil {
7302		objectMap["location"] = wpir.Location
7303	}
7304	if wpir.Tags != nil {
7305		objectMap["tags"] = wpir.Tags
7306	}
7307	if wpir.ETag != nil {
7308		objectMap["eTag"] = wpir.ETag
7309	}
7310	return json.Marshal(objectMap)
7311}
7312
7313// UnmarshalJSON is the custom unmarshaler for WorkloadProtectableItemResource struct.
7314func (wpir *WorkloadProtectableItemResource) UnmarshalJSON(body []byte) error {
7315	var m map[string]*json.RawMessage
7316	err := json.Unmarshal(body, &m)
7317	if err != nil {
7318		return err
7319	}
7320	for k, v := range m {
7321		switch k {
7322		case "properties":
7323			if v != nil {
7324				properties, err := unmarshalBasicWorkloadProtectableItem(*v)
7325				if err != nil {
7326					return err
7327				}
7328				wpir.Properties = properties
7329			}
7330		case "id":
7331			if v != nil {
7332				var ID string
7333				err = json.Unmarshal(*v, &ID)
7334				if err != nil {
7335					return err
7336				}
7337				wpir.ID = &ID
7338			}
7339		case "name":
7340			if v != nil {
7341				var name string
7342				err = json.Unmarshal(*v, &name)
7343				if err != nil {
7344					return err
7345				}
7346				wpir.Name = &name
7347			}
7348		case "type":
7349			if v != nil {
7350				var typeVar string
7351				err = json.Unmarshal(*v, &typeVar)
7352				if err != nil {
7353					return err
7354				}
7355				wpir.Type = &typeVar
7356			}
7357		case "location":
7358			if v != nil {
7359				var location string
7360				err = json.Unmarshal(*v, &location)
7361				if err != nil {
7362					return err
7363				}
7364				wpir.Location = &location
7365			}
7366		case "tags":
7367			if v != nil {
7368				var tags map[string]*string
7369				err = json.Unmarshal(*v, &tags)
7370				if err != nil {
7371					return err
7372				}
7373				wpir.Tags = tags
7374			}
7375		case "eTag":
7376			if v != nil {
7377				var eTag string
7378				err = json.Unmarshal(*v, &eTag)
7379				if err != nil {
7380					return err
7381				}
7382				wpir.ETag = &eTag
7383			}
7384		}
7385	}
7386
7387	return nil
7388}
7389
7390// WorkloadProtectableItemResourceList the list of WorkloadProtectableItem resources.
7391type WorkloadProtectableItemResourceList struct {
7392	autorest.Response `json:"-"`
7393	// Value - List of resources.
7394	Value *[]WorkloadProtectableItemResource `json:"value,omitempty"`
7395	// NextLink - The URI to GET the next page of resources. Call ListNext() gets the next page of resources.
7396	NextLink *string `json:"nextLink,omitempty"`
7397}
7398
7399// WorkloadProtectableItemResourceListIterator provides access to a complete listing of
7400// WorkloadProtectableItemResource values.
7401type WorkloadProtectableItemResourceListIterator struct {
7402	i    int
7403	page WorkloadProtectableItemResourceListPage
7404}
7405
7406// NextWithContext advances to the next value.  If there was an error making
7407// the request the iterator does not advance and the error is returned.
7408func (iter *WorkloadProtectableItemResourceListIterator) NextWithContext(ctx context.Context) (err error) {
7409	if tracing.IsEnabled() {
7410		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListIterator.NextWithContext")
7411		defer func() {
7412			sc := -1
7413			if iter.Response().Response.Response != nil {
7414				sc = iter.Response().Response.Response.StatusCode
7415			}
7416			tracing.EndSpan(ctx, sc, err)
7417		}()
7418	}
7419	iter.i++
7420	if iter.i < len(iter.page.Values()) {
7421		return nil
7422	}
7423	err = iter.page.NextWithContext(ctx)
7424	if err != nil {
7425		iter.i--
7426		return err
7427	}
7428	iter.i = 0
7429	return nil
7430}
7431
7432// Next advances to the next value.  If there was an error making
7433// the request the iterator does not advance and the error is returned.
7434// Deprecated: Use NextWithContext() instead.
7435func (iter *WorkloadProtectableItemResourceListIterator) Next() error {
7436	return iter.NextWithContext(context.Background())
7437}
7438
7439// NotDone returns true if the enumeration should be started or is not yet complete.
7440func (iter WorkloadProtectableItemResourceListIterator) NotDone() bool {
7441	return iter.page.NotDone() && iter.i < len(iter.page.Values())
7442}
7443
7444// Response returns the raw server response from the last page request.
7445func (iter WorkloadProtectableItemResourceListIterator) Response() WorkloadProtectableItemResourceList {
7446	return iter.page.Response()
7447}
7448
7449// Value returns the current value or a zero-initialized value if the
7450// iterator has advanced beyond the end of the collection.
7451func (iter WorkloadProtectableItemResourceListIterator) Value() WorkloadProtectableItemResource {
7452	if !iter.page.NotDone() {
7453		return WorkloadProtectableItemResource{}
7454	}
7455	return iter.page.Values()[iter.i]
7456}
7457
7458// Creates a new instance of the WorkloadProtectableItemResourceListIterator type.
7459func NewWorkloadProtectableItemResourceListIterator(page WorkloadProtectableItemResourceListPage) WorkloadProtectableItemResourceListIterator {
7460	return WorkloadProtectableItemResourceListIterator{page: page}
7461}
7462
7463// IsEmpty returns true if the ListResult contains no values.
7464func (wpirl WorkloadProtectableItemResourceList) IsEmpty() bool {
7465	return wpirl.Value == nil || len(*wpirl.Value) == 0
7466}
7467
7468// workloadProtectableItemResourceListPreparer prepares a request to retrieve the next set of results.
7469// It returns nil if no more results exist.
7470func (wpirl WorkloadProtectableItemResourceList) workloadProtectableItemResourceListPreparer(ctx context.Context) (*http.Request, error) {
7471	if wpirl.NextLink == nil || len(to.String(wpirl.NextLink)) < 1 {
7472		return nil, nil
7473	}
7474	return autorest.Prepare((&http.Request{}).WithContext(ctx),
7475		autorest.AsJSON(),
7476		autorest.AsGet(),
7477		autorest.WithBaseURL(to.String(wpirl.NextLink)))
7478}
7479
7480// WorkloadProtectableItemResourceListPage contains a page of WorkloadProtectableItemResource values.
7481type WorkloadProtectableItemResourceListPage struct {
7482	fn    func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)
7483	wpirl WorkloadProtectableItemResourceList
7484}
7485
7486// NextWithContext advances to the next page of values.  If there was an error making
7487// the request the page does not advance and the error is returned.
7488func (page *WorkloadProtectableItemResourceListPage) NextWithContext(ctx context.Context) (err error) {
7489	if tracing.IsEnabled() {
7490		ctx = tracing.StartSpan(ctx, fqdn+"/WorkloadProtectableItemResourceListPage.NextWithContext")
7491		defer func() {
7492			sc := -1
7493			if page.Response().Response.Response != nil {
7494				sc = page.Response().Response.Response.StatusCode
7495			}
7496			tracing.EndSpan(ctx, sc, err)
7497		}()
7498	}
7499	next, err := page.fn(ctx, page.wpirl)
7500	if err != nil {
7501		return err
7502	}
7503	page.wpirl = next
7504	return nil
7505}
7506
7507// Next advances to the next page of values.  If there was an error making
7508// the request the page does not advance and the error is returned.
7509// Deprecated: Use NextWithContext() instead.
7510func (page *WorkloadProtectableItemResourceListPage) Next() error {
7511	return page.NextWithContext(context.Background())
7512}
7513
7514// NotDone returns true if the page enumeration should be started or is not yet complete.
7515func (page WorkloadProtectableItemResourceListPage) NotDone() bool {
7516	return !page.wpirl.IsEmpty()
7517}
7518
7519// Response returns the raw server response from the last page request.
7520func (page WorkloadProtectableItemResourceListPage) Response() WorkloadProtectableItemResourceList {
7521	return page.wpirl
7522}
7523
7524// Values returns the slice of values for the current page or nil if there are no values.
7525func (page WorkloadProtectableItemResourceListPage) Values() []WorkloadProtectableItemResource {
7526	if page.wpirl.IsEmpty() {
7527		return nil
7528	}
7529	return *page.wpirl.Value
7530}
7531
7532// Creates a new instance of the WorkloadProtectableItemResourceListPage type.
7533func NewWorkloadProtectableItemResourceListPage(getNextPage func(context.Context, WorkloadProtectableItemResourceList) (WorkloadProtectableItemResourceList, error)) WorkloadProtectableItemResourceListPage {
7534	return WorkloadProtectableItemResourceListPage{fn: getNextPage}
7535}
7536
7537// YearlyRetentionSchedule yearly retention schedule.
7538type YearlyRetentionSchedule struct {
7539	// RetentionScheduleFormatType - Retention schedule format for the yearly retention policy. Possible values include: 'RetentionScheduleFormatInvalid', 'RetentionScheduleFormatDaily', 'RetentionScheduleFormatWeekly'
7540	RetentionScheduleFormatType RetentionScheduleFormat `json:"retentionScheduleFormatType,omitempty"`
7541	// MonthsOfYear - List of the months of year for the yearly retention policy.
7542	MonthsOfYear *[]MonthOfYear `json:"monthsOfYear,omitempty"`
7543	// RetentionScheduleDaily - Daily retention format for the yearly retention policy.
7544	RetentionScheduleDaily *DailyRetentionFormat `json:"retentionScheduleDaily,omitempty"`
7545	// RetentionScheduleWeekly - Weekly retention format for the yearly retention policy.
7546	RetentionScheduleWeekly *WeeklyRetentionFormat `json:"retentionScheduleWeekly,omitempty"`
7547	// RetentionTimes - Retention times for the retention policy.
7548	RetentionTimes *[]date.Time `json:"retentionTimes,omitempty"`
7549	// RetentionDuration - Retention duration for the retention policy.
7550	RetentionDuration *RetentionDuration `json:"retentionDuration,omitempty"`
7551}
7552