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