diff --git a/profiles/latest/recoveryservices/mgmt/backup/models.go b/profiles/latest/recoveryservices/mgmt/backup/models.go index 4299cfd85ab0..68d059cbe616 100644 --- a/profiles/latest/recoveryservices/mgmt/backup/models.go +++ b/profiles/latest/recoveryservices/mgmt/backup/models.go @@ -241,6 +241,14 @@ const ( InquiryStatusSuccess InquiryStatus = original.InquiryStatusSuccess ) +type IntentItemType = original.IntentItemType + +const ( + IntentItemTypeInvalid IntentItemType = original.IntentItemTypeInvalid + IntentItemTypeSQLAvailabilityGroupContainer IntentItemType = original.IntentItemTypeSQLAvailabilityGroupContainer + IntentItemTypeSQLInstance IntentItemType = original.IntentItemTypeSQLInstance +) + type ItemType = original.ItemType const ( @@ -463,6 +471,16 @@ const ( OverwriteOptionsOverwrite OverwriteOptions = original.OverwriteOptionsOverwrite ) +type PolicyType = original.PolicyType + +const ( + PolicyTypeCopyOnlyFull PolicyType = original.PolicyTypeCopyOnlyFull + PolicyTypeDifferential PolicyType = original.PolicyTypeDifferential + PolicyTypeFull PolicyType = original.PolicyTypeFull + PolicyTypeInvalid PolicyType = original.PolicyTypeInvalid + PolicyTypeLog PolicyType = original.PolicyTypeLog +) + type ProtectableContainerType = original.ProtectableContainerType const ( @@ -993,7 +1011,11 @@ type ProtectionContainerResourceListIterator = original.ProtectionContainerResou type ProtectionContainerResourceListPage = original.ProtectionContainerResourceListPage type BasicProtectionIntent = original.BasicProtectionIntent type ProtectionIntent = original.ProtectionIntent +type ProtectionIntentQueryObject = original.ProtectionIntentQueryObject type ProtectionIntentResource = original.ProtectionIntentResource +type ProtectionIntentResourceList = original.ProtectionIntentResourceList +type ProtectionIntentResourceListIterator = original.ProtectionIntentResourceListIterator +type ProtectionIntentResourceListPage = original.ProtectionIntentResourceListPage type BasicProtectionPolicy = original.BasicProtectionPolicy type ProtectionPolicy = original.ProtectionPolicy type ProtectionPolicyQueryObject = original.ProtectionPolicyQueryObject @@ -1076,6 +1098,7 @@ type ProtectionContainerRefreshOperationResultsClient = original.ProtectionConta type ProtectionContainersClient = original.ProtectionContainersClient type ProtectionContainersGroupClient = original.ProtectionContainersGroupClient type ProtectionIntentClient = original.ProtectionIntentClient +type ProtectionIntentGroupClient = original.ProtectionIntentGroupClient type ProtectionPoliciesClient = original.ProtectionPoliciesClient type ProtectionPolicyOperationResultsClient = original.ProtectionPolicyOperationResultsClient type ProtectionPolicyOperationStatusesClient = original.ProtectionPolicyOperationStatusesClient @@ -1199,6 +1222,9 @@ func PossibleHTTPStatusCodeValues() []HTTPStatusCode { func PossibleInquiryStatusValues() []InquiryStatus { return original.PossibleInquiryStatusValues() } +func PossibleIntentItemTypeValues() []IntentItemType { + return original.PossibleIntentItemTypeValues() +} func PossibleItemTypeValues() []ItemType { return original.PossibleItemTypeValues() } @@ -1256,6 +1282,9 @@ func PossibleOperationStatusValuesValues() []OperationStatusValues { func PossibleOverwriteOptionsValues() []OverwriteOptions { return original.PossibleOverwriteOptionsValues() } +func PossiblePolicyTypeValues() []PolicyType { + return original.PossiblePolicyTypeValues() +} func PossibleProtectableContainerTypeValues() []ProtectableContainerType { return original.PossibleProtectableContainerTypeValues() } @@ -1445,6 +1474,12 @@ func NewProtectionIntentClient(subscriptionID string) ProtectionIntentClient { func NewProtectionIntentClientWithBaseURI(baseURI string, subscriptionID string) ProtectionIntentClient { return original.NewProtectionIntentClientWithBaseURI(baseURI, subscriptionID) } +func NewProtectionIntentGroupClient(subscriptionID string) ProtectionIntentGroupClient { + return original.NewProtectionIntentGroupClient(subscriptionID) +} +func NewProtectionIntentGroupClientWithBaseURI(baseURI string, subscriptionID string) ProtectionIntentGroupClient { + return original.NewProtectionIntentGroupClientWithBaseURI(baseURI, subscriptionID) +} func NewProtectionPoliciesClient(subscriptionID string) ProtectionPoliciesClient { return original.NewProtectionPoliciesClient(subscriptionID) } diff --git a/profiles/preview/recoveryservices/mgmt/backup/models.go b/profiles/preview/recoveryservices/mgmt/backup/models.go index 8d173f3c0e95..4fca158a6489 100644 --- a/profiles/preview/recoveryservices/mgmt/backup/models.go +++ b/profiles/preview/recoveryservices/mgmt/backup/models.go @@ -241,6 +241,14 @@ const ( InquiryStatusSuccess InquiryStatus = original.InquiryStatusSuccess ) +type IntentItemType = original.IntentItemType + +const ( + IntentItemTypeInvalid IntentItemType = original.IntentItemTypeInvalid + IntentItemTypeSQLAvailabilityGroupContainer IntentItemType = original.IntentItemTypeSQLAvailabilityGroupContainer + IntentItemTypeSQLInstance IntentItemType = original.IntentItemTypeSQLInstance +) + type ItemType = original.ItemType const ( @@ -463,6 +471,16 @@ const ( OverwriteOptionsOverwrite OverwriteOptions = original.OverwriteOptionsOverwrite ) +type PolicyType = original.PolicyType + +const ( + PolicyTypeCopyOnlyFull PolicyType = original.PolicyTypeCopyOnlyFull + PolicyTypeDifferential PolicyType = original.PolicyTypeDifferential + PolicyTypeFull PolicyType = original.PolicyTypeFull + PolicyTypeInvalid PolicyType = original.PolicyTypeInvalid + PolicyTypeLog PolicyType = original.PolicyTypeLog +) + type ProtectableContainerType = original.ProtectableContainerType const ( @@ -993,7 +1011,11 @@ type ProtectionContainerResourceListIterator = original.ProtectionContainerResou type ProtectionContainerResourceListPage = original.ProtectionContainerResourceListPage type BasicProtectionIntent = original.BasicProtectionIntent type ProtectionIntent = original.ProtectionIntent +type ProtectionIntentQueryObject = original.ProtectionIntentQueryObject type ProtectionIntentResource = original.ProtectionIntentResource +type ProtectionIntentResourceList = original.ProtectionIntentResourceList +type ProtectionIntentResourceListIterator = original.ProtectionIntentResourceListIterator +type ProtectionIntentResourceListPage = original.ProtectionIntentResourceListPage type BasicProtectionPolicy = original.BasicProtectionPolicy type ProtectionPolicy = original.ProtectionPolicy type ProtectionPolicyQueryObject = original.ProtectionPolicyQueryObject @@ -1076,6 +1098,7 @@ type ProtectionContainerRefreshOperationResultsClient = original.ProtectionConta type ProtectionContainersClient = original.ProtectionContainersClient type ProtectionContainersGroupClient = original.ProtectionContainersGroupClient type ProtectionIntentClient = original.ProtectionIntentClient +type ProtectionIntentGroupClient = original.ProtectionIntentGroupClient type ProtectionPoliciesClient = original.ProtectionPoliciesClient type ProtectionPolicyOperationResultsClient = original.ProtectionPolicyOperationResultsClient type ProtectionPolicyOperationStatusesClient = original.ProtectionPolicyOperationStatusesClient @@ -1199,6 +1222,9 @@ func PossibleHTTPStatusCodeValues() []HTTPStatusCode { func PossibleInquiryStatusValues() []InquiryStatus { return original.PossibleInquiryStatusValues() } +func PossibleIntentItemTypeValues() []IntentItemType { + return original.PossibleIntentItemTypeValues() +} func PossibleItemTypeValues() []ItemType { return original.PossibleItemTypeValues() } @@ -1256,6 +1282,9 @@ func PossibleOperationStatusValuesValues() []OperationStatusValues { func PossibleOverwriteOptionsValues() []OverwriteOptions { return original.PossibleOverwriteOptionsValues() } +func PossiblePolicyTypeValues() []PolicyType { + return original.PossiblePolicyTypeValues() +} func PossibleProtectableContainerTypeValues() []ProtectableContainerType { return original.PossibleProtectableContainerTypeValues() } @@ -1445,6 +1474,12 @@ func NewProtectionIntentClient(subscriptionID string) ProtectionIntentClient { func NewProtectionIntentClientWithBaseURI(baseURI string, subscriptionID string) ProtectionIntentClient { return original.NewProtectionIntentClientWithBaseURI(baseURI, subscriptionID) } +func NewProtectionIntentGroupClient(subscriptionID string) ProtectionIntentGroupClient { + return original.NewProtectionIntentGroupClient(subscriptionID) +} +func NewProtectionIntentGroupClientWithBaseURI(baseURI string, subscriptionID string) ProtectionIntentGroupClient { + return original.NewProtectionIntentGroupClientWithBaseURI(baseURI, subscriptionID) +} func NewProtectionPoliciesClient(subscriptionID string) ProtectionPoliciesClient { return original.NewProtectionPoliciesClient(subscriptionID) } diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/models.go b/services/recoveryservices/mgmt/2016-12-01/backup/models.go index 38fbaf7e27df..6094ee4692fb 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/models.go +++ b/services/recoveryservices/mgmt/2016-12-01/backup/models.go @@ -589,6 +589,27 @@ func PossibleOverwriteOptionsValues() []OverwriteOptions { return []OverwriteOptions{OverwriteOptionsFailOnConflict, OverwriteOptionsInvalid, OverwriteOptionsOverwrite} } +// PolicyType enumerates the values for policy type. +type PolicyType string + +const ( + // PolicyTypeCopyOnlyFull ... + PolicyTypeCopyOnlyFull PolicyType = "CopyOnlyFull" + // PolicyTypeDifferential ... + PolicyTypeDifferential PolicyType = "Differential" + // PolicyTypeFull ... + PolicyTypeFull PolicyType = "Full" + // PolicyTypeInvalid ... + PolicyTypeInvalid PolicyType = "Invalid" + // PolicyTypeLog ... + PolicyTypeLog PolicyType = "Log" +) + +// PossiblePolicyTypeValues returns an array of possible values for the PolicyType const type. +func PossiblePolicyTypeValues() []PolicyType { + return []PolicyType{PolicyTypeCopyOnlyFull, PolicyTypeDifferential, PolicyTypeFull, PolicyTypeInvalid, PolicyTypeLog} +} + // ProtectableContainerType enumerates the values for protectable container type. type ProtectableContainerType string @@ -1596,6 +1617,8 @@ type AzureFileshareProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -1649,6 +1672,9 @@ func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { if afpi.CreateMode != "" { objectMap["createMode"] = afpi.CreateMode } + if afpi.VaultID != nil { + objectMap["vaultId"] = afpi.VaultID + } if afpi.ProtectedItemType != "" { objectMap["protectedItemType"] = afpi.ProtectedItemType } @@ -1742,8 +1768,8 @@ type AzureFileshareProtectedItemExtendedInfo struct { // AzureFileShareProtectionPolicy azureStorage backup policy. type AzureFileShareProtectionPolicy struct { - // WorkLoadType - Type of workload for the backup management - WorkLoadType *string `json:"workLoadType,omitempty"` + // WorkLoadType - Type of workload for the backup management. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkLoadType WorkloadType `json:"workLoadType,omitempty"` // SchedulePolicy - Backup schedule specified as part of backup policy. SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` // RetentionPolicy - Retention policy with the details on backup copy retention ranges. @@ -1760,7 +1786,7 @@ type AzureFileShareProtectionPolicy struct { func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { afspp.BackupManagementType = BackupManagementTypeAzureStorage objectMap := make(map[string]interface{}) - if afspp.WorkLoadType != nil { + if afspp.WorkLoadType != "" { objectMap["workLoadType"] = afspp.WorkLoadType } objectMap["schedulePolicy"] = afspp.SchedulePolicy @@ -1828,12 +1854,12 @@ func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { switch k { case "workLoadType": if v != nil { - var workLoadType string + var workLoadType WorkloadType err = json.Unmarshal(*v, &workLoadType) if err != nil { return err } - afspp.WorkLoadType = &workLoadType + afspp.WorkLoadType = workLoadType } case "schedulePolicy": if v != nil { @@ -2368,6 +2394,8 @@ type AzureIaaSClassicComputeVMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -2430,6 +2458,9 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, er if aisccvpi.CreateMode != "" { objectMap["createMode"] = aisccvpi.CreateMode } + if aisccvpi.VaultID != nil { + objectMap["vaultId"] = aisccvpi.VaultID + } if aisccvpi.ProtectedItemType != "" { objectMap["protectedItemType"] = aisccvpi.ProtectedItemType } @@ -2794,6 +2825,8 @@ type AzureIaaSComputeVMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -2856,6 +2889,9 @@ func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { if aiscvpi.CreateMode != "" { objectMap["createMode"] = aiscvpi.CreateMode } + if aiscvpi.VaultID != nil { + objectMap["vaultId"] = aiscvpi.VaultID + } if aiscvpi.ProtectedItemType != "" { objectMap["protectedItemType"] = aiscvpi.ProtectedItemType } @@ -2994,6 +3030,8 @@ type AzureIaaSVMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -3097,6 +3135,9 @@ func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { if aispi.CreateMode != "" { objectMap["createMode"] = aispi.CreateMode } + if aispi.VaultID != nil { + objectMap["vaultId"] = aispi.VaultID + } if aispi.ProtectedItemType != "" { objectMap["protectedItemType"] = aispi.ProtectedItemType } @@ -3608,6 +3649,8 @@ type AzureSQLProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -3649,6 +3692,9 @@ func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { if aspi.CreateMode != "" { objectMap["createMode"] = aspi.CreateMode } + if aspi.VaultID != nil { + objectMap["vaultId"] = aspi.VaultID + } if aspi.ProtectedItemType != "" { objectMap["protectedItemType"] = aspi.ProtectedItemType } @@ -4409,6 +4455,8 @@ type AzureVMWorkloadProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -4496,6 +4544,9 @@ func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { if avwpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable } + if avwpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwpi.IsAutoProtected + } if avwpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount } @@ -4641,6 +4692,8 @@ type AzureVMWorkloadProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -4746,6 +4799,9 @@ func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { if avwpi.CreateMode != "" { objectMap["createMode"] = avwpi.CreateMode } + if avwpi.VaultID != nil { + objectMap["vaultId"] = avwpi.VaultID + } if avwpi.ProtectedItemType != "" { objectMap["protectedItemType"] = avwpi.ProtectedItemType } @@ -4839,8 +4895,8 @@ type AzureVMWorkloadProtectedItemExtendedInfo struct { // AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. type AzureVMWorkloadProtectionPolicy struct { - // WorkLoadType - Type of workload for the backup management - WorkLoadType *string `json:"workLoadType,omitempty"` + // WorkLoadType - Type of workload for the backup management. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkLoadType WorkloadType `json:"workLoadType,omitempty"` // Settings - Common settings for the backup management Settings *Settings `json:"settings,omitempty"` // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention @@ -4855,7 +4911,7 @@ type AzureVMWorkloadProtectionPolicy struct { func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { avwpp.BackupManagementType = BackupManagementTypeAzureWorkload objectMap := make(map[string]interface{}) - if avwpp.WorkLoadType != nil { + if avwpp.WorkLoadType != "" { objectMap["workLoadType"] = avwpp.WorkLoadType } if avwpp.Settings != nil { @@ -4925,6 +4981,8 @@ type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -4959,6 +5017,9 @@ func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]b if avwshdpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable } + if avwshdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected + } if avwshdpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount } @@ -5099,6 +5160,8 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -5167,6 +5230,9 @@ func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byt if avwshdpi.CreateMode != "" { objectMap["createMode"] = avwshdpi.CreateMode } + if avwshdpi.VaultID != nil { + objectMap["vaultId"] = avwshdpi.VaultID + } if avwshdpi.ProtectedItemType != "" { objectMap["protectedItemType"] = avwshdpi.ProtectedItemType } @@ -5362,6 +5428,8 @@ type AzureVMWorkloadSAPHanaSystemProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -5396,6 +5464,9 @@ func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byt if avwshspi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable } + if avwshspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshspi.IsAutoProtected + } if avwshspi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount } @@ -5606,6 +5677,8 @@ type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -5640,6 +5713,9 @@ func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() if avwsagpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable } + if avwsagpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected + } if avwsagpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount } @@ -5748,6 +5824,8 @@ type AzureVMWorkloadSQLDatabaseProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -5782,6 +5860,9 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, if avwsdpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable } + if avwsdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected + } if avwsdpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount } @@ -5921,6 +6002,8 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -5989,6 +6072,9 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, er if avwsdpi.CreateMode != "" { objectMap["createMode"] = avwsdpi.CreateMode } + if avwsdpi.VaultID != nil { + objectMap["vaultId"] = avwsdpi.VaultID + } if avwsdpi.ProtectedItemType != "" { objectMap["protectedItemType"] = avwsdpi.ProtectedItemType } @@ -6182,6 +6268,8 @@ type AzureVMWorkloadSQLInstanceProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -6216,6 +6304,9 @@ func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, if avwsipi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable } + if avwsipi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsipi.IsAutoProtected + } if avwsipi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount } @@ -8387,6 +8478,8 @@ type DPMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -8434,6 +8527,9 @@ func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { if dpi.CreateMode != "" { objectMap["createMode"] = dpi.CreateMode } + if dpi.VaultID != nil { + objectMap["vaultId"] = dpi.VaultID + } if dpi.ProtectedItemType != "" { objectMap["protectedItemType"] = dpi.ProtectedItemType } @@ -9187,6 +9283,8 @@ type GenericProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -9237,6 +9335,9 @@ func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { if gpi.CreateMode != "" { objectMap["createMode"] = gpi.CreateMode } + if gpi.VaultID != nil { + objectMap["vaultId"] = gpi.VaultID + } if gpi.ProtectedItemType != "" { objectMap["protectedItemType"] = gpi.ProtectedItemType } @@ -10828,6 +10929,8 @@ type MabFileFolderProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -10881,6 +10984,9 @@ func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { if mffpi.CreateMode != "" { objectMap["createMode"] = mffpi.CreateMode } + if mffpi.VaultID != nil { + objectMap["vaultId"] = mffpi.VaultID + } if mffpi.ProtectedItemType != "" { objectMap["protectedItemType"] = mffpi.ProtectedItemType } @@ -11824,6 +11930,8 @@ type ProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -11933,6 +12041,9 @@ func (pi ProtectedItem) MarshalJSON() ([]byte, error) { if pi.CreateMode != "" { objectMap["createMode"] = pi.CreateMode } + if pi.VaultID != nil { + objectMap["vaultId"] = pi.VaultID + } if pi.ProtectedItemType != "" { objectMap["protectedItemType"] = pi.ProtectedItemType } @@ -14203,8 +14314,8 @@ type SQLDataDirectoryMapping struct { // SubProtectionPolicy sub-protection policy which includes schedule and retention type SubProtectionPolicy struct { - // PolicyType - Type of backup policy type - PolicyType *string `json:"policyType,omitempty"` + // PolicyType - Type of backup policy type. Possible values include: 'PolicyTypeInvalid', 'PolicyTypeFull', 'PolicyTypeDifferential', 'PolicyTypeLog', 'PolicyTypeCopyOnlyFull' + PolicyType PolicyType `json:"policyType,omitempty"` // SchedulePolicy - Backup schedule specified as part of backup policy. SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` // RetentionPolicy - Retention policy with the details on backup copy retention ranges. @@ -14222,12 +14333,12 @@ func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { switch k { case "policyType": if v != nil { - var policyType string + var policyType PolicyType err = json.Unmarshal(*v, &policyType) if err != nil { return err } - spp.PolicyType = &policyType + spp.PolicyType = policyType } case "schedulePolicy": if v != nil { diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go b/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go index 729cd477381d..4c1df7758583 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go +++ b/services/recoveryservices/mgmt/2016-12-01/backup/protectablecontainers.go @@ -39,7 +39,7 @@ func NewProtectableContainersClientWithBaseURI(baseURI string, subscriptionID st return ProtectableContainersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists the containers registered to Recovery Services Vault. +// List lists the containers that can be registered to Recovery Services Vault. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. diff --git a/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go b/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go index 3b0bba90791c..7d5b13369f7d 100644 --- a/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go +++ b/services/recoveryservices/mgmt/2016-12-01/backup/protectioncontainers.go @@ -110,7 +110,7 @@ func (client ProtectionContainersClient) GetResponder(resp *http.Response) (resu return } -// Inquire inquires all the protectable items that are protectable under the given container. +// Inquire this is an async operation and the results should be tracked using location header or Azure-async-url. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/models.go b/services/recoveryservices/mgmt/2017-07-01/backup/models.go index 5b80befdaa35..228a63e5bc75 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/models.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/models.go @@ -448,6 +448,23 @@ func PossibleInquiryStatusValues() []InquiryStatus { return []InquiryStatus{InquiryStatusFailed, InquiryStatusInvalid, InquiryStatusSuccess} } +// IntentItemType enumerates the values for intent item type. +type IntentItemType string + +const ( + // IntentItemTypeInvalid ... + IntentItemTypeInvalid IntentItemType = "Invalid" + // IntentItemTypeSQLAvailabilityGroupContainer ... + IntentItemTypeSQLAvailabilityGroupContainer IntentItemType = "SQLAvailabilityGroupContainer" + // IntentItemTypeSQLInstance ... + IntentItemTypeSQLInstance IntentItemType = "SQLInstance" +) + +// PossibleIntentItemTypeValues returns an array of possible values for the IntentItemType const type. +func PossibleIntentItemTypeValues() []IntentItemType { + return []IntentItemType{IntentItemTypeInvalid, IntentItemTypeSQLAvailabilityGroupContainer, IntentItemTypeSQLInstance} +} + // ItemType enumerates the values for item type. type ItemType string @@ -913,6 +930,27 @@ func PossibleOverwriteOptionsValues() []OverwriteOptions { return []OverwriteOptions{OverwriteOptionsFailOnConflict, OverwriteOptionsInvalid, OverwriteOptionsOverwrite} } +// PolicyType enumerates the values for policy type. +type PolicyType string + +const ( + // PolicyTypeCopyOnlyFull ... + PolicyTypeCopyOnlyFull PolicyType = "CopyOnlyFull" + // PolicyTypeDifferential ... + PolicyTypeDifferential PolicyType = "Differential" + // PolicyTypeFull ... + PolicyTypeFull PolicyType = "Full" + // PolicyTypeInvalid ... + PolicyTypeInvalid PolicyType = "Invalid" + // PolicyTypeLog ... + PolicyTypeLog PolicyType = "Log" +) + +// PossiblePolicyTypeValues returns an array of possible values for the PolicyType const type. +func PossiblePolicyTypeValues() []PolicyType { + return []PolicyType{PolicyTypeCopyOnlyFull, PolicyTypeDifferential, PolicyTypeFull, PolicyTypeInvalid, PolicyTypeLog} +} + // ProtectableContainerType enumerates the values for protectable container type. type ProtectableContainerType string @@ -2055,6 +2093,8 @@ type AzureFileshareProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -2108,6 +2148,9 @@ func (afpi AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { if afpi.CreateMode != "" { objectMap["createMode"] = afpi.CreateMode } + if afpi.VaultID != nil { + objectMap["vaultId"] = afpi.VaultID + } if afpi.ProtectedItemType != "" { objectMap["protectedItemType"] = afpi.ProtectedItemType } @@ -2201,8 +2244,8 @@ type AzureFileshareProtectedItemExtendedInfo struct { // AzureFileShareProtectionPolicy azureStorage backup policy. type AzureFileShareProtectionPolicy struct { - // WorkLoadType - Type of workload for the backup management - WorkLoadType *string `json:"workLoadType,omitempty"` + // WorkLoadType - Type of workload for the backup management. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkLoadType WorkloadType `json:"workLoadType,omitempty"` // SchedulePolicy - Backup schedule specified as part of backup policy. SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` // RetentionPolicy - Retention policy with the details on backup copy retention ranges. @@ -2219,7 +2262,7 @@ type AzureFileShareProtectionPolicy struct { func (afspp AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { afspp.BackupManagementType = BackupManagementTypeAzureStorage objectMap := make(map[string]interface{}) - if afspp.WorkLoadType != nil { + if afspp.WorkLoadType != "" { objectMap["workLoadType"] = afspp.WorkLoadType } objectMap["schedulePolicy"] = afspp.SchedulePolicy @@ -2287,12 +2330,12 @@ func (afspp *AzureFileShareProtectionPolicy) UnmarshalJSON(body []byte) error { switch k { case "workLoadType": if v != nil { - var workLoadType string + var workLoadType WorkloadType err = json.Unmarshal(*v, &workLoadType) if err != nil { return err } - afspp.WorkLoadType = &workLoadType + afspp.WorkLoadType = workLoadType } case "schedulePolicy": if v != nil { @@ -2827,6 +2870,8 @@ type AzureIaaSClassicComputeVMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -2889,6 +2934,9 @@ func (aisccvpi AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, er if aisccvpi.CreateMode != "" { objectMap["createMode"] = aisccvpi.CreateMode } + if aisccvpi.VaultID != nil { + objectMap["vaultId"] = aisccvpi.VaultID + } if aisccvpi.ProtectedItemType != "" { objectMap["protectedItemType"] = aisccvpi.ProtectedItemType } @@ -3253,6 +3301,8 @@ type AzureIaaSComputeVMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -3315,6 +3365,9 @@ func (aiscvpi AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { if aiscvpi.CreateMode != "" { objectMap["createMode"] = aiscvpi.CreateMode } + if aiscvpi.VaultID != nil { + objectMap["vaultId"] = aiscvpi.VaultID + } if aiscvpi.ProtectedItemType != "" { objectMap["protectedItemType"] = aiscvpi.ProtectedItemType } @@ -3637,6 +3690,8 @@ type AzureIaaSVMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -3740,6 +3795,9 @@ func (aispi AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { if aispi.CreateMode != "" { objectMap["createMode"] = aispi.CreateMode } + if aispi.VaultID != nil { + objectMap["vaultId"] = aispi.VaultID + } if aispi.ProtectedItemType != "" { objectMap["protectedItemType"] = aispi.ProtectedItemType } @@ -4467,6 +4525,8 @@ type AzureSQLProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -4508,6 +4568,9 @@ func (aspi AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { if aspi.CreateMode != "" { objectMap["createMode"] = aspi.CreateMode } + if aspi.VaultID != nil { + objectMap["vaultId"] = aspi.VaultID + } if aspi.ProtectedItemType != "" { objectMap["protectedItemType"] = aspi.ProtectedItemType } @@ -5480,6 +5543,8 @@ type AzureVMWorkloadProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -5567,6 +5632,9 @@ func (avwpi AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { if avwpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwpi.IsAutoProtectable } + if avwpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwpi.IsAutoProtected + } if avwpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwpi.Subinquireditemcount } @@ -5712,6 +5780,8 @@ type AzureVMWorkloadProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -5817,6 +5887,9 @@ func (avwpi AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { if avwpi.CreateMode != "" { objectMap["createMode"] = avwpi.CreateMode } + if avwpi.VaultID != nil { + objectMap["vaultId"] = avwpi.VaultID + } if avwpi.ProtectedItemType != "" { objectMap["protectedItemType"] = avwpi.ProtectedItemType } @@ -5910,8 +5983,8 @@ type AzureVMWorkloadProtectedItemExtendedInfo struct { // AzureVMWorkloadProtectionPolicy azure VM (Mercury) workload-specific backup policy. type AzureVMWorkloadProtectionPolicy struct { - // WorkLoadType - Type of workload for the backup management - WorkLoadType *string `json:"workLoadType,omitempty"` + // WorkLoadType - Type of workload for the backup management. Possible values include: 'WorkloadTypeInvalid', 'WorkloadTypeVM', 'WorkloadTypeFileFolder', 'WorkloadTypeAzureSQLDb', 'WorkloadTypeSQLDB', 'WorkloadTypeExchange', 'WorkloadTypeSharepoint', 'WorkloadTypeVMwareVM', 'WorkloadTypeSystemState', 'WorkloadTypeClient', 'WorkloadTypeGenericDataSource', 'WorkloadTypeSQLDataBase', 'WorkloadTypeAzureFileShare', 'WorkloadTypeSAPHanaDatabase' + WorkLoadType WorkloadType `json:"workLoadType,omitempty"` // Settings - Common settings for the backup management Settings *Settings `json:"settings,omitempty"` // SubProtectionPolicy - List of sub-protection policies which includes schedule and retention @@ -5926,7 +5999,7 @@ type AzureVMWorkloadProtectionPolicy struct { func (avwpp AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { avwpp.BackupManagementType = BackupManagementTypeAzureWorkload objectMap := make(map[string]interface{}) - if avwpp.WorkLoadType != nil { + if avwpp.WorkLoadType != "" { objectMap["workLoadType"] = avwpp.WorkLoadType } if avwpp.Settings != nil { @@ -5996,6 +6069,8 @@ type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -6030,6 +6105,9 @@ func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]b if avwshdpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwshdpi.IsAutoProtectable } + if avwshdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshdpi.IsAutoProtected + } if avwshdpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwshdpi.Subinquireditemcount } @@ -6170,6 +6248,8 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -6238,6 +6318,9 @@ func (avwshdpi AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byt if avwshdpi.CreateMode != "" { objectMap["createMode"] = avwshdpi.CreateMode } + if avwshdpi.VaultID != nil { + objectMap["vaultId"] = avwshdpi.VaultID + } if avwshdpi.ProtectedItemType != "" { objectMap["protectedItemType"] = avwshdpi.ProtectedItemType } @@ -6433,6 +6516,8 @@ type AzureVMWorkloadSAPHanaSystemProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -6467,6 +6552,9 @@ func (avwshspi AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byt if avwshspi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwshspi.IsAutoProtectable } + if avwshspi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwshspi.IsAutoProtected + } if avwshspi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwshspi.Subinquireditemcount } @@ -6677,6 +6765,8 @@ type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -6711,6 +6801,9 @@ func (avwsagpi AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() if avwsagpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwsagpi.IsAutoProtectable } + if avwsagpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsagpi.IsAutoProtected + } if avwsagpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwsagpi.Subinquireditemcount } @@ -6819,6 +6912,8 @@ type AzureVMWorkloadSQLDatabaseProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -6853,6 +6948,9 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, if avwsdpi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwsdpi.IsAutoProtectable } + if avwsdpi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsdpi.IsAutoProtected + } if avwsdpi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwsdpi.Subinquireditemcount } @@ -6992,6 +7090,8 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -7060,6 +7160,9 @@ func (avwsdpi AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, er if avwsdpi.CreateMode != "" { objectMap["createMode"] = avwsdpi.CreateMode } + if avwsdpi.VaultID != nil { + objectMap["vaultId"] = avwsdpi.VaultID + } if avwsdpi.ProtectedItemType != "" { objectMap["protectedItemType"] = avwsdpi.ProtectedItemType } @@ -7253,6 +7356,8 @@ type AzureVMWorkloadSQLInstanceProtectableItem struct { ServerName *string `json:"serverName,omitempty"` // IsAutoProtectable - Indicates if protectable item is auto-protectable IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + // IsAutoProtected - Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` // Subinquireditemcount - For instance or AG, indicates number of DB's present Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` // Subprotectableitemcount - For instance or AG, indicates number of DB's to be protected @@ -7287,6 +7392,9 @@ func (avwsipi AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, if avwsipi.IsAutoProtectable != nil { objectMap["isAutoProtectable"] = avwsipi.IsAutoProtectable } + if avwsipi.IsAutoProtected != nil { + objectMap["isAutoProtected"] = avwsipi.IsAutoProtected + } if avwsipi.Subinquireditemcount != nil { objectMap["subinquireditemcount"] = avwsipi.Subinquireditemcount } @@ -10155,6 +10263,8 @@ type DPMProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -10202,6 +10312,9 @@ func (dpi DPMProtectedItem) MarshalJSON() ([]byte, error) { if dpi.CreateMode != "" { objectMap["createMode"] = dpi.CreateMode } + if dpi.VaultID != nil { + objectMap["vaultId"] = dpi.VaultID + } if dpi.ProtectedItemType != "" { objectMap["protectedItemType"] = dpi.ProtectedItemType } @@ -11085,6 +11198,8 @@ type GenericProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -11135,6 +11250,9 @@ func (gpi GenericProtectedItem) MarshalJSON() ([]byte, error) { if gpi.CreateMode != "" { objectMap["createMode"] = gpi.CreateMode } + if gpi.VaultID != nil { + objectMap["vaultId"] = gpi.VaultID + } if gpi.ProtectedItemType != "" { objectMap["protectedItemType"] = gpi.ProtectedItemType } @@ -13122,6 +13240,8 @@ type MabFileFolderProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -13175,6 +13295,9 @@ func (mffpi MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { if mffpi.CreateMode != "" { objectMap["createMode"] = mffpi.CreateMode } + if mffpi.VaultID != nil { + objectMap["vaultId"] = mffpi.VaultID + } if mffpi.ProtectedItemType != "" { objectMap["protectedItemType"] = mffpi.ProtectedItemType } @@ -14554,6 +14677,8 @@ type ProtectedItem struct { BackupSetName *string `json:"backupSetName,omitempty"` // CreateMode - Create mode to indicate recovery of existing soft deleted data source or creation of new data source. Possible values include: 'CreateModeInvalid', 'CreateModeDefault', 'CreateModeRecover' CreateMode CreateMode `json:"createMode,omitempty"` + // VaultID - ID of the vault which protects this item + VaultID *string `json:"vaultId,omitempty"` // ProtectedItemType - Possible values include: 'ProtectedItemTypeProtectedItem', 'ProtectedItemTypeAzureFileShareProtectedItem', 'ProtectedItemTypeMicrosoftClassicComputevirtualMachines', 'ProtectedItemTypeMicrosoftComputevirtualMachines', 'ProtectedItemTypeAzureIaaSVMProtectedItem', 'ProtectedItemTypeMicrosoftSqlserversdatabases', 'ProtectedItemTypeAzureVMWorkloadProtectedItem', 'ProtectedItemTypeAzureVMWorkloadSAPHanaDatabase', 'ProtectedItemTypeAzureVMWorkloadSQLDatabase', 'ProtectedItemTypeDPMProtectedItem', 'ProtectedItemTypeGenericProtectedItem', 'ProtectedItemTypeMabFileFolderProtectedItem' ProtectedItemType ProtectedItemType `json:"protectedItemType,omitempty"` } @@ -14663,6 +14788,9 @@ func (pi ProtectedItem) MarshalJSON() ([]byte, error) { if pi.CreateMode != "" { objectMap["createMode"] = pi.CreateMode } + if pi.VaultID != nil { + objectMap["vaultId"] = pi.VaultID + } if pi.ProtectedItemType != "" { objectMap["protectedItemType"] = pi.ProtectedItemType } @@ -15573,6 +15701,18 @@ func (pi ProtectionIntent) AsBasicProtectionIntent() (BasicProtectionIntent, boo return &pi, true } +// ProtectionIntentQueryObject filters to list protection intent. +type ProtectionIntentQueryObject struct { + // BackupManagementType - Backup management type for the backed up item. Possible values include: 'ManagementTypeInvalid', 'ManagementTypeAzureIaasVM', 'ManagementTypeMAB', 'ManagementTypeDPM', 'ManagementTypeAzureBackupServer', 'ManagementTypeAzureSQL', 'ManagementTypeAzureStorage', 'ManagementTypeAzureWorkload', 'ManagementTypeDefaultBackup' + BackupManagementType ManagementType `json:"backupManagementType,omitempty"` + // ItemType - Type of workload this item represents. Possible values include: 'IntentItemTypeInvalid', 'IntentItemTypeSQLInstance', 'IntentItemTypeSQLAvailabilityGroupContainer' + ItemType IntentItemType `json:"itemType,omitempty"` + // ParentName - Parent name of the intent + ParentName *string `json:"parentName,omitempty"` + // ItemName - Item name of the intent + ItemName *string `json:"itemName,omitempty"` +} + // ProtectionIntentResource base class for backup ProtectionIntent. type ProtectionIntentResource struct { autorest.Response `json:"-"` @@ -15694,6 +15834,108 @@ func (pir *ProtectionIntentResource) UnmarshalJSON(body []byte) error { return nil } +// ProtectionIntentResourceList list of ProtectionIntent resources +type ProtectionIntentResourceList struct { + autorest.Response `json:"-"` + // Value - List of resources. + Value *[]ProtectionIntentResource `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of resources. Call ListNext() fetches next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProtectionIntentResourceListIterator provides access to a complete listing of ProtectionIntentResource values. +type ProtectionIntentResourceListIterator struct { + i int + page ProtectionIntentResourceListPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProtectionIntentResourceListIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProtectionIntentResourceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProtectionIntentResourceListIterator) Response() ProtectionIntentResourceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProtectionIntentResourceListIterator) Value() ProtectionIntentResource { + if !iter.page.NotDone() { + return ProtectionIntentResource{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (pirl ProtectionIntentResourceList) IsEmpty() bool { + return pirl.Value == nil || len(*pirl.Value) == 0 +} + +// protectionIntentResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pirl ProtectionIntentResourceList) protectionIntentResourceListPreparer() (*http.Request, error) { + if pirl.NextLink == nil || len(to.String(pirl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pirl.NextLink))) +} + +// ProtectionIntentResourceListPage contains a page of ProtectionIntentResource values. +type ProtectionIntentResourceListPage struct { + fn func(ProtectionIntentResourceList) (ProtectionIntentResourceList, error) + pirl ProtectionIntentResourceList +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProtectionIntentResourceListPage) Next() error { + next, err := page.fn(page.pirl) + if err != nil { + return err + } + page.pirl = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProtectionIntentResourceListPage) NotDone() bool { + return !page.pirl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProtectionIntentResourceListPage) Response() ProtectionIntentResourceList { + return page.pirl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProtectionIntentResourceListPage) Values() []ProtectionIntentResource { + if page.pirl.IsEmpty() { + return nil + } + return *page.pirl.Value +} + // BasicProtectionPolicy base class for backup policy. Workload-specific backup policies are derived from this class. type BasicProtectionPolicy interface { AsAzureFileShareProtectionPolicy() (*AzureFileShareProtectionPolicy, bool) @@ -17464,8 +17706,8 @@ type StatusResponse struct { // SubProtectionPolicy sub-protection policy which includes schedule and retention type SubProtectionPolicy struct { - // PolicyType - Type of backup policy type - PolicyType *string `json:"policyType,omitempty"` + // PolicyType - Type of backup policy type. Possible values include: 'PolicyTypeInvalid', 'PolicyTypeFull', 'PolicyTypeDifferential', 'PolicyTypeLog', 'PolicyTypeCopyOnlyFull' + PolicyType PolicyType `json:"policyType,omitempty"` // SchedulePolicy - Backup schedule specified as part of backup policy. SchedulePolicy BasicSchedulePolicy `json:"schedulePolicy,omitempty"` // RetentionPolicy - Retention policy with the details on backup copy retention ranges. @@ -17483,12 +17725,12 @@ func (spp *SubProtectionPolicy) UnmarshalJSON(body []byte) error { switch k { case "policyType": if v != nil { - var policyType string + var policyType PolicyType err = json.Unmarshal(*v, &policyType) if err != nil { return err } - spp.PolicyType = &policyType + spp.PolicyType = policyType } case "schedulePolicy": if v != nil { diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protectablecontainers.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectablecontainers.go index 729cd477381d..4c1df7758583 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protectablecontainers.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protectablecontainers.go @@ -39,7 +39,7 @@ func NewProtectableContainersClientWithBaseURI(baseURI string, subscriptionID st return ProtectableContainersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists the containers registered to Recovery Services Vault. +// List lists the containers that can be registered to Recovery Services Vault. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go index 3b0bba90791c..7d5b13369f7d 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protectioncontainers.go @@ -110,7 +110,7 @@ func (client ProtectionContainersClient) GetResponder(resp *http.Response) (resu return } -// Inquire inquires all the protectable items that are protectable under the given container. +// Inquire this is an async operation and the results should be tracked using location header or Azure-async-url. // Parameters: // vaultName - the name of the recovery services vault. // resourceGroupName - the name of the resource group where the recovery services vault is present. diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protectionintent.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectionintent.go index 424d4ab179e2..5fb2e259f7d0 100644 --- a/services/recoveryservices/mgmt/2017-07-01/backup/protectionintent.go +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protectionintent.go @@ -113,6 +113,149 @@ func (client ProtectionIntentClient) CreateOrUpdateResponder(resp *http.Response return } +// Delete used to remove intent from an item +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the intent. +// intentObjectName - intent to be deleted. +func (client ProtectionIntentClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result autorest.Response, err error) { + req, err := client.DeletePreparer(ctx, vaultName, resourceGroupName, fabricName, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProtectionIntentClient) DeletePreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionIntentClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProtectionIntentClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get provides the details of the protection intent up item. This is an asynchronous operation. To know the status of +// the operation, +// call the GetItemOperationResult API. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// fabricName - fabric name associated with the backed up item. +// intentObjectName - backed up item name whose details are to be fetched. +func (client ProtectionIntentClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (result ProtectionIntentResource, err error) { + req, err := client.GetPreparer(ctx, vaultName, resourceGroupName, fabricName, intentObjectName) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProtectionIntentClient) GetPreparer(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "fabricName": autorest.Encode("path", fabricName), + "intentObjectName": autorest.Encode("path", intentObjectName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionIntentClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProtectionIntentClient) GetResponder(resp *http.Response) (result ProtectionIntentResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Validate sends the validate request. // Parameters: // azureRegion - azure region to hit Api diff --git a/services/recoveryservices/mgmt/2017-07-01/backup/protectionintentgroup.go b/services/recoveryservices/mgmt/2017-07-01/backup/protectionintentgroup.go new file mode 100644 index 000000000000..03f84a8353cc --- /dev/null +++ b/services/recoveryservices/mgmt/2017-07-01/backup/protectionintentgroup.go @@ -0,0 +1,143 @@ +package backup + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ProtectionIntentGroupClient is the open API 2.0 Specs for Azure RecoveryServices Backup service +type ProtectionIntentGroupClient struct { + BaseClient +} + +// NewProtectionIntentGroupClient creates an instance of the ProtectionIntentGroupClient client. +func NewProtectionIntentGroupClient(subscriptionID string) ProtectionIntentGroupClient { + return NewProtectionIntentGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProtectionIntentGroupClientWithBaseURI creates an instance of the ProtectionIntentGroupClient client. +func NewProtectionIntentGroupClientWithBaseURI(baseURI string, subscriptionID string) ProtectionIntentGroupClient { + return ProtectionIntentGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List provides a pageable list of all intents that are present within a vault. +// Parameters: +// vaultName - the name of the recovery services vault. +// resourceGroupName - the name of the resource group where the recovery services vault is present. +// filter - oData filter options. +// skipToken - skipToken Filter. +func (client ProtectionIntentGroupClient) List(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectionIntentResourceListPage, err error) { + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, vaultName, resourceGroupName, filter, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentGroupClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pirl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentGroupClient", "List", resp, "Failure sending request") + return + } + + result.pirl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentGroupClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ProtectionIntentGroupClient) ListPreparer(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vaultName": autorest.Encode("path", vaultName), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ProtectionIntentGroupClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ProtectionIntentGroupClient) ListResponder(resp *http.Response) (result ProtectionIntentResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ProtectionIntentGroupClient) listNextResults(lastResults ProtectionIntentResourceList) (result ProtectionIntentResourceList, err error) { + req, err := lastResults.protectionIntentResourceListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "backup.ProtectionIntentGroupClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "backup.ProtectionIntentGroupClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "backup.ProtectionIntentGroupClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProtectionIntentGroupClient) ListComplete(ctx context.Context, vaultName string, resourceGroupName string, filter string, skipToken string) (result ProtectionIntentResourceListIterator, err error) { + result.page, err = client.List(ctx, vaultName, resourceGroupName, filter, skipToken) + return +}